diff options
author | ssouhlal <ssouhlal@FreeBSD.org> | 2004-08-16 13:07:40 +0000 |
---|---|---|
committer | ssouhlal <ssouhlal@FreeBSD.org> | 2004-08-16 13:07:40 +0000 |
commit | 43e0cc18c44f87e4df804eeba2d1caa26db52ec3 (patch) | |
tree | b157d8deb4868d4c8be8ccfaa470af595c4ef1ef /sys/powerpc/include | |
parent | 9dc119c4b67e0952e92a5feb416e18e610733b7b (diff) | |
download | FreeBSD-src-43e0cc18c44f87e4df804eeba2d1caa26db52ec3.zip FreeBSD-src-43e0cc18c44f87e4df804eeba2d1caa26db52ec3.tar.gz |
Add /dev/mem and /dev/kmem to powerpc.
Approved by: grehan (mentor)
Diffstat (limited to 'sys/powerpc/include')
-rw-r--r-- | sys/powerpc/include/memdev.h | 40 | ||||
-rw-r--r-- | sys/powerpc/include/ofw_machdep.h | 1 | ||||
-rw-r--r-- | sys/powerpc/include/pmap.h | 2 |
3 files changed, 43 insertions, 0 deletions
diff --git a/sys/powerpc/include/memdev.h b/sys/powerpc/include/memdev.h new file mode 100644 index 0000000..69072d9 --- /dev/null +++ b/sys/powerpc/include/memdev.h @@ -0,0 +1,40 @@ +/*- + * Copyright (c) 2004 Mark R V Murray + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer + * in this position and unchanged. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#define CDEV_MAJOR 2 +#define CDEV_MINOR_MEM 0 +#define CDEV_MINOR_KMEM 1 + +d_open_t memopen; +d_read_t memrw; +#define memioctl (d_ioctl_t *)NULL +d_mmap_t memmmap; + +void dev_mem_md_init(void); + +MALLOC_DECLARE(M_MEMDEV); diff --git a/sys/powerpc/include/ofw_machdep.h b/sys/powerpc/include/ofw_machdep.h index 35b09b9..7f3aa0e 100644 --- a/sys/powerpc/include/ofw_machdep.h +++ b/sys/powerpc/include/ofw_machdep.h @@ -31,5 +31,6 @@ #include <sys/bus.h> void OF_getetheraddr(device_t dev, u_char *addr); +int mem_valid(vm_offset_t addr, int len); #endif /* _MACHINE_OFW_MACHDEP_H_ */ diff --git a/sys/powerpc/include/pmap.h b/sys/powerpc/include/pmap.h index d9013a9..16fc5c6 100644 --- a/sys/powerpc/include/pmap.h +++ b/sys/powerpc/include/pmap.h @@ -82,6 +82,8 @@ vm_offset_t pmap_kextract(vm_offset_t); int pmap_pte_spill(vm_offset_t); +int pmap_dev_direct_mapped(vm_offset_t, vm_size_t); + #define vtophys(va) pmap_kextract(((vm_offset_t)(va))) extern vm_offset_t phys_avail[]; |