Age | Commit message (Collapse) | Author | Files | Lines |
|
|
|
|
|
Co-Authored-By: Jonas Schievink <jonasschievink@gmail.com>
|
|
|
|
|
|
181: Add cfg to Peripheral fields r=thejpster a=hug-dev
The cfg conditional compilation attribute was only set on impl blocks of peripherals. This commit also sets it on the fields themselves to be more consistent.
Also adds Armv8-M Baseline to the blacklist of the ITM peripheral (cf rule `FMQF` of the Armv8-M ARM).
Co-authored-by: Hugues de Valon <hugues.devalon@arm.com>
|
|
180: Add Security Attribution Unit support r=thejpster a=hug-dev
The SAU is a Armv8-M core peripheral that, alongside the Implementation
Defined Attribution Unit, manages the security attribution of the memory
zones.
This driver provides abstraction to help setting the SAU up.
This pull-request adds a new dependency, `bitfield` which provides a really nice way to describe bit fields in registers with methods to access them. It makes it really easier to use/write rather than having to manually declare the shift number and mask constants.
Although `bitfield` does not have any dependency, I am well aware of the increased cost of memory its addition could cause to embedded targets.
I am really open to criticism about its use, if you would prefer me not to use it, or if you would like to see benchmarks of memory usage for some reference targets of embedded Rust 😃
Co-authored-by: Hugues de Valon <hugues.devalon@arm.com>
|
|
206: Add triagebot configuration r=adamgreig a=LeSeulArtichaut
This enables [assignment](https://github.com/rust-lang/triagebot/wiki/Assignment) through triagebot on this repository, in preparation for the migration from highfive to triagebot for PR assignment.
cc rust-lang/highfive#258 rust-lang/triagebot#433
Co-authored-by: LeSeulArtichaut <leseulartichaut@gmail.com>
|
|
|
|
Update cfg attributes and code documentation to take into consideration
the new Armv8-M architecture profiles.
Signed-off-by: Hugues de Valon <hugues.devalon@arm.com>
|
|
202: Prevent unnecessary bounds check in SCB::{get_priority, set_priority} r=therealprof a=qwerty19106
SystemHandler.index() gives true index for SCB.shpr array.
But now it produce unnecessary bounds check. For example, SCB::set_priority:
```
48: sym.cortex_m::peripheral::scb::__impl_cortex_m::peripheral::SCB_::set_priority::h622cd21bcc3321be ();
0x08000376 push {r7, lr}
0x08000378 mov r7, sp
0x0800037a bl cortex_m::peripheral::scb::SystemHandler::index::hdaf1a31aa5a6a8c5 ; sym.cortex_m::peripheral::scb::SystemHandler::index::hdaf1a31aa5a6a8c5
0x0800037e subs r0, 4
0x08000380 uxtb r0, r0
0x08000382 cmp r0, 0xb ; 11
0x08000384 itttt ls
0x08000386 movw r1, 0xed18
0x0800038a movt r1, 0xe000
0x0800038e movs r2, 0xff
0x08000390 strb r2, [r0, r1]
0x08000392 it ls
0x08000394 pop {r7, pc}
0x08000396 movw r2, 0x1dc0
0x0800039a movs r1, 0xc
0x0800039c movt r2, 0x800
0x080003a0 bl core::panicking::panic_bounds_check::h5181f47ae17a04a5 ; sym.core::panicking::panic_bounds_check::h5181f47ae17a04a5
0x080003a4 trap
```
This PR fix it.
Co-authored-by: Роман Кривенков <qwerty19106@gmail.com>
|
|
|
|
|
|
|
|
203: Use u8 repr for enum instead of custom method r=jonas-schievink a=therealprof
This is an alternative proposal to #202 as suggested in
https://github.com/rust-embedded/cortex-m/pull/202#issuecomment-600017553
Signed-off-by: Daniel Egger <daniel@eggers-club.de>
Co-authored-by: Daniel Egger <daniel@eggers-club.de>
|
|
This is an alternative proposal to #202 as suggested in
https://github.com/rust-embedded/cortex-m/pull/202#issuecomment-600017553
Signed-off-by: Daniel Egger <daniel@eggers-club.de>
|
|
201: Add UDF instruction. Closes #199. r=jonas-schievink a=adamgreig
Co-authored-by: Adam Greig <adam@adamgreig.com>
|
|
|
|
200: Add CPSR to asm::delay's clobber flags. Fixes #195 r=therealprof a=adamgreig
Co-authored-by: Adam Greig <adam@adamgreig.com>
|
|
|
|
|
|
|
|
189: Initial Rust CMSE support r=thejpster a=hug-dev
Armv8-M and Armv8.1-M architecture profiles have an optional Security Extension which provides a set of Security features.
This patch adds initial support of the Cortex-M Security Extensions but providing support for the TT intrinsics and helper functions on top of it in the newly added `cmse` module of this crate.
The code is a Rust idiomatic implementation of the C requirements described in this document: https://developer.arm.com/docs/ecm0359818/latest
Executed `assemble.sh` to generate the new static libraries containing the `TT*` instructions. Tested `check_blobs.sh` locally and it passed.
Tested on QEMU using the `mps2-an505` machine.
Co-authored-by: Hugues de Valon <hugues.devalon@arm.com>
|
|
Clippy complains that the match expressions used for cfg gating could be
rewritten as a let statement, this is a false positive.
Also adds inline on two functions.
Signed-off-by: Hugues de Valon <hugues.devalon@arm.com>
|
|
Armv8-M and Armv8.1-M architecture profiles have an optional Security
Extension which provides a set of Security features.
This patch adds initial support of the Cortex-M Security Extensions but
providing support for the TT intrinsics and helper functions on top of
it in the newly added cmse module of this crate.
The code is a Rust idiomatic implementation of the C
requirements described in this document:
https://developer.arm.com/docs/ecm0359818/latest
Signed-off-by: Hugues de Valon <hugues.devalon@arm.com>
|
|
193: Make `Peripherals` non-exhaustive and improve its docs r=therealprof a=jonas-schievink
This means that it's no longer a breaking change to add fields to it, which is important since Arm is likely to add more in upcoming architectures. They could also add extensions that add peripherals.
Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
|
|
198: Remove unnecessary parenthesis r=jonas-schievink a=hug-dev
Otherwise Cargo complains!
This should fix the CI for #193 and #189
Co-authored-by: Hugues de Valon <hugues.devalon@arm.com>
|
|
Otherwise Cargo complains!
Signed-off-by: Hugues de Valon <hugues.devalon@arm.com>
|
|
192: Update and improve cache operations. r=jonas-schievink a=adamgreig
Closes #47, #188.
I've implemented the proposed methods from #47 and marked all d-cache invalidation functions as unsafe. It's not unsafe to invalidate i-cache or branch predictor as they are read-only caches. The clean and clean+invalidate operations do not alter memory from the executing core's point of view so are also safe.
It wasn't possible to remove the requirement to pass in `&mut CPUID` as you require synchronized access to `CPUID` to read the number of sets and ways in the cache, which is required to fully clean or invalidate them, which is required to enable or disable them. So it goes.
Breaking change due to changing safety of d-cache invalidation functions.
Co-authored-by: Adam Greig <adam@adamgreig.com>
|
|
|
|
Co-Authored-By: Jonas Schievink <jonasschievink@gmail.com>
|
|
|
|
|
|
|
|
The Clippy lint was unnecessarily `#[allow]`ed.
|
|
Closes #47, #188.
Breaking change due to changing safety of d-cache invalidation
functions.
|
|
191: Remove deprecated APIs and the `const-fn` feature r=adamgreig a=jonas-schievink
Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
|
|
|
|
190: Remove `aligned`, improve ITM code r=adamgreig a=jonas-schievink
This does a handful of things:
* Removes the dependency on `aligned` (and thus `as-slice` and the 2 versions of `generic-array`), instead providing our own simplified `Aligned` wrapper
* Moves the innards of `write_aligned` to its own function, and calls that from `write_all` instead of transmuting `&[u8]` to `&Aligned<A4, [u8]>` (which is likely UB)
* Fixes the doc example, which didn't compile anymore
* Sinks the `#[allow]` attributes into the functions so they only cover the statements they need to
Closes https://github.com/rust-embedded/cortex-m/issues/184
Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
|
|
|
|
|
|
187: 0.6.2 r=therealprof a=jonas-schievink
Closes #185
Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
|
|
Even though this cfg isn't currently used, printing it doesn't hurt, and
it avoids a Clippy lint
|
|
|
|
|
|
The SAU is a Armv8-M core peripheral that, alongside the Implementation
Defined Attribution Unit, manages the security attribution of the memory
zones.
This driver provides abstraction to help setting the SAU up.
Signed-off-by: Hugues de Valon <hugues.devalon@arm.com>
|
|
175: Enable the missing_inline_in_public_items clippy lint. r=jonas-schievink a=m-ou-se
This adds `#![deny(clippy::missing_inline_in_public_items)]` to make sure all functions in this crate are marked `#[inline]`, unless they are explicitly marked with `#[allow(clippy::missing_inline_in_public_items)]`.
Only three functions in this crate are not `#[inline]`:
- `write_words`
- `write_all`
- `write_aligned`
Additionally, the derived `Debug` impl's also have a non-inline implementations.
This unfortunately means that the allow attribute also needs to added to any types deriving `Debug`.
See also #171 and https://github.com/rust-embedded/cortex-m/pull/174#issuecomment-547304467.
Co-authored-by: Mara Bos <m-ou.se@m-ou.se>
|
|
|
|
|
|
171: Add `#[inline]` to lots of trivial functions. r=korken89 a=m-ou-se
Now the only public non-inline functions left are:
- `write_all`
- `write_aligned`
- All (derived) `Debug` implementations
(Checked using Clippy's [`missing_inline_in_public_items`][1] lint.)
[1]: https://rust-lang.github.io/rust-clippy/master/#missing_inline_in_public_items
Co-authored-by: Mara Bos <m-ou.se@m-ou.se>
|