diff options
author | dfr <dfr@FreeBSD.org> | 2000-05-28 15:49:55 +0000 |
---|---|---|
committer | dfr <dfr@FreeBSD.org> | 2000-05-28 15:49:55 +0000 |
commit | 3d3263476ea3c9efbc1896de413e89bb3ca6ac2c (patch) | |
tree | d5c2ad0fe38d67d689415b5cd18c8352133ddc8b | |
parent | 2858982d35973c53f73d984305943bce4dfbcbf7 (diff) | |
download | FreeBSD-src-3d3263476ea3c9efbc1896de413e89bb3ca6ac2c.zip FreeBSD-src-3d3263476ea3c9efbc1896de413e89bb3ca6ac2c.tar.gz |
Add a new pmap entry point, pmap_enter_temporary() to be used during
dumps to create temporary page mappings. This replaces the use of CADDR1
which is fairly x86 specific.
Reviewed by: dillon
-rw-r--r-- | sys/alpha/alpha/pmap.c | 30 | ||||
-rw-r--r-- | sys/amd64/amd64/pmap.c | 11 | ||||
-rw-r--r-- | sys/cam/scsi/scsi_da.c | 9 | ||||
-rw-r--r-- | sys/dev/ata/ata-disk.c | 7 | ||||
-rw-r--r-- | sys/i386/i386/pmap.c | 11 | ||||
-rw-r--r-- | sys/vm/pmap.h | 1 |
6 files changed, 44 insertions, 25 deletions
diff --git a/sys/alpha/alpha/pmap.c b/sys/alpha/alpha/pmap.c index 4ff1d08..da127c6 100644 --- a/sys/alpha/alpha/pmap.c +++ b/sys/alpha/alpha/pmap.c @@ -90,9 +90,7 @@ * should the kernel Lev1map be inserted into this object?). * * pvtmmap is not needed for alpha since K0SEG maps all of physical - * memory. CADDR1 and CADDR2 are not needed for the same reason. The - * only places outside pmap and machdep which use CADDR1 are xxdump - * routines which use them for dumping physical pages. + * memory. * * * alpha virtual memory map: @@ -341,14 +339,6 @@ static int pv_entry_count=0, pv_entry_max=0, pv_entry_high_water=0; static int pmap_pagedaemon_waken = 0; static struct pv_entry *pvinit; -/* - * All those kernel PT submaps that BSD is so fond of - */ -pt_entry_t *CMAP1 = 0; -static pt_entry_t *CMAP2; -caddr_t CADDR1; -static caddr_t CADDR2; - static PMAP_INLINE void free_pv_entry __P((pv_entry_t pv)); static pv_entry_t get_pv_entry __P((void)); static void alpha_protection_init __P((void)); @@ -578,16 +568,8 @@ pmap_bootstrap(vm_offset_t ptaddr, u_int maxasn) va = virtual_avail; pte = pmap_lev3pte(kernel_pmap, va); - /* - * CMAP1/CMAP2 are used for zeroing and copying pages. - */ - SYSMAP(caddr_t, CMAP1, CADDR1, 1) - SYSMAP(caddr_t, CMAP2, CADDR2, 1) - virtual_avail = va; - *CMAP1 = *CMAP2 = 0; - /* * Set up proc0's PCB such that the ptbr points to the right place * and has the kernel pmap's. @@ -2219,6 +2201,16 @@ retry: return mpte; } +/* + * Make temporary mapping for a physical address. This is called + * during dump. + */ +vm_offset_t +pmap_enter_temporary(vm_offset_t pa, vm_prot_t prot) +{ + return ALPHA_PHYS_TO_K0SEG(pa); +} + #define MAX_INIT_PT (96) /* * pmap_object_init_pt preloads the ptes for a given object diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c index d1c7e8e..55ea81f 100644 --- a/sys/amd64/amd64/pmap.c +++ b/sys/amd64/amd64/pmap.c @@ -2240,6 +2240,17 @@ retry: return mpte; } +/* + * Make temporary mapping for a physical address using CADDR1. This is + * called during dump. + */ +vm_offset_t +pmap_enter_temporary(vm_offset_t pa, vm_prot_t prot) +{ + pmap_enter(kernel_pmap, (vm_offset_t) CADDR1, pa, prot, TRUE); + return (vm_offset_t) CADDR1; +} + #define MAX_INIT_PT (96) /* * pmap_object_init_pt preloads the ptes for a given object diff --git a/sys/cam/scsi/scsi_da.c b/sys/cam/scsi/scsi_da.c index f7fdd55..f41c038 100644 --- a/sys/cam/scsi/scsi_da.c +++ b/sys/cam/scsi/scsi_da.c @@ -631,11 +631,14 @@ dadump(dev_t dev) blkcnt = howmany(PAGE_SIZE, secsize); while (num > 0) { + vm_offset_t va; if (is_physical_memory(addr)) { - pmap_kenter((vm_offset_t)CADDR1, trunc_page(addr)); + va = pmap_enter_temporary(trunc_page(addr), + VM_PROT_READ); } else { - pmap_kenter((vm_offset_t)CADDR1, trunc_page(0)); + va = pmap_enter_temporary(trunc_page(0), + VM_PROT_READ); } xpt_setup_ccb(&csio.ccb_h, periph->path, /*priority*/1); @@ -649,7 +652,7 @@ dadump(dev_t dev) /*minimum_cmd_size*/ softc->minimum_cmd_size, blknum, blkcnt, - /*data_ptr*/CADDR1, + /*data_ptr*/(u_int8_t *) va, /*dxfer_len*/blkcnt * secsize, /*sense_len*/SSD_FULL_SIZE, DA_DEFAULT_TIMEOUT * 1000); diff --git a/sys/dev/ata/ata-disk.c b/sys/dev/ata/ata-disk.c index a1cb3aa..8a74e83 100644 --- a/sys/dev/ata/ata-disk.c +++ b/sys/dev/ata/ata-disk.c @@ -272,17 +272,18 @@ addump(dev_t dev) ata_reinit(adp->controller); while (count > 0) { + vm_offset_t va; DELAY(1000); if (is_physical_memory(addr)) - pmap_kenter((vm_offset_t)CADDR1, trunc_page(addr)); + va = pmap_enter_temporary(trunc_page(addr), VM_PROT_READ); else - pmap_kenter((vm_offset_t)CADDR1, trunc_page(0)); + va = pmap_enter_temporary(trunc_page(0), VM_PROT_READ); bzero(&request, sizeof(struct ad_request)); request.device = adp; request.blockaddr = blkno; request.bytecount = PAGE_SIZE; - request.data = CADDR1; + request.data = (int8_t *) va; while (request.bytecount > 0) { ad_transfer(&request); diff --git a/sys/i386/i386/pmap.c b/sys/i386/i386/pmap.c index d1c7e8e..55ea81f 100644 --- a/sys/i386/i386/pmap.c +++ b/sys/i386/i386/pmap.c @@ -2240,6 +2240,17 @@ retry: return mpte; } +/* + * Make temporary mapping for a physical address using CADDR1. This is + * called during dump. + */ +vm_offset_t +pmap_enter_temporary(vm_offset_t pa, vm_prot_t prot) +{ + pmap_enter(kernel_pmap, (vm_offset_t) CADDR1, pa, prot, TRUE); + return (vm_offset_t) CADDR1; +} + #define MAX_INIT_PT (96) /* * pmap_object_init_pt preloads the ptes for a given object diff --git a/sys/vm/pmap.h b/sys/vm/pmap.h index 3087236..88b5631 100644 --- a/sys/vm/pmap.h +++ b/sys/vm/pmap.h @@ -140,6 +140,7 @@ void pmap_swapout_proc __P((struct proc *p)); void pmap_swapin_proc __P((struct proc *p)); void pmap_activate __P((struct proc *p)); vm_offset_t pmap_addr_hint __P((vm_object_t obj, vm_offset_t addr, vm_size_t size)); +vm_offset_t pmap_enter_temporary __P((vm_offset_t pa, vm_prot_t prot)); void pmap_init2 __P((void)); #endif /* _KERNEL */ |