aarch64: format paging.rs

toolchain_update
equation314 6 years ago
parent a0b948fb53
commit 67b920cc16

2
kernel/Cargo.lock generated

@ -263,8 +263,6 @@ dependencies = [
"uart_16550 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"ucore-memory 0.1.0",
"ucore-process 0.1.0",
"usize_conversions 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
"ux 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
"volatile 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)",
"x86_64 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)",
"xmas-elf 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)",

@ -33,10 +33,6 @@ ucore-memory = { path = "../crate/memory" }
ucore-process = { path = "../crate/process" }
simple-filesystem = { git = "https://github.com/wangrunji0408/SimpleFileSystem-Rust" }
[dependencies.ux]
default-features = false
version = "0.1.0"
[target.'cfg(target_arch = "x86_64")'.dependencies]
bootloader = "0.3"
x86_64 = "0.2.11"
@ -49,7 +45,6 @@ bbl = { path = "../crate/bbl" }
[target.'cfg(target_arch = "aarch64")'.dependencies]
cortex-a = "2.2.1"
usize_conversions = "0.2.0"
atags = { path = "../crate/atags" }
bcm2837 = { path = "../crate/bcm2837", features = ["use_generic_timer"] }

@ -10,6 +10,7 @@ pub fn init() {
unsafe {
HEAP_ALLOCATOR.lock().init(start, end - start);
}
info!("memory: init end");
}
extern "C" {

@ -1,9 +1,6 @@
//! Entrance and initialization for aarch64.
extern crate atags;
extern crate bitflags;
extern crate usize_conversions;
pub extern crate ux;
pub mod io;
pub mod paging;
@ -23,11 +20,16 @@ pub extern "C" fn rust_main() -> ! {
// Init board to enable serial port.
board::init();
// First init log mod, so that we can print log info.
// FIXME
::logging::init();
let (start, end) = memory::memory_map().expect("failed to find memory map");
println!("The value of start is: {}, end is {}", start, end);
println!("The value of start is: {:#x?}, end is {:#x?}", start, end);
interrupt::init();
memory::init();
println!("memory init over");
timer::init();
//let mut v = vec![];
//for i in 0..1000 {
@ -35,12 +37,6 @@ pub extern "C" fn rust_main() -> ! {
// println!("{:?}", v);
//}
// First init log mod, so that we can print log info.
// FIXME
::logging::init();
interrupt::init();
timer::init();
::process::init();
unsafe { interrupt::enable(); }

@ -3,11 +3,11 @@
use ucore_memory::memory_set::*;
use ucore_memory::paging::*;
type VirtAddr=usize;
type PhysAddr=usize;
type VirtAddr = usize;
type PhysAddr = usize;
use alloc::alloc::{alloc, Layout};
use memory::alloc_stack;
use memory::{active_table, alloc_frame, alloc_stack, dealloc_frame};
/// TODO
pub struct ActivePageTable {
@ -36,7 +36,7 @@ impl PageTable for ActivePageTable {
}
// For testing with mock
fn get_page_slice_mut<'a,'b>(&'a mut self, addr: VirtAddr) -> &'b mut [u8] {
fn get_page_slice_mut<'a, 'b>(&'a mut self, addr: VirtAddr) -> &'b mut [u8] {
unimplemented!()
}
@ -82,7 +82,6 @@ impl Entry for PageEntry {
unimplemented!()
}
fn clear_accessed(&mut self) {
unimplemented!()
}
@ -99,7 +98,6 @@ impl Entry for PageEntry {
unimplemented!()
}
fn target(&self) -> PhysAddr {
unimplemented!()
}
@ -108,7 +106,6 @@ impl Entry for PageEntry {
unimplemented!()
}
// For Copy-on-write extension
fn writable_shared(&self) -> bool {
unimplemented!()
@ -126,7 +123,6 @@ impl Entry for PageEntry {
unimplemented!()
}
// For Swap extension
fn swapped(&self) -> bool {
unimplemented!()
@ -136,7 +132,6 @@ impl Entry for PageEntry {
unimplemented!()
}
fn user(&self) -> bool {
unimplemented!()
}
@ -152,7 +147,6 @@ impl Entry for PageEntry {
fn set_execute(&mut self, value: bool) {
unimplemented!()
}
}
#[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord)]
@ -186,14 +180,16 @@ impl InactivePageTable for InactivePageTable0 {
type Active = ActivePageTable;
fn new() -> Self {
unsafe {let layout = Layout::new::<u64>();
let ptr = alloc(layout);
let frame = MockFrame::of_addr(*ptr as usize);
InactivePageTable0 { p4_frame: frame }}
unsafe {
let layout = Layout::new::<u64>();
let ptr = alloc(layout);
let frame = MockFrame::of_addr(*ptr as usize);
InactivePageTable0 { p4_frame: frame }
}
}
fn new_bare() -> Self {
Self::new()
unimplemented!()
}
fn edit(&mut self, f: impl FnOnce(&mut Self::Active)) {
@ -201,11 +197,11 @@ impl InactivePageTable for InactivePageTable0 {
}
unsafe fn activate(&self) {
unimplemented!()
}
unsafe fn with(&self, f: impl FnOnce()) {
unimplemented!()
}
fn token(&self) -> usize {
@ -213,11 +209,11 @@ impl InactivePageTable for InactivePageTable0 {
}
fn alloc_frame() -> Option<PhysAddr> {
unimplemented!()
alloc_frame()
}
fn dealloc_frame(target: PhysAddr) {
dealloc_frame(target)
}
fn alloc_stack() -> Stack {

@ -9,7 +9,6 @@
#![feature(panic_info_message)]
#![feature(global_asm)]
#![feature(compiler_builtins_lib)]
#![feature(try_from)]
#![no_std]
@ -34,7 +33,6 @@ extern crate volatile;
#[cfg(target_arch = "x86_64")]
extern crate x86_64;
extern crate xmas_elf;
extern crate usize_conversions;
use linked_list_allocator::LockedHeap;

Loading…
Cancel
Save