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

Format code and update debug code

This commit is contained in:
Jiajie Chen 2019-06-03 09:33:02 +08:00
parent 33513ded94
commit 8b06314828
8 changed files with 468 additions and 350 deletions

6
kernel/Cargo.lock generated
View File

@ -51,7 +51,7 @@ dependencies = [
[[package]]
name = "bcm2837"
version = "1.0.0"
source = "git+https://github.com/GeminiLab/bcm2837#bf1e4ec63c52827bc199399f214f39a4fdcbe228"
source = "git+https://github.com/rcore-os/bcm2837#bf1e4ec63c52827bc199399f214f39a4fdcbe228"
dependencies = [
"aarch64 2.6.1 (git+https://github.com/rcore-os/aarch64)",
"volatile 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)",
@ -374,7 +374,7 @@ version = "0.2.0"
dependencies = [
"aarch64 2.6.1 (git+https://github.com/rcore-os/aarch64)",
"apic 0.1.0 (git+https://github.com/rcore-os/apic-rs)",
"bcm2837 1.0.0 (git+https://github.com/GeminiLab/bcm2837)",
"bcm2837 1.0.0 (git+https://github.com/rcore-os/bcm2837)",
"bit_field 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
"bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)",
"bitmap-allocator 0.1.0 (git+https://github.com/rcore-os/bitmap-allocator)",
@ -688,7 +688,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
"checksum array-init 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "23589ecb866b460d3a0f1278834750268c607e8e28a1b982c907219f3178cd72"
"checksum as-slice 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "293dac66b274fab06f95e7efb05ec439a6b70136081ea522d270bc351ae5bb27"
"checksum bare-metal 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)" = "a3caf393d93b2d453e80638d0674597020cef3382ada454faacd43d1a55a735a"
"checksum bcm2837 1.0.0 (git+https://github.com/GeminiLab/bcm2837)" = "<none>"
"checksum bcm2837 1.0.0 (git+https://github.com/rcore-os/bcm2837)" = "<none>"
"checksum bit_field 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ed8765909f9009617974ab6b7d332625b320b33c326b1e9321382ef1999b5d56"
"checksum bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "228047a76f468627ca71776ecdebd732a3423081fcf5125585bcd7c49886ce12"
"checksum bitmap-allocator 0.1.0 (git+https://github.com/rcore-os/bitmap-allocator)" = "<none>"

View File

@ -81,7 +81,7 @@ riscv = { git = "https://github.com/rcore-os/riscv", features = ["inline-asm"] }
[target.'cfg(target_arch = "aarch64")'.dependencies]
aarch64 = { git = "https://github.com/rcore-os/aarch64", version = "2.6.1" }
bcm2837 = { git = "https://github.com/GeminiLab/bcm2837", version = "1.0.0", optional = true }
bcm2837 = { git = "https://github.com/rcore-os/bcm2837", version = "1.0.0", optional = true }
[target.'cfg(target_arch = "mips")'.dependencies]
mips = "^0.2.0"

File diff suppressed because it is too large Load Diff

View File

@ -366,4 +366,4 @@ pub fn get_clock_rate(clock_id: u32) -> PropertyMailboxResult<u32> {
} else {
return Err(PropertyMailboxError(1));
}
}
}

View File

@ -154,11 +154,15 @@ fn timer() {
fn syscall(tf: &mut TrapFrame) {
tf.epc += 4; // Must before syscall, because of fork.
let arguments = [tf.a0, tf.a1, tf.a2, tf.a3, tf.t0, tf.t1];
trace!("MIPS syscall {} invoked with {:x?}, epc = {:x?}", tf.v0, arguments, tf.epc);
trace!(
"MIPS syscall {} invoked with {:x?}, epc = {:x?}",
tf.v0,
arguments,
tf.epc
);
// temporary solution for ThinPad
if(tf.v0 == 0) {
if (tf.v0 == 0) {
warn!("Syscall ID = 0");
tf.v0 = unsafe { *((tf.sp + 28) as *const usize) };
}

View File

@ -72,7 +72,8 @@ impl BlockDevice for EmmcDriver {
fn read_at(&self, block_id: usize, buf: &mut [u8]) -> Result<()> {
use core::slice;
assert!(buf.len() >= emmc::BLOCK_SIZE);
let buf = unsafe { slice::from_raw_parts_mut(buf.as_ptr() as *mut u32, emmc::BLOCK_SIZE / 4) };
let buf =
unsafe { slice::from_raw_parts_mut(buf.as_ptr() as *mut u32, emmc::BLOCK_SIZE / 4) };
let mut ctrl = self.0.lock();
ctrl.read(block_id as u32, 1, buf).map_err(|_| DevError)?;
Ok(())
@ -88,4 +89,4 @@ impl BlockDevice for EmmcDriver {
fn sync(&self) -> Result<()> {
Ok(())
}
}
}

View File

@ -1 +1 @@
nightly-2019-04-14
nightly-2019-03-05

2
user

@ -1 +1 @@
Subproject commit 9fb1d459b50bc14c7ac56d9fd94b4b8485620730
Subproject commit e493f65dfab6db206b73ce7f6b517adb90bead3c