Skip to content

Commit

Permalink
update page tabe
Browse files Browse the repository at this point in the history
  • Loading branch information
ZR233 committed Jan 23, 2025
1 parent 11abc21 commit 8fbee85
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 11 deletions.
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion crates/sparreal-kernel/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ buddy_system_allocator = "0.11"
sparreal-macros = { version = "0.6", path = "../sparreal-macros" }
driver-interface = { version = "0.2", path = "../driver-interface" }
memory_addr = "0.3"
page-table-generic = { version = "0.4" }
page-table-generic = { version = "0.5" }
fdt-parser = "0.4"
lock_api = "0.4"
pasts = { version = "0.14", default-features = false }
Expand Down
2 changes: 1 addition & 1 deletion crates/sparreal-kernel/src/mem/mmu/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ pub fn new_boot_table(rsv: &[BootMemoryRegion]) -> Result<usize, &'static str> {
name: "debugcon",
range: start..start + 0x1000,
access: AccessSetting::Read | AccessSetting::Write | AccessSetting::Execute,
cache: CacheSetting::DeviceBidirectional,
cache: CacheSetting::Device,
},
&mut access,
);
Expand Down
4 changes: 2 additions & 2 deletions crates/sparreal-kernel/src/mem/mmu/paging.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ pub fn init_table() {
vaddr.into(),
reg.into(),
AccessSetting::Read | AccessSetting::Write,
CacheSetting::DeviceBidirectional,
CacheSetting::Device,
),
0x1000,
true,
Expand Down Expand Up @@ -133,7 +133,7 @@ pub fn iomap(paddr: PhysAddr, size: usize) -> NonNull<u8> {
vaddr.into(),
paddr.as_usize(),
AccessSetting::Read | AccessSetting::Write,
CacheSetting::DeviceBidirectional,
CacheSetting::Device,
),
size,
true,
Expand Down
2 changes: 1 addition & 1 deletion crates/sparreal-rt/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ early-print = []

[dependencies]
log = "0.4"
page-table-generic = { version = "0.4" }
page-table-generic = { version = "0.5" }
futures = { version = "0.3", default-features = false, features = ["alloc"] }
sparreal-macros = { version = "0.6", path = "../sparreal-macros" }
sparreal-kernel = { version = "0.6", path = "../sparreal-kernel", features = [
Expand Down
6 changes: 2 additions & 4 deletions crates/sparreal-rt/src/arch/aarch64/mmu.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,8 @@ impl MMU for PageTableImpl {

pte.set_mair_idx(MAIRDefault::get_idx(match config.setting.cache_setting {
CacheSetting::Normal => MAIRKind::Normal,
CacheSetting::DeviceBidirectional => MAIRKind::Device,
CacheSetting::Device => MAIRKind::Device,
CacheSetting::NonCache => MAIRKind::NonCache,
CacheSetting::ToDevice => MAIRKind::Device,
CacheSetting::FromDevice => MAIRKind::Device,
}));

let privilege = &config.setting.privilege_access;
Expand Down Expand Up @@ -105,7 +103,7 @@ impl MMU for PageTableImpl {
let mair_idx = pte.get_mair_idx();

cache_setting = match MAIRDefault::from_idx(mair_idx) {
MAIRKind::Device => CacheSetting::DeviceBidirectional,
MAIRKind::Device => CacheSetting::Device,
MAIRKind::Normal => CacheSetting::Normal,
MAIRKind::NonCache => CacheSetting::NonCache,
};
Expand Down

0 comments on commit 8fbee85

Please sign in to comment.