41#define SIG_BIT(sig) (1u << (sig))
44#define SIG_UNBLOCKABLE (SIG_BIT(SIGKILL) | SIG_BIT(SIGSTOP))
51#define SA_NOCLDSTOP 0x00000001
52#define SA_RESTORER 0x04000000
53#define SA_RESTART 0x10000000
54#define SA_NODEFER 0x40000000
55#define SA_RESETHAND 0x80000000
uint8_t flags
Definition idt.c:3
struct signal_handlers signal_handlers_t
what a process does with each signal.
#define NSIG
Definition signal.h:36
unsigned int uint32_t
Definition fb.h:17
__UINT64_TYPE__ uint64_t
Definition stdint.h:17
__UINTPTR_TYPE__ uintptr_t
Definition stdint.h:19
bool signal_pending(const process_t *proc)
Definition signal.c:240
void signal_send_process(process_t *proc, int sig)
send a signal to a process (a thread group): one of its threads takes it (signal_send),...
Definition signal.c:604
void signal_force(process_t *proc, int sig)
send a signal caused by the process's own instruction (a fault).
Definition signal.c:224
void signal_handlers_put(signal_handlers_t *handlers)
remove a user from a set of handlers; the last user frees it.
Definition signal.c:528
void signal_deliver(struct registers *regs)
act on pending signals before returning to user mode: run the default action, or set up the user hand...
Definition signal.c:409
void signal_send(process_t *proc, int sig)
send a signal to one thread.
Definition signal.c:217
void signal_exec(process_t *proc)
the signal state after execve: handlers go back to SIG_DFL (ignored signals stay ignored); the mask a...
Definition signal.c:540
uint32_t signal_state_lock(void)
take the lock of the signal state of all processes, with interrupts masked.
Definition signal.c:912
int signal_send_group(uint32_t pgid, int sig)
send a signal to every process of a process group.
Definition signal.c:593
void signal_state_unlock(uint32_t flags)
release the lock that signal_state_lock() took.
Definition signal.c:917
void signal_init(void)
set up signal handling.
Definition signal.c:922
signal_handlers_t * signal_handlers_create(void)
make a set of handlers, all SIG_DFL, with one user.
Definition signal.c:512
void signal_alarm_tick(uint64_t now)
send SIGALRM to processes whose alarm is due.
Definition signal.c:579
void signal_fork(process_t *child, const process_t *parent)
Definition signal.c:503
signal_handlers_t * signal_handlers_get(signal_handlers_t *handlers)
add a user to a set of handlers (a new thread that shares it).
Definition signal.c:522
what a process does with one signal (ABI: the sigaction syscall copies it to and from user space in t...
Definition signal.h:67
uintptr_t restorer
Definition signal.h:70
uint32_t mask
Definition signal.h:71
uintptr_t handler
Definition signal.h:68
uint32_t flags
Definition signal.h:69
process control block.
Definition process.h:69
saved register state pushed onto the stack by ISR stubs.
Definition isr.h:41
what a process does with each signal.
Definition signal.h:90
uint32_t users
Definition signal.h:91
ksigaction_t actions[NSIG]
Definition signal.h:92
the signal state of a process (inside process_t).
Definition signal.h:78
uint32_t saved_blocked
Definition signal.h:81
uint32_t pending
Definition signal.h:79
uint32_t blocked
Definition signal.h:80
bool restore_blocked
Definition signal.h:82