Add pmap_kenter_flags(), which is used by MD bus code that will be
committed soon, add a stub form pmap_kenter_temporary(), and implement pmap_extract() and pmap_kextract().
This commit is contained in:
parent
62601deb33
commit
4bc38523ec
@ -66,6 +66,9 @@ struct pmap {
|
||||
|
||||
void pmap_bootstrap(vm_offset_t skpa, vm_offset_t ekva);
|
||||
vm_offset_t pmap_kextract(vm_offset_t va);
|
||||
void pmap_kenter_flags(vm_offset_t va, vm_offset_t pa, u_long flags);
|
||||
|
||||
#define vtophys(va) pmap_kextract(((vm_offset_t) (va)))
|
||||
|
||||
extern vm_offset_t avail_start;
|
||||
extern vm_offset_t avail_end;
|
||||
|
@ -412,6 +412,39 @@ pmap_kenter(vm_offset_t va, vm_offset_t pa)
|
||||
stp->st_tte = tte;
|
||||
}
|
||||
|
||||
/*
|
||||
* Map a wired page into kernel virtual address space. This additionally
|
||||
* takes a flag argument wich is or'ed to the TTE data. This is used by
|
||||
* bus_space_map().
|
||||
*/
|
||||
void
|
||||
pmap_kenter_flags(vm_offset_t va, vm_offset_t pa, u_long flags)
|
||||
{
|
||||
struct stte *stp;
|
||||
struct tte tte;
|
||||
|
||||
tte.tte_tag = TT_CTX(TLB_CTX_KERNEL) | TT_VA(va);
|
||||
if ((flags & TD_W) != 0)
|
||||
flags |= TD_SW;
|
||||
tte.tte_data = TD_V | TD_8K | TD_VA_LOW(va) | TD_PA(pa) |
|
||||
TD_REF | TD_P | flags;
|
||||
stp = tsb_kvtostte(va);
|
||||
CTR4(KTR_PMAP, "pmap_kenter: va=%#lx pa=%#lx stp=%p data=%#lx",
|
||||
va, pa, stp, stp->st_tte.tte_data);
|
||||
stp->st_tte = tte;
|
||||
}
|
||||
|
||||
/*
|
||||
* Make a temporary mapping for a physical address. This is only intended
|
||||
* to be used for panic dumps.
|
||||
*/
|
||||
void *
|
||||
pmap_kenter_temporary(vm_offset_t pa, int i)
|
||||
{
|
||||
|
||||
TODO;
|
||||
}
|
||||
|
||||
/*
|
||||
* Remove a wired page from kernel virtual address space.
|
||||
*/
|
||||
@ -970,15 +1003,24 @@ pmap_zero_page_area(vm_offset_t pa, int off, int size)
|
||||
vm_offset_t
|
||||
pmap_extract(pmap_t pmap, vm_offset_t va)
|
||||
{
|
||||
TODO;
|
||||
return (0);
|
||||
struct stte *stp;
|
||||
|
||||
stp = tsb_stte_lookup(pmap, va);
|
||||
if (stp == NULL)
|
||||
return (0);
|
||||
else
|
||||
return (TD_PA(stp->st_tte.tte_data) | (va & PAGE_MASK));
|
||||
}
|
||||
|
||||
vm_offset_t
|
||||
pmap_kextract(vm_offset_t va)
|
||||
{
|
||||
TODO;
|
||||
return (0);
|
||||
struct stte *stp;
|
||||
|
||||
stp = tsb_kvtostte(va);
|
||||
KASSERT((stp->st_tte.tte_data & TD_V) != 0,
|
||||
("pmap_kextract: invalid virtual address 0x%lx", va));
|
||||
return (TD_PA(stp->st_tte.tte_data) | (va & PAGE_MASK));
|
||||
}
|
||||
|
||||
int
|
||||
|
Loading…
Reference in New Issue
Block a user