/* We change the next-pc to point to a breakpoint instruction, restore */
/* the original instruction, and exit. We would like to be able to */
/* sigreturn, but we can't, because this is hpux. */
/* We change the next-pc to point to a breakpoint instruction, restore */
/* the original instruction, and exit. We would like to be able to */
/* sigreturn, but we can't, because this is hpux. */
#else
/* We set the recovery counter to cover one instruction, put the */
/* original instruction back in, and then resume. We will then trap */
#else
/* We set the recovery counter to cover one instruction, put the */
/* original instruction back in, and then resume. We will then trap */
/* The instruction we just stepped over was not a branch, so */
/* we need to fix it up. If it was a branch, it will point to */
/* the correct place. */
/* The instruction we just stepped over was not a branch, so */
/* we need to fix it up. If it was a branch, it will point to */
/* the correct place. */
if (BreakpointAddr) {
*BreakpointAddr = trap_Breakpoint;
os_flush_icache((os_vm_address_t)BreakpointAddr,
if (BreakpointAddr) {
*BreakpointAddr = trap_Breakpoint;
os_flush_icache((os_vm_address_t)BreakpointAddr,
static void sigtrap_handler(int signal, siginfo_t *siginfo, void *void_context)
{
os_context_t *context = arch_os_get_context(&void_context);
static void sigtrap_handler(int signal, siginfo_t *siginfo, void *void_context)
{
os_context_t *context = arch_os_get_context(&void_context);
#if 0
printf("sigtrap_handler, pc=0x%08x, alloc=0x%08x\n", scp->sc_pcoqh,
SC_REG(scp,reg_ALLOC));
#endif
#if 0
printf("sigtrap_handler, pc=0x%08x, alloc=0x%08x\n", scp->sc_pcoqh,
SC_REG(scp,reg_ALLOC));
#endif
if (bad_inst & 0xfc001fe0)
interrupt_handle_now(signal, siginfo, context);
else {
if (bad_inst & 0xfc001fe0)
interrupt_handle_now(signal, siginfo, context);
else {
static void sigfpe_handler(int signal, siginfo_t *siginfo, void *void_context)
{
os_context_t *context = arch_os_get_context(&void_context);
static void sigfpe_handler(int signal, siginfo_t *siginfo, void *void_context)
{
os_context_t *context = arch_os_get_context(&void_context);
if ((badinst&0xfffff800) == (0xb000e000|reg_ALLOC<<21|reg_ALLOC<<16)) {
/* It is an ADDIT,OD i,ALLOC,ALLOC instruction that trapped. */
/* That means that it is the end of a pseudo-atomic. So do the */
if ((badinst&0xfffff800) == (0xb000e000|reg_ALLOC<<21|reg_ALLOC<<16)) {
/* It is an ADDIT,OD i,ALLOC,ALLOC instruction that trapped. */
/* That means that it is the end of a pseudo-atomic. So do the */
static void sigbus_handler(int signal, siginfo_t *siginfo, void *void_context)
{
os_context_t *context = arch_os_get_context(&void_context);
static void sigbus_handler(int signal, siginfo_t *siginfo, void *void_context)
{
os_context_t *context = arch_os_get_context(&void_context);
/* First, test for the pseudo-atomic instruction */
if ((badinst & 0xfffff800) == (0xb000e000 |
reg_ALLOC<<21 |
/* First, test for the pseudo-atomic instruction */
if ((badinst & 0xfffff800) == (0xb000e000 |
reg_ALLOC<<21 |