-/* $OpenBSD: cpu.c,v 1.55 2021/03/25 04:12:00 jsg Exp $ */
+/* $OpenBSD: cpu.c,v 1.56 2021/11/26 14:45:13 jsg Exp $ */
/* $NetBSD: cpu.c,v 1.56 2004/04/14 04:01:49 bsh Exp $ */
__asm volatile("mrc p15, 0, %0, c0, c0, 5" : "=r"(mpidr));
KASSERT(faa->fa_nreg > 0);
+#ifdef MULTIPROCESSOR
if (faa->fa_reg[0].addr == (mpidr & MPIDR_AFF)) {
ci = &cpu_info_primary;
-#ifdef MULTIPROCESSOR
ci->ci_flags |= CPUF_RUNNING | CPUF_PRESENT | CPUF_PRIMARY;
-#endif
- }
-#ifdef MULTIPROCESSOR
- else {
+ } else {
ci = malloc(sizeof(*ci), M_DEVBUF, M_WAITOK | M_ZERO);
cpu_info[dev->dv_unit] = ci;
ci->ci_next = cpu_info_list->ci_next;
ci->ci_flags |= CPUF_AP;
ncpus++;
}
+#else
+ ci = &cpu_info_primary;
#endif
ci->ci_dev = dev;
-/* $OpenBSD: cpu.c,v 1.58 2021/11/23 01:03:35 deraadt Exp $ */
+/* $OpenBSD: cpu.c,v 1.59 2021/11/26 14:45:13 jsg Exp $ */
/*
* Copyright (c) 2016 Dale Rahn <drahn@dalerahn.com>
{
struct fdt_attach_args *faa = aux;
struct cpu_info *ci;
+#ifdef MULTIPROCESSOR
uint64_t mpidr = READ_SPECIALREG(mpidr_el1);
+#endif
uint64_t id_aa64mmfr1, sctlr;
uint32_t opp;
KASSERT(faa->fa_nreg > 0);
+#ifdef MULTIPROCESSOR
if (faa->fa_reg[0].addr == (mpidr & MPIDR_AFF)) {
ci = &cpu_info_primary;
-#ifdef MULTIPROCESSOR
ci->ci_flags |= CPUF_RUNNING | CPUF_PRESENT | CPUF_PRIMARY;
-#endif
- }
-#ifdef MULTIPROCESSOR
- else {
+ } else {
ci = malloc(sizeof(*ci), M_DEVBUF, M_WAITOK | M_ZERO);
cpu_info[dev->dv_unit] = ci;
ci->ci_next = cpu_info_list->ci_next;
ci->ci_flags |= CPUF_AP;
ncpus++;
}
+#else
+ ci = &cpu_info_primary;
#endif
ci->ci_dev = dev;
-/* $OpenBSD: cpu.c,v 1.80 2021/07/24 08:21:13 visa Exp $ */
+/* $OpenBSD: cpu.c,v 1.81 2021/11/26 14:45:13 jsg Exp $ */
/*
* Copyright (c) 1997-2004 Opsycon AB (www.opsycon.se)
int fptype, vers_maj, vers_min;
int displayver;
+#ifdef MULTIPROCESSOR
if (cpuno == 0) {
ci = &cpu_info_primary;
-#ifdef MULTIPROCESSOR
ci->ci_flags |= CPUF_RUNNING | CPUF_PRESENT | CPUF_PRIMARY;
if (ncpusfound > 1) {
cpu_info_secondaries = (struct cpu_info *)
if (cpu_info_secondaries == NULL)
panic("unable to allocate cpu_info");
}
-#endif
- }
-#ifdef MULTIPROCESSOR
- else {
+ } else {
ci = &cpu_info_secondaries[cpuno - 1];
ci->ci_next = cpu_info_list->ci_next;
cpu_info_list->ci_next = ci;
ci->ci_flags |= CPUF_PRESENT;
}
+#else
+ ci = &cpu_info_primary;
#endif
ci->ci_self = ci;
ci->ci_cpuid = cpuno;
-/* $OpenBSD: cpu.c,v 1.11 2021/07/24 18:15:13 kettenis Exp $ */
+/* $OpenBSD: cpu.c,v 1.12 2021/11/26 14:45:13 jsg Exp $ */
/*
* Copyright (c) 2016 Dale Rahn <drahn@dalerahn.com>
KASSERT(faa->fa_nreg > 0);
+#ifdef MULTIPROCESSOR
if (faa->fa_reg[0].addr == boot_hart) {
ci = &cpu_info_primary;
-#ifdef MULTIPROCESSOR
ci->ci_flags |= CPUF_RUNNING | CPUF_PRESENT | CPUF_PRIMARY;
csr_set(sie, SIE_SSIE);
-#endif
- }
-#ifdef MULTIPROCESSOR
- else {
+ } else {
ci = malloc(sizeof(*ci), M_DEVBUF, M_WAITOK | M_ZERO);
cpu_info[dev->dv_unit] = ci;
ci->ci_next = cpu_info_list->ci_next;
ci->ci_flags |= CPUF_AP;
ncpus++;
}
+#else
+ ci = &cpu_info_primary;
#endif
ci->ci_dev = dev;