Commit c63d9f82 authored by Mark Brown's avatar Mark Brown Committed by Catalin Marinas

arm64: head.S: Convert to modern annotations for assembly functions

In an effort to clarify and simplify the annotation of assembly functions
in the kernel new macros have been introduced. These replace ENTRY and
ENDPROC and also add a new annotation for static functions which previously
had no ENTRY equivalent. Update the annotations in the core kernel code to
the new macros.
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
Signed-off-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
parent 1e4729ed
...@@ -275,7 +275,7 @@ ENDPROC(preserve_boot_args) ...@@ -275,7 +275,7 @@ ENDPROC(preserve_boot_args)
* - first few MB of the kernel linear mapping to jump to once the MMU has * - first few MB of the kernel linear mapping to jump to once the MMU has
* been enabled * been enabled
*/ */
__create_page_tables: SYM_FUNC_START_LOCAL(__create_page_tables)
mov x28, lr mov x28, lr
/* /*
...@@ -403,7 +403,7 @@ __create_page_tables: ...@@ -403,7 +403,7 @@ __create_page_tables:
bl __inval_dcache_area bl __inval_dcache_area
ret x28 ret x28
ENDPROC(__create_page_tables) SYM_FUNC_END(__create_page_tables)
.ltorg .ltorg
/* /*
...@@ -411,7 +411,7 @@ ENDPROC(__create_page_tables) ...@@ -411,7 +411,7 @@ ENDPROC(__create_page_tables)
* *
* x0 = __PHYS_OFFSET * x0 = __PHYS_OFFSET
*/ */
__primary_switched: SYM_FUNC_START_LOCAL(__primary_switched)
adrp x4, init_thread_union adrp x4, init_thread_union
add sp, x4, #THREAD_SIZE add sp, x4, #THREAD_SIZE
adr_l x5, init_task adr_l x5, init_task
...@@ -456,7 +456,7 @@ __primary_switched: ...@@ -456,7 +456,7 @@ __primary_switched:
mov x29, #0 mov x29, #0
mov x30, #0 mov x30, #0
b start_kernel b start_kernel
ENDPROC(__primary_switched) SYM_FUNC_END(__primary_switched)
/* /*
* end early head section, begin head code that is also used for * end early head section, begin head code that is also used for
...@@ -475,7 +475,7 @@ EXPORT_SYMBOL(kimage_vaddr) ...@@ -475,7 +475,7 @@ EXPORT_SYMBOL(kimage_vaddr)
* Returns either BOOT_CPU_MODE_EL1 or BOOT_CPU_MODE_EL2 in w0 if * Returns either BOOT_CPU_MODE_EL1 or BOOT_CPU_MODE_EL2 in w0 if
* booted in EL1 or EL2 respectively. * booted in EL1 or EL2 respectively.
*/ */
ENTRY(el2_setup) SYM_FUNC_START(el2_setup)
msr SPsel, #1 // We want to use SP_EL{1,2} msr SPsel, #1 // We want to use SP_EL{1,2}
mrs x0, CurrentEL mrs x0, CurrentEL
cmp x0, #CurrentEL_EL2 cmp x0, #CurrentEL_EL2
...@@ -636,13 +636,13 @@ install_el2_stub: ...@@ -636,13 +636,13 @@ install_el2_stub:
msr elr_el2, lr msr elr_el2, lr
mov w0, #BOOT_CPU_MODE_EL2 // This CPU booted in EL2 mov w0, #BOOT_CPU_MODE_EL2 // This CPU booted in EL2
eret eret
ENDPROC(el2_setup) SYM_FUNC_END(el2_setup)
/* /*
* Sets the __boot_cpu_mode flag depending on the CPU boot mode passed * Sets the __boot_cpu_mode flag depending on the CPU boot mode passed
* in w0. See arch/arm64/include/asm/virt.h for more info. * in w0. See arch/arm64/include/asm/virt.h for more info.
*/ */
set_cpu_boot_mode_flag: SYM_FUNC_START_LOCAL(set_cpu_boot_mode_flag)
adr_l x1, __boot_cpu_mode adr_l x1, __boot_cpu_mode
cmp w0, #BOOT_CPU_MODE_EL2 cmp w0, #BOOT_CPU_MODE_EL2
b.ne 1f b.ne 1f
...@@ -651,7 +651,7 @@ set_cpu_boot_mode_flag: ...@@ -651,7 +651,7 @@ set_cpu_boot_mode_flag:
dmb sy dmb sy
dc ivac, x1 // Invalidate potentially stale cache line dc ivac, x1 // Invalidate potentially stale cache line
ret ret
ENDPROC(set_cpu_boot_mode_flag) SYM_FUNC_END(set_cpu_boot_mode_flag)
/* /*
* These values are written with the MMU off, but read with the MMU on. * These values are written with the MMU off, but read with the MMU on.
...@@ -683,7 +683,7 @@ ENTRY(__early_cpu_boot_status) ...@@ -683,7 +683,7 @@ ENTRY(__early_cpu_boot_status)
* This provides a "holding pen" for platforms to hold all secondary * This provides a "holding pen" for platforms to hold all secondary
* cores are held until we're ready for them to initialise. * cores are held until we're ready for them to initialise.
*/ */
ENTRY(secondary_holding_pen) SYM_FUNC_START(secondary_holding_pen)
bl el2_setup // Drop to EL1, w0=cpu_boot_mode bl el2_setup // Drop to EL1, w0=cpu_boot_mode
bl set_cpu_boot_mode_flag bl set_cpu_boot_mode_flag
mrs x0, mpidr_el1 mrs x0, mpidr_el1
...@@ -695,19 +695,19 @@ pen: ldr x4, [x3] ...@@ -695,19 +695,19 @@ pen: ldr x4, [x3]
b.eq secondary_startup b.eq secondary_startup
wfe wfe
b pen b pen
ENDPROC(secondary_holding_pen) SYM_FUNC_END(secondary_holding_pen)
/* /*
* Secondary entry point that jumps straight into the kernel. Only to * Secondary entry point that jumps straight into the kernel. Only to
* be used where CPUs are brought online dynamically by the kernel. * be used where CPUs are brought online dynamically by the kernel.
*/ */
ENTRY(secondary_entry) SYM_FUNC_START(secondary_entry)
bl el2_setup // Drop to EL1 bl el2_setup // Drop to EL1
bl set_cpu_boot_mode_flag bl set_cpu_boot_mode_flag
b secondary_startup b secondary_startup
ENDPROC(secondary_entry) SYM_FUNC_END(secondary_entry)
secondary_startup: SYM_FUNC_START_LOCAL(secondary_startup)
/* /*
* Common entry point for secondary CPUs. * Common entry point for secondary CPUs.
*/ */
...@@ -717,9 +717,9 @@ secondary_startup: ...@@ -717,9 +717,9 @@ secondary_startup:
bl __enable_mmu bl __enable_mmu
ldr x8, =__secondary_switched ldr x8, =__secondary_switched
br x8 br x8
ENDPROC(secondary_startup) SYM_FUNC_END(secondary_startup)
__secondary_switched: SYM_FUNC_START_LOCAL(__secondary_switched)
adr_l x5, vectors adr_l x5, vectors
msr vbar_el1, x5 msr vbar_el1, x5
isb isb
...@@ -734,13 +734,13 @@ __secondary_switched: ...@@ -734,13 +734,13 @@ __secondary_switched:
mov x29, #0 mov x29, #0
mov x30, #0 mov x30, #0
b secondary_start_kernel b secondary_start_kernel
ENDPROC(__secondary_switched) SYM_FUNC_END(__secondary_switched)
__secondary_too_slow: SYM_FUNC_START_LOCAL(__secondary_too_slow)
wfe wfe
wfi wfi
b __secondary_too_slow b __secondary_too_slow
ENDPROC(__secondary_too_slow) SYM_FUNC_END(__secondary_too_slow)
/* /*
* The booting CPU updates the failed status @__early_cpu_boot_status, * The booting CPU updates the failed status @__early_cpu_boot_status,
...@@ -772,7 +772,7 @@ ENDPROC(__secondary_too_slow) ...@@ -772,7 +772,7 @@ ENDPROC(__secondary_too_slow)
* Checks if the selected granule size is supported by the CPU. * Checks if the selected granule size is supported by the CPU.
* If it isn't, park the CPU * If it isn't, park the CPU
*/ */
ENTRY(__enable_mmu) SYM_FUNC_START(__enable_mmu)
mrs x2, ID_AA64MMFR0_EL1 mrs x2, ID_AA64MMFR0_EL1
ubfx x2, x2, #ID_AA64MMFR0_TGRAN_SHIFT, 4 ubfx x2, x2, #ID_AA64MMFR0_TGRAN_SHIFT, 4
cmp x2, #ID_AA64MMFR0_TGRAN_SUPPORTED cmp x2, #ID_AA64MMFR0_TGRAN_SUPPORTED
...@@ -796,9 +796,9 @@ ENTRY(__enable_mmu) ...@@ -796,9 +796,9 @@ ENTRY(__enable_mmu)
dsb nsh dsb nsh
isb isb
ret ret
ENDPROC(__enable_mmu) SYM_FUNC_END(__enable_mmu)
ENTRY(__cpu_secondary_check52bitva) SYM_FUNC_START(__cpu_secondary_check52bitva)
#ifdef CONFIG_ARM64_VA_BITS_52 #ifdef CONFIG_ARM64_VA_BITS_52
ldr_l x0, vabits_actual ldr_l x0, vabits_actual
cmp x0, #52 cmp x0, #52
...@@ -816,9 +816,9 @@ ENTRY(__cpu_secondary_check52bitva) ...@@ -816,9 +816,9 @@ ENTRY(__cpu_secondary_check52bitva)
#endif #endif
2: ret 2: ret
ENDPROC(__cpu_secondary_check52bitva) SYM_FUNC_END(__cpu_secondary_check52bitva)
__no_granule_support: SYM_FUNC_START_LOCAL(__no_granule_support)
/* Indicate that this CPU can't boot and is stuck in the kernel */ /* Indicate that this CPU can't boot and is stuck in the kernel */
update_early_cpu_boot_status \ update_early_cpu_boot_status \
CPU_STUCK_IN_KERNEL | CPU_STUCK_REASON_NO_GRAN, x1, x2 CPU_STUCK_IN_KERNEL | CPU_STUCK_REASON_NO_GRAN, x1, x2
...@@ -826,10 +826,10 @@ __no_granule_support: ...@@ -826,10 +826,10 @@ __no_granule_support:
wfe wfe
wfi wfi
b 1b b 1b
ENDPROC(__no_granule_support) SYM_FUNC_END(__no_granule_support)
#ifdef CONFIG_RELOCATABLE #ifdef CONFIG_RELOCATABLE
__relocate_kernel: SYM_FUNC_START_LOCAL(__relocate_kernel)
/* /*
* Iterate over each entry in the relocation table, and apply the * Iterate over each entry in the relocation table, and apply the
* relocations in place. * relocations in place.
...@@ -931,10 +931,10 @@ __relocate_kernel: ...@@ -931,10 +931,10 @@ __relocate_kernel:
#endif #endif
ret ret
ENDPROC(__relocate_kernel) SYM_FUNC_END(__relocate_kernel)
#endif #endif
__primary_switch: SYM_FUNC_START_LOCAL(__primary_switch)
#ifdef CONFIG_RANDOMIZE_BASE #ifdef CONFIG_RANDOMIZE_BASE
mov x19, x0 // preserve new SCTLR_EL1 value mov x19, x0 // preserve new SCTLR_EL1 value
mrs x20, sctlr_el1 // preserve old SCTLR_EL1 value mrs x20, sctlr_el1 // preserve old SCTLR_EL1 value
...@@ -977,4 +977,4 @@ __primary_switch: ...@@ -977,4 +977,4 @@ __primary_switch:
ldr x8, =__primary_switched ldr x8, =__primary_switched
adrp x0, __PHYS_OFFSET adrp x0, __PHYS_OFFSET
br x8 br x8
ENDPROC(__primary_switch) SYM_FUNC_END(__primary_switch)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment