summaryrefslogtreecommitdiff
path: root/sys/arch
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2011-09-19 21:53:03 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2011-09-19 21:53:03 +0000
commitb7fc97d9812d76a1f7ba09d9ee3d6b89f31158a2 (patch)
tree3c9b8d9e3f2dc920b26c9b7853873c6f4ffc7195 /sys/arch
parentcffd557b24ccfe493733ce3d4c06f22eb59539b7 (diff)
Try and clean system type constants a bit:
- save the second byte of vax_siedata into a new variable, vax_cpustype, and use it instead of (vax_siedata >> 8) & 0xff or other similar constructs. - the VAX_SIE_KAxxx constants are duplicates of the VAX_STYP_xx constants. Standardize on the latter and kill the former. - only keep VAX_VTYP_xx constants for KA46 and KA47, those are the only systems which use these constants and are told apart by a different SIE byte. No functional change intended.
Diffstat (limited to 'sys/arch')
-rw-r--r--sys/arch/vax/dec/dzcons.c4
-rw-r--r--sys/arch/vax/include/ka650.h4
-rw-r--r--sys/arch/vax/include/sid.h70
-rw-r--r--sys/arch/vax/stand/boot/boot.c4
-rw-r--r--sys/arch/vax/stand/boot/if_le.c4
-rw-r--r--sys/arch/vax/vax/findcpu.c4
-rw-r--r--sys/arch/vax/vax/ibus.c7
-rw-r--r--sys/arch/vax/vax/ka46.c4
-rw-r--r--sys/arch/vax/vax/ka48.c4
-rw-r--r--sys/arch/vax/vax/ka53.c4
-rw-r--r--sys/arch/vax/vax/ka650.c13
-rw-r--r--sys/arch/vax/vax/ka680.c8
-rw-r--r--sys/arch/vax/vax/machdep.c22
-rw-r--r--sys/arch/vax/vsa/lcg.c6
14 files changed, 56 insertions, 102 deletions
diff --git a/sys/arch/vax/dec/dzcons.c b/sys/arch/vax/dec/dzcons.c
index 939336497f3..c5bf9454de0 100644
--- a/sys/arch/vax/dec/dzcons.c
+++ b/sys/arch/vax/dec/dzcons.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dzcons.c,v 1.5 2011/09/11 19:29:01 miod Exp $ */
+/* $OpenBSD: dzcons.c,v 1.6 2011/09/19 21:53:00 miod Exp $ */
/* $NetBSD: dz_ibus.c,v 1.15 1999/08/27 17:50:42 ragge Exp $ */
/*
* Copyright (c) 1998 Ludd, University of Lule}, Sweden.
@@ -124,7 +124,7 @@ dz_can_have_kbd()
return (1);
break;
case VAX_BTYP_48:
- if (((vax_siedata >> 8) & 0xff) == VAX_STYP_48)
+ if (vax_cpustype == VAX_STYP_48)
return (1);
break;
diff --git a/sys/arch/vax/include/ka650.h b/sys/arch/vax/include/ka650.h
index f941a5298cf..d9ec7c72b92 100644
--- a/sys/arch/vax/include/ka650.h
+++ b/sys/arch/vax/include/ka650.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: ka650.h,v 1.11 2008/08/18 23:07:24 miod Exp $ */
+/* $OpenBSD: ka650.h,v 1.12 2011/09/19 21:53:02 miod Exp $ */
/* $NetBSD: ka650.h,v 1.6 1997/07/26 10:12:43 ragge Exp $ */
/*
* Copyright (c) 1988 The Regents of the University of California.
@@ -171,7 +171,5 @@ struct ka650_ipcr {
/*
* Some useful macros
*/
-#define GETCPUTYPE(x) ((x >> 24) & 0xff)
-#define GETSYSSUBT(x) ((x >> 8) & 0xff)
#define GETFRMREV(x) ((x >> 16) & 0xff)
#define GETCODREV(x) (x & 0xff)
diff --git a/sys/arch/vax/include/sid.h b/sys/arch/vax/include/sid.h
index f785c39a667..f1478f9bb3b 100644
--- a/sys/arch/vax/include/sid.h
+++ b/sys/arch/vax/include/sid.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: sid.h,v 1.15 2006/07/19 20:22:36 miod Exp $ */
+/* $OpenBSD: sid.h,v 1.16 2011/09/19 21:53:02 miod Exp $ */
/* $NetBSD: sid.h,v 1.12 1999/12/11 17:55:13 ragge Exp $ */
/*
@@ -32,15 +32,6 @@
*/
/*
- * Board-Type (?_BTYP_?) and Sub-Type (?_STYP_?) are synonyms.
- * Michael Kukat changed this 01/27/2001, STYP is relly a subtype now.
- * other synonyms are:
- */
-#define cpudata vax_cpudata
-#define cputype vax_cputype
-#define cpusubtype vax_boardtype
-
-/*
* Chip CPU types / chip CPU Subtypes
*
* The type of a VAX is given by the high-order byte of the System
@@ -78,7 +69,6 @@
* MicroVAX I (1984)
*/
#define VAX_TYP_UV1 7 /* MicroVAX I, VAXstation I */
- /* VAX_TYP_610 7 */
#define VAX_BTYP_610 0x07000000 /* generic MicroVAX-I */
@@ -86,7 +76,6 @@
* MicroVAX II series (1985)
*/
#define VAX_TYP_UV2 8
- /* VAX_TYP_78032 8 */
#define VAX_BTYP_630 0x08000001 /* MicroVAX II, VAXstation II */
#define VAX_BTYP_410 0x08000004 /* MicroVAX 2000, VAXstation 2000 */
@@ -95,34 +84,24 @@
* CVAX chip series (1987)
*/
#define VAX_TYP_CVAX 10
- /* VAX_TYP_650 10 */
-
-#define VAX_BTYP_650 0x0A000001 /* MicroVAX 3500, 3600 */
- /* VAX_BTYP_65D 0x0A000001 VAXstation 3200, 3500 XXX */
- /* VAX_BTYP_640 0x0A000001 MicroVAX 3300, 3400 XXX */
- /* VAX_BTYP_655 0x0A000001 MicroVAX 3800, 3900 XXX */
+#define VAX_BTYP_650 0x0A000001 /* MicroVAX 3[345689]00 */
+#define VAX_STYP_650 0x1 /* MicroVAX 3500, 3600 */
+#define VAX_STYP_640 0x2 /* MicroVAX 3300, 3400 */
+#define VAX_STYP_655 0x3 /* MicroVAX 3800, 3900 */
#define VAX_BTYP_9CC 0x0A000002 /* VAX 6000 model 210/310 */
#define VAX_BTYP_60 0x0A000003 /* VAXstation 3520, 3540 */
#define VAX_BTYP_420 0x0A000004 /* VAXstation 3100 models 10 - 48 */
#define VAX_BTYP_IS1 0x0A000006 /* Infoserver 1000 */
-#define VAX_BTYP_510 0x0A000007 /* VAXft model 110 */
- /* VAX_BTYP_520 0x0A000007 VAXft model 310 */
+#define VAX_BTYP_5x0 0x0A000007 /* VAXft model 110, 310 */
/*
- * SID Extension register definitions for CVAX series
- */
-#define VAX_SIE_KA640 0x2 /* KA640 MicroVAX 3300, 3400 */
-#define VAX_SIE_KA650 0x1 /* KA650 MicroVAX 3500, 3600 */
-#define VAX_SIE_KA655 0x3 /* KA655 MicroVAX 3800, 3900 */
-
-/*
* Rigel chip series (1990)
*/
#define VAX_TYP_RIGEL 11
- /* VAX_TYP_9RR 11 */
-#define VAX_BTYP_670 0x0B000001 /* VAX 4000 model 300 */
+#define VAX_BTYP_670 0x0B000001 /* VAX 4000 300 */
+#define VAX_STYP_670 0x4 /* VAX 4000 300 */
#define VAX_BTYP_9RR 0x0B000002 /* VAX 6000 model 410-460 */
#define VAX_BTYP_43 0x0B000004 /* VAXstation 3100 model 76 */
@@ -131,9 +110,6 @@
*/
#define VAX_TYP_9000 14
-#define VAX_BTYP_9AR 0x0E00000? /* VAX 9000 models 210, 410-440 */
-#define VAX_BTYP_9AQ 0x0E00000? /* VAX 9000 models 400-800 */
-
/*
* Polarstar series (1988)
*/
@@ -145,9 +121,7 @@
* Mariah chip series (1991)
*/
#define VAX_TYP_MARIAH 18
-#define VAX_TYP_V12 18
-#define VAX_BTYP_690 0x12000001 /* VAX 4000 model 400 */
#define VAX_BTYP_1202 0x12000002 /* VAX 6000 model 510-560 */
#define VAX_BTYP_46 0x12000004 /* VAXstation 4000/60, 3100/80 */
@@ -158,13 +132,11 @@
* NVAX chip series (1991)
*/
#define VAX_TYP_NVAX 19
-#define VAX_TYP_V13 19
-#define VAX_BTYP_1301 0x13000001 /* VAX 4000 model [4-6]00 */
+#define VAX_BTYP_1301 0x13000001 /* Omega machines */
#define VAX_STYP_675 0x00000c /* VAX 4000 model 400 */
#define VAX_STYP_680 0x000006 /* VAX 4000 model 500 */
#define VAX_STYP_690 0x000007 /* VAX 4000 model 600 */
-#define VAX_STYP_692 0x000010 /* VAX 4000 model 700? */
#define VAX_BTYP_1302 0x13000002
@@ -177,7 +149,9 @@
#define VAX_BTYP_1305 0x13000005 /* Legacy machines */
#define VAX_STYP_681 0x00000e /* VAX 4000 model 500A */
#define VAX_STYP_691 0x00000f /* VAX 4000 model 605A */
-#define VAX_STYP_694 0x000010 /* VAX 4000 model 705A */
+#define VAX_STYP_692 0x000010 /* VAX 4000 model 700 */
+#define VAX_STYP_694 0x000010 /* VAX 4000 model 705A
+ (same value as 692) */
#define VAX_BTYP_49 0x13000004 /* VaxStation 4000 model 90 */
@@ -185,14 +159,12 @@
* SOC chip series (1991)
*/
#define VAX_TYP_SOC 20
-#define VAX_TYP_V14 20
#define VAX_BTYP_660 0x14000001 /* VAX 4000 model 200 */
+#define VAX_STYP_660 0x5
#define VAX_BTYP_48 0x14000004 /* VS4000/VLC and MV3100/{30,40} */
#define VAX_STYP_45 0x000000 /* MicroVAX 3100 {30,40} */
-#define VAX_VTYP_45 0x00000001 /* MicroVAX 3100 {30,40} */
#define VAX_STYP_48 0x000001 /* VAXstation 4000 VLC */
-#define VAX_VTYP_48 0x00000002 /* VAXstation 4000 VLC */
#define VAX_BTYP_550 0x14000007 /* VAXft model 410, 610 */
#define VAX_BTYP_VXT 0x14000008 /* VXT 2000+ */
@@ -200,28 +172,14 @@
* NVAX+ chip series (1991)
*/
#define VAX_TYP_NVPLUS 23
-#define VAX_TYP_V17 23
#define VAX_BTYP_1701 0x17000001
/*
- * compatibility with old names:
- */
-
-#define VAX_780 VAX_TYP_780
-#define VAX_750 VAX_TYP_750
-#define VAX_730 VAX_TYP_730
-#define VAX_8600 VAX_TYP_790
-#define VAX_8200 VAX_TYP_8SS
-#define VAX_8800 VAX_TYP_8NN
-#define VAX_610 VAX_TYP_UV1
-#define VAX_78032 VAX_TYP_UV2
-#define VAX_650 VAX_TYP_CVAX
-
-/*
* Some common-used external variables.
*/
extern int vax_cputype; /* general, highest byte of the SID-register */
+extern int vax_cpustype; /* general, second byte of the SIE-register */
extern int vax_cpudata; /* general, the contents of the SID-register */
extern int vax_siedata; /* contents of the SIE register */
extern int vax_bustype; /* HW-dep., setup at consinit() in ka???.c */
diff --git a/sys/arch/vax/stand/boot/boot.c b/sys/arch/vax/stand/boot/boot.c
index 597185c079e..17aec75e436 100644
--- a/sys/arch/vax/stand/boot/boot.c
+++ b/sys/arch/vax/stand/boot/boot.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: boot.c,v 1.20 2011/07/06 18:32:59 miod Exp $ */
+/* $OpenBSD: boot.c,v 1.21 2011/09/19 21:53:02 miod Exp $ */
/* $NetBSD: boot.c,v 1.18 2002/05/31 15:58:26 ragge Exp $ */
/*-
* Copyright (c) 1982, 1986 The Regents of the University of California.
@@ -99,7 +99,7 @@ Xmain(void)
if (((vax_boardtype == VAX_BTYP_46 &&
(vax_siedata & 0xff) == VAX_VTYP_46) ||
(vax_boardtype == VAX_BTYP_48 &&
- ((vax_siedata >> 8) & 0xff) == VAX_STYP_48)) &&
+ vax_cpustype == VAX_STYP_48)) &&
(vax_confdata & 0x100) == 0)
transition = ' ';
diff --git a/sys/arch/vax/stand/boot/if_le.c b/sys/arch/vax/stand/boot/if_le.c
index e7860d97762..1be0350cdda 100644
--- a/sys/arch/vax/stand/boot/if_le.c
+++ b/sys/arch/vax/stand/boot/if_le.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_le.c,v 1.6 2008/08/18 23:20:44 miod Exp $ */
+/* $OpenBSD: if_le.c,v 1.7 2011/09/19 21:53:02 miod Exp $ */
/* $NetBSD: if_le.c,v 1.6 2000/05/20 13:30:03 ragge Exp $ */
/*
* Copyright (c) 1997, 1999 Ludd, University of Lule}, Sweden.
@@ -148,7 +148,7 @@ leopen(struct open_file *f, int adapt, int ctlr, int unit, int part)
next_rdesc = next_tdesc = 0;
if (vax_boardtype == VAX_BTYP_650 &&
- ((vax_siedata >> 8) & 0xff) == VAX_SIE_KA640) {
+ vax_cpustype == VAX_STYP_640) {
lebufaddr = 0x20120000;
ea = (void *)0x20084200;
nireg = (void *)0x20084400;
diff --git a/sys/arch/vax/vax/findcpu.c b/sys/arch/vax/vax/findcpu.c
index 76c93124bc9..e7ee36186b6 100644
--- a/sys/arch/vax/vax/findcpu.c
+++ b/sys/arch/vax/vax/findcpu.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: findcpu.c,v 1.15 2011/07/06 18:32:59 miod Exp $ */
+/* $OpenBSD: findcpu.c,v 1.16 2011/09/19 21:53:02 miod Exp $ */
/* $NetBSD: findcpu.c,v 1.5 1999/08/23 19:10:43 ragge Exp $ */
/*
* Copyright (c) 1994, 1998 Ludd, University of Lule}, Sweden.
@@ -47,6 +47,7 @@
* outside of this routine, they should be read only!
*/
int vax_cputype; /* highest byte of SID register */
+int vax_cpustype; /* second byte of SIE register */
int vax_bustype; /* holds/defines the main bus type on this machine */
int vax_boardtype; /* machine dependent, combination of SID and SIE */
@@ -74,6 +75,7 @@ findcpu(void)
case VAX_TYP_NVAX:
case VAX_TYP_SOC:
vax_siedata = *(int *)(0x20040004); /* SIE address */
+ vax_cpustype = (vax_siedata >> 8) & 0xff;
vax_boardtype |= vax_siedata >> 24;
switch (vax_boardtype) {
diff --git a/sys/arch/vax/vax/ibus.c b/sys/arch/vax/vax/ibus.c
index 0b21cb8d121..4a36c247121 100644
--- a/sys/arch/vax/vax/ibus.c
+++ b/sys/arch/vax/vax/ibus.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ibus.c,v 1.8 2006/07/20 19:55:20 miod Exp $ */
+/* $OpenBSD: ibus.c,v 1.9 2011/09/19 21:53:02 miod Exp $ */
/* $NetBSD: ibus.c,v 1.7 2001/02/04 20:36:32 ragge Exp $ */
/*
* Copyright (c) 1999 Ludd, University of Lule}, Sweden.
@@ -112,10 +112,9 @@ ibus_attach(parent, self, aux)
bp.type = "shac";
/*
* XXX Clearly the address on Cheetah machines varies between models,
- * XXX but I could only check the address on a 4000 105A so far. -- miod
+ * XXX but I could only check the address on a 4000 106 so far. -- miod
*/
- if (vax_boardtype == VAX_BTYP_1303 &&
- ((vax_siedata >> 8) & 0xFF) != VAX_STYP_53)
+ if (vax_boardtype == VAX_BTYP_1303 && vax_cpustype != VAX_STYP_53)
va = vax_map_physmem(SHAC1303ADDR, 1);
else
va = vax_map_physmem(SHACADDR, 1);
diff --git a/sys/arch/vax/vax/ka46.c b/sys/arch/vax/vax/ka46.c
index 95e3977a1d9..b7684c92f06 100644
--- a/sys/arch/vax/vax/ka46.c
+++ b/sys/arch/vax/vax/ka46.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ka46.c,v 1.10 2011/07/06 20:42:05 miod Exp $ */
+/* $OpenBSD: ka46.c,v 1.11 2011/09/19 21:53:02 miod Exp $ */
/* $NetBSD: ka46.c,v 1.12 2000/03/04 07:27:49 matt Exp $ */
/*
* Copyright (c) 1998 Ludd, University of Lule}, Sweden.
@@ -86,7 +86,7 @@ struct cpu_dep ka46_calls = {
void
ka46_conf()
{
- switch(vax_siedata & 0xFF) {
+ switch (vax_siedata & 0xFF) {
case VAX_VTYP_47:
printf("cpu: KA47\n");
break;
diff --git a/sys/arch/vax/vax/ka48.c b/sys/arch/vax/vax/ka48.c
index 66c455dbf9a..9085cab19a6 100644
--- a/sys/arch/vax/vax/ka48.c
+++ b/sys/arch/vax/vax/ka48.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ka48.c,v 1.13 2011/09/15 00:48:24 miod Exp $ */
+/* $OpenBSD: ka48.c,v 1.14 2011/09/19 21:53:02 miod Exp $ */
/*
* Copyright (c) 1998 Ludd, University of Lule}, Sweden.
* All rights reserved.
@@ -88,7 +88,7 @@ void
ka48_conf()
{
char *cpuname;
- switch((vax_siedata >> 8) & 0xFF) {
+ switch (vax_cpustype) {
case VAX_STYP_45:
cpuname = "KA45";
break;
diff --git a/sys/arch/vax/vax/ka53.c b/sys/arch/vax/vax/ka53.c
index 7e0fca1eafa..dae90c4774a 100644
--- a/sys/arch/vax/vax/ka53.c
+++ b/sys/arch/vax/vax/ka53.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ka53.c,v 1.9 2011/09/15 00:48:24 miod Exp $ */
+/* $OpenBSD: ka53.c,v 1.10 2011/09/19 21:53:02 miod Exp $ */
/* $NetBSD: ka53.c,v 1.2 2000/06/04 02:19:27 matt Exp $ */
/*
* Copyright (c) 2002 Hugh Graham.
@@ -82,7 +82,7 @@ ka53_conf()
cpmbx = (struct cpmbx *)vax_map_physmem(0x20140400, 1);
- switch((vax_siedata >> 8) & 0xFF) {
+ switch (vax_cpustype) {
case VAX_STYP_50:
cpuname = "KA50";
break;
diff --git a/sys/arch/vax/vax/ka650.c b/sys/arch/vax/vax/ka650.c
index 0174e1e5eaf..0bd515a0687 100644
--- a/sys/arch/vax/vax/ka650.c
+++ b/sys/arch/vax/vax/ka650.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ka650.c,v 1.20 2011/09/15 00:48:24 miod Exp $ */
+/* $OpenBSD: ka650.c,v 1.21 2011/09/19 21:53:02 miod Exp $ */
/* $NetBSD: ka650.c,v 1.25 2001/04/27 15:02:37 ragge Exp $ */
/*
* Copyright (c) 1988 The Regents of the University of California.
@@ -88,8 +88,6 @@ struct cpu_dep ka650_calls = {
void
uvaxIII_conf()
{
- int syssub = GETSYSSUBT(vax_siedata);
-
/*
* MicroVAX III: We map in memory error registers,
* cache control registers, SSC registers,
@@ -103,8 +101,8 @@ uvaxIII_conf()
(KA650_CACHESIZE/VAX_NBPG));
printf("cpu: KA6%d%d, CVAX microcode rev %d Firmware rev %d\n",
- syssub == VAX_SIE_KA640 ? 4 : 5,
- syssub == VAX_SIE_KA655 ? 5 : 0,
+ vax_cpustype == VAX_STYP_640 ? 4 : 5,
+ vax_cpustype == VAX_STYP_655 ? 5 : 0,
(vax_cpudata & 0xff), GETFRMREV(vax_siedata));
ka650setcache(CACHEON);
if (ptoa(physmem) > ka650merr_ptr->merr_qbmbr) {
@@ -229,14 +227,13 @@ uvaxIII_mchk(cmcf)
void
ka650setcache(int state)
{
- int syssub = GETSYSSUBT(vax_siedata);
int i;
/*
* Before doing anything, disable the cache.
*/
mtpr(0, PR_CADR);
- if (syssub != VAX_SIE_KA640)
+ if (vax_cpustype != VAX_STYP_640)
ka650cbd_ptr->cbd_cacr = CACR_CPE;
/*
@@ -244,7 +241,7 @@ ka650setcache(int state)
*/
if (state == CACHEON) {
mtpr(CADR_SEN2 | CADR_SEN1 | CADR_CENI | CADR_CEND, PR_CADR);
- if (syssub != VAX_SIE_KA640) {
+ if (vax_cpustype != VAX_STYP_640) {
for (i = 0;
i < (KA650_CACHESIZE / sizeof(KA650_CACHE_ptr[0]));
i += 2)
diff --git a/sys/arch/vax/vax/ka680.c b/sys/arch/vax/vax/ka680.c
index 4291e3ff18d..37086955341 100644
--- a/sys/arch/vax/vax/ka680.c
+++ b/sys/arch/vax/vax/ka680.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ka680.c,v 1.14 2011/09/15 00:48:24 miod Exp $ */
+/* $OpenBSD: ka680.c,v 1.15 2011/09/19 21:53:02 miod Exp $ */
/* $NetBSD: ka680.c,v 1.3 2001/01/28 21:01:53 ragge Exp $ */
/*
* Copyright (c) 2002 Hugh Graham.
@@ -115,7 +115,7 @@ ka680_conf()
switch(vax_boardtype) {
case VAX_BTYP_1301:
- switch((vax_siedata & 0xff00) >> 8) {
+ switch (vax_cpustype) {
case VAX_STYP_675:
cpuname = "KA675";
break;
@@ -130,7 +130,7 @@ ka680_conf()
}
break;
case VAX_BTYP_1305:
- switch((vax_siedata & 0xff00) >> 8) {
+ switch (vax_cpustype) {
case VAX_STYP_681:
cpuname = "KA681";
break;
@@ -170,7 +170,7 @@ ka680_cache_enable()
mtpr(mfpr(PR_BCEDSTS), PR_BCEDSTS); /* Clear error bits */
mtpr(mfpr(PR_NESTS), PR_NESTS); /* Clear error bits */
- switch((vax_siedata & 0xff00) >> 8) {
+ switch (vax_cpustype) {
case VAX_STYP_680:
case VAX_STYP_681: /* XXX untested */
fslut = 0x01420000;
diff --git a/sys/arch/vax/vax/machdep.c b/sys/arch/vax/vax/machdep.c
index d099567de42..7011804aeeb 100644
--- a/sys/arch/vax/vax/machdep.c
+++ b/sys/arch/vax/vax/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.119 2011/07/09 00:47:18 henning Exp $ */
+/* $OpenBSD: machdep.c,v 1.120 2011/09/19 21:53:02 miod Exp $ */
/* $NetBSD: machdep.c,v 1.108 2000/09/13 15:00:23 thorpej Exp $ */
/*
@@ -1109,7 +1109,7 @@ start(struct rpb *prpb)
case VAX_BTYP_420: /* They are very similar */
dep_call = &ka410_calls;
strlcat(cpu_model, "3100", sizeof cpu_model);
- switch ((vax_siedata >> 8) & 0xff) {
+ switch (vax_cpustype) {
case 0x00:
strlcat(cpu_model, "/m{30,40}", sizeof cpu_model);
break;
@@ -1136,7 +1136,7 @@ start(struct rpb *prpb)
#if VAX46
case VAX_BTYP_46:
dep_call = &ka46_calls;
- switch(vax_siedata & 0xff) {
+ switch (vax_siedata & 0xff) {
case VAX_VTYP_47:
strlcpy(cpu_model, "MicroVAX 3100 m80", sizeof cpu_model);
break;
@@ -1157,7 +1157,7 @@ start(struct rpb *prpb)
#if VAX48
case VAX_BTYP_48:
dep_call = &ka48_calls;
- switch ((vax_siedata >> 8) & 0xff) {
+ switch (vax_cpustype) {
case VAX_STYP_45:
strlcpy(cpu_model, "MicroVAX 3100/m{30,40}", sizeof cpu_model);
break;
@@ -1178,7 +1178,7 @@ start(struct rpb *prpb)
#if VAX53
case VAX_BTYP_1303:
dep_call = &ka53_calls;
- switch ((vax_siedata >> 8) & 0xff) {
+ switch (vax_cpustype) {
case VAX_STYP_50:
strlcpy(cpu_model, "MicroVAX 3100 model 85 or 90", sizeof cpu_model);
break;
@@ -1206,16 +1206,16 @@ start(struct rpb *prpb)
case VAX_BTYP_650:
dep_call = &ka650_calls;
strlcpy(cpu_model,"MicroVAX ", sizeof cpu_model);
- switch ((vax_siedata >> 8) & 255) {
- case VAX_SIE_KA640:
+ switch (vax_cpustype) {
+ case VAX_STYP_640:
strlcat(cpu_model, "3300/3400", sizeof cpu_model);
break;
- case VAX_SIE_KA650:
+ case VAX_STYP_650:
strlcat(cpu_model, "3500/3600", sizeof cpu_model);
break;
- case VAX_SIE_KA655:
+ case VAX_STYP_655:
strlcat(cpu_model, "3800/3900", sizeof cpu_model);
break;
@@ -1241,7 +1241,7 @@ start(struct rpb *prpb)
case VAX_BTYP_1301:
dep_call = &ka680_calls;
strlcpy(cpu_model,"VAX 4000 ", sizeof cpu_model);
- switch ((vax_siedata >> 8) & 0xff) {
+ switch (vax_cpustype) {
case VAX_STYP_675:
strlcat(cpu_model,"400", sizeof cpu_model);
break;
@@ -1258,7 +1258,7 @@ start(struct rpb *prpb)
case VAX_BTYP_1305:
dep_call = &ka680_calls;
strlcpy(cpu_model,"VAX 4000 ", sizeof cpu_model);
- switch ((vax_siedata >> 8) & 0xff) {
+ switch (vax_cpustype) {
case VAX_STYP_681:
strlcat(cpu_model,"500A", sizeof cpu_model);
break;
diff --git a/sys/arch/vax/vsa/lcg.c b/sys/arch/vax/vsa/lcg.c
index 4614f1316d4..bf76d69e2a9 100644
--- a/sys/arch/vax/vsa/lcg.c
+++ b/sys/arch/vax/vsa/lcg.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: lcg.c,v 1.18 2011/09/11 14:00:34 miod Exp $ */
+/* $OpenBSD: lcg.c,v 1.19 2011/09/19 21:53:02 miod Exp $ */
/*
* Copyright (c) 2006 Miodrag Vallat.
*
@@ -176,7 +176,7 @@ lcg_match(struct device *parent, void *vcf, void *aux)
return (0);
break;
case VAX_BTYP_48:
- if (((vax_siedata >> 8) & 0xff) != VAX_STYP_48)
+ if (vax_cpustype != VAX_STYP_48)
return (0);
/* KA48 can't boot without the frame buffer board */
break;
@@ -727,7 +727,7 @@ lcgcnprobe()
return (0); /* no frame buffer */
break;
case VAX_BTYP_48:
- if (((vax_siedata >> 8) & 0xff) != VAX_STYP_48)
+ if (vax_cpustype != VAX_STYP_48)
return (0);
break;
default: