limine: Header cleanup
This commit is contained in:
parent
80ba39503d
commit
01fd8257e3
@ -21,6 +21,7 @@ struct limine_uuid {
|
||||
};
|
||||
|
||||
struct limine_file_location {
|
||||
uint64_t revision;
|
||||
uint64_t partition_index;
|
||||
uint32_t pxe_ip;
|
||||
uint32_t pxe_port;
|
||||
@ -87,9 +88,8 @@ struct limine_framebuffer {
|
||||
|
||||
struct limine_framebuffer_response {
|
||||
uint64_t revision;
|
||||
|
||||
uint64_t fbs_count;
|
||||
LIMINE_PTR(LIMINE_PTR(struct limine_framebuffer *) *) fbs;
|
||||
uint64_t framebuffer_count;
|
||||
LIMINE_PTR(struct limine_framebuffer **) framebuffers;
|
||||
};
|
||||
|
||||
struct limine_framebuffer_request {
|
||||
@ -128,11 +128,10 @@ struct limine_smp_info {
|
||||
|
||||
struct limine_smp_response {
|
||||
uint64_t revision;
|
||||
|
||||
uint32_t flags;
|
||||
uint32_t bsp_lapic_id;
|
||||
uint64_t cpus_count;
|
||||
LIMINE_PTR(LIMINE_PTR(struct limine_smp_info *) *) cpus;
|
||||
uint64_t cpu_count;
|
||||
LIMINE_PTR(struct limine_smp_info **) cpus;
|
||||
};
|
||||
|
||||
struct limine_smp_request {
|
||||
@ -163,9 +162,8 @@ struct limine_memmap_entry {
|
||||
|
||||
struct limine_memmap_response {
|
||||
uint64_t revision;
|
||||
|
||||
uint64_t entries_count;
|
||||
LIMINE_PTR(LIMINE_PTR(struct limine_memmap_entry *) *) entries;
|
||||
uint64_t entry_count;
|
||||
LIMINE_PTR(struct limine_memmap_entry **) entries;
|
||||
};
|
||||
|
||||
struct limine_memmap_request {
|
||||
@ -186,7 +184,6 @@ struct limine_entry_point_request {
|
||||
uint64_t id[4];
|
||||
uint64_t revision;
|
||||
LIMINE_PTR(struct limine_entry_point_response *) response;
|
||||
|
||||
LIMINE_PTR(void *) entry;
|
||||
};
|
||||
|
||||
@ -204,9 +201,8 @@ struct limine_module {
|
||||
|
||||
struct limine_module_response {
|
||||
uint64_t revision;
|
||||
|
||||
uint64_t modules_count;
|
||||
LIMINE_PTR(LIMINE_PTR(struct limine_module *) *) modules;
|
||||
uint64_t module_count;
|
||||
LIMINE_PTR(struct limine_module **) modules;
|
||||
};
|
||||
|
||||
struct limine_module_request {
|
||||
@ -221,7 +217,6 @@ struct limine_module_request {
|
||||
|
||||
struct limine_rsdp_response {
|
||||
uint64_t revision;
|
||||
|
||||
LIMINE_PTR(void *) address;
|
||||
};
|
||||
|
||||
@ -237,7 +232,6 @@ struct limine_rsdp_request {
|
||||
|
||||
struct limine_smbios_response {
|
||||
uint64_t revision;
|
||||
|
||||
LIMINE_PTR(void *) entry_32;
|
||||
LIMINE_PTR(void *) entry_64;
|
||||
};
|
||||
@ -254,7 +248,6 @@ struct limine_smbios_request {
|
||||
|
||||
struct limine_efi_system_table_response {
|
||||
uint64_t revision;
|
||||
|
||||
LIMINE_PTR(void *) address;
|
||||
};
|
||||
|
||||
@ -270,7 +263,6 @@ struct limine_efi_system_table_request {
|
||||
|
||||
struct limine_boot_time_response {
|
||||
uint64_t revision;
|
||||
|
||||
int64_t boot_time;
|
||||
};
|
||||
|
||||
@ -286,7 +278,6 @@ struct limine_boot_time_request {
|
||||
|
||||
struct limine_kernel_address_response {
|
||||
uint64_t revision;
|
||||
|
||||
uint64_t physical_base;
|
||||
uint64_t virtual_base;
|
||||
};
|
||||
|
@ -403,7 +403,7 @@ FEAT_START
|
||||
modules_list[i] = reported_addr(&modules[i]);
|
||||
}
|
||||
|
||||
module_response->modules_count = module_count;
|
||||
module_response->module_count = module_count;
|
||||
module_response->modules = reported_addr(modules_list);
|
||||
|
||||
module_request->response = reported_addr(module_response);
|
||||
@ -463,8 +463,8 @@ FEAT_START
|
||||
uint64_t *fb_list = ext_mem_alloc(1 * sizeof(uint64_t));
|
||||
fb_list[0] = reported_addr(fbp);
|
||||
|
||||
framebuffer_response->fbs_count = 1;
|
||||
framebuffer_response->fbs = reported_addr(fb_list);
|
||||
framebuffer_response->framebuffer_count = 1;
|
||||
framebuffer_response->framebuffers = reported_addr(fb_list);
|
||||
|
||||
framebuffer_request->response = reported_addr(framebuffer_response);
|
||||
FEAT_END
|
||||
@ -541,7 +541,7 @@ FEAT_START
|
||||
smp_list[i] = reported_addr(&smp_array[i]);
|
||||
}
|
||||
|
||||
smp_response->cpus_count = cpu_count;
|
||||
smp_response->cpu_count = cpu_count;
|
||||
smp_response->cpus = reported_addr(smp_list);
|
||||
|
||||
smp_request->response = reported_addr(smp_response);
|
||||
@ -608,7 +608,7 @@ FEAT_START
|
||||
memmap_list[i] = reported_addr(&_memmap[i]);
|
||||
}
|
||||
|
||||
memmap_response->entries_count = mmap_entries;
|
||||
memmap_response->entry_count = mmap_entries;
|
||||
memmap_response->entries = reported_addr(memmap_list);
|
||||
|
||||
memmap_request->response = reported_addr(memmap_response);
|
||||
|
@ -91,6 +91,7 @@ static char *get_memmap_type(uint64_t type) {
|
||||
}
|
||||
|
||||
static void print_file_loc(struct limine_file_location *file_location) {
|
||||
e9_printf("Loc->Revision: %d", file_location->revision);
|
||||
e9_printf("Loc->PartIndex: %d", file_location->partition_index);
|
||||
e9_printf("Loc->PXEIP: %d.%d.%d.%d",
|
||||
(file_location->pxe_ip & (0xff << 0)) >> 0,
|
||||
@ -128,17 +129,6 @@ static void limine_main(void) {
|
||||
|
||||
e9_printf("Kernel slide: %x", kernel_slide);
|
||||
|
||||
FEAT_START
|
||||
e9_printf("");
|
||||
if (kernel_address_request.response == NULL) {
|
||||
e9_printf("Kernel address not passed");
|
||||
break;
|
||||
}
|
||||
struct limine_kernel_address_response *ka_response = kernel_address_request.response;
|
||||
e9_printf("Physical base: %x", ka_response->physical_base);
|
||||
e9_printf("Virtual base: %x", ka_response->virtual_base);
|
||||
FEAT_END
|
||||
|
||||
FEAT_START
|
||||
e9_printf("");
|
||||
if (bootloader_info_request.response == NULL) {
|
||||
@ -146,10 +136,23 @@ FEAT_START
|
||||
break;
|
||||
}
|
||||
struct limine_bootloader_info_response *bootloader_info_response = bootloader_info_request.response;
|
||||
e9_printf("Bootloader info feature, revision %d", bootloader_info_response->revision);
|
||||
e9_printf("Bootloader name: %s", bootloader_info_response->name);
|
||||
e9_printf("Bootloader version: %s", bootloader_info_response->version);
|
||||
FEAT_END
|
||||
|
||||
FEAT_START
|
||||
e9_printf("");
|
||||
if (kernel_address_request.response == NULL) {
|
||||
e9_printf("Kernel address not passed");
|
||||
break;
|
||||
}
|
||||
struct limine_kernel_address_response *ka_response = kernel_address_request.response;
|
||||
e9_printf("Kernel address feature, revision %d", ka_response->revision);
|
||||
e9_printf("Physical base: %x", ka_response->physical_base);
|
||||
e9_printf("Virtual base: %x", ka_response->virtual_base);
|
||||
FEAT_END
|
||||
|
||||
FEAT_START
|
||||
e9_printf("");
|
||||
if (hhdm_request.response == NULL) {
|
||||
@ -157,6 +160,7 @@ FEAT_START
|
||||
break;
|
||||
}
|
||||
struct limine_hhdm_response *hhdm_response = hhdm_request.response;
|
||||
e9_printf("HHDM feature, revision %d", hhdm_response->revision);
|
||||
e9_printf("Higher half direct map at: %x", hhdm_response->address);
|
||||
FEAT_END
|
||||
|
||||
@ -167,8 +171,9 @@ FEAT_START
|
||||
break;
|
||||
}
|
||||
struct limine_memmap_response *memmap_response = memmap_request.response;
|
||||
e9_printf("%d memory map entries", memmap_response->entries_count);
|
||||
for (size_t i = 0; i < memmap_response->entries_count; i++) {
|
||||
e9_printf("Memory map feature, revision %d", memmap_response->revision);
|
||||
e9_printf("%d memory map entries", memmap_response->entry_count);
|
||||
for (size_t i = 0; i < memmap_response->entry_count; i++) {
|
||||
struct limine_memmap_entry *e = memmap_response->entries[i];
|
||||
e9_printf("%x->%x %s", e->base, e->base + e->length, get_memmap_type(e->type));
|
||||
}
|
||||
@ -181,9 +186,10 @@ FEAT_START
|
||||
break;
|
||||
}
|
||||
struct limine_framebuffer_response *fb_response = framebuffer_request.response;
|
||||
e9_printf("%d framebuffer(s)", fb_response->fbs_count);
|
||||
for (size_t i = 0; i < fb_response->fbs_count; i++) {
|
||||
struct limine_framebuffer *fb = fb_response->fbs[i];
|
||||
e9_printf("Framebuffers feature, revision %d", fb_response->revision);
|
||||
e9_printf("%d framebuffer(s)", fb_response->framebuffer_count);
|
||||
for (size_t i = 0; i < fb_response->framebuffer_count; i++) {
|
||||
struct limine_framebuffer *fb = fb_response->framebuffers[i];
|
||||
e9_printf("Address: %x", fb->address);
|
||||
e9_printf("Width: %d", fb->width);
|
||||
e9_printf("Height: %d", fb->height);
|
||||
@ -208,8 +214,9 @@ FEAT_START
|
||||
break;
|
||||
}
|
||||
struct limine_module_response *module_response = module_request.response;
|
||||
e9_printf("%d module(s)", module_response->modules_count);
|
||||
for (size_t i = 0; i < module_response->modules_count; i++) {
|
||||
e9_printf("Modules feature, revision %d", module_response->revision);
|
||||
e9_printf("%d module(s)", module_response->module_count);
|
||||
for (size_t i = 0; i < module_response->module_count; i++) {
|
||||
struct limine_module *m = module_response->modules[i];
|
||||
|
||||
e9_printf("Base: %x", m->base);
|
||||
@ -228,6 +235,7 @@ FEAT_START
|
||||
break;
|
||||
}
|
||||
struct limine_rsdp_response *rsdp_response = rsdp_request.response;
|
||||
e9_printf("RSDP feature, revision %d", rsdp_response->revision);
|
||||
e9_printf("RSDP at: %x", rsdp_response->address);
|
||||
FEAT_END
|
||||
|
||||
@ -238,6 +246,7 @@ FEAT_START
|
||||
break;
|
||||
}
|
||||
struct limine_smbios_response *smbios_response = smbios_request.response;
|
||||
e9_printf("SMBIOS feature, revision %d", smbios_response->revision);
|
||||
e9_printf("SMBIOS 32-bit entry at: %x", smbios_response->entry_32);
|
||||
e9_printf("SMBIOS 64-bit entry at: %x", smbios_response->entry_64);
|
||||
FEAT_END
|
||||
@ -249,6 +258,7 @@ FEAT_START
|
||||
break;
|
||||
}
|
||||
struct limine_efi_system_table_response *est_response = est_request.response;
|
||||
e9_printf("EFI system table feature, revision %d", est_response->revision);
|
||||
e9_printf("EFI system table at: %x", est_response->address);
|
||||
FEAT_END
|
||||
|
||||
@ -259,7 +269,8 @@ FEAT_START
|
||||
break;
|
||||
}
|
||||
struct limine_boot_time_response *boot_time_response = boot_time_request.response;
|
||||
e9_printf("Kernel boot time: %d", boot_time_response->boot_time);
|
||||
e9_printf("Boot time feature, revision %d", boot_time_response->revision);
|
||||
e9_printf("Boot time: %d", boot_time_response->boot_time);
|
||||
FEAT_END
|
||||
|
||||
FEAT_START
|
||||
@ -269,10 +280,11 @@ FEAT_START
|
||||
break;
|
||||
}
|
||||
struct limine_smp_response *smp_response = _smp_request.response;
|
||||
e9_printf("SMP feature, revision %d", smp_response->revision);
|
||||
e9_printf("Flags: %x", smp_response->flags);
|
||||
e9_printf("BSP LAPIC ID: %x", smp_response->bsp_lapic_id);
|
||||
e9_printf("CPUs count: %d", smp_response->cpus_count);
|
||||
for (size_t i = 0; i < smp_response->cpus_count; i++) {
|
||||
e9_printf("CPU count: %d", smp_response->cpu_count);
|
||||
for (size_t i = 0; i < smp_response->cpu_count; i++) {
|
||||
struct limine_smp_info *cpu = smp_response->cpus[i];
|
||||
e9_printf("Processor ID: %x", cpu->processor_id);
|
||||
e9_printf("LAPIC ID: %x", cpu->lapic_id);
|
||||
|
Loading…
Reference in New Issue
Block a user