Skip to content

Commit d06833e

Browse files
Merge branch 'main' into vbar-available-for-armv7a
2 parents 422978e + 6770083 commit d06833e

3 files changed

Lines changed: 13 additions & 0 deletions

File tree

aarch32-cpu/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
99

1010
- Added `Iciallu` register which allows invalidating the instruction cache.
1111
- `register::vbar` and `register::Vbar` are also available for ARMv7-A now.
12+
- Added `defmt` implementations for PMSA types.
1213

1314
## [aarch32-cpu v0.2.0]
1415

aarch32-cpu/src/pmsav7.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,7 @@ impl Mpu {
189189

190190
/// Configuration for the PMSAv7 MPU
191191
#[derive(Clone, Debug, PartialEq, Eq)]
192+
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
192193
pub struct Config<'a> {
193194
/// Background Config Enable
194195
///
@@ -202,6 +203,7 @@ pub struct Config<'a> {
202203

203204
/// Configuration for a region in the PMSAv7 MPU
204205
#[derive(Clone, Debug, PartialEq, Eq)]
206+
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
205207
pub struct Region {
206208
/// The base address of this region.
207209
///
@@ -232,6 +234,7 @@ unsafe impl Sync for Region {}
232234

233235
/// Describes the memory ordering and cacheability of a region
234236
#[derive(Debug, Clone, PartialEq, Eq)]
237+
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
235238
pub enum MemAttr {
236239
/// Strongly-ordered memory
237240
StronglyOrdered,
@@ -348,6 +351,7 @@ impl MemAttr {
348351

349352
/// A representation of Memory Attributes suitable for sticking into the RACR register
350353
#[derive(Debug, Clone, PartialEq, Eq)]
354+
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
351355
struct MemAttrBits {
352356
tex: u3,
353357
c: bool,

aarch32-cpu/src/pmsav8.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ pub use register::prbar::{AccessPerms as El1AccessPerms, Shareability as El1Shar
1717

1818
/// Ways this API can fail
1919
#[derive(Debug, Clone, PartialEq, Eq)]
20+
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
2021
pub enum Error {
2122
/// Found too many regions
2223
TooManyRegions,
@@ -363,6 +364,7 @@ impl El2Mpu {
363364

364365
/// Configuration for the PMSAv8-32 EL1 MPU
365366
#[derive(Clone, Debug, PartialEq, Eq)]
367+
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
366368
pub struct El1Config<'a> {
367369
/// Background Config Enable
368370
///
@@ -380,6 +382,7 @@ pub struct El1Config<'a> {
380382

381383
/// Configuration for the PMSAv8-32 MPU
382384
#[derive(Clone, Debug, PartialEq, Eq)]
385+
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
383386
pub struct El1Region {
384387
/// The range of the region
385388
///
@@ -408,6 +411,7 @@ unsafe impl Sync for El1Region {}
408411

409412
/// Configuration for the PMSAv8-32 EL2 MPU
410413
#[derive(Clone, Debug, PartialEq, Eq)]
414+
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
411415
pub struct El2Config<'a> {
412416
/// Background Config Enable
413417
///
@@ -425,6 +429,7 @@ pub struct El2Config<'a> {
425429

426430
/// Configuration for the PMSAv8-32 EL2 MPU
427431
#[derive(Clone, Debug, PartialEq, Eq)]
432+
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
428433
pub struct El2Region {
429434
/// The range of the region
430435
///
@@ -453,6 +458,7 @@ unsafe impl Sync for El2Region {}
453458

454459
/// Describes the memory ordering and cacheability of a region
455460
#[derive(Debug, Clone, PartialEq, Eq)]
461+
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
456462
pub enum MemAttr {
457463
/// Strongly-ordered memory
458464
StronglyOrdered,
@@ -484,6 +490,7 @@ impl MemAttr {
484490

485491
/// Cacheability of a region
486492
#[derive(Debug, Clone, PartialEq, Eq)]
493+
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
487494
pub enum CachePolicy {
488495
/// Normal memory, Outer Write-Through Transient
489496
WriteThroughTransient(RwAllocPolicy),
@@ -512,6 +519,7 @@ impl CachePolicy {
512519

513520
/// Cache allocation policy
514521
#[derive(Copy, Debug, Clone, PartialEq, Eq)]
522+
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
515523
#[repr(u8)]
516524
pub enum RwAllocPolicy {
517525
/// Write-allocate

0 commit comments

Comments
 (0)