acpicpu(4) drivers to the right cpu(4).
ok mlarkin@, guenther@
-/* $OpenBSD: cpu.c,v 1.101 2016/06/28 05:37:50 mlarkin Exp $ */
+/* $OpenBSD: cpu.c,v 1.102 2016/07/28 21:57:57 kettenis Exp $ */
/* $NetBSD: cpu.c,v 1.1 2003/04/26 18:39:26 fvdl Exp $ */
/*-
} else {
ci = &cpu_info_primary;
#if defined(MULTIPROCESSOR)
- if (caa->cpu_number != lapic_cpu_number()) {
+ if (caa->cpu_apicid != lapic_cpu_number()) {
panic("%s: running cpu is at apic %d"
" instead of at expected %d",
- sc->sc_dev.dv_xname, lapic_cpu_number(), caa->cpu_number);
+ sc->sc_dev.dv_xname, lapic_cpu_number(), caa->cpu_apicid);
}
#endif
}
sc->sc_info = ci;
ci->ci_dev = self;
- ci->ci_apicid = caa->cpu_number;
+ ci->ci_apicid = caa->cpu_apicid;
+ ci->ci_acpi_proc_id = caa->cpu_acpi_proc_id;
#ifdef MULTIPROCESSOR
ci->ci_cpuid = cpunum;
#else
break;
case CPU_ROLE_BP:
- printf("apid %d (boot processor)\n", caa->cpu_number);
+ printf("apid %d (boot processor)\n", caa->cpu_apicid);
ci->ci_flags |= CPUF_PRESENT | CPUF_BSP | CPUF_PRIMARY;
cpu_intr_init(ci);
identifycpu(ci);
lapic_calibrate_timer(ci);
#endif
#if NIOAPIC > 0
- ioapic_bsp_id = caa->cpu_number;
+ ioapic_bsp_id = caa->cpu_apicid;
#endif
cpu_init_mwait(sc);
break;
/*
* report on an AP
*/
- printf("apid %d (application processor)\n", caa->cpu_number);
+ printf("apid %d (application processor)\n", caa->cpu_apicid);
#if defined(MULTIPROCESSOR)
cpu_intr_init(ci);
-/* $OpenBSD: mainbus.c,v 1.37 2016/06/21 15:24:55 jcs Exp $ */
+/* $OpenBSD: mainbus.c,v 1.38 2016/07/28 21:57:57 kettenis Exp $ */
/* $NetBSD: mainbus.c,v 1.1 2003/04/26 18:39:29 fvdl Exp $ */
/*
memset(&caa, 0, sizeof(caa));
caa.caa_name = "cpu";
- caa.cpu_number = 0;
caa.cpu_role = CPU_ROLE_SP;
- caa.cpu_func = 0;
config_found(self, &caa, mainbus_print);
}
-/* $OpenBSD: mpbios.c,v 1.26 2016/04/21 22:13:27 mlarkin Exp $ */
+/* $OpenBSD: mpbios.c,v 1.27 2016/07/28 21:57:57 kettenis Exp $ */
/* $NetBSD: mpbios.c,v 1.7 2003/05/15 16:32:50 fvdl Exp $ */
/*-
}
caa.caa_name = "cpu";
- caa.cpu_number = entry->apic_id;
+ caa.cpu_apicid = entry->apic_id;
#ifdef MULTIPROCESSOR
caa.cpu_func = &mp_cpu_funcs;
#endif
-/* $OpenBSD: cpu.h,v 1.101 2016/05/09 22:45:07 deraadt Exp $ */
+/* $OpenBSD: cpu.h,v 1.102 2016/07/28 21:57:57 kettenis Exp $ */
/* $NetBSD: cpu.h,v 1.1 2003/04/26 18:39:39 fvdl Exp $ */
/*-
struct proc *ci_curproc;
u_int ci_cpuid;
u_int ci_apicid;
+ u_int ci_acpi_proc_id;
u_int32_t ci_randseed;
u_int64_t ci_scratch;
-/* $OpenBSD: cpuvar.h,v 1.7 2015/07/18 19:21:03 sf Exp $ */
+/* $OpenBSD: cpuvar.h,v 1.8 2016/07/28 21:57:57 kettenis Exp $ */
/* $NetBSD: cpuvar.h,v 1.1 2003/03/01 18:29:28 fvdl Exp $ */
/*-
struct cpu_attach_args {
const char *caa_name;
- int cpu_number;
+ int cpu_apicid;
+ int cpu_acpi_proc_id;
int cpu_role;
struct cpu_functions *cpu_func;
};
-/* $OpenBSD: cpu.c,v 1.78 2016/06/28 05:37:50 mlarkin Exp $ */
+/* $OpenBSD: cpu.c,v 1.79 2016/07/28 21:57:56 kettenis Exp $ */
/* $NetBSD: cpu.c,v 1.1.2.7 2000/06/26 02:04:05 sommerfeld Exp $ */
/*-
} else {
ci = &cpu_info_primary;
#ifdef MULTIPROCESSOR
- if (caa->cpu_number != lapic_cpu_number()) {
+ if (caa->cpu_apicid != lapic_cpu_number()) {
panic("%s: running cpu is at apic %d"
" instead of at expected %d",
- self->dv_xname, lapic_cpu_number(), caa->cpu_number);
+ self->dv_xname, lapic_cpu_number(), caa->cpu_apicid);
}
#endif
bcopy(self, &ci->ci_dev, sizeof *self);
}
ci->ci_self = ci;
- ci->ci_apicid = caa->cpu_number;
+ ci->ci_apicid = caa->cpu_apicid;
+ ci->ci_acpi_proc_id = caa->cpu_acpi_proc_id;
#ifdef MULTIPROCESSOR
ci->ci_cpuid = cpunum;
#else
break;
case CPU_ROLE_BP:
- printf("apid %d (boot processor)\n", caa->cpu_number);
+ printf("apid %d (boot processor)\n", caa->cpu_apicid);
ci->ci_flags |= CPUF_PRESENT | CPUF_BSP | CPUF_PRIMARY;
identifycpu(ci);
#ifdef MTRR
lapic_calibrate_timer(ci);
#endif
#if NIOAPIC > 0
- ioapic_bsp_id = caa->cpu_number;
+ ioapic_bsp_id = caa->cpu_apicid;
#endif
cpu_init_mwait(&ci->ci_dev);
break;
/*
* report on an AP
*/
- printf("apid %d (application processor)\n", caa->cpu_number);
+ printf("apid %d (application processor)\n", caa->cpu_apicid);
#ifdef MULTIPROCESSOR
gdt_alloc_cpu(ci);
-/* $OpenBSD: mainbus.c,v 1.54 2015/12/12 12:33:49 reyk Exp $ */
+/* $OpenBSD: mainbus.c,v 1.55 2016/07/28 21:57:56 kettenis Exp $ */
/* $NetBSD: mainbus.c,v 1.21 1997/06/06 23:14:20 thorpej Exp $ */
/*
memset(&caa, 0, sizeof(caa));
caa.caa_name = "cpu";
- caa.cpu_number = 0;
+ caa.cpu_apicid = 0;
caa.cpu_role = CPU_ROLE_SP;
caa.cpu_func = 0;
caa.cpu_signature = cpu_id;
-/* $OpenBSD: mpbios.c,v 1.39 2016/04/21 22:13:27 mlarkin Exp $ */
+/* $OpenBSD: mpbios.c,v 1.40 2016/07/28 21:57:56 kettenis Exp $ */
/* $NetBSD: mpbios.c,v 1.2 2002/10/01 12:56:57 fvdl Exp $ */
/*-
}
caa.caa_name = "cpu";
- caa.cpu_number = entry->apic_id;
+ caa.cpu_apicid = entry->apic_id;
#ifdef MULTIPROCESSOR
caa.cpu_func = &mp_cpu_funcs;
#endif
-/* $OpenBSD: cpu.h,v 1.147 2016/03/15 03:17:51 guenther Exp $ */
+/* $OpenBSD: cpu.h,v 1.148 2016/07/28 21:57:57 kettenis Exp $ */
/* $NetBSD: cpu.h,v 1.35 1996/05/05 19:29:26 christos Exp $ */
/*-
struct proc *ci_curproc; /* current owner of the processor */
cpuid_t ci_cpuid; /* our CPU ID */
u_int ci_apicid; /* our APIC ID */
+ u_int ci_acpi_proc_id;
u_int32_t ci_randseed;
#if defined(MULTIPROCESSOR)
-/* $OpenBSD: cpuvar.h,v 1.6 2015/07/18 19:21:03 sf Exp $ */
+/* $OpenBSD: cpuvar.h,v 1.7 2016/07/28 21:57:57 kettenis Exp $ */
/* $NetBSD: cpuvar.h,v 1.1.2.3 2000/02/21 18:54:07 sommerfeld Exp $ */
/*-
struct cpu_attach_args {
const char *caa_name;
- int cpu_number;
+ int cpu_apicid;
+ int cpu_acpi_proc_id;
int cpu_role;
struct cpu_functions *cpu_func;
int cpu_signature;
-/* $OpenBSD: acpi.c,v 1.312 2016/06/10 20:03:46 kettenis Exp $ */
+/* $OpenBSD: acpi.c,v 1.313 2016/07/28 21:57:56 kettenis Exp $ */
/*
* Copyright (c) 2005 Thorsten Lockert <tholo@sigmasoft.com>
* Copyright (c) 2005 Jordan Hargrave <jordan@openbsd.org>
struct acpi_attach_args aaa;
#ifdef MULTIPROCESSOR
struct aml_value res;
+ CPU_INFO_ITERATOR cii;
+ struct cpu_info *ci;
int proc_id = -1;
#endif
proc_id = res.v_processor.proc_id;
aml_freevalue(&res);
}
- if (proc_id < -1 || proc_id >= LAPIC_MAP_SIZE ||
- (acpi_lapic_flags[proc_id] & ACPI_PROC_ENABLE) == 0)
+ CPU_INFO_FOREACH(cii, ci) {
+ if (ci->ci_acpi_proc_id == proc_id)
+ break;
+ }
+ if (ci == NULL)
return 0;
#endif
nacpicpus++;
-/* $OpenBSD: acpicpu.c,v 1.74 2016/03/17 13:18:47 mpi Exp $ */
+/* $OpenBSD: acpicpu.c,v 1.75 2016/07/28 21:57:56 kettenis Exp $ */
/*
* Copyright (c) 2005 Marco Peereboom <marco@openbsd.org>
* Copyright (c) 2015 Philip Guenther <guenther@openbsd.org>
/* link in the matching cpu_info */
CPU_INFO_FOREACH(cii, ci)
- if (ci->ci_cpuid == sc->sc_dev.dv_unit) {
+ if (ci->ci_acpi_proc_id == sc->sc_cpu) {
ci->ci_acpicpudev = self;
sc->sc_ci = ci;
break;
-/* $OpenBSD: acpimadt.c,v 1.34 2016/07/10 20:41:19 kettenis Exp $ */
+/* $OpenBSD: acpimadt.c,v 1.35 2016/07/28 21:57:56 kettenis Exp $ */
/*
* Copyright (c) 2006 Mark Kettenis <kettenis@openbsd.org>
*
#include "ioapic.h"
-u_int8_t acpi_lapic_flags[LAPIC_MAP_SIZE];
-
int acpimadt_match(struct device *, void *, void *);
void acpimadt_attach(struct device *, struct device *, void *);
lapic_map[entry->madt_lapic.acpi_proc_id] =
entry->madt_lapic.apic_id;
- acpi_lapic_flags[entry->madt_lapic.acpi_proc_id] =
- entry->madt_lapic.flags;
memset(&caa, 0, sizeof(struct cpu_attach_args));
if (lapic_cpu_number() == entry->madt_lapic.apic_id)
ncpusfound++;
}
caa.caa_name = "cpu";
- caa.cpu_number = entry->madt_lapic.apic_id;
+ caa.cpu_apicid = entry->madt_lapic.apic_id;
+ caa.cpu_acpi_proc_id = entry->madt_lapic.acpi_proc_id;
#ifdef MULTIPROCESSOR
caa.cpu_func = &mp_cpu_funcs;
#endif
ncpusfound++;
}
caa.caa_name = "cpu";
- caa.cpu_number = entry->madt_x2apic.apic_id;
+ caa.cpu_apicid = entry->madt_x2apic.apic_id;
+ caa.cpu_acpi_proc_id = entry->madt_x2apic.acpi_proc_uid;
#ifdef MULTIPROCESSOR
caa.cpu_func = &mp_cpu_funcs;
#endif
-/* $OpenBSD: acpivar.h,v 1.82 2016/01/12 01:11:15 jcs Exp $ */
+/* $OpenBSD: acpivar.h,v 1.83 2016/07/28 21:57:56 kettenis Exp $ */
/*
* Copyright (c) 2005 Thorsten Lockert <tholo@sigmasoft.com>
*
extern int acpi_hasprocfvs;
-#define LAPIC_MAP_SIZE 256
-extern u_int8_t acpi_lapic_flags[LAPIC_MAP_SIZE];
-
struct klist;
struct acpiec_softc;
struct acpipwrres_softc;