Avoid adding more CPUs than the kernel args can hold (and therefore overwriting other kernel args stuff). Doesn't fix my problems though as the current maximum is 4 CPUs.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23105 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
7825641a7b
commit
f6c512f8e3
@ -156,6 +156,12 @@ smp_do_mp_config()
|
|||||||
switch (*ptr) {
|
switch (*ptr) {
|
||||||
case MP_BASE_PROCESSOR:
|
case MP_BASE_PROCESSOR:
|
||||||
{
|
{
|
||||||
|
if (gKernelArgs.num_cpus == MAX_BOOT_CPUS) {
|
||||||
|
TRACE(("smp: already reached maximum boot CPUs (%d)\n", MAX_BOOT_CPUS));
|
||||||
|
ptr += sizeof(struct mp_base_processor);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
struct mp_base_processor *processor = (struct mp_base_processor *)ptr;
|
struct mp_base_processor *processor = (struct mp_base_processor *)ptr;
|
||||||
|
|
||||||
gKernelArgs.arch_args.cpu_apic_id[gKernelArgs.num_cpus] = processor->apic_id;
|
gKernelArgs.arch_args.cpu_apic_id[gKernelArgs.num_cpus] = processor->apic_id;
|
||||||
@ -267,6 +273,11 @@ smp_do_acpi_config(acpi_rsdp *rsdp)
|
|||||||
switch (apic->type) {
|
switch (apic->type) {
|
||||||
case ACPI_MADT_LOCAL_APIC:
|
case ACPI_MADT_LOCAL_APIC:
|
||||||
{
|
{
|
||||||
|
if (gKernelArgs.num_cpus == MAX_BOOT_CPUS) {
|
||||||
|
TRACE(("smp: already reached maximum boot CPUs (%d)\n", MAX_BOOT_CPUS));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
acpi_local_apic *localApic = (acpi_local_apic *)apic;
|
acpi_local_apic *localApic = (acpi_local_apic *)apic;
|
||||||
TRACE(("smp: found local APIC with id %u\n", localApic->apic_id));
|
TRACE(("smp: found local APIC with id %u\n", localApic->apic_id));
|
||||||
gKernelArgs.arch_args.cpu_apic_id[gKernelArgs.num_cpus] = localApic->apic_id;
|
gKernelArgs.arch_args.cpu_apic_id[gKernelArgs.num_cpus] = localApic->apic_id;
|
||||||
|
Loading…
Reference in New Issue
Block a user