summaryrefslogtreecommitdiff
path: root/sys/arch
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2005-12-04 15:00:27 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2005-12-04 15:00:27 +0000
commit8725bd0621d927b5c94792b68fe2660400146d71 (patch)
treeed3a59edd2dc2d6310e7a3eaf01ef3b7622a0a7e /sys/arch
parent639f68c9d1197b1b43c4e16be900a3b73eea1c6f (diff)
Let cmmu_init() now return the cpuid of the master cpu.
Diffstat (limited to 'sys/arch')
-rw-r--r--sys/arch/luna88k/luna88k/machdep.c7
-rw-r--r--sys/arch/m88k/include/cmmu.h14
-rw-r--r--sys/arch/m88k/m88k/m8820x_machdep.c16
-rw-r--r--sys/arch/mvme88k/mvme88k/m88110.c10
-rw-r--r--sys/arch/mvme88k/mvme88k/machdep.c9
5 files changed, 25 insertions, 31 deletions
diff --git a/sys/arch/luna88k/luna88k/machdep.c b/sys/arch/luna88k/luna88k/machdep.c
index d991a923a33..f7eabfd6f13 100644
--- a/sys/arch/luna88k/luna88k/machdep.c
+++ b/sys/arch/luna88k/luna88k/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.28 2005/12/04 12:20:17 miod Exp $ */
+/* $OpenBSD: machdep.c,v 1.29 2005/12/04 15:00:23 miod Exp $ */
/*
* Copyright (c) 1998, 1999, 2000, 2001 Steve Murphree, Jr.
* Copyright (c) 1996 Nivas Madhur
@@ -1105,7 +1105,7 @@ luna88k_bootstrap()
extern struct cmmu_p cmmu8820x;
extern char *end;
#ifndef MULTIPROCESSOR
- u_int master_cpu;
+ cpuid_t master_cpu;
#endif
cmmu = &cmmu8820x;
@@ -1127,8 +1127,7 @@ luna88k_bootstrap()
physmem = btoc(last_addr);
setup_board_config();
- cmmu_init();
- master_cpu = cmmu_cpu_number();
+ master_cpu = cmmu_init();
set_cpu_number(master_cpu);
/*
diff --git a/sys/arch/m88k/include/cmmu.h b/sys/arch/m88k/include/cmmu.h
index ae58c666b0b..c23a2f24b38 100644
--- a/sys/arch/m88k/include/cmmu.h
+++ b/sys/arch/m88k/include/cmmu.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: cmmu.h,v 1.14 2005/12/04 12:20:19 miod Exp $ */
+/* $OpenBSD: cmmu.h,v 1.15 2005/12/04 15:00:25 miod Exp $ */
/*
* Mach Operating System
* Copyright (c) 1993-1992 Carnegie Mellon University
@@ -54,10 +54,10 @@ extern __cpu_simple_lock_t cmmu_cpu_lock;
/* machine dependent cmmu function pointer structure */
struct cmmu_p {
- void (*init)(void);
+ cpuid_t (*init)(void);
void (*setup_board_config)(void);
void (*cpu_configuration_print)(int);
- void (*shutdown_now)(void);
+ void (*shutdown)(void);
cpuid_t (*cpu_number)(void);
void (*set_sapr)(cpuid_t, apr_t);
void (*set_uapr)(apr_t);
@@ -69,14 +69,12 @@ struct cmmu_p {
int (*dma_cachectl_pa)(paddr_t, psize_t, int);
};
-/* THE pointer! */
extern struct cmmu_p *cmmu;
-/* The macros... */
#define cmmu_init (cmmu->init)
#define setup_board_config (cmmu->setup_board_config)
#define cpu_configuration_print(a) (cmmu->cpu_configuration_print)(a)
-#define cmmu_shutdown_now (cmmu->shutdown_now)
+#define cmmu_shutdown (cmmu->shutdown)
#define cmmu_cpu_number (cmmu->cpu_number)
#define cmmu_set_sapr(a, b) (cmmu->set_sapr)(a, b)
#define cmmu_set_uapr(a) (cmmu->set_uapr)(a)
@@ -86,10 +84,6 @@ extern struct cmmu_p *cmmu;
#define cmmu_flush_data_cache(a, b, c) (cmmu->flush_data_cache)(a, b, c)
#define dma_cachectl(a, b, c, d) (cmmu->dma_cachectl)(a, b, c, d)
#define dma_cachectl_pa(a, b, c) (cmmu->dma_cachectl_pa)(a, b, c)
-#define cmmu_dump_config (cmmu->dump_config)
-#define cmmu_show_translation(a, b, c, d) \
- (cmmu->show_translation)(a, b, c, d)
-#define show_apr(ap) (cmmu->show_apr)(ap)
/*
* dma_cachectl() modes
diff --git a/sys/arch/m88k/m88k/m8820x_machdep.c b/sys/arch/m88k/m88k/m8820x_machdep.c
index b9ba1de34f0..06a58237565 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.15 2005/12/04 12:20:19 miod Exp $ */
+/* $OpenBSD: m8820x_machdep.c,v 1.16 2005/12/04 15:00:26 miod Exp $ */
/*
* Copyright (c) 2004, Miodrag Vallat.
*
@@ -94,7 +94,7 @@
#include <machine/m8820x.h>
#include <machine/psl.h>
-void m8820x_init(void);
+cpuid_t m8820x_init(void);
void m8820x_cpu_configuration_print(int);
void m8820x_shutdown(void);
void m8820x_set_sapr(cpuid_t, apr_t);
@@ -105,9 +105,6 @@ void m8820x_flush_inst_cache(cpuid_t, paddr_t, psize_t);
void m8820x_flush_data_cache(cpuid_t, paddr_t, psize_t);
int m8820x_dma_cachectl(pmap_t, vaddr_t, vsize_t, int);
int m8820x_dma_cachectl_pa(paddr_t, psize_t, int);
-void m8820x_dump_config(void);
-void m8820x_show_translation(vaddr_t, u_int, u_int, int);
-void m8820x_show_apr(apr_t);
/* This is the function table for the mc8820x CMMUs */
struct cmmu_p cmmu8820x = {
@@ -262,7 +259,7 @@ m8820x_cpu_configuration_print(int master)
printf("cpu%d: ", cpu);
switch (proctype) {
default:
- printf("unknown model arch 0x%x rev 0x%x\n",
+ printf("unknown model arch 0x%x rev 0x%x",
proctype, procvers);
break;
case ARN_88100:
@@ -312,7 +309,8 @@ m8820x_cpu_configuration_print(int master)
} else
#endif
printf(" full");
- printf(" %ccache", CMMU_MODE(mmu) == INST_CMMU ? 'I' : 'D');
+ printf(" %ccache",
+ CMMU_MODE(mmu) == INST_CMMU ? 'I' : 'D');
}
break;
}
@@ -337,7 +335,7 @@ m8820x_cpu_configuration_print(int master)
/*
* CMMU initialization routine
*/
-void
+cpuid_t
m8820x_init()
{
struct m8820x_cmmu *cmmu;
@@ -423,6 +421,8 @@ m8820x_init()
0, cpu, 0, 0);
m8820x_cmmu_wait(cpu);
}
+
+ return (m8820x_cpu_number());
}
/*
diff --git a/sys/arch/mvme88k/mvme88k/m88110.c b/sys/arch/mvme88k/mvme88k/m88110.c
index 46d30d6706a..18ddd7806a6 100644
--- a/sys/arch/mvme88k/mvme88k/m88110.c
+++ b/sys/arch/mvme88k/mvme88k/m88110.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: m88110.c,v 1.33 2005/12/04 12:20:19 miod Exp $ */
+/* $OpenBSD: m88110.c,v 1.34 2005/12/04 15:00:26 miod Exp $ */
/*
* Copyright (c) 1998 Steve Murphree, Jr.
* All rights reserved.
@@ -71,7 +71,7 @@
#include <machine/psl.h>
#include <machine/trap.h>
-void m88110_init(void);
+cpuid_t m88110_init(void);
void m88110_setup_board_config(void);
void m88110_cpu_configuration_print(int);
void m88110_shutdown(void);
@@ -153,7 +153,7 @@ m88110_cpu_configuration_print(int master)
printf("cpu%d: ", cpu);
switch (proctype) {
default:
- printf("unknown model arch 0x%x version 0x%x\n",
+ printf("unknown model arch 0x%x version 0x%x",
proctype, procvers);
break;
case ARN_88110:
@@ -171,7 +171,7 @@ m88110_cpu_configuration_print(int master)
/*
* CMMU initialization routine
*/
-void
+cpuid_t
m88110_init(void)
{
int i;
@@ -212,6 +212,8 @@ m88110_init(void)
set_isr(0);
set_dsr(0);
+
+ return (m88110_cpu_number());
}
/*
diff --git a/sys/arch/mvme88k/mvme88k/machdep.c b/sys/arch/mvme88k/mvme88k/machdep.c
index 95c22a466c4..49f1cc7cb20 100644
--- a/sys/arch/mvme88k/mvme88k/machdep.c
+++ b/sys/arch/mvme88k/mvme88k/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.172 2005/12/04 12:20:19 miod Exp $ */
+/* $OpenBSD: machdep.c,v 1.173 2005/12/04 15:00:26 miod Exp $ */
/*
* Copyright (c) 1998, 1999, 2000, 2001 Steve Murphree, Jr.
* Copyright (c) 1996 Nivas Madhur
@@ -563,7 +563,7 @@ allocsys(v)
__dead void
_doboot()
{
- cmmu_shutdown_now();
+ cmmu_shutdown();
bugreturn();
/*NOTREACHED*/
for (;;); /* appease gcc */
@@ -1032,7 +1032,7 @@ mvme_bootstrap()
extern struct consdev *cn_tab;
struct mvmeprom_brdid brdid;
#ifndef MULTIPROCESSOR
- u_int master_cpu;
+ cpuid_t master_cpu;
#endif
buginit();
@@ -1094,8 +1094,7 @@ mvme_bootstrap()
physmem = btoc(last_addr);
setup_board_config();
- cmmu_init();
- master_cpu = cmmu_cpu_number();
+ master_cpu = cmmu_init();
set_cpu_number(master_cpu);
/*