1 /* Copyright (C) 2010 - 2013 UNISYS CORPORATION
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or (at
7 * your option) any later version.
9 * This program is distributed in the hope that it will be useful, but
10 * WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or
12 * NON INFRINGEMENT. See the GNU General Public License for more
20 * Abstract: This file defines common structures in the unmanaged
21 * Ultravisor (mostly EFI) space.
25 #ifndef _CONTROL_FRAMEWORK_H_
26 #define _CONTROL_FRAMEWORK_H_
28 #include <linux/types.h>
31 #define ULTRA_MEMORY_COUNT_Ki 1024
33 /* Scale order 0 is one 32-bit (4-byte) word (in 64 or 128-bit
34 * architecture potentially 64 or 128-bit word) */
35 #define ULTRA_MEMORY_PAGE_WORD 4
37 /* Define Ki scale page to be traditional 4KB page */
38 #define ULTRA_MEMORY_PAGE_Ki (ULTRA_MEMORY_PAGE_WORD * ULTRA_MEMORY_COUNT_Ki)
39 typedef struct _ULTRA_SEGMENT_STATE {
40 u16 Enabled:1; /* Bit 0: May enter other states */
41 u16 Active:1; /* Bit 1: Assigned to active partition */
42 u16 Alive:1; /* Bit 2: Configure message sent to
44 u16 Revoked:1; /* Bit 3: similar to partition state
46 u16 Allocated:1; /* Bit 4: memory (device/port number)
47 * has been selected by Command */
48 u16 Known:1; /* Bit 5: has been introduced to the
49 * service/guest partition */
50 u16 Ready:1; /* Bit 6: service/Guest partition has
51 * responded to introduction */
52 u16 Operating:1; /* Bit 7: resource is configured and
54 /* Note: don't use high bit unless we need to switch to ushort
55 * which is non-compliant */
56 } ULTRA_SEGMENT_STATE;
57 static const ULTRA_SEGMENT_STATE SegmentStateRunning = {
58 1, 1, 1, 0, 1, 1, 1, 1
60 static const ULTRA_SEGMENT_STATE SegmentStatePaused = {
61 1, 1, 1, 0, 1, 1, 1, 0
63 static const ULTRA_SEGMENT_STATE SegmentStateStandby = {
64 1, 1, 0, 0, 1, 1, 1, 0
69 u8 Major; /* will be 1 for the first release and
70 * increment thereafter */
73 u32 Revision; /* Subversion revision */
75 } ULTRA_COMPONENT_VERSION;
77 #endif /* _CONTROL_FRAMEWORK_H_ not defined */