Line data Source code
1 : pub struct ArmCpu { 2 : processor: Processor, 3 : } 4 : 5 : pub enum Processor { 6 : /// RISC ARM processor that implements the ARMv5TE architecture. 7 : Arm9, 8 : /// RISC ARM processor that implements the ARMv6K architecture. 9 : Arm11, 10 : } 11 : 12 : impl Default for ArmCpu { 13 : /// Creates a new [`ArmCpu`] with a [`Processor::Arm9`] processor. 14 0 : fn default() -> Self { 15 0 : Self { processor: Processor::Arm9 } 16 0 : } 17 : } 18 : 19 : impl ArmCpu { 20 : /// Creates a new [`ArmCpu`] with the given [`Processor`]. 21 0 : fn new(processor: Processor) -> Self { 22 0 : Self { processor } 23 0 : } 24 : }