riscv: Move global pointer loading to a macro
[sfrench/cifs-2.6.git] / arch / riscv / kernel / head.S
index 3710ea5d160f30347ff1b8ebf79927ca466e6da1..a0484d95d8fb3dd859b5de48421fe9315cca26ea 100644 (file)
@@ -110,10 +110,7 @@ relocate_enable_mmu:
        csrw CSR_TVEC, a0
 
        /* Reload the global pointer */
-.option push
-.option norelax
-       la gp, __global_pointer$
-.option pop
+       load_global_pointer
 
        /*
         * Switch to kernel page tables.  A full fence is necessary in order to
@@ -134,10 +131,7 @@ secondary_start_sbi:
        csrw CSR_IP, zero
 
        /* Load the global pointer */
-       .option push
-       .option norelax
-               la gp, __global_pointer$
-       .option pop
+       load_global_pointer
 
        /*
         * Disable FPU & VECTOR to detect illegal usage of
@@ -228,10 +222,7 @@ pmp_done:
 #endif /* CONFIG_RISCV_M_MODE */
 
        /* Load the global pointer */
-.option push
-.option norelax
-       la gp, __global_pointer$
-.option pop
+       load_global_pointer
 
        /*
         * Disable FPU & VECTOR to detect illegal usage of