
264
Evaluating and Programming the 29K RISC Family
to TRUE or FALSE; the high level handler achieves this by modifying the
gr121
register location in the PCB before the system call return code is executed. A FILL
assertion is used to repair the cache to the position at which the system call was
issued.
add
nop
asleu
gr1,gr1,16
;restore system
; call frame lr1
;restore all cache
V_FILL,lr1,rfb
;copy return values from memory to gr96,...
jmp
resume
nop
;restore context
Because a User mode signal handler may use the system call mechanism to issue
a
sigreturn
, it is possible an asynchronous context restore may be required in place of
the
normal
synchronous context restore associated with a system call. Label
resume
is jumped to and is described in the
Restore Context
section (section 5.10). If an
asynchronous context is being restored, then a pointer to the context being restored
will have been passed to the
sigreturn
system call. The high level C handler will have
copied this data over the PCB data stored at the time of the system call trap entry. The
C handler must change the SIG_SYNC value stored in the PCB by the system call
trap handler. This will cause the
resume
code to perform an asynchronous rather than
synchronous context restore.
5.8
FLOATING–POINT ISSUES
The example code presented saves only three supervisor accessible global
registers under the heading
floating–point support
. These registers are typically
ks
13–
ks
15. This is sufficient to save and restore floating–point context when an
Am29000 processor is being used with trapware emulation. This is only true if
interrupts are turned off during floating–point trapware execution. If floating–point
trapware is interruptible, then the Am29000 trapware support registers (typically
it0–it3
and
kt0–kt11
) would have to be saved.
When an Am29027 floating–point coprocessor is used, either inline or via
trapware support, the complete state of the coprocessor must be saved. This requires
an additional 35 words space in addition to the three Am29000 global support
registers.
Some real–time operating systems may run floating–point trapware with
interrupts off and chose to save no floating support registers at all. This will improve
context switch times. User programs typically only change the rounding mode
information in the support registers. If all user tasks run with the same rounding
information, then there is no need to save and restore the three floating–point support
registers.
The Am29050 directly executes floating point instructions without the need for
trapware. It has four floating point support registers, special registers
sr160–162
and