XenevaOS
Loading...
Searching...
No Matches
signal.h
Go to the documentation of this file.
1
30#ifndef __SIGNAL_H__
31#define __SIGNAL_H__
32
33#include <stdint.h>
34#include <Hal/AA64/sched.h>
35#if defined(__GNUC__) || defined(__clang__)
36#ifndef __cplusplus
37#include <stdbool.h>
38#endif
39#endif
40
41typedef enum _signal_num_ {
42 SIGHUP = 1, /* Terminal closed or hangup*/
43 SIGINT, /* Interrupt (CTRL+C) */
44 SIGQUIT, /* Quit (CTRL+), generate core dump */
45 SIGILL, /* Illegal instruction*/
46 SIGTRAP, /* Breakpoint or trace trap */
47 SIGABRT, /* Abort a process */
48 SIGBUS, /* Bus error */
49 SIGFPE, /* Floating-point exception */
50 SIGKILL, /* Forcefully terminate */
51 SIGUSR1, /* User-defined signal 1*/
52 SIGSEGV, /* Invalid memory access (segmentation fault) */
53 SIGUSR2, /* user-defined signal 2*/
54 SIGPIPE, /* Write to a broken pipe */
55 SIGALRM, /* Alarm timer expired */
56 SIGTERM, /* Graceful termination request */
57 SIGCHLD = 17, /*Child process stopped or exited */
58 SIGCONT, /* Continue a stopped process */
59 SIGSTOP, /* Stop process */
60 SIGTSTP, /* Terminal stop */
61 SIGTTIN, /* Background process attempted terminal input */
62 SIGTTOU, /* Background process attempted terminal output */
64
65typedef void(*AuSignalHandler)(int signum);
72extern int AuAllocSignal(AA64Thread* thread, int sigNum);
73
74
80extern bool AuSignalDeliver(AA64Thread* current_thread);
81
86extern int AuSignalDispatch(AA64Thread* thr);
87
93extern void AuSignalInitializeTrampoline(AA64Thread* t);
94
95#endif
enum _signal_num_ AuSignalNumber
int AuSignalDispatch(AA64Thread *thr)
AuSignalDispatch – dispatch a signal.
Definition signal.c:82
_signal_num_
Definition signal.h:41
@ SIGTTOU
Definition signal.h:62
@ SIGQUIT
Definition signal.h:44
@ SIGILL
Definition signal.h:45
@ SIGCONT
Definition signal.h:58
@ SIGABRT
Definition signal.h:47
@ SIGTERM
Definition signal.h:56
@ SIGSEGV
Definition signal.h:52
@ SIGUSR1
Definition signal.h:51
@ SIGCHLD
Definition signal.h:57
@ SIGHUP
Definition signal.h:42
@ SIGTTIN
Definition signal.h:61
@ SIGINT
Definition signal.h:43
@ SIGTSTP
Definition signal.h:60
@ SIGKILL
Definition signal.h:50
@ SIGFPE
Definition signal.h:49
@ SIGUSR2
Definition signal.h:53
@ SIGPIPE
Definition signal.h:54
@ SIGTRAP
Definition signal.h:46
@ SIGALRM
Definition signal.h:55
@ SIGSTOP
Definition signal.h:59
@ SIGBUS
Definition signal.h:48
int AuAllocSignal(AA64Thread *thread, int sigNum)
AuAllocSignal – allocate a signal onto the signal queue of thread.
Definition signal.c:50
void(* AuSignalHandler)(int signum)
Definition signal.h:65
void AuSignalInitializeTrampoline(AA64Thread *t)
AuSignalInitializeTrampoline – installs return trampoline code to threads sig return address.
Definition signal.c:121
bool AuSignalDeliver(AA64Thread *current_thread)
AuSignalDeliver – deliver the current thread's signal.
Definition signal.c:101
XETime t
Definition main.cpp:53
AA64Thread * current_thread
Definition sched.c:69