Fix mmap clashing with temporary map addr. Add riscv toolchains in travis CI

master
Jiajie Chen 6 years ago
parent fcfe677bcc
commit 10e883d56f

@ -73,6 +73,26 @@ install:
sudo apt install libfuse-dev;
fi
- if [ $ARCH = riscv32 ]; then
if [ $TRAVIS_OS_NAME = linux ]; then
sudo apt update;
sudo apt install linux-headers-$(uname -r);
wget https://musl.cc/riscv32-linux-musl-cross.tgz;
tar -xvf riscv32-linux-musl-cross.tgz;
export PATH=$PATH:$PWD/riscv32-linux-musl-cross/bin;
fi;
fi
- if [ $ARCH = riscv64 ]; then
if [ $TRAVIS_OS_NAME = linux ]; then
sudo apt update;
sudo apt install linux-headers-$(uname -r);
wget https://musl.cc/riscv64-linux-musl-cross.tgz;
tar -xvf riscv64-linux-musl-cross.tgz;
export PATH=$PATH:$PWD/riscv64-linux-musl-cross/bin;
fi;
fi
before_script:
- rustup component add rust-src
- (test -x $HOME/.cargo/bin/cargo-xbuild || cargo install cargo-xbuild)

@ -3,6 +3,9 @@
use super::*;
pub trait PageTableExt: PageTable {
// Take some special care here.
// TEMP_PAGE_ADDR mapping might be overwritten in the `f` below.
// So this should be really high in kernel space when necessary.
const TEMP_PAGE_ADDR: VirtAddr = 0xcafeb000;
fn with_temporary_map<T, D>(&mut self, target: PhysAddr, f: impl FnOnce(&mut Self, &mut D) -> T) -> T {

@ -11,6 +11,7 @@ use x86_64::structures::paging::{
frame::PhysFrame as Frame,
FrameAllocator, FrameDeallocator
};
use crate::consts::KERNEL_OFFSET;
use log::*;
pub trait PageExt {
@ -69,7 +70,9 @@ impl PageTable for ActivePageTable {
}
}
impl PageTableExt for ActivePageTable {}
impl PageTableExt for ActivePageTable {
const TEMP_PAGE_ADDR: usize = KERNEL_OFFSET | 0xcafeb000;
}
impl ActivePageTable {
pub unsafe fn new() -> Self {

Loading…
Cancel
Save