1
1
//! CPUID
2
2
3
3
use volatile_register:: RO ;
4
- #[ cfg( any ( armv7m , target_arch = "x86_64" ) ) ]
4
+ #[ cfg( not ( armv6m ) ) ]
5
5
use volatile_register:: RW ;
6
6
7
- #[ cfg( any ( armv7m , target_arch = "x86_64" ) ) ]
7
+ #[ cfg( not ( armv6m ) ) ]
8
8
use peripheral:: CPUID ;
9
9
10
10
/// Register block
11
11
#[ repr( C ) ]
12
12
pub struct RegisterBlock {
13
13
/// CPUID base
14
14
pub base : RO < u32 > ,
15
- reserved0 : [ u32 ; 15 ] ,
16
- /// Processor Feature
15
+
16
+ _reserved0 : [ u32 ; 15 ] ,
17
+
18
+ /// Processor Feature (not present on Cortex-M0 variants)
19
+ #[ cfg( not( armv6m) ) ]
17
20
pub pfr : [ RO < u32 > ; 2 ] ,
18
- /// Debug Feature
21
+ #[ cfg( armv6m) ]
22
+ _reserved1 : [ u32 ; 2 ] ,
23
+
24
+ /// Debug Feature (not present on Cortex-M0 variants)
25
+ #[ cfg( not( armv6m) ) ]
19
26
pub dfr : RO < u32 > ,
20
- /// Auxiliary Feature
27
+ #[ cfg( armv6m) ]
28
+ _reserved2 : u32 ,
29
+
30
+ /// Auxiliary Feature (not present on Cortex-M0 variants)
31
+ #[ cfg( not( armv6m) ) ]
21
32
pub afr : RO < u32 > ,
22
- /// Memory Model Feature
33
+ #[ cfg( armv6m) ]
34
+ _reserved3 : u32 ,
35
+
36
+ /// Memory Model Feature (not present on Cortex-M0 variants)
37
+ #[ cfg( not( armv6m) ) ]
23
38
pub mmfr : [ RO < u32 > ; 4 ] ,
24
- /// Instruction Set Attribute
39
+ #[ cfg( armv6m) ]
40
+ _reserved4 : [ u32 ; 4 ] ,
41
+
42
+ /// Instruction Set Attribute (not present on Cortex-M0 variants)
43
+ #[ cfg( not( armv6m) ) ]
25
44
pub isar : [ RO < u32 > ; 5 ] ,
26
- reserved1 : u32 ,
27
- /// Cache Level ID
28
- #[ cfg( any( armv7m, target_arch = "x86_64" ) ) ]
45
+ #[ cfg( armv6m) ]
46
+ _reserved5 : [ u32 ; 5 ] ,
47
+
48
+ _reserved6 : u32 ,
49
+
50
+ /// Cache Level ID (only present on Cortex-M7)
51
+ #[ cfg( not( armv6m) ) ]
29
52
pub clidr : RO < u32 > ,
30
- /// Cache Type
31
- #[ cfg( any( armv7m, target_arch = "x86_64" ) ) ]
53
+
54
+ /// Cache Type (only present on Cortex-M7)
55
+ #[ cfg( not( armv6m) ) ]
32
56
pub ctr : RO < u32 > ,
33
- /// Cache Size ID
34
- #[ cfg( any( armv7m, target_arch = "x86_64" ) ) ]
57
+
58
+ /// Cache Size ID (only present on Cortex-M7)
59
+ #[ cfg( not( armv6m) ) ]
35
60
pub ccsidr : RO < u32 > ,
36
- /// Cache Size Selection
37
- #[ cfg( any( armv7m, target_arch = "x86_64" ) ) ]
61
+
62
+ /// Cache Size Selection (only present on Cortex-M7)
63
+ #[ cfg( not( armv6m) ) ]
38
64
pub csselr : RW < u32 > ,
39
65
}
40
66
@@ -47,7 +73,7 @@ pub enum CsselrCacheType {
47
73
Instruction = 1 ,
48
74
}
49
75
50
- #[ cfg( any ( armv7m , target_arch = "x86_64" ) ) ]
76
+ #[ cfg( not ( armv6m ) ) ]
51
77
impl CPUID {
52
78
/// Selects the current CCSIDR
53
79
///
0 commit comments