mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-17 08:40:52 +00:00
kernel: add Connect stub
It doesn't respond, but it prints a message now at least. Signed-off-by: Sean Cross <sean@xobs.io>
This commit is contained in:
parent
2dd62e50fd
commit
04eb18e2fb
2 changed files with 13 additions and 1 deletions
|
|
@ -5,7 +5,7 @@ pub use crate::arch::ProcessContext;
|
||||||
use crate::args::KernelArguments;
|
use crate::args::KernelArguments;
|
||||||
use crate::mem::{MemoryManagerHandle, PAGE_SIZE};
|
use crate::mem::{MemoryManagerHandle, PAGE_SIZE};
|
||||||
use core::{mem, slice};
|
use core::{mem, slice};
|
||||||
use xous::{MemoryFlags, PID, SID};
|
use xous::{MemoryFlags, CID, PID, SID};
|
||||||
|
|
||||||
const MAX_PROCESS_COUNT: usize = 32;
|
const MAX_PROCESS_COUNT: usize = 32;
|
||||||
const MAX_SERVER_COUNT: usize = 32;
|
const MAX_SERVER_COUNT: usize = 32;
|
||||||
|
|
@ -490,6 +490,12 @@ impl SystemServices {
|
||||||
}
|
}
|
||||||
Err(xous::Error::OutOfMemory)
|
Err(xous::Error::OutOfMemory)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Allocate a new server ID for this process and return the address.
|
||||||
|
/// If the server table is full, return an error.
|
||||||
|
pub fn connect_to_server(&mut self, sid: SID) -> Result<CID, xous::Error> {
|
||||||
|
Err(xous::Error::OutOfMemory)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// How many people have checked out the handle object.
|
/// How many people have checked out the handle object.
|
||||||
|
|
|
||||||
|
|
@ -244,6 +244,12 @@ pub fn handle(call: SysCall) -> xous::Result {
|
||||||
.map(|x| xous::Result::ServerID(x))
|
.map(|x| xous::Result::ServerID(x))
|
||||||
.unwrap_or_else(|e| xous::Result::Error(e))
|
.unwrap_or_else(|e| xous::Result::Error(e))
|
||||||
}
|
}
|
||||||
|
SysCall::Connect(sid) => {
|
||||||
|
let mut ss = SystemServicesHandle::get();
|
||||||
|
ss.connect_to_server(sid)
|
||||||
|
.map(|x| xous::Result::ConnectionID(x))
|
||||||
|
.unwrap_or_else(|e| xous::Result::Error(e))
|
||||||
|
}
|
||||||
_ => xous::Result::Error(xous::Error::UnhandledSyscall),
|
_ => xous::Result::Error(xous::Error::UnhandledSyscall),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue