remove trailing whitespace
[coreboot.git] / src / southbridge / amd / cimx / sb900 / AmdSbLib.h
1 /*
2  *****************************************************************************
3  *
4  * This file is part of the coreboot project.
5  *
6  * Copyright (C) 2011 Advanced Micro Devices, Inc.
7  *
8  * This program is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; version 2 of the License.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
20  * ***************************************************************************
21  *
22  */
23
24 #ifndef _AMD_SB_LIB_H_
25 #define _AMD_SB_LIB_H_
26
27 typedef signed char  *va_list;
28 #ifndef _INTSIZEOF
29   #define _INTSIZEOF (n) ( (sizeof (n) + sizeof (UINTN) - 1) & ~(sizeof (UINTN) - 1) )
30 #endif
31
32 // Also support coding convention rules for var arg macros
33 #ifndef va_start
34   #define va_start(ap, v)  ( ap = (va_list)&(v) + _INTSIZEOF (v) )
35 #endif
36 #define va_arg(ap, t)    ( *(t *) ((ap += _INTSIZEOF (t)) - _INTSIZEOF (t)) )
37 #define va_end(ap)      ( ap = (va_list)0 )
38
39
40 #pragma pack (push, 1)
41
42 #define IMAGE_ALIGN          32*1024
43 #define NUM_IMAGE_LOCATION   32
44
45 //Entry Point Call
46 typedef void (*CIM_IMAGE_ENTRY) (void* pConfig);
47
48 //Hook Call
49
50 typedef struct _CIMFILEHEADER
51 {
52   unsigned int  AMDLogo;
53   unsigned long long  CreatorID;
54   unsigned int  Version1;
55   unsigned int  Version2;
56   unsigned int  Version3;
57   unsigned int  ModuleInfoOffset;
58   unsigned int  EntryPoint;
59   unsigned int  ImageBase;
60   unsigned int  RelocTableOffset;
61   unsigned int  ImageSize;
62   unsigned short  CheckSum;
63   unsigned char ImageType;
64   unsigned char Reserved2;
65 } CIMFILEHEADER;
66
67 #ifndef BIT0
68   #define BIT0 (1 << 0)
69 #endif
70 #ifndef BIT1
71   #define BIT1 (1 << 1)
72 #endif
73 #ifndef BIT2
74   #define BIT2 (1 << 2)
75 #endif
76 #ifndef BIT3
77   #define BIT3 (1 << 3)
78 #endif
79 #ifndef BIT4
80   #define BIT4 (1 << 4)
81 #endif
82 #ifndef BIT5
83   #define BIT5 (1 << 5)
84 #endif
85 #ifndef BIT6
86   #define BIT6 (1 << 6)
87 #endif
88 #ifndef BIT7
89   #define BIT7 (1 << 7)
90 #endif
91 #ifndef BIT8
92   #define BIT8 (1 << 8)
93 #endif
94 #ifndef BIT9
95   #define BIT9 (1 << 9)
96 #endif
97 #ifndef BIT10
98   #define BIT10 (1 << 10)
99 #endif
100 #ifndef BIT11
101   #define BIT11 (1 << 11)
102 #endif
103 #ifndef BIT12
104   #define BIT12 (1 << 12)
105 #endif
106 #ifndef BIT13
107   #define BIT13 (1 << 13)
108 #endif
109 #ifndef BIT14
110   #define BIT14 (1 << 14)
111 #endif
112 #ifndef BIT15
113   #define BIT15 (1 << 15)
114 #endif
115 #ifndef BIT16
116   #define BIT16 (1 << 16)
117 #endif
118 #ifndef BIT17
119   #define BIT17 (1 << 17)
120 #endif
121 #ifndef BIT18
122   #define BIT18 (1 << 18)
123 #endif
124 #ifndef BIT19
125   #define BIT19 (1 << 19)
126 #endif
127 #ifndef BIT20
128   #define BIT20 (1 << 20)
129 #endif
130 #ifndef BIT21
131   #define BIT21 (1 << 21)
132 #endif
133 #ifndef BIT22
134   #define BIT22 (1 << 22)
135 #endif
136 #ifndef BIT23
137   #define BIT23 (1 << 23)
138 #endif
139 #ifndef  BIT24
140   #define BIT24 (1 << 24)
141 #endif
142 #ifndef BIT25
143   #define BIT25 (1 << 25)
144 #endif
145 #ifndef BIT26
146   #define BIT26 (1 << 26)
147 #endif
148 #ifndef BIT27
149   #define BIT27 (1 << 27)
150 #endif
151 #ifndef BIT28
152   #define BIT28 (1 << 28)
153 #endif
154 #ifndef BIT29
155   #define BIT29 (1 << 29)
156 #endif
157 #ifndef BIT30
158   #define BIT30 (1 << 30)
159 #endif
160 #ifndef BIT31
161   #define BIT31 (1 << 31)
162 #endif
163
164 #pragma pack (pop)
165
166 typedef enum
167 {
168   AccWidthUint8 = 0,
169   AccWidthUint16,
170   AccWidthUint32,
171 } ACC_WIDTH;
172
173 #define S3_SAVE  0x80
174
175 #endif