authorgravatar for n@nirf.deNick Erdmann <n@nirf.de> 2019-09-03 22:04:22+02:00
committergravatar for n@nirf.deNick Erdmann <n@nirf.de> 2019-09-27 07:56:02+02:00
loga4f324e9ea37b086d5bf2aa962d74e18adeeb4d0
tree3b3bd314cd8dd91861862367a14fa499579cee4e
parent23a82b5ffdc0973e6d62b0171268781f8cbcb70d
signaturelock-open Commit is signed but in an unrecognized format.

std/os/uefi: add exitBootServices and allocatePool


2 files changed, 23 insertions(+), 20 deletions(-)

lib/std/os/uefi/tables.zig+1
......@@ -2,6 +2,7 @@ pub const BootServices = @import("tables/boot_services.zig").BootServices;
22pub const ConfigurationTable = @import("tables/configuration_table.zig").ConfigurationTable;
33pub const global_variable align(8) = @import("tables/runtime_services.zig").global_variable;
44pub const MemoryDescriptor = @import("tables/boot_services.zig").MemoryDescriptor;
5pub const MemoryType = @import("tables/boot_services.zig").MemoryType;
56pub const ResetType = @import("tables/runtime_services.zig").ResetType;
67pub const RuntimeServices = @import("tables/runtime_services.zig").RuntimeServices;
78pub const SystemTable = @import("tables/system_table.zig").SystemTable;
lib/std/os/uefi/tables/boot_services.zig+22-20
......@@ -21,7 +21,7 @@ pub const BootServices = extern struct {
2121 allocatePages: usize, // TODO
2222 freePages: usize, // TODO
2323 getMemoryMap: extern fn (*usize, [*]MemoryDescriptor, *usize, *usize, *u32) usize,
24 allocatePool: usize, // TODO
24 allocatePool: extern fn (MemoryType, usize, *align(8) [*]u8) usize,
2525 freePool: usize, // TODO
2626 createEvent: extern fn (u32, usize, ?extern fn (Event, ?*const c_void) void, ?*const c_void, *Event) usize,
2727 setTimer: extern fn (Event, TimerDelay, u64) usize,
......@@ -42,7 +42,7 @@ pub const BootServices = extern struct {
4242 imageStart: usize, // TODO
4343 exit: extern fn (Handle, usize, usize, ?*const c_void) usize,
4444 imageUnload: usize, // TODO
45 exitBootServices: usize, // TODO
45 exitBootServices: extern fn (Handle, usize) usize,
4646 getNextMonotonicCount: usize, // TODO
4747 stall: extern fn (usize) usize,
4848 setWatchdogTimer: extern fn (usize, u64, usize, ?[*]const u16) usize,
......@@ -82,25 +82,27 @@ pub const TimerDelay = extern enum(u32) {
8282 TimerRelative,
8383};
8484
85pub const MemoryType = extern enum(u32) {
86 ReservedMemoryType,
87 LoaderCode,
88 LoaderData,
89 BootServicesCode,
90 BootServicesData,
91 RuntimeServicesCode,
92 RuntimeServicesData,
93 ConventionalMemory,
94 UnusableMemory,
95 ACPIReclaimMemory,
96 ACPIMemoryNVS,
97 MemoryMappedIO,
98 MemoryMappedIOPortSpace,
99 PalCode,
100 PersistentMemory,
101 MaxMemoryType,
102};
103
85104pub const MemoryDescriptor = extern struct {
86 type: extern enum(u32) {
87 ReservedMemoryType,
88 LoaderCode,
89 LoaderData,
90 BootServicesCode,
91 BootServicesData,
92 RuntimeServicesCode,
93 RuntimeServicesData,
94 ConventionalMemory,
95 UnusableMemory,
96 ACPIReclaimMemory,
97 ACPIMemoryNVS,
98 MemoryMappedIO,
99 MemoryMappedIOPortSpace,
100 PalCode,
101 PersistentMemory,
102 MaxMemoryType,
103 },
105 type: MemoryType,
104106 physical_start: u64,
105107 virtual_start: u64,
106108 number_of_pages: usize,