2 *****************************************************************************
\r
4 * This file is part of the coreboot project.
\r
6 * Copyright (C) 2010 Advanced Micro Devices, Inc.
\r
8 * This program is free software; you can redistribute it and/or modify
\r
9 * it under the terms of the GNU General Public License as published by
\r
10 * the Free Software Foundation; version 2 of the License.
\r
12 * This program is distributed in the hope that it will be useful,
\r
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
\r
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
\r
15 * GNU General Public License for more details.
\r
17 * You should have received a copy of the GNU General Public License
\r
18 * along with this program; if not, write to the Free Software
\r
19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
\r
20 * ***************************************************************************
\r
24 #ifndef _AMD_SB_LIB_H_
\r
25 #define _AMD_SB_LIB_H_
\r
27 typedef CHAR8 *va_list;
\r
29 #define _INTSIZEOF (n) ( (sizeof (n) + sizeof (UINTN) - 1) & ~(sizeof (UINTN) - 1) )
\r
32 // Also support coding convention rules for var arg macros
\r
34 #define va_start(ap, v) ( ap = (va_list)&(v) + _INTSIZEOF (v) )
\r
36 #define va_arg(ap, t) ( *(t *) ((ap += _INTSIZEOF (t)) - _INTSIZEOF (t)) )
\r
37 #define va_end(ap) ( ap = (va_list)0 )
\r
39 #pragma pack (push, 1)
\r
41 #define IMAGE_ALIGN 32*1024
\r
42 #define NUM_IMAGE_LOCATION 32
\r
45 typedef void (*CIM_IMAGE_ENTRY) (void* pConfig);
\r
49 typedef struct _CIMFILEHEADER
\r
56 UINT32 ModuleInfoOffset;
\r
59 UINT32 RelocTableOffset;
\r
67 #define BIT0 (1 << 0)
\r
70 #define BIT1 (1 << 1)
\r
73 #define BIT2 (1 << 2)
\r
76 #define BIT3 (1 << 3)
\r
79 #define BIT4 (1 << 4)
\r
82 #define BIT5 (1 << 5)
\r
85 #define BIT6 (1 << 6)
\r
88 #define BIT7 (1 << 7)
\r
91 #define BIT8 (1 << 8)
\r
94 #define BIT9 (1 << 9)
\r
97 #define BIT10 (1 << 10)
\r
100 #define BIT11 (1 << 11)
\r
103 #define BIT12 (1 << 12)
\r
106 #define BIT13 (1 << 13)
\r
109 #define BIT14 (1 << 14)
\r
112 #define BIT15 (1 << 15)
\r
115 #define BIT16 (1 << 16)
\r
118 #define BIT17 (1 << 17)
\r
121 #define BIT18 (1 << 18)
\r
124 #define BIT19 (1 << 19)
\r
127 #define BIT20 (1 << 20)
\r
130 #define BIT21 (1 << 21)
\r
133 #define BIT22 (1 << 22)
\r
136 #define BIT23 (1 << 23)
\r
139 #define BIT24 (1 << 24)
\r
142 #define BIT25 (1 << 25)
\r
145 #define BIT26 (1 << 26)
\r
148 #define BIT27 (1 << 27)
\r
151 #define BIT28 (1 << 28)
\r
154 #define BIT29 (1 << 29)
\r
157 #define BIT30 (1 << 30)
\r
160 #define BIT31 (1 << 31)
\r
172 #define S3_SAVE 0x80
\r