diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2003-10-11 22:46:26 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2003-10-11 22:46:26 +0000 |
commit | 2e5b2dc306720a1d427697c13b67f7a258eb4164 (patch) | |
tree | a4a2ee02bfadc105fe5071a3f7979896e783ce69 /sys/arch | |
parent | 57d2abb4c707e3cc3473d7afe7e191295d3dd748 (diff) |
Get rid of "union cpupid"; makes <machine/cpus.h> disappear as well.
Diffstat (limited to 'sys/arch')
-rw-r--r-- | sys/arch/mvme88k/include/cpus.h | 61 | ||||
-rw-r--r-- | sys/arch/mvme88k/include/m8820x.h | 7 | ||||
-rw-r--r-- | sys/arch/mvme88k/mvme88k/m8820x.c | 28 |
3 files changed, 18 insertions, 78 deletions
diff --git a/sys/arch/mvme88k/include/cpus.h b/sys/arch/mvme88k/include/cpus.h deleted file mode 100644 index 4de514f31ae..00000000000 --- a/sys/arch/mvme88k/include/cpus.h +++ /dev/null @@ -1,61 +0,0 @@ -/* $OpenBSD: cpus.h,v 1.12 2003/10/11 22:08:57 miod Exp $ */ -/* - * Mach Operating System - * Copyright (c) 1993-1992 Carnegie Mellon University - * All Rights Reserved. - * - * Permission to use, copy, modify and distribute this software and its - * documentation is hereby granted, provided that both the copyright - * notice and this permission notice appear in all copies of the - * software, derivative works or modified versions, and any portions - * thereof, and that both notices appear in supporting documentation. - * - * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" - * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR - * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. - * - * Carnegie Mellon requests users of this software to return to - * - * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU - * School of Computer Science - * Carnegie Mellon University - * Pittsburgh PA 15213-3890 - * - * any improvements or extensions that they make and grant Carnegie Mellon - * the rights to redistribute these changes. - */ -/* - * Versions Idents for 88k family chips - */ - -#ifndef __MACHINE_CPUS_H__ -#define __MACHINE_CPUS_H__ - -/* - * cpu Processor Identification Register (PID). - */ -#ifndef _LOCORE -union cpupid { - unsigned cpupid; - struct { - unsigned - /*empty*/:16, - arc:8, - version:7, - master:1; - } m88100; - struct { - unsigned - id:8, - type:3, - version:5, - /*empty*/:16; - } m88200; -}; -#endif /* _LOCORE */ - -#define M88100_ID 0 -#define M88200_ID 5 -#define M88204_ID 6 - -#endif /* __MACHINE_CPUS_H__ */ diff --git a/sys/arch/mvme88k/include/m8820x.h b/sys/arch/mvme88k/include/m8820x.h index f27a2d16101..cc95c8d76ff 100644 --- a/sys/arch/mvme88k/include/m8820x.h +++ b/sys/arch/mvme88k/include/m8820x.h @@ -1,4 +1,4 @@ -/* $OpenBSD: m8820x.h,v 1.8 2003/10/05 20:35:22 miod Exp $ */ +/* $OpenBSD: m8820x.h,v 1.9 2003/10/11 22:46:24 miod Exp $ */ /* * Mach Operating System * Copyright (c) 1993-1992 Carnegie Mellon University @@ -145,4 +145,9 @@ #define NBSG (4*1024*1024) /* segment size */ +#define CMMU_TYPE(idr) (((idr) >> 21) & 0x07) + +#define M88200_ID 5 +#define M88204_ID 6 + #endif /* __MACHINE_M8820X_H__ */ diff --git a/sys/arch/mvme88k/mvme88k/m8820x.c b/sys/arch/mvme88k/mvme88k/m8820x.c index 57a376f486f..d3051c6c503 100644 --- a/sys/arch/mvme88k/mvme88k/m8820x.c +++ b/sys/arch/mvme88k/mvme88k/m8820x.c @@ -1,4 +1,4 @@ -/* $OpenBSD: m8820x.c,v 1.22 2003/10/08 13:26:12 miod Exp $ */ +/* $OpenBSD: m8820x.c,v 1.23 2003/10/11 22:46:25 miod Exp $ */ /* * Copyright (c) 2001 Steve Murphree, Jr. * Copyright (c) 1996 Nivas Madhur @@ -65,7 +65,6 @@ #include <machine/asm_macro.h> #include <machine/board.h> -#include <machine/cpus.h> #include <machine/cpu_number.h> #include <machine/locore.h> @@ -428,12 +427,11 @@ m8820x_setup_board_config() for (cmmu_num = 0; cmmu_num < max_cmmus; cmmu_num++) { cr = m8820x_cmmu[cmmu_num].cmmu_regs; if (!badwordaddr((vaddr_t)cr)) { - union cpupid id; + int type; - id.cpupid = cr->idr; + type = CMMU_TYPE(cr->idr); #ifdef DIAGNOSTIC - if (id.m88200.type != M88200_ID && - id.m88200.type != M88204_ID) { + if (type != M88200_ID && type != M88204_ID) { printf("WARNING: non M8820x circuit found " "at CMMU address %p\n", cr); continue; /* will probably die quickly */ @@ -450,8 +448,7 @@ m8820x_setup_board_config() * CPU/CMMU sets seem complete (hopefully all) */ for (num = 0; num < max_cpus; num++) { - int i; - union cpupid id; + int i, type; for (i = 0; i < cpu_cmmu_ratio; i++) { dprintf(("cmmu_init: testing CMMU %d for CPU %d\n", @@ -465,11 +462,11 @@ m8820x_setup_board_config() #endif } cpu_sets[num] = 1; /* This cpu installed... */ - id.cpupid = m8820x_cmmu[num * cpu_cmmu_ratio].cmmu_regs->idr; + type = CMMU_TYPE(m8820x_cmmu[num * cpu_cmmu_ratio]. + cmmu_regs->idr); printf("CPU%d is attached with %d MC%x CMMUs\n", - num, cpu_cmmu_ratio, - id.m88200.type == M88204_ID ? 0x88204 : 0x88200); + num, cpu_cmmu_ratio, type == M88204_ID ? 0x88204 : 0x88200); } for (num = 0; num < max_cpus; num++) { @@ -766,7 +763,7 @@ m8820x_cpu_configuration_print(master) for (mmu = cpu * cpu_cmmu_ratio; mmu < (cpu + 1) * cpu_cmmu_ratio; mmu++) { int idr = m8820x_cmmu_get(mmu, CMMU_IDR); - int mmuid = (0xe00000 & idr) >> 21; + int mmuid = CMMU_TYPE(idr); int access = m8820x_cmmu[mmu].cmmu_access; if ((mmu - cpu * cpu_cmmu_ratio) % 2 == 0) @@ -809,8 +806,7 @@ void m8820x_cmmu_init() { unsigned tmp, cmmu_num; - union cpupid id; - int cpu; + int cpu, type; struct cmmu_regs *cr; for (cpu = 0; cpu < max_cpus; cpu++) { @@ -821,7 +817,7 @@ m8820x_cmmu_init() for (cmmu_num = 0; cmmu_num < max_cmmus; cmmu_num++) { if (m8820x_cmmu_alive(cmmu_num)) { cr = m8820x_cmmu[cmmu_num].cmmu_regs; - id.cpupid = cr->idr; + type = CMMU_TYPE(cr->idr); cpu_cmmu[m8820x_cmmu[cmmu_num].cmmu_cpu].pair[m8820x_cmmu[cmmu_num].which] = &m8820x_cmmu[cmmu_num]; @@ -836,7 +832,7 @@ m8820x_cmmu_init() } /* 88204 has additional cache to clear */ - if (id.m88200.type == M88204_ID) { + if (type == M88204_ID) { for (tmp = 0; tmp < 255; tmp++) { cr->sar = tmp << 4; cr->cssp1 = 0x3f0ff000; |