1
0
mirror of https://github.com/rcore-os/rCore.git synced 2024-11-23 08:26:17 +04:00

Fix memory::cow LLVM error for RV32

This commit is contained in:
WangRunji 2018-07-12 19:35:21 +08:00
parent 5530549a54
commit 7d856fe009
2 changed files with 3 additions and 5 deletions

View File

@ -104,15 +104,15 @@ impl<T: PageTable> DerefMut for CowExt<T> {
/// A map contains reference count for shared frame /// A map contains reference count for shared frame
#[derive(Default)] #[derive(Default)]
struct FrameRcMap(BTreeMap<Frame, (u8, u8)>); struct FrameRcMap(BTreeMap<Frame, (u16, u16)>);
type Frame = usize; type Frame = usize;
impl FrameRcMap { impl FrameRcMap {
fn read_count(&mut self, frame: &Frame) -> u8 { fn read_count(&mut self, frame: &Frame) -> u16 {
self.0.get(frame).unwrap_or(&(0, 0)).0 self.0.get(frame).unwrap_or(&(0, 0)).0
} }
fn write_count(&mut self, frame: &Frame) -> u8 { fn write_count(&mut self, frame: &Frame) -> u16 {
self.0.get(frame).unwrap_or(&(0, 0)).1 self.0.get(frame).unwrap_or(&(0, 0)).1
} }
fn read_increase(&mut self, frame: &Frame) { fn read_increase(&mut self, frame: &Frame) {

View File

@ -11,8 +11,6 @@ extern crate alloc;
extern crate std; extern crate std;
pub mod paging; pub mod paging;
// FIXME: LLVM error on riscv32
#[cfg(target_arch = "x86_64")]
pub mod cow; pub mod cow;
pub mod swap; pub mod swap;
pub mod memory_set; pub mod memory_set;