| ... | @@ -20,7 +20,7 @@ pub const BootServices = extern struct { | ... | @@ -20,7 +20,7 @@ pub const BootServices = extern struct { |
| 20 | restoreTpl: usize, // TODO | 20 | restoreTpl: usize, // TODO |
| 21 | allocatePages: usize, // TODO | 21 | allocatePages: usize, // TODO |
| 22 | freePages: usize, // TODO | 22 | freePages: usize, // TODO |
| 23 | getMemoryMap: usize, // TODO | 23 | getMemoryMap: extern fn (*usize, [*]MemoryDescriptor, *usize, *usize, *u32) usize, |
| 24 | allocatePool: usize, // TODO | 24 | allocatePool: usize, // TODO |
| 25 | freePool: usize, // TODO | 25 | freePool: usize, // TODO |
| 26 | createEvent: extern fn (u32, usize, ?extern fn (Event, ?*const c_void) void, ?*const c_void, *Event) usize, | 26 | createEvent: extern fn (u32, usize, ?extern fn (Event, ?*const c_void) void, ?*const c_void, *Event) usize, |
| ... | @@ -81,3 +81,45 @@ pub const TimerDelay = extern enum(u32) { | ... | @@ -81,3 +81,45 @@ pub const TimerDelay = extern enum(u32) { |
| 81 | TimerPeriodic, | 81 | TimerPeriodic, |
| 82 | TimerRelative, | 82 | TimerRelative, |
| 83 | }; | 83 | }; |
| | 84 | |
| | 85 | pub 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 | }, |
| | 104 | physical_start: u64, |
| | 105 | virtual_start: u64, |
| | 106 | number_of_pages: usize, |
| | 107 | attribute: packed struct { |
| | 108 | uc: bool, |
| | 109 | wc: bool, |
| | 110 | wt: bool, |
| | 111 | wb: bool, |
| | 112 | uce: bool, |
| | 113 | _pad1: u7, |
| | 114 | wp: bool, |
| | 115 | rp: bool, |
| | 116 | xp: bool, |
| | 117 | nv: bool, |
| | 118 | more_reliable: bool, |
| | 119 | ro: bool, |
| | 120 | sp: bool, |
| | 121 | cpu_crypto: bool, |
| | 122 | _pad2: u43, |
| | 123 | memory_runtime: bool, |
| | 124 | }, |
| | 125 | }; |