Commit fb274cb2 authored by Arthur Carlsson's avatar Arthur Carlsson

rustfmt

parent 22f7eb86
Pipeline #15867235 passed with stage
in 10 minutes and 11 seconds
......@@ -17,7 +17,8 @@ impl Cpu {
/// TODO: Maybe handle this as an exception which sets an exception bit?
pub fn power_on_reset(&mut self) {
self.regs.pc = 0xFFFF_FFFF_BFC0_0000;
self.regs.status -= reg::Status::STATUS_DS_TS | reg::Status::STATUS_DS_SR | reg::Status::STATUS_RP;
self.regs.status -=
reg::Status::STATUS_DS_TS | reg::Status::STATUS_DS_SR | reg::Status::STATUS_RP;
self.regs.config -= reg::Config::CONFIG_EP;
self.regs.status |= reg::Status::STATUS_ERL | reg::Status::STATUS_DS_BEV;
self.regs.config |= reg::Config::CONFIG_BE;
......
......@@ -44,7 +44,8 @@ impl Status {
/// Supervisor mode segment as per "Table 5-2 32-Bit and 64-Bit Supervisor Mode Segments"
pub fn is_supervisor_mode_address_segments(&self) -> bool {
(*self & Status::STATUS_KSU).bits == 0b01000 && !self.intersects(Status::STATUS_EXL | Status::STATUS_ERL)
(*self & Status::STATUS_KSU).bits == 0b01000
&& !self.intersects(Status::STATUS_EXL | Status::STATUS_ERL)
}
}
......@@ -100,7 +101,10 @@ mod tests {
#[test]
fn test_is_kernel_mode_address_segment() {
assert!((Status::STATUS_EXL | Status::STATUS_ERL | Status::STATUS_KX).is_kernel_mode_address_segment());
assert!(
(Status::STATUS_EXL | Status::STATUS_ERL | Status::STATUS_KX)
.is_kernel_mode_address_segment()
);
}
#[test]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment