CHAPTER 12 SYSTEM CONFIGURATION MANAGEMENT FUNCTIONS
This chapter describes the system configuration management functions performed by the RI850V4.
The RI850V4 provides as system configuration management functions related to the initialization routine called from
Kernel Initialization Module.
12.2 User-Own Coding Module
To support various execution environments, the RI850V4 extracts from the system management functions the hardware-dependent processing (
Initialization routine) that is required to execute processing, as a user-own coding module. This enhances portability for various execution environments and facilitates customization as well.
12.2.1 Initialization routine
The initialization routine is a routine dedicated to initialization processing that is extracted as a user-own coding module to initialize the hardware dependent on the user execution environment (such as the peripheral controller), and is called from the
Kernel Initialization Module.
The RI850V4 manages the states in which each initialization routine may enter and initialization routines themselves, by using management objects (initialization routine control blocks) corresponding to initialization routines one-to-one.
The following shows a processing flow from when a reset interrupt occurs until the control is passed to the task.
Figure 12-1 Processing Flow (Initialization Routine)
- Basic form of initialization routines
Code initialization routines by using the void type function that has one VP_INT type argument.
Extended information specified in
Initialization routine information is set to argument
exinf.
The following shows the basic form of initialization routine in C.
#include <kernel.h> /*Standard header file definition*/
void inirtn (VP_INT exinf)
{
.........
return; /*Terminate initialization routine*/
}
|
- Internal processing of initialization routine
The RI850V4 executes the original initialization routine pre-processing when passing control from the
Kernel Initialization Module to an initialization routine, as well as the original initialization routine post-processing when returning control from the initialization routine to the
Kernel Initialization Module.
Therefore, note the following points when coding initialization routines.
- Coding method
Code initialization routines using C or assembly language.
When coding in C, they can be coded in the same manner as ordinary functions coded.
When coding in assembly language, code them according to the calling rules prescribed in the compiler used.
- Stack switching
The RI850V4 switches to the system stack specified in
Basic information when passing control to an initialization routine, and switches to the relevant stack when returning control to the
Kernel Initialization Module. Coding regarding stack switching is therefore not required in initialization routines.
- Service call issue
The RI850V4 prohibits issue of service calls in Initialization routines.
- Acceptance of EI level maskable interrupts
When passing control to the initialization routine, the RI850V4 disables acceptance of EI level maskable interrupts by manipulating the PM
n bits in the priority mask register (PMR) and the ID bit in the program status word (PSW).
The PM
n bits to be manipulated correspond to the interrupt priority range defined as the
Maximum interrupt priority: maxintpri during configuration.
Note 1 When the RI850V4 initializes the hardware (OS timer) used for time management, appropriate settings should be made so that base clock timer interrupts occur according to the
Base clock interval: tim_base defined in the
Basic information in the system configuration file.
Note 2 Manipulate within this routine the RINT bit in the reset vector base address (RBASE) and the RINT bit in the exception handler vector address (EBASE) to specify whether operation should be done in the reduced mode, which is necessary when using an entry file in the direct vector method.
Note 3 Manipulate within this routine the MK
n bits (or EIMK
n bits) in the EI level interrupt mask register (IMR
m) to enable acceptance of EI level maskable interrupts.
12.2.2 Define initialization routine
The RI850V4 supports the static registration of initialization routines only. They cannot be registered dynamically by issuing a service call from the processing program.
Static initialization routine registration means defining of initialization routines using static API "ATT_INI" in the system configuration file.