- unsigned long badinst;
- boolean subtract, immed;
- int rd, rs1, op1, rs2, op2, result;
- os_context_t *context = arch_os_get_context(&void_context);
-
- badinst = *(unsigned long *)os_context_pc_addr(context);
- if ((badinst >> 30) != 2 || ((badinst >> 20) & 0x1f) != 0x11) {
- /* It wasn't a tagged add. Pass the signal into lisp. */
- interrupt_handle_now(signal, siginfo, context);
- return;
- }
-
- fprintf(stderr, "SIGEMT trap handler with tagged op instruction!\n");
-
- /* Extract the parts of the inst. */
- subtract = badinst & (1<<19);
- rs1 = (badinst>>14) & 0x1f;
- op1 = *os_context_register_addr(context, rs1);
-
- /* If the first arg is $ALLOC then it is really a signal-pending note */
- /* for the pseudo-atomic noise. */
- if (rs1 == reg_ALLOC) {
- /* Perform the op anyway. */
- op2 = badinst & 0x1fff;
- if (op2 & (1<<12))
- op2 |= -1<<13;
- if (subtract)
- result = op1 - op2;
- else
- result = op1 + op2;
- *os_context_register_addr(context, reg_ALLOC) = result & ~7;
- arch_skip_instruction(context);
- interrupt_handle_pending(context);
- return;
- }
+ unsigned int badinst;
+ boolean subtract, immed;
+ int rd, rs1, op1, rs2, op2, result;
+
+ badinst = *(unsigned int *)os_context_pc_addr(context);
+ if ((badinst >> 30) != 2 || ((badinst >> 20) & 0x1f) != 0x11) {
+ /* It wasn't a tagged add. Pass the signal into lisp. */
+ interrupt_handle_now(signal, siginfo, context);
+ return;
+ }