mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-16 08:38:26 +00:00
kernel: fix remaining warnings
This just silences them, which isn't great in the long run. Signed-off-by: Sean Cross <sean@xobs.io>
This commit is contained in:
parent
b93abcc926
commit
0ffbaa369a
8 changed files with 12 additions and 28 deletions
|
|
@ -131,6 +131,7 @@ impl Process {
|
|||
Ok(())
|
||||
}
|
||||
|
||||
#[allow(dead_code)]
|
||||
pub fn find_free_context_nr(&self) -> Option<CtxID> {
|
||||
None
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
use super::process::Context;
|
||||
#[allow(dead_code)]
|
||||
pub fn invoke(
|
||||
_context: &mut Context,
|
||||
_supervisor: bool,
|
||||
|
|
@ -7,4 +8,5 @@ pub fn invoke(
|
|||
_ret_addr: usize,
|
||||
_args: &[usize],
|
||||
) {
|
||||
unimplemented!()
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,10 +23,12 @@ pub struct KernelArgumentsIterator {
|
|||
}
|
||||
|
||||
impl KernelArguments {
|
||||
#[allow(dead_code)]
|
||||
pub fn get() -> Self {
|
||||
KernelArguments { base: unsafe { KERNEL_ARGUMENTS_BASE } }
|
||||
}
|
||||
|
||||
#[allow(dead_code)]
|
||||
pub unsafe fn init(base: *const u32) {
|
||||
KERNEL_ARGUMENTS_BASE = base;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -457,6 +457,7 @@ impl MemoryManager {
|
|||
}
|
||||
|
||||
/// Move a page from one process into another, keeping its permissions.
|
||||
#[allow(dead_code)]
|
||||
pub fn move_page(
|
||||
&mut self,
|
||||
src_mapping: &MemoryMapping,
|
||||
|
|
@ -479,6 +480,7 @@ impl MemoryManager {
|
|||
/// read-only, then additionally remove the "write" bit on it. If the page
|
||||
/// is writable, then remove it from the current process until the borrow is
|
||||
/// returned.
|
||||
#[allow(dead_code)]
|
||||
pub fn lend_page(
|
||||
&mut self,
|
||||
src_mapping: &MemoryMapping,
|
||||
|
|
@ -503,6 +505,7 @@ impl MemoryManager {
|
|||
}
|
||||
|
||||
/// Return the range from `src_mapping` back to `dest_mapping`
|
||||
#[allow(dead_code)]
|
||||
pub fn unlend_page(
|
||||
&mut self,
|
||||
src_mapping: &MemoryMapping,
|
||||
|
|
|
|||
|
|
@ -124,6 +124,8 @@ fn send_scalar_message() {
|
|||
#[test]
|
||||
fn send_move_message() {
|
||||
let server_spec = "localhost:0";
|
||||
let test_str = "Hello, world!";
|
||||
let test_bytes = test_str.as_bytes();
|
||||
|
||||
let (main_thread, server_spec) = start_kernel(server_spec);
|
||||
|
||||
|
|
@ -141,6 +143,7 @@ fn send_move_message() {
|
|||
let bt = unsafe {
|
||||
Box::from_raw(core::slice::from_raw_parts_mut(buf.as_mut_ptr(), buf.len()))
|
||||
};
|
||||
assert_eq!(*test_bytes, *bt);
|
||||
// let s = String::from_utf8_lossy(&bt);
|
||||
// println!("Got message: {:?} -> \"{}\"", bt, s);
|
||||
} else {
|
||||
|
|
@ -156,7 +159,7 @@ fn send_move_message() {
|
|||
let sid = server_addr_recv.recv().unwrap();
|
||||
// println!("CLIENT: Connecting to server {:?}", sid);
|
||||
let conn = xous::connect(sid).expect("couldn't connect to server");
|
||||
let msg = xous::carton::Carton::from_bytes(format!("Hello, world!").as_bytes());
|
||||
let msg = xous::carton::Carton::from_bytes(test_bytes);
|
||||
xous::send_message(conn, xous::Message::Move(msg.into_message(0)))
|
||||
.expect("couldn't send a message");
|
||||
});
|
||||
|
|
|
|||
|
|
@ -181,7 +181,6 @@ fn _xous_syscall_to(
|
|||
}
|
||||
}*/
|
||||
// Nothing to do for Immutable borrow, since the memory can't change
|
||||
crate::Message::Borrow(_) => (),
|
||||
crate::Message::Scalar(_) => (),
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,2 +0,0 @@
|
|||
pub mod stringmessage;
|
||||
pub use stringmessage::StringMessage;
|
||||
|
|
@ -1,24 +0,0 @@
|
|||
use crate::{MemoryMessage, MemoryRange};
|
||||
|
||||
pub struct StringMessage {
|
||||
backing: *mut u8,
|
||||
length: usize,
|
||||
}
|
||||
|
||||
impl StringMessage {
|
||||
pub fn new(src: &str) -> Self {
|
||||
StringMessage {
|
||||
backing: 0 as _,
|
||||
length: 0
|
||||
}
|
||||
}
|
||||
|
||||
pub fn into_message(self, id: usize) -> MemoryMessage {
|
||||
MemoryMessage {
|
||||
id,
|
||||
buf: MemoryRange::new(self.backing as _, self.length),
|
||||
offset: None,
|
||||
valid: None,
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue