pub struct ScarletAbi {
pub tls_pointer: Option<usize>,
pub clear_child_tid_ptr: Option<usize>,
}Fields§
§tls_pointer: Option<usize>TLS (Thread Local Storage) pointer for this task
clear_child_tid_ptr: Option<usize>clear_child_tid pointer for thread exit notification (Linux-compatible)
Implementations§
Source§impl ScarletAbi
impl ScarletAbi
Sourcepub fn tls_pointer(&self) -> Option<usize>
pub fn tls_pointer(&self) -> Option<usize>
Get the TLS pointer for this task
Sourcepub fn set_tls_pointer(&mut self, ptr: usize)
pub fn set_tls_pointer(&mut self, ptr: usize)
Set the TLS pointer for this task
Sourcepub fn clear_tls_pointer(&mut self)
pub fn clear_tls_pointer(&mut self)
Clear the TLS pointer for this task
Sourcepub fn set_clear_child_tid(&mut self, ptr: usize)
pub fn set_clear_child_tid(&mut self, ptr: usize)
Set the clear_child_tid pointer for thread exit notification
Sourcepub fn on_task_exit(&mut self, task: &Task)
pub fn on_task_exit(&mut self, task: &Task)
Handle task exit with TLS cleanup (Linux-compatible)
Source§impl ScarletAbi
impl ScarletAbi
Sourcefn setup_arguments_on_stack(
&self,
task: &Task,
argv: &[&str],
envp: &[&str],
initial_sp: usize,
) -> Result<(usize, usize), &'static str>
fn setup_arguments_on_stack( &self, task: &Task, argv: &[&str], envp: &[&str], initial_sp: usize, ) -> Result<(usize, usize), &'static str>
Setup argc, argv, and envp on the user stack following Unix conventions
Standard Unix stack layout (from high to low addresses):
[high addresses]
envp strings (null-terminated)
argv strings (null-terminated)
envp[] array (null-terminated pointer array)
argv[] array (null-terminated pointer array)
argc (integer)
[low addresses - returned stack pointer]§Arguments
task- The task to set up arguments forargv- Command line argumentsenvp- Environment variablesinitial_sp- Initial stack pointer from setup_user_stack
§Returns
Tuple of (new stack pointer, argv array pointer)
Sourcefn write_to_stack_memory(
&self,
task: &Task,
vaddr: usize,
data: &[u8],
) -> Result<(), &'static str>
fn write_to_stack_memory( &self, task: &Task, vaddr: usize, data: &[u8], ) -> Result<(), &'static str>
Write bytes to stack memory using virtual memory translation
Sourcefn write_string_to_stack(
&self,
task: &Task,
vaddr: usize,
string: &str,
) -> Result<(), &'static str>
fn write_string_to_stack( &self, task: &Task, vaddr: usize, string: &str, ) -> Result<(), &'static str>
Write a null-terminated string to stack memory
Sourcefn normalize_path_to_absolute_scarlet(&self, path_value: &str) -> String
fn normalize_path_to_absolute_scarlet(&self, path_value: &str) -> String
Normalize path string to absolute Scarlet namespace format
This ensures all paths in PATH-like variables are absolute and in the proper Scarlet namespace format.
Trait Implementations§
Source§impl AbiModule for ScarletAbi
impl AbiModule for ScarletAbi
fn name() -> &'static str
fn get_name(&self) -> String
Source§fn clone_boxed(&self) -> Box<dyn AbiModule + Send + Sync>
fn clone_boxed(&self) -> Box<dyn AbiModule + Send + Sync>
fn handle_syscall( &mut self, trapframe: &mut Trapframe, ) -> Result<usize, &'static str>
Source§fn can_execute_binary(
&self,
file_object: &KernelObject,
file_path: &str,
current_abi: Option<&(dyn AbiModule + Send + Sync)>,
) -> Option<u8>
fn can_execute_binary( &self, file_object: &KernelObject, file_path: &str, current_abi: Option<&(dyn AbiModule + Send + Sync)>, ) -> Option<u8>
Source§fn get_runtime_config(
&self,
file_object: &KernelObject,
file_path: &str,
) -> Option<RuntimeConfig>
fn get_runtime_config( &self, file_object: &KernelObject, file_path: &str, ) -> Option<RuntimeConfig>
Source§fn execute_binary(
&self,
file_object: &KernelObject,
argv: &[&str],
envp: &[&str],
task: &Task,
trapframe: &mut Trapframe,
) -> Result<(), &'static str>
fn execute_binary( &self, file_object: &KernelObject, argv: &[&str], envp: &[&str], task: &Task, trapframe: &mut Trapframe, ) -> Result<(), &'static str>
Source§fn choose_load_address(&self, elf_type: u16, target: LoadTarget) -> Option<u64>
fn choose_load_address(&self, elf_type: u16, target: LoadTarget) -> Option<u64>
Source§fn normalize_env_to_scarlet(&self, envp: &mut Vec<String>)
fn normalize_env_to_scarlet(&self, envp: &mut Vec<String>)
Source§fn denormalize_env_from_scarlet(&self, envp: &mut Vec<String>)
fn denormalize_env_from_scarlet(&self, envp: &mut Vec<String>)
Source§fn setup_overlay_environment(
&self,
target_vfs: &Arc<VfsManager>,
base_vfs: &Arc<VfsManager>,
system_path: &str,
config_path: &str,
) -> Result<(), &'static str>
fn setup_overlay_environment( &self, target_vfs: &Arc<VfsManager>, base_vfs: &Arc<VfsManager>, system_path: &str, config_path: &str, ) -> Result<(), &'static str>
Source§fn on_task_exit(&mut self, task: &Task)
fn on_task_exit(&mut self, task: &Task)
Source§fn set_tls_pointer(&mut self, ptr: usize)
fn set_tls_pointer(&mut self, ptr: usize)
Source§fn get_tls_pointer(&self) -> Option<usize>
fn get_tls_pointer(&self) -> Option<usize>
Source§fn set_clear_child_tid(&mut self, ptr: usize)
fn set_clear_child_tid(&mut self, ptr: usize)
Source§fn on_task_cloned(
&mut self,
_parent_task: &Task,
_child_task: &Task,
_flags: CloneFlags,
) -> Result<(), &'static str>
fn on_task_cloned( &mut self, _parent_task: &Task, _child_task: &Task, _flags: CloneFlags, ) -> Result<(), &'static str>
Source§fn get_task_namespace(&self) -> Arc<TaskNamespace>
fn get_task_namespace(&self) -> Arc<TaskNamespace>
Source§fn initialize_from_existing_handles(
&mut self,
_task: &Task,
) -> Result<(), &'static str>
fn initialize_from_existing_handles( &mut self, _task: &Task, ) -> Result<(), &'static str>
Source§fn get_interpreter_path(&self, requested_interpreter: &str) -> String
fn get_interpreter_path(&self, requested_interpreter: &str) -> String
Source§fn get_default_cwd(&self) -> &str
fn get_default_cwd(&self) -> &str
Source§fn handle_event(
&self,
_event: Event,
_target_task_id: u32,
) -> Result<(), &'static str>
fn handle_event( &self, _event: Event, _target_task_id: u32, ) -> Result<(), &'static str>
Source§impl Clone for ScarletAbi
impl Clone for ScarletAbi
Source§fn clone(&self) -> ScarletAbi
fn clone(&self) -> ScarletAbi
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Default for ScarletAbi
impl Default for ScarletAbi
impl Copy for ScarletAbi
Auto Trait Implementations§
impl Freeze for ScarletAbi
impl RefUnwindSafe for ScarletAbi
impl Send for ScarletAbi
impl Sync for ScarletAbi
impl Unpin for ScarletAbi
impl UnwindSafe for ScarletAbi
Blanket Implementations§
§impl<T> Any for Twhere
T: 'static + ?Sized,
impl<T> Any for Twhere
T: 'static + ?Sized,
§impl<T> Borrow<T> for Twhere
T: ?Sized,
impl<T> Borrow<T> for Twhere
T: ?Sized,
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
clone_to_uninit)