MOS Source Code
Loading...
Searching...
No Matches
signal.c File Reference
#include "mos/tasks/signal.h"
#include "mos/mm/slab.h"
#include "mos/mm/slab_autoinit.h"
#include "mos/platform/platform.h"
#include "mos/syslog/printk.h"
#include "mos/tasks/process.h"
#include "mos/tasks/schedule.h"
#include "mos/tasks/thread.h"
#include <errno.h>
#include <limits.h>
#include <mos/lib/structures/list.h>
#include <mos/lib/sync/spinlock.h>
#include <mos/tasks/signal_types.h>
#include <mos_stdlib.h>
#include <mos_string.h>
+ Include dependency graph for signal.c:

Go to the source code of this file.

Functions

static int sigset_add (sigset_t *sigset, int sig)
 
static int sigset_del (sigset_t *sigset, int sig)
 
static int sigset_test (const sigset_t *sigset, int sig)
 
 SLAB_AUTOINIT ("signal_pending", sigpending_slab, sigpending_t)
 
static void signal_do_coredump (signal_t signal)
 
static void signal_do_terminate (signal_t signal)
 
static void signal_do_ignore (signal_t signal)
 
static bool is_fatal_signal (signal_t signal)
 
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.
 
static signal_t signal_get_next_pending (void)
 
static void do_signal_exit_to_user_prepare (platform_regs_t *regs, signal_t next_signal, const sigaction_t *action)
 
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 *data)
 Return from a signal handler.
 
bool signal_has_pending (void)
 Return true if there's a pending signal.
 

Variables

slab_tsigpending_slab = NULL
 

Function Documentation

◆ sigset_add()

static int sigset_add ( sigset_t * sigset,
int sig )
static

Definition at line 21 of file signal.c.

Referenced by do_signal_exit_to_user_prepare().

◆ sigset_del()

static int sigset_del ( sigset_t * sigset,
int sig )
static

Definition at line 31 of file signal.c.

Referenced by signal_on_returned().

◆ sigset_test()

static int sigset_test ( const sigset_t * sigset,
int sig )
static

◆ SLAB_AUTOINIT()

SLAB_AUTOINIT ( "signal_pending" ,
sigpending_slab ,
sigpending_t  )

◆ signal_do_coredump()

static void signal_do_coredump ( signal_t signal)
static

Definition at line 53 of file signal.c.

Referenced by do_signal_exit_to_user_prepare().

+ Here is the call graph for this function:

◆ signal_do_terminate()

static void signal_do_terminate ( signal_t signal)
static

Definition at line 59 of file signal.c.

Referenced by do_signal_exit_to_user_prepare(), and signal_get_next_pending().

+ Here is the call graph for this function:

◆ signal_do_ignore()

static void signal_do_ignore ( signal_t signal)
static

Definition at line 68 of file signal.c.

Referenced by do_signal_exit_to_user_prepare().

◆ is_fatal_signal()

static bool is_fatal_signal ( signal_t signal)
static

◆ signal_get_next_pending()

static signal_t signal_get_next_pending ( void )
static

Definition at line 173 of file signal.c.

Referenced by signal_exit_to_user_prepare(), and signal_exit_to_user_prepare_syscall().

+ Here is the call graph for this function:

◆ do_signal_exit_to_user_prepare()

static void do_signal_exit_to_user_prepare ( platform_regs_t * regs,
signal_t next_signal,
const sigaction_t * action )
static

Definition at line 200 of file signal.c.

Referenced by signal_exit_to_user_prepare(), and signal_exit_to_user_prepare_syscall().

+ Here is the call graph for this function: