MOS Source Code
Loading...
Searching...
No Matches

Signal handling. More...

+ Collaboration diagram for kernel.tasks.signal:

Classes

struct  sigpending_t
 A pending signal. More...
 
struct  sigreturn_data_t
 

Functions

long signal_send_to_thread (thread_t *target, signal_t signal)
 Send a signal to a thread.
 
long signal_send_to_process (process_t *target, signal_t signal)
 Send a signal to a process, an arbitrary thread will be chosen to receive the signal.
 
void signal_exit_to_user_prepare (platform_regs_t *regs)
 Prepare to exit to userspace.
 
void signal_exit_to_user_prepare_syscall (platform_regs_t *regs, reg_t syscall_nr, reg_t syscall_ret)
 Prepare to exit to userspace after a syscall.
 
void signal_on_returned (sigreturn_data_t *supplimentary_data)
 Return from a signal handler.
 
bool signal_has_pending (void)
 Return true if there's a pending signal.
 

Variables

slab_tsigpending_slab
 

Detailed Description

Signal handling.

Function Documentation

◆ signal_send_to_thread()

long signal_send_to_thread ( thread_t * target,
signal_t signal )

Send a signal to a thread.

Parameters
target
signal

Definition at line 92 of file signal.c.

Referenced by console_putc(), invalid_page_fault(), io_poll(), ksyscall_enter(), MOS_STATIC_ASSERT(), pipe_write(), process_do_execveat(), process_exit(), riscv64_trap_handler(), signal_send_to_process(), and x86_handle_exception().

+ Here is the call graph for this function:

◆ signal_send_to_process()

long signal_send_to_process ( process_t * target,
signal_t signal )

Send a signal to a process, an arbitrary thread will be chosen to receive the signal.

Parameters
target
signal

Definition at line 126 of file signal.c.

Referenced by MOS_STATIC_ASSERT(), process_exit(), and riscv64_trap_handler().

+ Here is the call graph for this function:

◆ signal_exit_to_user_prepare()

void signal_exit_to_user_prepare ( platform_regs_t * regs)

Prepare to exit to userspace.

Parameters
regsThe registers of the thread.

Definition at line 245 of file signal.c.

Referenced by invalid_page_fault(), riscv64_start_user_thread(), riscv64_trap_handler(), x86_interrupt_entry(), and x86_start_user_thread().

+ Here is the call graph for this function:

◆ signal_exit_to_user_prepare_syscall()

void signal_exit_to_user_prepare_syscall ( platform_regs_t * regs,
reg_t syscall_nr,
reg_t syscall_ret )

Prepare to exit to userspace after a syscall.

Parameters
regsThe registers of the thread.
syscall_nrThe syscall number, used in case the syscall should be restarted.
syscall_retThe return value of the syscall, which may be -ERESTARTSYS, in which case the syscall should be restarted.

Definition at line 261 of file signal.c.

Referenced by riscv64_trap_handler(), and x86_interrupt_entry().

+ Here is the call graph for this function:

◆ signal_on_returned()

void signal_on_returned ( sigreturn_data_t * supplimentary_data)

Return from a signal handler.

Definition at line 295 of file signal.c.

Referenced by platform_restore_from_signal_handler().

+ Here is the call graph for this function:

◆ signal_has_pending()

bool signal_has_pending ( void )

Return true if there's a pending signal.

Definition at line 301 of file signal.c.

Referenced by console_io_read(), ipc_connect_to_server(), ipc_server_accept(), pipe_read(), pipe_write(), process_wait_for_pid(), and timer_msleep().

+ Here is the call graph for this function:

Variable Documentation

◆ sigpending_slab

slab_t* sigpending_slab
extern

Definition at line 50 of file signal.c.

Referenced by process_do_fork(), and signal_send_to_thread().