diff options
-rw-r--r-- | cortex-m-rt/Cargo.toml | 6 | ||||
-rw-r--r-- | cortex-m-rt/README.md | 2 | ||||
-rw-r--r-- | cortex-m-rt/examples/main.rs | 2 | ||||
-rw-r--r-- | cortex-m-rt/link.x.in | 1 | ||||
-rw-r--r-- | cortex-m-rt/macros/Cargo.toml | 2 | ||||
-rw-r--r-- | cortex-m-rt/src/lib.rs | 27 | ||||
-rw-r--r-- | cortex-m-rt/tests/compile-fail/duplicate-static.rs | 1 | ||||
-rw-r--r-- | cortex-m-rt/tests/compile-fail/interrupt-args.rs | 1 | ||||
-rw-r--r-- | cortex-m-rt/tests/compile-fail/interrupt-bad-signature-1.rs | 1 | ||||
-rw-r--r-- | cortex-m-rt/tests/compile-fail/interrupt-bad-signature-2.rs | 1 | ||||
-rw-r--r-- | cortex-m-rt/tests/compile-fail/interrupt-invalid.rs | 5 | ||||
-rw-r--r-- | cortex-m-rt/tests/compile-fail/interrupt-soundness.rs | 1 |
12 files changed, 24 insertions, 26 deletions
diff --git a/cortex-m-rt/Cargo.toml b/cortex-m-rt/Cargo.toml index bb2dde9..df0158c 100644 --- a/cortex-m-rt/Cargo.toml +++ b/cortex-m-rt/Cargo.toml @@ -1,5 +1,9 @@ [package] -authors = ["Jorge Aparicio <jorge@japaric.io>", "Hideki Sekine <sekineh@me.com>"] +authors = [ + "The Cortex-M Team <cortex-m@teams.rust-embedded.org>", + "Jorge Aparicio <jorge@japaric.io>", + "Hideki Sekine <sekineh@me.com>", +] categories = ["embedded", "no-std"] description = "Minimal runtime / startup for Cortex-M microcontrollers" documentation = "https://docs.rs/cortex-m-rt/" diff --git a/cortex-m-rt/README.md b/cortex-m-rt/README.md index d74fa51..a251695 100644 --- a/cortex-m-rt/README.md +++ b/cortex-m-rt/README.md @@ -7,7 +7,7 @@ This project is developed and maintained by the [Cortex-M team][team]. -# [Documentation](https://rust-embedded.github.io/cortex-m-rt) +# [Documentation](https://docs.rs/cortex-m-rt) # License diff --git a/cortex-m-rt/examples/main.rs b/cortex-m-rt/examples/main.rs index b8ab66e..58e3cb4 100644 --- a/cortex-m-rt/examples/main.rs +++ b/cortex-m-rt/examples/main.rs @@ -1,4 +1,4 @@ -//! Directly plug a `main` symbol instead of using `entry!` +//! Directly plug a `main` symbol instead of using `#[entry]` #![deny(warnings)] #![no_main] diff --git a/cortex-m-rt/link.x.in b/cortex-m-rt/link.x.in index dff43e0..f895e21 100644 --- a/cortex-m-rt/link.x.in +++ b/cortex-m-rt/link.x.in @@ -150,6 +150,7 @@ SECTIONS { /* Unused exception related info that only wastes space */ *(.ARM.exidx.*); + *(.ARM.extab.*); } } diff --git a/cortex-m-rt/macros/Cargo.toml b/cortex-m-rt/macros/Cargo.toml index 1ca968c..ba6db64 100644 --- a/cortex-m-rt/macros/Cargo.toml +++ b/cortex-m-rt/macros/Cargo.toml @@ -2,7 +2,7 @@ authors = ["Jorge Aparicio <jorge@japaric.io>"] categories = ["embedded", "no-std"] description = "Attributes re-exported in `cortex-m-rt`" -documentation = "https://rust-embedded.github.io/cortex-m-rt" +documentation = "https://docs.rs/cortex-m-rt" keywords = ["arm", "cortex-m", "runtime", "startup"] license = "MIT OR Apache-2.0" name = "cortex-m-rt-macros" diff --git a/cortex-m-rt/src/lib.rs b/cortex-m-rt/src/lib.rs index 9f2a20a..1dd686f 100644 --- a/cortex-m-rt/src/lib.rs +++ b/cortex-m-rt/src/lib.rs @@ -194,11 +194,11 @@ //! One will always find the following (unmangled) symbols in `cortex-m-rt` applications: //! //! - `Reset`. This is the reset handler. The microcontroller will executed this function upon -//! booting. This function will call the user program entry point (cf. [`entry!`]) using the `main` +//! booting. This function will call the user program entry point (cf. [`#[entry]`]) using the `main` //! symbol so you may also find that symbol in your program; if you do, `main` will contain your //! application code. Some other times `main` gets inlined into `Reset` so you won't find it. //! -//! [`entry!`]: macro.entry.html +//! [`#[entry]`]: https://docs.rs/cortex-m-rt-macros/0.1.5/cortex_m_rt_macros/attr.entry.html //! //! - `DefaultHandler`. This is the default handler. If not overridden using `#[exception] fn //! DefaultHandler(..` this will be an infinite loop. @@ -245,26 +245,13 @@ //! //! ## Setting the program entry point //! -//! This section describes how `entry!` is implemented. This information is useful to developers who -//! want to provide an alternative to `entry!` that provides extra guarantees. +//! This section describes how `#[entry]` is implemented. This information is useful to developers who +//! want to provide an alternative to `#[entry]` that provides extra guarantees. //! //! The `Reset` handler will call a symbol named `main` (unmangled) *after* initializing `.bss` and -//! `.data`, and enabling the FPU (if the target is `thumbv7em-none-eabihf`). `entry!` provides this -//! symbol in its expansion: -//! -//! ``` ignore -//! entry!(path::to::main); -//! -//! // expands into -//! -//! #[export_name = "main"] -//! pub extern "C" fn __impl_main() -> ! { -//! // validate the signature of the program entry point -//! let f: fn() -> ! = path::to::main; -//! -//! f() -//! } -//! ``` +//! `.data`, and enabling the FPU (if the target is `thumbv7em-none-eabihf`). A function with the +//! `entry` attribute will be set to have the export name "`main`"; in addition, its mutable +//! statics are turned into safe mutable references (see [`#[entry]`] for details). //! //! The unmangled `main` symbol must have signature `extern "C" fn() -> !` or its invocation from //! `Reset` will result in undefined behavior. diff --git a/cortex-m-rt/tests/compile-fail/duplicate-static.rs b/cortex-m-rt/tests/compile-fail/duplicate-static.rs index fccb65f..eeb884f 100644 --- a/cortex-m-rt/tests/compile-fail/duplicate-static.rs +++ b/cortex-m-rt/tests/compile-fail/duplicate-static.rs @@ -6,6 +6,7 @@ extern crate panic_halt; use cortex_m_rt::{entry, exception, interrupt}; +#[allow(non_camel_case_types)] enum interrupt { UART0, } diff --git a/cortex-m-rt/tests/compile-fail/interrupt-args.rs b/cortex-m-rt/tests/compile-fail/interrupt-args.rs index 9630ce1..1e06ec2 100644 --- a/cortex-m-rt/tests/compile-fail/interrupt-args.rs +++ b/cortex-m-rt/tests/compile-fail/interrupt-args.rs @@ -11,6 +11,7 @@ fn foo() -> ! { loop {} } +#[allow(non_camel_case_types)] enum interrupt { USART1, } diff --git a/cortex-m-rt/tests/compile-fail/interrupt-bad-signature-1.rs b/cortex-m-rt/tests/compile-fail/interrupt-bad-signature-1.rs index c7e25b3..bd5ff9f 100644 --- a/cortex-m-rt/tests/compile-fail/interrupt-bad-signature-1.rs +++ b/cortex-m-rt/tests/compile-fail/interrupt-bad-signature-1.rs @@ -11,6 +11,7 @@ fn foo() -> ! { loop {} } +#[allow(non_camel_case_types)] enum interrupt { USART1, } diff --git a/cortex-m-rt/tests/compile-fail/interrupt-bad-signature-2.rs b/cortex-m-rt/tests/compile-fail/interrupt-bad-signature-2.rs index ed5cbd4..56db222 100644 --- a/cortex-m-rt/tests/compile-fail/interrupt-bad-signature-2.rs +++ b/cortex-m-rt/tests/compile-fail/interrupt-bad-signature-2.rs @@ -11,6 +11,7 @@ fn foo() -> ! { loop {} } +#[allow(non_camel_case_types)] enum interrupt { USART1, } diff --git a/cortex-m-rt/tests/compile-fail/interrupt-invalid.rs b/cortex-m-rt/tests/compile-fail/interrupt-invalid.rs index 4e79e7d..9b1482a 100644 --- a/cortex-m-rt/tests/compile-fail/interrupt-invalid.rs +++ b/cortex-m-rt/tests/compile-fail/interrupt-invalid.rs @@ -11,11 +11,12 @@ fn foo() -> ! { loop {} } +#[allow(non_camel_case_types)] enum interrupt { USART1, } // NOTE this looks a bit better when using a device crate: // "no variant named `foo` found for type `stm32f30x::Interrupt` in the current scope" -#[interrupt] //~ ERROR no variant named `foo` found for type `interrupt` in the current scope -fn foo() {} +#[interrupt] +fn foo() {} //~ ERROR no variant named `foo` found for type `interrupt` in the current scope diff --git a/cortex-m-rt/tests/compile-fail/interrupt-soundness.rs b/cortex-m-rt/tests/compile-fail/interrupt-soundness.rs index b473a94..74e5e79 100644 --- a/cortex-m-rt/tests/compile-fail/interrupt-soundness.rs +++ b/cortex-m-rt/tests/compile-fail/interrupt-soundness.rs @@ -11,6 +11,7 @@ fn foo() -> ! { loop {} } +#[allow(non_camel_case_types)] enum interrupt { USART1, USART2, |