Linux 3.18-rc3
[cascardo/linux.git] / drivers / staging / unisys / common-spar / include / channels / controlframework.h
1 /* Copyright (C) 2010 - 2013 UNISYS CORPORATION
2  * All rights reserved.
3  *
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.
8  *
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
13  * details.
14  */
15
16 /*
17  * Module Name:
18  *  controlframework.h
19  *
20  * Abstract: This file defines common structures in the unmanaged
21  *           Ultravisor (mostly EFI) space.
22  *
23  */
24
25 #ifndef _CONTROL_FRAMEWORK_H_
26 #define _CONTROL_FRAMEWORK_H_
27
28 #include <linux/types.h>
29 #include "channel.h"
30
31 #define ULTRA_MEMORY_COUNT_Ki 1024
32
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
36
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
43                                  * service/server */
44         u16 Revoked:1;          /* Bit 3: similar to partition state
45                                  * ShuttingDown */
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
53                                  * operating */
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
59 };
60 static const ULTRA_SEGMENT_STATE SegmentStatePaused = {
61         1, 1, 1, 0, 1, 1, 1, 0
62 };
63 static const ULTRA_SEGMENT_STATE SegmentStateStandby = {
64         1, 1, 0, 0, 1, 1, 1, 0
65 };
66 typedef union {
67         u64 Full;
68         struct {
69                 u8 Major;       /* will be 1 for the first release and
70                                  * increment thereafter  */
71                 u8 Minor;
72                 u16 Maintenance;
73                 u32 Revision;   /* Subversion revision */
74         } Part;
75 } ULTRA_COMPONENT_VERSION;
76
77 #endif                          /* _CONTROL_FRAMEWORK_H_ not defined */