limine: Move SMP request to using SoA
This commit is contained in:
parent
76b9312d72
commit
03700dea96
@ -116,8 +116,7 @@ struct limine_5_level_paging_request {
|
||||
struct limine_smp_info {
|
||||
uint32_t processor_id;
|
||||
uint32_t lapic_id;
|
||||
uint64_t reserved;
|
||||
LIMINE_PTR(void *) goto_address;
|
||||
uint64_t reserved[2];
|
||||
uint64_t extra_argument;
|
||||
};
|
||||
|
||||
@ -126,8 +125,11 @@ struct limine_smp_response {
|
||||
|
||||
uint32_t bsp_lapic_id;
|
||||
uint32_t unused;
|
||||
uint64_t cpus_count;
|
||||
LIMINE_PTR(struct limine_smp_info *) cpus;
|
||||
uint64_t cpu_count;
|
||||
LIMINE_PTR(uint32_t *) cpu_processor_id;
|
||||
LIMINE_PTR(uint32_t *) cpu_lapic_id;
|
||||
LIMINE_PTR(LIMINE_PTR(LIMINE_PTR(void *) *) *) cpu_goto_address;
|
||||
LIMINE_PTR(LIMINE_PTR(LIMINE_PTR(void *) *) *) cpu_extra_argument;
|
||||
};
|
||||
|
||||
struct limine_smp_request {
|
||||
|
@ -483,11 +483,10 @@ FEAT_START
|
||||
break; // next feature
|
||||
}
|
||||
|
||||
struct limine_smp_info *smp_array;
|
||||
struct smp_information *smp_info;
|
||||
size_t cpu_count;
|
||||
uint32_t bsp_lapic_id;
|
||||
smp_info = init_smp(0, (void **)&smp_array,
|
||||
smp_info = init_smp(0, (void **)&smp_info,
|
||||
&cpu_count, &bsp_lapic_id,
|
||||
true, want_5lv,
|
||||
pagemap, smp_request->flags & LIMINE_SMP_X2APIC, true,
|
||||
@ -507,8 +506,24 @@ FEAT_START
|
||||
|
||||
smp_response->flags |= (smp_request->flags & LIMINE_SMP_X2APIC) && x2apic_check();
|
||||
smp_response->bsp_lapic_id = bsp_lapic_id;
|
||||
smp_response->cpus_count = cpu_count;
|
||||
smp_response->cpus = reported_addr(smp_array);
|
||||
smp_response->cpu_count = cpu_count;
|
||||
|
||||
uint32_t *cpu_processor_id = ext_mem_alloc(sizeof(uint32_t) * cpu_count);
|
||||
uint32_t *cpu_lapic_id = ext_mem_alloc(sizeof(uint32_t) * cpu_count);
|
||||
uint64_t *cpu_goto_address = ext_mem_alloc(sizeof(uint64_t) * cpu_count);
|
||||
uint64_t *cpu_extra_argument = ext_mem_alloc(sizeof(uint64_t) * cpu_count);
|
||||
|
||||
for (size_t i = 0; i < cpu_count; i++) {
|
||||
cpu_processor_id[i] = smp_info[i].acpi_processor_uid;
|
||||
cpu_lapic_id[i] = smp_info[i].lapic_id;
|
||||
cpu_goto_address[i] = reported_addr(&smp_info[i].goto_address);
|
||||
cpu_extra_argument[i] = reported_addr(&smp_info[i].extra_argument);
|
||||
}
|
||||
|
||||
smp_response->cpu_processor_id = reported_addr(cpu_processor_id);
|
||||
smp_response->cpu_lapic_id = reported_addr(cpu_lapic_id);
|
||||
smp_response->cpu_goto_address = reported_addr(cpu_goto_address);
|
||||
smp_response->cpu_extra_argument = reported_addr(cpu_extra_argument);
|
||||
|
||||
smp_request->response = reported_addr(smp_response);
|
||||
FEAT_END
|
||||
|
@ -224,11 +224,10 @@ FEAT_START
|
||||
struct limine_smp_response *smp_response = _smp_request.response;
|
||||
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++) {
|
||||
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);
|
||||
e9_printf("CPU count: %d", smp_response->cpu_count);
|
||||
for (size_t i = 0; i < smp_response->cpu_count; i++) {
|
||||
e9_printf("Processor ID: %x", smp_response->cpu_processor_id[i]);
|
||||
e9_printf("LAPIC ID: %x", smp_response->cpu_lapic_id[i]);
|
||||
}
|
||||
FEAT_END
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user