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
This commit is contained in:
dfr 2000-05-28 15:49:55 +00:00
parent 2858982d35
commit 3d3263476e
6 changed files with 44 additions and 25 deletions

View File

@ -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 @@ pmap_enter_quick(pmap_t pmap, vm_offset_t va, vm_page_t m, vm_page_t mpte)
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

View File

@ -2240,6 +2240,17 @@ pmap_enter_quick(pmap, va, m, mpte)
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

View File

@ -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);

View File

@ -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);

View File

@ -2240,6 +2240,17 @@ pmap_enter_quick(pmap, va, m, mpte)
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

View File

@ -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 */