refactor(kernel): move SyscallOutcome/Result to syscall module, move test helpers to tests module

This commit is contained in:
2026-10-18 00:39:28 +02:00
parent 38ebb6002b
commit 2c4a9dbadc
8 changed files with 118 additions and 115 deletions

View File

@@ -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(

View File

@@ -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(

View File

@@ -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(

View File

@@ -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(

View File

@@ -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 {

View File

@@ -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 {