46 #include <sys/types.h>
74 return sigaltstack(&stack, NULL) == 0;
79 int flags = SA_RESTART)
83 memset(&sa, 0,
sizeof(sa));
84 sigemptyset(&sa.sa_mask);
85 sa.sa_handler = handler;
88 if (sigaction(signal, &sa, NULL) == -1)
89 panic(
"Failed to setup handler for signal %i\n", signal);
98 pthread_kill(pthread_self(), signo);
102 STATIC_ERR(
"Failed to execute default signal handler!\n");
155 STATIC_ERR(
"gem5 has encountered a segmentation fault!\n\n");
180 signal(SIGFPE, SIG_IGN);
199 SA_RESETHAND | SA_NODEFER | SA_ONSTACK);
201 warn(
"Failed to setup stack for SIGSEGV handler, "
202 "using default signal handler.\n");
void ccprintf(cp::Print &print)
void dumprstStatsHandler(int sigtype)
EventQueue * getEventQueue(uint32_t index)
Function for returning eventq queue for the provided index.
void dumpStatsHandler(int sigtype)
Stats signal handler.
void print_backtrace()
Print a gem5 post-mortem report.
This file defines flags used to handle asynchronous simulator events.
void abortHandler(int sigtype)
Abort signal handler.
volatile bool async_exit
Async request to exit simulator.
static void ioHandler(int sigtype)
static void segvHandler(int sigtype)
Segmentation fault signal handler.
static bool setupAltStack()
static uint8_t fatalSigStack[2 *SIGSTKSZ]
static void raiseFatalSignal(int signo)
virtual void wakeup(Tick when=(Tick)-1)
Function to signal that the event loop should be woken up because an event has been scheduled by an a...
static void installSignalHandler(int signal, void(*handler)(int sigtype), int flags=SA_RESTART)
Queue of events sorted in time order.
EventQueue * curEventQueue()
volatile bool async_statdump
Async request to dump stats.
#define STATIC_ERR(m)
Statically allocate a string and write it to STDERR.
volatile bool async_io
Async I/O request (SIGIO).
volatile bool async_statreset
Async request to reset stats.
volatile bool async_event
Some asynchronous event has happened.
void exitNowHandler(int sigtype)
Exit signal handler.