Date: Tue, 6 Apr 2010 07:40:43 +0000 (UTC) From: Juli Mallett <jmallett@FreeBSD.org> To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r206251 - in user/jmallett/octeon/sys/mips: include mips Message-ID: <201004060740.o367ehRR086828@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: jmallett Date: Tue Apr 6 07:40:43 2010 New Revision: 206251 URL: http://svn.freebsd.org/changeset/base/206251 Log: Switch to using XKSEG for N64. Modified: user/jmallett/octeon/sys/mips/include/cpuregs.h user/jmallett/octeon/sys/mips/include/vmparam.h user/jmallett/octeon/sys/mips/mips/pmap.c Modified: user/jmallett/octeon/sys/mips/include/cpuregs.h ============================================================================== --- user/jmallett/octeon/sys/mips/include/cpuregs.h Tue Apr 6 05:53:54 2010 (r206250) +++ user/jmallett/octeon/sys/mips/include/cpuregs.h Tue Apr 6 07:40:43 2010 (r206251) @@ -113,6 +113,9 @@ ((0x2ULL << 62) | ((unsigned long long)(cca) << 59) | (x)) #define MIPS_XKPHYS_TO_PHYS(x) ((x) & 0x07ffffffffffffffULL) +#define MIPS_XKSEG_START 0xc000000000000000 +#define MIPS_XKSEG_END 0xc00000ff80000000 + /* CPU dependent mtc0 hazard hook */ #ifdef TARGET_OCTEON #define COP0_SYNC nop; nop; nop; nop; nop; Modified: user/jmallett/octeon/sys/mips/include/vmparam.h ============================================================================== --- user/jmallett/octeon/sys/mips/include/vmparam.h Tue Apr 6 05:53:54 2010 (r206250) +++ user/jmallett/octeon/sys/mips/include/vmparam.h Tue Apr 6 07:40:43 2010 (r206251) @@ -117,8 +117,13 @@ #define VM_KERNEL_ALLOC_OFFSET ((vm_offset_t)0x00000000) #endif +#if defined(__mips_n64) +#define VM_MIN_KERNEL_ADDRESS ((vm_offset_t)0xc000000000000000) +#define VM_MAX_KERNEL_ADDRESS (VM_MIN_KERNEL_ADDRESS + (NPDEPG * NPTEPG * PAGE_SIZE)) +#else #define VM_MIN_KERNEL_ADDRESS ((vm_offset_t)(intptr_t)(int32_t)0xC0000000) #define VM_MAX_KERNEL_ADDRESS ((vm_offset_t)(intptr_t)(int32_t)0xFFFFC000) +#endif #define VM_KERNEL_WIRED_ADDR_END (VM_MIN_KERNEL_ADDRESS + VM_KERNEL_ALLOC_OFFSET) #if 0 #define KERNBASE (VM_MIN_KERNEL_ADDRESS) Modified: user/jmallett/octeon/sys/mips/mips/pmap.c ============================================================================== --- user/jmallett/octeon/sys/mips/mips/pmap.c Tue Apr 6 05:53:54 2010 (r206250) +++ user/jmallett/octeon/sys/mips/mips/pmap.c Tue Apr 6 07:40:43 2010 (r206251) @@ -3246,16 +3246,29 @@ pmap_kextract(vm_offset_t va) /* * Kernel virtual. */ +#if defined(__mips_n64) + if (va >= MIPS_XKSEG_START && va < MIPS_XKSEG_END) { + pt_entry_t *ptep; + + /* Is the kernel pmap initialized? */ + if (kernel_pmap->pm_active) { + /* It's inside the virtual address range */ + ptep = pmap_pte(kernel_pmap, va); + if (ptep) { + return (TLBLO_PTE_TO_PA(*ptep) | + (va & PAGE_MASK)); + } + } + } +#else if (va >= MIPS_KSEG2_START && va < MIPS_KSEG2_END) { pt_entry_t *ptep; /* Is the kernel pmap initialized? */ if (kernel_pmap->pm_active) { -#if !defined(__mips_n64) if (va < (vm_offset_t)virtual_sys_start) { panic("%s for special address %p.", __func__, (void *)va); } -#endif /* Its inside the virtual address range */ ptep = pmap_pte(kernel_pmap, va); @@ -3266,6 +3279,7 @@ pmap_kextract(vm_offset_t va) return (0); } } +#endif panic("%s for unknown address space %p.", __func__, (void *)va); }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201004060740.o367ehRR086828>