Module Name: src Committed By: matt Date: Sat Jan 28 00:56:35 UTC 2012
Modified Files: src/sys/arch/mips/include [matt-nb5-mips64]: cpu.h src/sys/arch/mips/mips [matt-nb5-mips64]: mips_machdep.c Log Message: Add mm_md_direct_mapped_phys from current. To generate a diff of this commit: cvs rdiff -u -r1.90.16.40 -r1.90.16.41 src/sys/arch/mips/include/cpu.h cvs rdiff -u -r1.205.4.1.2.1.2.60 -r1.205.4.1.2.1.2.61 \ src/sys/arch/mips/mips/mips_machdep.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/arch/mips/include/cpu.h diff -u src/sys/arch/mips/include/cpu.h:1.90.16.40 src/sys/arch/mips/include/cpu.h:1.90.16.41 --- src/sys/arch/mips/include/cpu.h:1.90.16.40 Thu Jan 19 08:28:48 2012 +++ src/sys/arch/mips/include/cpu.h Sat Jan 28 00:56:34 2012 @@ -636,6 +636,7 @@ void fpusave_cpu(struct cpu_info *); void dumpsys(void); int savectx(struct pcb *); void cpu_identify(device_t, const char *); +bool mm_md_direct_mapped_phys(paddr_t, vaddr_t *); /* locore*.S */ int badaddr(void *, size_t); Index: src/sys/arch/mips/mips/mips_machdep.c diff -u src/sys/arch/mips/mips/mips_machdep.c:1.205.4.1.2.1.2.60 src/sys/arch/mips/mips/mips_machdep.c:1.205.4.1.2.1.2.61 --- src/sys/arch/mips/mips/mips_machdep.c:1.205.4.1.2.1.2.60 Thu Jan 19 08:28:50 2012 +++ src/sys/arch/mips/mips/mips_machdep.c Sat Jan 28 00:56:34 2012 @@ -2434,3 +2434,26 @@ mips_watchpoint_init(void) curcpu()->ci_cpuwatch_count = cpuwatch_discover(); } #endif + +bool +mm_md_direct_mapped_phys(paddr_t pa, vaddr_t *vap) +{ +#ifdef _LP64 + if (MIPS_XKSEG_P(pa)) { + *vap = MIPS_PHYS_TO_XKPHYS_CACHED(pa); + return true; + } +#endif +#ifdef ENABLE_MIPS_KSEGX + if (mips_ksegx_start <= pa && pa < mips_ksegx_start + VM_KSEGX_SIZE) { + *vap = VM_KSEGX_ADDRESS + pa - mips_ksegx_start; + return true; + } +#endif + if (MIPS_KSEG0_P(pa)) { + *vap = MIPS_PHYS_TO_KSEG0(pa); + return true; + } + return false; +} +