MIPS: Octeon: Enable KASLR
[sfrench/cifs-2.6.git] / arch / mips / cavium-octeon / smp.c
index 256fe6f65cf2dec815777a8ee736431481115e94..889c3f49dbc0e4fb3fe15eae7a7134a009465c17 100644 (file)
 volatile unsigned long octeon_processor_boot = 0xff;
 volatile unsigned long octeon_processor_sp;
 volatile unsigned long octeon_processor_gp;
+#ifdef CONFIG_RELOCATABLE
+volatile unsigned long octeon_processor_relocated_kernel_entry;
+#endif /* CONFIG_RELOCATABLE */
 
 #ifdef CONFIG_HOTPLUG_CPU
 uint64_t octeon_bootloader_entry_addr;
 EXPORT_SYMBOL(octeon_bootloader_entry_addr);
 #endif
 
+extern void kernel_entry(unsigned long arg1, ...);
+
 static void octeon_icache_flush(void)
 {
        asm volatile ("synci 0($0)\n");
@@ -180,6 +185,19 @@ static void __init octeon_smp_setup(void)
        octeon_smp_hotplug_setup();
 }
 
+
+#ifdef CONFIG_RELOCATABLE
+int plat_post_relocation(long offset)
+{
+       unsigned long entry = (unsigned long)kernel_entry;
+
+       /* Send secondaries into relocated kernel */
+       octeon_processor_relocated_kernel_entry = entry + offset;
+
+       return 0;
+}
+#endif /* CONFIG_RELOCATABLE */
+
 /**
  * Firmware CPU startup hook
  *
@@ -333,8 +351,6 @@ void play_dead(void)
                ;
 }
 
-extern void kernel_entry(unsigned long arg1, ...);
-
 static void start_after_reset(void)
 {
        kernel_entry(0, 0, 0);  /* set a2 = 0 for secondary core */