Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions aarch32-rt/src/arch_v4/abort.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ core::arch::global_asm!(
.arm
.global _asm_default_data_abort_handler
.type _asm_default_data_abort_handler, %function
.p2align 2
_asm_default_data_abort_handler:
sub lr, lr, #8 // Make sure we jump back to the right place
push {{ r12 }} // Push preserved register R12 (1)
Expand Down Expand Up @@ -60,6 +61,7 @@ core::arch::global_asm!(
.arm
.global _asm_default_prefetch_abort_handler
.type _asm_default_prefetch_abort_handler, %function
.p2align 2
_asm_default_prefetch_abort_handler:
sub lr, lr, #4 // Make sure we jump back to the right place
push {{ r12 }} // Push preserved register R12 (1)
Expand Down
1 change: 1 addition & 0 deletions aarch32-rt/src/arch_v4/boot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ core::arch::global_asm!(
.arm
.global _default_start
.type _default_start, %function
.p2align 2
_default_start:
// Init .data and .bss on primary core
bl _asm_init_segments
Expand Down
1 change: 1 addition & 0 deletions aarch32-rt/src/arch_v4/hvc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ core::arch::global_asm!(
.arm
.global _asm_default_hvc_handler
.type _asm_default_hvc_handler, %function
.p2align 2
_asm_default_hvc_handler:
b .
.size _asm_default_hvc_handler, . - _asm_default_hvc_handler
Expand Down
1 change: 1 addition & 0 deletions aarch32-rt/src/arch_v4/interrupt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ core::arch::global_asm!(
.arm
.global _asm_default_irq_handler
.type _asm_default_irq_handler, %function
.p2align 2
_asm_default_irq_handler:
sub lr, lr, 4 // Make sure we jump back to the right place
stmfd sp!, {{ lr }} // Save adjusted LR to IRQ stack (1)
Expand Down
1 change: 1 addition & 0 deletions aarch32-rt/src/arch_v4/svc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ core::arch::global_asm!(
.arm
.global _asm_default_svc_handler
.type _asm_default_svc_handler, %function
.p2align 2
_asm_default_svc_handler:
stmfd sp!, {{ r12, lr }} // Save LR and R12 (1)
mrs r12, spsr // Grab SPSR (2)
Expand Down
1 change: 1 addition & 0 deletions aarch32-rt/src/arch_v4/undefined.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ core::arch::global_asm!(
.arm
.global _asm_default_undefined_handler
.type _asm_default_undefined_handler, %function
.p2align 2
_asm_default_undefined_handler:
push {{ r12 }} // Push preserved register R12 (1)
mrs r12, spsr // Grab SPSR (2)
Expand Down
2 changes: 2 additions & 0 deletions aarch32-rt/src/arch_v7/abort.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ core::arch::global_asm!(
.arm
.global _asm_default_data_abort_handler
.type _asm_default_data_abort_handler, %function
.p2align 2
_asm_default_data_abort_handler:
sub lr, lr, #8 // Make sure we jump back to the right place
srsfd sp!, #{abt_mode} // Store return state to ABT stack (1)
Expand Down Expand Up @@ -59,6 +60,7 @@ core::arch::global_asm!(
.arm
.global _asm_default_prefetch_abort_handler
.type _asm_default_prefetch_abort_handler, %function
.p2align 2
_asm_default_prefetch_abort_handler:
sub lr, lr, #4 // Make sure we jump back to the right place
srsfd sp!, #{abt_mode} // Store return state to ABT stack (1)
Expand Down
1 change: 1 addition & 0 deletions aarch32-rt/src/arch_v7/boot_from_el1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ core::arch::global_asm!(
.arm
.global _default_start
.type _default_start, %function
.p2align 2
_default_start:
// Read MPIDR into R0
mrc p15, 0, r0, c0, c0, 5
Expand Down
1 change: 1 addition & 0 deletions aarch32-rt/src/arch_v7/boot_from_el2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ core::arch::global_asm!(
.arm
.global _default_start
.type _default_start, %function
.p2align 2
_default_start:
// Read MPIDR into R0
mrc p15, 0, r0, c0, c0, 5
Expand Down
2 changes: 2 additions & 0 deletions aarch32-rt/src/arch_v7/hvc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ core::arch::global_asm!(
.arm
.global _asm_default_hvc_handler
.type _asm_default_hvc_handler, %function
.p2align 2
_asm_default_hvc_handler:
push {{ r12, lr }} // Push preserved registers R12 and LR (1)
push {{ r0-r5 }} // Push HVC frame to stack (2)
Expand Down Expand Up @@ -51,6 +52,7 @@ core::arch::global_asm!(
.arm
.global _asm_default_hvc_handler
.type _asm_default_hvc_handler, %function
.p2align 2
_asm_default_hvc_handler:
b .
.size _asm_default_hvc_handler, . - _asm_default_hvc_handler
Expand Down
1 change: 1 addition & 0 deletions aarch32-rt/src/arch_v7/interrupt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ core::arch::global_asm!(
.arm
.global _asm_default_irq_handler
.type _asm_default_irq_handler, %function
.p2align 2
_asm_default_irq_handler:
sub lr, lr, 4 // Make sure we jump back to the right place
srsfd sp!, #{handler_mode} // Store return state to the handler stack (1)
Expand Down
1 change: 1 addition & 0 deletions aarch32-rt/src/arch_v7/svc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ core::arch::global_asm!(
.arm
.global _asm_default_svc_handler
.type _asm_default_svc_handler, %function
.p2align 2
_asm_default_svc_handler:
srsfd sp!, #{svc_mode} // Store return state to the SVC stack (1)
push {{ r12, lr }} // Push preserved registers R12 and LR (2)
Expand Down
1 change: 1 addition & 0 deletions aarch32-rt/src/arch_v7/undefined.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ core::arch::global_asm!(
.arm
.global _asm_default_undefined_handler
.type _asm_default_undefined_handler, %function
.p2align 2
_asm_default_undefined_handler:
srsfd sp!, #{und_mode} // Store return state to the UND stack (1)
push {{ r12 }} // Push preserved register R12 (2)
Expand Down
2 changes: 2 additions & 0 deletions aarch32-rt/src/arch_v8_hyp/abort.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ core::arch::global_asm!(
.arm
.global _asm_default_data_abort_handler
.type _asm_default_data_abort_handler, %function
.p2align 2
_asm_default_data_abort_handler:
push {{ r0-r3, r12, lr }} // Push preserved registers (1)
mrs r0, spsr_hyp // Grab SPSR (2)
Expand Down Expand Up @@ -57,6 +58,7 @@ core::arch::global_asm!(
.arm
.global _asm_default_prefetch_abort_handler
.type _asm_default_prefetch_abort_handler, %function
.p2align 2
_asm_default_prefetch_abort_handler:
push {{ r0-r3, r12, lr }} // Push preserved registers (1)
mrs r0, spsr_hyp // Grab SPSR (2)
Expand Down
1 change: 1 addition & 0 deletions aarch32-rt/src/arch_v8_hyp/boot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ core::arch::global_asm!(
.arm
.global _default_start
.type _default_start, %function
.p2align 2
_default_start:
// Read MPIDR into R0
mrc p15, 0, r0, c0, c0, 5
Expand Down
1 change: 1 addition & 0 deletions aarch32-rt/src/arch_v8_hyp/hvc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ core::arch::global_asm!(
.arm
.global _asm_default_hvc_handler
.type _asm_default_hvc_handler, %function
.p2align 2
_asm_default_hvc_handler:
push {{ r12, lr }} // Push preserved registers R12 and LR (1)
mrs lr, elr_hyp // Grab ELR (2)
Expand Down
1 change: 1 addition & 0 deletions aarch32-rt/src/arch_v8_hyp/interrupt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ core::arch::global_asm!(
.arm
.global _asm_default_irq_handler
.type _asm_default_irq_handler, %function
.p2align 2
_asm_default_irq_handler:
push {{ r0-r3, r12, lr }} // Push preserved registers (1)
mrs r0, elr_hyp // Grab ELR (2)
Expand Down
1 change: 1 addition & 0 deletions aarch32-rt/src/arch_v8_hyp/svc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ core::arch::global_asm!(
.arm
.global _asm_default_svc_handler
.type _asm_default_svc_handler, %function
.p2align 2
_asm_default_svc_handler:
push {{ r12, lr }} // Push R12 and LR (1)
mrs lr, elr_hyp // Grab ELR (2)
Expand Down
1 change: 1 addition & 0 deletions aarch32-rt/src/arch_v8_hyp/undefined.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ core::arch::global_asm!(
.arm
.global _asm_default_undefined_handler
.type _asm_default_undefined_handler, %function
.p2align 2
_asm_default_undefined_handler:
push {{ r0-r3, r12, lr }} // Push preserved registers (1)
mrs r0, spsr_hyp // Grab SPSR (2)
Expand Down
8 changes: 8 additions & 0 deletions aarch32-rt/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -761,6 +761,7 @@ core::arch::global_asm!(
.arm
.global _vector_table
.type _vector_table, %function
.p2align 2
.align 5
_vector_table:
ldr pc, =_start
Expand All @@ -786,8 +787,10 @@ core::arch::global_asm!(
// Work around https://github.com/rust-lang/rust/issues/127269
.fpu vfp2
.pushsection .text._asm_core_start
.arm
.global _asm_core_start
.type _asm_core_start, %function
.p2align 2
_asm_core_start:
// Keep our core number for later
mov r12, r0
Expand Down Expand Up @@ -866,8 +869,10 @@ pub extern "C" fn _default_kmain_secondary() {
core::arch::global_asm!(
r#"
.pushsection .text._asm_stack_setup_preallocated
.arm
.global _asm_stack_setup_preallocated
.type _asm_stack_setup_preallocated, %function
.p2align 2
_asm_stack_setup_preallocated:
// Save LR from whatever mode we're currently in
mov r3, lr
Expand Down Expand Up @@ -967,8 +972,10 @@ core::arch::global_asm!(
.fpu vfp2

.pushsection .text._asm_init_segments
.arm
.global _asm_init_segments
.type _asm_init_segments, %function
.p2align 2
_asm_init_segments:
// Zero .bss
ldr r0, =__sbss
Expand Down Expand Up @@ -1026,6 +1033,7 @@ core::arch::global_asm!(
.arm
.global _asm_default_fiq_handler
.type _asm_default_fiq_handler, %function
.p2align 2
_asm_default_fiq_handler:
b _asm_default_fiq_handler
.size _asm_default_fiq_handler, . - _asm_default_fiq_handler
Expand Down