refactor(kernel): move SyscallOutcome/Result to syscall module, move test helpers to tests module
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
use platform::Platform;
|
||||
|
||||
use crate::{Kernel, SyscallOutcome, SyscallResult};
|
||||
use super::{SyscallOutcome, SyscallResult};
|
||||
use crate::Kernel;
|
||||
|
||||
impl<P: Platform> Kernel<P> {
|
||||
pub(crate) fn handle_delegate(
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
use platform::Platform;
|
||||
|
||||
use crate::{Kernel, SyscallOutcome, SyscallResult};
|
||||
use super::{SyscallOutcome, SyscallResult};
|
||||
use crate::Kernel;
|
||||
|
||||
impl<P: Platform> Kernel<P> {
|
||||
pub(crate) fn handle_send(
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
use platform::Platform;
|
||||
|
||||
use crate::{Kernel, SyscallOutcome, SyscallResult};
|
||||
use super::{SyscallOutcome, SyscallResult};
|
||||
use crate::Kernel;
|
||||
|
||||
impl<P: Platform> Kernel<P> {
|
||||
pub(crate) fn handle_spawn_thread(
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
use platform::Platform;
|
||||
|
||||
use crate::{Kernel, SyscallOutcome, SyscallResult};
|
||||
use super::{SyscallOutcome, SyscallResult};
|
||||
use crate::Kernel;
|
||||
|
||||
impl<P: Platform> Kernel<P> {
|
||||
pub(crate) fn handle_request_pages(
|
||||
|
||||
@@ -4,10 +4,27 @@ mod lifecycle;
|
||||
mod memory;
|
||||
mod simple;
|
||||
|
||||
use domain::syscall::Syscall;
|
||||
use domain::{error::KernelError, message::Message, syscall::Syscall};
|
||||
use platform::Platform;
|
||||
use types::{bounded::CapSlot, id::ThreadId};
|
||||
|
||||
use crate::{Kernel, SyscallOutcome, SyscallResult};
|
||||
use crate::Kernel;
|
||||
|
||||
pub enum SyscallOutcome {
|
||||
Complete(SyscallResult),
|
||||
BlockCaller(domain::thread::BlockReason),
|
||||
SwitchTo(ThreadId),
|
||||
TerminateCaller,
|
||||
}
|
||||
|
||||
pub enum SyscallResult {
|
||||
Ok,
|
||||
Value(usize),
|
||||
Slot(CapSlot),
|
||||
Message(Message),
|
||||
WakeReason(domain::syscall::WakeReason),
|
||||
Error(KernelError),
|
||||
}
|
||||
|
||||
impl<P: Platform> Kernel<P> {
|
||||
pub fn handle_syscall(&mut self, syscall: Syscall) -> SyscallOutcome {
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
use platform::Platform;
|
||||
|
||||
use crate::{Kernel, SyscallOutcome, SyscallResult};
|
||||
use super::{SyscallOutcome, SyscallResult};
|
||||
use crate::Kernel;
|
||||
|
||||
impl<P: Platform> Kernel<P> {
|
||||
pub(crate) fn handle_get_time(&self) -> SyscallOutcome {
|
||||
|
||||
Reference in New Issue
Block a user