File indexing completed on 2025-05-11 08:24:05
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028 #pragma pack()
0029
0030
0031 #ifdef __FreeBSD__
0032 #include <sys/stdint.h>
0033 #elif __rtems__
0034 #include <stdint.h>
0035 #else
0036
0037
0038
0039
0040 #if (__STDC_VERSION__ < 199901L )
0041
0042
0043
0044 #ifdef _MSC_EXTENSIONS
0045
0046
0047
0048 typedef unsigned __int64 uint64_t;
0049 typedef __int64 int64_t;
0050 typedef unsigned __int32 uint32_t;
0051 typedef __int32 int32_t;
0052 typedef unsigned short uint16_t;
0053 typedef short int16_t;
0054 typedef unsigned char uint8_t;
0055 typedef char int8_t;
0056 #else
0057 #ifdef UNIX_LP64
0058
0059
0060
0061 typedef unsigned long uint64_t;
0062 typedef long int64_t;
0063 typedef unsigned int uint32_t;
0064 typedef int int32_t;
0065 typedef unsigned short uint16_t;
0066 typedef short int16_t;
0067 typedef unsigned char uint8_t;
0068 typedef char int8_t;
0069 #else
0070
0071
0072
0073 typedef unsigned long long uint64_t;
0074 typedef long long int64_t;
0075 typedef unsigned int uint32_t;
0076 typedef int int32_t;
0077 typedef unsigned short uint16_t;
0078 typedef short int16_t;
0079 typedef unsigned char uint8_t;
0080 typedef char int8_t;
0081 #endif
0082 #endif
0083 #endif
0084 #endif
0085
0086
0087
0088
0089
0090 #ifndef ACPI_THREAD_ID
0091 #define ACPI_USE_SYSTEM_INTTYPES 1
0092
0093 typedef uint64_t UINT64;
0094 typedef int64_t INT64;
0095
0096 #ifndef _BASETSD_H_
0097 typedef uint32_t UINT32;
0098 typedef int32_t INT32;
0099 #endif
0100
0101 typedef uint16_t UINT16;
0102 typedef int16_t INT16;
0103 typedef uint8_t UINT8;
0104 typedef int8_t INT8;
0105
0106 #endif
0107
0108 #undef VOID
0109 #define VOID void
0110
0111
0112 typedef int64_t INTN;
0113 typedef uint64_t UINTN;
0114
0115 #ifdef EFI_NT_EMULATOR
0116 #define POST_CODE(_Data)
0117 #else
0118 #ifdef EFI_DEBUG
0119 #define POST_CODE(_Data) __asm mov eax,(_Data) __asm out 0x80,al
0120 #else
0121 #define POST_CODE(_Data)
0122 #endif
0123 #endif
0124
0125 #define EFIERR(a) (0x8000000000000000 | a)
0126 #define EFI_ERROR_MASK 0x8000000000000000
0127 #define EFIERR_OEM(a) (0xc000000000000000 | a)
0128
0129
0130 #define BAD_POINTER 0xFBFBFBFBFBFBFBFB
0131 #define MAX_ADDRESS 0xFFFFFFFFFFFFFFFF
0132
0133 #define BREAKPOINT() __asm { int 3 }
0134
0135
0136
0137
0138
0139 #define MIN_ALIGNMENT_SIZE 4
0140
0141 #define ALIGN_VARIABLE(Value ,Adjustment) \
0142 (UINTN)Adjustment = 0; \
0143 if((UINTN)Value % MIN_ALIGNMENT_SIZE) \
0144 (UINTN)Adjustment = MIN_ALIGNMENT_SIZE - ((UINTN)Value % MIN_ALIGNMENT_SIZE); \
0145 Value = (UINTN)Value + (UINTN)Adjustment
0146
0147
0148
0149
0150
0151
0152 #define EFI_SIGNATURE_16(A,B) ((A) | (B<<8))
0153 #define EFI_SIGNATURE_32(A,B,C,D) (EFI_SIGNATURE_16(A,B) | (EFI_SIGNATURE_16(C,D) << 16))
0154 #define EFI_SIGNATURE_64(A,B,C,D,E,F,G,H) (EFI_SIGNATURE_32(A,B,C,D) | ((UINT64)(EFI_SIGNATURE_32(E,F,G,H)) << 32))
0155
0156
0157
0158
0159
0160
0161
0162
0163
0164 #ifdef __amd64__
0165 #define EFIAPI __attribute__((ms_abi))
0166 #endif
0167
0168 #ifndef EFIAPI
0169 #ifdef _MSC_EXTENSIONS
0170 #define EFIAPI __cdecl
0171 #else
0172 #define EFIAPI
0173 #endif
0174 #endif
0175
0176 #define BOOTSERVICE
0177
0178
0179 #define RUNTIMESERVICE
0180 #define RUNTIMEFUNCTION
0181
0182
0183 #define RUNTIME_CODE(a) alloc_text("rtcode", a)
0184 #define BEGIN_RUNTIME_DATA() data_seg("rtdata")
0185 #define END_RUNTIME_DATA() data_seg("")
0186
0187 #define VOLATILE volatile
0188
0189 #define MEMORY_FENCE()
0190
0191 #ifdef EFI_NO_INTERFACE_DECL
0192 #define EFI_FORWARD_DECLARATION(x)
0193 #define EFI_INTERFACE_DECL(x)
0194 #else
0195 #define EFI_FORWARD_DECLARATION(x) typedef struct _##x x
0196 #define EFI_INTERFACE_DECL(x) typedef struct x
0197 #endif
0198
0199 #ifdef EFI_NT_EMULATOR
0200
0201
0202
0203
0204
0205
0206
0207 #define EFI_DRIVER_ENTRY_POINT(InitFunction) \
0208 EFI_STATUS \
0209 InitFunction ( \
0210 EFI_HANDLE ImageHandle, \
0211 EFI_SYSTEM_TABLE *SystemTable \
0212 ); \
0213 \
0214 UINTN \
0215 __stdcall \
0216 _DllMainCRTStartup ( \
0217 UINTN Inst, \
0218 UINTN reason_for_call, \
0219 VOID *rserved \
0220 ) \
0221 { \
0222 return 1; \
0223 } \
0224 \
0225 int \
0226 __declspec( dllexport ) \
0227 __cdecl \
0228 InitializeDriver ( \
0229 void *ImageHandle, \
0230 void *SystemTable \
0231 ) \
0232 { \
0233 return InitFunction(ImageHandle, SystemTable); \
0234 }
0235
0236
0237 #define LOAD_INTERNAL_DRIVER(_if, type, name, entry) \
0238 (_if)->LoadInternal(type, name, NULL)
0239
0240 #else
0241
0242
0243
0244
0245
0246
0247 #define EFI_DRIVER_ENTRY_POINT(InitFunction)
0248
0249 #define LOAD_INTERNAL_DRIVER(_if, type, name, entry) \
0250 (_if)->LoadInternal(type, name, entry)
0251
0252 #endif
0253
0254 #ifdef __FreeBSD__
0255 #define INTERFACE_DECL(x) struct x
0256 #elif __rtems__
0257 #define INTERFACE_DECL(x) struct x
0258 #else
0259
0260
0261
0262
0263
0264
0265 #ifdef NO_INTERFACE_DECL
0266 #define INTERFACE_DECL(x)
0267 #else
0268 #define INTERFACE_DECL(x) typedef struct x
0269 #endif
0270 #endif
0271
0272 #ifdef _MSC_EXTENSIONS
0273 #pragma warning ( disable : 4731 )
0274 #endif
0275