summaryrefslogtreecommitdiff
path: root/sys/arch/sun3/include
diff options
context:
space:
mode:
authorMichael Shalayeff <mickey@cvs.openbsd.org>1996-05-03 16:05:01 +0000
committerMichael Shalayeff <mickey@cvs.openbsd.org>1996-05-03 16:05:01 +0000
commitf19f6f3c1fb3e32d0ec3a2cfc1155f5773773fac (patch)
treeebc4f86aa5ec5a8abcda7997297093a14dfb8d0b /sys/arch/sun3/include
parentcb307111a88f57667598461d6faaf39bff1ef2f8 (diff)
sync with 0430.
Diffstat (limited to 'sys/arch/sun3/include')
-rw-r--r--sys/arch/sun3/include/autoconf.h13
-rw-r--r--sys/arch/sun3/include/dvma.h39
-rw-r--r--sys/arch/sun3/include/obio.h5
-rw-r--r--sys/arch/sun3/include/param.h19
-rw-r--r--sys/arch/sun3/include/pmap.h5
-rw-r--r--sys/arch/sun3/include/psl.h6
-rw-r--r--sys/arch/sun3/include/z8530var.h23
7 files changed, 48 insertions, 62 deletions
diff --git a/sys/arch/sun3/include/autoconf.h b/sys/arch/sun3/include/autoconf.h
index 60b7e477c24..9b90ac4c081 100644
--- a/sys/arch/sun3/include/autoconf.h
+++ b/sys/arch/sun3/include/autoconf.h
@@ -1,4 +1,4 @@
-/* $NetBSD: autoconf.h,v 1.9 1995/01/11 20:38:33 gwr Exp $ */
+/* $NetBSD: autoconf.h,v 1.10 1996/03/26 15:16:28 gwr Exp $ */
/*
* Copyright (c) 1994 Gordon W. Ross
@@ -41,8 +41,6 @@
#define BUS_OBIO 1 /* "obio" */
#define BUS_VME16 2 /* "vmes" */
#define BUS_VME32 3 /* "vmel" */
-/* These are pseudo buses: */
-#define BUS_OBCTL 4
/*
* This is the "args" parameter to the bus match/attach functions.
@@ -54,8 +52,13 @@ struct confargs {
int ca_intvec; /* interrupt vector index */
};
-int always_match __P((struct device *, void *, void *));
-void bus_scan __P((struct device *, void *, int));
+/* Locator aliases */
+#define cf_paddr cf_loc[0]
+#define cf_intpri cf_loc[1]
+#define cf_intvec cf_loc[2]
+
+int bus_scan __P((struct device *, void *, void *));
int bus_print __P((void *, char *));
int bus_peek __P((int, int, int));
char * bus_mapin __P((int, int, int));
+
diff --git a/sys/arch/sun3/include/dvma.h b/sys/arch/sun3/include/dvma.h
index a48a2a19672..abe533fc5c3 100644
--- a/sys/arch/sun3/include/dvma.h
+++ b/sys/arch/sun3/include/dvma.h
@@ -1,4 +1,4 @@
-/* $NetBSD: dvma.h,v 1.1 1995/09/26 04:02:08 gwr Exp $ */
+/* $NetBSD: dvma.h,v 1.3 1996/02/20 22:06:28 gwr Exp $ */
/*
* Copyright (c) 1995 Gordon W. Ross
@@ -54,25 +54,9 @@
*/
/*
- * This range could be managed as whole MMU segments.
- * The last segment is pre-allocated (see below)
- */
-#define DVMA_SEGMAP_BASE 0x0FF00000
-#define DVMA_SEGMAP_SIZE 0x000E0000
-#define DVMA_SEGMAP_END (DVMA_SEGMAP_BASE+DVMA_SEGMAP_SIZE)
-
-/*
- * This range is managed as individual pages.
- * The last page is owned by the PROM monitor.
- */
-#define DVMA_PAGEMAP_BASE 0x0FFE0000
-#define DVMA_PAGEMAP_SIZE 0x0001E000
-#define DVMA_PAGEMAP_END (DVMA_PAGEMAP_BASE+DVMA_PAGEMAP_SIZE)
-
-/*
* To convert an address in DVMA space to a slave address,
* just use a logical AND with one of the following masks.
- * To convert back, use logical OR with DVMA_SEGMAP_BASE.
+ * To convert back, just logical OR with the base address.
*/
#define DVMA_OBIO_SLAVE_BASE 0x0F000000
#define DVMA_OBIO_SLAVE_MASK 0x00FFffff /* 16MB */
@@ -81,25 +65,18 @@
#define DVMA_VME_SLAVE_MASK 0x000Fffff /* 1MB */
-#if 1 /* XXX - temporary */
-/*
- * XXX - For compatibility, until DVMA is re-worked.
- * Total DVMA space covers SEGMAP + PAGEMAP
- */
-#define DVMA_SPACE_START DVMA_SEGMAP_BASE
-#define DVMA_SPACE_END DVMA_PAGEMAP_END
-#define DVMA_SPACE_SIZE (DVMA_SPACE_END - DVMA_SPACE_START)
-#endif /* XXX */
-
-/*
- * XXX - These will change! (will be like the sparc)
- */
+/* DVMA is the last 1MB, but the PROM gets the last page. */
+#define DVMA_SPACE_START 0x0FF00000
+#define DVMA_SPACE_END 0x0FFFE000
+/* Allocate/free actual pages of DVMA space. */
caddr_t dvma_malloc(size_t bytes);
void dvma_free(caddr_t addr, size_t bytes);
+/* Remap/unmap kernel memory in DVMA space. */
caddr_t dvma_mapin(char *kva, int len);
void dvma_mapout(caddr_t dvma_addr, int len);
+/* Convert a kernel DVMA pointer to a slave address. */
long dvma_kvtopa(long kva, int bus);
diff --git a/sys/arch/sun3/include/obio.h b/sys/arch/sun3/include/obio.h
index 414726fdbcd..b348e2e2f7a 100644
--- a/sys/arch/sun3/include/obio.h
+++ b/sys/arch/sun3/include/obio.h
@@ -1,4 +1,4 @@
-/* $NetBSD: obio.h,v 1.13 1994/12/12 18:59:42 gwr Exp $ */
+/* $NetBSD: obio.h,v 1.14 1996/03/26 15:16:32 gwr Exp $ */
/*
* Copyright (c) 1993 Adam Glass
@@ -71,7 +71,10 @@
#define OBIO_DES_SIZE 0x00004
#define OBIO_ECCREG_SIZE 0x00100
+#ifdef _KERNEL
+
caddr_t obio_alloc __P((int, int));
caddr_t obio_vm_alloc __P((int));
caddr_t obio_find_mapping __P((int pa, int size));
+#endif /* _KERNEL */
diff --git a/sys/arch/sun3/include/param.h b/sys/arch/sun3/include/param.h
index aaaa50cd1aa..561a62fd55e 100644
--- a/sys/arch/sun3/include/param.h
+++ b/sys/arch/sun3/include/param.h
@@ -1,4 +1,4 @@
-/* $NetBSD: param.h,v 1.30 1995/11/10 22:04:48 gwr Exp $ */
+/* $NetBSD: param.h,v 1.34 1996/03/04 05:04:40 cgd Exp $ */
/*
* Copyright (c) 1994, 1995 Gordon W. Ross
@@ -48,7 +48,9 @@
/*
* Machine dependent constants for the Sun3 series.
*/
+#define _MACHINE sun3
#define MACHINE "sun3"
+#define _MACHINE_ARCH m68k
#define MACHINE_ARCH "m68k"
#define MID_MACHINE MID_M68K
@@ -149,17 +151,10 @@
/* XXX - Does this really belong here? -gwr */
#include <machine/psl.h>
-#ifdef _KERNEL
-#ifndef LOCORE
+#if defined(_KERNEL) && !defined(_LOCORE)
+extern void _delay __P((unsigned));
+#define delay(us) _delay((us)<<8)
#define DELAY(n) delay(n)
-extern int cpuspeed;
-static inline void delay2us()
-{
- register int n = cpuspeed;
-
- __asm __volatile ("0: subql #4,%0; jgt 0b" : "=d" (n) : "0" (n));
-}
-#endif /* !LOCORE */
-#endif /* _KERNEL */
+#endif /* _KERNEL && !_LOCORE */
#endif /* MACHINE */
diff --git a/sys/arch/sun3/include/pmap.h b/sys/arch/sun3/include/pmap.h
index 275fdce7255..d4def4b5237 100644
--- a/sys/arch/sun3/include/pmap.h
+++ b/sys/arch/sun3/include/pmap.h
@@ -1,4 +1,4 @@
-/* $NetBSD: pmap.h,v 1.13 1995/04/10 12:42:29 mycroft Exp $ */
+/* $NetBSD: pmap.h,v 1.14 1996/02/28 22:50:43 gwr Exp $ */
/*
* Copyright (c) 1994 Gordon W. Ross
@@ -59,6 +59,9 @@ struct pmap kernel_pmap_store;
#define PMAP_DEACTIVATE(pmap, pcbp) \
pmap_deactivate(pmap, pcbp)
+extern void pmap_prefer(vm_offset_t, vm_offset_t *);
+#define PMAP_PREFER(fo, ap) pmap_prefer((fo), (ap))
+
/* XXX - Need a (silly) #define get code in kern_sysctl.c */
extern segsz_t pmap_resident_pages(pmap_t);
#define pmap_resident_count(pmap) pmap_resident_pages(pmap)
diff --git a/sys/arch/sun3/include/psl.h b/sys/arch/sun3/include/psl.h
index d716133399c..0419d103f3f 100644
--- a/sys/arch/sun3/include/psl.h
+++ b/sys/arch/sun3/include/psl.h
@@ -1,4 +1,4 @@
-/* $NetBSD: psl.h,v 1.8 1995/10/10 21:28:00 gwr Exp $ */
+/* $NetBSD: psl.h,v 1.9 1996/02/01 22:33:10 mycroft Exp $ */
/*
* Copyright (c) 1995 Gordon W. Ross
@@ -35,7 +35,7 @@
/* Could define this in the common <m68k/psl.h> instead. */
-#if defined(_KERNEL) && !defined(LOCORE)
+#if defined(_KERNEL) && !defined(_LOCORE)
#ifndef __GNUC__
/* No inline, use real function in locore.s */
@@ -102,5 +102,5 @@ extern __inline__ int _spl(int new)
#define splhigh() spl7()
#define splsched() spl7()
-#endif /* KERNEL && !LOCORE */
+#endif /* KERNEL && !_LOCORE */
#endif /* PSL_C */
diff --git a/sys/arch/sun3/include/z8530var.h b/sys/arch/sun3/include/z8530var.h
index 9eb9551daf2..86f029efcff 100644
--- a/sys/arch/sun3/include/z8530var.h
+++ b/sys/arch/sun3/include/z8530var.h
@@ -1,4 +1,4 @@
-/* $NetBSD: z8530var.h,v 1.2 1996/01/24 22:40:48 gwr Exp $ */
+/* $NetBSD: z8530var.h,v 1.3 1996/01/30 22:35:04 gwr Exp $ */
/*
* Copyright (c) 1994 Gordon W. Ross
@@ -48,16 +48,21 @@
#include <dev/ic/z8530sc.h>
/*
- * Macros to read and write individual registers (except 0) in a channel.
- * The ZS chip requires a 1.6 uSec. recovery time between accesses, and
- * the Sun3 hardware does NOT take care of this for you.
+ * Functions to read and write individual registers in a channel.
+ * The ZS chip requires a 1.6 uSec. recovery time between accesses,
+ * and the Sun3 hardware does NOT take care of this for you.
+ * The delay is now handled inside the chip access functions.
+ * These could be inlines, but with the delay, speed is moot.
*/
-#define ZS_READ(c, r) zs_read_reg(c, r)
-#define ZS_WRITE(c, r, v) zs_write_reg(c, r, v)
-#define ZS_DELAY() delay2us()
-u_char zs_read_reg __P((struct zs_chanstate *zc, u_char reg));
-void zs_write_reg __P((struct zs_chanstate *zc, u_char reg, u_char val));
+u_char zs_read_reg __P((struct zs_chanstate *cs, u_char reg));
+u_char zs_read_csr __P((struct zs_chanstate *cs));
+u_char zs_read_data __P((struct zs_chanstate *cs));
+
+void zs_write_reg __P((struct zs_chanstate *cs, u_char reg, u_char val));
+void zs_write_csr __P((struct zs_chanstate *cs, u_char val));
+void zs_write_data __P((struct zs_chanstate *cs, u_char val));
+
/*
* How to request a "soft" interrupt.