Go to the source code of this file.
◆ MINIOS_SA_NOCLDWAIT
| #define MINIOS_SA_NOCLDWAIT 0x00000002U /* do not produce zombies; skip SIGCHLD delivery */ |
◆ MINIOS_SA_RESETHAND
| #define MINIOS_SA_RESETHAND 0x80000000U /* reset to SIG_DFL on delivery */ |
◆ MINIOS_SA_RESTART
| #define MINIOS_SA_RESTART 0x10000000U /* restart interrupted syscall on signal return */ |
◆ SIG_DFL
◆ SIG_IGN
◆ SIGABRT
| #define SIGABRT 6 /* abort */ |
◆ SIGALRM
| #define SIGALRM 14 /* alarm clock (ITIMER_REAL expiry) */ |
◆ SIGCHLD
| #define SIGCHLD 17 /* sent to parent when a child exits or stops (Linux ABI) */ |
◆ SIGCONT
| #define SIGCONT 18 /* continue if stopped */ |
◆ SIGFPE
| #define SIGFPE 8 /* floating-point exception */ |
◆ SIGHUP
| #define SIGHUP 1 /* hangup */ |
◆ SIGILL
| #define SIGILL 4 /* illegal instruction */ |
◆ SIGINT
| #define SIGINT 2 /* interrupt (Ctrl-C) */ |
◆ SIGKILL
| #define SIGKILL 9 /* unconditional termination; cannot be caught or ignored */ |
◆ SIGPIPE
| #define SIGPIPE 13 /* broken pipe */ |
◆ SIGQUIT
| #define SIGQUIT 3 /* quit (Ctrl-\) */ |
◆ SIGSEGV
| #define SIGSEGV 11 /* segmentation fault */ |
◆ SIGSTOP
| #define SIGSTOP 19 /* stop (cannot be caught or ignored) */ |
◆ SIGTERM
| #define SIGTERM 15 /* termination request; default action terminates process */ |
◆ SIGTRAP
| #define SIGTRAP 5 /* breakpoint/single-step trap (ptrace) */ |
◆ SIGTSTP
| #define SIGTSTP 20 /* terminal stop (Ctrl-Z) */ |
◆ mini_sigaction_t
mini_sigaction_t — per-signal disposition record.
Stored in struct thread::signal_actions[1..31]. sa_flags holds MINIOS_SA_RESTART and other SA_* flags. sa_mask is reserved (zero) — miniOS does not block signals during handlers yet.
◆ minisigset_t
◆ sighandler_t
| typedef void(* sighandler_t) (int signum) |
◆ ring3_invoke_handler()
ring3_invoke_handler() - Set up user stack to invoke a signal handler. @sig: Signal number passed as first argument to handler (RDI per SysV ABI). @handler: User-mode function pointer to invoke.
Modifies the current thread's saved_user_rip to point to @handler and adjusts saved_user_rsp to push the signal number onto the user stack. SYSRET then jumps directly into the handler. Full trampoline (return path via SYS_sigreturn).
◆ signal_dispatch()
| void signal_dispatch |
( |
void | | ) |
|
signal_dispatch() - Deliver all pending signals before returning to userspace.
Called from syscall.asm immediately before SYSRET. Scans the current thread's pending_signals bitmask (bits 1-31). For SIGKILL and SIGTERM calls sched_exit_current(128 + signum). For other signals invokes the registered handler via ring3_invoke_handler() if a non-default handler is registered, otherwise clears the pending bit and continues.
Context: Called with interrupts disabled (CLI before SYSRET path). Does not return if SIGKILL or SIGTERM is pending.