diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 1995-12-15 13:56:49 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 1995-12-15 13:56:49 +0000 |
commit | e4e83e0395766865b32e31ffd4c99492e95021a9 (patch) | |
tree | 3cdf19cc2481595d362927e4907c24c03ed2cea4 /sys/arch/sparc/include | |
parent | 52870c9193cefaa9a2f79fab1b0a1e8076290b55 (diff) |
new mapdev/()/mapiodev() calling convention uses "struct rom_reg *" to supply
base plus an offset
new dvma routines
Diffstat (limited to 'sys/arch/sparc/include')
-rw-r--r-- | sys/arch/sparc/include/autoconf.h | 21 | ||||
-rw-r--r-- | sys/arch/sparc/include/param.h | 15 | ||||
-rw-r--r-- | sys/arch/sparc/include/vmparam.h | 6 |
3 files changed, 36 insertions, 6 deletions
diff --git a/sys/arch/sparc/include/autoconf.h b/sys/arch/sparc/include/autoconf.h index 08b44eb4407..4cb7f4b25f6 100644 --- a/sys/arch/sparc/include/autoconf.h +++ b/sys/arch/sparc/include/autoconf.h @@ -138,13 +138,30 @@ char *clockfreq __P((int freq)); * it will use that instead of creating one, but you must only do this if * you get it from ../sparc/vaddrs.h. */ -void *mapdev __P((void *pa, int va, int size, int bustype)); -#define mapiodev(pa, size, bustype) mapdev(pa, 0, size, bustype) +void *mapdev __P((struct rom_reg *rr, int va, int offset, + int size, int bustype)); +#define mapiodev(rr, offset, size, bustype) mapdev(rr, 0, offset, size, bustype) void *bus_map __P((void *pa, int len, int bustype)); void *bus_tmp __P((void *pa, int bustype)); void bus_untmp __P((void)); +#ifdef notyet +/* + * REG2PHYS is provided for drivers with a `d_mmap' function. + */ +#define REG2PHYS(rr, offset, bt) \ + (((u_int)(rr)->rr_paddr + (offset)) | \ + ((cputyp == CPU_SUN4M) \ + ? ((rr)->rr_iospace << PMAP_SHFT4M) \ + : bt2pmt[bt]) \ + ) +#else +#define REG2PHYS(rr, offset, bt) \ + (((u_int)(rr)->rr_paddr + (offset)) | (bt2pmt[bt]) \ + ) +#endif + /* * Memory description arrays. Shared between pmap.c and autoconf.c; no * one else should use this (except maybe mem.c, e.g., if we fix the VM to diff --git a/sys/arch/sparc/include/param.h b/sys/arch/sparc/include/param.h index c62dfcfe3cb..da5231519df 100644 --- a/sys/arch/sparc/include/param.h +++ b/sys/arch/sparc/include/param.h @@ -169,16 +169,21 @@ extern int nbpg, pgofset, pgshift; */ #ifdef _KERNEL #ifndef LOCORE -extern vm_offset_t dvmabase; +extern vm_offset_t dvma_base; +extern vm_offset_t dvma_end; 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) +#define rctov(n) (ctob(((n)-1))+dvma_base) +#define vtorc(v) ((btoc((v)-dvma_base))+1) + +extern caddr_t kdvma_mapin __P((caddr_t, int, int)); +extern caddr_t dvma_malloc __P((size_t, void *, int)); +extern void dvma_free __P((caddr_t, size_t, void *)); +#endif #ifdef _KERNEL @@ -188,9 +193,11 @@ extern struct map *dvmamap; #endif #ifdef _KERNEL +#ifndef LOCORE extern int cputyp; extern int cpumod; #endif +#endif /* * Values for the cputyp variable. */ diff --git a/sys/arch/sparc/include/vmparam.h b/sys/arch/sparc/include/vmparam.h index 989f8272933..ef899abd76a 100644 --- a/sys/arch/sparc/include/vmparam.h +++ b/sys/arch/sparc/include/vmparam.h @@ -139,3 +139,9 @@ #define VM_KMEM_SIZE (NKMEMCLUSTERS*CLBYTES) #define MACHINE_NONCONTIG /* VM <=> pmap interface modifier */ + +#if defined (_KERNEL) && !defined(LOCORE) +struct vm_map; +vm_offset_t dvma_mapin __P((struct vm_map *, vm_offset_t, int, int)); +int dvma_mapout __P((vm_offset_t, vm_offset_t, int)); +#endif |