
User’s Manual U14833EJ2V0UM
90
CHAPTER 8 INTERRUPT MANAGEMENT
This chapter describes interrupt management in the RX4000.
8.1
Overview
Processing in response to interrupt sources and CPU exceptions can be said to be one of the most important
functions in a system using a real-time OS. This is because, assuming the RX4000 is used embedded in a control
device, the OS can improve the performance of the system as a whole by responding quickly to peripheral devices
such as sensors.
One of the features of a general-purpose OS such as Windows or UNIX is that processing dependent on the
device, such as interrupt processing, is concealed, enabling use of an interface common to multiple applications. It
could be argued, however, that in order to maximize the performance of the CPU or peripheral device, processing
dependent on the device such as interrupt and exception processing should not be concealed, which is why with the
RX4000, users are supplied with a source file as a sample, which can be rewritten to accord with the user’s
application system. This chapter should be read assuming that the source file is in an unmodified state.
8.2
Interrupt Management
The interrupt management performed by the kernel can be divided depending on the contents into interrupt control
and interrupt processing management. Interrupt control refers to interrupt enable/disable processing, which includes
not only an explicit enable/disable function via service calls, but also a function whereby the kernel enables or disables
interrupts in order to preserve the integrity of the data while it is performing processing.
Interrupt processing management refers to the function of registering and executing processing routines in order to
carry out processing in response to an acknowledged interrupt.
8.2.1
Interrupt control
The RX4000 disables interrupts in the target processor (V
R
4100 Series or V
R
5000 Series) by manipulating the IE
or IM bit of the status register. Interrupts can also be enabled/disabled via control from an external interrupt controller.
The service calls provided by the RX4000 to control interrupts are (i)loc_cpu, (i)unl_cpu, which enable/disable
interrupts by manipulating the IE bit, (i)chg_ims, which uses the IM bit, and dis_int, ena_int, which use an external
interrupt controller.
dis_int and ena_int also set the variable cpusts, which determines whether interrupts are enabled or disabled in the
OS.
The kernel also uses the IM bit of the status register to disable interrupts while it is performing processing.
In this way interrupts can always be acknowledged in interrupt processing in which service calls provided by the
kernel are not used.