Skip to content

Commit

Permalink
update memory_addr to (yet to publish) v0.3
Browse files Browse the repository at this point in the history
  • Loading branch information
aarkegz committed Aug 26, 2024
1 parent 2d47ae1 commit db44428
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ categories = ["os", "hardware-support", "memory-management", "no-std"]

[patch.crates-io]
# todo: update to new version of `memory_addr` on `crates.io` once it get released
memory_addr = { git = "https://github.com/arceos-hypervisor/memory_addr.git", rev = "2b628c9" }
memory_addr = { git = "https://github.com/arceos-org/memory_addr.git", rev = "46c06e5" }
2 changes: 1 addition & 1 deletion page_table_entry/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ arm-el2 = []

[dependencies]
bitflags = "2.6"
memory_addr = "0.2"
memory_addr = "0.3"

[target.'cfg(any(target_arch = "aarch64", doc))'.dependencies]
aarch64-cpu = "9.4"
Expand Down
2 changes: 1 addition & 1 deletion page_table_multiarch/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ categories.workspace = true

[dependencies]
log = "0.4"
memory_addr = "0.2"
memory_addr = "0.3"
page_table_entry = { path = "../page_table_entry", version = "0.3" }

[target.'cfg(any(target_arch = "x86_64", doc))'.dependencies]
Expand Down
2 changes: 1 addition & 1 deletion page_table_multiarch/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Currently supported architectures and page table structures:
## Examples (x86_64)

```rust
use memory_addr::{PhysAddr, VirtAddr};
use memory_addr::{MemoryAddr, PhysAddr, VirtAddr};
use page_table_multiarch::x86_64::{X64PageTable};
use page_table_multiarch::{MappingFlags, PagingHandler, PageSize};

Expand Down
4 changes: 2 additions & 2 deletions page_table_multiarch/src/bits64.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ extern crate alloc;
use crate::{GenericPTE, PagingHandler, PagingMetaData};
use crate::{MappingFlags, PageSize, PagingError, PagingResult, TlbFlush, TlbFlushAll};
use core::marker::PhantomData;
use memory_addr::{PhysAddr, PAGE_SIZE_4K};
use memory_addr::{PhysAddr, PAGE_SIZE_4K, MemoryAddr};

const ENTRY_COUNT: usize = 512;

Expand Down Expand Up @@ -139,7 +139,7 @@ impl<M: PagingMetaData, PTE: GenericPTE, H: PagingHandler> PageTable64<M, PTE, H
return Err(PagingError::NotMapped);
}
let off = size.align_offset(vaddr.into());
Ok((entry.paddr() + off, entry.flags(), size))
Ok((entry.paddr().add(off), entry.flags(), size))
}

/// Maps a contiguous virtual memory region to a contiguous physical memory
Expand Down

0 comments on commit db44428

Please sign in to comment.