2 *****************************************************************************
4 * This file is part of the coreboot project.
6 * Copyright (C) 2011 Advanced Micro Devices, Inc.
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.
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.
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 * ***************************************************************************
24 #ifndef _AMD_SB_LIB_H_
25 #define _AMD_SB_LIB_H_
27 typedef signed char *va_list;
29 #define _INTSIZEOF (n) ( (sizeof (n) + sizeof (UINTN) - 1) & ~(sizeof (UINTN) - 1) )
32 // Also support coding convention rules for var arg macros
34 #define va_start(ap, v) ( ap = (va_list)&(v) + _INTSIZEOF (v) )
36 #define va_arg(ap, t) ( *(t *) ((ap += _INTSIZEOF (t)) - _INTSIZEOF (t)) )
37 #define va_end(ap) ( ap = (va_list)0 )
40 #pragma pack (push, 1)
42 #define IMAGE_ALIGN 32*1024
43 #define NUM_IMAGE_LOCATION 32
46 typedef void (*CIM_IMAGE_ENTRY) (void* pConfig);
50 typedef struct _CIMFILEHEADER
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;
98 #define BIT10 (1 << 10)
101 #define BIT11 (1 << 11)
104 #define BIT12 (1 << 12)
107 #define BIT13 (1 << 13)
110 #define BIT14 (1 << 14)
113 #define BIT15 (1 << 15)
116 #define BIT16 (1 << 16)
119 #define BIT17 (1 << 17)
122 #define BIT18 (1 << 18)
125 #define BIT19 (1 << 19)
128 #define BIT20 (1 << 20)
131 #define BIT21 (1 << 21)
134 #define BIT22 (1 << 22)
137 #define BIT23 (1 << 23)
140 #define BIT24 (1 << 24)
143 #define BIT25 (1 << 25)
146 #define BIT26 (1 << 26)
149 #define BIT27 (1 << 27)
152 #define BIT28 (1 << 28)
155 #define BIT29 (1 << 29)
158 #define BIT30 (1 << 30)
161 #define BIT31 (1 << 31)