Skip to content

Commit c63d9f8

Browse files
brooniectmarinas
authored andcommitted
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: Mark Brown <[email protected]> Signed-off-by: Catalin Marinas <[email protected]>
1 parent 1e4729e commit c63d9f8

File tree

1 file changed

+28
-28
lines changed

1 file changed

+28
-28
lines changed

arch/arm64/kernel/head.S

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ ENDPROC(preserve_boot_args)
275275
* - first few MB of the kernel linear mapping to jump to once the MMU has
276276
* been enabled
277277
*/
278-
__create_page_tables:
278+
SYM_FUNC_START_LOCAL(__create_page_tables)
279279
mov x28, lr
280280

281281
/*
@@ -403,15 +403,15 @@ __create_page_tables:
403403
bl __inval_dcache_area
404404

405405
ret x28
406-
ENDPROC(__create_page_tables)
406+
SYM_FUNC_END(__create_page_tables)
407407
.ltorg
408408

409409
/*
410410
* The following fragment of code is executed with the MMU enabled.
411411
*
412412
* x0 = __PHYS_OFFSET
413413
*/
414-
__primary_switched:
414+
SYM_FUNC_START_LOCAL(__primary_switched)
415415
adrp x4, init_thread_union
416416
add sp, x4, #THREAD_SIZE
417417
adr_l x5, init_task
@@ -456,7 +456,7 @@ __primary_switched:
456456
mov x29, #0
457457
mov x30, #0
458458
b start_kernel
459-
ENDPROC(__primary_switched)
459+
SYM_FUNC_END(__primary_switched)
460460

461461
/*
462462
* end early head section, begin head code that is also used for
@@ -475,7 +475,7 @@ EXPORT_SYMBOL(kimage_vaddr)
475475
* Returns either BOOT_CPU_MODE_EL1 or BOOT_CPU_MODE_EL2 in w0 if
476476
* booted in EL1 or EL2 respectively.
477477
*/
478-
ENTRY(el2_setup)
478+
SYM_FUNC_START(el2_setup)
479479
msr SPsel, #1 // We want to use SP_EL{1,2}
480480
mrs x0, CurrentEL
481481
cmp x0, #CurrentEL_EL2
@@ -636,13 +636,13 @@ install_el2_stub:
636636
msr elr_el2, lr
637637
mov w0, #BOOT_CPU_MODE_EL2 // This CPU booted in EL2
638638
eret
639-
ENDPROC(el2_setup)
639+
SYM_FUNC_END(el2_setup)
640640

641641
/*
642642
* Sets the __boot_cpu_mode flag depending on the CPU boot mode passed
643643
* in w0. See arch/arm64/include/asm/virt.h for more info.
644644
*/
645-
set_cpu_boot_mode_flag:
645+
SYM_FUNC_START_LOCAL(set_cpu_boot_mode_flag)
646646
adr_l x1, __boot_cpu_mode
647647
cmp w0, #BOOT_CPU_MODE_EL2
648648
b.ne 1f
@@ -651,7 +651,7 @@ set_cpu_boot_mode_flag:
651651
dmb sy
652652
dc ivac, x1 // Invalidate potentially stale cache line
653653
ret
654-
ENDPROC(set_cpu_boot_mode_flag)
654+
SYM_FUNC_END(set_cpu_boot_mode_flag)
655655

656656
/*
657657
* These values are written with the MMU off, but read with the MMU on.
@@ -683,7 +683,7 @@ ENTRY(__early_cpu_boot_status)
683683
* This provides a "holding pen" for platforms to hold all secondary
684684
* cores are held until we're ready for them to initialise.
685685
*/
686-
ENTRY(secondary_holding_pen)
686+
SYM_FUNC_START(secondary_holding_pen)
687687
bl el2_setup // Drop to EL1, w0=cpu_boot_mode
688688
bl set_cpu_boot_mode_flag
689689
mrs x0, mpidr_el1
@@ -695,19 +695,19 @@ pen: ldr x4, [x3]
695695
b.eq secondary_startup
696696
wfe
697697
b pen
698-
ENDPROC(secondary_holding_pen)
698+
SYM_FUNC_END(secondary_holding_pen)
699699

700700
/*
701701
* Secondary entry point that jumps straight into the kernel. Only to
702702
* be used where CPUs are brought online dynamically by the kernel.
703703
*/
704-
ENTRY(secondary_entry)
704+
SYM_FUNC_START(secondary_entry)
705705
bl el2_setup // Drop to EL1
706706
bl set_cpu_boot_mode_flag
707707
b secondary_startup
708-
ENDPROC(secondary_entry)
708+
SYM_FUNC_END(secondary_entry)
709709

