Skip to content

Commit e3217ad

Browse files
bors[bot]japaric
andcommitted
Merge #88
88: make compilable on stable r=japaric a=japaric This PR makes this crate compilable on stable when the "inline-asm" and "singleton" Cargo features are disabled (they are enabled by default to maintain backwards compatibility). The main change has been replacing almost (\*) all inline `asm!` invocations with FFI calls into external assembly files. (\*) Stuff that has not been converted into external assembly file and thus is not available on stable: - Reading the (A)PSR register (I'm not sure if this will work with the extra function call overhead) - Reading and writing the Link Register (LR) - Reading and writing the Program Counter (PC) I would appreciate if someone checked that all the stuff that's now using FFI calls has the same semantics as the inline `asm!` version. Co-authored-by: Jorge Aparicio <[email protected]>
2 parents 00d6faa + 05bbc3b commit e3217ad

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+946
-300
lines changed

.travis.yml

Lines changed: 48 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,62 @@ language: rust
33
matrix:
44
include:
55
- env: TARGET=x86_64-unknown-linux-gnu
6-
rust: nightly
6+
7+
- env: TARGET=thumbv6m-none-eabi
8+
rust: beta
9+
addons:
10+
apt:
11+
packages:
12+
- gcc-arm-none-eabi
13+
14+
- env: TARGET=thumbv7m-none-eabi
15+
rust: beta
16+
addons:
17+
apt:
18+
packages:
19+
- gcc-arm-none-eabi
20+
21+
- env: TARGET=thumbv7em-none-eabi
22+
rust: beta
23+
addons:
24+
apt:
25+
packages:
26+
- gcc-arm-none-eabi
27+
28+
- env: TARGET=thumbv7em-none-eabihf
29+
rust: beta
30+
addons:
31+
apt:
32+
packages:
33+
- gcc-arm-none-eabi
34+
735
- env: TARGET=thumbv6m-none-eabi
836
rust: nightly
37+
addons:
38+
apt:
39+
packages:
40+
- gcc-arm-none-eabi
41+
942
- env: TARGET=thumbv7m-none-eabi
1043
rust: nightly
44+
addons:
45+
apt:
46+
packages:
47+
- gcc-arm-none-eabi
48+
1149
- env: TARGET=thumbv7em-none-eabi
1250
rust: nightly
51+
addons:
52+
apt:
53+
packages:
54+
- gcc-arm-none-eabi
55+
1356
- env: TARGET=thumbv7em-none-eabihf
1457
rust: nightly
58+
addons:
59+
apt:
60+
packages:
61+
- gcc-arm-none-eabi
1562

1663
before_install: set -e
1764

CHANGELOG.md

Lines changed: 44 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,50 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](http://keepachangelog.com/)
66
and this project adheres to [Semantic Versioning](http://semver.org/).
77

8-
## [Unreleased]
8+
## [v0.5.0] - 2018-05-11
9+
10+
### Added
11+
12+
- `DebugMonitor` and `SecureFault` variants to the `Exception` enumeration.
13+
14+
- An optional `"inline-asm"` feature
15+
16+
### Changed
17+
18+
- [breaking-change] This crate now requires `arm-none-eabi-gcc` to be installed and available in
19+
`$PATH` when built with the `"inline-asm"` feature disabled (which is disabled by default).
20+
21+
- [breaking-change] The `register::{apsr,lr,pc}` modules are now behind the `"inline-asm"` feature.
22+
23+
- [breaking-change] Some variants of the `Exception` enumeration are no longer available on
24+
`thumbv6m-none-eabi`. See API docs for details.
25+
26+
- [breaking-change] Several of the variants of the `Exception` enumeration have been renamed to
27+
match the CMSIS specification.
28+
29+
- [breaking-change] fixed typo in `shcrs` field of `scb::RegisterBlock`; it was previously named
30+
`shpcrs`.
31+
32+
- [breaking-change] removed several fields from `scb::RegisterBlock` on ARMv6-M. These registers are
33+
not available on that sub-architecture.
34+
35+
- [breaking-change] changed the type of `scb::RegisterBlock.shpr` from `RW<u8>` to `RW<u32>` on
36+
ARMv6-M. These registers are word accessible only on that sub-architecture.
37+
38+
- [breaking-change] renamed the `mmar` field of `scb::RegisterBlock` to `mmfar` to match the CMSIS
39+
name.
40+
41+
- [breaking-change] removed the `iabr` field from `scb::RegisterBlock` on ARMv6-M. This register is
42+
not available on that sub-architecture.
43+
44+
- [breaking-change] removed several fields from `cpuid::RegisterBlock` on ARMv6-M. These registers
45+
are not available on that sub-architecture.
46+
47+
### Removed
48+
49+
- [breaking-change] The `exception` module has been removed. A replacement for `Exception::active`
50+
can be found in `SCB::vect_active`. A modified version `exception::Exception` can be found in the
51+
`peripheral::scb` module.
952

1053
## [v0.4.3] - 2018-01-25
1154

Cargo.toml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,16 @@ keywords = ["arm", "cortex-m", "register", "peripheral"]
77
license = "MIT OR Apache-2.0"
88
name = "cortex-m"
99
repository = "https://github.com/japaric/cortex-m"
10-
version = "0.4.3"
10+
version = "0.5.0"
11+
12+
[build-dependencies]
13+
cc = "1.0.10"
1114

1215
[dependencies]
13-
aligned = "0.1.1"
14-
bare-metal = "0.1.0"
16+
aligned = "0.2.0"
17+
bare-metal = "0.2.0"
1518
volatile-register = "0.2.0"
16-
untagged-option = "0.1.1"
1719

1820
[features]
1921
cm7-r0p1 = []
22+
inline-asm = []

asm/basepri_max-cm7-r0p1.s

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
.global __basepri_max
2+
.syntax unified
3+
__basepri_max:
4+
mrs r1, PRIMASK
5+
cpsid i
6+
tst.w r1, #1
7+
msr BASEPRI_MAX, r0
8+
it ne
9+
bxne lr
10+
cpsie i
11+
bx lr

asm/basepri_max.s

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
.global __basepri_max
2+
__basepri_max:
3+
msr BASEPRI_MAX, r0
4+
bx lr

asm/basepri_r.s

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
.global __basepri_r
2+
__basepri_r:
3+
mrs r0, BASEPRI
4+
bx lr

asm/basepri_w-cm7-r0p1.s

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
.global __basepri_w
2+
.syntax unified
3+
__basepri_w:
4+
mrs r1, PRIMASK
5+
cpsid i
6+
tst.w r1, #1
7+
msr BASEPRI, r0
8+
it ne
9+
bxne lr
10+
cpsie i
11+
bx lr

asm/basepri_w.s

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
.global __basepri_w
2+
__basepri_w:
3+
msr BASEPRI, r0
4+
bx lr

asm/bkpt.s

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
.global __bkpt
2+
__bkpt:
3+
bkpt
4+
bx lr

asm/control.s

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
.global __control
2+
__control:
3+
mrs r0, CONTROL
4+
bx lr

0 commit comments

Comments
 (0)