···2323 dsrl \res, NSRI_NODEID_SHFT2424 .endm25252626+ /*2727+ * inputs are the text nasid in t1, data nasid in t2.2828+ */2929+ .macro MAPPED_KERNEL_SETUP_TLB3030+#ifdef CONFIG_MAPPED_KERNEL3131+ /*3232+ * This needs to read the nasid - assume 0 for now.3333+ * Drop in 0xffffffffc0000000 in tlbhi, 0+VG in tlblo_0,3434+ * 0+DVG in tlblo_1.3535+ */3636+ dli t0, 0xffffffffc00000003737+ dmtc0 t0, CP0_ENTRYHI3838+ li t0, 0x1c000 # Offset of text into node memory3939+ dsll t1, NASID_SHFT # Shift text nasid into place4040+ dsll t2, NASID_SHFT # Same for data nasid4141+ or t1, t1, t0 # Physical load address of kernel text4242+ or t2, t2, t0 # Physical load address of kernel data4343+ dsrl t1, 12 # 4K pfn4444+ dsrl t2, 12 # 4K pfn4545+ dsll t1, 6 # Get pfn into place4646+ dsll t2, 6 # Get pfn into place4747+ li t0, ((_PAGE_GLOBAL|_PAGE_VALID| _CACHE_CACHABLE_COW) >> 6)4848+ or t0, t0, t14949+ mtc0 t0, CP0_ENTRYLO0 # physaddr, VG, cach exlwr5050+ li t0, ((_PAGE_GLOBAL|_PAGE_VALID| _PAGE_DIRTY|_CACHE_CACHABLE_COW) >> 6)5151+ or t0, t0, t25252+ mtc0 t0, CP0_ENTRYLO1 # physaddr, DVG, cach exlwr5353+ li t0, 0x1ffe000 # MAPPED_KERN_TLBMASK, TLBPGMASK_16M5454+ mtc0 t0, CP0_PAGEMASK5555+ li t0, 0 # KMAP_INX5656+ mtc0 t0, CP0_INDEX5757+ li t0, 15858+ mtc0 t0, CP0_WIRED5959+ tlbwi6060+#else6161+ mtc0 zero, CP0_WIRED6262+#endif6363+ .endm6464+2665/*2766 * Intentionally empty macro, used in head.S. Override in2867 * arch/mips/mach-xxx/kernel-entry-init.h when necessary.
-39
arch/mips/kernel/head.S
···2828#include <kernel-entry-init.h>29293030 /*3131- * inputs are the text nasid in t1, data nasid in t2.3232- */3333- .macro MAPPED_KERNEL_SETUP_TLB3434-#ifdef CONFIG_MAPPED_KERNEL3535- /*3636- * This needs to read the nasid - assume 0 for now.3737- * Drop in 0xffffffffc0000000 in tlbhi, 0+VG in tlblo_0,3838- * 0+DVG in tlblo_1.3939- */4040- dli t0, 0xffffffffc00000004141- dmtc0 t0, CP0_ENTRYHI4242- li t0, 0x1c000 # Offset of text into node memory4343- dsll t1, NASID_SHFT # Shift text nasid into place4444- dsll t2, NASID_SHFT # Same for data nasid4545- or t1, t1, t0 # Physical load address of kernel text4646- or t2, t2, t0 # Physical load address of kernel data4747- dsrl t1, 12 # 4K pfn4848- dsrl t2, 12 # 4K pfn4949- dsll t1, 6 # Get pfn into place5050- dsll t2, 6 # Get pfn into place5151- li t0, ((_PAGE_GLOBAL|_PAGE_VALID| _CACHE_CACHABLE_COW) >> 6)5252- or t0, t0, t15353- mtc0 t0, CP0_ENTRYLO0 # physaddr, VG, cach exlwr5454- li t0, ((_PAGE_GLOBAL|_PAGE_VALID| _PAGE_DIRTY|_CACHE_CACHABLE_COW) >> 6)5555- or t0, t0, t25656- mtc0 t0, CP0_ENTRYLO1 # physaddr, DVG, cach exlwr5757- li t0, 0x1ffe000 # MAPPED_KERN_TLBMASK, TLBPGMASK_16M5858- mtc0 t0, CP0_PAGEMASK5959- li t0, 0 # KMAP_INX6060- mtc0 t0, CP0_INDEX6161- li t0, 16262- mtc0 t0, CP0_WIRED6363- tlbwi6464-#else6565- mtc0 zero, CP0_WIRED6666-#endif6767- .endm6868-6969- /*7031 * For the moment disable interrupts, mark the kernel mode and7132 * set ST0_KX so that the CPU does not spit fire when using7233 * 64-bit addresses. A full initialization of the CPU's status