summaryrefslogtreecommitdiff
path: root/sys/arch
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2010-07-10 19:32:26 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2010-07-10 19:32:26 +0000
commit9a9eb00f7b2ba1a461a4f0e474e2d8431e727018 (patch)
tree9aced9ad7d9f9287739626262ea6f8bb85e23935 /sys/arch
parentab98f8b4b2be806732331cc202bf10bf268cac9f (diff)
sun4e (i.e. SPARCengine 1e) support. This platform is a mix between sun4 and
sun4c, as it has a sun4c OpenPROM but a sun4 8KB pagesize. VME devices are not supported yet. ok deraadt@
Diffstat (limited to 'sys/arch')
-rw-r--r--sys/arch/sparc/conf/GENERIC25
-rw-r--r--sys/arch/sparc/conf/RAMDISK21
-rw-r--r--sys/arch/sparc/dev/bwtwo.c6
-rw-r--r--sys/arch/sparc/dev/cgsix.c4
-rw-r--r--sys/arch/sparc/dev/dma.c12
-rw-r--r--sys/arch/sparc/dev/esp.c14
-rw-r--r--sys/arch/sparc/dev/fb.c24
-rw-r--r--sys/arch/sparc/dev/fd.c6
-rw-r--r--sys/arch/sparc/dev/if_le.c28
-rw-r--r--sys/arch/sparc/dev/lebuffer.c6
-rw-r--r--sys/arch/sparc/dev/led.c41
-rw-r--r--sys/arch/sparc/dev/sbus.c13
-rw-r--r--sys/arch/sparc/dev/sbusreg.h12
-rw-r--r--sys/arch/sparc/dev/z8530kbd.c4
-rw-r--r--sys/arch/sparc/dev/zs.c18
-rw-r--r--sys/arch/sparc/dev/zs_kgdb.c4
-rw-r--r--sys/arch/sparc/include/param.h180
-rw-r--r--sys/arch/sparc/include/pmap.h8
-rw-r--r--sys/arch/sparc/include/pte.h30
-rw-r--r--sys/arch/sparc/sparc/autoconf.c166
-rw-r--r--sys/arch/sparc/sparc/auxreg.c3
-rw-r--r--sys/arch/sparc/sparc/cache.c10
-rw-r--r--sys/arch/sparc/sparc/cache.h6
-rw-r--r--sys/arch/sparc/sparc/clock.c25
-rw-r--r--sys/arch/sparc/sparc/conf.c4
-rw-r--r--sys/arch/sparc/sparc/cpu.c26
-rw-r--r--sys/arch/sparc/sparc/intr.c9
-rw-r--r--sys/arch/sparc/sparc/intreg.h9
-rw-r--r--sys/arch/sparc/sparc/iommu.c4
-rw-r--r--sys/arch/sparc/sparc/kgdb_machdep.c8
-rw-r--r--sys/arch/sparc/sparc/locore.s131
-rw-r--r--sys/arch/sparc/sparc/pmap.c118
-rw-r--r--sys/arch/sparc/sparc/trap.c6
33 files changed, 557 insertions, 424 deletions
diff --git a/sys/arch/sparc/conf/GENERIC b/sys/arch/sparc/conf/GENERIC
index e6f9a8dc160..4270707afb9 100644
--- a/sys/arch/sparc/conf/GENERIC
+++ b/sys/arch/sparc/conf/GENERIC
@@ -1,4 +1,4 @@
-# $OpenBSD: GENERIC,v 1.97 2010/07/03 03:59:17 krw Exp $
+# $OpenBSD: GENERIC,v 1.98 2010/07/10 19:32:20 miod Exp $
#
# For further information on compiling OpenBSD kernels, see the config(8)
# man page.
@@ -17,6 +17,7 @@ maxusers 20 # estimated number of users
# At least one is required.
option SUN4 # sun4/100, sun4/200, sun4/300
option SUN4C # sun4c - SS1, 1+, 2, ELC, SLC, IPC, IPX, etc.
+option SUN4E # sun4e - SPARCengine 1E
option SUN4M # sun4m - SS10, SS20, Classic, etc.
#option MMU_3L # 3-level MMU on sun4/400
@@ -40,7 +41,7 @@ mainbus0 at root
cpu0 at mainbus0
# Bus types found on SPARC systems.
-sbus0 at mainbus0 # sun4c
+sbus0 at mainbus0 # sun4c and sun4e
obio0 at mainbus0 # sun4 and sun4m
vmes0 at mainbus0 # sun4
vmel0 at mainbus0 # sun4
@@ -55,7 +56,7 @@ audio* at audioamd?
audiocs0 at sbus0 # sun4m
audio* at audiocs?
-auxreg* at mainbus0 # sun4c
+auxreg* at mainbus0 # sun4c and sun4e
auxreg* at obio0 # sun4m
# Power status and control register found on Sun4m systems
@@ -63,7 +64,7 @@ power0 at obio0
# Mostek clock found on 4/300, sun4c, and sun4m systems.
# The Mostek clock NVRAM is the "eeprom" on sun4/300 systems.
-clock0 at mainbus0 # sun4c
+clock0 at mainbus0 # sun4c and sun4e
clock0 at obio0 # sun4m
clock0 at obio0 addr 0xf2000000 # sun4/300
@@ -71,12 +72,12 @@ clock0 at obio0 addr 0xf2000000 # sun4/300
oclock0 at obio0 addr 0xf3000000 # sun4/100 and sun4/200
# Memory error registers.
-memreg0 at mainbus0 # sun4c
+memreg0 at mainbus0 # sun4c and sun4e
memreg0 at obio0 # sun4m
memreg0 at obio0 addr 0xf4000000 # sun4
# Timer chip found on 4/300, sun4c, and sun4m systems.
-timer0 at mainbus0 # sun4c
+timer0 at mainbus0 # sun4c and sun4e
timer0 at obio0 # sun4m
timer0 at obio0 addr 0xef000000 # sun4/300
@@ -86,15 +87,15 @@ timer0 at obio0 addr 0xef000000 # sun4/300
eeprom0 at obio0 addr 0xf2000000 # sun4/100 and sun4/200
# 8 segment led display on sun4/sun4m systems
-led0 at mainbus0 # sun4
+led0 at mainbus0 # sun4 and sun4e
led0 at obio0 # sun4/600
# Zilog 8530 serial chips. Each has two-channels.
# zs0 is ttya and ttyb. zs1 is the keyboard and mouse.
-zs0 at mainbus0 # sun4c
+zs0 at mainbus0 # sun4c and sun4e
zs0 at obio0 # sun4m
zs0 at obio0 addr 0xf1000000 level 12 # sun4
-zs1 at mainbus0 # sun4c
+zs1 at mainbus0 # sun4c and sun4e
zs1 at obio0 # sun4m
zs1 at obio0 addr 0xf0000000 level 12 # sun4
zs2 at obio0 addr 0xe0000000 level 12 # sun4/300
@@ -143,7 +144,7 @@ esp0 at obio0 addr 0xfa000000 level 4 flags 0x00ff000f
# sun4c or sun4m SCSI - an NCR53c94 or equivalent behind
# specialized DMA glue
dma0 at sbus0 # on-board SCSI
-esp0 at sbus0 flags 0x00ff000f # sun4c
+esp0 at sbus0 flags 0x00ff000f # sun4c and sun4e
esp0 at dma0 flags 0x00ff000f # sun4m
# FSBE/S SCSI - an NCR53c94 or equivalent behind
@@ -151,7 +152,7 @@ dma* at sbus? # SBus SCSI
esp* at sbus? flags 0x00ff000f # two flavours
esp* at dma? flags 0x00ff000f # depending on model
-#sun4c, sun4m
+#sun4c, sun4e, sun4m
isp* at sbus?
# sun4m Ethernet - an AMD 7990 LANCE behind
@@ -168,7 +169,7 @@ le0 at lebuffer0 #
le* at lebuffer? #
# sun4/300 and sun4c Ethernet - an AMD 7990 LANCE
-le0 at sbus0 # sun4c on-board
+le0 at sbus0 # sun4c/sun4e on-board
le* at sbus?
le0 at obio0 addr 0xf9000000 level 6 # sun4/300
diff --git a/sys/arch/sparc/conf/RAMDISK b/sys/arch/sparc/conf/RAMDISK
index ee5d214b87c..5a2386c6bd2 100644
--- a/sys/arch/sparc/conf/RAMDISK
+++ b/sys/arch/sparc/conf/RAMDISK
@@ -1,4 +1,4 @@
-# $OpenBSD: RAMDISK,v 1.70 2010/07/03 03:59:17 krw Exp $
+# $OpenBSD: RAMDISK,v 1.71 2010/07/10 19:32:20 miod Exp $
# $NetBSD: GENERIC,v 1.28.2.1 1996/07/02 23:55:22 jtc Exp $
# Machine architecture; required by config(8)
@@ -30,6 +30,7 @@ option CRYPTO # Cryptographic framework
# At least one is required.
option SUN4 # sun4/100, sun4/200, sun4/300
option SUN4C # sun4c - SS1, 1+, 2, ELC, SLC, IPC, IPX, etc.
+option SUN4E # sun4e - SPARCengine 1E
option SUN4M # sun4m - SS10, SS20, Classic, etc.
#option MMU_3L # 3-level MMU on sun4/400
@@ -51,7 +52,7 @@ mainbus0 at root
cpu0 at mainbus0
# Bus types found on SPARC systems.
-sbus0 at mainbus0 # sun4c
+sbus0 at mainbus0 # sun4c and sun4e
obio0 at mainbus0 # sun4 and sun4m
vmes0 at mainbus0 # sun4
vmel0 at mainbus0 # sun4
@@ -63,7 +64,7 @@ sbus0 at iommu0 # sun4m
#audioamd0 at sbus0 # sun4m
#audio* at audioamd?
-auxreg* at mainbus0 # sun4c
+auxreg* at mainbus0 # sun4c and sun4e
auxreg* at obio0 # sun4m
# Power status and control register found on Sun4m systems
@@ -71,7 +72,7 @@ power0 at obio0
# Mostek clock found on 4/300, sun4c, and sun4m systems.
# The Mostek clock NVRAM is the "eeprom" on sun4/300 systems.
-clock0 at mainbus0 # sun4c
+clock0 at mainbus0 # sun4c and sun4e
clock0 at obio0 # sun4m
clock0 at obio0 addr 0xf2000000 # sun4/300
@@ -79,12 +80,12 @@ clock0 at obio0 addr 0xf2000000 # sun4/300
oclock0 at obio0 addr 0xf3000000 # sun4/100 and sun4/200
# Memory error registers.
-memreg0 at mainbus0 # sun4c
+memreg0 at mainbus0 # sun4c and sun4e
memreg0 at obio0 # sun4m
memreg0 at obio0 addr 0xf4000000 # sun4
# Timer chip found on 4/300, sun4c, and sun4m systems.
-timer0 at mainbus0 # sun4c
+timer0 at mainbus0 # sun4c and sun4e
timer0 at obio0 # sun4m
timer0 at obio0 addr 0xef000000 # sun4/300
@@ -95,10 +96,10 @@ eeprom0 at obio0 addr 0xf2000000 # sun4/100 and sun4/200
# Zilog 8530 serial chips. Each has two-channels.
# zs0 is ttya and ttyb. zs1 is the keyboard and mouse.
-zs0 at mainbus0 # sun4c
+zs0 at mainbus0 # sun4c and sun4e
zs0 at obio0 # sun4m
zs0 at obio0 addr 0xf1000000 level 12 # sun4
-zs1 at mainbus0 # sun4c
+zs1 at mainbus0 # sun4c and sun4e
zs1 at obio0 # sun4m
zs1 at obio0 addr 0xf0000000 level 12 # sun4
zs2 at obio0 addr 0xe0000000 level 12 # sun4/300
@@ -130,7 +131,7 @@ esp0 at obio0 addr 0xfa000000 level 4 flags 0x00ff000f
# sun4c or sun4m SCSI - an NCR53c94 or equivalent behind
# specialized DMA glue
dma0 at sbus0 # on-board SCSI
-esp0 at sbus0 flags 0x00ff000f # sun4c
+esp0 at sbus0 flags 0x00ff000f # sun4c and sun4e
esp0 at dma0 flags 0x00ff000f # sun4m
# FSBE/S SCSI - an NCR53c94 or equivalent behind
@@ -151,7 +152,7 @@ le0 at lebuffer0 #
le* at lebuffer? #
# sun4/300 and sun4c Ethernet - an AMD 7990 LANCE
-le0 at sbus0 # sun4c on-board
+le0 at sbus0 # sun4c/sun4e on-board
le* at sbus?
le0 at obio0 addr 0xf9000000 level 6 # sun4/300
diff --git a/sys/arch/sparc/dev/bwtwo.c b/sys/arch/sparc/dev/bwtwo.c
index 918eec695ff..a479974d9bf 100644
--- a/sys/arch/sparc/dev/bwtwo.c
+++ b/sys/arch/sparc/dev/bwtwo.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bwtwo.c,v 1.37 2010/06/07 19:43:45 miod Exp $ */
+/* $OpenBSD: bwtwo.c,v 1.38 2010/07/10 19:32:24 miod Exp $ */
/* $NetBSD: bwtwo.c,v 1.33 1997/05/24 20:16:02 pk Exp $ */
/*
@@ -240,7 +240,7 @@ bwtwoattach(struct device *parent, struct device *self, void *args)
case BUS_SBUS:
obp_name:
-#if defined(SUN4C) || defined(SUN4M)
+#if defined(SUN4C) || defined(SUN4D) || defined(SUN4E) || defined(SUN4M)
nam = getpropstring(node, "model");
#endif
break;
@@ -272,7 +272,7 @@ obp_name:
}
#endif
- if (CPU_ISSUN4COR4M)
+ if (!CPU_ISSUN4)
isconsole = node == fbnode;
sc->sc_phys = ca->ca_ra.ra_reg[0];
diff --git a/sys/arch/sparc/dev/cgsix.c b/sys/arch/sparc/dev/cgsix.c
index c38b4605ba5..847787ab987 100644
--- a/sys/arch/sparc/dev/cgsix.c
+++ b/sys/arch/sparc/dev/cgsix.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cgsix.c,v 1.42 2010/06/07 19:43:45 miod Exp $ */
+/* $OpenBSD: cgsix.c,v 1.43 2010/07/10 19:32:24 miod Exp $ */
/* $NetBSD: cgsix.c,v 1.33 1997/08/07 19:12:30 pk Exp $ */
/*
@@ -253,7 +253,7 @@ cgsixattach(struct device *parent, struct device *self, void *args)
}
#endif
- if (CPU_ISSUN4COR4M)
+ if (!CPU_ISSUN4)
isconsole = node == fbnode;
fhcrev = (*sc->sc_fhc >> FHC_REV_SHIFT) &
diff --git a/sys/arch/sparc/dev/dma.c b/sys/arch/sparc/dev/dma.c
index 191ec5f51c9..8d1fc60875f 100644
--- a/sys/arch/sparc/dev/dma.c
+++ b/sys/arch/sparc/dev/dma.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dma.c,v 1.27 2010/06/27 05:52:01 beck Exp $ */
+/* $OpenBSD: dma.c,v 1.28 2010/07/10 19:32:24 miod Exp $ */
/* $NetBSD: dma.c,v 1.46 1997/08/27 11:24:16 bouyer Exp $ */
/*
@@ -111,7 +111,7 @@ dmamatch(parent, vcf, aux)
if (strcmp(cf->cf_driver->cd_name, ra->ra_name) &&
strcmp("espdma", ra->ra_name))
return (0);
-#if defined(SUN4C) || defined(SUN4M)
+#if defined(SUN4C) || defined(SUN4D) || defined(SUN4E) || defined(SUN4M)
if (ca->ca_bustype == BUS_SBUS) {
if (!sbus_testdma((struct sbus_softc *)parent, ca))
return (0);
@@ -133,7 +133,7 @@ dmaattach(parent, self, aux)
struct confargs *ca = aux;
struct dma_softc *sc = (void *)self;
int devnode;
-#if defined(SUN4C) || defined(SUN4M)
+#if defined(SUN4C) || defined(SUN4D) || defined(SUN4E) || defined(SUN4M)
int node;
struct confargs oca;
char *name;
@@ -217,7 +217,7 @@ dmaattach(parent, self, aux)
if (CPU_ISSUN4)
goto espsearch;
-#if defined(SUN4C) || defined(SUN4M)
+#if defined(SUN4C) || defined(SUN4D) || defined(SUN4E) || defined(SUN4M)
/* Propagate bootpath */
if (ca->ca_ra.ra_bp != NULL &&
(strcmp(ca->ca_ra.ra_bp->name, "espdma") == 0 ||
@@ -238,7 +238,7 @@ dmaattach(parent, self, aux)
oca.ca_bustype = BUS_SBUS;
(void) config_found(&sc->sc_dev, (void *)&oca, dmaprint);
} while ((node = nextsibling(node)) != 0); else
-#endif /* SUN4C || SUN4M */
+#endif /* SUN4C || SUN4D || SUN4E || SUN4M */
if (strcmp(ca->ca_ra.ra_name, "dma") == 0) {
espsearch:
@@ -413,7 +413,7 @@ ledmamatch(parent, vcf, aux)
if (strcmp(cf->cf_driver->cd_name, ra->ra_name))
return (0);
-#if defined(SUN4C) || defined(SUN4M)
+#if defined(SUN4C) || defined(SUN4D) || defined(SUN4E) || defined(SUN4M)
if (!sbus_testdma((struct sbus_softc *)parent, ca))
return(0);
#endif
diff --git a/sys/arch/sparc/dev/esp.c b/sys/arch/sparc/dev/esp.c
index 85120c54f8e..d7f6960f19e 100644
--- a/sys/arch/sparc/dev/esp.c
+++ b/sys/arch/sparc/dev/esp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: esp.c,v 1.32 2010/06/28 18:31:01 krw Exp $ */
+/* $OpenBSD: esp.c,v 1.33 2010/07/10 19:32:24 miod Exp $ */
/* $NetBSD: esp.c,v 1.69 1997/08/27 11:24:18 bouyer Exp $ */
/*
@@ -169,7 +169,7 @@ struct ncr53c9x_glue esp_glue = {
NULL, /* gl_clear_latched_intr */
};
-#if defined(SUN4C) || defined(SUN4M)
+#if defined(SUN4C) || defined(SUN4D) || defined(SUN4E) || defined(SUN4M)
struct ncr53c9x_glue esp_glue1 = {
esp_rdreg1,
esp_wrreg1,
@@ -193,7 +193,7 @@ espmatch(parent, vcf, aux)
register struct confargs *ca = aux;
register struct romaux *ra = &ca->ca_ra;
-#if defined(SUN4C) || defined(SUN4M)
+#if defined(SUN4C) || defined(SUN4D) || defined(SUN4E) || defined(SUN4M)
if (ca->ca_bustype == BUS_SBUS) {
if (strcmp("SUNW,fas", ra->ra_name) == 0 ||
strcmp("ptscII", ra->ra_name) == 0)
@@ -203,7 +203,7 @@ espmatch(parent, vcf, aux)
if (strcmp(cf->cf_driver->cd_name, ra->ra_name))
return (0);
-#if defined(SUN4C) || defined(SUN4M)
+#if defined(SUN4C) || defined(SUN4D) || defined(SUN4E) || defined(SUN4M)
if (ca->ca_bustype == BUS_SBUS) {
if (!sbus_testdma((struct sbus_softc *)parent, ca))
return (0);
@@ -261,7 +261,7 @@ espattach(parent, self, aux)
/* gimme MHz */
sc->sc_freq /= 1000000;
-#if defined(SUN4C) || defined(SUN4M)
+#if defined(SUN4C) || defined(SUN4D) || defined(SUN4E) || defined(SUN4M)
if (ca->ca_bustype == BUS_SBUS &&
strcmp("SUNW,fas", ca->ca_ra.ra_name) == 0) {
struct dma_softc *dsc;
@@ -387,7 +387,7 @@ espattach(parent, self, aux)
/*
* Set up glue for MI code.
*/
-#if defined(SUN4C) || defined(SUN4M)
+#if defined(SUN4C) || defined(SUN4D) || defined(SUN4E) || defined(SUN4M)
if (ca->ca_bustype == BUS_SBUS &&
strcmp("ptscII", ca->ca_ra.ra_name) == 0) {
sc->sc_glue = &esp_glue1;
@@ -539,7 +539,7 @@ esp_write_reg(sc, reg, val)
esc->sc_reg[reg * 4] = v;
}
-#if defined(SUN4C) || defined(SUN4M)
+#if defined(SUN4C) || defined(SUN4D) || defined(SUN4E) || defined(SUN4M)
u_char
esp_rdreg1(sc, reg)
struct ncr53c9x_softc *sc;
diff --git a/sys/arch/sparc/dev/fb.c b/sys/arch/sparc/dev/fb.c
index db0fdc52d7d..bf299342ec1 100644
--- a/sys/arch/sparc/dev/fb.c
+++ b/sys/arch/sparc/dev/fb.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: fb.c,v 1.51 2010/06/07 19:43:45 miod Exp $ */
+/* $OpenBSD: fb.c,v 1.52 2010/07/10 19:32:24 miod Exp $ */
/* $NetBSD: fb.c,v 1.23 1997/07/07 23:30:22 pk Exp $ */
/*
@@ -82,7 +82,7 @@
#include <machine/eeprom.h>
#include <sparc/dev/pfourreg.h>
#endif
-#if defined(SUN4C) || defined(SUN4M)
+#if defined(SUN4C) || defined(SUN4D) || defined(SUN4E) || defined(SUN4M)
#include <machine/bsd_openprom.h>
#endif
@@ -118,7 +118,7 @@ fb_unblank()
#if NWSDISPLAY > 0
-#if defined(SUN4C) || defined(SUN4M)
+#if defined(SUN4C) || defined(SUN4D) || defined(SUN4E) || defined(SUN4M)
static int a2int(char *, int);
#endif
int fb_get_console_metrics(int *, int *, int *, int *);
@@ -272,7 +272,7 @@ obpsize:
sf->sf_fbsize = sf->sf_height * sf->sf_linebytes;
}
-#if defined(SUN4C) || defined(SUN4M)
+#if defined(SUN4C) || defined(SUN4D) || defined(SUN4E) || defined(SUN4M)
static int
a2int(char *cp, int deflt)
{
@@ -313,7 +313,7 @@ fbwscons_init(struct sunfb *sf, int isconsole)
{
struct rasops_info *ri = &sf->sf_ro;
int cols, rows;
-#if defined(SUN4C) || defined(SUN4M)
+#if defined(SUN4C) || defined(SUN4D) || defined(SUN4E) || defined(SUN4M)
int fw, fh, wt, wl;
#endif
@@ -326,8 +326,8 @@ fbwscons_init(struct sunfb *sf, int isconsole)
ri->ri_width = sf->sf_width;
ri->ri_height = sf->sf_height;
-#if defined(SUN4C) || defined(SUN4M)
- if (CPU_ISSUN4COR4M) {
+#if defined(SUN4C) || defined(SUN4D) || defined(SUN4E) || defined(SUN4M)
+ if (!CPU_ISSUN4) {
rows = a2int(getpropstring(optionsnode, "screen-#rows"), 34);
cols = a2int(getpropstring(optionsnode, "screen-#columns"), 80);
}
@@ -369,8 +369,8 @@ fbwscons_init(struct sunfb *sf, int isconsole)
* this chunk.
*/
-#if defined(SUN4C) || defined(SUN4M)
- if (CPU_ISSUN4COR4M && isconsole) {
+#if defined(SUN4C) || defined(SUN4D) || defined(SUN4E) || defined(SUN4M)
+ if (!CPU_ISSUN4 && isconsole) {
if (fb_get_console_metrics(&fw, &fh, &wt, &wl) != 0) {
/*
* Assume a 12x22 prom font and a centered
@@ -422,7 +422,7 @@ fbwscons_init(struct sunfb *sf, int isconsole)
rasops_init(ri, rows, cols);
-#if defined(SUN4C) || defined(SUN4M)
+#if defined(SUN4C) || defined(SUN4D) || defined(SUN4E) || defined(SUN4M)
/*
* If this is the console display and there is no font change,
* adjust our terminal window to the position of the PROM
@@ -670,7 +670,7 @@ fb_pfour_burner(void *v, u_int enable, u_int flags)
#endif /* SUN4 */
-#if defined(SUN4C) || defined(SUN4M)
+#if defined(SUN4C) || defined(SUN4D) || defined(SUN4E) || defined(SUN4M)
int
fb_get_console_metrics(int *fontwidth, int *fontheight, int *wtop, int *wleft)
{
@@ -732,6 +732,6 @@ fb_get_console_metrics(int *fontwidth, int *fontheight, int *wtop, int *wleft)
return (0);
}
-#endif /* SUN4C || SUN4M */
+#endif /* SUN4C || SUN4D || SUN4E || SUN4M */
#endif /* NWSDISPLAY */
diff --git a/sys/arch/sparc/dev/fd.c b/sys/arch/sparc/dev/fd.c
index c90be332be7..ed0e33b6252 100644
--- a/sys/arch/sparc/dev/fd.c
+++ b/sys/arch/sparc/dev/fd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: fd.c,v 1.71 2010/07/02 19:57:15 tedu Exp $ */
+/* $OpenBSD: fd.c,v 1.72 2010/07/10 19:32:24 miod Exp $ */
/* $NetBSD: fd.c,v 1.51 1997/05/24 20:16:19 pk Exp $ */
/*-
@@ -281,9 +281,9 @@ fdcmatch(parent, match, aux)
register struct romaux *ra = &ca->ca_ra;
/*
- * Floppy doesn't exist on sun4.
+ * Floppy doesn't exist on sun4 and sun4e.
*/
- if (CPU_ISSUN4)
+ if (CPU_ISSUN4OR4E)
return (0);
/*
diff --git a/sys/arch/sparc/dev/if_le.c b/sys/arch/sparc/dev/if_le.c
index 7bf1432d45b..0a8b22f562f 100644
--- a/sys/arch/sparc/dev/if_le.c
+++ b/sys/arch/sparc/dev/if_le.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_le.c,v 1.30 2009/10/26 20:17:27 deraadt Exp $ */
+/* $OpenBSD: if_le.c,v 1.31 2010/07/10 19:32:24 miod Exp $ */
/* $NetBSD: if_le.c,v 1.50 1997/09/09 20:54:48 pk Exp $ */
/*-
@@ -407,7 +407,7 @@ lematch(parent, vcf, aux)
return (ca->ca_bustype == BUS_OBIO);
}
#endif
-#if defined(SUN4C) || defined(SUN4M)
+#if defined(SUN4C) || defined(SUN4D) || defined(SUN4E) || defined(SUN4M)
if (ca->ca_bustype == BUS_SBUS) {
if (!sbus_testdma((struct sbus_softc *)parent, ca))
return (0);
@@ -428,7 +428,7 @@ leattach(parent, self, aux)
struct confargs *ca = aux;
int pri;
struct bootpath *bp;
-#if defined(SUN4C) || defined(SUN4M)
+#if defined(SUN4C) || defined(SUN4D) || defined(SUN4E) || defined(SUN4M)
int sbuschild = strcmp(parent->dv_cfdata->cf_driver->cd_name, "sbus") == 0;
int lebufchild = strcmp(parent->dv_cfdata->cf_driver->cd_name, "lebuffer") == 0;
int dmachild = strcmp(parent->dv_cfdata->cf_driver->cd_name, "ledma") == 0;
@@ -446,14 +446,14 @@ leattach(parent, self, aux)
printf(" pri %d", pri);
sc->sc_hasifmedia = 1;
-#if defined(SUN4C) || defined(SUN4M)
+#if defined(SUN4C) || defined(SUN4D) || defined(SUN4E) || defined(SUN4M)
lesc->sc_lebufchild = lebufchild;
#endif
lesc->sc_r1 = (struct lereg1 *)
mapiodev(ca->ca_ra.ra_reg, 0, sizeof(struct lereg1));
-#if defined(SUN4C) || defined(SUN4M)
+#if defined(SUN4C) || defined(SUN4D) || defined(SUN4E) || defined(SUN4M)
lebuf = NULL;
if (lebufchild) {
lebuf = (struct lebuf_softc *)parent;
@@ -506,17 +506,17 @@ leattach(parent, self, aux)
laddr & 0xfffe0000);
} /* else */
#endif /* solbourne */
-#if defined(SUN4) || defined(SUN4C) || defined(SUN4M)
-#if defined(SUN4C) || defined(SUN4M)
- if (sbuschild && CPU_ISSUN4M)
+#if defined(SUN4) || defined(SUN4C) || defined(SUN4D) || defined(SUN4E) || defined(SUN4M)
+#if defined(SUN4C) || defined(SUN4D) || defined(SUN4E) || defined(SUN4M)
+ if (sbuschild && CPU_ISSUN4DOR4M)
laddr = (u_long)dvma_malloc_space(MEMSIZE,
&sc->sc_mem, M_NOWAIT, M_SPACE_D24);
else
#endif
laddr = (u_long)dvma_malloc(MEMSIZE,
&sc->sc_mem, M_NOWAIT);
-#endif /* SUN4 || SUN4C || SUN4M */
-#if defined (SUN4M)
+#endif /* SUN4 || SUN4C || SUN4D || SUN4E || SUN4M */
+#if defined(SUN4D) || defined (SUN4M)
if ((laddr & 0xffffff) >= (laddr & 0xffffff) + MEMSIZE)
panic("if_le: Lance buffer crosses 16MB boundary");
#endif
@@ -533,7 +533,7 @@ leattach(parent, self, aux)
else
#endif
sc->sc_conf3 = LE_C3_BSWP | LE_C3_ACON | LE_C3_BCON;
-#if defined(SUN4C) || defined(SUN4M)
+#if defined(SUN4C) || defined(SUN4D) || defined(SUN4E) || defined(SUN4M)
if (dmachild) {
lesc->sc_dma = (struct dma_softc *)parent;
lesc->sc_dma->sc_le = lesc;
@@ -544,7 +544,7 @@ leattach(parent, self, aux)
bp = ca->ca_ra.ra_bp;
switch (ca->ca_bustype) {
-#if defined(SUN4C) || defined(SUN4M)
+#if defined(SUN4C) || defined(SUN4D) || defined(SUN4E) || defined(SUN4M)
#define SAME_LANCE(bp, ca) \
((bp->val[0] == ca->ca_slot && bp->val[1] == ca->ca_offset) || \
(bp->val[0] == -1 && bp->val[1] == sc->sc_dev.dv_unit))
@@ -554,7 +554,7 @@ leattach(parent, self, aux)
SAME_LANCE(bp, ca))
bp->dev = &sc->sc_dev;
break;
-#endif /* SUN4C || SUN4M */
+#endif /* SUN4C || SUN4D || SUN4E || SUN4M */
default:
if (bp != NULL && strcmp(bp->name, le_cd.cd_name) == 0 &&
@@ -581,7 +581,7 @@ leattach(parent, self, aux)
sc->sc_hwreset = lehwreset;
ifmedia_init(&sc->sc_ifmedia, 0, lemediachange, lemediastatus);
-#if defined(SUN4C) || defined(SUN4M)
+#if defined(SUN4C) || defined(SUN4D) || defined(SUN4E) || defined(SUN4M)
if (lebufchild) {
ifmedia_add(&sc->sc_ifmedia, IFM_ETHER | IFM_10_T, 0, NULL);
ifmedia_set(&sc->sc_ifmedia, IFM_ETHER | IFM_10_T);
diff --git a/sys/arch/sparc/dev/lebuffer.c b/sys/arch/sparc/dev/lebuffer.c
index bed9669017a..65c16196158 100644
--- a/sys/arch/sparc/dev/lebuffer.c
+++ b/sys/arch/sparc/dev/lebuffer.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: lebuffer.c,v 1.8 2010/06/26 23:24:44 guenther Exp $ */
+/* $OpenBSD: lebuffer.c,v 1.9 2010/07/10 19:32:24 miod Exp $ */
/* $NetBSD: lebuffer.c,v 1.3 1997/05/24 20:16:28 pk Exp $ */
/*
@@ -102,7 +102,7 @@ lebufattach(parent, self, aux)
struct device *parent, *self;
void *aux;
{
-#if defined(SUN4C) || defined(SUN4M)
+#if defined(SUN4C) || defined(SUN4D) || defined(SUN4E) || defined(SUN4M)
register struct confargs *ca = aux;
struct lebuf_softc *sc = (void *)self;
int node;
@@ -157,5 +157,5 @@ lebufattach(parent, self, aux)
oca.ca_bustype = BUS_SBUS;
(void) config_found(&sc->sc_dev, (void *)&oca, lebufprint);
}
-#endif /* SUN4C || SUN4M */
+#endif /* SUN4C || SUN4D || SUN4E || SUN4M */
}
diff --git a/sys/arch/sparc/dev/led.c b/sys/arch/sparc/dev/led.c
index 209d5e587c2..e8fdc26f66c 100644
--- a/sys/arch/sparc/dev/led.c
+++ b/sys/arch/sparc/dev/led.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: led.c,v 1.12 2006/08/01 18:09:40 deraadt Exp $ */
+/* $OpenBSD: led.c,v 1.13 2010/07/10 19:32:24 miod Exp $ */
/*
* Copyright (c) 1998 Jason L. Wright (jason@thought.net)
@@ -27,7 +27,7 @@
*/
/*
- * Driver for leds on the 4/100, 4/200, 4/300, and 4/600. (sun4 & sun4m)
+ * Driver for leds on the sun4, sun4e, and 4/600 (sun4m) systems.
*/
#include <sys/param.h>
@@ -42,8 +42,10 @@
#include <machine/autoconf.h>
#include <machine/ctlreg.h>
+#include <machine/vmparam.h>
#include <sparc/sparc/asm.h>
#include <sparc/cpu.h>
+#include <sparc/sparc/auxioreg.h>
#include <sparc/sparc/cpuvar.h>
#include <sparc/dev/led.h>
@@ -72,10 +74,10 @@ ledmatch(parent, vcf, aux)
struct device *parent;
void *vcf, *aux;
{
-#if defined(SUN4)
+#if defined(SUN4) || defined(SUN4E)
struct cfdata *cf = vcf;
#endif
-#if defined(SUN4) || defined(SUN4M)
+#if defined(SUN4) || defined(SUN4E) || defined(SUN4M)
struct confargs *ca = aux;
register struct romaux *ra = &ca->ca_ra;
@@ -87,16 +89,16 @@ ledmatch(parent, vcf, aux)
}
#endif /* SUN4M */
-#if defined(SUN4)
+#if defined(SUN4) || defined(SUN4E)
if (ca->ca_bustype == BUS_MAIN) {
if (strcmp(cf->cf_driver->cd_name, ra->ra_name))
return (0);
- if (CPU_ISSUN4)
+ if (CPU_ISSUN4OR4E)
return (1);
return (0);
}
-#endif /* SUN4 */
-#endif /* SUN4 || SUN4M */
+#endif /* SUN4 || SUN4E*/
+#endif /* SUN4 || SUN4E || SUN4M */
return (0);
}
@@ -139,21 +141,26 @@ led_cycle(v)
if (sparc_led_blink == 0)
sc->sc_index = 0;
+ s = splhigh();
+ switch (cputyp) {
+ default:
#if defined(SUN4M)
- if (CPU_ISSUN4M) {
- s = splhigh();
+ case CPU_SUN4M:
(*sc->sc_reg) = led_pattern[sc->sc_index] | 0xff00;
- splx(s);
- }
+ break;
+#endif
+#if defined(SUN4E)
+ case CPU_SUN4E:
+ *(volatile u_char *)(AUXREG_VA) = led_pattern[sc->sc_index];
+ break;
#endif
-
#if defined(SUN4)
- if (CPU_ISSUN4) {
- s = splhigh();
+ case CPU_SUN4:
stba(AC_DIAG_REG, ASI_CONTROL, led_pattern[sc->sc_index]);
- splx(s);
- }
+ break;
#endif
+ }
+ splx(s);
if (sparc_led_blink != 0) {
s = (((averunnable.ldavg[0] + FSCALE) * hz) >> (FSHIFT + 3));
diff --git a/sys/arch/sparc/dev/sbus.c b/sys/arch/sparc/dev/sbus.c
index 0357403db49..d177c8f45b7 100644
--- a/sys/arch/sparc/dev/sbus.c
+++ b/sys/arch/sparc/dev/sbus.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sbus.c,v 1.16 2007/05/29 09:54:13 sobrado Exp $ */
+/* $OpenBSD: sbus.c,v 1.17 2010/07/10 19:32:24 miod Exp $ */
/* $NetBSD: sbus.c,v 1.17 1997/06/01 22:10:39 pk Exp $ */
/*
@@ -159,7 +159,10 @@ sbus_attach(parent, self, aux)
* IS THIS THE CORRECT DEFAULT??
*/
node = ra->ra_node;
- sc->sc_clockfreq = getpropint(node, "clock-frequency", 25*1000*1000);
+ sc->sc_clockfreq = getpropint(node, "clock-frequency", -1);
+ if (sc->sc_clockfreq <= 0)
+ sc->sc_clockfreq = getpropint(findroot(), "clock-frequency",
+ 25 * 1000 * 1000);
printf(": clock = %s MHz\n", clockfreq(sc->sc_clockfreq));
/*
@@ -199,6 +202,10 @@ sbus_attach(parent, self, aux)
*/
for (node = firstchild(node); node; node = nextsibling(node)) {
name = getpropstring(node, "name");
+#ifdef SUN4E
+ if (CPU_ISSUN4E && strcmp(name, "vm") == 0)
+ continue;
+#endif
if (!romprop(&oca.ca_ra, name, node))
continue;
@@ -224,7 +231,7 @@ sbus_translate(dev, ca)
ca->ca_slot = SBUS_ABS_TO_SLOT(base);
ca->ca_offset = SBUS_ABS_TO_OFFSET(base);
} else {
- if (!CPU_ISSUN4C)
+ if (!CPU_ISSUN4C && !CPU_ISSUN4E)
panic("relative sbus addressing not supported");
ca->ca_slot = slot = ca->ca_ra.ra_iospace;
ca->ca_offset = base;
diff --git a/sys/arch/sparc/dev/sbusreg.h b/sys/arch/sparc/dev/sbusreg.h
index f6449311a5e..96d858d06d5 100644
--- a/sys/arch/sparc/dev/sbusreg.h
+++ b/sys/arch/sparc/dev/sbusreg.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: sbusreg.h,v 1.5 2007/05/29 09:54:15 sobrado Exp $ */
+/* $OpenBSD: sbusreg.h,v 1.6 2010/07/10 19:32:24 miod Exp $ */
/* $NetBSD: sbusreg.h,v 1.3 1997/09/14 19:17:25 pk Exp $ */
/*
@@ -51,11 +51,13 @@
* in `absolute' and `relative' address flavors, so we have to handle both.
* Relative addresses do *not* include the slot number.
*/
-#define SBUS_BASE 0xf8000000
-#define SBUS_ADDR(slot, off) (SBUS_BASE + ((slot) << 25) + (off))
+#define SBUS_PAGE_SHIFT (13 + PAGE_SHIFT)
+#define SBUS_BASE (0 - (4 << SBUS_PAGE_SHIFT))
+#define SBUS_PAGE_MASK ((1 << SBUS_PAGE_SHIFT) - 1)
+#define SBUS_ADDR(slot, off) (SBUS_BASE + ((slot) << SBUS_PAGE_SHIFT) + (off))
#define SBUS_ABS(a) ((unsigned)(a) >= SBUS_BASE)
-#define SBUS_ABS_TO_SLOT(a) (((a) - SBUS_BASE) >> 25)
-#define SBUS_ABS_TO_OFFSET(a) (((a) - SBUS_BASE) & 0x1ffffff)
+#define SBUS_ABS_TO_SLOT(a) (((a) - SBUS_BASE) >> SBUS_PAGE_SHIFT)
+#define SBUS_ABS_TO_OFFSET(a) (((a) - SBUS_BASE) & SBUS_PAGE_MASK)
struct sbusreg {
u_int32_t sbus_afsr; /* M-to-S Asynchronous Fault Status */
diff --git a/sys/arch/sparc/dev/z8530kbd.c b/sys/arch/sparc/dev/z8530kbd.c
index cad933dd4f1..08dd87c5405 100644
--- a/sys/arch/sparc/dev/z8530kbd.c
+++ b/sys/arch/sparc/dev/z8530kbd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: z8530kbd.c,v 1.13 2009/01/12 21:11:56 miod Exp $ */
+/* $OpenBSD: z8530kbd.c,v 1.14 2010/07/10 19:32:24 miod Exp $ */
/* $NetBSD: z8530tty.c,v 1.77 2001/05/30 15:24:24 lukem Exp $ */
/*-
@@ -387,7 +387,7 @@ zskbd_attach(parent, self, aux)
}
ss->sc_click = 0;
-#if defined(SUN4C) || defined(SUN4M)
+#if defined(SUN4C) || defined(SUN4D) || defined(SUN4E) || defined(SUN4M)
if (!CPU_ISSUN4) {
char *cp = getpropstring(optionsnode, "keyboard-click?");
diff --git a/sys/arch/sparc/dev/zs.c b/sys/arch/sparc/dev/zs.c
index d3751bc31a3..10b9452daa8 100644
--- a/sys/arch/sparc/dev/zs.c
+++ b/sys/arch/sparc/dev/zs.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: zs.c,v 1.47 2009/04/10 20:53:51 miod Exp $ */
+/* $OpenBSD: zs.c,v 1.48 2010/07/10 19:32:24 miod Exp $ */
/* $NetBSD: zs.c,v 1.50 1997/10/18 00:00:40 gwr Exp $ */
/*-
@@ -96,11 +96,11 @@ int zs_major = 12;
*/
#define PCLK (9600 * 512) /* PCLK pin input clock rate */
-#define ZS_DELAY() (CPU_ISSUN4C ? (0) : delay(2))
+#define ZS_DELAY() ((CPU_ISSUN4C || CPU_ISSUN4E) ? (0) : delay(2))
/* The layout of this is hardware-dependent (padding, order). */
struct zschan {
-#if defined(SUN4) || defined(SUN4C) || defined(SUN4M)
+#if defined(SUN4) || defined(SUN4C) || defined(SUN4D) || defined(SUN4E) || defined(SUN4M)
volatile u_char zc_csr; /* ctrl,status, and indirect access */
u_char zc_xxx0;
volatile u_char zc_data; /* data */
@@ -226,7 +226,7 @@ zs_match(parent, vcf, aux)
return (ca->ca_bustype == BUS_OBIO);
#endif
- if ((ca->ca_bustype == BUS_MAIN && !CPU_ISSUN4) ||
+ if ((ca->ca_bustype == BUS_MAIN && (CPU_ISSUN4C || CPU_ISSUN4E)) ||
(ca->ca_bustype == BUS_OBIO && CPU_ISSUN4M))
return (getpropint(ra->ra_node, "slave", -2) == cf->cf_unit);
ra->ra_len = NBPG;
@@ -828,7 +828,7 @@ zscnpollc(dev, on)
/*****************************************************************/
-#if defined(SUN4) || defined(SUN4C) || defined(SUN4M)
+#if defined(SUN4) || defined(SUN4C) || defined(SUN4D) || defined(SUN4E) || defined(SUN4M)
cons_decl(prom);
@@ -934,7 +934,7 @@ promcnputc(dev, c)
splx(s);
}
-#endif /* SUN4 || SUN4C || SUN4M */
+#endif /* SUN4 || SUN4C || SUN4D || SUN4E || SUN4M */
/*****************************************************************/
@@ -960,7 +960,7 @@ consinit()
int channel, zs_unit;
int inSource, outSink;
-#if defined(SUN4) || defined(SUN4C) || defined(SUN4M)
+#if defined(SUN4) || defined(SUN4C) || defined(SUN4D) || defined(SUN4E) || defined(SUN4M)
if (promvec->pv_romvec_vers > 2) {
/* We need to probe the PROM device tree */
int node,fd;
@@ -1068,7 +1068,7 @@ setup_output:
inSource = *promvec->pv_stdin;
outSink = *promvec->pv_stdout;
}
-#endif /* SUN4 || SUN4C || SUN4M */
+#endif /* SUN4 || SUN4C || SUN4D || SUN4E || SUN4M */
#ifdef solbourne
if (CPU_ISKAP) {
const char *dev;
@@ -1093,7 +1093,7 @@ setup_output:
}
#endif
-#if defined(SUN4) || defined(SUN4C) || defined(SUN4M)
+#if defined(SUN4) || defined(SUN4C) || defined(SUN4D) || defined(SUN4E) || defined(SUN4M)
setup_console:
#endif
diff --git a/sys/arch/sparc/dev/zs_kgdb.c b/sys/arch/sparc/dev/zs_kgdb.c
index 2d14aafc542..6dc0e40183c 100644
--- a/sys/arch/sparc/dev/zs_kgdb.c
+++ b/sys/arch/sparc/dev/zs_kgdb.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: zs_kgdb.c,v 1.3 2008/06/26 05:42:13 ray Exp $ */
+/* $OpenBSD: zs_kgdb.c,v 1.4 2010/07/10 19:32:24 miod Exp $ */
/* $NetBSD: zs_kgdb.c,v 1.1 1997/10/18 00:00:51 gwr Exp $ */
/*-
@@ -59,7 +59,7 @@
#define PCLK (9600 * 512) /* PCLK pin input clock rate */
#define ZSHARD_PRI 6 /* Wired on the CPU board... */
-#define ZS_DELAY() (CPU_ISSUN4C ? (0) : delay(2))
+#define ZS_DELAY() ((CPU_ISSUN4C || CPU_ISSUN4E) ? (0) : delay(2))
/* The layout of this is hardware-dependent (padding, order). */
struct zschan {
diff --git a/sys/arch/sparc/include/param.h b/sys/arch/sparc/include/param.h
index 71cc97bf954..dd5e29b0b39 100644
--- a/sys/arch/sparc/include/param.h
+++ b/sys/arch/sparc/include/param.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: param.h,v 1.41 2010/06/29 21:26:09 miod Exp $ */
+/* $OpenBSD: param.h,v 1.42 2010/07/10 19:32:24 miod Exp $ */
/* $NetBSD: param.h,v 1.29 1997/03/10 22:50:37 pk Exp $ */
/*
@@ -136,115 +136,125 @@ extern int mmumod;
#endif /* _KERNEL */
/*
- * Values for the cputyp variable.
+ * Values for the cputyp variable. Order is important!
*/
#define CPU_SUN4 0
-#define CPU_SUN4C 1
-#define CPU_SUN4M 2
+#define CPU_SUN4E 1
+#define CPU_SUN4C 2
+#define CPU_SUN4M 3
+#define CPU_SUN4D 4
/*
* Shorthand CPU-type macros. Enumerate all eight cases.
* Let compiler optimize away code conditional on constants.
*
- * On a sun4 machine, the page size is 8192, while on a sun4c and sun4m
- * it is 4096. Therefore, in the (SUN4 && (SUN4C || SUN4M)) cases below,
- * NBPG, PGOFSET and PGSHIFT are defined as variables which are initialized
- * early in locore.s after the machine type has been detected.
+ * On sun4 and sun4e machines, the page size is 8192, while on sun4c, sun4d
+ * and sun4m machines, it is 4096. Therefore, in the common case below, the
+ * various pagesize-related defines are defined as variables which are
+ * initialized early in locore.s after the machine type has been detected.
*
* Note that whenever the macros defined below evaluate to expressions
* involving variables, the kernel will perform slightly worse due to the
* extra memory references they'll generate.
*/
-#if defined(SUN4M) && defined(SUN4C) && defined(SUN4)
-# define CPU_ISSUN4M (cputyp == CPU_SUN4M)
-# define CPU_ISSUN4C (cputyp == CPU_SUN4C)
-# define CPU_ISSUN4 (cputyp == CPU_SUN4)
-# define CPU_ISSUN4OR4C (cputyp == CPU_SUN4 || cputyp == CPU_SUN4C)
-# define CPU_ISSUN4COR4M (cputyp == CPU_SUN4C || cputyp == CPU_SUN4M)
-#elif defined(SUN4M) && defined(SUN4C) && !defined(SUN4)
-# define CPU_ISSUN4M (cputyp == CPU_SUN4M)
-# define CPU_ISSUN4C (cputyp == CPU_SUN4C)
-# define CPU_ISSUN4 (0)
-# define CPU_ISSUN4OR4C (cputyp == CPU_SUN4C)
-# define CPU_ISSUN4COR4M (cputyp == CPU_SUN4C || cputyp == CPU_SUN4M)
-# define NBPG 4096
-# define PGOFSET (NBPG-1)
-# define PGSHIFT SUN4CM_PGSHIFT
-# define PAGE_SIZE 4096
-# define PAGE_MASK (PAGE_SIZE - 1)
-# define PAGE_SHIFT SUN4CM_PGSHIFT
-#elif defined(SUN4M) && !defined(SUN4C) && defined(SUN4)
-# define CPU_ISSUN4M (cputyp == CPU_SUN4M)
-# define CPU_ISSUN4C (0)
-# define CPU_ISSUN4 (cputyp == CPU_SUN4)
-# define CPU_ISSUN4OR4C (cputyp == CPU_SUN4)
-# define CPU_ISSUN4COR4M (cputyp == CPU_SUN4M)
-#elif defined(SUN4M) && !defined(SUN4C) && !defined(SUN4)
-# define CPU_ISSUN4M (1)
-# define CPU_ISSUN4C (0)
-# define CPU_ISSUN4 (0)
-# define CPU_ISSUN4OR4C (0)
-# define CPU_ISSUN4COR4M (1)
-# define NBPG 4096
-# define PGOFSET (NBPG-1)
-# define PGSHIFT SUN4CM_PGSHIFT
-# define PAGE_SIZE 4096
+#if (defined(SUN4) || defined(SUN4E)) && !(defined(SUN4C) || defined(SUN4D) || defined(SUN4M))
+# define PAGE_SIZE 8192
# define PAGE_MASK (PAGE_SIZE - 1)
-# define PAGE_SHIFT SUN4CM_PGSHIFT
-#elif !defined(SUN4M) && defined(SUN4C) && defined(SUN4)
-# define CPU_ISSUN4M (0)
-# define CPU_ISSUN4C (cputyp == CPU_SUN4C)
-# define CPU_ISSUN4 (cputyp == CPU_SUN4)
-# define CPU_ISSUN4OR4C (1)
-# define CPU_ISSUN4COR4M (cputyp == CPU_SUN4C)
-#elif !defined(SUN4M) && defined(SUN4C) && !defined(SUN4)
-# define CPU_ISSUN4M (0)
-# define CPU_ISSUN4C (1)
-# define CPU_ISSUN4 (0)
-# define CPU_ISSUN4OR4C (1)
-# define CPU_ISSUN4COR4M (1)
-# define NBPG 4096
-# define PGOFSET (NBPG-1)
-# define PGSHIFT SUN4CM_PGSHIFT
+# define PAGE_SHIFT SUN4_PGSHIFT
+#elif (defined(SUN4C) || defined(SUN4D) || defined(SUN4M)) && !(defined(SUN4) || defined(SUN4E))
# define PAGE_SIZE 4096
# define PAGE_MASK (PAGE_SIZE - 1)
# define PAGE_SHIFT SUN4CM_PGSHIFT
-#elif !defined(SUN4M) && !defined(SUN4C) && defined(SUN4)
-# define CPU_ISSUN4M (0)
-# define CPU_ISSUN4C (0)
-# define CPU_ISSUN4 (1)
-# define CPU_ISSUN4OR4C (1)
-# define CPU_ISSUN4COR4M (0)
-# define NBPG 8192
-# define PGOFSET (NBPG-1)
-# define PGSHIFT SUN4_PGSHIFT
-# define PAGE_SIZE 8192
-# define PAGE_MASK (PAGE_SIZE - 1)
-# define PAGE_SHIFT SUN4_PGSHIFT
-#elif !defined(SUN4M) && !defined(SUN4C) && !defined(SUN4)
-# define CPU_ISSUN4M (cputyp == CPU_SUN4M)
-# define CPU_ISSUN4C (cputyp == CPU_SUN4C)
-# define CPU_ISSUN4 (cputyp == CPU_SUN4)
-# define CPU_ISSUN4OR4C (cputyp == CPU_SUN4 || cputyp == CPU_SUN4C)
-# define CPU_ISSUN4COR4M (cputyp == CPU_SUN4C || cputyp == CPU_SUN4M)
-#endif
-
-#ifndef NBPG
+#else
#ifdef STANDALONE /* boot blocks */
-# define NBPG nbpg
-# define PGOFSET pgofset
-# define PGSHIFT pgshift
# define PAGE_SIZE nbpg
# define PAGE_MASK pgofset
# define PAGE_SHIFT pgshift
#else
-# define NBPG uvmexp.pagesize
-# define PGOFSET uvmexp.pagemask
-# define PGSHIFT uvmexp.pageshift
# define PAGE_SIZE uvmexp.pagesize
# define PAGE_MASK uvmexp.pagemask
# define PAGE_SHIFT uvmexp.pageshift
#endif
#endif
+# define NBPG PAGE_SIZE
+# define PGOFSET PAGE_MASK
+# define PGSHIFT PAGE_SHIFT
+
+#if defined(SUN4) && !(defined(SUN4C) || defined(SUN4D) || defined(SUN4E) || defined(SUN4M))
+# define CPU_ISSUN4 (1)
+#elif defined(SUN4C) && !(defined(SUN4) || defined(SUN4D) || defined(SUN4E) || defined(SUN4M))
+# define CPU_ISSUN4C (1)
+#elif defined(SUN4D) && !(defined(SUN4) || defined(SUN4C) || defined(SUN4E) || defined(SUN4M))
+# define CPU_ISSUN4D (1)
+#elif defined(SUN4E) && !(defined(SUN4) || defined(SUN4C) || defined(SUN4D) || defined(SUN4M))
+# define CPU_ISSUN4E (1)
+#elif defined(SUN4M) && !(defined(SUN4) || defined(SUN4C) || defined(SUN4D) || defined(SUN4E))
+# define CPU_ISSUN4M (1)
+#elif (defined(SUN4) || defined(SUN4C)) && !(defined(SUN4D) || defined(SUN4E) || defined(SUN4M))
+# define CPU_ISSUN4OR4C (1)
+#elif (defined(SUN4) || defined(SUN4C) || defined(SUN4E)) && !(defined(SUN4D) || defined(SUN4M))
+# define CPU_ISSUN4OR4COR4E (1)
+#elif (defined(SUN4) || defined(SUN4E)) && !(defined(SUN4C) || defined(SUN4D) || defined(SUN4M))
+# define CPU_ISSUN4OR4E (1)
+#elif (defined(SUN4C) || defined(SUN4M)) && !(defined(SUN4) || defined(SUN4D) || defined(SUN4E))
+# define CPU_ISSUN4COR4M (1)
+#elif (defined(SUN4D) || defined(SUN4M)) && !(defined(SUN4) || defined(SUN4C) || defined(SUN4E))
+# define CPU_ISSUN4DOR4M (1)
+#endif
+
+#if !defined(CPU_ISSUN4)
+#if defined(SUN4)
+# define CPU_ISSUN4 (cputyp == CPU_SUN4)
+#else
+# define CPU_ISSUN4 (0)
+#endif
+#endif
+#if !defined(CPU_ISSUN4C)
+#if defined(SUN4C)
+# define CPU_ISSUN4C (cputyp == CPU_SUN4C)
+#else
+# define CPU_ISSUN4C (0)
+#endif
+#endif
+#if !defined(CPU_ISSUN4D)
+#if defined(SUN4D)
+# define CPU_ISSUN4D (cputyp == CPU_SUN4D)
+#else
+# define CPU_ISSUN4D (0)
+#endif
+#endif
+#if !defined(CPU_ISSUN4E)
+#if defined(SUN4E)
+# define CPU_ISSUN4E (cputyp == CPU_SUN4E)
+#else
+# define CPU_ISSUN4E (0)
+#endif
+#endif
+#if !defined(CPU_ISSUN4M)
+#if defined(SUN4M)
+# define CPU_ISSUN4M (cputyp == CPU_SUN4M)
+#else
+# define CPU_ISSUN4M (0)
+#endif
+#endif
+
+#if !defined(CPU_ISSUN4OR4C)
+# define CPU_ISSUN4OR4C (CPU_ISSUN4 || CPU_ISSUN4C)
+#endif
+#if !defined(CPU_ISSUN4OR4E)
+# define CPU_ISSUN4OR4E (cputyp <= CPU_SUN4E)
+ /* (CPU_ISSUN4 || CPU_ISSUN4E) */
+#endif
+#if !defined(CPU_ISSUN4OR4COR4E)
+# define CPU_ISSUN4OR4COR4E (cputyp <= CPU_SUN4C)
+ /* (CPU_ISSUN4 || CPU_ISSUN4C || CPU_ISSUN4E) */
+#endif
+#if !defined(CPU_ISSUN4COR4M)
+# define CPU_ISSUN4COR4M (CPU_ISSUN4C || CPU_ISSUN4M)
+#endif
+#if !defined(CPU_ISSUN4DOR4M)
+# define CPU_ISSUN4DOR4M (cputyp >= CPU_SUN4D)
+ /* (CPU_ISSUN4D || CPU_ISSUN4M) */
+#endif
#endif /* _SPARC_PARAM_H_ */
diff --git a/sys/arch/sparc/include/pmap.h b/sys/arch/sparc/include/pmap.h
index e4c1c780dc8..d2727b93faa 100644
--- a/sys/arch/sparc/include/pmap.h
+++ b/sys/arch/sparc/include/pmap.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: pmap.h,v 1.47 2010/06/29 21:26:09 miod Exp $ */
+/* $OpenBSD: pmap.h,v 1.48 2010/07/10 19:32:24 miod Exp $ */
/* $NetBSD: pmap.h,v 1.30 1997/08/04 20:00:47 pk Exp $ */
/*
@@ -303,7 +303,7 @@ void pmap_writetext(unsigned char *, int);
/* SUN4/SUN4C SPECIFIC DECLARATIONS */
-#if defined(SUN4) || defined(SUN4C)
+#if defined(SUN4) || defined(SUN4C) || defined(SUN4E)
boolean_t pmap_clear_modify4_4c(struct vm_page *);
boolean_t pmap_clear_reference4_4c(struct vm_page *);
int pmap_enter4_4c(pmap_t, vaddr_t, paddr_t, vm_prot_t, int);
@@ -335,7 +335,7 @@ void pmap_zero_page4m(struct vm_page *);
void pmap_changeprot4m(pmap_t, vaddr_t, vm_prot_t, int);
#endif /* defined SUN4M */
-#if !defined(SUN4M) && (defined(SUN4) || defined(SUN4C))
+#if !(defined(SUN4D) || defined(SUN4M)) && (defined(SUN4) || defined(SUN4C) || defined(SUN4E))
#define pmap_clear_modify pmap_clear_modify4_4c
#define pmap_clear_reference pmap_clear_reference4_4c
@@ -350,7 +350,7 @@ void pmap_changeprot4m(pmap_t, vaddr_t, vm_prot_t, int);
#define pmap_zero_page pmap_zero_page4_4c
#define pmap_changeprot pmap_changeprot4_4c
-#elif defined(SUN4M) && !(defined(SUN4) || defined(SUN4C))
+#elif (defined(SUN4D) || defined(SUN4M)) && !(defined(SUN4) || defined(SUN4C) || defined(SUN4E))
#define pmap_clear_modify pmap_clear_modify4m
#define pmap_clear_reference pmap_clear_reference4m
diff --git a/sys/arch/sparc/include/pte.h b/sys/arch/sparc/include/pte.h
index 0be131b3a24..cd43462a1d2 100644
--- a/sys/arch/sparc/include/pte.h
+++ b/sys/arch/sparc/include/pte.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: pte.h,v 1.7 2010/06/18 23:48:11 miod Exp $ */
+/* $OpenBSD: pte.h,v 1.8 2010/07/10 19:32:24 miod Exp $ */
/* $NetBSD: pte.h,v 1.19 1997/08/05 11:00:10 pk Exp $ */
/*
@@ -191,7 +191,7 @@ typedef u_char smeg_t; /* 8 bits needed per Sun-4 regmap entry */
#define SGOFSET (NBPSG - 1) /* mask for segment offset */
/* number of PTEs that map one segment (not number that fit in one segment!) */
-#if defined(SUN4) && (defined(SUN4C) || defined(SUN4M))
+#if (defined(SUN4) || defined(SUN4E)) && (defined(SUN4C) || defined(SUN4D) || defined(SUN4M))
extern int nptesg;
#define NPTESG nptesg /* (which someone will have to initialize) */
#else
@@ -237,28 +237,28 @@ extern int mmu_has_hole;
#define MMU_HOLE_START 0x20000000
#define MMU_HOLE_END 0xe0000000
-#if defined(SUN4M) /* Optimization: sun4m, sun4c have same page */
-#if defined(SUN4) /* size, so they're used interchangeably */
-#define VA_VPG(va) (cputyp==CPU_SUN4 ? VA_SUN4_VPG(va) : VA_SUN4C_VPG(va))
-#define VA_OFF(va) (cputyp==CPU_SUN4 ? VA_SUN4_OFF(va) : VA_SUN4C_OFF(va))
+#if defined(SUN4D) || defined(SUN4M) /* Optimization: sun4c/d/m have same */
+#if defined(SUN4) || defined(SUN4E) /* page size, so they're used interchangeably */
+#define VA_VPG(va) (CPU_ISSUN4OR4E ? VA_SUN4_VPG(va) : VA_SUN4C_VPG(va))
+#define VA_OFF(va) (CPU_ISSUN4OR4E ? VA_SUN4_OFF(va) : VA_SUN4C_OFF(va))
#else
#define VA_VPG(va) VA_SUN4M_VPG(va)
#define VA_OFF(va) VA_SUN4M_OFF(va)
-#endif /* defined SUN4 */
-#else /* 4m not defined */
-#if defined(SUN4) && defined(SUN4C)
-#define VA_VPG(va) (cputyp==CPU_SUN4C ? VA_SUN4C_VPG(va) : VA_SUN4_VPG(va))
-#define VA_OFF(va) (cputyp==CPU_SUN4C ? VA_SUN4C_OFF(va) : VA_SUN4_OFF(va))
+#endif /* defined SUN4 || defined SUN4E */
+#else /* 4d,4m not defined */
+#if (defined(SUN4) || defined(SUN4E)) && defined(SUN4C)
+#define VA_VPG(va) (CPU_ISSUN4C ? VA_SUN4C_VPG(va) : VA_SUN4_VPG(va))
+#define VA_OFF(va) (CPU_ISSUN4C ? VA_SUN4C_OFF(va) : VA_SUN4_OFF(va))
#endif
-#if defined(SUN4C) && !defined(SUN4)
+#if defined(SUN4C) && !(defined(SUN4) || defined(SUN4E))
#define VA_VPG(va) VA_SUN4C_VPG(va)
#define VA_OFF(va) VA_SUN4C_OFF(va)
#endif
-#if !defined(SUN4C) && defined(SUN4)
+#if !defined(SUN4C) && (defined(SUN4) || defined(SUN4E))
#define VA_VPG(va) VA_SUN4_VPG(va)
#define VA_OFF(va) VA_SUN4_OFF(va)
#endif
-#endif /* defined 4m */
+#endif /* defined 4d,4m */
/* there is no `struct pte'; we just use `int'; this is for non-4M only */
#define PG_V 0x80000000
@@ -272,7 +272,7 @@ extern int mmu_has_hole;
#define PG_OBIO 0x04000000 /* on board I/O (incl. SBus on 4c) */
#define PG_VME16 0x08000000 /* 16-bit-data VME space */
#define PG_VME32 0x0c000000 /* 32-bit-data VME space */
-#if defined(SUN4M)
+#if defined(SUN4D) || defined(SUN4M)
#define PG_SUN4M_OBMEM 0x0 /* No type bits=>obmem on 4m */
#define PG_SUN4M_OBIO 0xf /* obio maps to 0xf on 4M */
#define SRMMU_PGTYPE 0xf0000000 /* Top 4 bits of pte PPN give type */
diff --git a/sys/arch/sparc/sparc/autoconf.c b/sys/arch/sparc/sparc/autoconf.c
index 6aaebc18c88..fae8b8e6018 100644
--- a/sys/arch/sparc/sparc/autoconf.c
+++ b/sys/arch/sparc/sparc/autoconf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: autoconf.c,v 1.91 2010/07/06 20:40:01 miod Exp $ */
+/* $OpenBSD: autoconf.c,v 1.92 2010/07/10 19:32:24 miod Exp $ */
/* $NetBSD: autoconf.c,v 1.73 1997/07/29 09:41:53 fair Exp $ */
/*
@@ -168,6 +168,43 @@ struct om_vector *oldpvec = (struct om_vector *)PROM_BASE;
void
bootstrap()
{
+#if defined(SUN4C) || defined(SUN4E)
+ /*
+ * If we are running on a sun4e system, we need to differentiate it
+ * from sun4c now. Note that we can't use CPU_ISSUN4C here because
+ * it might have been optimized depending upon the kernel
+ * configuration.
+ */
+ if (cputyp == CPU_SUN4C) {
+ char tmpstr[24];
+ u_long pgsiz;
+
+ pgsiz = 0;
+ snprintf(tmpstr, sizeof tmpstr, "pagesize %x l!",
+ (u_long)&pgsiz);
+ rominterpret(tmpstr);
+ if (pgsiz == 1 << SUN4_PGSHIFT) {
+#if defined(SUN4E)
+ extern int nbpg, pgofset;
+
+ cputyp = CPU_SUN4E;
+ nbpg = 1 << SUN4_PGSHIFT;
+ pgofset = nbpg - 1;
+#else
+ printf("OpenBSD/sparc: this kernel does not support the sun4e\n");
+ romhalt();
+#endif
+ } else {
+#if defined(SUN4C)
+ /* cputyp, nbpg and pgofset already set in locore */
+#else
+ printf("OpenBSD/sparc: this kernel does not support the sun4c\n");
+ romhalt();
+#endif
+ }
+ }
+#endif
+
#if defined(SUN4)
if (CPU_ISSUN4) {
extern void oldmon_w_cmd(u_long, char *);
@@ -312,16 +349,16 @@ bootstrap()
}
#endif /* SUN4M */
-#if defined(SUN4) || defined(SUN4C)
- if (CPU_ISSUN4OR4C) {
+#if defined(SUN4) || defined(SUN4C) || defined(SUN4E)
+ if (CPU_ISSUN4OR4COR4E) {
/* Map Interrupt Enable Register */
/*
* XXX on non-Sun4, we ought to get the address from
* XXX the `interrupt-enable' node.
*/
- pmap_kenter_pa(INTRREG_VA,
- INT_ENABLE_REG_PHYSADR | PMAP_NC | PMAP_OBIO,
- VM_PROT_READ | VM_PROT_WRITE);
+ pmap_kenter_pa(INTRREG_VA, PMAP_NC | PMAP_OBIO |
+ (CPU_ISSUN4E ? INT_ENABLE_REG_PHYSADR_4E :
+ INT_ENABLE_REG_PHYSADR_44C), VM_PROT_READ | VM_PROT_WRITE);
pmap_update(pmap_kernel());
/* Disable all interrupts */
*((unsigned char *)INTRREG_VA) = 0;
@@ -477,13 +514,6 @@ bootpath_fake(bp, cp)
nbootpath++; \
}
-#if defined(SUN4)
- if (CPU_ISSUN4M) {
- printf("twas brillig..\n");
- return;
- }
-#endif
-
pp = cp + 2;
v0val[0] = v0val[1] = v0val[2] = 0;
if (*pp == '(' /* for vi: ) */
@@ -573,7 +603,7 @@ bootpath_fake(bp, cp)
}
#endif /* SUN4 */
-#if defined(SUN4C)
+#if defined(SUN4C) || defined(SUN4E)
/*
* sun4c stuff
*/
@@ -621,7 +651,7 @@ bootpath_fake(bp, cp)
BP_APPEND(bp, tmpname, target, lun, v0val[2]);
return;
}
-#endif /* SUN4C */
+#endif /* SUN4C || SUN4E */
/*
@@ -793,8 +823,8 @@ cpu_configure()
panic("cpu_configure: ROM hasn't mapped memreg!");
}
#endif
-#if defined(SUN4C)
- if (CPU_ISSUN4C) {
+#if defined(SUN4C) || defined(SUN4E)
+ if (CPU_ISSUN4C || CPU_ISSUN4E) {
node = findroot();
cp = getpropstring(node, "device_type");
if (strcmp(cp, "cpu") != 0)
@@ -819,8 +849,8 @@ cpu_configure()
if (CPU_ISSUN4M)
intreg_clr_4m(SINTR_MA);
#endif
-#if defined(SUN4) || defined(SUN4C)
- if (CPU_ISSUN4OR4C)
+#if defined(SUN4) || defined(SUN4C) || defined(SUN4E)
+ if (CPU_ISSUN4OR4COR4E)
intreg_set_44c(IE_ALLIE);
#endif
(void)spl0();
@@ -1069,7 +1099,7 @@ mainbus_attach(parent, dev, aux)
struct confargs oca;
register const char *const *ssp, *sp = NULL;
struct confargs *ca = aux;
-#if defined(SUN4C) || defined(SUN4M)
+#if defined(SUN4C) || defined(SUN4D) || defined(SUN4E) || defined(SUN4M)
register int node0, node;
const char *const *openboot_special;
#define L1A_HACK /* XXX hack to allow L1-A during autoconf */
@@ -1105,8 +1135,22 @@ mainbus_attach(parent, dev, aux)
"virtual-memory",
NULL
};
-#else
-#define openboot_special4c ((void *)0)
+#endif
+#if defined(SUN4E)
+ static const char *const openboot_special4e[] = {
+ /* find these first (end with empty string) */
+ "memory-error", /* as early as convenient, in case of error */
+ "eeprom",
+ "counter-timer",
+ "auxiliary-io",
+ "",
+
+ /* ignore these (end with NULL) */
+ "interrupt-enable",
+ "options",
+ "p2bus", /* memory bus, has `eccmem' child */
+ NULL
+ };
#endif
#if defined(SUN4M)
static const char *const openboot_special4m[] = {
@@ -1130,8 +1174,6 @@ mainbus_attach(parent, dev, aux)
/* we also skip any nodes with device_type == "cpu" */
NULL
};
-#else
-#define openboot_special4m ((void *)0)
#endif
if (CPU_ISSUN4)
@@ -1177,11 +1219,29 @@ mainbus_attach(parent, dev, aux)
/*
* The rest of this routine is for OBP machines exclusively.
*/
-#if defined(SUN4C) || defined(SUN4M)
+#if defined(SUN4C) || defined(SUN4D) || defined(SUN4E) || defined(SUN4M)
- openboot_special = CPU_ISSUN4M
- ? openboot_special4m
- : openboot_special4c;
+ switch (cputyp) {
+#ifdef SUN4C
+ case CPU_SUN4C:
+ openboot_special = openboot_special4c;
+ break;
+#endif
+#ifdef SUN4E
+ case CPU_SUN4E:
+ openboot_special = openboot_special4e;
+ break;
+#endif
+#ifdef SUN4M
+ case CPU_SUN4M:
+ openboot_special = openboot_special4m;
+ break;
+#endif
+ default:
+ /* panic("can't happen"); */
+ openboot_special = NULL;
+ break;
+ }
node = ca->ca_ra.ra_node; /* i.e., the root node */
@@ -1201,7 +1261,7 @@ mainbus_attach(parent, dev, aux)
config_found(dev, (void *)&oca, mbprint);
}
}
- } else if (CPU_ISSUN4C) {
+ } else if (CPU_ISSUN4C || CPU_ISSUN4E) {
bzero(&oca, sizeof(oca));
oca.ca_ra.ra_node = node;
oca.ca_ra.ra_name = "cpu";
@@ -1257,8 +1317,8 @@ mainbus_attach(parent, dev, aux)
for (node = node0; node; node = nextsibling(node)) {
register const char *cp;
-#if defined(SUN4M)
- if (CPU_ISSUN4M) /* skip the CPUs */
+#if defined(SUN4D) || defined(SUN4M)
+ if (CPU_ISSUN4DOR4M) /* skip the CPUs */
if (node_has_property(node, "device_type") &&
!strcmp(getpropstring(node, "device_type"), "cpu"))
continue;
@@ -1280,7 +1340,22 @@ mainbus_attach(parent, dev, aux)
(void) config_found(dev, (void *)&oca, mbprint);
}
}
-#endif /* SUN4C || SUN4M */
+
+#if defined(SUN4E)
+ if (CPU_ISSUN4E) {
+ /*
+ * Attach the leds.
+ * XXX This is not a natural attachment, but since there
+ * XXX is more than one led, this does not fit in the usual
+ * XXX auxio blink framework.
+ */
+ bzero(&oca, sizeof(oca));
+ oca.ca_bustype = BUS_MAIN;
+ oca.ca_ra.ra_name = "led";
+ config_found(dev, (void *)&oca, mbprint);
+ }
+#endif
+#endif /* SUN4C || SUN4D || SUN4E || SUN4M */
}
struct cfattach mainbus_ca = {
@@ -1334,8 +1409,8 @@ findzs(zs)
}
#endif
-#if defined(SUN4C) || defined(SUN4M)
- if (CPU_ISSUN4COR4M) {
+#if defined(SUN4C) || defined(SUN4D) || defined(SUN4E) || defined(SUN4M)
+ if (!CPU_ISSUN4) {
int node;
node = firstchild(findroot());
@@ -1371,7 +1446,7 @@ findzs(zs)
int
makememarr(struct memarr *ap, u_int xmax, int which)
{
-#if defined(SUN4C) || defined(SUN4M)
+#if defined(SUN4C) || defined(SUN4D) || defined(SUN4E) || defined(SUN4M)
struct v0mlist *mp;
int node, n;
char *prop;
@@ -1382,6 +1457,11 @@ makememarr(struct memarr *ap, u_int xmax, int which)
panic("makememarr");
#endif
+#ifdef DIAGNOSTIC
+ if (which != MEMARR_AVAILPHYS && which != MEMARR_TOTALPHYS)
+ panic("makememarr");
+#endif
+
#if defined(SUN4)
if (CPU_ISSUN4) {
if (ap != NULL && xmax != 0) {
@@ -1393,7 +1473,7 @@ makememarr(struct memarr *ap, u_int xmax, int which)
return 1;
}
#endif
-#if defined(SUN4C) || defined(SUN4M)
+#if defined(SUN4C) || defined(SUN4D) || defined(SUN4E) || defined(SUN4M)
switch (n = promvec->pv_romvec_vers) {
case 0:
/*
@@ -1437,7 +1517,7 @@ makememarr(struct memarr *ap, u_int xmax, int which)
if (n <= 0)
panic("makememarr: no memory found");
return (n);
-#endif /* SUN4C || SUN4M */
+#endif /* SUN4C || SUN4D || SUN4E || SUN4M */
}
/*
@@ -1450,7 +1530,7 @@ getprop(node, name, buf, bufsiz)
void *buf;
register int bufsiz;
{
-#if defined(SUN4C) || defined(SUN4M)
+#if defined(SUN4C) || defined(SUN4D) || defined(SUN4E) || defined(SUN4M)
register struct nodeops *no;
register int len;
#endif
@@ -1462,7 +1542,7 @@ getprop(node, name, buf, bufsiz)
}
#endif
-#if defined(SUN4C) || defined(SUN4M)
+#if defined(SUN4C) || defined(SUN4D) || defined(SUN4E) || defined(SUN4M)
no = promvec->pv_nodeops;
len = no->no_proplen(node, name);
if (len > bufsiz) {
@@ -1652,7 +1732,7 @@ romgetcursoraddr(rowp, colp)
void
romhalt()
{
- if (CPU_ISSUN4COR4M)
+ if (!CPU_ISSUN4)
*promvec->pv_synchook = NULL;
promvec->pv_halt();
@@ -1663,7 +1743,7 @@ void
romboot(str)
char *str;
{
- if (CPU_ISSUN4COR4M)
+ if (!CPU_ISSUN4)
*promvec->pv_synchook = NULL;
promvec->pv_reboot(str);
@@ -1733,8 +1813,8 @@ device_register(struct device *dev, void *aux)
}
#endif
-#if defined(SUN4C)
- if (CPU_ISSUN4C && dev->dv_xname[0] == 's')
+#if defined(SUN4C) || defined(SUN4E)
+ if ((CPU_ISSUN4C || CPU_ISSUN4E) && dev->dv_xname[0] == 's')
target = sd_crazymap(target);
#endif
diff --git a/sys/arch/sparc/sparc/auxreg.c b/sys/arch/sparc/sparc/auxreg.c
index 30976b6afa0..519e965e045 100644
--- a/sys/arch/sparc/sparc/auxreg.c
+++ b/sys/arch/sparc/sparc/auxreg.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: auxreg.c,v 1.14 2007/07/01 19:07:46 miod Exp $ */
+/* $OpenBSD: auxreg.c,v 1.15 2010/07/10 19:32:24 miod Exp $ */
/* $NetBSD: auxreg.c,v 1.21 1997/05/24 20:15:59 pk Exp $ */
/*
@@ -124,6 +124,7 @@ auxregmatch(struct device *parent, void *cf, void *aux)
default:
return (0);
case CPU_SUN4C:
+ case CPU_SUN4E:
return (strcmp("auxiliary-io", ca->ca_ra.ra_name) == 0);
case CPU_SUN4M:
return (strcmp("auxio", ca->ca_ra.ra_name) == 0 ||
diff --git a/sys/arch/sparc/sparc/cache.c b/sys/arch/sparc/sparc/cache.c
index 9fb0a2599cf..57f9a8e8db9 100644
--- a/sys/arch/sparc/sparc/cache.c
+++ b/sys/arch/sparc/sparc/cache.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cache.c,v 1.19 2010/06/29 21:24:41 miod Exp $ */
+/* $OpenBSD: cache.c,v 1.20 2010/07/10 19:32:24 miod Exp $ */
/* $NetBSD: cache.c,v 1.34 1997/09/26 22:17:23 pk Exp $ */
/*
@@ -89,10 +89,10 @@ sun4_cache_enable()
{
u_int i, lim, ls, ts;
- cache_alias_bits = CPU_ISSUN4
+ cache_alias_bits = CPU_ISSUN4OR4E
? CACHE_ALIAS_BITS_SUN4
: CACHE_ALIAS_BITS_SUN4C;
- cache_alias_dist = CPU_ISSUN4
+ cache_alias_dist = CPU_ISSUN4OR4E
? CACHE_ALIAS_DIST_SUN4
: CACHE_ALIAS_DIST_SUN4C;
@@ -357,7 +357,7 @@ turbosparc_cache_enable()
}
#endif /* defined(SUN4M) */
-#if defined(SUN4) || defined(SUN4C)
+#if defined(SUN4) || defined(SUN4C) || defined(SUN4E)
/*
* Flush the current context from the cache.
*
@@ -548,7 +548,7 @@ sun4_cache_flush(base, len)
sun4_vcache_flush_context();
}
}
-#endif /* defined(SUN4) || defined(SUN4C) */
+#endif /* SUN4 || SUN4C || SUN4E */
#if defined(SUN4M)
/*
diff --git a/sys/arch/sparc/sparc/cache.h b/sys/arch/sparc/sparc/cache.h
index d8cfa200bc9..4a2fcffb7c5 100644
--- a/sys/arch/sparc/sparc/cache.h
+++ b/sys/arch/sparc/sparc/cache.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: cache.h,v 1.10 2007/01/22 19:39:33 miod Exp $ */
+/* $OpenBSD: cache.h,v 1.11 2010/07/10 19:32:24 miod Exp $ */
/* $NetBSD: cache.h,v 1.16 1997/07/06 21:15:14 pk Exp $ */
/*
@@ -122,10 +122,10 @@ extern int cache_alias_dist;
extern int cache_alias_bits;
/* Optimize cache alias macros on single architecture kernels */
-#if defined(SUN4) && !defined(SUN4C) && !defined(SUN4M)
+#if (defined(SUN4) || defined(SUN4E)) && !(defined(SUN4C) || defined(SUN4D) || defined(SUN4M))
#define CACHE_ALIAS_DIST CACHE_ALIAS_DIST_SUN4
#define CACHE_ALIAS_BITS CACHE_ALIAS_BITS_SUN4
-#elif !defined(SUN4) && defined(SUN4C) && !defined(SUN4M)
+#elif !(defined(SUN4) || defined(SUN4E)) && defined(SUN4C) && !(defined(SUN4D) || defined(SUN4M))
#define CACHE_ALIAS_DIST CACHE_ALIAS_DIST_SUN4C
#define CACHE_ALIAS_BITS CACHE_ALIAS_BITS_SUN4C
#else
diff --git a/sys/arch/sparc/sparc/clock.c b/sys/arch/sparc/sparc/clock.c
index d043e7c6834..382b3266470 100644
--- a/sys/arch/sparc/sparc/clock.c
+++ b/sys/arch/sparc/sparc/clock.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: clock.c,v 1.25 2010/07/06 20:40:01 miod Exp $ */
+/* $OpenBSD: clock.c,v 1.26 2010/07/10 19:32:24 miod Exp $ */
/* $NetBSD: clock.c,v 1.52 1997/05/24 20:16:05 pk Exp $ */
/*
@@ -377,8 +377,7 @@ clockattach(parent, self, aux)
if (CPU_ISSUN4)
prop = "mk48t02";
-
- else if (CPU_ISSUN4COR4M)
+ else if (!CPU_ISSUN4)
prop = getpropstring(ra->ra_node, "model");
printf(": %s (eeprom)\n", prop);
@@ -455,7 +454,7 @@ timermatch(parent, vcf, aux)
return (1);
}
- if (CPU_ISSUN4C) {
+ if (CPU_ISSUN4C || CPU_ISSUN4E) {
return (strcmp("counter-timer", ca->ca_ra.ra_name) == 0);
}
@@ -492,11 +491,11 @@ timerattach(parent, self, aux)
lim = &counterreg_4m->t_limit;
}
- if (CPU_ISSUN4OR4C) {
+ if (CPU_ISSUN4OR4COR4E) {
/*
* This time, we ignore any existing virtual address because
* we have a fixed virtual address for the timer, to make
- * microtime() faster (in SUN4/SUN4C kernel only).
+ * microtime() faster (in SUN4/SUN4C/SUN4E kernel only).
*/
(void)mapdev(ra->ra_reg, TIMERREG_VA, 0,
sizeof(struct timerreg_4));
@@ -644,7 +643,7 @@ cpu_initclocks()
counterreg_4m->t_limit = tmr_ustolim4m(statint);
}
- if (CPU_ISSUN4OR4C) {
+ if (CPU_ISSUN4OR4COR4E) {
timerreg4->t_c10.t_limit = tmr_ustolim(tick);
timerreg4->t_c14.t_limit = tmr_ustolim(statint);
}
@@ -656,8 +655,8 @@ cpu_initclocks()
intreg_clr_4m(SINTR_T);
#endif
-#if defined(SUN4) || defined(SUN4C)
- if (CPU_ISSUN4OR4C)
+#if defined(SUN4) || defined(SUN4C) || defined(SUN4E)
+ if (CPU_ISSUN4OR4COR4E)
intreg_set_44c(IE_L14 | IE_L10);
#endif
}
@@ -705,8 +704,8 @@ clockintr(cap)
discard = timerreg_4m->t_limit;
}
#endif
-#if defined(SUN4) || defined(SUN4C)
- if (CPU_ISSUN4OR4C) {
+#if defined(SUN4) || defined(SUN4C) || defined(SUN4E)
+ if (CPU_ISSUN4OR4COR4E) {
discard = timerreg4->t_c10.t_limit;
}
#endif
@@ -749,7 +748,7 @@ statintr(cap)
}
}
- if (CPU_ISSUN4OR4C) {
+ if (CPU_ISSUN4OR4COR4E) {
discard = timerreg4->t_c14.t_limit;
}
statclock((struct clockframe *)cap);
@@ -769,7 +768,7 @@ statintr(cap)
counterreg_4m->t_limit = tmr_ustolim4m(newint);
}
- if (CPU_ISSUN4OR4C) {
+ if (CPU_ISSUN4OR4COR4E) {
timerreg4->t_c14.t_limit = tmr_ustolim(newint);
}
return (1);
diff --git a/sys/arch/sparc/sparc/conf.c b/sys/arch/sparc/sparc/conf.c
index a6f1969a5b5..78a1a281285 100644
--- a/sys/arch/sparc/sparc/conf.c
+++ b/sys/arch/sparc/sparc/conf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: conf.c,v 1.52 2010/07/03 03:59:17 krw Exp $ */
+/* $OpenBSD: conf.c,v 1.53 2010/07/10 19:32:24 miod Exp $ */
/* $NetBSD: conf.c,v 1.40 1996/04/11 19:20:03 thorpej Exp $ */
/*
@@ -205,7 +205,7 @@ struct cdevsw cdevsw[] =
cdev_notdef(), /* 67: was /dev/cgsix */
cdev_notdef(), /* 68 */
cdev_gen_init(NAUDIO,audio), /* 69: /dev/audio */
-#if defined(SUN4) || defined(SUN4C) || defined(SUN4M)
+#if defined(SUN4) || defined(SUN4C) || defined(SUN4D) || defined(SUN4E) || defined(SUN4M)
cdev_openprom_init(1,openprom), /* 70: /dev/openprom */
#else
cdev_notdef(), /* 70 */
diff --git a/sys/arch/sparc/sparc/cpu.c b/sys/arch/sparc/sparc/cpu.c
index 45e01bbd18f..983cccd6e69 100644
--- a/sys/arch/sparc/sparc/cpu.c
+++ b/sys/arch/sparc/sparc/cpu.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cpu.c,v 1.46 2010/06/07 19:54:33 miod Exp $ */
+/* $OpenBSD: cpu.c,v 1.47 2010/07/10 19:32:24 miod Exp $ */
/* $NetBSD: cpu.c,v 1.56 1997/09/15 20:52:36 pk Exp $ */
/*
@@ -189,20 +189,30 @@ cpu_attach(parent, self, aux)
bcopy(&cpuinfo, sc, sizeof(cpuinfo));
}
-#if defined(SUN4C) || defined(SUN4M)
+#if defined(SUN4C) || defined(SUN4D) || defined(SUN4E) || defined(SUN4M)
switch (cputyp) {
#if defined(SUN4C)
case CPU_SUN4C:
cpu_class = "sun4c";
break;
#endif /* defined(SUN4C) */
+#if defined(SUN4D)
+ case CPU_SUN4D:
+ cpu_class = "sun4d";
+ break;
+#endif /* defined(SUN4D) */
+#if defined(SUN4E)
+ case CPU_SUN4E:
+ cpu_class = "sun4e";
+ break;
+#endif /* defined(SUN4E) */
#if defined(SUN4M)
case CPU_SUN4M:
cpu_class = "sun4m";
break;
#endif /* defined(SUN4M) */
}
-#endif /* defined(SUN4C) || defined(SUN4M) */
+#endif /* SUN4C || SUN4D || SUN4E || SUN4M */
getcpuinfo(sc, node);
@@ -535,7 +545,7 @@ cpumatch_sun4(sc, mp, node)
}
#endif /* SUN4 */
-#if defined(SUN4C)
+#if defined(SUN4C) || defined(SUN4E)
struct module_info module_sun4c = {
CPUTYP_UNKNOWN,
VAC_WRITETHROUGH,
@@ -568,7 +578,7 @@ cpumatch_sun4c(sc, mp, node)
rnode = findroot();
sc->mmu_npmeg = sc->mmu_nsegment =
- getpropint(rnode, "mmu-npmg", 128);
+ getpropint(rnode, "mmu-npmg", CPU_ISSUN4E ? 256 : 128);
sc->mmu_ncontext = getpropint(rnode, "mmu-nctx", 8);
/* Get clock frequency */
@@ -617,7 +627,7 @@ getcacheinfo_sun4c(sc, node)
if (getpropint(node, "buserr-type", 0) == 1)
sc->flags |= CPUFLG_SUN4CACHEBUG;
}
-#endif /* SUN4C */
+#endif /* SUN4C || SUN4E */
#if defined(solbourne)
struct module_info module_kap = {
@@ -1196,6 +1206,10 @@ struct cpu_conf {
{ CPU_SUN4C, 9, 0, ANY, ANY, "W8601/8701 or MB86903", &module_sun4c },
#endif
+#if defined(SUN4E)
+ { CPU_SUN4E, 0, 0, ANY, ANY, "MB86900/1A or L64801", &module_sun4c },
+#endif
+
#if defined(SUN4M)
{ CPU_SUN4M, 0, 4, 0, 4, "MB86904", &module_swift },
{ CPU_SUN4M, 0, 5, 0, 5, "MB86907", &module_turbosparc },
diff --git a/sys/arch/sparc/sparc/intr.c b/sys/arch/sparc/sparc/intr.c
index 80041ae3627..3509ce4c5cb 100644
--- a/sys/arch/sparc/sparc/intr.c
+++ b/sys/arch/sparc/sparc/intr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: intr.c,v 1.33 2010/07/06 20:40:01 miod Exp $ */
+/* $OpenBSD: intr.c,v 1.34 2010/07/10 19:32:25 miod Exp $ */
/* $NetBSD: intr.c,v 1.20 1997/07/29 09:42:03 fair Exp $ */
/*
@@ -468,8 +468,8 @@ softintr_establish(int level, void (*fn)(void *), void *arg)
* passed to intreg_set_44c().
*/
ipl = hw = level;
-#if defined(SUN4) || defined(SUN4C)
- if (CPU_ISSUN4OR4C) {
+#if defined(SUN4) || defined(SUN4C) || defined(SUN4E)
+ if (CPU_ISSUN4OR4COR4E) {
/*
* Select the most suitable of the three available
* softintr levels.
@@ -540,8 +540,9 @@ softintr_schedule(void *arg)
raise(0, sih->sih_hw);
break;
#endif
-#if defined(SUN4) || defined(SUN4C)
+#if defined(SUN4) || defined(SUN4C) || defined(SUN4E)
case CPU_SUN4:
+ case CPU_SUN4E:
case CPU_SUN4C:
intreg_set_44c(sih->sih_hw);
break;
diff --git a/sys/arch/sparc/sparc/intreg.h b/sys/arch/sparc/sparc/intreg.h
index 1a8439fb9ef..cf7bdc66c20 100644
--- a/sys/arch/sparc/sparc/intreg.h
+++ b/sys/arch/sparc/sparc/intreg.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: intreg.h,v 1.10 2010/07/06 20:40:01 miod Exp $ */
+/* $OpenBSD: intreg.h,v 1.11 2010/07/10 19:32:25 miod Exp $ */
/* $NetBSD: intreg.h,v 1.6 1997/07/22 20:19:10 pk Exp $ */
/*
@@ -43,7 +43,7 @@
#include <sparc/sparc/vaddrs.h>
-#if defined(SUN4) || defined(SUN4C)
+#if defined(SUN4) || defined(SUN4C) || defined(SUN4E)
/*
* sun4c interrupt enable register.
@@ -55,7 +55,8 @@
* must be mapped early in the boot process (otherwise NMI handling
* will fail).
*/
-#define INT_ENABLE_REG_PHYSADR 0xf5000000 /* phys addr in IOspace */
+#define INT_ENABLE_REG_PHYSADR_44C 0xf5000000
+#define INT_ENABLE_REG_PHYSADR_4E 0xea000000
/*
* Bits in interrupt enable register. Software interrupt requests must
@@ -75,7 +76,7 @@ void intreg_set_44c(int); /* set given bits */
void intreg_clr_44c(int); /* clear given bits */
#endif
-#endif /* SUN4 || SUN4C */
+#endif /* SUN4 || SUN4C || SUN4E */
#if defined(SUN4M)
diff --git a/sys/arch/sparc/sparc/iommu.c b/sys/arch/sparc/sparc/iommu.c
index b8ec3070051..4f7261bb01e 100644
--- a/sys/arch/sparc/sparc/iommu.c
+++ b/sys/arch/sparc/sparc/iommu.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: iommu.c,v 1.24 2010/06/17 16:11:19 miod Exp $ */
+/* $OpenBSD: iommu.c,v 1.25 2010/07/10 19:32:25 miod Exp $ */
/* $NetBSD: iommu.c,v 1.13 1997/07/29 09:42:04 fair Exp $ */
/*
@@ -145,7 +145,7 @@ iommu_match(parent, vcf, aux)
register struct confargs *ca = aux;
register struct romaux *ra = &ca->ca_ra;
- if (CPU_ISSUN4OR4C)
+ if (CPU_ISSUN4OR4COR4E)
return (0);
return (strcmp(cf->cf_driver->cd_name, ra->ra_name) == 0);
}
diff --git a/sys/arch/sparc/sparc/kgdb_machdep.c b/sys/arch/sparc/sparc/kgdb_machdep.c
index 29369983ef5..e507484bc24 100644
--- a/sys/arch/sparc/sparc/kgdb_machdep.c
+++ b/sys/arch/sparc/sparc/kgdb_machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kgdb_machdep.c,v 1.9 2008/06/26 05:42:13 ray Exp $ */
+/* $OpenBSD: kgdb_machdep.c,v 1.10 2010/07/10 19:32:25 miod Exp $ */
/* $NetBSD: kgdb_machdep.c,v 1.1 1997/08/31 21:22:45 pk Exp $ */
/*-
* Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -98,7 +98,7 @@
lda(((vaddr_t)va & 0xFFFFF000) | ASI_SRMMUFP_L3, ASI_SRMMUFP)
#endif
-#if defined(SUN4) || defined(SUN4C)
+#if defined(SUN4) || defined(SUN4C) || defined(SUN4E)
#define getpte4(va) lda(va, ASI_PTE)
#define setpte4(va, pte) sta(va, ASI_PTE, pte)
#endif
@@ -274,8 +274,8 @@ kgdb_acc(vaddr_t va, size_t len)
return (0);
}
#endif
-#if defined(SUN4) || defined(SUN4C)
- if (CPU_ISSUN4C || CPU_ISSUN4) {
+#if defined(SUN4) || defined(SUN4C) || defined(SUN4E)
+ if (CPU_ISSUN4OR4COR4E) {
pte = getpte4(va);
if ((pte & PG_V) == 0)
return (0);
diff --git a/sys/arch/sparc/sparc/locore.s b/sys/arch/sparc/sparc/locore.s
index 36d89c293be..527a1ba414b 100644
--- a/sys/arch/sparc/sparc/locore.s
+++ b/sys/arch/sparc/sparc/locore.s
@@ -1,4 +1,4 @@
-/* $OpenBSD: locore.s,v 1.87 2010/07/06 20:40:01 miod Exp $ */
+/* $OpenBSD: locore.s,v 1.88 2010/07/10 19:32:25 miod Exp $ */
/* $NetBSD: locore.s,v 1.73 1997/09/13 20:36:48 pk Exp $ */
/*
@@ -187,11 +187,11 @@ curproc = CPUINFO_VA + CPUINFO_CURPROC
/*
* cputyp is the current cpu type, used to distinguish between
* the many variations of different sun4* machines. It contains
- * the value CPU_SUN4, CPU_SUN4C, or CPU_SUN4M.
+ * the value CPU_SUN4, CPU_SUN4C, CPU_SUN4D, CPU_SUN4E or CPU_SUN4M.
*/
.globl _C_LABEL(cputyp)
_C_LABEL(cputyp):
- .word 1
+ .word CPU_SUN4C
/*
* cpumod is the current cpu model, used to distinguish between variants
* in the Sun4 and Sun4M families. See /sys/arch/sparc/include/param.h for
@@ -209,7 +209,7 @@ _C_LABEL(cpumod):
_C_LABEL(mmumod):
.word 0
-#if defined(SUN4C) || defined(SUN4M)
+#if defined(SUN4C) || defined(SUN4D) || defined(SUN4E) || defined(SUN4M)
_C_LABEL(cputypval):
.asciz "sun4c"
.ascii " "
@@ -225,6 +225,7 @@ _C_LABEL(cputypvallen) = _C_LABEL(cputypvar) - _C_LABEL(cputypval)
.globl _C_LABEL(nbpg)
_C_LABEL(nbpg):
.word 0
+ .globl _C_LABEL(pgofset)
_C_LABEL(pgofset):
.word 0
@@ -240,7 +241,7 @@ sun4m_notsup:
sun4d_notsup:
.asciz "cr .( OpenBSD/sparc: this kernel does not support the sun4d) cr"
#endif
-#if !defined(SUN4C)
+#if !(defined(SUN4C) || defined(SUN4E))
sun4c_notsup:
.asciz "cr .( OpenBSD/sparc: this kernel does not support the sun4c) cr"
#endif
@@ -347,11 +348,13 @@ sun4_notsup:
#define ZS_INTERRUPT4M HARDINT4M(12)
#endif
+ .text
.globl start, _C_LABEL(kernel_text)
_C_LABEL(kernel_text):
start:
/*
- * Put sun4 traptable first, since it needs the most stringent alignment (8192)
+ * Put sun4 and sun4e traptables first, since they need the most stringent
+ * alignment (8192).
*/
#if defined(SUN4)
trapbase_sun4:
@@ -612,11 +615,19 @@ trapbase_sun4:
STRAP(0xfd)
STRAP(0xfe)
STRAP(0xff)
+#endif /* SUN4 */
+
+#if defined(SUN4) && defined(SUN4E)
+ /*
+ * Make sure the sun4e trap table (which is the same as the sun4c
+ * table until we support VME interrupts) is properly page-aligned.
+ */
+ .skip 4096
#endif
-#if defined(SUN4C)
+#if defined(SUN4C) || defined(SUN4E)
trapbase_sun4c:
-/* trap 0 is special since we cannot receive it */
+ /* trap 0 is special since we cannot receive it */
b dostart; nop; nop; nop ! 00 = reset (fake)
VTRAP(T_TEXTFAULT, memfault_sun4c) ! 01 = instr. fetch fault
TRAP(T_ILLINST) ! 02 = illegal instruction
@@ -1136,15 +1147,22 @@ trapbase_sun4m:
STRAP(0xff)
#endif
+#if (defined(SUN4) || defined(SUN4E))
/*
* Pad the trap table to max page size.
* Trap table size is 0x100 * 4instr * 4byte/instr = 4096 bytes;
* need to .skip 4096 to pad to page size iff. the number of trap tables
* defined above is odd.
*/
-#if (defined(SUN4) + defined(SUN4C) + defined(SUN4M)) % 2 == 1
+/*
+ * SUN4 && !SUN4E => pad if only one of 4C and 4M is set
+ * SUN4E => pad if 4M is not set
+ */
+#if (!defined(SUN4E) && (defined(SUN4C) + defined(SUN4M)) == 1) || \
+ (defined(SUN4E) && !defined(SUN4M))
.skip 4096
#endif
+#endif
#ifdef DEBUG
/*
@@ -1227,7 +1245,7 @@ Lpanic_red:
* The code below also assumes that PTE_OF_ADDR is safe in a delay
* slot; it is, at it merely sets its `pte' register to a temporary value.
*/
-#if defined(SUN4) || defined(SUN4C)
+#if defined(SUN4) || defined(SUN4C) || defined(SUN4E)
/* input: addr, output: pte; aux: bad address label */
#define PTE_OF_ADDR4_4C(addr, pte, bad, page_offset) \
sra addr, PG_VSHIFT, pte; \
@@ -1289,14 +1307,14 @@ Lpanic_red:
cmp pte, (SRMMU_TEPTE | PPROT_WRITE)
#endif /* 4m */
-#if defined(SUN4M) && !(defined(SUN4C) || defined(SUN4))
+#if (defined(SUN4D) || defined(SUN4M)) && !(defined(SUN4) || defined(SUN4C) || defined(SUN4E))
#define PTE_OF_ADDR(addr, pte, bad, page_offset, label) \
PTE_OF_ADDR4M(addr, pte, bad, page_offset)
#define CMP_PTE_USER_WRITE(pte, tmp, label) CMP_PTE_USER_WRITE4M(pte,tmp)
#define CMP_PTE_USER_READ(pte, tmp, label) CMP_PTE_USER_READ4M(pte,tmp)
-#elif (defined(SUN4C) || defined(SUN4)) && !defined(SUN4M)
+#elif (defined(SUN4) || defined(SUN4C) || defined(SUN4E)) && !(defined(SUN4D) || defined(SUN4M))
#define PTE_OF_ADDR(addr, pte, bad, page_offset,label) \
PTE_OF_ADDR4_4C(addr, pte, bad, page_offset)
@@ -1780,14 +1798,14 @@ memfault_sun4:
sethi %hi(SER_WRITE), %o5 ! damn SER_WRITE wont fit simm13
! or %lo(SER_WRITE), %o5, %o5! not necessary since %lo is zero
or %o5, %o1, %o1 ! set SER_WRITE
-#if defined(SUN4C) || defined(SUN4M)
+#if defined(SUN4C) || defined(SUN4D) || defined(SUN4E) || defined(SUN4M)
ba,a normal_mem_fault
!!nop ! XXX make efficient later
-#endif /* SUN4C || SUN4M */
+#endif /* SUN4C || SUN4D || SUN4E || SUN4M */
#endif /* SUN4 */
memfault_sun4c:
-#if defined(SUN4C)
+#if defined(SUN4C) || defined(SUN4E)
TRAP_SETUP(-CCFSZ-80)
INCR(_C_LABEL(uvmexp)+V_FAULTS) ! cnt.v_faults++ (clobbers %o0,%o1)
@@ -1882,7 +1900,7 @@ memfault_sun4c:
b return_from_trap
wr %l0, 0, %psr
/* NOTREACHED */
-#endif /* SUN4C */
+#endif /* SUN4C || SUN4E */
#if defined(SUN4M)
memfault_sun4m:
@@ -2401,9 +2419,9 @@ softintr_common:
* _sparc_interrupt{44c,4m} is exported for paranoia checking
* (see intr.c).
*/
-#if defined(SUN4M)
.globl _C_LABEL(sparc_interrupt4m)
_C_LABEL(sparc_interrupt4m):
+#if defined(SUN4D) || defined(SUN4M)
mov 1, %l4
sethi %hi(ICR_PI_PEND), %l5
ld [%l5 + %lo(ICR_PI_PEND)], %l5 ! get pending interrupts
@@ -2424,13 +2442,11 @@ _C_LABEL(sparc_interrupt4m):
ld [%l6 + %lo(ICR_PI_PEND)], %g0
b,a softintr_common
-#endif
+#endif /* SUN4D || SUN4M */
-#if defined(SUN4) || defined(SUN4C)
+sparc_interrupt_common:
.globl _C_LABEL(sparc_interrupt44c)
_C_LABEL(sparc_interrupt44c):
-#endif
-sparc_interrupt_common:
INTR_SETUP(-CCFSZ-80)
std %g2, [%sp + CCFSZ + 24] ! save registers
INCR(_C_LABEL(uvmexp)+V_INTR) ! cnt.v_intr++; (clobbers %o0,%o1)
@@ -2491,25 +2507,6 @@ sparc_interrupt_common:
b 5b
std %l4, [%l3 + IH_COUNT]
-#ifdef notyet
-/*
- * Level 12 (ZS serial) interrupt. Handle it quickly, schedule a
- * software interrupt, and get out. Do the software interrupt directly
- * if we would just take it on the way out.
- *
- * Input:
- * %l0 = %psr
- * %l1 = return pc
- * %l2 = return npc
- * Internal:
- * %l3 = zs device
- * %l4, %l5 = temporary
- * %l6 = rr3 (or temporary data) + 0x100 => need soft int
- * %l7 = zs soft status
- */
-zshard:
-#endif /* notyet */
-
/*
* Level 15 interrupt. An async memory error has occurred;
* take care of it (typically by panicking, but hey...).
@@ -2551,12 +2548,12 @@ nmi_sun4:
mov %g1, %l5 ! save g1, g6, g7
mov %g6, %l6
mov %g7, %l7
-#if defined(SUN4C) || defined(SUN4M)
+#if defined(SUN4C) || defined(SUN4E)
b,a nmi_common
-#endif /* SUN4C || SUN4M */
+#endif /* SUN4C */
#endif
-#if defined(SUN4C)
+#if defined(SUN4C) || defined(SUN4E)
nmi_sun4c:
INTR_SETUP(-CCFSZ-80)
INCR(_C_LABEL(uvmexp)+V_INTR) ! cnt.v_intr++; (clobbers %o0,%o1)
@@ -2586,11 +2583,12 @@ nmi_sun4c:
lda [%o0] ASI_CONTROL, %o3 ! async err reg
inc 4, %o0
lda [%o0] ASI_CONTROL, %o4 ! async virt addr
-#if defined(SUN4M)
+#if defined(SUN4)
!!b,a nmi_common
-#endif /* SUN4M */
-#endif /* SUN4C */
+#endif /* SUN4 */
+#endif /* SUN4C || SUN4E */
+#if defined(SUN4) || defined(SUN4C) || defined(SUN4E)
nmi_common:
! and call C code
call _C_LABEL(memerr4_4c)
@@ -2610,6 +2608,7 @@ nmi_common:
stb %o1, [%o0 + %lo(INTRREG_VA)]
b return_from_trap
wr %l4, 0, %y ! restore y
+#endif /* SUN4 || SUN4C || SUN4E */
#if defined(SUN4M)
nmi_sun4m:
@@ -3439,11 +3438,11 @@ dostart:
be is_sun4
nop
-#if defined(SUN4C) || defined(SUN4M)
+#if defined(SUN4C) || defined(SUN4D) || defined(SUN4E) || defined(SUN4M)
mov %o0, %g7 ! save prom vector pointer
/*
- * are we on a sun4c, sun4d or a sun4m?
+ * are we on a sun4c, sun4d, sun4e or a sun4m?
*/
ld [%g7 + PV_NODEOPS], %o4 ! node = pv->pv_nodeops->no_nextnode(0)
ld [%o4 + NO_NEXTNODE], %o4
@@ -3468,9 +3467,9 @@ dostart:
cmp %o0, 'm'
be is_sun4m
nop
-#endif /* SUN4C || SUN4M */
+#endif /* SUN4C || SUN4D || SUN4E || SUN4M */
- ! ``on a sun4e or sun4u? hell no!''
+ ! ``on a sun4u? hell no!''
ld [%g7 + PV_HALT], %o1 ! by this kernel, then halt
call %o1
nop
@@ -3508,7 +3507,11 @@ is_sun4d:
/*NOTREACHED*/
#endif
is_sun4c:
-#if defined(SUN4C)
+#if defined(SUN4C) || defined(SUN4E)
+ /*
+ * Assume sun4c for now; bootstrap() will check for the pagesize
+ * and will update the page size variables as well as cputyp.
+ */
set trapbase_sun4c, %g6
mov SUN4CM_PGSHIFT, %g5
@@ -3516,7 +3519,7 @@ is_sun4c:
stba %g0, [%g1] ASI_CONTROL
b start_havetype
- mov CPU_SUN4C, %g4 ! XXX CPU_SUN4
+ mov CPU_SUN4C, %g4
#else
RELOCATE(sun4c_notsup, %o0)
@@ -3598,7 +3601,7 @@ start_havetype:
* Need different initial mapping functions for different
* types of machines.
*/
-#if defined(SUN4C)
+#if defined(SUN4C) || defined(SUN4E)
cmp %g4, CPU_SUN4C
bne 1f
set 1 << 18, %l3 ! segment size in bytes
@@ -3611,7 +3614,7 @@ start_havetype:
add %l3, %l0, %l0 ! (and lowva += segsz)
b,a startmap_done
1:
-#endif /* SUN4C */
+#endif /* SUN4C || SUN4E */
#if defined(SUN4)
cmp %g4, CPU_SUN4
@@ -3800,7 +3803,7 @@ startmap_done:
call init_tables
st %o0, [%o1 + %lo(_C_LABEL(nwindows))]
-#if defined(SUN4) || defined(SUN4C)
+#if defined(SUN4) || defined(SUN4C) || defined(SUN4E)
/*
* Some sun4/sun4c models have fewer than 8 windows. For extra
* speed, we do not need to save/restore those windows
@@ -3819,7 +3822,7 @@ noplab: nop
1:
#endif
-#if ((defined(SUN4) || defined(SUN4C)) && defined(SUN4M))
+#if ((defined(SUN4) || defined(SUN4C) || defined(SUN4E)) && (defined(SUN4D) || defined(SUN4M)))
/*
* Patch instructions at specified labels that start
@@ -3835,7 +3838,7 @@ Lgandul: nop
ld [%o0 + %lo(Lgandul)], %l0 ! %l0 = NOP
cmp %g4, CPU_SUN4M
- bne,a 1f
+ blu,a 1f
nop
! this should be automated!
@@ -4529,14 +4532,14 @@ Lsw_load:
/* p does have a context: just switch to it */
Lsw_havectx:
! context is in %o0
-#if (defined(SUN4) || defined(SUN4C)) && defined(SUN4M)
+#if (defined(SUN4) || defined(SUN4C) || defined(SUN4E)) && (defined(SUN4D) || defined(SUN4M))
sethi %hi(_C_LABEL(cputyp)), %o1 ! what cpu are we running on?
ld [%o1 + %lo(_C_LABEL(cputyp))], %o1
cmp %o1, CPU_SUN4M
- be 1f
+ bge 1f
nop
#endif
-#if defined(SUN4) || defined(SUN4C)
+#if defined(SUN4) || defined(SUN4C) || defined(SUN4E)
set AC_CONTEXT, %o1
retl
stba %o0, [%o1] ASI_CONTROL ! setcontext(vm->vm_map.pmap->pm_ctxnum);
@@ -5388,7 +5391,7 @@ ENTRY(loadfpstate)
* Set and clear bits in the interrupt register.
*/
-#if defined(SUN4) || defined(SUN4C)
+#if defined(SUN4) || defined(SUN4C) || defined(SUN4E)
/*
* Since there are no read-modify-write instructions for this,
* and one of the interrupts is nonmaskable, we must disable traps.
@@ -5420,7 +5423,7 @@ ENTRY(intreg_clr_44c)
nop
retl
nop
-#endif /* SUN4 || SUN4C */
+#endif /* SUN4 || SUN4C || SUN4E */
#if defined(SUN4M)
/*
@@ -5943,10 +5946,10 @@ ENTRY(microtime)
#endif
sethi %hi(_C_LABEL(time)), %g2
-#if defined(SUN4M) && !(defined(SUN4C) || defined(SUN4))
+#if (defined(SUN4D) || defined(SUN4M)) && !(defined(SUN4) || defined(SUN4C) || defined(SUN4E))
sethi %hi(TIMERREG_VA+4), %g3
or %g3, %lo(TIMERREG_VA+4), %g3
-#elif (defined(SUN4C) || defined(SUN4)) && !defined(SUN4M)
+#elif (defined(SUN4) || defined(SUN4C) || defined(SUN4E)) && !(defined(SUN4D) || defined(SUN4M))
sethi %hi(TIMERREG_VA), %g3
or %g3, %lo(TIMERREG_VA), %g3
#else
diff --git a/sys/arch/sparc/sparc/pmap.c b/sys/arch/sparc/sparc/pmap.c
index d05914798d6..77121c067f9 100644
--- a/sys/arch/sparc/sparc/pmap.c
+++ b/sys/arch/sparc/sparc/pmap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pmap.c,v 1.156 2010/06/30 20:35:03 miod Exp $ */
+/* $OpenBSD: pmap.c,v 1.157 2010/07/10 19:32:25 miod Exp $ */
/* $NetBSD: pmap.c,v 1.118 1998/05/19 19:00:18 thorpej Exp $ */
/*
@@ -384,7 +384,7 @@ vaddr_t pagetables_start, pagetables_end;
static void pmap_page_upload(void);
void pmap_release(pmap_t);
-#if defined(SUN4) || defined(SUN4C)
+#if defined(SUN4) || defined(SUN4C) || defined(SUN4E)
int mmu_has_hole;
#endif
@@ -428,12 +428,12 @@ static u_long segfixmask = 0xffffffff; /* all bits valid to start */
? setcontext4m(c) \
: setcontext4(c) )
-#define getsegmap(va) (CPU_ISSUN4C \
- ? lduba(va, ASI_SEGMAP) \
- : (lduha(va, ASI_SEGMAP) & segfixmask))
-#define setsegmap(va, pmeg) (CPU_ISSUN4C \
- ? stba(va, ASI_SEGMAP, pmeg) \
- : stha(va, ASI_SEGMAP, pmeg))
+#define getsegmap(va) (CPU_ISSUN4 \
+ ? (lduha(va, ASI_SEGMAP) & segfixmask) \
+ : lduba(va, ASI_SEGMAP))
+#define setsegmap(va, pmeg) (CPU_ISSUN4 \
+ ? stha(va, ASI_SEGMAP, pmeg) \
+ : stba(va, ASI_SEGMAP, pmeg))
/* 3-level sun4 MMU only: */
#define getregmap(va) ((unsigned)lduha((va)+2, ASI_REGMAP) >> 8)
@@ -447,7 +447,7 @@ static __inline void setpgt4m(int *, int);
void setpte4m(vaddr_t va, int pte);
#endif
-#if defined(SUN4) || defined(SUN4C)
+#if defined(SUN4) || defined(SUN4C) || defined(SUN4E)
#define getpte4(va) lda(va, ASI_PTE)
#define setpte4(va, pte) sta(va, ASI_PTE, pte)
#endif
@@ -483,7 +483,7 @@ int pv_link4m(struct pvlist *, struct pmap *, vaddr_t, int);
void pv_unlink4m(struct pvlist *, struct pmap *, vaddr_t);
#endif
-#if defined(SUN4) || defined(SUN4C)
+#if defined(SUN4) || defined(SUN4C) || defined(SUN4E)
void mmu_reservemon4_4c(int *, int *);
void pmap_rmk4_4c(struct pmap *, vaddr_t, vaddr_t, int, int);
void pmap_rmu4_4c(struct pmap *, vaddr_t, vaddr_t, int, int);
@@ -497,11 +497,11 @@ int pv_link4_4c(struct pvlist *, struct pmap *, vaddr_t, int);
void pv_unlink4_4c(struct pvlist *, struct pmap *, vaddr_t);
#endif
-#if !defined(SUN4M) && (defined(SUN4) || defined(SUN4C))
+#if !(defined(SUN4D) || defined(SUN4M)) && (defined(SUN4) || defined(SUN4C) || defined(SUN4E))
#define pmap_rmk pmap_rmk4_4c
#define pmap_rmu pmap_rmu4_4c
-#elif defined(SUN4M) && !(defined(SUN4) || defined(SUN4C))
+#elif (defined(SUN4D) || defined(SUN4M)) && !(defined(SUN4) || defined(SUN4C) || defined(SUN4E))
#define pmap_rmk pmap_rmk4m
#define pmap_rmu pmap_rmu4m
@@ -720,14 +720,14 @@ sparc_protection_init4m(void)
#define CTX_USABLE(pm,rp) ((pm)->pm_ctx != NULL )
#endif
-#define GAP_WIDEN(pm,vr) do if (CPU_ISSUN4OR4C) { \
+#define GAP_WIDEN(pm,vr) do if (CPU_ISSUN4OR4COR4E) { \
if (vr + 1 == pm->pm_gap_start) \
pm->pm_gap_start = vr; \
if (vr == pm->pm_gap_end) \
pm->pm_gap_end = vr + 1; \
} while (0)
-#define GAP_SHRINK(pm,vr) do if (CPU_ISSUN4OR4C) { \
+#define GAP_SHRINK(pm,vr) do if (CPU_ISSUN4OR4COR4E) { \
int x; \
x = pm->pm_gap_start + (pm->pm_gap_end - pm->pm_gap_start) / 2; \
if (vr > x) { \
@@ -923,7 +923,7 @@ pmap_pa_exists(paddr_t pa)
* description of *free* virtual memory. Rather than invert this, we
* resort to two magic constants from the PROM vector description file.
*/
-#if defined(SUN4) || defined(SUN4C)
+#if defined(SUN4) || defined(SUN4C) || defined(SUN4E)
void
mmu_reservemon4_4c(nrp, nsp)
int *nrp, *nsp;
@@ -941,8 +941,8 @@ mmu_reservemon4_4c(nrp, nsp)
prom_vend = eva = OLDMON_ENDVADDR;
}
#endif
-#if defined(SUN4C)
- if (CPU_ISSUN4C) {
+#if defined(SUN4C) || defined(SUN4E)
+ if (CPU_ISSUN4C || CPU_ISSUN4E) {
prom_vstart = va = OPENPROM_STARTVADDR;
prom_vend = eva = OPENPROM_ENDVADDR;
}
@@ -1232,10 +1232,8 @@ mmu_setup4m_L3(pagtblptd, sp)
/*
* MMU management.
*/
-struct mmuentry *me_alloc(struct mmuhd *, struct pmap *, int, int);
-void me_free(struct pmap *, u_int);
-struct mmuentry *region_alloc(struct mmuhd *, struct pmap *, int);
-void region_free(struct pmap *, u_int);
+
+#if defined(SUN4) || defined(SUN4C) || defined(SUN4E) /* This is old sun MMU stuff */
/*
* Change contexts. We need the old context number as well as the new
@@ -1246,10 +1244,14 @@ void region_free(struct pmap *, u_int);
#define CHANGE_CONTEXTS(old, new) \
if ((old) != (new)) { \
write_user_windows(); \
- setcontext(new); \
+ setcontext4(new); \
}
-#if defined(SUN4) || defined(SUN4C) /* This is old sun MMU stuff */
+struct mmuentry *me_alloc(struct mmuhd *, struct pmap *, int, int);
+void me_free(struct pmap *, u_int);
+struct mmuentry *region_alloc(struct mmuhd *, struct pmap *, int);
+void region_free(struct pmap *, u_int);
+
/*
* Allocate an MMU entry (i.e., a PMEG).
* If necessary, steal one from someone else.
@@ -1669,6 +1671,7 @@ printf("mmu_pagein: kernel wants map at va 0x%x, vr %d, vs %d\n", va, vr, vs);
/* return 0 if we have no PMEGs to load */
if (rp->rg_segmap == NULL)
return (0);
+
#if defined(SUN4_MMU3L)
if (HASSUN4_MMU3L && rp->rg_smeg == reginval) {
smeg_t smeg;
@@ -1709,7 +1712,7 @@ printf("mmu_pagein: kernel wants map at va 0x%x, vr %d, vs %d\n", va, vr, vs);
splx(s);
return (1);
}
-#endif /* defined SUN4 or SUN4C */
+#endif /* SUN4 || SUN4C || SUN4E */
/*
* Allocate a context. If necessary, steal one from someone else.
@@ -1734,7 +1737,7 @@ ctx_alloc(pm)
if (pmapdebug & PDB_CTX_ALLOC)
printf("ctx_alloc(%p)\n", pm);
#endif
- if (CPU_ISSUN4OR4C) {
+ if (CPU_ISSUN4OR4COR4E) {
gap_start = pm->pm_gap_start;
gap_end = pm->pm_gap_end;
}
@@ -1762,7 +1765,7 @@ ctx_alloc(pm)
#endif
c->c_pmap->pm_ctx = NULL;
doflush = (CACHEINFO.c_vactype != VAC_NONE);
- if (CPU_ISSUN4OR4C) {
+ if (CPU_ISSUN4OR4COR4E) {
if (gap_start < c->c_pmap->pm_gap_start)
gap_start = c->c_pmap->pm_gap_start;
if (gap_end > c->c_pmap->pm_gap_end)
@@ -1774,7 +1777,7 @@ ctx_alloc(pm)
pm->pm_ctx = c;
pm->pm_ctxnum = cnum;
- if (CPU_ISSUN4OR4C) {
+ if (CPU_ISSUN4OR4COR4E) {
/*
* Write pmap's region (3-level MMU) or segment table into
* the MMU.
@@ -1899,6 +1902,7 @@ ctx_free(pm)
setcontext4m(0);
#endif
} else {
+#if defined(SUN4) || defined(SUN4C) || defined(SUN4E)
oldc = getcontext4();
if (CACHEINFO.c_vactype != VAC_NONE) {
newc = pm->pm_ctxnum;
@@ -1908,6 +1912,7 @@ ctx_free(pm)
} else {
CHANGE_CONTEXTS(oldc, 0);
}
+#endif
}
c->c_nextfree = ctx_freelist;
@@ -1952,7 +1957,7 @@ ctx_free(pm)
* status stick.
*/
-#if defined(SUN4) || defined(SUN4C)
+#if defined(SUN4) || defined(SUN4C) || defined(SUN4E)
void
pv_changepte4_4c(pv0, bis, bic)
@@ -2625,14 +2630,14 @@ pg_flushcache(struct vm_page *pg)
* At last, pmap code.
*/
-#if defined(SUN4) && defined(SUN4C)
+#if (defined(SUN4) || defined(SUN4E)) && defined(SUN4C)
int nptesg;
#endif
#if defined(SUN4M)
static void pmap_bootstrap4m(void *);
#endif
-#if defined(SUN4) || defined(SUN4C)
+#if defined(SUN4) || defined(SUN4C) || defined(SUN4E)
static void pmap_bootstrap4_4c(void *, int, int, int);
#endif
@@ -2656,7 +2661,7 @@ pmap_bootstrap(int nctx, int nregion, int nsegment)
uvmexp.pagesize = nbpg;
uvm_setpagesize();
-#if defined(SUN4) && (defined(SUN4C) || defined(SUN4M))
+#if (defined(SUN4) || defined(SUN4E)) && (defined(SUN4C) || defined(SUN4D) || defined(SUN4M))
/* In this case NPTESG is not a #define */
nptesg = (NBPSG >> uvmexp.pageshift);
#endif
@@ -2675,8 +2680,8 @@ pmap_bootstrap(int nctx, int nregion, int nsegment)
#if defined(SUN4M)
pmap_bootstrap4m(p);
#endif
- } else if (CPU_ISSUN4OR4C) {
-#if defined(SUN4) || defined(SUN4C)
+ } else if (CPU_ISSUN4OR4COR4E) {
+#if defined(SUN4) || defined(SUN4C) || defined(SUN4E)
pmap_bootstrap4_4c(p, nctx, nregion, nsegment);
#endif
}
@@ -2684,7 +2689,7 @@ pmap_bootstrap(int nctx, int nregion, int nsegment)
pmap_page_upload();
}
-#if defined(SUN4) || defined(SUN4C)
+#if defined(SUN4) || defined(SUN4C) || defined(SUN4E)
void
pmap_bootstrap4_4c(void *top, int nctx, int nregion, int nsegment)
{
@@ -2716,6 +2721,7 @@ pmap_bootstrap4_4c(void *top, int nctx, int nregion, int nsegment)
switch (cputyp) {
case CPU_SUN4C:
+ case CPU_SUN4E:
mmu_has_hole = 1;
break;
case CPU_SUN4:
@@ -3094,7 +3100,7 @@ pmap_bootstrap4m(void *top)
*/
va2pa_offset = (vaddr_t)kernel_text - VA2PA(kernel_text);
-#if defined(SUN4) || defined(SUN4C) /* setup 4M fn. ptrs for dual-arch kernel */
+#if defined(SUN4) || defined(SUN4C) || defined(SUN4E) /* setup 4M fn. ptrs for dual-arch kernel */
pmap_clear_modify_p = pmap_clear_modify4m;
pmap_clear_reference_p = pmap_clear_reference4m;
pmap_copy_page_p = pmap_copy_page4m;
@@ -3109,7 +3115,7 @@ pmap_bootstrap4m(void *top)
pmap_changeprot_p = pmap_changeprot4m;
pmap_rmk_p = pmap_rmk4m;
pmap_rmu_p = pmap_rmu4m;
-#endif /* defined Sun4/Sun4c */
+#endif /* SUN4 || SUN4C || SUN4E */
/*
* Initialize the kernel pmap.
@@ -3560,7 +3566,7 @@ pmap_create()
pm->pm_refcount = 1;
pm->pm_regmap = urp;
- if (CPU_ISSUN4OR4C) {
+ if (CPU_ISSUN4OR4COR4E) {
TAILQ_INIT(&pm->pm_seglist);
#if defined(SUN4_MMU3L)
TAILQ_INIT(&pm->pm_reglist);
@@ -3646,7 +3652,7 @@ pmap_release(pm)
printf("pmap_release(%p)\n", pm);
#endif
- if (CPU_ISSUN4OR4C) {
+ if (CPU_ISSUN4OR4COR4E) {
#if defined(SUN4_MMU3L)
if (!TAILQ_EMPTY(&pm->pm_reglist))
panic("pmap_release: region list not empty");
@@ -3829,7 +3835,7 @@ pmap_kremove(va, len)
* These are egregiously complicated routines.
*/
-#if defined(SUN4) || defined(SUN4C)
+#if defined(SUN4) || defined(SUN4C) || defined(SUN4E)
/* remove from kernel */
void
@@ -4026,7 +4032,7 @@ pmap_rmk4m(pm, va, endva, vr, vs)
#define PMAP_RMU_MAGIC 4 /* if > magic, use cache_flush_segment */
#endif
-#if defined(SUN4) || defined(SUN4C)
+#if defined(SUN4) || defined(SUN4C) || defined(SUN4E)
/* remove from user */
void
@@ -4312,7 +4318,7 @@ pmap_rmu4m(pm, va, endva, vr, vs)
* to read-only (in which case pv_changepte does the trick).
*/
-#if defined(SUN4) || defined(SUN4C)
+#if defined(SUN4) || defined(SUN4C) || defined(SUN4E)
void
pmap_page_protect4_4c(struct vm_page *pg, vm_prot_t prot)
{
@@ -4984,7 +4990,7 @@ out:
* XXX should have different entry points for changing!
*/
-#if defined(SUN4) || defined(SUN4C)
+#if defined(SUN4) || defined(SUN4C) || defined(SUN4E)
int
pmap_enter4_4c(pm, va, pa, prot, flags)
@@ -5712,7 +5718,7 @@ pmap_unwire(pm, va)
* GRR, the vm code knows; we should not have to do this!
*/
-#if defined(SUN4) || defined(SUN4C)
+#if defined(SUN4) || defined(SUN4C) || defined(SUN4E)
boolean_t
pmap_extract4_4c(pm, va, pa)
struct pmap *pm;
@@ -5848,7 +5854,7 @@ pmap_extract4m(pm, va, pa)
}
#endif /* sun4m */
-#if defined(SUN4) || defined(SUN4C)
+#if defined(SUN4) || defined(SUN4C) || defined(SUN4E)
/*
* Clear the modify bit for the given physical page.
@@ -5994,7 +6000,7 @@ pmap_is_referenced4m(struct vm_page *pg)
* XXX might be faster to use destination's context and allow cache to fill?
*/
-#if defined(SUN4) || defined(SUN4C)
+#if defined(SUN4) || defined(SUN4C) || defined(SUN4E)
void
pmap_zero_page4_4c(struct vm_page *pg)
@@ -6198,7 +6204,7 @@ kvm_setcache(va, npages, cached)
#endif
} else {
-#if defined(SUN4) || defined(SUN4C)
+#if defined(SUN4) || defined(SUN4C) || defined(SUN4E)
ctx = getcontext4();
setcontext4(0);
for (; --npages >= 0; va += NBPG) {
@@ -6241,7 +6247,7 @@ pmap_prefer(foff, vap)
vaddr_t va = *vap;
long d, m;
-#if defined(SUN4) || defined(SUN4C)
+#if defined(SUN4) || defined(SUN4C) || defined(SUN4E)
if (VA_INHOLE(va))
va = MMU_HOLE_END;
#endif
@@ -6258,7 +6264,7 @@ pmap_prefer(foff, vap)
void
pmap_remove_holes(struct vm_map *map)
{
-#if defined(SUN4) || defined(SUN4C)
+#if defined(SUN4) || defined(SUN4C) || defined(SUN4E)
if (mmu_has_hole) {
vaddr_t shole, ehole;
@@ -6285,8 +6291,8 @@ pmap_redzone()
return;
}
#endif
-#if defined(SUN4) || defined(SUN4C)
- if (CPU_ISSUN4OR4C) {
+#if defined(SUN4) || defined(SUN4C) || defined(SUN4E)
+ if (CPU_ISSUN4OR4COR4E) {
setpte4(KERNBASE, 0);
return;
}
@@ -6498,7 +6504,7 @@ pmap_dumpsize()
sz = ALIGN(sizeof(kcore_seg_t)) + ALIGN(sizeof(cpu_kcore_hdr_t));
sz += npmemarr * sizeof(phys_ram_seg_t);
- if (CPU_ISSUN4OR4C)
+ if (CPU_ISSUN4OR4COR4E)
sz += (seginval + 1) * NPTESG * sizeof(int);
return (atop(sz));
@@ -6521,7 +6527,7 @@ pmap_dumpmmu(dump, blkno)
int i, memsegoffset, pmegoffset;
int buffer[dbtob(1) / sizeof(int)];
int *bp, *ep;
-#if defined(SUN4C) || defined(SUN4)
+#if defined(SUN4) || defined(SUN4C) || defined(SUN4E)
int pmeg;
#endif
@@ -6558,7 +6564,7 @@ pmap_dumpmmu(dump, blkno)
kcpup->cputype = cputyp;
kcpup->nmemseg = npmemarr;
kcpup->memsegoffset = memsegoffset = ALIGN(sizeof(cpu_kcore_hdr_t));
- kcpup->npmeg = (CPU_ISSUN4OR4C) ? seginval + 1 : 0;
+ kcpup->npmeg = (CPU_ISSUN4OR4COR4E) ? seginval + 1 : 0;
kcpup->pmegoffset = pmegoffset =
memsegoffset + npmemarr * sizeof(phys_ram_seg_t);
@@ -6580,7 +6586,7 @@ pmap_dumpmmu(dump, blkno)
if (CPU_ISSUN4M)
goto out;
-#if defined(SUN4C) || defined(SUN4)
+#if defined(SUN4) || defined(SUN4C) || defined(SUN4E)
/*
* dump page table entries
*
@@ -6651,8 +6657,8 @@ pmap_writetext(dst, ch)
setpgt4m(ptep, pte0);
}
#endif
-#if defined(SUN4) || defined(SUN4C)
- if (CPU_ISSUN4C || CPU_ISSUN4) {
+#if defined(SUN4) || defined(SUN4C) || defined(SUN4E)
+ if (CPU_ISSUN4OR4COR4E) {
pte0 = getpte4(va);
if ((pte0 & PG_V) == 0) {
splx(s);
diff --git a/sys/arch/sparc/sparc/trap.c b/sys/arch/sparc/sparc/trap.c
index f9790fb4c2b..71e425a0944 100644
--- a/sys/arch/sparc/sparc/trap.c
+++ b/sys/arch/sparc/sparc/trap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: trap.c,v 1.53 2008/01/06 21:15:58 miod Exp $ */
+/* $OpenBSD: trap.c,v 1.54 2010/07/10 19:32:25 miod Exp $ */
/* $NetBSD: trap.c,v 1.58 1997/09/12 08:55:01 pk Exp $ */
/*
@@ -628,7 +628,7 @@ mem_access_fault(type, ser, v, pc, psr, tf)
int pc, psr;
struct trapframe *tf;
{
-#if defined(SUN4) || defined(SUN4C)
+#if defined(SUN4) || defined(SUN4C) || defined(SUN4E)
struct proc *p;
struct vmspace *vm;
vaddr_t va;
@@ -760,7 +760,7 @@ out:
userret(p);
share_fpu(p, tf);
}
-#endif /* Sun4/Sun4C */
+#endif /* SUN4 || SUN4C || SUN4E */
}
#if defined(SUN4M) /* 4m version of mem_access_fault() follows */