Module Name: src Committed By: matt Date: Wed Dec 29 00:46:17 UTC 2010
Modified Files: src/sys/arch/mips/mips [matt-nb5-mips64]: mips_fixup.c Log Message: Add stub for tlb_write_indexed. To generate a diff of this commit: cvs rdiff -u -r1.1.2.7 -r1.1.2.8 src/sys/arch/mips/mips/mips_fixup.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/mips/mips_fixup.c diff -u src/sys/arch/mips/mips/mips_fixup.c:1.1.2.7 src/sys/arch/mips/mips/mips_fixup.c:1.1.2.8 --- src/sys/arch/mips/mips/mips_fixup.c:1.1.2.7 Fri Dec 24 07:12:10 2010 +++ src/sys/arch/mips/mips/mips_fixup.c Wed Dec 29 00:46:17 2010 @@ -29,8 +29,9 @@ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: mips_fixup.c,v 1.1.2.7 2010/12/24 07:12:10 matt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: mips_fixup.c,v 1.1.2.8 2010/12/29 00:46:17 matt Exp $"); +#include "opt_mips3_wired.h" #include <sys/param.h> #include <uvm/uvm_extern.h> @@ -122,6 +123,7 @@ return fixed; } +#ifdef MIPS3_PLUS bool mips_fixup_zero_relative(int32_t load_addr, uint32_t new_insns[2]) { @@ -165,13 +167,15 @@ TLBINFO_LOCK(ti); if (ci->ci_tlb_slot < 0) { ci->ci_tlb_slot = ti->ti_wired++; - mips3_cp0_wired_write(ti->ti_wired); + if (MIPS_HAS_R4K_MMU) + mips3_cp0_wired_write(ti->ti_wired); tlb_enter(ci->ci_tlb_slot, -PAGE_SIZE, tlb_lo); } TLBINFO_UNLOCK(ti); return true; } +#endif /* MIPS3_PLUS */ #define OPCODE_J 002 #define OPCODE_JAL 003 @@ -271,6 +275,12 @@ const intptr_t real_addr = *(int32_t *)load_addr; #endif /* + * If the real_addr has been set yet, don't fix up. + */ + if (real_addr == 0) { + continue; + } + /* * Verify the real destination is in the same 256MB * as the location of the jump instruction. */ @@ -318,12 +328,19 @@ int tlb_update(vaddr_t, uint32_t) __stub; void tlb_enter(size_t, vaddr_t, uint32_t) __stub; void tlb_read_indexed(size_t, struct tlbmask *) __stub; +#if defined(ENABLE_MIPS3_WIRED_MAP) +void tlb_write_indexed(size_t, const struct tlbmask *) __stub; +#endif +/* + * wbflush isn't a stub since it gets overridden quite late + * (after mips_vector_init returns). + */ void wbflush(void) /*__stub*/; void mips_cpu_switch_resume(struct lwp *l) { - (*mips_locoresw.lsw_cpu_switch_resume)(l); + (*mips_locore_jumpvec.ljv_cpu_switch_resume)(l); } void @@ -380,9 +397,16 @@ (*mips_locore_jumpvec.ljv_tlb_read_indexed)(tlbno, tlb); } +#if defined(ENABLE_MIPS3_WIRED_MAP) void -wbflush(void) +tlb_write_indexed(size_t tlbno, const struct tlbmask *tlb) { - (*mips_locore_jumpvec.ljv_wbflush)(); + (*mips_locore_jumpvec.ljv_tlb_write_indexed)(tlbno, tlb); } +#endif +void +wbflush(void) +{ + (*mips_locoresw.lsw_wbflush)(); +}