From affbc4d346309ddea7cac08598a421476961855c Mon Sep 17 00:00:00 2001 From: pk Date: Mon, 26 Jun 1995 22:36:32 +0000 Subject: [PATCH] Define variables and macros for DVMA allocation using rmaps. --- sys/arch/sparc/include/param.h | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/sys/arch/sparc/include/param.h b/sys/arch/sparc/include/param.h index a1c2959d7dd8..55c3f1f61b97 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)