Skip to content

Commit b0d2e45

Browse files
authored
Merge pull request #549 from elfenlaid/patch-1
cortex-m: fix typos
2 parents 9405cf1 + 27cd652 commit b0d2e45

File tree

3 files changed

+27
-20
lines changed

3 files changed

+27
-20
lines changed

cortex-m-rt/link.x.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
static mut __sbss }`).
88

99
- `EXTERN` forces the linker to keep a symbol in the final binary. We use this to make sure a
10-
symbol if not dropped if it appears in or near the front of the linker arguments and "it's not
10+
symbol is not dropped if it appears in or near the front of the linker arguments and "it's not
1111
needed" by any of the preceding objects (linker arguments)
1212

1313
- `PROVIDE` is used to provide default values that can be overridden by a user linker script

cortex-m-rt/src/lib.rs

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
//! This crates takes care of:
99
//!
1010
//! - The memory layout of the program. In particular, it populates the vector table so the device
11-
//! can boot correctly, and properly dispatch exceptions and interrupts.
11+
//! can boot correctly, and properly dispatch exceptions and interrupts.
1212
//!
1313
//! - Initializing `static` variables before the program entry point.
1414
//!
@@ -221,42 +221,42 @@
221221
//! One will always find the following (unmangled) symbols in `cortex-m-rt` applications:
222222
//!
223223
//! - `Reset`. This is the reset handler. The microcontroller will execute this function upon
224-
//! booting. This function will call the user program entry point (cf. [`#[entry]`][attr-entry])
225-
//! using the `main` symbol so you will also find that symbol in your program.
224+
//! booting. This function will call the user program entry point (cf. [`#[entry]`][attr-entry])
225+
//! using the `main` symbol so you will also find that symbol in your program.
226226
//!
227227
//! - `DefaultHandler`. This is the default handler. If not overridden using `#[exception] fn
228228
//! DefaultHandler(..` this will be an infinite loop.
229229
//!
230230
//! - `HardFault` and `_HardFault`. These function handle the hard fault handling and what they
231-
//! do depends on whether the hard fault is overridden and whether the trampoline is enabled (which it is by default).
231+
//! do depends on whether the hard fault is overridden and whether the trampoline is enabled (which it is by default).
232232
//! - No override: Both are the same function. The function is an infinite loop defined in the cortex-m-rt crate.
233233
//! - Trampoline enabled: `HardFault` is the real hard fault handler defined in assembly. This function is simply a
234-
//! trampoline that jumps into the rust defined `_HardFault` function. This second function jumps to the user-defined
235-
//! handler with the exception frame as parameter. This second jump is usually optimised away with inlining.
234+
//! trampoline that jumps into the rust defined `_HardFault` function. This second function jumps to the user-defined
235+
//! handler with the exception frame as parameter. This second jump is usually optimised away with inlining.
236236
//! - Trampoline disabled: `HardFault` is the user defined function. This means the user function is called directly
237-
//! from the vector table. `_HardFault` still exists, but is an empty function that is purely there for compiler
238-
//! diagnostics.
237+
//! from the vector table. `_HardFault` still exists, but is an empty function that is purely there for compiler
238+
//! diagnostics.
239239
//!
240240
//! - `__STACK_START`. This is the first entry in the `.vector_table` section. This symbol contains
241-
//! the initial value of the stack pointer; this is where the stack will be located -- the stack
242-
//! grows downwards towards smaller addresses.
241+
//! the initial value of the stack pointer; this is where the stack will be located -- the stack
242+
//! grows downwards towards smaller addresses.
243243
//!
244244
//! - `__RESET_VECTOR`. This is the reset vector, a pointer to the `Reset` function. This vector
245-
//! is located in the `.vector_table` section after `__STACK_START`.
245+
//! is located in the `.vector_table` section after `__STACK_START`.
246246
//!
247247
//! - `__EXCEPTIONS`. This is the core exceptions portion of the vector table; it's an array of 14
248-
//! exception vectors, which includes exceptions like `HardFault` and `SysTick`. This array is
249-
//! located after `__RESET_VECTOR` in the `.vector_table` section.
248+
//! exception vectors, which includes exceptions like `HardFault` and `SysTick`. This array is
249+
//! located after `__RESET_VECTOR` in the `.vector_table` section.
250250
//!
251251
//! - `__INTERRUPTS`. This is the device specific interrupt portion of the vector table; its exact
252-
//! size depends on the target device but if the `"device"` feature has not been enabled it will
253-
//! have a size of 32 vectors (on ARMv6-M) or 240 vectors (on ARMv7-M). This array is located after
254-
//! `__EXCEPTIONS` in the `.vector_table` section.
252+
//! size depends on the target device but if the `"device"` feature has not been enabled it will
253+
//! have a size of 32 vectors (on ARMv6-M) or 240 vectors (on ARMv7-M). This array is located after
254+
//! `__EXCEPTIONS` in the `.vector_table` section.
255255
//!
256256
//! - `__pre_init`. This is a function to be run before RAM is initialized. It defaults to an empty
257-
//! function. As this runs before RAM is initialised, it is not sound to use a Rust function for
258-
//! `pre_init`, and instead it should typically be written in assembly using `global_asm` or an
259-
//! external assembly file.
257+
//! function. As this runs before RAM is initialised, it is not sound to use a Rust function for
258+
//! `pre_init`, and instead it should typically be written in assembly using `global_asm` or an
259+
//! external assembly file.
260260
//!
261261
//! If you override any exception handler you'll find it as an unmangled symbol, e.g. `SysTick` or
262262
//! `SVCall`, in the output of `objdump`,

testsuite/build.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
fn main() {
22
let target = std::env::var("TARGET").unwrap();
33

4+
println!("cargo:rustc-check-cfg=cfg(armv6m)");
5+
println!("cargo:rustc-check-cfg=cfg(armv7m)");
6+
println!("cargo:rustc-check-cfg=cfg(armv7em)");
7+
println!("cargo:rustc-check-cfg=cfg(armv8m)");
8+
println!("cargo:rustc-check-cfg=cfg(armv8m_base)");
9+
println!("cargo:rustc-check-cfg=cfg(armv8m_main)");
10+
411
if target.starts_with("thumbv6m-") {
512
println!("cargo:rustc-cfg=armv6m");
613
} else if target.starts_with("thumbv7m-") {

0 commit comments

Comments
 (0)