44 #include <sys/types.h> 51 #if defined(__FreeBSD__) 52 #include <sys/param.h> 73 #if defined(__FreeBSD__) && (__FreeBSD_version < 1100097) 81 return sigaltstack(&stack, NULL) == 0;
86 int flags = SA_RESTART)
90 memset(&sa, 0,
sizeof(sa));
91 sigemptyset(&sa.sa_mask);
92 sa.sa_handler = handler;
95 if (sigaction(signal, &sa, NULL) == -1)
96 panic(
"Failed to setup handler for signal %i\n", signal);
105 pthread_kill(pthread_self(), signo);
109 STATIC_ERR(
"Failed to execute default signal handler!\n");
162 STATIC_ERR(
"gem5 has encountered a segmentation fault!\n\n");
187 signal(SIGFPE, SIG_IGN);
206 SA_RESETHAND | SA_NODEFER | SA_ONSTACK);
208 warn(
"Failed to setup stack for SIGSEGV handler, " 209 "using default signal handler.\n");
#define panic(...)
This implements a cprintf based panic() function.
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()
Overload hash function for BasicBlockRange type.
static uint8_t fatalSigStack[2 *SIGSTKSZ]
static void raiseFatalSignal(int signo)
static void installSignalHandler(int signal, void(*handler)(int sigtype), int flags=SA_RESTART)
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...
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.
Tick getCurTick() const
While curTick() is useful for any object assigned to this event queue, if an object that is assigned ...