aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/unisys/common-spar/include/channels/controlframework.h
blob: fd4726e754eae5edd9a47f2e43b4619f9f3428f8 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
/* Copyright (C) 2010 - 2013 UNISYS CORPORATION
 * All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or (at
 * your option) any later version.
 *
 * This program is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or
 * NON INFRINGEMENT.  See the GNU General Public License for more
 * details.
 */

/*
 * Module Name:
 *  controlframework.h
 *
 * Abstract: This file defines common structures in the unmanaged
 *	     Ultravisor (mostly EFI) space.
 *
 */

#ifndef _CONTROL_FRAMEWORK_H_
#define _CONTROL_FRAMEWORK_H_

#include <linux/types.h>
#include "channel.h"

#define ULTRA_MEMORY_COUNT_Ki 1024

/* Scale order 0 is one 32-bit (4-byte) word (in 64 or 128-bit
 * architecture potentially 64 or 128-bit word) */
#define ULTRA_MEMORY_PAGE_WORD 4

/* Define Ki scale page to be traditional 4KB page */
#define ULTRA_MEMORY_PAGE_Ki (ULTRA_MEMORY_PAGE_WORD * ULTRA_MEMORY_COUNT_Ki)
typedef struct _ULTRA_SEGMENT_STATE  {
	u16 Enabled:1;		/* Bit 0: May enter other states */
	u16 Active:1;		/* Bit 1: Assigned to active partition */
	u16 Alive:1;		/* Bit 2: Configure message sent to
				 * service/server */
	u16 Revoked:1;		/* Bit 3: similar to partition state
				 * ShuttingDown */
	u16 Allocated:1;	/* Bit 4: memory (device/port number)
				 * has been selected by Command */
	u16 Known:1;		/* Bit 5: has been introduced to the
				 * service/guest partition */
	u16 Ready:1;		/* Bit 6: service/Guest partition has
				 * responded to introduction */
	u16 Operating:1;	/* Bit 7: resource is configured and
				 * operating */
	/* Note: don't use high bit unless we need to switch to ushort
	 * which is non-compliant */
} ULTRA_SEGMENT_STATE;
static const ULTRA_SEGMENT_STATE SegmentStateRunning = {
	1, 1, 1, 0, 1, 1, 1, 1
};
static const ULTRA_SEGMENT_STATE SegmentStatePaused = {
	1, 1, 1, 0, 1, 1, 1, 0
};
static const ULTRA_SEGMENT_STATE SegmentStateStandby = {
	1, 1, 0, 0, 1, 1, 1, 0
};
typedef union {
	u64 Full;
	struct {
		u8 Major;	/* will be 1 for the first release and
				 * increment thereafter  */
		u8 Minor;
		u16 Maintenance;
		u32 Revision;	/* Subversion revision */
	} Part;
} ULTRA_COMPONENT_VERSION;

#endif				/* _CONTROL_FRAMEWORK_H_ not defined */