Ticket #3445: haiku-mps-check-enabled.patch

File haiku-mps-check-enabled.patch, 1.3 KB (added by jkeeping, 16 years ago)

Updated patch which is much cleaner and doesn't rely on the enabled processors being the first ones.

  • src/system/boot/platform/bios_ia32/smp.cpp

     
    151151
    152152                struct mp_base_processor *processor = (struct mp_base_processor *)pointer;
    153153
    154                 gKernelArgs.arch_args.cpu_apic_id[gKernelArgs.num_cpus] = processor->apic_id;
    155                 gKernelArgs.arch_args.cpu_os_id[processor->apic_id] = gKernelArgs.num_cpus;
    156                 gKernelArgs.arch_args.cpu_apic_version[gKernelArgs.num_cpus] = processor->apic_version;
    157 
    158154#ifdef TRACE_SMP
    159155                const char *cpuFamily[] = { "", "", "", "", "Intel 486",
    160156                    "Intel Pentium", "Intel Pentium Pro", "Intel Pentium II" };
     
    164160                    processor->apic_id, processor->apic_version, (processor->cpu_flags & 0x2) ?
    165161                    ", BSP" : ""));
    166162
     163                /* skip if the processor is not enabled. */
     164                if(!(processor->cpu_flags & 0x1))
     165                    break;
     166
     167                gKernelArgs.arch_args.cpu_apic_id[gKernelArgs.num_cpus] = processor->apic_id;
     168                gKernelArgs.arch_args.cpu_os_id[processor->apic_id] = gKernelArgs.num_cpus;
     169                gKernelArgs.arch_args.cpu_apic_version[gKernelArgs.num_cpus] = processor->apic_version;
     170
    167171                gKernelArgs.num_cpus++;
    168172                pointer += sizeof(struct mp_base_processor);
    169173                break;