- /* Skip the offending instruction */
- if (os_context_bd_cause(context)) {
- /* Currently, we never get here, because Linux' support for
- bd_cause seems not terribly solid (c.f os_context_bd_cause
- in mips-linux-os.c). If a port to Irix comes along, this
- code will be executed, because presumably Irix' support is
- better (it can hardly be worse). We lose() to remind the
- porter to review this code. -- CSR, 2002-09-06 */
- lose("bd_cause branch taken; review code for new OS?\n");
- *os_context_pc_addr(context) =
- emulate_branch(context,
- *(unsigned long *) *os_context_pc_addr(context));
- }
- else
- *os_context_pc_addr(context) += 4;
-
- os_flush_icache((os_vm_address_t) *os_context_pc_addr(context), sizeof(unsigned long));
+ /* Skip the offending instruction. Don't use os_context_insn here,
+ since in case of a branch we want the branch insn, not the delay
+ slot. */
+ *os_context_pc_addr(context)
+ = emulate_branch(context,
+ *(unsigned int *)(os_context_pc(context)));