diff options
author | cognet <cognet@FreeBSD.org> | 2004-11-07 23:01:36 +0000 |
---|---|---|
committer | cognet <cognet@FreeBSD.org> | 2004-11-07 23:01:36 +0000 |
commit | 103e95586ea0c1e4225a4bc7c851cf22bd979fa5 (patch) | |
tree | bd6194dbac8ef344d695c3a883f0f92fa9bc572f /sys/arm/include | |
parent | e8fd5617c522ffcbe43eca509cc8a05d0fa4ef0e (diff) | |
download | FreeBSD-src-103e95586ea0c1e4225a4bc7c851cf22bd979fa5.zip FreeBSD-src-103e95586ea0c1e4225a4bc7c851cf22bd979fa5.tar.gz |
Import md bits for mem(4) on arm.
While I'm there, cleanup a bit pmap.h.
Diffstat (limited to 'sys/arm/include')
-rw-r--r-- | sys/arm/include/memdev.h | 38 | ||||
-rw-r--r-- | sys/arm/include/pmap.h | 51 |
2 files changed, 44 insertions, 45 deletions
diff --git a/sys/arm/include/memdev.h b/sys/arm/include/memdev.h new file mode 100644 index 0000000..9cf0b4a --- /dev/null +++ b/sys/arm/include/memdev.h @@ -0,0 +1,38 @@ +/*- + * 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; +d_mmap_t memmmap; +#define memioctl (d_ioctl_t *)NULL + +void dev_mem_md_init(void); diff --git a/sys/arm/include/pmap.h b/sys/arm/include/pmap.h index a4377b1..fc870c9 100644 --- a/sys/arm/include/pmap.h +++ b/sys/arm/include/pmap.h @@ -57,31 +57,7 @@ */ #define PTE_NOCACHE 0 #define PTE_CACHE 1 - -#define VADDR(pdi, pti) ((vm_offset_t)(((pdi)<<PDR_SHIFT)+((pti)<<PAGE_SHIFT))) -#define PTDIPDE(ptd) ((ptd)/1024) -#define PTDIPTE(ptd) ((ptd)%256) - -#ifndef NKPT -#define NKPT 120 /* actual number of kernel page tables */ -#endif - -#ifndef NKPDE -#define NKPDE 1019 /* Maximum number of kernel PDE */ -#endif - -#define NPDEPTD 16 /* Number of PDE in each PTD */ - -/* - * The *PTDI values control the layout of virtual memory - */ - -#define KPTDI (NPDEPG-NKPDE) /* ptd entry for kernel space begin */ -#define PTDPTDI (KPTDI-1) /* ptd entry that points to ptd! */ -#define KPTPTDI (PTDPTDI-1) /* ptd entry for kernel PTEs */ -#define UPTPTDI (KPTPTDI-3) /* ptd entry for uspace PTEs */ -#define UMAXPTDI (UPTPTDI-1) /* ptd entry for user space end */ -#define UMAXPTEOFF (NPTEPG) /* pte entry for user space end */ +#define PTE_PAGETABLE 2 #ifndef LOCORE @@ -99,7 +75,7 @@ #define pmap_page_is_mapped(m) (!TAILQ_EMPTY(&(m)->md.pv_list)) /* - * Pmap sutff + * Pmap stuff */ /* @@ -175,6 +151,7 @@ typedef struct pmap *pmap_t; #ifdef _KERNEL extern pmap_t kernel_pmap; #define pmap_kernel() kernel_pmap + #endif @@ -192,20 +169,6 @@ typedef struct pv_entry { #define PV_ENTRY_NULL ((pv_entry_t) 0) -#define PV_CI 0x01 /* all entries must be cache inhibited */ -#define PV_PTPAGE 0x02 /* entry maps a page table page */ - -/* - * Page hooks. - * For speed we store the both the virtual address and the page table - * entry address for each page hook. - */ -typedef struct { - vm_offset_t va; - pt_entry_t *pte; -} pagehook_t; - - #ifdef _KERNEL boolean_t pmap_get_pde_pte(pmap_t, vm_offset_t, pd_entry_t **, pt_entry_t **); @@ -496,11 +459,6 @@ void pmap_use_minicache(vm_offset_t, vm_size_t); #define pmap_pte_v(pte) l2pte_valid(*(pte)) #define pmap_pte_pa(pte) l2pte_pa(*(pte)) -/* Size of the kernel part of the L1 page table */ -#define KERNEL_PD_SIZE \ - (L1_TABLE_SIZE - (KERNEL_BASE >> L1_S_SHIFT) * sizeof(pd_entry_t)) -#define PTE_PAGETABLE 2 - /* * Flags that indicate attributes of pages or mappings of pages. * @@ -542,6 +500,9 @@ const struct pmap_devmap *pmap_devmap_find_va(vm_offset_t, vm_size_t); void pmap_devmap_bootstrap(vm_offset_t, const struct pmap_devmap *); void pmap_devmap_register(const struct pmap_devmap *); + +extern char *_tmppt; + #endif /* _KERNEL */ #endif /* !LOCORE */ |