diff options
author | jchandra <jchandra@FreeBSD.org> | 2010-12-03 19:22:18 +0000 |
---|---|---|
committer | jchandra <jchandra@FreeBSD.org> | 2010-12-03 19:22:18 +0000 |
commit | cbc03d7836d367a26880c77736410bd4af76ebe4 (patch) | |
tree | faa897cddee15aa86fd340a7f8880feb214a978a /sys/mips | |
parent | 3e854ebf959d26915bc669c5f087303f4ae8c975 (diff) | |
download | FreeBSD-src-cbc03d7836d367a26880c77736410bd4af76ebe4.zip FreeBSD-src-cbc03d7836d367a26880c77736410bd4af76ebe4.tar.gz |
1. Fix off by one errors in calls to MIPS_DIRECT_MAPPABLE, reported by alc@
2. Remove unnecessary #defines from vmparam.h
Submitted by: alc (2)
Reviewed by: alc (1)
Diffstat (limited to 'sys/mips')
-rw-r--r-- | sys/mips/include/vmparam.h | 6 | ||||
-rw-r--r-- | sys/mips/mips/pmap.c | 23 |
2 files changed, 12 insertions, 17 deletions
diff --git a/sys/mips/include/vmparam.h b/sys/mips/include/vmparam.h index 3050a91..b76e065 100644 --- a/sys/mips/include/vmparam.h +++ b/sys/mips/include/vmparam.h @@ -46,11 +46,6 @@ /* * Machine dependent constants mips processors. */ -/* - * USRTEXT is the start of the user text/data space, while USRSTACK - * is the top (end) of the user stack. - */ -#define USRTEXT (1*PAGE_SIZE) /* * Virtual memory related constants, all in bytes @@ -94,7 +89,6 @@ #define VM_MAX_ADDRESS ((vm_offset_t)(intptr_t)(int32_t)0xffffffff) #define VM_MINUSER_ADDRESS ((vm_offset_t)0x00000000) -#define VM_MAX_MMAP_ADDR VM_MAXUSER_ADDRESS #ifdef __mips_n64 #define VM_MAXUSER_ADDRESS (VM_MINUSER_ADDRESS + (NPDEPG * NBSEG)) diff --git a/sys/mips/mips/pmap.c b/sys/mips/mips/pmap.c index 4e2b34e..69d4e1e 100644 --- a/sys/mips/mips/pmap.c +++ b/sys/mips/mips/pmap.c @@ -196,14 +196,15 @@ static void pmap_update_page_action(void *arg); #ifndef __mips_n64 /* - * This structure is for high memory (memory above 512Meg in 32 bit) - * This memory area does not have direct mapping, so we a mechanism to do - * temporary per-CPU mapping to access these addresses. + * This structure is for high memory (memory above 512Meg in 32 bit) support. + * The highmem area does not have a KSEG0 mapping, and we need a mechanism to + * do temporary per-CPU mappings for pmap_zero_page, pmap_copy_page etc. * - * At bootup we reserve 2 virtual pages per CPU for mapping highmem pages, to - * access a highmem physical address on a CPU, we will disable interrupts and - * add the mapping from the reserved virtual address for the CPU to the physical - * address in the kernel pagetable. + * At bootup, we reserve 2 virtual pages per CPU for mapping highmem pages. To + * access a highmem physical address on a CPU, we map the physical address to + * the reserved virtual address for the CPU in the kernel pagetable. This is + * done with interrupts disabled(although a spinlock and sched_pin would be + * sufficient). */ struct local_sysmaps { vm_offset_t base; @@ -520,11 +521,11 @@ again: } /* - * In 32 bit, we may have memory which cannot be mapped directly - * this memory will need temporary mapping before it can be + * In 32 bit, we may have memory which cannot be mapped directly. + * This memory will need temporary mapping before it can be * accessed. */ - if (!MIPS_DIRECT_MAPPABLE(phys_avail[i - 1])) + if (!MIPS_DIRECT_MAPPABLE(phys_avail[i - 1] - 1)) need_local_mappings = 1; /* @@ -893,7 +894,7 @@ pmap_map(vm_offset_t *virt, vm_offset_t start, vm_offset_t end, int prot) { vm_offset_t va, sva; - if (MIPS_DIRECT_MAPPABLE(end)) + if (MIPS_DIRECT_MAPPABLE(end - 1)) return (MIPS_PHYS_TO_DIRECT(start)); va = sva = *virt; |