summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSlendi <slendi@socopon.com>2023-09-27 13:20:39 +0300
committerSlendi <slendi@socopon.com>2023-09-27 13:20:39 +0300
commita690d970cc85ba8cce7cf99a5528f623e1743b8c (patch)
tree69d57212f50fe7ea39ee06cdb53440b69588021b
parent47653038d130865c2ae0374f5939ea7f9b4f7ccd (diff)
Implement Image Services.
Signed-off-by: Slendi <slendi@socopon.com>
-rw-r--r--efi.odin58
1 files changed, 53 insertions, 5 deletions
diff --git a/efi.odin b/efi.odin
index 1f3b1a2..005daff 100644
--- a/efi.odin
+++ b/efi.odin
@@ -136,6 +136,12 @@ EfiMemoryType :: enum {
EfiMaxMemoryType,
}
+EfiDevicePathProtocol :: struct {
+ type: u8,
+ subtype: u8,
+ length: [2]u8,
+}
+
EfiTPL :: uint
EfiRaiseTPL :: proc "c" (new_tpl: EfiTPL) -> EfiTPL
EfiRestoreTPL :: proc "c" (old_tpl: EfiTPL)
@@ -153,20 +159,50 @@ EfiGetMemoryMap :: proc "c" (
descriptor_version: u32,
) -> EfiStatus
+EfiLoadImage :: proc "c" (
+ boot_policy: bool,
+ parent_image_handle: rawptr,
+ device_path: EfiDevicePathProtocol,
+ source_buffer: rawptr,
+ source_size: uint,
+ image_handle: rawptr,
+) -> EfiStatus
+EfiStartImage :: proc "c" (
+ image_handle: rawptr,
+ exit_data_size: ^uint,
+ exit_data: ^[^]u16,
+) -> EfiStatus
+EfiUnloadImage :: proc "c" (image_handle: rawptr) -> EfiStatus
+EfiExit :: proc "c" (
+ image_handle: rawptr,
+ exit_status: EfiStatus,
+ exit_data_size: uint,
+ exit_data: [^]u16,
+) -> EfiStatus
+EfiExitBootServices :: proc "c" (image_handle: rawptr, map_key: uint) -> EfiStatus
+
EfiBootServices :: struct {
header: EfiTableHeader,
+ // Event, Timer, and Task Priority Services
raise_tpl: EfiRaiseTPL,
restore_tpl: EfiRestoreTPL,
+
+ // Memory Allocation Services
allocate_pages: EfiAllocatePages,
+ free_pages: EfiAllocatePages,
get_memory_map: EfiGetMemoryMap,
allocate_pool: EfiUnimplementedFunction,
free_pool: EfiUnimplementedFunction,
+
+ // Event, Timer, and Task Priority Services
create_event: EfiUnimplementedFunction,
set_timer: EfiUnimplementedFunction,
wait_for_event: EfiUnimplementedFunction,
signal_event: EfiUnimplementedFunction,
close_event: EfiUnimplementedFunction,
check_event: EfiUnimplementedFunction,
+
+ // Protocol Handler Services
install_protocol_interface: EfiUnimplementedFunction,
reinstall_protocol_interface: EfiUnimplementedFunction,
uninstall_protocol_interface: EfiUnimplementedFunction,
@@ -175,15 +211,23 @@ EfiBootServices :: struct {
register_protocol_notify: EfiUnimplementedFunction,
locate_handle: EfiUnimplementedFunction,
locate_device_path: EfiUnimplementedFunction,
+
+ // Miscellaneous services (1)
install_configuration_table: EfiUnimplementedFunction,
- load_image: EfiUnimplementedFunction,
- start_image: EfiUnimplementedFunction,
- exit: EfiUnimplementedFunction,
- unload_image: EfiUnimplementedFunction,
- exit_boot_services: EfiUnimplementedFunction,
+
+ // Image services
+ load_image: EfiLoadImage,
+ start_image: EfiStartImage,
+ exit: EfiExit,
+ unload_image: EfiUnloadImage,
+ exit_boot_services: EfiExitBootServices,
+
+ // Miscellaneous services (2)
get_next_monotonic_count: EfiUnimplementedFunction,
stall: EfiUnimplementedFunction,
set_watchdog_timer: EfiUnimplementedFunction,
+
+ // Protocol Handler Services
connect_controller: EfiUnimplementedFunction,
disconnect_controller: EfiUnimplementedFunction,
open_protocol: EfiUnimplementedFunction,
@@ -194,9 +238,13 @@ EfiBootServices :: struct {
locate_protocol: EfiUnimplementedFunction,
install_multiple_protocol_interfaces: EfiUnimplementedFunction,
uninstall_multiple_protocol_interfaces: EfiUnimplementedFunction,
+
+ // Miscellaneous services (3)
calculate_crc32: EfiUnimplementedFunction,
copy_mem: EfiUnimplementedFunction,
set_mem: EfiUnimplementedFunction,
+
+ // Event, Timer, and Task Priority Services
create_event_ex: EfiUnimplementedFunction,
}