123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157 |
- #if !defined(__STDC_VERSION__) || (__STDC_VERSION__ < 199901L ) && !defined(__cplusplus)
- typedef unsigned long uint64_t;
- typedef long int64_t;
- typedef unsigned int uint32_t;
- typedef int int32_t;
- typedef unsigned short uint16_t;
- typedef short int16_t;
- typedef unsigned char uint8_t;
- typedef signed char int8_t;
- typedef uint64_t uintptr_t;
- typedef int64_t intptr_t;
- #else
- #include <stdint.h>
- #endif
- #ifndef __WCHAR_TYPE__
- # define __WCHAR_TYPE__ short
- #endif
- typedef uint64_t UINT64;
- typedef int64_t INT64;
- typedef uint32_t UINT32;
- typedef int32_t INT32;
- typedef uint16_t UINT16;
- typedef int16_t INT16;
- typedef uint8_t UINT8;
- typedef int8_t INT8;
- typedef __WCHAR_TYPE__ WCHAR;
- #undef VOID
- #define VOID void
- typedef int64_t INTN;
- typedef uint64_t UINTN;
- #define EFIERR(a) (0x8000000000000000 | a)
- #define EFI_ERROR_MASK 0x8000000000000000
- #define EFIERR_OEM(a) (0xc000000000000000 | a)
- #define BAD_POINTER 0xFBFBFBFBFBFBFBFB
- #define MAX_ADDRESS 0xFFFFFFFFFFFFFFFF
- #define BREAKPOINT() while (TRUE);
- #define MIN_ALIGNMENT_SIZE 8
- #define ALIGN_VARIABLE(Value ,Adjustment) \
- (UINTN)Adjustment = 0; \
- if((UINTN)Value % MIN_ALIGNMENT_SIZE) \
- (UINTN)Adjustment = MIN_ALIGNMENT_SIZE - ((UINTN)Value % MIN_ALIGNMENT_SIZE); \
- Value = (UINTN)Value + (UINTN)Adjustment
- #define EFI_SIGNATURE_16(A,B) ((A) | (B<<8))
- #define EFI_SIGNATURE_32(A,B,C,D) (EFI_SIGNATURE_16(A,B) | (EFI_SIGNATURE_16(C,D) << 16))
- #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))
- #ifndef EFIAPI
- #define EFIAPI
- #endif
- #define BOOTSERVICE
- #define RUNTIMESERVICE
- #define RUNTIMEFUNCTION
- #define RUNTIME_CODE(a) alloc_text("rtcode", a)
- #define BEGIN_RUNTIME_DATA() data_seg("rtdata")
- #define END_RUNTIME_DATA() data_seg("")
- #define VOLATILE volatile
- #define MEMORY_FENCE __sync_synchronize
- #define EFI_DRIVER_ENTRY_POINT(InitFunction) \
- UINTN \
- InitializeDriver ( \
- VOID *ImageHandle, \
- VOID *SystemTable \
- ) \
- { \
- return InitFunction(ImageHandle, \
- SystemTable); \
- } \
- \
- EFI_STATUS efi_main( \
- EFI_HANDLE image, \
- EFI_SYSTEM_TABLE *systab \
- ) __attribute__((weak, \
- alias ("InitializeDriver")));
- #define LOAD_INTERNAL_DRIVER(_if, type, name, entry) \
- (_if)->LoadInternal(type, name, entry)
- #define INTERFACE_DECL(x) struct x
- #define uefi_call_wrapper(func, va_num, ...) func(__VA_ARGS__)
- #define EFI_FUNCTION
|