mirror of
https://github.com/limine-bootloader/limine
synced 2024-12-23 22:36:48 +03:00
Adjust stivale2 SMP spec a little to add an extra argument to the smp_info struct
This commit is contained in:
parent
c3c3c5dd6f
commit
4927abcfaf
11
STIVALE2.md
11
STIVALE2.md
@ -378,8 +378,10 @@ This tag reports to the kernel info about the firmware.
|
||||
struct stivale2_struct_tag_smp {
|
||||
uint64_t identifier; // Identifier: 0x34d1d96339647025
|
||||
uint64_t next;
|
||||
uint64_t cpu_count; // Total number of logical CPUs (including BSP)
|
||||
struct stivale2_smp_info smp_info[];
|
||||
uint64_t cpu_count; // Total number of logical CPUs (excluding BSP)
|
||||
struct stivale2_smp_info smp_info[]; // Array of smp_info structs, one per
|
||||
// additional logical processor, note
|
||||
// that the BSP does not have one.
|
||||
} __attribute__((packed));
|
||||
```
|
||||
|
||||
@ -405,5 +407,10 @@ struct stivale2_smp_info {
|
||||
// is handed off.
|
||||
// All general purpose registers are cleared
|
||||
// except ESP/RSP, and RDI in 64-bit mode.
|
||||
uint64_t extra_argument; // This field is here for the kernel to use
|
||||
// for whatever it wants. Writes here should
|
||||
// be performed before writing to goto_address
|
||||
// so that the receiving processor can safely
|
||||
// retrieve the data.
|
||||
} __attribute__((packed));
|
||||
```
|
||||
|
BIN
limine.bin
BIN
limine.bin
Binary file not shown.
@ -89,7 +89,7 @@ struct smp_information *init_smp(size_t *cpu_count,
|
||||
asm volatile ("sgdt %0" :: "m"(gdtr));
|
||||
|
||||
struct smp_information *ret = balloc_aligned(0, 1);
|
||||
*cpu_count = 1;
|
||||
*cpu_count = 0;
|
||||
|
||||
// Parse the MADT entries
|
||||
for (uint8_t *madt_ptr = (uint8_t *)madt->madt_entries_begin;
|
||||
|
@ -11,6 +11,7 @@ struct smp_information {
|
||||
uint32_t lapic_id;
|
||||
uint64_t stack_addr;
|
||||
uint64_t goto_address;
|
||||
uint64_t extra_argument;
|
||||
} __attribute__((packed));
|
||||
|
||||
struct smp_information *init_smp(size_t *cpu_count,
|
||||
|
@ -100,8 +100,8 @@ parking32:
|
||||
.out:
|
||||
mov esp, dword [edi + 8]
|
||||
push 0
|
||||
push eax
|
||||
push edi
|
||||
push eax
|
||||
xor eax, eax
|
||||
xor ebx, ebx
|
||||
xor ecx, ecx
|
||||
|
@ -136,6 +136,7 @@ struct stivale2_smp_info {
|
||||
uint32_t lapic_id;
|
||||
uint64_t target_stack;
|
||||
uint64_t goto_address;
|
||||
uint64_t extra_argument;
|
||||
} __attribute__((packed));
|
||||
|
||||
struct stivale2_struct_tag_smp {
|
||||
|
Loading…
Reference in New Issue
Block a user