mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-17 08:40:52 +00:00
kernel: fix remaining warnings on hosted mode
This removes all remaining warnings from hosted mode. Tests pass, and the system continues to run normally. Signed-off-by: Sean Cross <sean@xobs.io>
This commit is contained in:
parent
5eaa3a41b1
commit
e44eec2334
7 changed files with 14 additions and 16 deletions
|
|
@ -3,10 +3,6 @@
|
||||||
|
|
||||||
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,8 +48,6 @@ 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
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@ use crate::services::SystemServices;
|
||||||
|
|
||||||
use crossbeam_channel::{unbounded, Receiver, RecvError, RecvTimeoutError, Sender};
|
use crossbeam_channel::{unbounded, Receiver, RecvError, RecvTimeoutError, Sender};
|
||||||
|
|
||||||
use xous_kernel::{MemoryAddress, ProcessInit, ProcessKey, Result, SysCall, ThreadInit, PID, TID};
|
use xous_kernel::{ProcessInit, ProcessKey, Result, SysCall, ThreadInit, PID, TID};
|
||||||
|
|
||||||
enum ThreadMessage {
|
enum ThreadMessage {
|
||||||
SysCall(PID, TID, SysCall),
|
SysCall(PID, TID, SysCall),
|
||||||
|
|
|
||||||
|
|
@ -301,7 +301,7 @@ impl Process {
|
||||||
if let Some(mem) = result.memory() {
|
if let Some(mem) = result.memory() {
|
||||||
let s = unsafe { core::slice::from_raw_parts(mem.as_ptr(), mem.len()) };
|
let s = unsafe { core::slice::from_raw_parts(mem.as_ptr(), mem.len()) };
|
||||||
klog!("adding {} additional bytes from result", s.len());
|
klog!("adding {} additional bytes from result", s.len());
|
||||||
response.extend_from_slice(&s);
|
response.extend_from_slice(s);
|
||||||
}
|
}
|
||||||
|
|
||||||
// If there is memory to return for this thread, also return that.
|
// If there is memory to return for this thread, also return that.
|
||||||
|
|
@ -395,12 +395,6 @@ impl Process {
|
||||||
});
|
});
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn print_all_threads(&self) {}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Thread {}
|
impl Thread {}
|
||||||
|
|
||||||
pub fn current_tid() -> TID {
|
|
||||||
1
|
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,12 @@
|
||||||
// SPDX-FileCopyrightText: 2020 Sean Cross <sean@xobs.io>
|
// SPDX-FileCopyrightText: 2020 Sean Cross <sean@xobs.io>
|
||||||
// SPDX-License-Identifier: Apache-2.0
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
|
#[cfg(baremetal)]
|
||||||
use core::fmt::{Error, Write};
|
use core::fmt::{Error, Write};
|
||||||
#[cfg(target_os = "none")]
|
#[cfg(target_os = "none")]
|
||||||
use utralib::generated::*;
|
use utralib::generated::*;
|
||||||
|
|
||||||
|
#[cfg(baremetal)]
|
||||||
pub static mut DEBUG_OUTPUT: Option<&'static mut dyn Write> = None;
|
pub static mut DEBUG_OUTPUT: Option<&'static mut dyn Write> = None;
|
||||||
|
|
||||||
#[macro_use]
|
#[macro_use]
|
||||||
|
|
@ -110,7 +112,7 @@ impl Uart {
|
||||||
let ret = Some(uart_csr.r(utra::uart::RXTX) as u8);
|
let ret = Some(uart_csr.r(utra::uart::RXTX) as u8);
|
||||||
uart_csr.wfo(utra::uart::EV_PENDING_RX, 1);
|
uart_csr.wfo(utra::uart::EV_PENDING_RX, 1);
|
||||||
ret
|
ret
|
||||||
},
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -153,6 +155,11 @@ pub fn irq(_irq_number: usize, _arg: *mut usize) {
|
||||||
// uart.acknowledge_irq();
|
// uart.acknowledge_irq();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(all(
|
||||||
|
not(test),
|
||||||
|
target_os = "none",
|
||||||
|
any(feature = "debug-print", feature = "print-panics")
|
||||||
|
))]
|
||||||
fn process_irq_character(b: u8) {
|
fn process_irq_character(b: u8) {
|
||||||
#[cfg(all(feature = "gdbserver", target_os = "none"))]
|
#[cfg(all(feature = "gdbserver", target_os = "none"))]
|
||||||
if gdb_server::handle(b) {
|
if gdb_server::handle(b) {
|
||||||
|
|
|
||||||
|
|
@ -107,6 +107,7 @@ 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,
|
||||||
|
|
@ -177,6 +178,7 @@ 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)]
|
#[cfg(baremetal)]
|
||||||
|
|
|
||||||
|
|
@ -73,6 +73,7 @@ pub enum ProcessState {
|
||||||
|
|
||||||
/// The process is currently being debugged. When it is resumed,
|
/// The process is currently being debugged. When it is resumed,
|
||||||
/// this will turn into `Ready(usize)`
|
/// this will turn into `Ready(usize)`
|
||||||
|
#[allow(dead_code)]
|
||||||
Debug(usize),
|
Debug(usize),
|
||||||
|
|
||||||
/// This process is processing an exception. When it is resumed, it will
|
/// This process is processing an exception. When it is resumed, it will
|
||||||
|
|
@ -247,7 +248,7 @@ std::thread_local!(static SYSTEM_SERVICES: core::cell::RefCell<SystemServices> =
|
||||||
ppid: unsafe { PID::new_unchecked(1) },
|
ppid: unsafe { PID::new_unchecked(1) },
|
||||||
pid: unsafe { PID::new_unchecked(1) },
|
pid: unsafe { PID::new_unchecked(1) },
|
||||||
mapping: arch::mem::DEFAULT_MEMORY_MAPPING,
|
mapping: arch::mem::DEFAULT_MEMORY_MAPPING,
|
||||||
current_thread: 0 as TID,
|
current_thread: 0_usize,
|
||||||
previous_thread: INITIAL_TID as TID,
|
previous_thread: INITIAL_TID as TID,
|
||||||
exception_handler: None,
|
exception_handler: None,
|
||||||
}; MAX_PROCESS_COUNT],
|
}; MAX_PROCESS_COUNT],
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue