Skip to content

Commit d52b84c

Browse files
committed
Auto merge of #76 - japaric:thumbv6m, r=japaric
hide ARMv7-M only peripherals on thumbv6m-none-eabi None
2 parents bc31511 + a8962d4 commit d52b84c

File tree

9 files changed

+83
-41
lines changed

9 files changed

+83
-41
lines changed

src/lib.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ mod macros;
2424
pub mod asm;
2525
pub mod exception;
2626
pub mod interrupt;
27+
// NOTE(target_arch) is for documentation purposes
28+
#[cfg(any(armv7m, target_arch = "x86_64"))]
2729
pub mod itm;
2830
pub mod peripheral;
2931
pub mod register;

src/peripheral/cbp.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
//! Cache and branch predictor maintenance operations
2+
//!
3+
//! *NOTE* Available only on ARMv7-M (`thumbv7*m-none-eabi*`)
24
35
use volatile_register::WO;
46

src/peripheral/cpuid.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
//! CPUID
22
33
use volatile_register::RO;
4-
#[cfg(any(armv7m, test))]
4+
#[cfg(any(armv7m, target_arch = "x86_64"))]
55
use volatile_register::RW;
66

7-
#[cfg(armv7m)]
7+
#[cfg(any(armv7m, target_arch = "x86_64"))]
88
use peripheral::CPUID;
99

1010
/// Register block
@@ -25,29 +25,29 @@ pub struct RegisterBlock {
2525
pub isar: [RO<u32>; 5],
2626
reserved1: u32,
2727
/// Cache Level ID
28-
#[cfg(any(armv7m, test))]
28+
#[cfg(any(armv7m, target_arch = "x86_64"))]
2929
pub clidr: RO<u32>,
3030
/// Cache Type
31-
#[cfg(any(armv7m, test))]
31+
#[cfg(any(armv7m, target_arch = "x86_64"))]
3232
pub ctr: RO<u32>,
3333
/// Cache Size ID
34-
#[cfg(any(armv7m, test))]
34+
#[cfg(any(armv7m, target_arch = "x86_64"))]
3535
pub ccsidr: RO<u32>,
3636
/// Cache Size Selection
37-
#[cfg(any(armv7m, test))]
37+
#[cfg(any(armv7m, target_arch = "x86_64"))]
3838
pub csselr: RW<u32>,
3939
}
4040

4141
/// Type of cache to select on CSSELR writes.
42-
#[cfg(armv7m)]
42+
#[cfg(any(armv7m, target_arch = "x86_64"))]
4343
pub enum CsselrCacheType {
4444
/// Select DCache or unified cache
4545
DataOrUnified = 0,
4646
/// Select ICache
4747
Instruction = 1,
4848
}
4949

50-
#[cfg(armv7m)]
50+
#[cfg(any(armv7m, target_arch = "x86_64"))]
5151
impl CPUID {
5252
/// Selects the current CCSIDR
5353
///

src/peripheral/fpb.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
//! Flash Patch and Breakpoint unit
2+
//!
3+
//! *NOTE* Available only on ARMv7-M (`thumbv7*m-none-eabi*`)
24
35
use volatile_register::{RO, RW, WO};
46

src/peripheral/fpu.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,19 @@
11
//! Floating Point Unit
2+
//!
3+
//! *NOTE* Available only on ARMv7E-M (`thumbv7em-none-eabihf`)
24
3-
#[cfg(any(has_fpu, test))]
45
use volatile_register::{RO, RW};
56

67
/// Register block
78
#[repr(C)]
89
pub struct RegisterBlock {
910
reserved: u32,
1011
/// Floating Point Context Control
11-
#[cfg(any(has_fpu, test))]
1212
pub fpccr: RW<u32>,
1313
/// Floating Point Context Address
14-
#[cfg(any(has_fpu, test))]
1514
pub fpcar: RW<u32>,
1615
/// Floating Point Default Status Control
17-
#[cfg(any(has_fpu, test))]
1816
pub fpdscr: RW<u32>,
1917
/// Media and FP Feature
20-
#[cfg(any(has_fpu, test))]
2118
pub mvfr: [RO<u32>; 3],
2219
}

src/peripheral/itm.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
//! Instrumentation Trace Macrocell
2+
//!
3+
//! *NOTE* Available only on ARMv7-M (`thumbv7*m-none-eabi*`)
24
35
use core::cell::UnsafeCell;
46
use core::ptr;

0 commit comments

Comments
 (0)