diff options
author | jchandra <jchandra@FreeBSD.org> | 2010-06-18 20:07:30 +0000 |
---|---|---|
committer | jchandra <jchandra@FreeBSD.org> | 2010-06-18 20:07:30 +0000 |
commit | d2c78cca9b6c90d9b7aee1d348a2b7f9b02d2520 (patch) | |
tree | d52ffb56040f224c5a78f5711f4c79c7b54db89e /sys/mips | |
parent | 3fc50687aaf022a812650864190599f8749a82cf (diff) | |
download | FreeBSD-src-d2c78cca9b6c90d9b7aee1d348a2b7f9b02d2520.zip FreeBSD-src-d2c78cca9b6c90d9b7aee1d348a2b7f9b02d2520.tar.gz |
Merge jmallett@'s n64 work into HEAD - changeset 5
Remove unnecessary locking and sched_pin() call while creating a temporary
mapping.
Changes from http://svn.freebsd.org/base/user/jmallett/octeon
Approved by: rrs (mentor), jmallett
Diffstat (limited to 'sys/mips')
-rw-r--r-- | sys/mips/include/pmap.h | 6 | ||||
-rw-r--r-- | sys/mips/mips/pmap.c | 14 |
2 files changed, 3 insertions, 17 deletions
diff --git a/sys/mips/include/pmap.h b/sys/mips/include/pmap.h index 6130dd0..f2ff691 100644 --- a/sys/mips/include/pmap.h +++ b/sys/mips/include/pmap.h @@ -116,12 +116,6 @@ extern struct pmap kernel_pmap_store; #define PMAP_TRYLOCK(pmap) mtx_trylock(&(pmap)->pm_mtx) #define PMAP_UNLOCK(pmap) mtx_unlock(&(pmap)->pm_mtx) -#define PMAP_LGMEM_LOCK_INIT(sysmap) mtx_init(&(sysmap)->lock, "pmap-lgmem", \ - "per-cpu-map", (MTX_DEF| MTX_DUPOK)) -#define PMAP_LGMEM_LOCK(sysmap) mtx_lock(&(sysmap)->lock) -#define PMAP_LGMEM_UNLOCK(sysmap) mtx_unlock(&(sysmap)->lock) -#define PMAP_LGMEM_DESTROY(sysmap) mtx_destroy(&(sysmap)->lock) - /* * For each vm_page_t, there is a list of all currently valid virtual * mappings of that page. An entry is a pv_entry_t, the list is pv_table. diff --git a/sys/mips/mips/pmap.c b/sys/mips/mips/pmap.c index 8a833aa..2f830f6 100644 --- a/sys/mips/mips/pmap.c +++ b/sys/mips/mips/pmap.c @@ -195,7 +195,6 @@ static void *pmap_ptpgzone_allocf(uma_zone_t, int, u_int8_t *, int); static uma_zone_t ptpgzone; struct local_sysmaps { - struct mtx lock; vm_offset_t base; uint16_t valid1, valid2; }; @@ -214,11 +213,9 @@ static struct local_sysmaps sysmap_lmem[MAXCPU]; struct local_sysmaps *sysm; \ pt_entry_t *pte, npte; \ \ + intr = intr_disable(); \ cpu = PCPU_GET(cpuid); \ sysm = &sysmap_lmem[cpu]; \ - PMAP_LGMEM_LOCK(sysm); \ - intr = intr_disable(); \ - sched_pin(); \ va = sysm->base; \ npte = TLBLO_PA_TO_PFN(phys) | \ PTE_RW | PTE_V | PTE_G | PTE_W | PTE_CACHE; \ @@ -231,11 +228,9 @@ static struct local_sysmaps sysmap_lmem[MAXCPU]; struct local_sysmaps *sysm; \ pt_entry_t *pte, npte; \ \ + intr = intr_disable(); \ cpu = PCPU_GET(cpuid); \ sysm = &sysmap_lmem[cpu]; \ - PMAP_LGMEM_LOCK(sysm); \ - intr = intr_disable(); \ - sched_pin(); \ va1 = sysm->base; \ va2 = sysm->base + PAGE_SIZE; \ npte = TLBLO_PA_TO_PFN(phys1) | \ @@ -258,9 +253,7 @@ static struct local_sysmaps sysmap_lmem[MAXCPU]; *pte = PTE_G; \ tlb_invalidate_address(kernel_pmap, sysm->base + PAGE_SIZE); \ sysm->valid2 = 0; \ - sched_unpin(); \ - intr_restore(intr); \ - PMAP_LGMEM_UNLOCK(sysm); + intr_restore(intr) pd_entry_t pmap_segmap(pmap_t pmap, vm_offset_t va) @@ -436,7 +429,6 @@ again: sysmap_lmem[i].base = virtual_avail; virtual_avail += PAGE_SIZE * 2; sysmap_lmem[i].valid1 = sysmap_lmem[i].valid2 = 0; - PMAP_LGMEM_LOCK_INIT(&sysmap_lmem[i]); } } |