| ... | ... | @@ -21,138 +21,138 @@ pub const BootServices = extern struct { |
| 21 | 21 | hdr: TableHeader, |
| 22 | 22 | |
| 23 | 23 | /// Raises a task's priority level and returns its previous level. |
| 24 | | raiseTpl: fn (usize) callconv(.C) usize, |
| 24 | raiseTpl: fn (new_tpl: usize) callconv(.C) usize, |
| 25 | 25 | |
| 26 | 26 | /// Restores a task's priority level to its previous value. |
| 27 | | restoreTpl: fn (usize) callconv(.C) void, |
| 27 | restoreTpl: fn (old_tpl: usize) callconv(.C) void, |
| 28 | 28 | |
| 29 | 29 | /// Allocates memory pages from the system. |
| 30 | | allocatePages: fn (AllocateType, MemoryType, usize, *[*]align(4096) u8) callconv(.C) Status, |
| 30 | allocatePages: fn (alloc_type: AllocateType, mem_type: MemoryType, pages: usize, memory: *[*]align(4096) u8) callconv(.C) Status, |
| 31 | 31 | |
| 32 | 32 | /// Frees memory pages. |
| 33 | | freePages: fn ([*]align(4096) u8, usize) callconv(.C) Status, |
| 33 | freePages: fn (memory: [*]align(4096) u8, pages: usize) callconv(.C) Status, |
| 34 | 34 | |
| 35 | 35 | /// Returns the current memory map. |
| 36 | | getMemoryMap: fn (*usize, [*]MemoryDescriptor, *usize, *usize, *u32) callconv(.C) Status, |
| 36 | getMemoryMap: fn (mmap_size: *usize, mmap: [*]MemoryDescriptor, mapKey: *usize, descriptor_size: *usize, descriptor_version: *u32) callconv(.C) Status, |
| 37 | 37 | |
| 38 | 38 | /// Allocates pool memory. |
| 39 | | allocatePool: fn (MemoryType, usize, *[*]align(8) u8) callconv(.C) Status, |
| 39 | allocatePool: fn (pool_type: MemoryType, size: usize, buffer: *[*]align(8) u8) callconv(.C) Status, |
| 40 | 40 | |
| 41 | 41 | /// Returns pool memory to the system. |
| 42 | | freePool: fn ([*]align(8) u8) callconv(.C) Status, |
| 42 | freePool: fn (buffer: [*]align(8) u8) callconv(.C) Status, |
| 43 | 43 | |
| 44 | 44 | /// Creates an event. |
| 45 | | createEvent: fn (u32, usize, ?fn (Event, ?*anyopaque) callconv(.C) void, ?*const anyopaque, *Event) callconv(.C) Status, |
| 45 | createEvent: fn (type: u32, notify_tpl: usize, notify_func: ?fn (Event, ?*anyopaque) callconv(.C) void, notifyCtx: ?*const anyopaque, event: *Event) callconv(.C) Status, |
| 46 | 46 | |
| 47 | 47 | /// Sets the type of timer and the trigger time for a timer event. |
| 48 | | setTimer: fn (Event, TimerDelay, u64) callconv(.C) Status, |
| 48 | setTimer: fn (event: Event, type: TimerDelay, triggerTime: u64) callconv(.C) Status, |
| 49 | 49 | |
| 50 | 50 | /// Stops execution until an event is signaled. |
| 51 | | waitForEvent: fn (usize, [*]const Event, *usize) callconv(.C) Status, |
| 51 | waitForEvent: fn (event_len: usize, events: [*]const Event, index: *usize) callconv(.C) Status, |
| 52 | 52 | |
| 53 | 53 | /// Signals an event. |
| 54 | | signalEvent: fn (Event) callconv(.C) Status, |
| 54 | signalEvent: fn (event: Event) callconv(.C) Status, |
| 55 | 55 | |
| 56 | 56 | /// Closes an event. |
| 57 | | closeEvent: fn (Event) callconv(.C) Status, |
| 57 | closeEvent: fn (event: Event) callconv(.C) Status, |
| 58 | 58 | |
| 59 | 59 | /// Checks whether an event is in the signaled state. |
| 60 | | checkEvent: fn (Event) callconv(.C) Status, |
| 60 | checkEvent: fn (event: Event) callconv(.C) Status, |
| 61 | 61 | |
| 62 | 62 | /// Installs a protocol interface on a device handle. If the handle does not exist, it is created |
| 63 | 63 | /// and added to the list of handles in the system. installMultipleProtocolInterfaces() |
| 64 | 64 | /// performs more error checking than installProtocolInterface(), so its use is recommended over this. |
| 65 | | installProtocolInterface: fn (Handle, *align(8) const Guid, EfiInterfaceType, *anyopaque) callconv(.C) Status, |
| 65 | installProtocolInterface: fn (handle: Handle, protocol: *align(8) const Guid, interface_type: EfiInterfaceType, interface: *anyopaque) callconv(.C) Status, |
| 66 | 66 | |
| 67 | 67 | /// Reinstalls a protocol interface on a device handle |
| 68 | | reinstallProtocolInterface: fn (Handle, *align(8) const Guid, *anyopaque, *anyopaque) callconv(.C) Status, |
| 68 | reinstallProtocolInterface: fn (handle: Handle, protocol: *align(8) const Guid, old_interface: *anyopaque, new_interface: *anyopaque) callconv(.C) Status, |
| 69 | 69 | |
| 70 | 70 | /// Removes a protocol interface from a device handle. Usage of |
| 71 | 71 | /// uninstallMultipleProtocolInterfaces is recommended over this. |
| 72 | | uninstallProtocolInterface: fn (Handle, *align(8) const Guid, *anyopaque) callconv(.C) Status, |
| 72 | uninstallProtocolInterface: fn (handle: Handle, protocol: *align(8) const Guid, interface: *anyopaque) callconv(.C) Status, |
| 73 | 73 | |
| 74 | 74 | /// Queries a handle to determine if it supports a specified protocol. |
| 75 | | handleProtocol: fn (Handle, *align(8) const Guid, *?*anyopaque) callconv(.C) Status, |
| 75 | handleProtocol: fn (handle: Handle, protocol: *align(8) const Guid, interface: *?*anyopaque) callconv(.C) Status, |
| 76 | 76 | |
| 77 | 77 | reserved: *anyopaque, |
| 78 | 78 | |
| 79 | 79 | /// Creates an event that is to be signaled whenever an interface is installed for a specified protocol. |
| 80 | | registerProtocolNotify: fn (*align(8) const Guid, Event, **anyopaque) callconv(.C) Status, |
| 80 | registerProtocolNotify: fn (protocol: *align(8) const Guid, event: Event, registration: **anyopaque) callconv(.C) Status, |
| 81 | 81 | |
| 82 | 82 | /// Returns an array of handles that support a specified protocol. |
| 83 | | locateHandle: fn (LocateSearchType, ?*align(8) const Guid, ?*const anyopaque, *usize, [*]Handle) callconv(.C) Status, |
| 83 | locateHandle: fn (search_type: LocateSearchType, protocol: ?*align(8) const Guid, search_key: ?*const anyopaque, bufferSize: *usize, buffer: [*]Handle) callconv(.C) Status, |
| 84 | 84 | |
| 85 | 85 | /// Locates the handle to a device on the device path that supports the specified protocol |
| 86 | | locateDevicePath: fn (*align(8) const Guid, **const DevicePathProtocol, *?Handle) callconv(.C) Status, |
| 86 | locateDevicePath: fn (protocols: *align(8) const Guid, device_path: **const DevicePathProtocol, device: *?Handle) callconv(.C) Status, |
| 87 | 87 | |
| 88 | 88 | /// Adds, updates, or removes a configuration table entry from the EFI System Table. |
| 89 | | installConfigurationTable: fn (*align(8) const Guid, ?*anyopaque) callconv(.C) Status, |
| 89 | installConfigurationTable: fn (guid: *align(8) const Guid, table: ?*anyopaque) callconv(.C) Status, |
| 90 | 90 | |
| 91 | 91 | /// Loads an EFI image into memory. |
| 92 | | loadImage: fn (bool, Handle, ?*const DevicePathProtocol, ?[*]const u8, usize, *?Handle) callconv(.C) Status, |
| 92 | loadImage: fn (boot_policy: bool, parent_image_handle: Handle, device_path: ?*const DevicePathProtocol, source_buffer: ?[*]const u8, source_size: usize, imageHandle: *?Handle) callconv(.C) Status, |
| 93 | 93 | |
| 94 | 94 | /// Transfers control to a loaded image's entry point. |
| 95 | | startImage: fn (Handle, ?*usize, ?*[*]u16) callconv(.C) Status, |
| 95 | startImage: fn (image_handle: Handle, exit_data_size: ?*usize, exit_data: ?*[*]u16) callconv(.C) Status, |
| 96 | 96 | |
| 97 | 97 | /// Terminates a loaded EFI image and returns control to boot services. |
| 98 | | exit: fn (Handle, Status, usize, ?*const anyopaque) callconv(.C) Status, |
| 98 | exit: fn (image_handle: Handle, exit_status: Status, exit_data_size: usize, exit_data: ?*const anyopaque) callconv(.C) Status, |
| 99 | 99 | |
| 100 | 100 | /// Unloads an image. |
| 101 | | unloadImage: fn (Handle) callconv(.C) Status, |
| 101 | unloadImage: fn (image_handle: Handle) callconv(.C) Status, |
| 102 | 102 | |
| 103 | 103 | /// Terminates all boot services. |
| 104 | | exitBootServices: fn (Handle, usize) callconv(.C) Status, |
| 104 | exitBootServices: fn (image_handle: Handle, map_key: usize) callconv(.C) Status, |
| 105 | 105 | |
| 106 | 106 | /// Returns a monotonically increasing count for the platform. |
| 107 | | getNextMonotonicCount: fn (*u64) callconv(.C) Status, |
| 107 | getNextMonotonicCount: fn (count: *u64) callconv(.C) Status, |
| 108 | 108 | |
| 109 | 109 | /// Induces a fine-grained stall. |
| 110 | | stall: fn (usize) callconv(.C) Status, |
| 110 | stall: fn (microseconds: usize) callconv(.C) Status, |
| 111 | 111 | |
| 112 | 112 | /// Sets the system's watchdog timer. |
| 113 | | setWatchdogTimer: fn (usize, u64, usize, ?[*]const u16) callconv(.C) Status, |
| 113 | setWatchdogTimer: fn (timeout: usize, watchdogCode: u64, data_size: usize, watchdog_data: ?[*]const u16) callconv(.C) Status, |
| 114 | 114 | |
| 115 | 115 | /// Connects one or more drives to a controller. |
| 116 | | connectController: fn (Handle, ?Handle, ?*DevicePathProtocol, bool) callconv(.C) Status, |
| 116 | connectController: fn (controller_handle: Handle, driver_image_handle: ?Handle, remaining_device_path: ?*DevicePathProtocol, recursive: bool) callconv(.C) Status, |
| 117 | 117 | |
| 118 | 118 | // Disconnects one or more drivers from a controller |
| 119 | | disconnectController: fn (Handle, ?Handle, ?Handle) callconv(.C) Status, |
| 119 | disconnectController: fn (controller_handle: Handle, driver_image_handle: ?Handle, child_handle: ?Handle) callconv(.C) Status, |
| 120 | 120 | |
| 121 | 121 | /// Queries a handle to determine if it supports a specified protocol. |
| 122 | | openProtocol: fn (Handle, *align(8) const Guid, *?*anyopaque, ?Handle, ?Handle, OpenProtocolAttributes) callconv(.C) Status, |
| 122 | openProtocol: fn (handle: Handle, protocol: *align(8) const Guid, interface: *?*anyopaque, agent_handle: ?Handle, controller_handle: ?Handle, attributes: OpenProtocolAttributes) callconv(.C) Status, |
| 123 | 123 | |
| 124 | 124 | /// Closes a protocol on a handle that was opened using openProtocol(). |
| 125 | | closeProtocol: fn (Handle, *align(8) const Guid, Handle, ?Handle) callconv(.C) Status, |
| 125 | closeProtocol: fn (handle: Handle, protocol: *align(8) const Guid, agentHandle: Handle, controller_handle: ?Handle) callconv(.C) Status, |
| 126 | 126 | |
| 127 | 127 | /// Retrieves the list of agents that currently have a protocol interface opened. |
| 128 | | openProtocolInformation: fn (Handle, *align(8) const Guid, *[*]ProtocolInformationEntry, *usize) callconv(.C) Status, |
| 128 | openProtocolInformation: fn (handle: Handle, protocol: *align(8) const Guid, entry_buffer: *[*]ProtocolInformationEntry, entry_count: *usize) callconv(.C) Status, |
| 129 | 129 | |
| 130 | 130 | /// Retrieves the list of protocol interface GUIDs that are installed on a handle in a buffer allocated from pool. |
| 131 | | protocolsPerHandle: fn (Handle, *[*]*align(8) const Guid, *usize) callconv(.C) Status, |
| 131 | protocolsPerHandle: fn (handle: Handle, protocol_buffer: *[*]*align(8) const Guid, protocol_buffer_count: *usize) callconv(.C) Status, |
| 132 | 132 | |
| 133 | 133 | /// Returns an array of handles that support the requested protocol in a buffer allocated from pool. |
| 134 | | locateHandleBuffer: fn (LocateSearchType, ?*align(8) const Guid, ?*const anyopaque, *usize, *[*]Handle) callconv(.C) Status, |
| 134 | locateHandleBuffer: fn (search_type: LocateSearchType, protocol: ?*align(8) const Guid, search_key: ?*const anyopaque, num_handles: *usize, buffer: *[*]Handle) callconv(.C) Status, |
| 135 | 135 | |
| 136 | 136 | /// Returns the first protocol instance that matches the given protocol. |
| 137 | | locateProtocol: fn (*align(8) const Guid, ?*const anyopaque, *?*anyopaque) callconv(.C) Status, |
| 137 | locateProtocol: fn (protocol: *align(8) const Guid, registration: ?*const anyopaque, interface: *?*anyopaque) callconv(.C) Status, |
| 138 | 138 | |
| 139 | 139 | /// Installs one or more protocol interfaces into the boot services environment |
| 140 | | installMultipleProtocolInterfaces: fn (*Handle, ...) callconv(.C) Status, |
| 140 | installMultipleProtocolInterfaces: fn (handle: *Handle, ...) callconv(.C) Status, |
| 141 | 141 | |
| 142 | 142 | /// Removes one or more protocol interfaces into the boot services environment |
| 143 | | uninstallMultipleProtocolInterfaces: fn (*Handle, ...) callconv(.C) Status, |
| 143 | uninstallMultipleProtocolInterfaces: fn (handle: *Handle, ...) callconv(.C) Status, |
| 144 | 144 | |
| 145 | 145 | /// Computes and returns a 32-bit CRC for a data buffer. |
| 146 | | calculateCrc32: fn ([*]const u8, usize, *u32) callconv(.C) Status, |
| 146 | calculateCrc32: fn (data: [*]const u8, data_size: usize, *u32) callconv(.C) Status, |
| 147 | 147 | |
| 148 | 148 | /// Copies the contents of one buffer to another buffer |
| 149 | | copyMem: fn ([*]u8, [*]const u8, usize) callconv(.C) void, |
| 149 | copyMem: fn (dest: [*]u8, src: [*]const u8, len: usize) callconv(.C) void, |
| 150 | 150 | |
| 151 | 151 | /// Fills a buffer with a specified value |
| 152 | | setMem: fn ([*]u8, usize, u8) callconv(.C) void, |
| 152 | setMem: fn (buffer: [*]u8, size: usize, value: u8) callconv(.C) void, |
| 153 | 153 | |
| 154 | 154 | /// Creates an event in a group. |
| 155 | | createEventEx: fn (u32, usize, EfiEventNotify, *const anyopaque, *align(8) const Guid, *Event) callconv(.C) Status, |
| 155 | createEventEx: fn (type: u32, notify_tpl: usize, notify_func: EfiEventNotify, notify_ctx: *const anyopaque, event_group: *align(8) const Guid, event: *Event) callconv(.C) Status, |
| 156 | 156 | |
| 157 | 157 | pub const signature: u64 = 0x56524553544f4f42; |
| 158 | 158 | |