From 513b799db3d25c5a6b16968bd07a24f5f2e5dfbf Mon Sep 17 00:00:00 2001 From: nifanfa Date: Wed, 1 Feb 2023 19:00:19 +0800 Subject: [PATCH] Update efi constants --- .../CompilerHelpers/StartupCodeHelpers.cs | 2 +- CoreLib/System/Runtime/InternalCalls.cs | 12 + CoreLib/System/Runtime/RuntimeExports.cs | 6 +- CoreLib/System/Runtime/RuntimeImports.cs | 2 +- CoreLib/System/String.cs | 2 +- uefi-cs/efi.cs | 901 +++++++++++++++++- uefi-cs/efiapi.cs | 31 - uefi-cs/efierr.cs | 35 - uefi-cs/efiprot.cs | 17 - 9 files changed, 900 insertions(+), 108 deletions(-) diff --git a/CoreLib/Internal/Runtime/CompilerHelpers/StartupCodeHelpers.cs b/CoreLib/Internal/Runtime/CompilerHelpers/StartupCodeHelpers.cs index 5278559..6ac66e6 100644 --- a/CoreLib/Internal/Runtime/CompilerHelpers/StartupCodeHelpers.cs +++ b/CoreLib/Internal/Runtime/CompilerHelpers/StartupCodeHelpers.cs @@ -51,7 +51,7 @@ static unsafe void InitializeStatics(IntPtr rgnStart, IntPtr rgnEnd) IntPtr pPreInitDataAddr = *(pBlock + 1); fixed (byte* p = &obj.GetRawData()) { - memcpy(p, (byte*)pPreInitDataAddr, obj.GetRawDataSize()); + InternalCalls.memcpy(p, (byte*)pPreInitDataAddr, obj.GetRawDataSize()); } } diff --git a/CoreLib/System/Runtime/InternalCalls.cs b/CoreLib/System/Runtime/InternalCalls.cs index 69c253e..f972c1c 100644 --- a/CoreLib/System/Runtime/InternalCalls.cs +++ b/CoreLib/System/Runtime/InternalCalls.cs @@ -135,6 +135,18 @@ internal static int RhEndNoGCRegion() internal static extern IntPtr RhHandleSet(IntPtr handle, object value); */ + [RuntimeExport("memset")] + public static unsafe void memset(byte* ptr, byte c, ulong count) + { + for (ulong i = 0; i < count; i++) ptr[i] = c; + } + + [RuntimeExport("memcpy")] + public static unsafe void memcpy(byte* dst, byte* src, ulong count) + { + for (ulong i = 0; i < count; i++) dst[i] = src[i]; + } + // // internal calls for allocation // diff --git a/CoreLib/System/Runtime/RuntimeExports.cs b/CoreLib/System/Runtime/RuntimeExports.cs index 3dec927..946cd7d 100644 --- a/CoreLib/System/Runtime/RuntimeExports.cs +++ b/CoreLib/System/Runtime/RuntimeExports.cs @@ -140,7 +140,7 @@ public static unsafe object RhBox(EEType* pEEType, ref byte data) { fixed (byte* pFields = &result.GetRawData()) fixed (byte* pData = &dataAdjustedForNullable) - efi.memcpy(pFields, pData, pEEType->ValueTypeSize); + InternalCalls.memcpy(pFields, pData, pEEType->ValueTypeSize); } return result; @@ -266,7 +266,7 @@ public static unsafe void RhUnbox(object obj, ref byte data, EEType* pUnboxToEET // Set HasValue to false and clear the value (in case there were GC references we wish to stop reporting). fixed (byte* pdata = &data) - efi.memset(pdata, 0, pUnboxToEEType->ValueTypeSize); + InternalCalls.memset(pdata, 0, pUnboxToEEType->ValueTypeSize); /* InternalCalls.RhpInitMultibyte( ref data, @@ -308,7 +308,7 @@ public static unsafe void RhUnbox(object obj, ref byte data, EEType* pUnboxToEET // Copy the boxed fields into the new location. fixed (byte* pData = &data) fixed (byte* pFields = &fields) - efi.memcpy(pData, pFields, pEEType->ValueTypeSize); + InternalCalls.memcpy(pData, pFields, pEEType->ValueTypeSize); } } diff --git a/CoreLib/System/Runtime/RuntimeImports.cs b/CoreLib/System/Runtime/RuntimeImports.cs index 752b741..3ad63fb 100644 --- a/CoreLib/System/Runtime/RuntimeImports.cs +++ b/CoreLib/System/Runtime/RuntimeImports.cs @@ -46,7 +46,7 @@ internal static unsafe void RhBulkMoveWithWriteBarrier(ref byte dmem, ref byte s { fixed (byte* pdst = &dmem) fixed (byte* psrc = &smem) - efi.memcpy(pdst, psrc, size); + InternalCalls.memcpy(pdst, psrc, size); } /* diff --git a/CoreLib/System/String.cs b/CoreLib/System/String.cs index 4b2d5c6..6b9e612 100644 --- a/CoreLib/System/String.cs +++ b/CoreLib/System/String.cs @@ -81,7 +81,7 @@ public static unsafe string Ctor(char* ptr, int index, int length) fixed (char* c = &s._firstChar) { - memcpy((byte*)c, (byte*)start, (ulong)length * sizeof(char)); + InternalCalls.memcpy((byte*)c, (byte*)start, (ulong)length * sizeof(char)); c[length] = '\0'; } diff --git a/uefi-cs/efi.cs b/uefi-cs/efi.cs index 78ea506..74aaefa 100644 --- a/uefi-cs/efi.cs +++ b/uefi-cs/efi.cs @@ -1,6 +1,5 @@ using Internal.Runtime.CompilerHelpers; using System; -using System.Runtime; public unsafe partial class efi { @@ -8,12 +7,6 @@ public unsafe partial class efi static IntPtr _BS; static IntPtr _RT; - public static EFI_SYSTEM_TABLE* gST => (EFI_SYSTEM_TABLE*)_ST; - public static EFI_BOOT_SERVICES* gBS => (EFI_BOOT_SERVICES*)_BS; - public static EFI_RUNTIME_SERVICES* gRT => (EFI_RUNTIME_SERVICES*)_RT; - - public static EFI_HANDLE gImageHandle; - public static void InitializeLib(EFI_HANDLE imageHandle, EFI_SYSTEM_TABLE* systemTable) { efi._ST = (IntPtr)systemTable; @@ -36,6 +29,888 @@ public static void InitializeLib(EFI_HANDLE imageHandle, EFI_SYSTEM_TABLE* syste StartupCodeHelpers.InitializeModules(moduleSec); } + public static EFI_SYSTEM_TABLE* gST => (EFI_SYSTEM_TABLE*)_ST; + public static EFI_BOOT_SERVICES* gBS => (EFI_BOOT_SERVICES*)_BS; + public static EFI_RUNTIME_SERVICES* gRT => (EFI_RUNTIME_SERVICES*)_RT; + + public static EFI_HANDLE gImageHandle; + public static int END_DEVICE_PATH_LENGTH => (sizeof(EFI_DEVICE_PATH_PROTOCOL)); + + public const ulong EFI_FIRMWARE_MAJOR_REVISION = 12; + public const ulong EFI_FIRMWARE_MINOR_REVISION = 33; + public const ulong EFI_FIRMWARE_REVISION = ((EFI_FIRMWARE_MAJOR_REVISION << 16) | (EFI_FIRMWARE_MINOR_REVISION)); + public const ulong EFI_SPECIFICATION_MAJOR_REVISION = 1; + public const ulong EFI_SPECIFICATION_MINOR_REVISION = 02; + public const ulong EFI_OPTIONAL_PTR = 0x00000001; + public const ulong EFI_INTERNAL_FNC = 0x00000002; // Pointer to internal runtime fnc + public const ulong EFI_INTERNAL_PTR = 0x00000004; // Pointer to internal runtime data + public const ulong EVT_TIMER = 0x80000000; + public const ulong EVT_RUNTIME = 0x40000000; + public const ulong EVT_RUNTIME_CONTEXT = 0x20000000; + public const ulong EVT_NOTIFY_WAIT = 0x00000100; + public const uint EVT_NOTIFY_SIGNAL = 0x00000200; + public const ulong EVT_SIGNAL_EXIT_BOOT_SERVICES = 0x00000201; + public const ulong EVT_SIGNAL_VIRTUAL_ADDRESS_CHANGE = 0x60000202; + public const ulong EVT_EFI_SIGNAL_MASK = 0x000000FF; + public const ulong EVT_EFI_SIGNAL_MAX = 4; + public const ulong EFI_EVENT_TIMER = EVT_TIMER; + public const ulong EFI_EVENT_RUNTIME = EVT_RUNTIME; + public const ulong EFI_EVENT_RUNTIME_CONTEXT = EVT_RUNTIME_CONTEXT; + public const ulong EFI_EVENT_NOTIFY_WAIT = EVT_NOTIFY_WAIT; + public const ulong EFI_EVENT_NOTIFY_SIGNAL = EVT_NOTIFY_SIGNAL; + public const ulong EFI_EVENT_SIGNAL_EXIT_BOOT_SERVICES = EVT_SIGNAL_EXIT_BOOT_SERVICES; + public const ulong EFI_EVENT_SIGNAL_VIRTUAL_ADDRESS_CHANGE = EVT_SIGNAL_VIRTUAL_ADDRESS_CHANGE; + public const ulong EFI_EVENT_EFI_SIGNAL_MASK = EVT_EFI_SIGNAL_MASK; + public const ulong EFI_EVENT_EFI_SIGNAL_MAX = EVT_EFI_SIGNAL_MAX; + public const ulong TPL_APPLICATION = 4; + public const ulong TPL_CALLBACK = 8; + public const ulong TPL_NOTIFY = 16; + public const ulong TPL_HIGH_LEVEL = 31; + public const ulong EFI_TPL_APPLICATION = TPL_APPLICATION; + public const ulong EFI_TPL_CALLBACK = TPL_CALLBACK; + public const ulong EFI_TPL_NOTIFY = TPL_NOTIFY; + public const ulong EFI_TPL_HIGH_LEVEL = TPL_HIGH_LEVEL; + public const ulong EFI_VARIABLE_NON_VOLATILE = 0x00000001; + public const ulong EFI_VARIABLE_BOOTSERVICE_ACCESS = 0x00000002; + public const ulong EFI_VARIABLE_RUNTIME_ACCESS = 0x00000004; + public const ulong EFI_VARIABLE_HARDWARE_ERROR_RECORD = 0x00000008; + public const ulong EFI_VARIABLE_AUTHENTICATED_WRITE_ACCESS = 0x00000010; + public const ulong EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS = 0x00000020; + public const ulong EFI_VARIABLE_APPEND_WRITE = 0x00000040; + public const ulong EFI_MAXIMUM_VARIABLE_SIZE = 1024; + public const ulong IMAGE_SUBSYSTEM_EFI_APPLICATION = 10; + public const ulong IMAGE_SUBSYSTEM_EFI_BOOT_SERVICE_DRIVER = 11; + public const ulong IMAGE_SUBSYSTEM_EFI_RUNTIME_DRIVER = 12; + public const ulong EFI_IMAGE_MACHINE_IA32 = 0x014c; + public const ulong EFI_IMAGE_MACHINE_IA64 = 0x0200; + public const ulong EFI_IMAGE_MACHINE_EBC = 0x0EBC; + public const ulong EFI_IMAGE_MACHINE_X64 = 0x8664; + public const ulong EFI_IMAGE_MACHINE_ARMTHUMB_MIXED = 0x01C2; + public const ulong EFI_IMAGE_MACHINE_AARCH64 = 0xAA64; + public const ulong EFI_IMAGE_MACHINE_RISCV32 = 0x5032; + public const ulong EFI_IMAGE_MACHINE_RISCV64 = 0x5064; + public const ulong EFI_IMAGE_MACHINE_RISCV128 = 0x5128; + public const ulong EFI_IMAGE_INFORMATION_REVISION = 0x1000; + public const ulong EFI_OPEN_PROTOCOL_BY_HANDLE_PROTOCOL = 0x00000001; + public const uint EFI_OPEN_PROTOCOL_GET_PROTOCOL = 0x00000002; + public const ulong EFI_OPEN_PROTOCOL_TEST_PROTOCOL = 0x00000004; + public const ulong EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER = 0x00000008; + public const ulong EFI_OPEN_PROTOCOL_BY_DRIVER = 0x00000010; + public const ulong EFI_OPEN_PROTOCOL_EXCLUSIVE = 0x00000020; + public const ulong CAPSULE_FLAGS_PERSIST_ACROSS_RESET = 0x00010000; + public const ulong CAPSULE_FLAGS_POPULATE_SYSTEM_TABLE = 0x00020000; + public const ulong CAPSULE_FLAGS_INITIATE_RESET = 0x00040000; + public const ulong EFI_RUNTIME_SERVICES_SIGNATURE = 0x56524553544e5552; + public const ulong EFI_RUNTIME_SERVICES_REVISION = (EFI_SPECIFICATION_MAJOR_REVISION << 16) | (EFI_SPECIFICATION_MINOR_REVISION); + public const ulong EFI_BOOT_SERVICES_SIGNATURE = 0x56524553544f4f42; + public const ulong EFI_BOOT_SERVICES_REVISION = (EFI_SPECIFICATION_MAJOR_REVISION << 16) | (EFI_SPECIFICATION_MINOR_REVISION); + public const ulong EFI_SYSTEM_TABLE_SIGNATURE = 0x5453595320494249; + public const ulong EFI_SYSTEM_TABLE_REVISION = (EFI_SPECIFICATION_MAJOR_REVISION << 16) | (EFI_SPECIFICATION_MINOR_REVISION); + public const ulong EFI_BLACK = 0x00; + public const ulong EFI_BLUE = 0x01; + public const ulong EFI_GREEN = 0x02; + public const ulong EFI_CYAN = (EFI_BLUE | EFI_GREEN); + public const ulong EFI_RED = 0x04; + public const ulong EFI_MAGENTA = (EFI_BLUE | EFI_RED); + public const ulong EFI_BROWN = (EFI_GREEN | EFI_RED); + public const ulong EFI_LIGHTGRAY = (EFI_BLUE | EFI_GREEN | EFI_RED); + public const ulong EFI_BRIGHT = 0x08; + public const ulong EFI_DARKGRAY = (EFI_BRIGHT); + public const ulong EFI_LIGHTBLUE = (EFI_BLUE | EFI_BRIGHT); + public const ulong EFI_LIGHTGREEN = (EFI_GREEN | EFI_BRIGHT); + public const ulong EFI_LIGHTCYAN = (EFI_CYAN | EFI_BRIGHT); + public const ulong EFI_LIGHTRED = (EFI_RED | EFI_BRIGHT); + public const ulong EFI_LIGHTMAGENTA = (EFI_MAGENTA | EFI_BRIGHT); + public const ulong EFI_YELLOW = (EFI_BROWN | EFI_BRIGHT); + public const ulong EFI_WHITE = (EFI_BLUE | EFI_GREEN | EFI_RED | EFI_BRIGHT); + public const ulong EFI_BACKGROUND_BLACK = 0x00; + public const ulong EFI_BACKGROUND_BLUE = 0x10; + public const ulong EFI_BACKGROUND_GREEN = 0x20; + public const ulong EFI_BACKGROUND_CYAN = (EFI_BACKGROUND_BLUE | EFI_BACKGROUND_GREEN); + public const ulong EFI_BACKGROUND_RED = 0x40; + public const ulong EFI_BACKGROUND_MAGENTA = (EFI_BACKGROUND_BLUE | EFI_BACKGROUND_RED); + public const ulong EFI_BACKGROUND_BROWN = (EFI_BACKGROUND_GREEN | EFI_BACKGROUND_RED); + public const ulong EFI_BACKGROUND_LIGHTGRAY = (EFI_BACKGROUND_BLUE | EFI_BACKGROUND_GREEN | EFI_BACKGROUND_RED); + public const ulong BOXDRAW_HORIZONTAL = 0x2500; + public const ulong BOXDRAW_VERTICAL = 0x2502; + public const ulong BOXDRAW_DOWN_RIGHT = 0x250c; + public const ulong BOXDRAW_DOWN_LEFT = 0x2510; + public const ulong BOXDRAW_UP_RIGHT = 0x2514; + public const ulong BOXDRAW_UP_LEFT = 0x2518; + public const ulong BOXDRAW_VERTICAL_RIGHT = 0x251c; + public const ulong BOXDRAW_VERTICAL_LEFT = 0x2524; + public const ulong BOXDRAW_DOWN_HORIZONTAL = 0x252c; + public const ulong BOXDRAW_UP_HORIZONTAL = 0x2534; + public const ulong BOXDRAW_VERTICAL_HORIZONTAL = 0x253c; + public const ulong BOXDRAW_DOUBLE_HORIZONTAL = 0x2550; + public const ulong BOXDRAW_DOUBLE_VERTICAL = 0x2551; + public const ulong BOXDRAW_DOWN_RIGHT_DOUBLE = 0x2552; + public const ulong BOXDRAW_DOWN_DOUBLE_RIGHT = 0x2553; + public const ulong BOXDRAW_DOUBLE_DOWN_RIGHT = 0x2554; + public const ulong BOXDRAW_DOWN_LEFT_DOUBLE = 0x2555; + public const ulong BOXDRAW_DOWN_DOUBLE_LEFT = 0x2556; + public const ulong BOXDRAW_DOUBLE_DOWN_LEFT = 0x2557; + public const ulong BOXDRAW_UP_RIGHT_DOUBLE = 0x2558; + public const ulong BOXDRAW_UP_DOUBLE_RIGHT = 0x2559; + public const ulong BOXDRAW_DOUBLE_UP_RIGHT = 0x255a; + public const ulong BOXDRAW_UP_LEFT_DOUBLE = 0x255b; + public const ulong BOXDRAW_UP_DOUBLE_LEFT = 0x255c; + public const ulong BOXDRAW_DOUBLE_UP_LEFT = 0x255d; + public const ulong BOXDRAW_VERTICAL_RIGHT_DOUBLE = 0x255e; + public const ulong BOXDRAW_VERTICAL_DOUBLE_RIGHT = 0x255f; + public const ulong BOXDRAW_DOUBLE_VERTICAL_RIGHT = 0x2560; + public const ulong BOXDRAW_VERTICAL_LEFT_DOUBLE = 0x2561; + public const ulong BOXDRAW_VERTICAL_DOUBLE_LEFT = 0x2562; + public const ulong BOXDRAW_DOUBLE_VERTICAL_LEFT = 0x2563; + public const ulong BOXDRAW_DOWN_HORIZONTAL_DOUBLE = 0x2564; + public const ulong BOXDRAW_DOWN_DOUBLE_HORIZONTAL = 0x2565; + public const ulong BOXDRAW_DOUBLE_DOWN_HORIZONTAL = 0x2566; + public const ulong BOXDRAW_UP_HORIZONTAL_DOUBLE = 0x2567; + public const ulong BOXDRAW_UP_DOUBLE_HORIZONTAL = 0x2568; + public const ulong BOXDRAW_DOUBLE_UP_HORIZONTAL = 0x2569; + public const ulong BOXDRAW_VERTICAL_HORIZONTAL_DOUBLE = 0x256a; + public const ulong BOXDRAW_VERTICAL_DOUBLE_HORIZONTAL = 0x256b; + public const ulong BOXDRAW_DOUBLE_VERTICAL_HORIZONTAL = 0x256c; + public const ulong BLOCKELEMENT_FULL_BLOCK = 0x2588; + public const ulong BLOCKELEMENT_LIGHT_SHADE = 0x2591; + public const ulong GEOMETRICSHAPE_UP_TRIANGLE = 0x25b2; + public const ulong GEOMETRICSHAPE_RIGHT_TRIANGLE = 0x25ba; + public const ulong GEOMETRICSHAPE_DOWN_TRIANGLE = 0x25bc; + public const ulong GEOMETRICSHAPE_LEFT_TRIANGLE = 0x25c4; + public const ulong ARROW_UP = 0x2191; + public const ulong ARROW_DOWN = 0x2193; + public const ulong CHAR_NULL = 0x0000; + public const ulong CHAR_BACKSPACE = 0x0008; + public const ulong CHAR_TAB = 0x0009; + public const ulong CHAR_LINEFEED = 0x000A; + public const ulong CHAR_CARRIAGE_RETURN = 0x000D; + public const ulong SCAN_NULL = 0x0000; + public const ulong SCAN_UP = 0x0001; + public const ulong SCAN_DOWN = 0x0002; + public const ulong SCAN_RIGHT = 0x0003; + public const ulong SCAN_LEFT = 0x0004; + public const ulong SCAN_HOME = 0x0005; + public const ulong SCAN_END = 0x0006; + public const ulong SCAN_INSERT = 0x0007; + public const ulong SCAN_DELETE = 0x0008; + public const ulong SCAN_PAGE_UP = 0x0009; + public const ulong SCAN_PAGE_DOWN = 0x000A; + public const ulong SCAN_F1 = 0x000B; + public const ulong SCAN_F2 = 0x000C; + public const ulong SCAN_F3 = 0x000D; + public const ulong SCAN_F4 = 0x000E; + public const ulong SCAN_F5 = 0x000F; + public const ulong SCAN_F6 = 0x0010; + public const ulong SCAN_F7 = 0x0011; + public const ulong SCAN_F8 = 0x0012; + public const ulong SCAN_F9 = 0x0013; + public const ulong SCAN_F10 = 0x0014; + public const ulong SCAN_F11 = 0x0015; + public const ulong SCAN_F12 = 0x0016; + public const ulong SCAN_ESC = 0x0017; + public const ulong EFI_SHIFT_STATE_VALID = 0x80000000; + public const ulong EFI_RIGHT_SHIFT_PRESSED = 0x00000001; + public const ulong EFI_LEFT_SHIFT_PRESSED = 0x00000002; + public const ulong EFI_RIGHT_CONTROL_PRESSED = 0x00000004; + public const ulong EFI_LEFT_CONTROL_PRESSED = 0x00000008; + public const ulong EFI_RIGHT_ALT_PRESSED = 0x00000010; + public const ulong EFI_LEFT_ALT_PRESSED = 0x00000020; + public const ulong EFI_RIGHT_LOGO_PRESSED = 0x00000040; + public const ulong EFI_LEFT_LOGO_PRESSED = 0x00000080; + public const ulong EFI_MENU_KEY_PRESSED = 0x00000100; + public const ulong EFI_SYS_REQ_PRESSED = 0x00000200; + public const ulong EFI_TOGGLE_STATE_VALID = 0x80; + public const ulong EFI_KEY_STATE_EXPOSED = 0x40; + public const ulong EFI_SCROLL_LOCK_ACTIVE = 0x01; + public const ulong EFI_NUM_LOCK_ACTIVE = 0x02; + public const ulong EFI_CAPS_LOCK_ACTIVE = 0x04; + public const ulong D_INIT = 0x00000001; // Initialization style messages + public const ulong D_WARN = 0x00000002; // Warnings + public const ulong D_LOAD = 0x00000004; // Load events + public const ulong D_FS = 0x00000008; // EFI File system + public const ulong D_INFO = 0x00000040; // Verbose + public const ulong D_VAR = 0x00000100; // Variable + public const ulong D_PARSE = 0x00000200; // Command parsing + public const ulong D_BM = 0x00000400; // Boot manager + public const ulong D_BLKIO = 0x00001000; // BlkIo Driver + public const ulong D_BLKIO_ULTRA = 0x00002000; // BlkIo Driver + public const ulong D_NET = 0x00004000; // SNI Driver + public const ulong D_NET_ULTRA = 0x00008000; // SNI Driver + public const ulong D_TXTIN = 0x00010000; // Simple Input Driver + public const ulong D_TXTOUT = 0x00020000; // Simple Text Output Driver + public const ulong D_ERROR_ATA = 0x00040000; // ATA error messages + public const ulong D_ERROR = 0x80000000; // Error + public const ulong D_RESERVED = 0x7fffC880; // Bits not reserved above + public const ulong EFI_DBUG_MASK = (D_ERROR); + public const ulong EXCEPT_IA32_DIVIDE_ERROR = 0; + public const ulong EXCEPT_IA32_DEBUG = 1; + public const ulong EXCEPT_IA32_NMI = 2; + public const ulong EXCEPT_IA32_BREAKPOINT = 3; + public const ulong EXCEPT_IA32_OVERFLOW = 4; + public const ulong EXCEPT_IA32_BOUND = 5; + public const ulong EXCEPT_IA32_INVALID_OPCODE = 6; + public const ulong EXCEPT_IA32_DOUBLE_FAULT = 8; + public const ulong EXCEPT_IA32_INVALID_TSS = 10; + public const ulong EXCEPT_IA32_SEG_NOT_PRESENT = 11; + public const ulong EXCEPT_IA32_STACK_FAULT = 12; + public const ulong EXCEPT_IA32_GP_FAULT = 13; + public const ulong EXCEPT_IA32_PAGE_FAULT = 14; + public const ulong EXCEPT_IA32_FP_ERROR = 16; + public const ulong EXCEPT_IA32_ALIGNMENT_CHECK = 17; + public const ulong EXCEPT_IA32_MACHINE_CHECK = 18; + public const ulong EXCEPT_IA32_SIMD = 19; + public const ulong EXCEPT_X64_DIVIDE_ERROR = 0; + public const ulong EXCEPT_X64_DEBUG = 1; + public const ulong EXCEPT_X64_NMI = 2; + public const ulong EXCEPT_X64_BREAKPOINT = 3; + public const ulong EXCEPT_X64_OVERFLOW = 4; + public const ulong EXCEPT_X64_BOUND = 5; + public const ulong EXCEPT_X64_INVALID_OPCODE = 6; + public const ulong EXCEPT_X64_DOUBLE_FAULT = 8; + public const ulong EXCEPT_X64_INVALID_TSS = 10; + public const ulong EXCEPT_X64_SEG_NOT_PRESENT = 11; + public const ulong EXCEPT_X64_STACK_FAULT = 12; + public const ulong EXCEPT_X64_GP_FAULT = 13; + public const ulong EXCEPT_X64_PAGE_FAULT = 14; + public const ulong EXCEPT_X64_FP_ERROR = 16; + public const ulong EXCEPT_X64_ALIGNMENT_CHECK = 17; + public const ulong EXCEPT_X64_MACHINE_CHECK = 18; + public const ulong EXCEPT_X64_SIMD = 19; + public const ulong EXCEPT_IPF_VHTP_TRANSLATION = 0; + public const ulong EXCEPT_IPF_INSTRUCTION_TLB = 1; + public const ulong EXCEPT_IPF_DATA_TLB = 2; + public const ulong EXCEPT_IPF_ALT_INSTRUCTION_TLB = 3; + public const ulong EXCEPT_IPF_ALT_DATA_TLB = 4; + public const ulong EXCEPT_IPF_DATA_NESTED_TLB = 5; + public const ulong EXCEPT_IPF_INSTRUCTION_KEY_MISSED = 6; + public const ulong EXCEPT_IPF_DATA_KEY_MISSED = 7; + public const ulong EXCEPT_IPF_DIRTY_BIT = 8; + public const ulong EXCEPT_IPF_INSTRUCTION_ACCESS_BIT = 9; + public const ulong EXCEPT_IPF_DATA_ACCESS_BIT = 10; + public const ulong EXCEPT_IPF_BREAKPOINT = 11; + public const ulong EXCEPT_IPF_EXTERNAL_INTERRUPT = 12; + public const ulong EXCEPT_IPF_PAGE_NOT_PRESENT = 20; + public const ulong EXCEPT_IPF_KEY_PERMISSION = 21; + public const ulong EXCEPT_IPF_INSTRUCTION_ACCESS_RIGHTS = 22; + public const ulong EXCEPT_IPF_DATA_ACCESS_RIGHTS = 23; + public const ulong EXCEPT_IPF_GENERAL_EXCEPTION = 24; + public const ulong EXCEPT_IPF_DISABLED_FP_REGISTER = 25; + public const ulong EXCEPT_IPF_NAT_CONSUMPTION = 26; + public const ulong EXCEPT_IPF_SPECULATION = 27; + public const ulong EXCEPT_IPF_DEBUG = 29; + public const ulong EXCEPT_IPF_UNALIGNED_REFERENCE = 30; + public const ulong EXCEPT_IPF_UNSUPPORTED_DATA_REFERENCE = 31; + public const ulong EXCEPT_IPF_FP_FAULT = 32; + public const ulong EXCEPT_IPF_FP_TRAP = 33; + public const ulong EXCEPT_IPF_LOWER_PRIVILEGE_TRANSFER_TRAP = 34; + public const ulong EXCEPT_IPF_TAKEN_BRANCH = 35; + public const ulong EXCEPT_IPF_SINGLE_STEP = 36; + public const ulong EXCEPT_IPF_IA32_EXCEPTION = 45; + public const ulong EXCEPT_IPF_IA32_INTERCEPT = 46; + public const ulong EXCEPT_IPF_IA32_INTERRUPT = 47; + public const ulong EXCEPT_EBC_UNDEFINED = 0; + public const ulong EXCEPT_EBC_DIVIDE_ERROR = 1; + public const ulong EXCEPT_EBC_DEBUG = 2; + public const ulong EXCEPT_EBC_BREAKPOINT = 3; + public const ulong EXCEPT_EBC_OVERFLOW = 4; + public const ulong EXCEPT_EBC_INVALID_OPCODE = 5; + public const ulong EXCEPT_EBC_STACK_FAULT = 6; + public const ulong EXCEPT_EBC_ALIGNMENT_CHECK = 7; + public const ulong EXCEPT_EBC_INSTRUCTION_ENCODING = 8; + public const ulong EXCEPT_EBC_BAD_BREAK = 9; + public const ulong EXCEPT_EBC_STEP = 10; + public const ulong MAX_EBC_EXCEPTION = EXCEPT_EBC_STEP; + public const ulong EXCEPT_ARM_RESET = 0; + public const ulong EXCEPT_ARM_UNDEFINED_INSTRUCTION = 1; + public const ulong EXCEPT_ARM_SOFTWARE_INTERRUPT = 2; + public const ulong EXCEPT_ARM_PREFETCH_ABORT = 3; + public const ulong EXCEPT_ARM_DATA_ABORT = 4; + public const ulong EXCEPT_ARM_RESERVED = 5; + public const ulong EXCEPT_ARM_IRQ = 6; + public const ulong EXCEPT_ARM_FIQ = 7; + public const ulong MAX_ARM_EXCEPTION = EXCEPT_ARM_FIQ; + public const ulong EFI_DEBUG_IMAGE_INFO_UPDATE_IN_PROGRESS = 0x01; + public const ulong EFI_DEBUG_IMAGE_INFO_TABLE_MODIFIED = 0x02; + public const ulong EFI_DEBUG_IMAGE_INFO_INITIAL_SIZE = (EFI_PAGE_SIZE / sizeof(ulong)); + public const ulong EFI_DEBUG_IMAGE_INFO_TYPE_NORMAL = 0x01; + public const ulong EFI_TIME_ADJUST_DAYLIGHT = 0x01; + public const ulong EFI_TIME_IN_DAYLIGHT = 0x02; + public const ulong EFI_UNSPECIFIED_TIMEZONE = 0x07FF; + public const ulong EFI_MEMORY_UC = 0x0000000000000001; + public const ulong EFI_MEMORY_WC = 0x0000000000000002; + public const ulong EFI_MEMORY_WT = 0x0000000000000004; + public const ulong EFI_MEMORY_WB = 0x0000000000000008; + public const ulong EFI_MEMORY_UCE = 0x0000000000000010; + public const ulong EFI_MEMORY_WP = 0x0000000000001000; + public const ulong EFI_MEMORY_RP = 0x0000000000002000; + public const ulong EFI_MEMORY_XP = 0x0000000000004000; + public const ulong EFI_MEMORY_RUNTIME = 0x8000000000000000; + public const ulong EFI_MEMORY_DESCRIPTOR_VERSION = 1; + public const ulong ISO_639_2_ENTRY_SIZE = 3; + public const ulong EFI_PAGE_SIZE = 4096; + public const ulong EFI_PAGE_MASK = 0xFFF; + public const ulong EFI_PAGE_SHIFT = 12; + public const ulong EFI_OS_INDICATIONS_BOOT_TO_FW_UI = 0x0000000000000001; + public const ulong EFI_OS_INDICATIONS_TIMESTAMP_REVOCATION = 0x0000000000000002; + public const ulong EFI_DP_TYPE_MASK = 0x7F; + public const ulong EFI_DP_TYPE_UNPACKED = 0x80; + public const ulong END_DEVICE_PATH_TYPE = 0x7f; + public const ulong END_ENTIRE_DEVICE_PATH_SUBTYPE = 0xff; + public const ulong END_INSTANCE_DEVICE_PATH_SUBTYPE = 0x01; + public const ulong HARDWARE_DEVICE_PATH = 0x01; + public const ulong HW_PCI_DP = 0x01; + public const ulong HW_PCCARD_DP = 0x02; + public const ulong HW_MEMMAP_DP = 0x03; + public const ulong HW_VENDOR_DP = 0x04; + public const ulong HW_CONTROLLER_DP = 0x05; + public const ulong ACPI_DEVICE_PATH = 0x02; + public const ulong ACPI_DP = 0x01; + public const ulong EXPANDED_ACPI_DP = 0x02; + public const ulong ACPI_ADR_DP = 3; + public const ulong PNP_EISA_ID_CONST = 0x41d0; + public const ulong PNP_EISA_ID_MASK = 0xffff; + public const ulong MESSAGING_DEVICE_PATH = 0x03; + public const ulong MSG_ATAPI_DP = 0x01; + public const ulong MSG_SCSI_DP = 0x02; + public const ulong MSG_FIBRECHANNEL_DP = 0x03; + public const ulong MSG_FIBRECHANNELEX_DP = 21; + public const ulong MSG_1394_DP = 0x04; + public const ulong MSG_USB_DP = 0x05; + public const ulong MSG_SATA_DP = 18; + public const ulong MSG_USB_WWID_DP = 16; + public const ulong MSG_DEVICE_LOGICAL_UNIT_DP = 17; + public const ulong MSG_USB_CLASS_DP = 0x0F; + public const ulong MSG_I2O_DP = 0x06; + public const ulong MSG_MAC_ADDR_DP = 0x0b; + public const ulong MSG_IPv4_DP = 0x0c; + public const ulong MSG_IPv6_DP = 0x0d; + public const ulong MSG_URI_DP = 24; + public const ulong MSG_VLAN_DP = 20; + public const ulong MSG_INFINIBAND_DP = 0x09; + public const ulong MSG_UART_DP = 0x0e; + public const ulong MSG_VENDOR_DP = 0x0A; + public const ulong MEDIA_DEVICE_PATH = 0x04; + public const ulong MEDIA_HARDDRIVE_DP = 0x01; + public const ulong MBR_TYPE_PCAT = 0x01; + public const ulong MBR_TYPE_EFI_PARTITION_TABLE_HEADER = 0x02; + public const ulong SIGNATURE_TYPE_MBR = 0x01; + public const ulong SIGNATURE_TYPE_GUID = 0x02; + public const ulong MEDIA_CDROM_DP = 0x02; + public const ulong MEDIA_VENDOR_DP = 0x03; + public const ulong MEDIA_FILEPATH_DP = 0x04; + public const ulong MEDIA_PROTOCOL_DP = 0x05; + public const ulong MEDIA_PIWG_FW_FILE_DP = 6; + public const ulong MEDIA_PIWG_FW_VOL_DP = 7; + public const ulong MEDIA_RELATIVE_OFFSET_RANGE_DP = 8; + public const ulong BBS_DEVICE_PATH = 0x05; + public const ulong BBS_BBS_DP = 0x01; + public const ulong BBS_TYPE_FLOPPY = 0x01; + public const ulong BBS_TYPE_HARDDRIVE = 0x02; + public const ulong BBS_TYPE_CDROM = 0x03; + public const ulong BBS_TYPE_PCMCIA = 0x04; + public const ulong BBS_TYPE_USB = 0x05; + public const ulong BBS_TYPE_EMBEDDED_NETWORK = 0x06; + public const ulong BBS_TYPE_DEV = 0x80; + public const ulong BBS_TYPE_UNKNOWN = 0xFF; + public const ulong EFI_SUCCESS = 0; + public const ulong EFI_LOAD_ERROR = 0x8000000000000000 |(1); + public const ulong EFI_INVALID_PARAMETER = 0x8000000000000000 |(2); + public const ulong EFI_UNSUPPORTED = 0x8000000000000000 |(3); + public const ulong EFI_BAD_BUFFER_SIZE = 0x8000000000000000 |(4); + public const ulong EFI_BUFFER_TOO_SMALL = 0x8000000000000000 |(5); + public const ulong EFI_NOT_READY = 0x8000000000000000 |(6); + public const ulong EFI_DEVICE_ERROR = 0x8000000000000000 |(7); + public const ulong EFI_WRITE_PROTECTED = 0x8000000000000000 |(8); + public const ulong EFI_OUT_OF_RESOURCES = 0x8000000000000000 |(9); + public const ulong EFI_VOLUME_CORRUPTED = 0x8000000000000000 |(10); + public const ulong EFI_VOLUME_FULL = 0x8000000000000000 |(11); + public const ulong EFI_NO_MEDIA = 0x8000000000000000 |(12); + public const ulong EFI_MEDIA_CHANGED = 0x8000000000000000 |(13); + public const ulong EFI_NOT_FOUND = 0x8000000000000000 |(14); + public const ulong EFI_ACCESS_DENIED = 0x8000000000000000 |(15); + public const ulong EFI_NO_RESPONSE = 0x8000000000000000 |(16); + public const ulong EFI_NO_MAPPING = 0x8000000000000000 |(17); + public const ulong EFI_TIMEOUT = 0x8000000000000000 |(18); + public const ulong EFI_NOT_STARTED = 0x8000000000000000 |(19); + public const ulong EFI_ALREADY_STARTED = 0x8000000000000000 |(20); + public const ulong EFI_ABORTED = 0x8000000000000000 |(21); + public const ulong EFI_ICMP_ERROR = 0x8000000000000000 |(22); + public const ulong EFI_TFTP_ERROR = 0x8000000000000000 |(23); + public const ulong EFI_PROTOCOL_ERROR = 0x8000000000000000 |(24); + public const ulong EFI_INCOMPATIBLE_VERSION = 0x8000000000000000 |(25); + public const ulong EFI_SECURITY_VIOLATION = 0x8000000000000000 |(26); + public const ulong EFI_CRC_ERROR = 0x8000000000000000 |(27); + public const ulong EFI_END_OF_MEDIA = 0x8000000000000000 |(28); + public const ulong EFI_END_OF_FILE = 0x8000000000000000 |(31); + public const ulong EFI_INVALID_LANGUAGE = 0x8000000000000000 |(32); + public const ulong EFI_COMPROMISED_DATA = 0x8000000000000000 |(33); + public const ulong EFI_WARN_UNKOWN_GLYPH = (1); + public const ulong EFI_WARN_UNKNOWN_GLYPH = (1); + public const ulong EFI_WARN_DELETE_FAILURE = (2); + public const ulong EFI_WARN_WRITE_FAILURE = (3); + public const ulong EFI_WARN_BUFFER_TOO_SMALL = (4); + public const ulong EFI_PARTITION_SIGNATURE = 0x5053595320494249; + public const ulong EFI_PARTITION_REVISION = 0x00010001; + public const ulong MIN_EFI_PARTITION_BLOCK_SIZE = 512; + public const ulong EFI_PARTITION_LBA = 1; + public const ulong EFI_FILE_HEADER_SIGNATURE = 0x454c494620494249; + public const ulong EFI_FILE_HEADER_REVISION = 0x00010000; + public const ulong EFI_FILE_STRING_SIZE = 260; + public const ulong EFI_FILE_CLASS_FREE_SPACE = 1; + public const ulong EFI_FILE_CLASS_EMPTY = 2; + public const ulong EFI_FILE_CLASS_NORMAL = 3; + public const ulong EFI_LBAL_SIGNATURE = 0x4c41424c20494249; + public const ulong EFI_LBAL_REVISION = 0x00010000; + public const ulong PRIMARY_PART_HEADER_LBA = 1; + public const ulong EFI_PART_USED_BY_EFI = 0x0000000000000001; + public const ulong EFI_PART_REQUIRED_TO_FUNCTION = 0x0000000000000002; + public const ulong EFI_PART_USED_BY_OS = 0x0000000000000004; + public const ulong EFI_PART_REQUIRED_BY_OS = 0x0000000000000008; + public const ulong EFI_PART_BACKUP_REQUIRED = 0x0000000000000010; + public const ulong EFI_PART_USER_DATA = 0x0000000000000020; + public const ulong EFI_PART_CRITICAL_USER_DATA = 0x0000000000000040; + public const ulong EFI_PART_REDUNDANT_PARTITION = 0x0000000000000080; + public const ulong ICMP_V6_DEST_UNREACHABLE = 0x1; + public const ulong ICMP_V6_PACKET_TOO_BIG = 0x2; + public const ulong ICMP_V6_TIME_EXCEEDED = 0x3; + public const ulong ICMP_V6_PARAMETER_PROBLEM = 0x4; + public const ulong ICMP_V6_ECHO_REQUEST = 0x80; + public const ulong ICMP_V6_ECHO_REPLY = 0x81; + public const ulong ICMP_V6_LISTENER_QUERY = 0x82; + public const ulong ICMP_V6_LISTENER_REPORT = 0x83; + public const ulong ICMP_V6_LISTENER_DONE = 0x84; + public const ulong ICMP_V6_ROUTER_SOLICIT = 0x85; + public const ulong ICMP_V6_ROUTER_ADVERTISE = 0x86; + public const ulong ICMP_V6_NEIGHBOR_SOLICIT = 0x87; + public const ulong ICMP_V6_NEIGHBOR_ADVERTISE = 0x88; + public const ulong ICMP_V6_REDIRECT = 0x89; + public const ulong ICMP_V6_LISTENER_REPORT_2 = 0x8F; + public const ulong ICMP_V6_NO_ROUTE_TO_DEST = 0x0; + public const ulong ICMP_V6_COMM_PROHIBITED = 0x1; + public const ulong ICMP_V6_BEYOND_SCOPE = 0x2; + public const ulong ICMP_V6_ADDR_UNREACHABLE = 0x3; + public const ulong ICMP_V6_PORT_UNREACHABLE = 0x4; + public const ulong ICMP_V6_SOURCE_ADDR_FAILED = 0x5; + public const ulong ICMP_V6_ROUTE_REJECTED = 0x6; + public const ulong ICMP_V6_TIMEOUT_HOP_LIMIT = 0x0; + public const ulong ICMP_V6_TIMEOUT_REASSEMBLE = 0x1; + public const ulong ICMP_V6_ERRONEOUS_HEADER = 0x0; + public const ulong ICMP_V6_UNRECOGNIZE_NEXT_HDR = 0x1; + public const ulong ICMP_V6_UNRECOGNIZE_OPTION = 0x2; + public const ulong LOAD_OPTION_ACTIVE = 0x00000001; + public const ulong EFI_SIMPLE_NETWORK_RECEIVE_UNICAST = 0x01; + public const ulong EFI_SIMPLE_NETWORK_RECEIVE_MULTICAST = 0x02; + public const ulong EFI_SIMPLE_NETWORK_RECEIVE_BROADCAST = 0x04; + public const ulong EFI_SIMPLE_NETWORK_RECEIVE_PROMISCUOUS = 0x08; + public const ulong EFI_SIMPLE_NETWORK_RECEIVE_PROMISCUOUS_MULTICAST = 0x10; + public const ulong EFI_SIMPLE_NETWORK_RECEIVE_INTERRUPT = 0x01; + public const ulong EFI_SIMPLE_NETWORK_TRANSMIT_INTERRUPT = 0x02; + public const ulong EFI_SIMPLE_NETWORK_COMMAND_INTERRUPT = 0x04; + public const ulong EFI_SIMPLE_NETWORK_SOFTWARE_INTERRUPT = 0x08; + public const ulong MAX_MCAST_FILTER_CNT = 16; + public const ulong EFI_SIMPLE_NETWORK_PROTOCOL_REVISION = 0x00010000; + public const ulong EFI_SIMPLE_NETWORK_INTERFACE_REVISION = EFI_SIMPLE_NETWORK_PROTOCOL_REVISION; + public const ulong EFI_PARTITION = 0xef; + public const ulong MBR_SIZE = 512; + public const ulong MBR_SIGNATURE = 0xaa55; + public const ulong MIN_MBR_DEVICE_SIZE = 0x80000; + public const ulong MBR_ERRATA_PAD = 0x40000;// 128 MB + public const ulong MAX_MBR_PARTITIONS = 4; + public const ulong EFI_PCI_IO_PASS_THROUGH_BAR = 0xff; + public const ulong EFI_PCI_ATTRIBUTE_ISA_MOTHERBOARD_IO = 0x0001; + public const ulong EFI_PCI_ATTRIBUTE_ISA_IO = 0x0002; + public const ulong EFI_PCI_ATTRIBUTE_VGA_PALETTE_IO = 0x0004; + public const ulong EFI_PCI_ATTRIBUTE_VGA_MEMORY = 0x0008; + public const ulong EFI_PCI_ATTRIBUTE_VGA_IO = 0x0010; + public const ulong EFI_PCI_ATTRIBUTE_IDE_PRIMARY_IO = 0x0020; + public const ulong EFI_PCI_ATTRIBUTE_IDE_SECONDARY_IO = 0x0040; + public const ulong EFI_PCI_ATTRIBUTE_MEMORY_WRITE_COMBINE = 0x0080; + public const ulong EFI_PCI_ATTRIBUTE_IO = 0x0100; + public const ulong EFI_PCI_ATTRIBUTE_MEMORY = 0x0200; + public const ulong EFI_PCI_ATTRIBUTE_BUS_MASTER = 0x0400; + public const ulong EFI_PCI_ATTRIBUTE_MEMORY_CACHED = 0x0800; + public const ulong EFI_PCI_ATTRIBUTE_MEMORY_DISABLE = 0x1000; + public const ulong EFI_PCI_ATTRIBUTE_EMBEDDED_DEVICE = 0x2000; + public const ulong EFI_PCI_ATTRIBUTE_EMBEDDED_ROM = 0x4000; + public const ulong EFI_PCI_ATTRIBUTE_DUAL_ADDRESS_CYCLE = 0x8000; + public const ulong EFI_PCI_ATTRIBUTE_ISA_IO_16 = 0x10000; + public const ulong EFI_PCI_ATTRIBUTE_VGA_PALETTE_IO_16 = 0x20000; + public const ulong EFI_PCI_ATTRIBUTE_VGA_IO_16 = 0x40000; + public const ulong EFI_PCI_IO_ATTRIBUTE_ISA_MOTHERBOARD_IO = EFI_PCI_ATTRIBUTE_ISA_MOTHERBOARD_IO; + public const ulong EFI_PCI_IO_ATTRIBUTE_ISA_IO = EFI_PCI_ATTRIBUTE_ISA_IO; + public const ulong EFI_PCI_IO_ATTRIBUTE_VGA_PALETTE_IO = EFI_PCI_ATTRIBUTE_VGA_PALETTE_IO; + public const ulong EFI_PCI_IO_ATTRIBUTE_VGA_MEMORY = EFI_PCI_ATTRIBUTE_VGA_MEMORY; + public const ulong EFI_PCI_IO_ATTRIBUTE_VGA_IO = EFI_PCI_ATTRIBUTE_VGA_IO; + public const ulong EFI_PCI_IO_ATTRIBUTE_IDE_PRIMARY_IO = EFI_PCI_ATTRIBUTE_IDE_PRIMARY_IO; + public const ulong EFI_PCI_IO_ATTRIBUTE_IDE_SECONDARY_IO = EFI_PCI_ATTRIBUTE_IDE_SECONDARY_IO; + public const ulong EFI_PCI_IO_ATTRIBUTE_MEMORY_WRITE_COMBINE = EFI_PCI_ATTRIBUTE_MEMORY_WRITE_COMBINE; + public const ulong EFI_PCI_IO_ATTRIBUTE_IO = EFI_PCI_ATTRIBUTE_IO; + public const ulong EFI_PCI_IO_ATTRIBUTE_MEMORY = EFI_PCI_ATTRIBUTE_MEMORY; + public const ulong EFI_PCI_IO_ATTRIBUTE_BUS_MASTER = EFI_PCI_ATTRIBUTE_BUS_MASTER; + public const ulong EFI_PCI_IO_ATTRIBUTE_MEMORY_CACHED = EFI_PCI_ATTRIBUTE_MEMORY_CACHED; + public const ulong EFI_PCI_IO_ATTRIBUTE_MEMORY_DISABLE = EFI_PCI_ATTRIBUTE_MEMORY_DISABLE; + public const ulong EFI_PCI_IO_ATTRIBUTE_EMBEDDED_DEVICE = EFI_PCI_ATTRIBUTE_EMBEDDED_DEVICE; + public const ulong EFI_PCI_IO_ATTRIBUTE_EMBEDDED_ROM = EFI_PCI_ATTRIBUTE_EMBEDDED_ROM; + public const ulong EFI_PCI_IO_ATTRIBUTE_DUAL_ADDRESS_CYCLE = EFI_PCI_ATTRIBUTE_DUAL_ADDRESS_CYCLE; + public const ulong EFI_PCI_IO_ATTRIBUTE_ISA_IO_16 = EFI_PCI_ATTRIBUTE_ISA_IO_16; + public const ulong EFI_PCI_IO_ATTRIBUTE_VGA_PALETTE_IO_16 = EFI_PCI_ATTRIBUTE_VGA_PALETTE_IO_16; + public const ulong EFI_PCI_IO_ATTRIBUTE_VGA_IO_16 = EFI_PCI_ATTRIBUTE_VGA_IO_16; + public const ulong EFI_ABSP_SupportsAltActive = 0x00000001; + public const ulong EFI_ABSP_SupportsPressureAsZ = 0x00000002; + public const ulong EFI_ABSP_TouchActive = 0x00000001; + public const ulong EFI_ABS_AltActive = 0x00000002; + public const ulong EFI_BLOCK_IO_PROTOCOL_REVISION = 0x00010000; + public const ulong EFI_BLOCK_IO_PROTOCOL_REVISION2 = 0x00020001; + public const ulong EFI_BLOCK_IO_PROTOCOL_REVISION3 = ((2 << 16) | 31); + public const ulong EFI_BLOCK_IO_INTERFACE_REVISION = EFI_BLOCK_IO_PROTOCOL_REVISION; + public const ulong EFI_BLOCK_IO_INTERFACE_REVISION2 = EFI_BLOCK_IO_PROTOCOL_REVISION2; + public const ulong EFI_BLOCK_IO_INTERFACE_REVISION3 = EFI_BLOCK_IO_PROTOCOL_REVISION3; + public const ulong EFI_DISK_IO_PROTOCOL_REVISION = 0x00010000; + public const ulong EFI_DISK_IO_INTERFACE_REVISION = EFI_DISK_IO_PROTOCOL_REVISION; + public const ulong EFI_DISK_IO2_PROTOCOL_REVISION = 0x00020000; + public const ulong EFI_SIMPLE_FILE_SYSTEM_PROTOCOL_REVISION = 0x00010000; + public const ulong EFI_FILE_IO_INTERFACE_REVISION = EFI_SIMPLE_FILE_SYSTEM_PROTOCOL_REVISION; + public const ulong EFI_FILE_MODE_READ = 0x0000000000000001; + public const ulong EFI_FILE_MODE_WRITE = 0x0000000000000002; + public const ulong EFI_FILE_MODE_CREATE = 0x8000000000000000; + public const ulong EFI_FILE_READ_ONLY = 0x0000000000000001; + public const ulong EFI_FILE_HIDDEN = 0x0000000000000002; + public const ulong EFI_FILE_SYSTEM = 0x0000000000000004; + public const ulong EFI_FILE_RESERVIED = 0x0000000000000008; + public const ulong EFI_FILE_DIRECTORY = 0x0000000000000010; + public const ulong EFI_FILE_ARCHIVE = 0x0000000000000020; + public const ulong EFI_FILE_VALID_ATTR = 0x0000000000000037; + public const ulong EFI_FILE_PROTOCOL_REVISION = 0x00010000; + public const ulong EFI_FILE_PROTOCOL_REVISION2 = 0x00020000; + public const ulong EFI_FILE_PROTOCOL_LATEST_REVISION = EFI_FILE_PROTOCOL_REVISION2; + public const ulong EFI_FILE_HANDLE_REVISION = EFI_FILE_PROTOCOL_REVISION; + public const ulong EFI_UNICODE_BYTE_ORDER_MARK = (0xfeff); + public const ulong UNICODE_BYTE_ORDER_MARK = EFI_UNICODE_BYTE_ORDER_MARK; + public const ulong EFI_LOADED_IMAGE_PROTOCOL_REVISION = 0x1000; + //public const ulong EFI_IMAGE_INFORMATION_REVISION = EFI_LOADED_IMAGE_PROTOCOL_REVISION; + public const ulong DEFAULT_TTL = 4; + public const ulong DEFAULT_ToS = 0; + public const ulong EFI_PXE_BASE_CODE_MAX_IPCNT = 8; + public const ulong EFI_PXE_BASE_CODE_IP_FILTER_STATION_IP = 0x0001; + public const ulong EFI_PXE_BASE_CODE_IP_FILTER_BROADCAST = 0x0002; + public const ulong EFI_PXE_BASE_CODE_IP_FILTER_PROMISCUOUS = 0x0004; + public const ulong EFI_PXE_BASE_CODE_IP_FILTER_PROMISCUOUS_MULTICAST = 0x0008; + public const ulong EFI_PXE_BASE_CODE_UDP_OPFLAGS_ANY_SRC_IP = 0x0001; + public const ulong EFI_PXE_BASE_CODE_UDP_OPFLAGS_ANY_SRC_PORT = 0x0002; + public const ulong EFI_PXE_BASE_CODE_UDP_OPFLAGS_ANY_DEST_IP = 0x0004; + public const ulong EFI_PXE_BASE_CODE_UDP_OPFLAGS_ANY_DEST_PORT = 0x0008; + public const ulong EFI_PXE_BASE_CODE_UDP_OPFLAGS_USE_FILTER = 0x0010; + public const ulong EFI_PXE_BASE_CODE_UDP_OPFLAGS_MAY_FRAGMENT = 0x0020; + public const ulong EFI_PXE_BASE_CODE_BOOT_TYPE_BOOTSTRAP = 0; + public const ulong EFI_PXE_BASE_CODE_BOOT_TYPE_MS_WINNT_RIS = 1; + public const ulong EFI_PXE_BASE_CODE_BOOT_TYPE_INTEL_LCM = 2; + public const ulong EFI_PXE_BASE_CODE_BOOT_TYPE_DOSUNDI = 3; + public const ulong EFI_PXE_BASE_CODE_BOOT_TYPE_NEC_ESMPRO = 4; + public const ulong EFI_PXE_BASE_CODE_BOOT_TYPE_IBM_WSoD = 5; + public const ulong EFI_PXE_BASE_CODE_BOOT_TYPE_IBM_LCCM = 6; + public const ulong EFI_PXE_BASE_CODE_BOOT_TYPE_CA_UNICENTER_TNG = 7; + public const ulong EFI_PXE_BASE_CODE_BOOT_TYPE_HP_OPENVIEW = 8; + public const ulong EFI_PXE_BASE_CODE_BOOT_TYPE_ALTIRIS_9 = 9; + public const ulong EFI_PXE_BASE_CODE_BOOT_TYPE_ALTIRIS_10 = 10; + public const ulong EFI_PXE_BASE_CODE_BOOT_TYPE_ALTIRIS_11 = 11; + public const ulong EFI_PXE_BASE_CODE_BOOT_TYPE_NOT_USED_12 = 12; + public const ulong EFI_PXE_BASE_CODE_BOOT_TYPE_REDHAT_INSTALL = 13; + public const ulong EFI_PXE_BASE_CODE_BOOT_TYPE_REDHAT_BOOT = 14; + public const ulong EFI_PXE_BASE_CODE_BOOT_TYPE_REMBO = 15; + public const ulong EFI_PXE_BASE_CODE_BOOT_TYPE_BEOBOOT = 16; + public const ulong EFI_PXE_BASE_CODE_BOOT_TYPE_PXETEST = 65535; + public const ulong EFI_PXE_BASE_CODE_BOOT_LAYER_MASK = 0x7FFF; + public const ulong EFI_PXE_BASE_CODE_BOOT_LAYER_INITIAL = 0x0000; + public const ulong EFI_PXE_BASE_CODE_MAX_ARP_ENTRIES = 8; + public const ulong EFI_PXE_BASE_CODE_MAX_ROUTE_ENTRIES = 8; + public const ulong EFI_PXE_BASE_CODE_PROTOCOL_REVISION = 0x00010000; + public const ulong EFI_PXE_BASE_CODE_INTERFACE_REVISION = EFI_PXE_BASE_CODE_PROTOCOL_REVISION; + public const ulong EFI_PXE_BASE_CODE_CALLBACK_PROTOCOL_REVISION = 0x00010000; + public const ulong EFI_PXE_BASE_CODE_CALLBACK_INTERFACE_REVISION = EFI_PXE_BASE_CODE_CALLBACK_PROTOCOL_REVISION; + public const ulong EFI_SERIAL_CLEAR_TO_SEND = 0x0010; // RO + public const ulong EFI_SERIAL_DATA_SET_READY = 0x0020;// RO + public const ulong EFI_SERIAL_RING_INDICATE = 0x0040; // RO + public const ulong EFI_SERIAL_CARRIER_DETECT = 0x0080; // RO + public const ulong EFI_SERIAL_REQUEST_TO_SEND = 0x0002; // WO + public const ulong EFI_SERIAL_DATA_TERMINAL_READY = 0x0001; // WO + public const ulong EFI_SERIAL_INPUT_BUFFER_EMPTY = 0x0100; // RO + public const ulong EFI_SERIAL_OUTPUT_BUFFER_EMPTY = 0x0200; // RO + public const ulong EFI_SERIAL_HARDWARE_LOOPBACK_ENABLE = 0x1000; // RW + public const ulong EFI_SERIAL_SOFTWARE_LOOPBACK_ENABLE = 0x2000; // RW + public const ulong EFI_SERIAL_HARDWARE_FLOW_CONTROL_ENABLE = 0x4000; // RW + public const ulong SERIAL_IO_INTERFACE_REVISION = 0x00010000; + public const ulong EFI_DEVICE_NAME_USE_COMPONENT_NAME = 0x00000001; + public const ulong EFI_DEVICE_NAME_USE_DEVICE_PATH = 0x00000002; + public const ulong EFI_CONNECTION_FIN = 0x8000000000000000 |(104); + public const ulong EFI_CONNECTION_RESET = 0x8000000000000000 |(105); + public const ulong EFI_CONNECTION_REFUSED = 0x8000000000000000 |(106); + public const ulong EFI_NETWORK_UNREACHABLE = 0x8000000000000000 |(100); + public const ulong EFI_HOST_UNREACHABLE = 0x8000000000000000 |(101); + public const ulong EFI_PROTOCOL_UNREACHABLE = 0x8000000000000000 |(102); + public const ulong EFI_PORT_UNREACHABLE = 0x8000000000000000 |(103); + public const ulong EFI_UI_INTERFACE_PROTOCOL_VERSION = 0x00010000; + public const ulong EFI_UI_VERSION = EFI_UI_INTERFACE_PROTOCOL_VERSION; + public const ulong EFI_NETWORK_INTERFACE_IDENTIFIER_PROTOCOL_REVISION = 0x00010000; + public const ulong EFI_NETWORK_INTERFACE_IDENTIFIER_INTERFACE_REVISION = EFI_NETWORK_INTERFACE_IDENTIFIER_PROTOCOL_REVISION; + public const ulong PXE_INTEL_ORDER = 1;// Intel order + public const ulong PXE_UINT64_SUPPORT = 1; // UINT64 supported + public const ulong PXE_CPBSIZE_NOT_USED = 0; // zero + public const ulong PXE_DBSIZE_NOT_USED = 0; // zero + public const ulong PXE_CPBADDR_NOT_USED = 0; // zero + public const ulong PXE_DBADDR_NOT_USED = 0; // zero + public const bool PXE_FALSE = false; // zero + public const bool PXE_TRUE = (!PXE_FALSE); + public const ulong PXE_OPCODE_GET_STATE = 0x0000; + public const ulong PXE_OPCODE_START = 0x0001; + public const ulong PXE_OPCODE_STOP = 0x0002; + public const ulong PXE_OPCODE_GET_INIT_INFO = 0x0003; + public const ulong PXE_OPCODE_GET_CONFIG_INFO = 0x0004; + public const ulong PXE_OPCODE_INITIALIZE = 0x0005; + public const ulong PXE_OPCODE_RESET = 0x0006; + public const ulong PXE_OPCODE_SHUTDOWN = 0x0007; + public const ulong PXE_OPCODE_INTERRUPT_ENABLES = 0x0008; + public const ulong PXE_OPCODE_RECEIVE_FILTERS = 0x0009; + public const ulong PXE_OPCODE_STATION_ADDRESS = 0x000A; + public const ulong PXE_OPCODE_STATISTICS = 0x000B; + public const ulong PXE_OPCODE_MCAST_IP_TO_MAC = 0x000C; + public const ulong PXE_OPCODE_NVDATA = 0x000D; + public const ulong PXE_OPCODE_GET_STATUS = 0x000E; + public const ulong PXE_OPCODE_FILL_HEADER = 0x000F; + public const ulong PXE_OPCODE_TRANSMIT = 0x0010; + public const ulong PXE_OPCODE_RECEIVE = 0x0011; + public const ulong PXE_OPCODE_VALID_MAX = 0x0011; + public const ulong PXE_OPCODE_LAST_VALID = 0x0011; + public const ulong PXE_OPFLAGS_NOT_USED = 0x0000; + public const ulong PXE_OPFLAGS_INITIALIZE_CABLE_DETECT_MASK = 0x0001; + public const ulong PXE_OPFLAGS_INITIALIZE_DETECT_CABLE = 0x0000; + public const ulong PXE_OPFLAGS_INITIALIZE_DO_NOT_DETECT_CABLE = 0x0001; + public const ulong PXE_OPFLAGS_RESET_DISABLE_INTERRUPTS = 0x0001; + public const ulong PXE_OPFLAGS_RESET_DISABLE_FILTERS = 0x0002; + public const ulong PXE_OPFLAGS_INTERRUPT_OPMASK = 0xC000; + public const ulong PXE_OPFLAGS_INTERRUPT_ENABLE = 0x8000; + public const ulong PXE_OPFLAGS_INTERRUPT_DISABLE = 0x4000; + public const ulong PXE_OPFLAGS_INTERRUPT_READ = 0x0000; + public const ulong PXE_OPFLAGS_INTERRUPT_RECEIVE = 0x0001; + public const ulong PXE_OPFLAGS_INTERRUPT_TRANSMIT = 0x0002; + public const ulong PXE_OPFLAGS_INTERRUPT_COMMAND = 0x0004; + public const ulong PXE_OPFLAGS_INTERRUPT_SOFTWARE = 0x0008; + public const ulong PXE_OPFLAGS_RECEIVE_FILTER_OPMASK = 0xC000; + public const ulong PXE_OPFLAGS_RECEIVE_FILTER_ENABLE = 0x8000; + public const ulong PXE_OPFLAGS_RECEIVE_FILTER_DISABLE = 0x4000; + public const ulong PXE_OPFLAGS_RECEIVE_FILTER_READ = 0x0000; + public const ulong PXE_OPFLAGS_RECEIVE_FILTER_RESET_MCAST_LIST = 0x2000; + public const ulong PXE_OPFLAGS_RECEIVE_FILTER_UNICAST = 0x0001; + public const ulong PXE_OPFLAGS_RECEIVE_FILTER_BROADCAST = 0x0002; + public const ulong PXE_OPFLAGS_RECEIVE_FILTER_FILTERED_MULTICAST = 0x0004; + public const ulong PXE_OPFLAGS_RECEIVE_FILTER_PROMISCUOUS = 0x0008; + public const ulong PXE_OPFLAGS_RECEIVE_FILTER_ALL_MULTICAST = 0x0010; + public const ulong PXE_OPFLAGS_STATION_ADDRESS_READ = 0x0000; + public const ulong PXE_OPFLAGS_STATION_ADDRESS_RESET = 0x0001; + public const ulong PXE_OPFLAGS_STATISTICS_READ = 0x0000; + public const ulong PXE_OPFLAGS_STATISTICS_RESET = 0x0001; + public const ulong PXE_OPFLAGS_MCAST_IP_TO_MAC_OPMASK = 0x0003; + public const ulong PXE_OPFLAGS_MCAST_IPV4_TO_MAC = 0x0000; + public const ulong PXE_OPFLAGS_MCAST_IPV6_TO_MAC = 0x0001; + public const ulong PXE_OPFLAGS_NVDATA_OPMASK = 0x0001; + public const ulong PXE_OPFLAGS_NVDATA_READ = 0x0000; + public const ulong PXE_OPFLAGS_NVDATA_WRITE = 0x0001; + public const ulong PXE_OPFLAGS_GET_INTERRUPT_STATUS = 0x0001; + public const ulong PXE_OPFLAGS_GET_TRANSMITTED_BUFFERS = 0x0002; + public const ulong PXE_OPFLAGS_FILL_HEADER_OPMASK = 0x0001; + public const ulong PXE_OPFLAGS_FILL_HEADER_FRAGMENTED = 0x0001; + public const ulong PXE_OPFLAGS_FILL_HEADER_WHOLE = 0x0000; + public const ulong PXE_OPFLAGS_SWUNDI_TRANSMIT_OPMASK = 0x0001; + public const ulong PXE_OPFLAGS_TRANSMIT_BLOCK = 0x0001; + public const ulong PXE_OPFLAGS_TRANSMIT_DONT_BLOCK = 0x0000; + public const ulong PXE_OPFLAGS_TRANSMIT_OPMASK = 0x0002; + public const ulong PXE_OPFLAGS_TRANSMIT_FRAGMENTED = 0x0002; + public const ulong PXE_OPFLAGS_TRANSMIT_WHOLE = 0x0000; + public const ulong PXE_STATFLAGS_INITIALIZE = 0x0000; + public const ulong PXE_STATFLAGS_STATUS_MASK = 0xC000; + public const ulong PXE_STATFLAGS_COMMAND_COMPLETE = 0xC000; + public const ulong PXE_STATFLAGS_COMMAND_FAILED = 0x8000; + public const ulong PXE_STATFLAGS_COMMAND_QUEUED = 0x4000; + public const ulong PXE_STATFLAGS_DB_WRITE_TRUNCATED = 0x2000; + public const ulong PXE_STATFLAGS_GET_STATE_MASK = 0x0003; + public const ulong PXE_STATFLAGS_GET_STATE_INITIALIZED = 0x0002; + public const ulong PXE_STATFLAGS_GET_STATE_STARTED = 0x0001; + public const ulong PXE_STATFLAGS_GET_STATE_STOPPED = 0x0000; + public const ulong PXE_STATFLAGS_CABLE_DETECT_MASK = 0x0001; + public const ulong PXE_STATFLAGS_CABLE_DETECT_NOT_SUPPORTED = 0x0000; + public const ulong PXE_STATFLAGS_CABLE_DETECT_SUPPORTED = 0x0001; + public const ulong PXE_STATFLAGS_INITIALIZED_NO_MEDIA = 0x0001; + public const ulong PXE_STATFLAGS_RESET_NO_MEDIA = 0x0001; + public const ulong PXE_STATFLAGS_INTERRUPT_RECEIVE = 0x0001; + public const ulong PXE_STATFLAGS_INTERRUPT_TRANSMIT = 0x0002; + public const ulong PXE_STATFLAGS_INTERRUPT_COMMAND = 0x0004; + public const ulong PXE_STATFLAGS_RECEIVE_FILTER_UNICAST = 0x0001; + public const ulong PXE_STATFLAGS_RECEIVE_FILTER_BROADCAST = 0x0002; + public const ulong PXE_STATFLAGS_RECEIVE_FILTER_FILTERED_MULTICAST = 0x0004; + public const ulong PXE_STATFLAGS_RECEIVE_FILTER_PROMISCUOUS = 0x0008; + public const ulong PXE_STATFLAGS_RECEIVE_FILTER_ALL_MULTICAST = 0x0010; + public const ulong PXE_STATFLAGS_GET_STATUS_INTERRUPT_MASK = 0x000F; + public const ulong PXE_STATFLAGS_GET_STATUS_NO_INTERRUPTS = 0x0000; + public const ulong PXE_STATFLAGS_GET_STATUS_RECEIVE = 0x0001; + public const ulong PXE_STATFLAGS_GET_STATUS_TRANSMIT = 0x0002; + public const ulong PXE_STATFLAGS_GET_STATUS_COMMAND = 0x0004; + public const ulong PXE_STATFLAGS_GET_STATUS_SOFTWARE = 0x0008; + public const ulong PXE_STATFLAGS_GET_STATUS_TXBUF_QUEUE_EMPTY = 0x0010; + public const ulong PXE_STATFLAGS_GET_STATUS_NO_TXBUFS_WRITTEN = 0x0020; + public const ulong PXE_STATCODE_INITIALIZE = 0x0000; + public const ulong PXE_STATCODE_SUCCESS = 0x0000; + public const ulong PXE_STATCODE_INVALID_CDB = 0x0001; + public const ulong PXE_STATCODE_INVALID_CPB = 0x0002; + public const ulong PXE_STATCODE_BUSY = 0x0003; + public const ulong PXE_STATCODE_QUEUE_FULL = 0x0004; + public const ulong PXE_STATCODE_ALREADY_STARTED = 0x0005; + public const ulong PXE_STATCODE_NOT_STARTED = 0x0006; + public const ulong PXE_STATCODE_NOT_SHUTDOWN = 0x0007; + public const ulong PXE_STATCODE_ALREADY_INITIALIZED = 0x0008; + public const ulong PXE_STATCODE_NOT_INITIALIZED = 0x0009; + public const ulong PXE_STATCODE_DEVICE_FAILURE = 0x000A; + public const ulong PXE_STATCODE_NVDATA_FAILURE = 0x000B; + public const ulong PXE_STATCODE_UNSUPPORTED = 0x000C; + public const ulong PXE_STATCODE_BUFFER_FULL = 0x000D; + public const ulong PXE_IFNUM_START = 0x0000; + public const ulong PXE_IFNUM_INVALID = 0x0000; + public const ulong PXE_CONTROL_QUEUE_IF_BUSY = 0x0002; + public const ulong PXE_CONTROL_LINK = 0x0001; + public const ulong PXE_CONTROL_LAST_CDB_IN_LIST = 0x0000; + public const ulong PXE_FRAME_TYPE_NONE = 0x00; + public const ulong PXE_FRAME_TYPE_UNICAST = 0x01; + public const ulong PXE_FRAME_TYPE_BROADCAST = 0x02; + public const ulong PXE_FRAME_TYPE_MULTICAST = 0x03; + public const ulong PXE_FRAME_TYPE_PROMISCUOUS = 0x04; + public const ulong PXE_MAC_LENGTH = 32; + public const ulong PXE_IFTYPE_ETHERNET = 0x01; + public const ulong PXE_IFTYPE_TOKENRING = 0x04; + public const ulong PXE_IFTYPE_FIBRE_CHANNEL = 0x12; + public const ulong PXE_HWSTAT_STATE_MASK = 0xC0000000; + public const ulong PXE_HWSTAT_BUSY = 0xC0000000; + public const ulong PXE_HWSTAT_INITIALIZED = 0x80000000; + public const ulong PXE_HWSTAT_STARTED = 0x40000000; + public const ulong PXE_HWSTAT_STOPPED = 0x00000000; + public const ulong PXE_HWSTAT_COMMAND_FAILED = 0x20000000; + public const ulong PXE_HWSTAT_PROMISCUOUS_MULTICAST_RX_ENABLED = 0x00001000; + public const ulong PXE_HWSTAT_PROMISCUOUS_RX_ENABLED = 0x00000800; + public const ulong PXE_HWSTAT_BROADCAST_RX_ENABLED = 0x00000400; + public const ulong PXE_HWSTAT_MULTICAST_RX_ENABLED = 0x00000200; + public const ulong PXE_HWSTAT_UNICAST_RX_ENABLED = 0x00000100; + public const ulong PXE_HWSTAT_SOFTWARE_INT_ENABLED = 0x00000080; + public const ulong PXE_HWSTAT_TX_COMPLETE_INT_ENABLED = 0x00000040; + public const ulong PXE_HWSTAT_PACKET_RX_INT_ENABLED = 0x00000020; + public const ulong PXE_HWSTAT_CMD_COMPLETE_INT_ENABLED = 0x00000010; + public const ulong PXE_HWSTAT_SOFTWARE_INT_PENDING = 0x00000008; + public const ulong PXE_HWSTAT_TX_COMPLETE_INT_PENDING = 0x00000004; + public const ulong PXE_HWSTAT_PACKET_RX_INT_PENDING = 0x00000002; + public const ulong PXE_HWSTAT_CMD_COMPLETE_INT_PENDING = 0x00000001; + public const ulong PXE_HWCMD_ISSUE_COMMAND = 0x80000000; + public const ulong PXE_HWCMD_INTS_AND_FILTS = 0x00000000; + public const ulong PXE_HWCMD_PROMISCUOUS_MULTICAST_RX_ENABLE = 0x00001000; + public const ulong PXE_HWCMD_PROMISCUOUS_RX_ENABLE = 0x00000800; + public const ulong PXE_HWCMD_BROADCAST_RX_ENABLE = 0x00000400; + public const ulong PXE_HWCMD_MULTICAST_RX_ENABLE = 0x00000200; + public const ulong PXE_HWCMD_UNICAST_RX_ENABLE = 0x00000100; + public const ulong PXE_HWCMD_SOFTWARE_INT_ENABLE = 0x00000080; + public const ulong PXE_HWCMD_TX_COMPLETE_INT_ENABLE = 0x00000040; + public const ulong PXE_HWCMD_PACKET_RX_INT_ENABLE = 0x00000020; + public const ulong PXE_HWCMD_CMD_COMPLETE_INT_ENABLE = 0x00000010; + public const ulong PXE_HWCMD_CLEAR_SOFTWARE_INT = 0x00000008; + public const ulong PXE_HWCMD_CLEAR_TX_COMPLETE_INT = 0x00000004; + public const ulong PXE_HWCMD_CLEAR_PACKET_RX_INT = 0x00000002; + public const ulong PXE_HWCMD_CLEAR_CMD_COMPLETE_INT = 0x00000001; + public const ulong PXE_ROMID_REV = 0x02; + public const ulong PXE_ROMID_MAJORVER = 0x03; + public const ulong PXE_ROMID_MINORVER = 0x00; + public const ulong PXE_ROMID_IMP_HW_UNDI = 0x80000000; + public const ulong PXE_ROMID_IMP_SW_VIRT_ADDR = 0x40000000; + public const ulong PXE_ROMID_IMP_64BIT_DEVICE = 0x00010000; + public const ulong PXE_ROMID_IMP_FRAG_SUPPORTED = 0x00008000; + public const ulong PXE_ROMID_IMP_CMD_LINK_SUPPORTED = 0x00004000; + public const ulong PXE_ROMID_IMP_CMD_QUEUE_SUPPORTED = 0x00002000; + public const ulong PXE_ROMID_IMP_MULTI_FRAME_SUPPORTED = 0x00001000; + public const ulong PXE_ROMID_IMP_NVDATA_SUPPORT_MASK = 0x00000C00; + public const ulong PXE_ROMID_IMP_NVDATA_BULK_WRITABLE = 0x00000C00; + public const ulong PXE_ROMID_IMP_NVDATA_SPARSE_WRITABLE = 0x00000800; + public const ulong PXE_ROMID_IMP_NVDATA_READ_ONLY = 0x00000400; + public const ulong PXE_ROMID_IMP_NVDATA_NOT_AVAILABLE = 0x00000000; + public const ulong PXE_ROMID_IMP_STATISTICS_SUPPORTED = 0x00000200; + public const ulong PXE_ROMID_IMP_STATION_ADDR_SETTABLE = 0x00000100; + public const ulong PXE_ROMID_IMP_PROMISCUOUS_MULTICAST_RX_SUPPORTED = 0x00000080; + public const ulong PXE_ROMID_IMP_PROMISCUOUS_RX_SUPPORTED = 0x00000040; + public const ulong PXE_ROMID_IMP_BROADCAST_RX_SUPPORTED = 0x00000020; + public const ulong PXE_ROMID_IMP_FILTERED_MULTICAST_RX_SUPPORTED = 0x00000010; + public const ulong PXE_ROMID_IMP_SOFTWARE_INT_SUPPORTED = 0x00000008; + public const ulong PXE_ROMID_IMP_TX_COMPLETE_INT_SUPPORTED = 0x00000004; + public const ulong PXE_ROMID_IMP_PACKET_RX_INT_SUPPORTED = 0x00000002; + public const ulong PXE_ROMID_IMP_CMD_COMPLETE_INT_SUPPORTED = 0x00000001; + public const ulong MAX_PCI_CONFIG_LEN = 64; // # of dwords + public const ulong MAX_EEPROM_LEN = 128; // #of dwords + public const ulong MAX_XMIT_BUFFERS = 32; // recycling Q length for xmit_done + public const ulong MAX_MCAST_ADDRESS_CNT = 8; + public const ulong PXE_DELAY_MILLISECOND = 1000; + public const ulong PXE_DELAY_SECOND = 1000000; + public const ulong PXE_IO_READ = 0; + public const ulong PXE_IO_WRITE = 1; + public const ulong PXE_MEM_READ = 2; + public const ulong PXE_MEM_WRITE = 4; + public const ulong PXE_MAX_TXRX_UNIT_ETHER = 1500; + public const ulong PXE_HWADDR_LEN_ETHER = 0x0006; + public const ulong PXE_MAC_HEADER_LEN_ETHER = 0x000E; + public const ulong PXE_DUPLEX_ENABLE_FULL_SUPPORTED = 1; + public const ulong PXE_DUPLEX_FORCE_FULL_SUPPORTED = 2; + public const ulong PXE_LOOPBACK_INTERNAL_SUPPORTED = 1; + public const ulong PXE_LOOPBACK_EXTERNAL_SUPPORTED = 2; + public const ulong PXE_DUPLEX_DEFAULT = 0x00; + public const ulong PXE_FORCE_FULL_DUPLEX = 0x01; + public const ulong PXE_ENABLE_FULL_DUPLEX = 0x02; + public const ulong LOOPBACK_NORMAL = 0; + public const ulong LOOPBACK_INTERNAL = 1; + public const ulong LOOPBACK_EXTERNAL = 2; + public const ulong PXE_STATISTICS_RX_TOTAL_FRAMES = 0x00; + public const ulong PXE_STATISTICS_RX_GOOD_FRAMES = 0x01; + public const ulong PXE_STATISTICS_RX_UNDERSIZE_FRAMES = 0x02; + public const ulong PXE_STATISTICS_RX_OVERSIZE_FRAMES = 0x03; + public const ulong PXE_STATISTICS_RX_DROPPED_FRAMES = 0x04; + public const ulong PXE_STATISTICS_RX_UNICAST_FRAMES = 0x05; + public const ulong PXE_STATISTICS_RX_BROADCAST_FRAMES = 0x06; + public const ulong PXE_STATISTICS_RX_MULTICAST_FRAMES = 0x07; + public const ulong PXE_STATISTICS_RX_CRC_ERROR_FRAMES = 0x08; + public const ulong PXE_STATISTICS_RX_TOTAL_BYTES = 0x09; + public const ulong PXE_STATISTICS_TX_TOTAL_FRAMES = 0x0A; + public const ulong PXE_STATISTICS_TX_GOOD_FRAMES = 0x0B; + public const ulong PXE_STATISTICS_TX_UNDERSIZE_FRAMES = 0x0C; + public const ulong PXE_STATISTICS_TX_OVERSIZE_FRAMES = 0x0D; + public const ulong PXE_STATISTICS_TX_DROPPED_FRAMES = 0x0E; + public const ulong PXE_STATISTICS_TX_UNICAST_FRAMES = 0x0F; + public const ulong PXE_STATISTICS_TX_BROADCAST_FRAMES = 0x10; + public const ulong PXE_STATISTICS_TX_MULTICAST_FRAMES = 0x11; + public const ulong PXE_STATISTICS_TX_CRC_ERROR_FRAMES = 0x12; + public const ulong PXE_STATISTICS_TX_TOTAL_BYTES = 0x13; + public const ulong PXE_STATISTICS_COLLISIONS = 0x14; + public const ulong PXE_STATISTICS_UNSUPPORTED_PROTOCOL = 0x15; + public const ulong PXE_PROTOCOL_ETHERNET_IP = 0x0800; + public const ulong PXE_PROTOCOL_ETHERNET_ARP = 0x0806; + public const ulong MAX_XMIT_FRAGMENTS = 16; + public const ulong PCI_MAX_BUS = 255; + public const ulong PCI_MAX_DEVICE = 31; + public const ulong PCI_MAX_FUNC = 7; + public const ulong PCI_VGA_PALETTE_SNOOP_DISABLED = 0x20; + public const ulong PCI_CLASS_DISPLAY_CTRL = 0x03; + public const ulong PCI_CLASS_VGA = 0x00; + public const ulong PCI_CLASS_BRIDGE = 0x06; + public const ulong PCI_CLASS_ISA = 0x01; + public const ulong PCI_CLASS_ISA_POSITIVE_DECODE = 0x80; + public const ulong PCI_CLASS_NETWORK = 0x02; + public const ulong PCI_CLASS_ETHERNET = 0x00; + public const ulong HEADER_TYPE_DEVICE = 0x00; + public const ulong HEADER_TYPE_PCI_TO_PCI_BRIDGE = 0x01; + public const ulong HEADER_TYPE_MULTI_FUNCTION = 0x80; + public const ulong HEADER_LAYOUT_CODE = 0x7f; + public const ulong PCI_EXPANSION_ROM_HEADER_SIGNATURE = 0xaa55; + public const ulong EFI_PCI_EXPANSION_ROM_HEADER_EFISIGNATURE = 0x0EF1; + public const ulong ROM_SIGNATURE = 0xaa55; + public static EFI_GUID EFI_GLOBAL_VARIABLE => new EFI_GUID(0x8BE4DF61, 0x93CA, 0x11d2, 0xAA, 0x0D, 0x00, 0xE0, 0x98, 0x03, 0x2B, 0x8C); public static EFI_GUID MPS_TABLE_GUID => new EFI_GUID(0xeb9d2d2f, 0x2d88, 0x11d3, 0x9a, 0x16, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d); public static EFI_GUID ACPI_TABLE_GUID => new EFI_GUID(0xeb9d2d30, 0x2d88, 0x11d3, 0x9a, 0x16, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d); @@ -128,16 +1003,4 @@ public static void InitializeLib(EFI_HANDLE imageHandle, EFI_SYSTEM_TABLE* syste public static EFI_GUID EFI_UI_INTERFACE_PROTOCOL_GUID => new EFI_GUID(0x32dd7981, 0x2d27, 0x11d4, 0xbc, 0x8b, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81); public static EFI_GUID EFI_NETWORK_INTERFACE_IDENTIFIER_PROTOCOL_GUID => new EFI_GUID(0xE18541CD, 0xF755, 0x4f73, 0x92, 0x8D, 0x64, 0x3C, 0x8A, 0x79, 0xB2, 0x29); public static EFI_GUID SHELL_INTERFACE_PROTOCOL_GUID => new EFI_GUID(0x47c7b223, 0xc42a, 0x11d2, 0x8e, 0x57, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b); - - [RuntimeExport("memset")] - public static unsafe void memset(byte* ptr, byte c, ulong count) - { - gBS->SetMem(ptr, count, c); - } - - [RuntimeExport("memcpy")] - public static unsafe void memcpy(byte* dst, byte* src, ulong count) - { - gBS->CopyMem(dst, src, count); - } } \ No newline at end of file diff --git a/uefi-cs/efiapi.cs b/uefi-cs/efiapi.cs index c98f59f..77459ea 100644 --- a/uefi-cs/efiapi.cs +++ b/uefi-cs/efiapi.cs @@ -19,27 +19,6 @@ Revision History using System.Runtime.InteropServices; -public partial class efi -{ - public const uint EVT_TIMER = 0x80000000; - public const uint EVT_RUNTIME = 0x40000000; - public const uint EVT_RUNTIME_CONTEXT = 0x20000000; - - public const uint EVT_NOTIFY_WAIT = 0x00000100; - public const uint EVT_NOTIFY_SIGNAL = 0x00000200; - - public const uint EVT_SIGNAL_EXIT_BOOT_SERVICES = 0x00000201; - public const uint EVT_SIGNAL_VIRTUAL_ADDRESS_CHANGE = 0x60000202; - - public const uint EVT_EFI_SIGNAL_MASK = 0x000000FF; - public const uint EVT_EFI_SIGNAL_MAX = 4; - - public const uint TPL_APPLICATION = 4; - public const uint TPL_CALLBACK = 8; - public const uint TPL_NOTIFY = 16; - public const uint TPL_HIGH_LEVEL = 31; -} - public enum EFI_TIMER_DELAY { TimerCancel, @@ -85,16 +64,6 @@ public unsafe struct EFI_LOADED_IMAGE } */ -public partial class efi -{ - public const uint EFI_OPEN_PROTOCOL_BY_HANDLE_PROTOCOL = 0x00000001; - public const uint EFI_OPEN_PROTOCOL_GET_PROTOCOL = 0x00000002; - public const uint EFI_OPEN_PROTOCOL_TEST_PROTOCOL = 0x00000004; - public const uint EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER = 0x00000008; - public const uint EFI_OPEN_PROTOCOL_BY_DRIVER = 0x00000010; - public const uint EFI_OPEN_PROTOCOL_EXCLUSIVE = 0x00000020; -} - [StructLayout(LayoutKind.Sequential)] public unsafe struct EFI_OPEN_PROTOCOL_INFORMATION_ENTRY { diff --git a/uefi-cs/efierr.cs b/uefi-cs/efierr.cs index 7eac955..e547474 100644 --- a/uefi-cs/efierr.cs +++ b/uefi-cs/efierr.cs @@ -17,38 +17,3 @@ Revision History --*/ -public partial class efi -{ - public const ulong EFI_SUCCESS = 0; - public const ulong EFI_LOAD_ERROR = 0x8000000000000000 | 1; - public const ulong EFI_INVALID_PARAMETER = 0x8000000000000000 | 2; - public const ulong EFI_UNSUPPORTED = 0x8000000000000000 | 3; - public const ulong EFI_BAD_BUFFER_SIZE = 0x8000000000000000 | 4; - public const ulong EFI_BUFFER_TOO_SMALL = 0x8000000000000000 | 5; - public const ulong EFI_NOT_READY = 0x8000000000000000 | 6; - public const ulong EFI_DEVICE_ERROR = 0x8000000000000000 | 7; - public const ulong EFI_WRITE_PROTECTED = 0x8000000000000000 | 8; - public const ulong EFI_OUT_OF_RESOURCES = 0x8000000000000000 | 9; - public const ulong EFI_VOLUME_CORRUPTED = 0x8000000000000000 | 10; - public const ulong EFI_VOLUME_FULL = 0x8000000000000000 | 11; - public const ulong EFI_NO_MEDIA = 0x8000000000000000 | 12; - public const ulong EFI_MEDIA_CHANGED = 0x8000000000000000 | 13; - public const ulong EFI_NOT_FOUND = 0x8000000000000000 | 14; - public const ulong EFI_ACCESS_DENIED = 0x8000000000000000 | 15; - public const ulong EFI_NO_RESPONSE = 0x8000000000000000 | 16; - public const ulong EFI_NO_MAPPING = 0x8000000000000000 | 17; - public const ulong EFI_TIMEOUT = 0x8000000000000000 | 18; - public const ulong EFI_NOT_STARTED = 0x8000000000000000 | 19; - public const ulong EFI_ALREADY_STARTED = 0x8000000000000000 | 20; - public const ulong EFI_ABORTED = 0x8000000000000000 | 21; - public const ulong EFI_ICMP_ERROR = 0x8000000000000000 | 22; - public const ulong EFI_TFTP_ERROR = 0x8000000000000000 | 23; - public const ulong EFI_PROTOCOL_ERROR = 0x8000000000000000 | 24; - public const ulong EFI_INCOMPATIBLE_VERSION = 0x8000000000000000 | 25; - public const ulong EFI_SECURITY_VIOLATION = 0x8000000000000000 | 26; - public const ulong EFI_CRC_ERROR = 0x8000000000000000 | 27; - public const ulong EFI_END_OF_MEDIA = 0x8000000000000000 | 28; - public const ulong EFI_END_OF_FILE = 0x8000000000000000 | 31; - public const ulong EFI_INVALID_LANGUAGE = 0x8000000000000000 | 32; - public const ulong EFI_COMPROMISED_DATA = 0x8000000000000000 | 33; -} diff --git a/uefi-cs/efiprot.cs b/uefi-cs/efiprot.cs index b25166d..232e9a8 100644 --- a/uefi-cs/efiprot.cs +++ b/uefi-cs/efiprot.cs @@ -104,23 +104,6 @@ public unsafe struct EFI_SIMPLE_FILE_SYSTEM_PROTOCOL public readonly delegate* unmanaged OpenVolume; } -public partial class efi -{ - // Open modes - public const ulong EFI_FILE_MODE_READ = 0x0000000000000001; - public const ulong EFI_FILE_MODE_WRITE = 0x0000000000000002; - public const ulong EFI_FILE_MODE_CREATE = 0x8000000000000000; - - // File attributes - public const ulong EFI_FILE_READ_ONLY = 0x0000000000000001; - public const ulong EFI_FILE_HIDDEN = 0x0000000000000002; - public const ulong EFI_FILE_SYSTEM = 0x0000000000000004; - public const ulong EFI_FILE_RESERVIED = 0x0000000000000008; - public const ulong EFI_FILE_DIRECTORY = 0x0000000000000010; - public const ulong EFI_FILE_ARCHIVE = 0x0000000000000020; - public const ulong EFI_FILE_VALID_ATTR = 0x0000000000000037; -} - [StructLayout(LayoutKind.Sequential)] public unsafe struct EFI_FILE_IO_TOKEN {