<pre>
trap_entry()
{
- if (ISANS != TRAP_ISANS) // musn't change if already there
- {
- LAST-ISANS = ISANS // record the old NS
- ISANS = TRAP_ISANS // traps are executed in "trap" NS
- }
+
+ LAST-ISANS = ISANS // record the old NS
+ ISANS = TRAP_ISANS // traps are executed in "trap" NS
}
and trap_exit:
trap_exit():
{
- if (LAST-ISANS != TRAP_ISANS)
- {
- ISANS = LAST-ISANS
- LAST-ISANS = TRAP_ISANS
- }
+ ISANS = LAST-ISANS
+ LAST-ISANS = TRAP_ISANS
}
</pre>
</code>
<pre>
trap_entry(x_cause)
{
- if (ISANS != TRAP_ISANS[xcause]) // musn't change if already there
- {
- LAST-ISANS = ISANS // record the old NS
- ISANS = TRAP_ISANS[xcause] // traps are executed in "trap" NS
- }
+ LAST-ISANS = ISANS // record the old NS
+ ISANS = TRAP_ISANS[xcause] // traps are executed in "trap" NS
}
and trap_exit:
trap_exit(x_cause):
{
- if (LAST-ISANS != TRAP_ISANS[x_cause])
- {
- ISANS = LAST-ISANS
- LAST-ISANS = TRAP_ISANS[x_cause]
- }
+ ISANS = LAST-ISANS
+ LAST-ISANS = TRAP_ISANS[x_cause]
}
</pre>
</code>