NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

kern/57789: i386 kernel compile error (with no options MULIPROCESSOR and use acpi)



>Number:         57789
>Category:       kern
>Synopsis:       i386 kernel compile error (with no options MULIPROCESSOR and use acpi)
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Dec 20 15:50:00 +0000 2023
>Originator:     Kouichi Hashikawa
>Release:        10.0-RC1, current (i386)
>Organization:
>Environment:
>Description:
mp_cpu_funcs is defined at src/sys/arch/x86/x86/cpu.c 
inside of #ifdef MULTIPROCESSOR, but used at src/sys/arch/x86/x86/mpacpi.c
and at src/sys/arch/x86/x86/mpbios.c outside of #ifdef MULTIPROCESSOR.

Then, kernel(i386) which use no options MULTIPROCESSOR and use acpi
encountered compile error (not config error).

build/tools/bin/i486--netbsdelf-ld: mpbios.o: in function `mpbios_cpu.part.0': mpbios.c:(.text+0xa1b): undefined reference to `mp_cpu_funcs'
build/tools/bin/i486--netbsdelf-ld: mpacpi.o: in function `mpacpi_config_cpu': mpacpi.c:(.text+0xb5): undefined reference to `mp_cpu_funcs'
build/tools/bin/i486--netbsdelf-ld: mpacpi.c:(.text+0xe0): undefined reference to `mp_cpu_funcs'


(src/sys/arch/x86/x86/cpu.c: 157)
#ifdef MULTIPROCESSOR
int mp_cpu_start(struct cpu_info *, paddr_t);
void mp_cpu_start_cleanup(struct cpu_info *);
const struct cpu_functions mp_cpu_funcs = { mp_cpu_start, NULL,
                                            mp_cpu_start_cleanup };
#endif

(src/sys/arch/x86/x86/mpacpi.c: 369)
#if defined(MULTIPROCESSOR) || defined(IOAPIC)
        if (mpacpi_ncpu > 1)
                cpunum = lapic_cpu_number();
#endif

        switch (hdrp->Type) {
        case ACPI_MADT_TYPE_LOCAL_APIC:
                lapic = (ACPI_MADT_LOCAL_APIC *)hdrp;
                if (lapic->LapicFlags & ACPI_MADT_ENABLED) {
                        if (lapic->Id != cpunum)
                                caa.cpu_role = CPU_ROLE_AP;
                        else
                                caa.cpu_role = CPU_ROLE_BP;
                        caa.cpu_id = lapic->ProcessorId;
                        caa.cpu_number = lapic->Id;
                        caa.cpu_func = &mp_cpu_funcs;  <---

(src/sys/arch/x86/x86/mpacpi.c: 407)
                if (x2apic->LapicFlags & ACPI_MADT_ENABLED) {
                        if (x2apic->LocalApicId != cpunum)
                                caa.cpu_role = CPU_ROLE_AP;
                        else
                                caa.cpu_role = CPU_ROLE_BP;
                        caa.cpu_id = x2apic->Uid;
                        caa.cpu_number = x2apic->LocalApicId;
                        caa.cpu_func = &mp_cpu_funcs;  <---

(src/sys/arch/x86/x86/mpbios.c: 809)
        /* check for BSP flag */
        if (entry->cpu_flags & PROCENTRY_FLAG_BP)
                caa.cpu_role = CPU_ROLE_BP;
        else
                caa.cpu_role = CPU_ROLE_AP;

        caa.cpu_id = entry->apic_id;
        caa.cpu_number = entry->apic_id;
        caa.cpu_func = &mp_cpu_funcs;  <---


>How-To-Repeat:

>Fix:



Home | Main Index | Thread Index | Old Index