710-
secondary_startup:
710+
SYM_FUNC_START_LOCAL(secondary_startup)
711711
/*
712712
* Common entry point for secondary CPUs.
713713
*/
@@ -717,9 +717,9 @@ secondary_startup:
717717
bl __enable_mmu
718718
ldr x8, =__secondary_switched
719719
br x8
720-
ENDPROC(secondary_startup)
720+
SYM_FUNC_END(secondary_startup)
721721

722-
__secondary_switched:
722+
SYM_FUNC_START_LOCAL(__secondary_switched)
723723
adr_l x5, vectors
724724
msr vbar_el1, x5
725725
isb
@@ -734,13 +734,13 @@ __secondary_switched:
734734
mov x29, #0
735735
mov x30, #0
736736
b secondary_start_kernel
737-
ENDPROC(__secondary_switched)
737+
SYM_FUNC_END(__secondary_switched)
738738

739-
__secondary_too_slow:
739+
SYM_FUNC_START_LOCAL(__secondary_too_slow)
740740
wfe
741741
wfi
742742
b __secondary_too_slow
743-
ENDPROC(__secondary_too_slow)
743+
SYM_FUNC_END(__secondary_too_slow)
744744

745745
/*
746746
* The booting CPU updates the failed status @__early_cpu_boot_status,
@@ -772,7 +772,7 @@ ENDPROC(__secondary_too_slow)
772772
* Checks if the selected granule size is supported by the CPU.
773773
* If it isn't, park the CPU
774774
*/
775-
ENTRY(__enable_mmu)
775+
SYM_FUNC_START(__enable_mmu)
776776
mrs x2, ID_AA64MMFR0_EL1
777777
ubfx x2, x2, #ID_AA64MMFR0_TGRAN_SHIFT, 4
778778
cmp x2, #ID_AA64MMFR0_TGRAN_SUPPORTED
@@ -796,9 +796,9 @@ ENTRY(__enable_mmu)
796796
dsb nsh
797797
isb
798798
ret
799-
ENDPROC(__enable_mmu)
799+
SYM_FUNC_END(__enable_mmu)
800800

801-
ENTRY(__cpu_secondary_check52bitva)
801+
SYM_FUNC_START(__cpu_secondary_check52bitva)
802802
#ifdef CONFIG_ARM64_VA_BITS_52
803803
ldr_l x0, vabits_actual
804804
cmp x0, #52
@@ -816,20 +816,20 @@ ENTRY(__cpu_secondary_check52bitva)
816816

817817
#endif
818818
2: ret
819-
ENDPROC(__cpu_secondary_check52bitva)
819+
SYM_FUNC_END(__cpu_secondary_check52bitva)
820820

821-
__no_granule_support:
821+
SYM_FUNC_START_LOCAL(__no_granule_support)
822822
/* Indicate that this CPU can't boot and is stuck in the kernel */
823823
update_early_cpu_boot_status \
824824
CPU_STUCK_IN_KERNEL | CPU_STUCK_REASON_NO_GRAN, x1, x2
825825
1:
826826
wfe
827827
wfi
828828
b 1b
829-
ENDPROC(__no_granule_support)
829+
SYM_FUNC_END(__no_granule_support)
830830

831831
#ifdef CONFIG_RELOCATABLE
832-
__relocate_kernel:
832+
SYM_FUNC_START_LOCAL(__relocate_kernel)
833833
/*
834834
* Iterate over each entry in the relocation table, and apply the
835835
* relocations in place.
@@ -931,10 +931,10 @@ __relocate_kernel:
931931
#endif
932932
ret
933933

934-
ENDPROC(__relocate_kernel)
934+
SYM_FUNC_END(__relocate_kernel)
935935
#endif
936936

937-
__primary_switch:
937+
SYM_FUNC_START_LOCAL(__primary_switch)
938938
#ifdef CONFIG_RANDOMIZE_BASE
939939
mov x19, x0 // preserve new SCTLR_EL1 value
940940
mrs x20, sctlr_el1 // preserve old SCTLR_EL1 value
@@ -977,4 +977,4 @@ __primary_switch:
977977
ldr x8, =__primary_switched
978978
adrp x0, __PHYS_OFFSET
979979
br x8
980-
ENDPROC(__primary_switch)
980+
SYM_FUNC_END(__primary_switch)

0 commit comments

Comments
 (0)