
124
Evaluating and Programming the 29K RISC Family
in Freeze mode. The following section 2.5.3 deals with all other types of C language
interrupt handlers.
A C language interrupt handler qualifies for Freeze mode execution if it meets
with a number of criteria:
It is a small leaf routine which does not attempt to lower the register stack
pointer. This means that, should the interrupt have occurred during a critical
stage in register stack management, the stack need not be brought to a valid
condition.
Floating–point instructions not directly supported by the processor are not used.
Many members of the 29K family emulate floating–point instructions in
software (see Chapter 3).
Instructions which may result in a trap are not used. All interrupts and traps are
disabled while in Freeze mode. This means the Memory Management Unit
cannot be used for memory access protection and address translation.
The handlers execution is short. Because the handler is to be run in Freeze mode
its execution time will add to the system interrupt latency.
The handler does not attempt to execute LOADM and STOREM instructions
while in Freeze mode. When a performance gain can be had, the High C 29K
compiler will use these instructions to move blocks of data; this does not
typically happen with short Freeze mode interrupt handlers. However, the High
C 29K compiler supports the _LOADM_STOREM pragma which can be used
to turn off or on (default) the use of LOADM and STOREM instructions.
Transparent procedure calls are not used (see section 3.7). They typically
require the support of indirect pointer which are not temporarily saved by the
code presented in this section.
The methods shown in this and the following section rely on application code
running with physical addressing; or if the Memory Management Unit is used to per-
form address translation, then virtual addresses are mapped directly to physical ad-
dresses. This is because the macros used to install the Freeze Mode trap handlers are
used to generate code in User mode and thus operate with User mode address values.
However, Freeze mode code runs in Supervisor mode with address translation turned
off.
The Metaware High C 29K and GCC compilers prior to release 3.2 have no C
language extension to aid with interrupt handling. Release 3.2, or newer, support the
key word
_Interrupt
as a procedure return type. Use of this C language extension
results in additional tag data (see section 3.6) preceding the interrupt handler routine.
Without the interrupt tag data, the only way to identify if a handler routine qualifies
for the above Freeze mode handler status, is to compile it with the “–S” option and
examine the assembly language code. Alternatively, handler routines which make