mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-18 08:52:45 +00:00
fix renode build
This commit is contained in:
parent
56de4c586f
commit
ca14ed78d2
3 changed files with 12 additions and 12 deletions
|
|
@ -12,22 +12,22 @@ pub mod panic;
|
||||||
|
|
||||||
pub use process::Thread;
|
pub use process::Thread;
|
||||||
|
|
||||||
#[cfg(feature="precursor")]
|
#[cfg(any(feature="precursor", feature="renode"))]
|
||||||
use utralib::generated::*;
|
use utralib::generated::*;
|
||||||
#[cfg(feature="precursor")]
|
#[cfg(any(feature="precursor", feature="renode"))]
|
||||||
use xous_kernel::{MemoryFlags, MemoryType, PID};
|
use xous_kernel::{MemoryFlags, MemoryType, PID};
|
||||||
#[cfg(feature="precursor")]
|
#[cfg(any(feature="precursor", feature="renode"))]
|
||||||
use crate::mem::MemoryManager;
|
use crate::mem::MemoryManager;
|
||||||
#[cfg(any(feature="cramium-soc", feature="cramium-fpga"))]
|
#[cfg(any(feature="cramium-soc", feature="cramium-fpga"))]
|
||||||
use xous_kernel::PID;
|
use xous_kernel::PID;
|
||||||
|
|
||||||
#[cfg(feature="precursor")]
|
#[cfg(any(feature="precursor", feature="renode"))]
|
||||||
pub const WFI_KERNEL: Wfi = Wfi {
|
pub const WFI_KERNEL: Wfi = Wfi {
|
||||||
// the manually chosen virtual address has to be in the top 4MiB as it is the only page shared among all processes
|
// the manually chosen virtual address has to be in the top 4MiB as it is the only page shared among all processes
|
||||||
base: 0xffcd_0000 as *mut usize, // see https://github.com/betrusted-io/xous-core/blob/master/docs/memory.md
|
base: 0xffcd_0000 as *mut usize, // see https://github.com/betrusted-io/xous-core/blob/master/docs/memory.md
|
||||||
};
|
};
|
||||||
|
|
||||||
#[cfg(feature="precursor")]
|
#[cfg(any(feature="precursor", feature="renode"))]
|
||||||
pub struct Wfi {
|
pub struct Wfi {
|
||||||
pub base: *mut usize,
|
pub base: *mut usize,
|
||||||
}
|
}
|
||||||
|
|
@ -37,7 +37,7 @@ pub fn current_pid() -> PID {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn init() {
|
pub fn init() {
|
||||||
#[cfg(feature="precursor")]
|
#[cfg(any(feature="precursor", feature="renode"))]
|
||||||
MemoryManager::with_mut(|memory_manager| {
|
MemoryManager::with_mut(|memory_manager| {
|
||||||
memory_manager
|
memory_manager
|
||||||
.map_range(
|
.map_range(
|
||||||
|
|
@ -50,9 +50,9 @@ pub fn init() {
|
||||||
)
|
)
|
||||||
.expect("unable to map WFI")
|
.expect("unable to map WFI")
|
||||||
});
|
});
|
||||||
#[cfg(feature="precursor")]
|
#[cfg(any(feature="precursor", feature="renode"))]
|
||||||
let mut wfi_kernel_csr = CSR::new(WFI_KERNEL.base as *mut u32);
|
let mut wfi_kernel_csr = CSR::new(WFI_KERNEL.base as *mut u32);
|
||||||
#[cfg(feature="precursor")]
|
#[cfg(any(feature="precursor", feature="renode"))]
|
||||||
wfi_kernel_csr.wfo(utra::wfi::IGNORE_LOCKED_IGNORE_LOCKED, 1);
|
wfi_kernel_csr.wfo(utra::wfi::IGNORE_LOCKED_IGNORE_LOCKED, 1);
|
||||||
|
|
||||||
unsafe {
|
unsafe {
|
||||||
|
|
@ -64,7 +64,7 @@ pub fn init() {
|
||||||
/// Put the core to sleep until an interrupt hits. Returns `true`
|
/// Put the core to sleep until an interrupt hits. Returns `true`
|
||||||
/// to indicate the kernel should not exit.
|
/// to indicate the kernel should not exit.
|
||||||
pub fn idle() -> bool {
|
pub fn idle() -> bool {
|
||||||
#[cfg(feature="precursor")]
|
#[cfg(any(feature="precursor", feature="renode"))]
|
||||||
let mut wfi_kernel_csr = CSR::new(WFI_KERNEL.base as *mut u32);
|
let mut wfi_kernel_csr = CSR::new(WFI_KERNEL.base as *mut u32);
|
||||||
|
|
||||||
// Issue `wfi`. This will return as soon as an external interrupt
|
// Issue `wfi`. This will return as soon as an external interrupt
|
||||||
|
|
@ -73,7 +73,7 @@ pub fn idle() -> bool {
|
||||||
// "traditional" path for stopping a clock
|
// "traditional" path for stopping a clock
|
||||||
unsafe { riscv::asm::wfi() };
|
unsafe { riscv::asm::wfi() };
|
||||||
|
|
||||||
#[cfg(feature="precursor")]
|
#[cfg(any(feature="precursor", feature="renode"))]
|
||||||
{
|
{
|
||||||
// this invokes Precusor-SoC specific path to gate clocks:
|
// this invokes Precusor-SoC specific path to gate clocks:
|
||||||
// 1. ignore_locked prevents the chip from going into reset if the PLL goes unlocked
|
// 1. ignore_locked prevents the chip from going into reset if the PLL goes unlocked
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ use crate::platform;
|
||||||
#[link_section = ".text.init"]
|
#[link_section = ".text.init"]
|
||||||
#[export_name = "_start"]
|
#[export_name = "_start"]
|
||||||
pub extern "C" fn _start(_kernel_args: usize, loader_sig: usize) {
|
pub extern "C" fn _start(_kernel_args: usize, loader_sig: usize) {
|
||||||
#[cfg(feature="precursor")]
|
#[cfg(any(feature="precursor", feature="renode"))]
|
||||||
let _kernel_args = _kernel_args;
|
let _kernel_args = _kernel_args;
|
||||||
#[cfg(any(feature="cramium-soc", feature="cramium-fpga"))]
|
#[cfg(any(feature="cramium-soc", feature="cramium-fpga"))]
|
||||||
let _kernel_args = _start as *const usize as usize + platform::KERNEL_OFFSET;
|
let _kernel_args = _start as *const usize as usize + platform::KERNEL_OFFSET;
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ pub struct Uart {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Uart {
|
impl Uart {
|
||||||
#[cfg(feature="precursor")]
|
#[cfg(any(feature="precursor", feature="renode"))]
|
||||||
pub fn putc(&self, c: u8) {
|
pub fn putc(&self, c: u8) {
|
||||||
let base = utra::uart::HW_UART_BASE as *mut u32;
|
let base = utra::uart::HW_UART_BASE as *mut u32;
|
||||||
let mut uart = CSR::new(base);
|
let mut uart = CSR::new(base);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue