summaryrefslogtreecommitdiff
path: root/sys/arch/m88k
diff options
context:
space:
mode:
Diffstat (limited to 'sys/arch/m88k')
-rw-r--r--sys/arch/m88k/include/cpu.h14
-rw-r--r--sys/arch/m88k/m88k/db_interface.c5
-rw-r--r--sys/arch/m88k/m88k/genassym.cf5
-rw-r--r--sys/arch/m88k/m88k/m8820x_machdep.c8
-rw-r--r--sys/arch/m88k/m88k/m88k_machdep.c9
-rw-r--r--sys/arch/m88k/m88k/pmap.c9
6 files changed, 22 insertions, 28 deletions
diff --git a/sys/arch/m88k/include/cpu.h b/sys/arch/m88k/include/cpu.h
index 5c6b24c7726..97b691f082b 100644
--- a/sys/arch/m88k/include/cpu.h
+++ b/sys/arch/m88k/include/cpu.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: cpu.h,v 1.29 2007/11/06 21:48:42 miod Exp $ */
+/* $OpenBSD: cpu.h,v 1.30 2007/11/14 23:12:45 miod Exp $ */
/*
* Copyright (c) 1996 Nivas Madhur
* Copyright (c) 1992, 1993
@@ -82,7 +82,9 @@ extern u_int max_cpus;
*/
struct cpu_info {
- u_int ci_alive; /* nonzero if CPU present */
+ u_int ci_flags;
+#define CIF_ALIVE 0x01 /* cpu initialized */
+#define CIF_PRIMARY 0x02 /* primary cpu */
struct proc *ci_curproc; /* current process... */
struct pcb *ci_curpcb; /* ...and its pcb */
@@ -101,13 +103,13 @@ struct cpu_info {
u_long ci_spin_locks; /* spin locks counter */
- volatile int ci_ddb_state; /* ddb status */
+ int ci_ddb_state; /* ddb status */
#define CI_DDB_RUNNING 0
#define CI_DDB_ENTERDDB 1
#define CI_DDB_INDDB 2
#define CI_DDB_PAUSE 3
- volatile int ci_ipi; /* pending ipis */
+ int ci_ipi; /* pending ipis */
#define CI_IPI_NOTIFY 0x00000001
#define CI_IPI_HARDCLOCK 0x00000002
#define CI_IPI_STATCLOCK 0x00000004
@@ -121,7 +123,7 @@ extern struct cpu_info m88k_cpus[MAX_CPUS];
#define CPU_INFO_ITERATOR cpuid_t
#define CPU_INFO_FOREACH(cii, ci) \
for ((cii) = 0; (cii) < MAX_CPUS; (cii)++) \
- if (((ci) = &m88k_cpus[cii])->ci_alive != 0)
+ if (((ci) = &m88k_cpus[cii])->ci_flags & CIF_ALIVE)
#define CPU_INFO_UNIT(ci) ((ci)->ci_cpuid)
#if defined(MULTIPROCESSOR)
@@ -135,7 +137,7 @@ curcpu(void)
return cpuptr;
}
-#define CPU_IS_PRIMARY(ci) ((ci)->ci_primary != 0)
+#define CPU_IS_PRIMARY(ci) ((ci)->ci_flags & CIF_PRIMARY)
void cpu_boot_secondary_processors(void);
__dead void cpu_emergency_disable(void);
diff --git a/sys/arch/m88k/m88k/db_interface.c b/sys/arch/m88k/m88k/db_interface.c
index ca313f6a300..7db78c45ae3 100644
--- a/sys/arch/m88k/m88k/db_interface.c
+++ b/sys/arch/m88k/m88k/db_interface.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: db_interface.c,v 1.9 2007/11/14 17:54:25 miod Exp $ */
+/* $OpenBSD: db_interface.c,v 1.10 2007/11/14 23:12:46 miod Exp $ */
/*
* Mach Operating System
* Copyright (c) 1993-1991 Carnegie Mellon University
@@ -631,7 +631,8 @@ m88k_db_cpu_cmd(db_expr_t addr, int have_addr, db_expr_t count, char *modif)
/* switch to another processor if requested */
if (have_addr) {
cpu = (cpuid_t)addr;
- if (cpu >= 0 && cpu < MAX_CPUS && m88k_cpus[cpu].ci_alive) {
+ if (cpu >= 0 && cpu < MAX_CPUS &&
+ ISSET(m88k_cpus[cpu].ci_flags, CIF_ALIVE)) {
ddb_mp_nextcpu = cpu;
db_cmd_loop_done = 1;
} else {
diff --git a/sys/arch/m88k/m88k/genassym.cf b/sys/arch/m88k/m88k/genassym.cf
index bc3a96c2e71..af886904abf 100644
--- a/sys/arch/m88k/m88k/genassym.cf
+++ b/sys/arch/m88k/m88k/genassym.cf
@@ -1,4 +1,4 @@
-# $OpenBSD: genassym.cf,v 1.10 2007/11/06 21:42:56 miod Exp $
+# $OpenBSD: genassym.cf,v 1.11 2007/11/14 23:12:46 miod Exp $
#
# Copyright (c) 1982, 1990 The Regents of the University of California.
# All rights reserved.
@@ -28,7 +28,7 @@
# SUCH DAMAGE.
#
# @(#)genassym.c 7.8 (Berkeley) 5/7/91
-# $Id: genassym.cf,v 1.10 2007/11/06 21:42:56 miod Exp $
+# $Id: genassym.cf,v 1.11 2007/11/14 23:12:46 miod Exp $
#
include <sys/param.h>
@@ -60,7 +60,6 @@ export SONPROC
struct cpu_info
member ci_curproc
member ci_curpcb
-member ci_primary
member ci_pfsr_i0
member ci_pfsr_i1
member ci_pfsr_d0
diff --git a/sys/arch/m88k/m88k/m8820x_machdep.c b/sys/arch/m88k/m88k/m8820x_machdep.c
index a9b11b00c03..f6fe89996fc 100644
--- a/sys/arch/m88k/m88k/m8820x_machdep.c
+++ b/sys/arch/m88k/m88k/m8820x_machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: m8820x_machdep.c,v 1.29 2007/11/11 13:05:28 miod Exp $ */
+/* $OpenBSD: m8820x_machdep.c,v 1.30 2007/11/14 23:12:46 miod Exp $ */
/*
* Copyright (c) 2004, Miodrag Vallat.
*
@@ -756,7 +756,8 @@ m8820x_dma_cachectl(pmap_t pmap, vaddr_t _va, vsize_t _size, int op)
/* invalidate on all... */
if (flusher != m8820x_cmmu_sync_cache) {
for (cpu = 0; cpu < MAX_CPUS; cpu++) {
- if (m88k_cpus[cpu].ci_alive == 0)
+ if (!ISSET(m88k_cpus[cpu].ci_flags,
+ CIF_ALIVE))
continue;
(*flusher)(cpu, pa, count);
}
@@ -823,7 +824,8 @@ m8820x_dma_cachectl_pa(paddr_t _pa, psize_t _size, int op)
/* invalidate on all... */
if (flusher != m8820x_cmmu_sync_cache) {
for (cpu = 0; cpu < MAX_CPUS; cpu++) {
- if (m88k_cpus[cpu].ci_alive == 0)
+ if (!ISSET(m88k_cpus[cpu].ci_flags,
+ CIF_ALIVE))
continue;
(*flusher)(cpu, pa, count);
}
diff --git a/sys/arch/m88k/m88k/m88k_machdep.c b/sys/arch/m88k/m88k/m88k_machdep.c
index ede3f353edc..70fbdff129f 100644
--- a/sys/arch/m88k/m88k/m88k_machdep.c
+++ b/sys/arch/m88k/m88k/m88k_machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: m88k_machdep.c,v 1.28 2007/11/09 17:08:44 miod Exp $ */
+/* $OpenBSD: m88k_machdep.c,v 1.29 2007/11/14 23:12:46 miod Exp $ */
/*
* Copyright (c) 1998, 1999, 2000, 2001 Steve Murphree, Jr.
* Copyright (c) 1996 Nivas Madhur
@@ -285,13 +285,6 @@ set_cpu_number(cpuid_t number)
__asm__ __volatile__ ("stcr %0, cr17" :: "r" (ci));
flush_pipeline();
-
-#ifdef MULTIPROCESSOR
- if (number == master_cpu)
-#endif
- {
- ci->ci_primary = 1;
- }
}
/*
diff --git a/sys/arch/m88k/m88k/pmap.c b/sys/arch/m88k/m88k/pmap.c
index b2256ae0dde..d2f6e88e62d 100644
--- a/sys/arch/m88k/m88k/pmap.c
+++ b/sys/arch/m88k/m88k/pmap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pmap.c,v 1.32 2007/11/06 21:45:46 miod Exp $ */
+/* $OpenBSD: pmap.c,v 1.33 2007/11/14 23:12:46 miod Exp $ */
/*
* Copyright (c) 2001-2004, Miodrag Vallat
* Copyright (c) 1998-2001 Steve Murphree, Jr.
@@ -211,10 +211,7 @@ flush_atc_entry(pmap_t pmap, vaddr_t va)
kernel = pmap == kernel_pmap;
while ((cpu = ff1(users)) != 32) {
-#ifdef DIAGNOSTIC
- if (m88k_cpus[cpu].ci_alive)
-#endif
- cmmu_flush_tlb(cpu, kernel, va, 1);
+ cmmu_flush_tlb(cpu, kernel, va, 1);
users ^= 1 << cpu;
}
#else /* MULTIPROCESSOR */
@@ -491,7 +488,7 @@ pmap_cache_ctrl(pmap_t pmap, vaddr_t s, vaddr_t e, u_int mode)
pa = ptoa(PG_PFNUM(opte));
#ifdef MULTIPROCESSOR
for (cpu = 0; cpu < MAX_CPUS; cpu++)
- if (m88k_cpus[cpu].ci_alive != 0)
+ if (ISSET(m88k_cpus[cpu].ci_flags, CIF_ALIVE))
#else
cpu = cpu_number();
#endif