]> xenbits.xensource.com Git - unikraft/unikraft.git/commitdiff
plat/common/arm: Make `lcpu_arch_jump_to` not SMP dependent
authorSergiu Moga <sergiu.moga@protonmail.com>
Fri, 7 Apr 2023 15:32:32 +0000 (18:32 +0300)
committerUnikraft <monkey@unikraft.io>
Fri, 11 Aug 2023 10:18:44 +0000 (10:18 +0000)
Since `lcpu_arch_jump_to` can be used with and without
`CONFIG_HAVE_SMP`, move it to a place where the preprocessing
phase does not remove the function from the final image.

Signed-off-by: Sergiu Moga <sergiu.moga@protonmail.com>
Reviewed-by: Michalis Pappas <michalis@unikraft.io>
Approved-by: Razvan Deaconescu <razvand@unikraft.io>
Tested-by: Unikraft CI <monkey@unikraft.io>
GitHub-Closes: #848

plat/common/arm/lcpu.c

index a93d15bfe0e70e20601cdfb825cec8b64fdb5a3f..3a827c351eec51bdd6d662fc7943235feda186cd 100644 (file)
@@ -50,6 +50,19 @@ __lcpuid lcpu_arch_id(void)
        return mpidr_reg & CPU_ID_MASK;
 }
 
+void __noreturn lcpu_arch_jump_to(void *sp, ukplat_lcpu_entry_t entry)
+{
+       __asm__ __volatile__ (
+               "mov    sp, %0\n" /* set the sp  */
+               "br     %1\n"     /* branch to the entry function */
+               :
+               : "r"(sp), "r"(entry)
+               : /* sp not needed */);
+
+       /* just make the compiler happy about returning function */
+       __builtin_unreachable();
+}
+
 #ifdef CONFIG_HAVE_SMP
 /**
  * The number of cells for the size field should be 0 in cpu nodes.
@@ -79,19 +92,6 @@ int lcpu_arch_init(struct lcpu *this_lcpu)
        return ret;
 }
 
-void __noreturn lcpu_arch_jump_to(void *sp, ukplat_lcpu_entry_t entry)
-{
-       __asm__ __volatile__ (
-               "mov    sp, %0\n" /* set the sp  */
-               "br     %1\n"     /* branch to the entry function */
-               :
-               : "r"(sp), "r"(entry)
-               : /* sp not needed */);
-
-       /* just make the compiler happy about returning function */
-       __builtin_unreachable();
-}
-
 int lcpu_arch_mp_init(void *arg)
 {
        int fdt_cpu;