28#ifdef LIMINE_NO_POINTERS
29# define LIMINE_PTR(TYPE) uint64_t
31# define LIMINE_PTR(TYPE) TYPE
34#define LIMINE_REQUESTS_START_MARKER { 0xf6b8f4b39de7d1ae, 0xfab91a6940fcb9cf, \
35 0x785c6ed015d3e316, 0x181e920a7852b9d9 }
36#define LIMINE_REQUESTS_END_MARKER { 0xadc0e0531bb10d03, 0x9572709f31764c62 }
38#define LIMINE_BASE_REVISION(N) { 0xf9562b2d5c95a6c8, 0x6a7b384944536bdc, (N) }
40#define LIMINE_BASE_REVISION_SUPPORTED(VAR) ((VAR)[2] == 0)
42#define LIMINE_LOADED_BASE_REVISION_VALID(VAR) ((VAR)[1] != 0x6a7b384944536bdc)
43#define LIMINE_LOADED_BASE_REVISION(VAR) ((VAR)[1])
45#define LIMINE_COMMON_MAGIC 0xc7b1dd30df4c8b88, 0x0a82e883a194f07b
54#define LIMINE_MEDIA_TYPE_GENERIC 0
55#define LIMINE_MEDIA_TYPE_OPTICAL 1
56#define LIMINE_MEDIA_TYPE_TFTP 2
60 LIMINE_PTR(
void *) address;
62 LIMINE_PTR(
char *) path;
63 LIMINE_PTR(
char *) string;
68 uint32_t partition_index;
70 struct limine_uuid gpt_disk_uuid;
71 struct limine_uuid gpt_part_uuid;
72 struct limine_uuid part_uuid;
77#define LIMINE_BOOTLOADER_INFO_REQUEST_ID { LIMINE_COMMON_MAGIC, 0xf55038d8e2a1202f, 0x279426fcf5f59740 }
79struct limine_bootloader_info_response {
81 LIMINE_PTR(
char *) name;
82 LIMINE_PTR(
char *) version;
85struct limine_bootloader_info_request {
88 LIMINE_PTR(
struct limine_bootloader_info_response *) response;
93#define LIMINE_EXECUTABLE_CMDLINE_REQUEST_ID { LIMINE_COMMON_MAGIC, 0x4b161536e598651e, 0xb390ad4a2f1f303a }
95struct limine_executable_cmdline_response {
97 LIMINE_PTR(
char *) cmdline;
100struct limine_executable_cmdline_request {
103 LIMINE_PTR(
struct limine_executable_cmdline_response *) response;
108#define LIMINE_FIRMWARE_TYPE_REQUEST_ID { LIMINE_COMMON_MAGIC, 0x8c2f75d90bef28a8, 0x7045a4688eac00c3 }
110#define LIMINE_FIRMWARE_TYPE_X86BIOS 0
111#define LIMINE_FIRMWARE_TYPE_EFI32 1
112#define LIMINE_FIRMWARE_TYPE_EFI64 2
113#define LIMINE_FIRMWARE_TYPE_SBI 3
115struct limine_firmware_type_response {
117 uint64_t firmware_type;
120struct limine_firmware_type_request {
123 LIMINE_PTR(
struct limine_firmware_type_response *) response;
128#define LIMINE_STACK_SIZE_REQUEST_ID { LIMINE_COMMON_MAGIC, 0x224ef0460a8e8926, 0xe1cb0fc25f46ea3d }
130struct limine_stack_size_response {
134struct limine_stack_size_request {
137 LIMINE_PTR(
struct limine_stack_size_response *) response;
143#define LIMINE_HHDM_REQUEST_ID { LIMINE_COMMON_MAGIC, 0x48dcf1cb8ad2b852, 0x63984e959a98244b }
145struct limine_hhdm_response {
150struct limine_hhdm_request {
153 LIMINE_PTR(
struct limine_hhdm_response *) response;
158#define LIMINE_FRAMEBUFFER_REQUEST_ID { LIMINE_COMMON_MAGIC, 0x9d5827dcd881dd75, 0xa3148604f6fab11b }
160#define LIMINE_FRAMEBUFFER_RGB 1
162struct limine_video_mode {
167 uint8_t memory_model;
168 uint8_t red_mask_size;
169 uint8_t red_mask_shift;
170 uint8_t green_mask_size;
171 uint8_t green_mask_shift;
172 uint8_t blue_mask_size;
173 uint8_t blue_mask_shift;
176struct limine_framebuffer {
177 LIMINE_PTR(
void *) address;
182 uint8_t memory_model;
183 uint8_t red_mask_size;
184 uint8_t red_mask_shift;
185 uint8_t green_mask_size;
186 uint8_t green_mask_shift;
187 uint8_t blue_mask_size;
188 uint8_t blue_mask_shift;
191 LIMINE_PTR(
void *) edid;
194 LIMINE_PTR(
struct limine_video_mode **) modes;
197struct limine_framebuffer_response {
199 uint64_t framebuffer_count;
200 LIMINE_PTR(
struct limine_framebuffer **) framebuffers;
203struct limine_framebuffer_request {
206 LIMINE_PTR(
struct limine_framebuffer_response *) response;
211#define LIMINE_PAGING_MODE_REQUEST_ID { LIMINE_COMMON_MAGIC, 0x95c1a0edab0944cb, 0xa4e5cb3842f7488a }
213#define LIMINE_PAGING_MODE_X86_64_4LVL 0
214#define LIMINE_PAGING_MODE_X86_64_5LVL 1
215#define LIMINE_PAGING_MODE_X86_64_MIN LIMINE_PAGING_MODE_X86_64_4LVL
216#define LIMINE_PAGING_MODE_X86_64_DEFAULT LIMINE_PAGING_MODE_X86_64_4LVL
218#define LIMINE_PAGING_MODE_AARCH64_4LVL 0
219#define LIMINE_PAGING_MODE_AARCH64_5LVL 1
220#define LIMINE_PAGING_MODE_AARCH64_MIN LIMINE_PAGING_MODE_AARCH64_4LVL
221#define LIMINE_PAGING_MODE_AARCH64_DEFAULT LIMINE_PAGING_MODE_AARCH64_4LVL
223#define LIMINE_PAGING_MODE_RISCV_SV39 0
224#define LIMINE_PAGING_MODE_RISCV_SV48 1
225#define LIMINE_PAGING_MODE_RISCV_SV57 2
226#define LIMINE_PAGING_MODE_RISCV_MIN LIMINE_PAGING_MODE_RISCV_SV39
227#define LIMINE_PAGING_MODE_RISCV_DEFAULT LIMINE_PAGING_MODE_RISCV_SV48
229#define LIMINE_PAGING_MODE_LOONGARCH_4LVL 0
230#define LIMINE_PAGING_MODE_LOONGARCH_MIN LIMINE_PAGING_MODE_LOONGARCH_4LVL
231#define LIMINE_PAGING_MODE_LOONGARCH_DEFAULT LIMINE_PAGING_MODE_LOONGARCH_4LVL
233struct limine_paging_mode_response {
238struct limine_paging_mode_request {
241 LIMINE_PTR(
struct limine_paging_mode_response *) response;
249#define LIMINE_MP_REQUEST_ID { LIMINE_COMMON_MAGIC, 0x95a67b819a1b857e, 0xa0b61b723b6a73e0 }
251struct limine_mp_info;
253typedef void (*limine_goto_address)(
struct limine_mp_info *);
255#if defined (__x86_64__) || defined (__i386__)
257#define LIMINE_MP_RESPONSE_X86_64_X2APIC (1 << 0)
259struct limine_mp_info {
260 uint32_t processor_id;
263 LIMINE_PTR(limine_goto_address) goto_address;
264 uint64_t extra_argument;
267struct limine_mp_response {
270 uint32_t bsp_lapic_id;
272 LIMINE_PTR(
struct limine_mp_info **) cpus;
275#elif defined (__aarch64__)
277struct limine_mp_info {
278 uint32_t processor_id;
282 LIMINE_PTR(limine_goto_address) goto_address;
283 uint64_t extra_argument;
286struct limine_mp_response {
291 LIMINE_PTR(
struct limine_mp_info **) cpus;
294#elif defined (__riscv) && (__riscv_xlen == 64)
296struct limine_mp_info {
297 uint64_t processor_id;
300 LIMINE_PTR(limine_goto_address) goto_address;
301 uint64_t extra_argument;
304struct limine_mp_response {
309 LIMINE_PTR(
struct limine_mp_info **) cpus;
312#elif defined (__loongarch__) && (__loongarch_grlen == 64)
314struct limine_mp_info {
318struct limine_mp_response {
320 LIMINE_PTR(
struct limine_mp_info **) cpus;
324#error Unknown architecture
327#define LIMINE_MP_REQUEST_X86_64_X2APIC (1 << 0)
329struct limine_mp_request {
332 LIMINE_PTR(
struct limine_mp_response *) response;
338#define LIMINE_MEMMAP_REQUEST_ID { LIMINE_COMMON_MAGIC, 0x67cf3d9d378a806f, 0xe304acdfc50c3c62 }
340#define LIMINE_MEMMAP_USABLE 0
341#define LIMINE_MEMMAP_RESERVED 1
342#define LIMINE_MEMMAP_ACPI_RECLAIMABLE 2
343#define LIMINE_MEMMAP_ACPI_NVS 3
344#define LIMINE_MEMMAP_BAD_MEMORY 4
345#define LIMINE_MEMMAP_BOOTLOADER_RECLAIMABLE 5
346#define LIMINE_MEMMAP_EXECUTABLE_AND_MODULES 6
347#define LIMINE_MEMMAP_FRAMEBUFFER 7
348#define LIMINE_MEMMAP_ACPI_TABLES 8
350struct limine_memmap_entry {
356struct limine_memmap_response {
358 uint64_t entry_count;
359 LIMINE_PTR(
struct limine_memmap_entry **) entries;
362struct limine_memmap_request {
365 LIMINE_PTR(
struct limine_memmap_response *) response;
370#define LIMINE_ENTRY_POINT_REQUEST_ID { LIMINE_COMMON_MAGIC, 0x13d86c035a1cd3e1, 0x2b0caa89d8f3026a }
372typedef void (*limine_entry_point)(void);
374struct limine_entry_point_response {
378struct limine_entry_point_request {
381 LIMINE_PTR(
struct limine_entry_point_response *) response;
382 LIMINE_PTR(limine_entry_point) entry;
387#define LIMINE_EXECUTABLE_FILE_REQUEST_ID { LIMINE_COMMON_MAGIC, 0xad97e90e83f1ed67, 0x31eb5d1c5ff23b69 }
389struct limine_executable_file_response {
391 LIMINE_PTR(
struct limine_file *) executable_file;
394struct limine_executable_file_request {
397 LIMINE_PTR(
struct limine_executable_file_response *) response;
402#define LIMINE_MODULE_REQUEST_ID { LIMINE_COMMON_MAGIC, 0x3e7e279702be32af, 0xca1c4f3bd1280cee }
404#define LIMINE_INTERNAL_MODULE_REQUIRED (1 << 0)
405#define LIMINE_INTERNAL_MODULE_COMPRESSED (1 << 1)
407struct limine_internal_module {
408 LIMINE_PTR(
const char *) path;
409 LIMINE_PTR(
const char *) string;
413struct limine_module_response {
415 uint64_t module_count;
416 LIMINE_PTR(
struct limine_file **) modules;
419struct limine_module_request {
422 LIMINE_PTR(
struct limine_module_response *) response;
425 uint64_t internal_module_count;
426 LIMINE_PTR(
struct limine_internal_module **) internal_modules;
431#define LIMINE_RSDP_REQUEST_ID { LIMINE_COMMON_MAGIC, 0xc5e77b6b397e7b43, 0x27637845accdcf3c }
433struct limine_rsdp_response {
435 LIMINE_PTR(
void *) address;
438struct limine_rsdp_request {
441 LIMINE_PTR(
struct limine_rsdp_response *) response;
446#define LIMINE_SMBIOS_REQUEST_ID { LIMINE_COMMON_MAGIC, 0x9e9046f11e095391, 0xaa4a520fefbde5ee }
448struct limine_smbios_response {
454struct limine_smbios_request {
457 LIMINE_PTR(
struct limine_smbios_response *) response;
462#define LIMINE_EFI_SYSTEM_TABLE_REQUEST_ID { LIMINE_COMMON_MAGIC, 0x5ceba5163eaaf6d6, 0x0a6981610cf65fcc }
464struct limine_efi_system_table_response {
469struct limine_efi_system_table_request {
472 LIMINE_PTR(
struct limine_efi_system_table_response *) response;
477#define LIMINE_EFI_MEMMAP_REQUEST_ID { LIMINE_COMMON_MAGIC, 0x7df62a431d6872d5, 0xa4fcdfb3e57306c8 }
479struct limine_efi_memmap_response {
481 LIMINE_PTR(
void *) memmap;
482 uint64_t memmap_size;
484 uint64_t desc_version;
487struct limine_efi_memmap_request {
490 LIMINE_PTR(
struct limine_efi_memmap_response *) response;
495#define LIMINE_DATE_AT_BOOT_REQUEST_ID { LIMINE_COMMON_MAGIC, 0x502746e184c088aa, 0xfbc5ec83e6327893 }
497struct limine_date_at_boot_response {
502struct limine_date_at_boot_request {
505 LIMINE_PTR(
struct limine_date_at_boot_response *) response;
510#define LIMINE_EXECUTABLE_ADDRESS_REQUEST_ID { LIMINE_COMMON_MAGIC, 0x71ba76863cc55f63, 0xb2644a48c516a487 }
512struct limine_executable_address_response {
514 uint64_t physical_base;
515 uint64_t virtual_base;
518struct limine_executable_address_request {
521 LIMINE_PTR(
struct limine_executable_address_response *) response;
526#define LIMINE_DTB_REQUEST_ID { LIMINE_COMMON_MAGIC, 0xb40ddb48fb54bac7, 0x545081493f81ffb7 }
528struct limine_dtb_response {
530 LIMINE_PTR(
void *) dtb_ptr;
533struct limine_dtb_request {
536 LIMINE_PTR(
struct limine_dtb_response *) response;
541#define LIMINE_RISCV_BSP_HARTID_REQUEST_ID { LIMINE_COMMON_MAGIC, 0x1369359f025525f9, 0x2ff2a56178391bb6 }
543struct limine_riscv_bsp_hartid_response {
548struct limine_riscv_bsp_hartid_request {
551 LIMINE_PTR(
struct limine_riscv_bsp_hartid_response *) response;
556#define LIMINE_BOOTLOADER_PERFORMANCE_REQUEST_ID { LIMINE_COMMON_MAGIC, 0x6b50ad9bf36d13ad, 0xdc4c7e88fc759e17 }
558struct limine_bootloader_performance_response {
565struct limine_bootloader_performance_request {
568 LIMINE_PTR(
struct limine_bootloader_performance_response *) response;