-
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
Conversation
@@ -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 comment
The reason will be displayed to describe this comment to others. Learn more.
Not needed?
@@ -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 comment
The reason will be displayed to describe this comment to others. Learn more.
Not needed?
@@ -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 comment
The reason will be displayed to describe this comment to others. Learn more.
Not needed?
_core_pos: | ||
.long get_core_pos - . | ||
|
||
/* |
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.
Why move this block here? Just cosmetic?
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.
It's to avoid an assembler error, apparantly the adr
instruction can only be performed on symbols in the same section.
@@ -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 comment
The reason will be displayed to describe this comment to others. Learn more.
Not needed?
"core: arm32: replace _start with reset() function" is needed also for this to have full effect. |
93594c6
to
c2cc553
Compare
Rebased |
@@ -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 comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: unrelated fix, should be a separate commit
|
||
#else /* defined(CFG_WITH_ARM_TRUSTED_FW) */ | ||
|
||
LOCAL_FUNC reset_secondary , : | ||
UNWIND( .fnstart) | ||
UNWIND( .cantunwind) | ||
ldr r0, =reset_vect_table | ||
write_vbar r0 |
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)
c2cc553
to
545e0e6
Compare
Split the commits |
Thanks for splitting the commits. |
Sets correct end tag for thread_set_und_sp() Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
To get a more fine grained selection of which area (init, paged, unpaged) an assembly function is assigned do the equivalent of -ffunction-sections but in assembly. Some functions has to be in specific places in the binary for a successful boot, link script is updated accordingly. Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
Renames _start to reset_vect_table and renames reset() to _start() in order to avoid pulling in too much unpaged code via reset_secondary()/cpu_on_handler(). Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
Sets reset vector in reset_secondary() to trap unexpected exceptions. Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> Tested-by: Jens Wiklander <jens.wiklander@linaro.org> (QEMU v7/v8) Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
545e0e6
to
f46ee4a
Compare
Tag applied |
To get a more fine grained selection of which area (init, paged,
unpaged) an assembly function is assigned do the equivalent of
-ffunction-sections but in assembly.
Some functions has to be in specific places in the binary for a
successful boot, link script is updated accordingly.
Tested-by: Jens Wiklander jens.wiklander@linaro.org (QEMU v7/v8)
Signed-off-by: Jens Wiklander jens.wiklander@linaro.org