Skip to content

Commit 6f4f5e4

Browse files
committed
lib: regs: support usize
Necessary for 32 or 64 bit RISC-V platforms.
1 parent 3501d5b commit 6f4f5e4

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

libraries/tock-register-interface/src/registers.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ IntLike_impl_for!(u16);
9494
IntLike_impl_for!(u32);
9595
IntLike_impl_for!(u64);
9696
IntLike_impl_for!(u128);
97+
IntLike_impl_for!(usize);
9798

9899
/// Descriptive name for each register.
99100
pub trait RegisterLongName {}
@@ -439,6 +440,7 @@ From_impl_for!(u16);
439440
From_impl_for!(u32);
440441
From_impl_for!(u64);
441442
From_impl_for!(u128);
443+
From_impl_for!(usize);
442444

443445
/// In memory volatile register.
444446
// To successfully alias this structure onto hardware registers in memory, this
@@ -565,6 +567,7 @@ Field_impl_for!(u16);
565567
Field_impl_for!(u32);
566568
Field_impl_for!(u64);
567569
Field_impl_for!(u128);
570+
Field_impl_for!(usize);
568571

569572
/// Values for the specific register fields.
570573
///
@@ -607,6 +610,7 @@ FieldValue_impl_for!(u16);
607610
FieldValue_impl_for!(u32);
608611
FieldValue_impl_for!(u64);
609612
FieldValue_impl_for!(u128);
613+
FieldValue_impl_for!(usize);
610614

611615
impl<T: IntLike, R: RegisterLongName> FieldValue<T, R> {
612616
/// Get the raw bitmask represented by this FieldValue.

0 commit comments

Comments
 (0)