Skip to content

Commit a4c30d5

Browse files
retragerbradford
authored andcommitted
aarch64: Use aarch64_cpu::registers traits
Signed-off-by: Akira Moroo <retrage01@gmail.com>
1 parent 128d513 commit a4c30d5

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

src/arch/aarch64/paging.rs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,10 @@
44

55
use core::ops::RangeInclusive;
66

7-
use aarch64_cpu::{asm::barrier, registers::*};
8-
use tock_registers::interfaces::{ReadWriteable, Readable, Writeable};
7+
use aarch64_cpu::{
8+
asm::barrier,
9+
registers::{Readable, Writeable, *},
10+
};
911

1012
use self::interface::Mmu;
1113

@@ -287,7 +289,10 @@ impl interface::Mmu for MemoryManagementUnit {
287289
barrier::isb(barrier::SY);
288290

289291
// Enable the MMU and turn on data and instruction caching.
290-
SCTLR_EL1.modify(SCTLR_EL1::M::Enable + SCTLR_EL1::C::Cacheable + SCTLR_EL1::I::Cacheable);
292+
SCTLR_EL1.modify_no_read(
293+
SCTLR_EL1.extract(),
294+
SCTLR_EL1::M::Enable + SCTLR_EL1::C::Cacheable + SCTLR_EL1::I::Cacheable,
295+
);
291296

292297
// Force MMU init to complete before next instruction.
293298
barrier::isb(barrier::SY);

src/arch/aarch64/simd.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22
// Copyright (C) 2023 Akira Moroo
33

44
use aarch64_cpu::registers::*;
5-
use tock_registers::interfaces::ReadWriteable;
65

76
pub fn setup_simd() {
8-
CPACR_EL1.modify(CPACR_EL1::FPEN::TrapNothing);
7+
CPACR_EL1.modify_no_read(CPACR_EL1.extract(), CPACR_EL1::FPEN::TrapNothing);
98
}

0 commit comments

Comments
 (0)