mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-22 09:23:16 +00:00
kernel: fix hosted build
Signed-off-by: Sean Cross <sean@xobs.io>
This commit is contained in:
parent
1bc84c76ff
commit
86dd38f7fa
6 changed files with 22 additions and 5 deletions
|
|
@ -3,6 +3,10 @@
|
||||||
|
|
||||||
use xous_kernel::{PID, TID};
|
use xous_kernel::{PID, TID};
|
||||||
|
|
||||||
|
pub unsafe fn take_isr_return_pair() -> Option<(PID, TID)> {
|
||||||
|
None
|
||||||
|
}
|
||||||
|
|
||||||
pub fn enable_irq(_irq_no: usize) {
|
pub fn enable_irq(_irq_no: usize) {
|
||||||
unimplemented!()
|
unimplemented!()
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -48,6 +48,8 @@ impl MemoryMapping {
|
||||||
) -> Result<(), Error> {
|
) -> Result<(), Error> {
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn print_map(&self) {}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Determine whether a virtual address has been mapped
|
/// Determine whether a virtual address has been mapped
|
||||||
|
|
|
||||||
|
|
@ -394,6 +394,12 @@ impl Process {
|
||||||
});
|
});
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn print_all_threads(&self) {}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Thread {}
|
impl Thread {}
|
||||||
|
|
||||||
|
pub fn current_tid() -> TID {
|
||||||
|
1
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -163,7 +163,7 @@ pub fn irq(_irq_number: usize, _arg: *mut usize) {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn process_irq_character(b: u8) {
|
fn process_irq_character(b: u8) {
|
||||||
#[cfg(feature = "gdbserver")]
|
#[cfg(all(feature = "gdbserver", baremetal))]
|
||||||
if gdb_server::handle(b) {
|
if gdb_server::handle(b) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
@ -259,7 +259,7 @@ fn process_irq_character(b: u8) {
|
||||||
});
|
});
|
||||||
println!("{} k total", total_bytes / 1024);
|
println!("{} k total", total_bytes / 1024);
|
||||||
}
|
}
|
||||||
#[cfg(feature = "gdbserver")]
|
#[cfg(all(feature = "gdbserver", baremetal))]
|
||||||
b'g' => {
|
b'g' => {
|
||||||
println!("Starting GDB server -- attach your debugger now");
|
println!("Starting GDB server -- attach your debugger now");
|
||||||
gdb_server::setup();
|
gdb_server::setup();
|
||||||
|
|
@ -268,7 +268,7 @@ fn process_irq_character(b: u8) {
|
||||||
println!("Xous Kernel Debug");
|
println!("Xous Kernel Debug");
|
||||||
println!("key | command");
|
println!("key | command");
|
||||||
println!("--- + -----------------------");
|
println!("--- + -----------------------");
|
||||||
#[cfg(feature = "gdbserver")]
|
#[cfg(all(feature = "gdbserver", baremetal))]
|
||||||
println!(" g | enter the gdb server");
|
println!(" g | enter the gdb server");
|
||||||
println!(" m | print MMU page tables of all processes");
|
println!(" m | print MMU page tables of all processes");
|
||||||
println!(" p | print all processes");
|
println!(" p | print all processes");
|
||||||
|
|
|
||||||
|
|
@ -107,7 +107,6 @@ impl MemoryManager {
|
||||||
MEMORY_MANAGER.with(|ss| f(&mut ss.borrow_mut()))
|
MEMORY_MANAGER.with(|ss| f(&mut ss.borrow_mut()))
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(baremetal)]
|
|
||||||
pub fn with<F, R>(f: F) -> R
|
pub fn with<F, R>(f: F) -> R
|
||||||
where
|
where
|
||||||
F: FnOnce(&MemoryManager) -> R,
|
F: FnOnce(&MemoryManager) -> R,
|
||||||
|
|
@ -120,6 +119,7 @@ impl MemoryManager {
|
||||||
#[cfg(not(baremetal))]
|
#[cfg(not(baremetal))]
|
||||||
MEMORY_MANAGER.with(|ss| f(&ss.borrow_mut()))
|
MEMORY_MANAGER.with(|ss| f(&ss.borrow_mut()))
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(baremetal)]
|
#[cfg(baremetal)]
|
||||||
pub fn init_from_memory(
|
pub fn init_from_memory(
|
||||||
&mut self,
|
&mut self,
|
||||||
|
|
@ -177,9 +177,9 @@ impl MemoryManager {
|
||||||
|
|
||||||
/// Print the number of RAM bytes used by the specified process.
|
/// Print the number of RAM bytes used by the specified process.
|
||||||
/// This does not include memory such as peripherals and CSRs.
|
/// This does not include memory such as peripherals and CSRs.
|
||||||
#[cfg(baremetal)]
|
|
||||||
pub fn ram_used_by(&self, pid: PID) -> usize {
|
pub fn ram_used_by(&self, pid: PID) -> usize {
|
||||||
let mut owned_bytes = 0;
|
let mut owned_bytes = 0;
|
||||||
|
#[cfg(baremetal)]
|
||||||
unsafe {
|
unsafe {
|
||||||
for owner in &MEMORY_ALLOCATIONS[0..self.ram_size / PAGE_SIZE] {
|
for owner in &MEMORY_ALLOCATIONS[0..self.ram_size / PAGE_SIZE] {
|
||||||
if owner == &Some(pid) {
|
if owner == &Some(pid) {
|
||||||
|
|
|
||||||
|
|
@ -2135,4 +2135,9 @@ impl SystemServices {
|
||||||
}
|
}
|
||||||
None
|
None
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(not(baremetal))]
|
||||||
|
pub fn process_name(&self, pid: PID) -> Option<&str> {
|
||||||
|
None
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue