-
Notifications
You must be signed in to change notification settings - Fork 165
make compilable on stable #88
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Changes from 1 commit
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
bff66f8
make compilable on stable
japaric b098b6a
make singleton! work on stable
japaric 93abfac
stable by default, remove exception module, add SCB.vect_active, ..
japaric 9a986d8
install arm-none-eabi-gcc
japaric 1d68643
fix build on ARMv7E-M
japaric 716398c
fix build on ARMv6-M
japaric c290aa4
ARMv6-M: remove fields that are not available from NVIC and SCB
japaric 17bd0c8
fix x86_64 tests
japaric 2cd6092
ARMv6-M: remove fields that are not available from cpuid::RegisterBlock
japaric 7d51707
simplify #[cfg]s
japaric 550f949
fix build for ARMv7E-M + "inline-asm"
japaric 05bbc3b
always list all the peripherals in `Peripherals`
japaric File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
;; fn __basepri_max(u8) | ||
;; executed in a critical section to work around a silicon erratum | ||
.global __basepri_max | ||
__basepri_max: | ||
mrs r1, PRIMASK | ||
cpsid i | ||
tst.w r1, #1 | ||
msr BASEPRI_MAX, r0 | ||
it ne | ||
bxne lr | ||
cpsie i | ||
bx lr |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
.global __basepri_max | ||
__basepri_max: | ||
msr BASEPRI_MAX, r0 | ||
bx lr |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
.global __basepri_r | ||
__basepri_r: | ||
mrs r0, BASEPRI | ||
bx lr |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
;; fn __basepri_w(u8) | ||
;; executed in a critical section to work around a silicon erratum | ||
.global __basepri_w | ||
__basepri_w: | ||
mrs r1, PRIMASK | ||
cpsid i | ||
tst.w r1, #1 | ||
msr BASEPRI, r0 | ||
it ne | ||
bxne lr | ||
cpsie i | ||
bx lr |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
.global __basepri_w | ||
__basepri_w: | ||
msr BASEPRI, r0 | ||
bx lr |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
.global __bkpt | ||
__bkpt: | ||
bkpt | ||
bx lr |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
.global __control | ||
__control: | ||
mrs r0, CONTROL | ||
bx lr |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
.global __cpsid | ||
__cpsid: | ||
cpsid i | ||
bx lr |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
.global __cpsie | ||
__cpsie: | ||
cpsie i | ||
bx lr |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
.global __dmb | ||
__dmb: | ||
dmb 0xF | ||
bx lr |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
.global __dsb | ||
__dsb: | ||
dsb 0xF | ||
bx lr |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
.global __faultmask | ||
__faultmask: | ||
mrs r0, FAULTMASK | ||
bx lr |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
.global __isb | ||
__isb: | ||
isb 0xF | ||
bx lr |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
.global __msp_r | ||
__msp_r: | ||
mrs r0, MSP | ||
bx lr |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
.global __msp_w | ||
__msp_w: | ||
msr MSP, r0 | ||
bx lr |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
.global __nop | ||
__nop: | ||
nop | ||
bx lr |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
.global __primask | ||
__primask: | ||
mrs r0, PRIMASK | ||
bx lr |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
.global __psp_r | ||
__psp_r: | ||
mrs r0, PSP | ||
bx lr |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
.global __psp_w | ||
__psp_w: | ||
msr PSP, r0 | ||
bx lr |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
.global __sev | ||
__sev: | ||
sev | ||
bx lr |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
.global __wfe | ||
__wfe: | ||
wfe | ||
bx lr |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
.global __wfi | ||
__wfi: | ||
wfi | ||
bx lr |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,58 @@ | ||
extern crate cc; | ||
|
||
use std::env; | ||
|
||
fn main() { | ||
let target = env::var("TARGET").unwrap(); | ||
|
||
if target.starts_with("thumb") && env::var_os("CARGO_FEATURE_INLINE_ASM").is_none() { | ||
// NOTE we need to place each routine in a separate assembly file or the linker won't be | ||
// able to discard the unused routines | ||
let mut build = cc::Build::new(); | ||
build | ||
.file("asm/basepri_r.s") | ||
.file("asm/bkpt.s") | ||
.file("asm/control.s") | ||
.file("asm/cpsid.s") | ||
.file("asm/cpsie.s") | ||
.file("asm/dmb.s") | ||
.file("asm/dsb.s") | ||
.file("asm/faultmask.s") | ||
.file("asm/isb.s") | ||
.file("asm/msp_r.s") | ||
.file("asm/msp_w.s") | ||
.file("asm/nop.s") | ||
.file("asm/primask.s") | ||
.file("asm/psp_r.s") | ||
.file("asm/psp_w.s") | ||
.file("asm/sev.s") | ||
.file("asm/wfe.s") | ||
.file("asm/wfi.s"); | ||
|
||
if env::var_os("CARGO_FEATURE_CM7_R0P1").is_some() { | ||
build.file("asm/basepri_max-cm7-r0p1.s"); | ||
build.file("asm/basepri_w-cm7-r0p1.s"); | ||
} else { | ||
build.file("asm/basepri_max.s"); | ||
build.file("asm/basepri_w.s"); | ||
} | ||
|
||
build.compile("asm"); | ||
} | ||
|
||
if target.starts_with("thumbv6m-") { | ||
println!("cargo:rustc-cfg=cortex_m"); | ||
println!("cargo:rustc-cfg=armv6m"); | ||
} else if target.starts_with("thumbv7m-") { | ||
println!("cargo:rustc-cfg=cortex_m"); | ||
println!("cargo:rustc-cfg=armv7m"); | ||
} else if target.starts_with("thumbv7em-") { | ||
println!("cargo:rustc-cfg=cortex_m"); | ||
println!("cargo:rustc-cfg=armv7m"); | ||
//println!("cargo:rustc-cfg=armv7em"); | ||
} | ||
|
||
if target.ends_with("eabihf") { | ||
if target.ends_with("-eabihf") { | ||
println!("cargo:rustc-cfg=has_fpu"); | ||
} | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could drop the
nop
instruction here. Even without itasm::nop
won't be optimized away by the compiler.