mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-20 09:03:28 +00:00
cross-platform: fix building on native and hosted
This makes some minor changes to get builds working on both platforms. Signed-off-by: Sean Cross <sean@xobs.io>
This commit is contained in:
parent
285b92401e
commit
4643155318
2 changed files with 11 additions and 10 deletions
|
|
@ -168,7 +168,7 @@ pub fn create_process_post(
|
||||||
};
|
};
|
||||||
|
|
||||||
// println!("Launching process...");
|
// println!("Launching process...");
|
||||||
let result = Command::new(shell)
|
Command::new(shell)
|
||||||
.args(&args)
|
.args(&args)
|
||||||
.env("XOUS_SERVER", server_env)
|
.env("XOUS_SERVER", server_env)
|
||||||
.env("XOUS_PID", pid_env)
|
.env("XOUS_PID", pid_env)
|
||||||
|
|
@ -176,12 +176,10 @@ pub fn create_process_post(
|
||||||
.env("XOUS_PROCESS_KEY", process_key_env)
|
.env("XOUS_PROCESS_KEY", process_key_env)
|
||||||
.spawn()
|
.spawn()
|
||||||
.map(ProcessHandle)
|
.map(ProcessHandle)
|
||||||
.map_err(|e| {
|
.map_err(|_| {
|
||||||
// eprintln!("couldn't start command: {}", e);
|
// eprintln!("couldn't start command: {}", e);
|
||||||
crate::Error::InternalError
|
crate::Error::InternalError
|
||||||
});
|
})
|
||||||
// println!("Process result: {:?}", result);
|
|
||||||
result
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn wait_process(mut joiner: ProcessHandle) -> crate::SysCallResult {
|
pub fn wait_process(mut joiner: ProcessHandle) -> crate::SysCallResult {
|
||||||
|
|
@ -407,8 +405,8 @@ fn xous_connect_impl(
|
||||||
mailbox: Arc::new(Mutex::new(HashMap::new())),
|
mailbox: Arc::new(Mutex::new(HashMap::new())),
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
Err(e) => {
|
Err(_e) => {
|
||||||
// eprintln!("Unable to connect to Xous server: {}", e);
|
// eprintln!("Unable to connect to Xous server: {}", _e);
|
||||||
// eprintln!(
|
// eprintln!(
|
||||||
// "Ensure Xous is running, or specify this process as an argument to the kernel"
|
// "Ensure Xous is running, or specify this process as an argument to the kernel"
|
||||||
// );
|
// );
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,9 @@
|
||||||
use crate::{MemoryAddress, PID, TID};
|
use crate::{MemoryAddress, PID, TID};
|
||||||
use core::convert::TryInto;
|
use core::convert::TryInto;
|
||||||
|
|
||||||
|
mod mem;
|
||||||
|
pub use mem::*;
|
||||||
|
|
||||||
#[derive(Debug, Clone, Copy, PartialEq)]
|
#[derive(Debug, Clone, Copy, PartialEq)]
|
||||||
pub struct ProcessArgs {
|
pub struct ProcessArgs {
|
||||||
name: [u8; 16],
|
name: [u8; 16],
|
||||||
|
|
@ -30,7 +33,7 @@ pub struct ProcessInit {
|
||||||
pub struct WaitHandle<T>(core::marker::PhantomData<T>);
|
pub struct WaitHandle<T>(core::marker::PhantomData<T>);
|
||||||
pub struct ProcessHandle(());
|
pub struct ProcessHandle(());
|
||||||
|
|
||||||
pub fn thread_to_args(call: usize, init: ThreadInit) -> [usize; 8] {
|
pub fn thread_to_args(call: usize, init: &ThreadInit) -> [usize; 8] {
|
||||||
[
|
[
|
||||||
call as usize,
|
call as usize,
|
||||||
init.call as usize,
|
init.call as usize,
|
||||||
|
|
@ -151,8 +154,8 @@ where
|
||||||
pub fn create_thread_simple_post<T, U>(
|
pub fn create_thread_simple_post<T, U>(
|
||||||
_f: fn(T) -> U,
|
_f: fn(T) -> U,
|
||||||
_arg: T,
|
_arg: T,
|
||||||
thread_id: TID,
|
_thread_id: TID,
|
||||||
) -> core::result::Result<WaitHandle<T>, crate::Error>
|
) -> core::result::Result<WaitHandle<U>, crate::Error>
|
||||||
where
|
where
|
||||||
T: Send + 'static,
|
T: Send + 'static,
|
||||||
U: Send + 'static,
|
U: Send + 'static,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue