diff options
author | 2018-09-06 01:24:01 +0200 | |
---|---|---|
committer | 2018-09-06 01:24:01 +0200 | |
commit | 19fcb13d22a56e01fd2fa5d34051196f59c9511b (patch) | |
tree | 8cec0b0edef2b5e29a348d7fb7b1437fef133bf3 /cortex-m-rt/examples | |
parent | bc526b8d74cb548c9da8d5c10d6013008e164ba5 (diff) | |
download | cortex-m-19fcb13d22a56e01fd2fa5d34051196f59c9511b.tar.gz cortex-m-19fcb13d22a56e01fd2fa5d34051196f59c9511b.tar.zst cortex-m-19fcb13d22a56e01fd2fa5d34051196f59c9511b.zip |
relax checks of the signatures of `entry` and the exceptions
Diffstat (limited to 'cortex-m-rt/examples')
-rw-r--r-- | cortex-m-rt/examples/divergent-default-handler.rs | 19 | ||||
-rw-r--r-- | cortex-m-rt/examples/divergent-exception.rs | 18 | ||||
-rw-r--r-- | cortex-m-rt/examples/unsafe-default-handler.rs | 16 | ||||
-rw-r--r-- | cortex-m-rt/examples/unsafe-entry.rs | 13 | ||||
-rw-r--r-- | cortex-m-rt/examples/unsafe-exception.rs | 16 | ||||
-rw-r--r-- | cortex-m-rt/examples/unsafe-hard-fault.rs | 18 |
6 files changed, 100 insertions, 0 deletions
diff --git a/cortex-m-rt/examples/divergent-default-handler.rs b/cortex-m-rt/examples/divergent-default-handler.rs new file mode 100644 index 0000000..cbb8bb1 --- /dev/null +++ b/cortex-m-rt/examples/divergent-default-handler.rs @@ -0,0 +1,19 @@ +#![deny(unsafe_code)] +#![deny(warnings)] +#![no_main] +#![no_std] + +extern crate cortex_m_rt; +extern crate panic_semihosting; + +use cortex_m_rt::{entry, exception}; + +#[entry] +fn foo() -> ! { + loop {} +} + +#[exception] +fn DefaultHandler(_irqn: i16) -> ! { + loop {} +} diff --git a/cortex-m-rt/examples/divergent-exception.rs b/cortex-m-rt/examples/divergent-exception.rs new file mode 100644 index 0000000..9998884 --- /dev/null +++ b/cortex-m-rt/examples/divergent-exception.rs @@ -0,0 +1,18 @@ +#![deny(warnings)] +#![no_main] +#![no_std] + +extern crate cortex_m_rt; +extern crate panic_semihosting; + +use cortex_m_rt::{entry, exception}; + +#[entry] +fn foo() -> ! { + loop {} +} + +#[exception] +fn SysTick() -> ! { + loop {} +} diff --git a/cortex-m-rt/examples/unsafe-default-handler.rs b/cortex-m-rt/examples/unsafe-default-handler.rs new file mode 100644 index 0000000..48bd31e --- /dev/null +++ b/cortex-m-rt/examples/unsafe-default-handler.rs @@ -0,0 +1,16 @@ +#![deny(warnings)] +#![no_main] +#![no_std] + +extern crate cortex_m_rt; +extern crate panic_semihosting; + +use cortex_m_rt::{entry, exception}; + +#[entry] +fn foo() -> ! { + loop {} +} + +#[exception] +unsafe fn DefaultHandler(_irqn: i16) {} diff --git a/cortex-m-rt/examples/unsafe-entry.rs b/cortex-m-rt/examples/unsafe-entry.rs new file mode 100644 index 0000000..feb6f44 --- /dev/null +++ b/cortex-m-rt/examples/unsafe-entry.rs @@ -0,0 +1,13 @@ +#![deny(warnings)] +#![no_main] +#![no_std] + +extern crate cortex_m_rt; +extern crate panic_semihosting; + +use cortex_m_rt::entry; + +#[entry] +unsafe fn foo() -> ! { + loop {} +} diff --git a/cortex-m-rt/examples/unsafe-exception.rs b/cortex-m-rt/examples/unsafe-exception.rs new file mode 100644 index 0000000..d67f06f --- /dev/null +++ b/cortex-m-rt/examples/unsafe-exception.rs @@ -0,0 +1,16 @@ +#![deny(warnings)] +#![no_main] +#![no_std] + +extern crate cortex_m_rt; +extern crate panic_semihosting; + +use cortex_m_rt::{entry, exception}; + +#[entry] +fn foo() -> ! { + loop {} +} + +#[exception] +unsafe fn SysTick() {} diff --git a/cortex-m-rt/examples/unsafe-hard-fault.rs b/cortex-m-rt/examples/unsafe-hard-fault.rs new file mode 100644 index 0000000..b091d47 --- /dev/null +++ b/cortex-m-rt/examples/unsafe-hard-fault.rs @@ -0,0 +1,18 @@ +#![deny(warnings)] +#![no_main] +#![no_std] + +extern crate cortex_m_rt; +extern crate panic_semihosting; + +use cortex_m_rt::{entry, exception, ExceptionFrame}; + +#[entry] +fn foo() -> ! { + loop {} +} + +#[exception] +unsafe fn HardFault(_ef: &ExceptionFrame) -> ! { + loop {} +} |