| ... | @@ -3,6 +3,7 @@ const Event = uefi.Event; | ... | @@ -3,6 +3,7 @@ const Event = uefi.Event; |
| 3 | const Guid = uefi.Guid; | 3 | const Guid = uefi.Guid; |
| 4 | const Handle = uefi.Handle; | 4 | const Handle = uefi.Handle; |
| 5 | const TableHeader = uefi.tables.TableHeader; | 5 | const TableHeader = uefi.tables.TableHeader; |
| | 6 | const DevicePathProtocol = uefi.protocols.DevicePathProtocol; |
| 6 | | 7 | |
| 7 | /// Boot services are services provided by the system's firmware until the operating system takes | 8 | /// Boot services are services provided by the system's firmware until the operating system takes |
| 8 | /// over control over the hardware by calling exitBootServices. | 9 | /// over control over the hardware by calling exitBootServices. |
| ... | @@ -17,47 +18,73 @@ const TableHeader = uefi.tables.TableHeader; | ... | @@ -17,47 +18,73 @@ const TableHeader = uefi.tables.TableHeader; |
| 17 | /// As the boot_services table may grow with new UEFI versions, it is important to check hdr.header_size. | 18 | /// As the boot_services table may grow with new UEFI versions, it is important to check hdr.header_size. |
| 18 | pub const BootServices = extern struct { | 19 | pub const BootServices = extern struct { |
| 19 | hdr: TableHeader, | 20 | hdr: TableHeader, |
| | 21 | |
| 20 | raiseTpl: usize, // TODO | 22 | raiseTpl: usize, // TODO |
| 21 | restoreTpl: usize, // TODO | 23 | restoreTpl: usize, // TODO |
| 22 | allocatePages: usize, // TODO | 24 | allocatePages: usize, // TODO |
| 23 | freePages: usize, // TODO | 25 | freePages: usize, // TODO |
| | 26 | |
| 24 | /// Returns the current memory map. | 27 | /// Returns the current memory map. |
| 25 | getMemoryMap: extern fn (*usize, [*]MemoryDescriptor, *usize, *usize, *u32) usize, | 28 | getMemoryMap: extern fn (*usize, [*]MemoryDescriptor, *usize, *usize, *u32) usize, |
| | 29 | |
| 26 | /// Allocates pool memory. | 30 | /// Allocates pool memory. |
| 27 | allocatePool: extern fn (MemoryType, usize, *align(8) [*]u8) usize, | 31 | allocatePool: extern fn (MemoryType, usize, *align(8) [*]u8) usize, |
| | 32 | |
| 28 | freePool: usize, // TODO | 33 | freePool: usize, // TODO |
| | 34 | |
| 29 | /// Creates an event. | 35 | /// Creates an event. |
| 30 | createEvent: extern fn (u32, usize, ?extern fn (Event, ?*const c_void) void, ?*const c_void, *Event) usize, | 36 | createEvent: extern fn (u32, usize, ?extern fn (Event, ?*const c_void) void, ?*const c_void, *Event) usize, |
| | 37 | |
| 31 | /// Sets the type of timer and the trigger time for a timer event. | 38 | /// Sets the type of timer and the trigger time for a timer event. |
| 32 | setTimer: extern fn (Event, TimerDelay, u64) usize, | 39 | setTimer: extern fn (Event, TimerDelay, u64) usize, |
| | 40 | |
| 33 | /// Stops execution until an event is signaled. | 41 | /// Stops execution until an event is signaled. |
| 34 | waitForEvent: extern fn (usize, [*]const Event, *usize) usize, | 42 | waitForEvent: extern fn (usize, [*]const Event, *usize) usize, |
| | 43 | |
| 35 | /// Signals an event. | 44 | /// Signals an event. |
| 36 | signalEvent: extern fn (Event) usize, | 45 | signalEvent: extern fn (Event) usize, |
| | 46 | |
| 37 | /// Closes an event. | 47 | /// Closes an event. |
| 38 | closeEvent: extern fn (Event) usize, | 48 | closeEvent: extern fn (Event) usize, |
| | 49 | |
| 39 | checkEvent: usize, // TODO | 50 | checkEvent: usize, // TODO |
| 40 | installProtocolInterface: usize, // TODO | 51 | installProtocolInterface: usize, // TODO |
| 41 | reinstallProtocolInterface: usize, // TODO | 52 | reinstallProtocolInterface: usize, // TODO |
| 42 | uninstallProtocolInterface: usize, // TODO | 53 | uninstallProtocolInterface: usize, // TODO |
| 43 | handleProtocol: usize, // TODO | 54 | |
| | 55 | /// Queries a handle to determine if it supports a specified protocol. |
| | 56 | handleProtocol: extern fn (Handle, *align(8) const Guid, *?*c_void) usize, |
| | 57 | |
| 44 | reserved: *c_void, | 58 | reserved: *c_void, |
| | 59 | |
| 45 | registerProtocolNotify: usize, // TODO | 60 | registerProtocolNotify: usize, // TODO |
| 46 | locateHandle: usize, // TODO | 61 | locateHandle: usize, // TODO |
| 47 | locateDevicePath: usize, // TODO | 62 | locateDevicePath: usize, // TODO |
| 48 | installConfigurationTable: usize, // TODO | 63 | installConfigurationTable: usize, // TODO |
| 49 | imageLoad: usize, // TODO | 64 | |
| 50 | imageStart: usize, // TODO | 65 | /// Loads an EFI image into memory. |
| | 66 | loadImage: extern fn (bool, Handle, ?*const DevicePathProtocol, ?[*]const u8, usize, *?Handle) usize, |
| | 67 | |
| | 68 | /// Transfers control to a loaded image's entry point. |
| | 69 | startImage: extern fn (Handle, ?*usize, ?*[*]u16) usize, |
| | 70 | |
| 51 | /// Terminates a loaded EFI image and returns control to boot services. | 71 | /// Terminates a loaded EFI image and returns control to boot services. |
| 52 | exit: extern fn (Handle, usize, usize, ?*const c_void) usize, | 72 | exit: extern fn (Handle, usize, usize, ?*const c_void) usize, |
| 53 | imageUnload: usize, // TODO | 73 | |
| | 74 | /// Unloads an image. |
| | 75 | unloadImage: extern fn (Handle) usize, |
| | 76 | |
| 54 | /// Terminates all boot services. | 77 | /// Terminates all boot services. |
| 55 | exitBootServices: extern fn (Handle, usize) usize, | 78 | exitBootServices: extern fn (Handle, usize) usize, |
| | 79 | |
| 56 | getNextMonotonicCount: usize, // TODO | 80 | getNextMonotonicCount: usize, // TODO |
| | 81 | |
| 57 | /// Induces a fine-grained stall. | 82 | /// Induces a fine-grained stall. |
| 58 | stall: extern fn (usize) usize, | 83 | stall: extern fn (usize) usize, |
| | 84 | |
| 59 | /// Sets the system's watchdog timer. | 85 | /// Sets the system's watchdog timer. |
| 60 | setWatchdogTimer: extern fn (usize, u64, usize, ?[*]const u16) usize, | 86 | setWatchdogTimer: extern fn (usize, u64, usize, ?[*]const u16) usize, |
| | 87 | |
| 61 | connectController: usize, // TODO | 88 | connectController: usize, // TODO |
| 62 | disconnectController: usize, // TODO | 89 | disconnectController: usize, // TODO |
| 63 | openProtocol: usize, // TODO | 90 | openProtocol: usize, // TODO |
| ... | @@ -65,8 +92,10 @@ pub const BootServices = extern struct { | ... | @@ -65,8 +92,10 @@ pub const BootServices = extern struct { |
| 65 | openProtocolInformation: usize, // TODO | 92 | openProtocolInformation: usize, // TODO |
| 66 | protocolsPerHandle: usize, // TODO | 93 | protocolsPerHandle: usize, // TODO |
| 67 | locateHandleBuffer: usize, // TODO | 94 | locateHandleBuffer: usize, // TODO |
| | 95 | |
| 68 | /// Returns the first protocol instance that matches the given protocol. | 96 | /// Returns the first protocol instance that matches the given protocol. |
| 69 | locateProtocol: extern fn (*align(8) const Guid, ?*const c_void, *?*c_void) usize, | 97 | locateProtocol: extern fn (*align(8) const Guid, ?*const c_void, *?*c_void) usize, |
| | 98 | |
| 70 | installMultipleProtocolInterfaces: usize, // TODO | 99 | installMultipleProtocolInterfaces: usize, // TODO |
| 71 | uninstallMultipleProtocolInterfaces: usize, // TODO | 100 | uninstallMultipleProtocolInterfaces: usize, // TODO |
| 72 | calculateCrc32: usize, // TODO | 101 | calculateCrc32: usize, // TODO |