EMULATE_BRANCH(3-SysV)ISC/os Reference ManualULATE_BRANCH(3-SysV)
NAME
emulate_branch - MIPS branch emulation
SYNOPSIS
#include <signal.h>
emulate_branch(scp, branch_instruction)
struct sigcontext *scp;
unsigned long branch_instruction;
DESCRIPTION
Emulate_branch is passed a signal context structure and a
branch instruction. It emulates the branch based on the
register values in the signal context structure. It modi-
fies the value of the program counter in the signal context
structure (sc_pc) to the target of the branch instruction.
The program counter must initially be pointing at the branch
and the register values must be those at the time of the
branch. If the branch is not taken the program counter is
advanced to point to the instruction after the delay slot
(sc_pc += 8).
In the case the branch instruction is a branch on coproces-
sor 2 or 3 instruction emulate_branch can't emulate or exe-
cute the branch currently.
RETURN VALUE
Emulate_branch returns a 0 if the branch was emulated suc-
cessfully. An non-zero value indicates the value passed as
a branch instruction was not a branch instruction.
ALSO SEE
signal(2), sigset(2)
Printed 1/15/91 Page 1