Go to the documentation of this file.
44 #include <sys/types.h>
51 #if defined(__FreeBSD__)
52 #include <sys/param.h>
71 const auto stack_size = 2 * SIGSTKSZ;
72 static uint8_t *fatal_sig_stack =
new uint8_t[stack_size];
74 #if defined(__FreeBSD__) && (__FreeBSD_version < 1100097)
75 stack.ss_sp = (
char *)fatal_sig_stack;
77 stack.ss_sp = fatal_sig_stack;
79 stack.ss_size = stack_size;
82 return sigaltstack(&
stack, NULL) == 0;
87 int flags = SA_RESTART)
91 memset(&
sa, 0,
sizeof(
sa));
92 sigemptyset(&
sa.sa_mask);
93 sa.sa_handler = handler;
96 if (sigaction(signal, &
sa, NULL) == -1)
97 panic(
"Failed to setup handler for signal %i\n", signal);
106 STATIC_ERR(
"For more info on how to address this issue, please visit "
107 "https://www.gem5.org/documentation/general_docs/common-errors/ \n\n");
108 pthread_kill(pthread_self(), signo);
112 STATIC_ERR(
"Failed to execute default signal handler!\n");
152 ccprintf(std::cerr,
"Program aborted at tick %llu\n",
166 STATIC_ERR(
"gem5 has encountered a segmentation fault!\n\n");
191 signal(SIGFPE, SIG_IGN);
210 SA_RESETHAND | SA_NODEFER | SA_ONSTACK);
212 warn(
"Failed to setup stack for SIGSEGV handler, "
213 "using default signal handler.\n");
void abortHandler(int sigtype)
Abort signal handler.
void dumprstStatsHandler(int sigtype)
void dumpStatsHandler(int sigtype)
Stats signal handler.
volatile bool async_exit
Async request to exit simulator.
EventQueue * getEventQueue(uint32_t index)
Function for returning eventq queue for the provided index.
static void segvHandler(int sigtype)
Segmentation fault signal handler.
volatile bool async_statreset
Async request to reset stats.
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...
void exitNowHandler(int sigtype)
Exit signal handler.
static void installSignalHandler(int signal, void(*handler)(int sigtype), int flags=SA_RESTART)
void ccprintf(cp::Print &print)
volatile bool async_statdump
Async request to dump stats.
#define STATIC_ERR(m)
Statically allocate a string and write it to STDERR.
Queue of events sorted in time order.
volatile bool async_io
Async I/O request (SIGIO).
EventQueue * curEventQueue()
static bool setupAltStack()
static void ioHandler(int sigtype)
Reference material can be found at the JEDEC website: UFS standard http://www.jedec....
void print_backtrace()
Print a gem5 post-mortem report.
volatile bool async_event
Some asynchronous event has happened.
#define panic(...)
This implements a cprintf based panic() function.
Generated on Sun Jul 30 2023 01:56:59 for gem5 by doxygen 1.8.17