Skip to content
Closed
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
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ This repository provides support for:
* Armv8-R AArch32 Processors, like the Arm Cortex-R52
* Armv7-A Processors, like the Arm Cortex-A5
* Armv8-A AArch32 Processors, like the Arm Cortex-A53 running in 32-bit mode
* Partial support for Legacy Armv5TE Processors

These libraries were originally written by Ferrous Systems, and are based on the
[`cortex-m` libraries] from the [Rust Embedded Devices Working Group].
Expand Down
40 changes: 40 additions & 0 deletions cortex-r-rt/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -935,6 +935,46 @@ core::arch::global_asm!(
}
);

// Start-up code for Armv5TE.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As this is basically exactly the same as the v7-r start-up code, maybe we should just add arm_architecture="v5te" to that block of code?

//
// Go straight to our default routine. No special floating-point handling is supported for now,
// which is theoretically allowed by supporting a VFP co-processor.
//
// If this is required, the user has to define a custom _start method.
#[cfg(arm_architecture = "v5te")]
core::arch::global_asm!(
r#"
.section .text.default_start
.global _default_start
.type _default_start, %function
_default_start:
// Set up stacks.
ldr r0, =_stack_top
bl _stack_setup
// Init .data and .bss
bl _init_segments
// Zero all registers before calling kmain
mov r0, 0
mov r1, 0
mov r2, 0
mov r3, 0
mov r4, 0
mov r5, 0
mov r6, 0
mov r7, 0
mov r8, 0
mov r9, 0
mov r10, 0
mov r11, 0
mov r12, 0
// Jump to application
bl kmain
// In case the application returns, loop forever
b .
.size _default_start, . - _default_start
"#
);

// Start-up code for Armv7-R.
//
// Go straight to our default routine
Expand Down