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:
Sean Cross 2021-08-16 15:07:25 +08:00
parent 5eaa3a41b1
commit e44eec2334
7 changed files with 14 additions and 16 deletions

View file

@ -3,10 +3,6 @@
use xous_kernel::{PID, TID};
pub unsafe fn take_isr_return_pair() -> Option<(PID, TID)> {
None
}
pub fn enable_irq(_irq_no: usize) {
unimplemented!()
}

View file

@ -48,8 +48,6 @@ impl MemoryMapping {
) -> Result<(), Error> {
Ok(())
}
pub fn print_map(&self) {}
}
/// Determine whether a virtual address has been mapped

View file

@ -19,7 +19,7 @@ use crate::services::SystemServices;
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 {
SysCall(PID, TID, SysCall),

View file

@ -301,7 +301,7 @@ impl Process {
if let Some(mem) = result.memory() {
let s = unsafe { core::slice::from_raw_parts(mem.as_ptr(), mem.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.
@ -395,12 +395,6 @@ impl Process {
});
Ok(())
}
pub fn print_all_threads(&self) {}
}
impl Thread {}
pub fn current_tid() -> TID {
1
}

View file

@ -1,10 +1,12 @@
// SPDX-FileCopyrightText: 2020 Sean Cross <sean@xobs.io>
// SPDX-License-Identifier: Apache-2.0
#[cfg(baremetal)]
use core::fmt::{Error, Write};
#[cfg(target_os = "none")]
use utralib::generated::*;
#[cfg(baremetal)]
pub static mut DEBUG_OUTPUT: Option<&'static mut dyn Write> = None;
#[macro_use]
@ -110,7 +112,7 @@ impl Uart {
let ret = Some(uart_csr.r(utra::uart::RXTX) as u8);
uart_csr.wfo(utra::uart::EV_PENDING_RX, 1);
ret
},
}
}
}
}
@ -153,6 +155,11 @@ pub fn irq(_irq_number: usize, _arg: *mut usize) {
// uart.acknowledge_irq();
}
#[cfg(all(
not(test),
target_os = "none",
any(feature = "debug-print", feature = "print-panics")
))]
fn process_irq_character(b: u8) {
#[cfg(all(feature = "gdbserver", target_os = "none"))]
if gdb_server::handle(b) {

View file

@ -107,6 +107,7 @@ impl MemoryManager {
MEMORY_MANAGER.with(|ss| f(&mut ss.borrow_mut()))
}
#[cfg(baremetal)]
pub fn with<F, R>(f: F) -> R
where
F: FnOnce(&MemoryManager) -> R,
@ -177,6 +178,7 @@ impl MemoryManager {
/// Print the number of RAM bytes used by the specified process.
/// This does not include memory such as peripherals and CSRs.
#[cfg(baremetal)]
pub fn ram_used_by(&self, pid: PID) -> usize {
let mut owned_bytes = 0;
#[cfg(baremetal)]

View file

@ -73,6 +73,7 @@ pub enum ProcessState {
/// The process is currently being debugged. When it is resumed,
/// this will turn into `Ready(usize)`
#[allow(dead_code)]
Debug(usize),
/// 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) },
pid: unsafe { PID::new_unchecked(1) },
mapping: arch::mem::DEFAULT_MEMORY_MAPPING,
current_thread: 0 as TID,
current_thread: 0_usize,
previous_thread: INITIAL_TID as TID,
exception_handler: None,
}; MAX_PROCESS_COUNT],