summaryrefslogtreecommitdiff
path: root/lib/uefi.c3l/uefi/protocol/services/boot.c3i
diff options
context:
space:
mode:
authorandromeda <andromeda@bsd.my.domain>2026-10-19 18:54:26 -0400
committerandromeda <andromeda@bsd.my.domain>2026-10-19 18:54:26 -0400
commitaa113b17449e67dbd808587b411aeb21ea869974 (patch)
treeb6b7f1b71d761cbc043d5e97f72345d428c140ac /lib/uefi.c3l/uefi/protocol/services/boot.c3i
parent97d331175ae47aec3d0b990ada9754a9e4298e32 (diff)
minimal running stub
Diffstat (limited to 'lib/uefi.c3l/uefi/protocol/services/boot.c3i')
-rw-r--r--lib/uefi.c3l/uefi/protocol/services/boot.c3i86
1 files changed, 86 insertions, 0 deletions
diff --git a/lib/uefi.c3l/uefi/protocol/services/boot.c3i b/lib/uefi.c3l/uefi/protocol/services/boot.c3i
new file mode 100644
index 0000000..c5b8e06
--- /dev/null
+++ b/lib/uefi.c3l/uefi/protocol/services/boot.c3i
@@ -0,0 +1,86 @@
+module uefi::protocol::boot_services;
+
+import uefi::protocol::mem;
+
+alias AllocatePagesFn = fn EfiStatus (AllocateType, MemoryType, usz, void**);
+alias AllocatePoolFn = fn EfiStatus (MemoryType, usz, void**);
+alias FreePagesFn = fn EfiStatus (uptr, usz);
+alias FreePoolFn = fn EfiStatus (void*);
+alias GetMemoryMapFn = fn EfiStatus (usz*, MemoryDescriptor*, usz*, usz*, uint*);
+alias HandleProtocolFn = fn EfiStatus (EfiHandle, EfiGuid*, void**);
+alias ExitBootServicesFn = fn EfiStatus (EfiHandle, usz);
+alias CopyMemFn = fn void (void* dst, void* src, usz);
+alias SetMemFn = fn void (void* buf, usz, char);
+
+module uefi;
+import uefi::protocol::boot_services;
+
+struct BootServices @packed {
+ inline TableHeader header;
+
+ // Task priority services
+ void* raise_tpl;
+ void* restore_tpl;
+
+ // Memory services (uefi::protocol::mem)
+ AllocatePagesFn allocate_pages;
+ FreePagesFn free_pages;
+ GetMemoryMapFn get_memory_map;
+ AllocatePoolFn allocate_pool;
+ FreePoolFn free_pool;
+
+ // Event and Timer services
+ void* create_event;
+ void* set_timer;
+ void* wait_for_event;
+ void* signal_event;
+ void* close_event;
+ void* check_event;
+
+ // Protocol Handler services
+ void* install_protocol_interface;
+ void* reinstall_protocol_interface;
+ void* uninstall_protocol_interface;
+ HandleProtocolFn handle_protocol;
+ void* _reserved;
+ void* register_protocol_notify;
+ void* locate_handle;
+ void* locate_device_path;
+ void* install_configuration_table;
+
+ // Image services
+ void* load_image;
+ void* start_image;
+ void* exit_image;
+ void* unload_image;
+ ExitBootServicesFn exit_boot_services;
+
+ // Misc services
+ void* get_next_monotonic_count;
+ void* stall;
+ void* set_watchdog_timer;
+
+ // Driver Support services
+ void* connect_controller;
+ void* disconnect_controller;
+
+ // Open/Close Protocol services
+ void* open_protocol;
+ void* close_protocol;
+ void* open_protocol_information;
+
+ // Library services
+ void* protocols_per_handle;
+ void* locate_handle_buffer;
+ void* locate_protocol;
+ void* install_multiple_protocol_interfaces;
+ void* uninstall_multiple_protocol_interfaces;
+
+ // 32-bit CRC services
+ void* calculate_crc32;
+
+ // More misc services
+ CopyMemFn copy_mem;
+ SetMemFn set_mem;
+ void* create_event_ex;
+}