MIPS: Remove redundant asm/pgtable-bits.h inclusions
[cascardo/linux.git] / arch / mips / kernel / head.S
index 4e4cc5b..56e8fed 100644 (file)
@@ -21,7 +21,6 @@
 #include <asm/asmmacro.h>
 #include <asm/irqflags.h>
 #include <asm/regdef.h>
-#include <asm/pgtable-bits.h>
 #include <asm/mipsregs.h>
 #include <asm/stackframe.h>
 
@@ -132,7 +131,27 @@ not_found:
        set_saved_sp    sp, t0, t1
        PTR_SUBU        sp, 4 * SZREG           # init stack pointer
 
+#ifdef CONFIG_RELOCATABLE
+       /* Copy kernel and apply the relocations */
+       jal             relocate_kernel
+
+       /* Repoint the sp into the new kernel image */
+       PTR_LI          sp, _THREAD_SIZE - 32 - PT_SIZE
+       PTR_ADDU        sp, $28
+       set_saved_sp    sp, t0, t1
+       PTR_SUBU        sp, 4 * SZREG           # init stack pointer
+
+       /*
+        * relocate_kernel returns the entry point either
+        * in the relocated kernel or the original if for
+        * some reason relocation failed - jump there now
+        * with instruction hazard barrier because of the
+        * newly sync'd icache.
+        */
+       jr.hb           v0
+#else
        j               start_kernel
+#endif
        END(kernel_entry)
 
 #ifdef CONFIG_SMP