summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorpk <pk@NetBSD.org>1995-06-26 22:36:32 +0000
committerpk <pk@NetBSD.org>1995-06-26 22:36:32 +0000
commitaffbc4d346309ddea7cac08598a421476961855c (patch)
tree83caa18251ee98a94845ed48abb0021d6d8a8869 /sys
parent81447b832254f66b6918561f6f22dc197fae266e (diff)
Define variables and macros for DVMA allocation using rmaps.
Diffstat (limited to 'sys')
-rw-r--r--sys/arch/sparc/include/param.h26
1 files changed, 25 insertions, 1 deletions
diff --git a/sys/arch/sparc/include/param.h b/sys/arch/sparc/include/param.h
index a1c2959d7dd..55c3f1f61b9 100644
--- a/sys/arch/sparc/include/param.h
+++ b/sys/arch/sparc/include/param.h
@@ -1,4 +1,4 @@
-/* $NetBSD: param.h,v 1.14 1995/06/26 06:56:14 cgd Exp $ */
+/* $NetBSD: param.h,v 1.15 1995/06/26 22:36:32 pk Exp $ */
/*
* Copyright (c) 1992, 1993
@@ -157,6 +157,30 @@ extern int nbpg, pgofset, pgshift;
*/
#define bdbtofsb(bn) ((bn) / (BLKDEV_IOSIZE / DEV_BSIZE))
+/*
+ * dvmamap manages a range of DVMA addresses intended to create double
+ * mappings of physical memory. In a way, `dvmamap' is a submap of the
+ * VM map `phys_map'. The difference is the use of the `resource map'
+ * routines to manage page allocation, allowing DVMA addresses to be
+ * allocated and freed from within interrupt routines.
+ *
+ * Note that `phys_map' can still be used to allocate memory-backed pages
+ * in DVMA space.
+ */
+#ifdef _KERNEL
+#ifndef LOCORE
+extern vm_offset_t dvmabase;
+extern struct map *dvmamap;
+#endif
+#endif
+/*
+ * The dvma resource map is defined in page units, which are numbered 1 to N.
+ * Use these macros to convert to/from virtual addresses.
+ */
+#define rctov(n) (ctob(((n)-1))+dvmabase)
+#define vtorc(v) ((btoc((v)-dvmabase))+1)
+
+
#ifdef _KERNEL
#ifndef LOCORE
#define DELAY(n) delay(n)