vexriscv: use upstream package

Use this package rather than the local xous-riscv package.

Signed-off-by: Sean Cross <sean@xobs.io>
This commit is contained in:
Sean Cross 2020-01-09 10:45:22 +08:00
parent 3a6c4f9a1c
commit fd7bbc463d
8 changed files with 25 additions and 34 deletions

22
Cargo.lock generated
View File

@ -91,12 +91,21 @@ name = "unicode-xid"
version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "vexriscv"
version = "0.0.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"bare-metal 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)",
"bit_field 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "xous-kernel"
version = "0.1.0"
dependencies = [
"vexriscv 0.0.2 (registry+https://github.com/rust-lang/crates.io-index)",
"xous-kernel-riscv-rt 0.6.1",
"xous-riscv 0.5.4",
]
[[package]]
@ -104,8 +113,8 @@ name = "xous-kernel-riscv-rt"
version = "0.6.1"
dependencies = [
"r0 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
"vexriscv 0.0.2 (registry+https://github.com/rust-lang/crates.io-index)",
"xous-kernel-riscv-rt-macros 0.1.6",
"xous-riscv 0.5.4",
]
[[package]]
@ -118,14 +127,6 @@ dependencies = [
"syn 0.15.44 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "xous-riscv"
version = "0.5.4"
dependencies = [
"bare-metal 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)",
"bit_field 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
[metadata]
"checksum bare-metal 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)" = "a3caf393d93b2d453e80638d0674597020cef3382ada454faacd43d1a55a735a"
"checksum bit_field 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ed8765909f9009617974ab6b7d332625b320b33c326b1e9321382ef1999b5d56"
@ -140,3 +141,4 @@ dependencies = [
"checksum semver-parser 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3"
"checksum syn 0.15.44 (registry+https://github.com/rust-lang/crates.io-index)" = "9ca4b3b69a77cbe1ffc9e198781b7acb0c7365a883670e8f1c1bc66fba79a5c5"
"checksum unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "fc72304796d0818e357ead4e000d19c9c174ab23dc11093ac919054d20a6a7fc"
"checksum vexriscv 0.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "a8cca4a24ec0049cadb38a5a0767529d28f3ea7bb5e5233b8f6cc02a1d8f0a51"

View File

@ -6,7 +6,7 @@ edition = "2018"
description = "Core kernel for Xous, including task switching and memory management"
[dependencies]
xous-riscv = { path = "xous-riscv" }
vexriscv = "0.0.2"
xous-kernel-riscv-rt = { path = "xous-kernel-riscv-rt" }
[profile.release]

View File

@ -1,6 +1,6 @@
use crate::definitions::XousError;
use crate::filled_array;
use xous_riscv::register::{mstatus, vmim};
use vexriscv::register::{mstatus, vmim};
static mut IRQ_HANDLERS: [Option<fn(usize)>; 32] = filled_array![None; 32];

View File

@ -1,12 +0,0 @@
#![no_std]
extern crate xous_riscv;
// use core::panic::PanicInfo;
// #[panic_handler]
// fn handle_panic(_arg: &PanicInfo) -> ! {
// loop {}
// }
// Allow consumers of this library to make syscalls
// pub mod syscalls;

View File

@ -1,7 +1,7 @@
#![no_std]
#![no_main]
extern crate xous_riscv;
extern crate vexriscv;
mod definitions;
mod irq;
mod macros;
@ -13,7 +13,7 @@ pub use irq::sys_interrupt_claim;
use core::panic::PanicInfo;
use xous_kernel_riscv_rt::xous_kernel_entry;
use xous_riscv::register::{mcause, mstatus, mie, vmim, vmip};
use vexriscv::register::{mcause, mstatus, mie, vmim, vmip};
use mem::MemoryManager;
use processtable::ProcessTable;
@ -39,6 +39,7 @@ fn xous_main() -> ! {
}
let mut mm = MemoryManager::new();
let mut pt = ProcessTable::new(&mut mm);
sys_interrupt_claim(2, |_| {
let uart_ptr = 0xE000_1800 as *mut usize;
print_str(uart_ptr, "hello, world!\r\n");
@ -59,7 +60,7 @@ fn xous_main() -> ! {
print_str(uart_ptr, "greetings!\r\n");
loop {
unsafe { xous_riscv::asm::wfi() };
unsafe { vexriscv::asm::wfi() };
}
}

View File

@ -1,6 +1,6 @@
use crate::definitions::{XousError, XousPid, MemoryAddress};
use core::num::NonZeroUsize;
use xous_riscv::register::mstatus;
use vexriscv::register::mstatus;
const FLASH_START: usize = 0x20000000;
const FLASH_SIZE: usize = 16_777_216;

View File

@ -10,9 +10,9 @@ license = "ISC"
[dependencies]
r0 = "0.2.2"
xous-riscv = { path = "../xous-riscv" }
vexriscv = "0.0.2"
xous-kernel-riscv-rt-macros = { path = "macros" }
[dev-dependencies]
xous-riscv = { path = "../xous-riscv" }
vexriscv = "0.0.2"
panic-halt = "0.2.0"

View File

@ -253,13 +253,13 @@
#![deny(missing_docs)]
#![deny(warnings)]
extern crate xous_riscv;
extern crate vexriscv;
extern crate xous_kernel_riscv_rt_macros as macros;
extern crate r0;
pub use macros::{xous_kernel_entry, pre_init};
use xous_riscv::register::mstatus;
use vexriscv::register::mstatus;
#[export_name = "error: riscv-rt appears more than once in the dependency graph"]
#[doc(hidden)]
@ -341,11 +341,11 @@ pub unsafe extern "Rust" fn default_pre_init() {}
#[doc(hidden)]
#[no_mangle]
pub extern "Rust" fn default_mp_hook() -> bool {
use xous_riscv::register::mhartid;
use vexriscv::register::mhartid;
match mhartid::read() {
0 => true,
_ => loop {
unsafe { xous_riscv::asm::wfi() }
unsafe { vexriscv::asm::wfi() }
},
}
}