-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Keep assembly functions in separate sections #1912
Changes from all commits
cde4479
99bf002
05ee739
f46ee4a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -73,7 +73,6 @@ | |
msr sctlr_el1, x0 | ||
.endm | ||
|
||
.section .text.boot | ||
FUNC _start , : | ||
mov x19, x0 /* Save pagable part address */ | ||
mov x20, x2 /* Save DT address */ | ||
|
@@ -187,7 +186,6 @@ END_FUNC _start | |
KEEP_INIT _start | ||
|
||
|
||
.section .text.cpu_on_handler | ||
FUNC cpu_on_handler , : | ||
mov x19, x0 | ||
mov x20, x1 | ||
|
@@ -216,6 +214,7 @@ FUNC cpu_on_handler , : | |
mov x30, x21 | ||
b generic_boot_cpu_on_handler | ||
END_FUNC cpu_on_handler | ||
KEEP_PAGER cpu_on_handler | ||
|
||
LOCAL_FUNC unhandled_cpu , : | ||
wfi | ||
|
@@ -234,6 +233,7 @@ END_FUNC unhandled_cpu | |
.endif | ||
.endm | ||
|
||
.section .text.reset_vect_table | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not needed? |
||
.align 11 | ||
LOCAL_FUNC reset_vect_table , : | ||
/* ----------------------------------------------------- | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -189,6 +189,7 @@ UNWIND( .cantunwind) | |
b vector_system_reset_entry | ||
UNWIND( .fnend) | ||
END_FUNC thread_vector_table | ||
KEEP_PAGER thread_vector_table | ||
|
||
FUNC thread_set_abt_sp , : | ||
UNWIND( .fnstart) | ||
|
@@ -210,7 +211,7 @@ UNWIND( .cantunwind) | |
msr cpsr, r1 | ||
bx lr | ||
UNWIND( .fnend) | ||
END_FUNC thread_set_abt_sp | ||
END_FUNC thread_set_und_sp | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nit: unrelated fix, should be a separate commit |
||
|
||
FUNC thread_set_irq_sp , : | ||
UNWIND( .fnstart) | ||
|
@@ -440,6 +441,7 @@ UNWIND( .save {r0}) | |
pop {r4-r5, pc} | ||
UNWIND( .fnend) | ||
END_FUNC thread_rpc | ||
KEEP_PAGER thread_rpc | ||
|
||
/* The handler of native interrupt. */ | ||
.macro native_intr_handler mode:req | ||
|
@@ -817,6 +819,7 @@ UNWIND( .cantunwind) | |
UNWIND( .fnend) | ||
END_FUNC thread_svc_handler | ||
|
||
.section .text.thread_vect_table | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not needed? |
||
.align 5 | ||
LOCAL_FUNC thread_vect_table , : | ||
UNWIND( .fnstart) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -45,7 +45,6 @@ | |
madd x\res, x\tmp0, x\tmp1, x\res | ||
.endm | ||
|
||
.section .text.thread_asm | ||
LOCAL_FUNC vector_std_smc_entry , : | ||
sub sp, sp, #THREAD_SMC_ARGS_SIZE | ||
store_xregs sp, THREAD_SMC_ARGS_X0, 0, 7 | ||
|
@@ -165,6 +164,7 @@ FUNC thread_vector_table , : | |
b vector_system_off_entry | ||
b vector_system_reset_entry | ||
END_FUNC thread_vector_table | ||
KEEP_PAGER thread_vector_table | ||
|
||
|
||
/* void thread_resume(struct thread_ctx_regs *regs) */ | ||
|
@@ -255,6 +255,7 @@ FUNC thread_rpc , : | |
store_wregs x16, 0, 0, 5 /* Store w0-w5 into rv[] */ | ||
ret | ||
END_FUNC thread_rpc | ||
KEEP_PAGER thread_rpc | ||
|
||
FUNC thread_init_vbar , : | ||
adr x0, thread_vect_table | ||
|
@@ -345,6 +346,7 @@ END_FUNC thread_unwind_user_mode | |
.endm | ||
|
||
|
||
.section .text.thread_vect_table | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not needed? |
||
.align 11 | ||
LOCAL_FUNC thread_vect_table , : | ||
/* ----------------------------------------------------- | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -146,6 +146,20 @@ UNWIND( .cantunwind) | |
UNWIND( .fnend) | ||
END_FUNC sm_pm_cpu_resume | ||
|
||
/* | ||
* The following will be located in text section whose attribute is | ||
* marked as readonly, but we only need to read here | ||
* _suspend_sp stores the offset between thread_core_local to _suspend_sp. | ||
* _core_pos stores the offset between get_core_pos to _core_pos. | ||
*/ | ||
.align 2 | ||
.extern thread_core_local | ||
_suspend_sp: | ||
.long thread_core_local - . | ||
.extern get_core_pos | ||
_core_pos: | ||
.long get_core_pos - . | ||
|
||
/* | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why move this block here? Just cosmetic? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's to avoid an assembler error, apparantly the |
||
* void sm_do_cpu_do_resume(paddr suspend_regs) __noreturn; | ||
* Restore the registers stored when sm_pm_cpu_do_suspend | ||
|
@@ -210,16 +224,3 @@ a7_resume: | |
UNWIND( .fnend) | ||
END_FUNC sm_pm_cpu_do_resume | ||
|
||
/* | ||
* The following will be located in text section whose attribute is | ||
* marked as readonly, but we only need to read here | ||
* _suspend_sp stores the offset between thread_core_local to _suspend_sp. | ||
* _core_pos stores the offset between get_core_pos to _core_pos. | ||
*/ | ||
.align 2 | ||
.extern thread_core_local | ||
_suspend_sp: | ||
.long thread_core_local - . | ||
.extern get_core_pos | ||
_core_pos: | ||
.long get_core_pos - . |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -244,6 +244,7 @@ UNWIND( .cantunwind) | |
UNWIND( .fnend) | ||
END_FUNC sm_fiq_entry | ||
|
||
.section .text.sm_vect_table | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not needed? |
||
.align 5 | ||
LOCAL_FUNC sm_vect_table , : | ||
UNWIND( .fnstart) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't this an unrelated fix? (would deserve its own commit)