CHAPTER 12 SYSTEM CONFIGURATION MANAGEMENT FUNCTIONS
The RI850V4 provides as system configuration management functions related to the initialization routine called from Kernel Initialization 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.
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.
- 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.
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.
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.
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.
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.
- 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 PMn bits in the priority mask register (PMR) and the ID bit in the program status word (PSW).
The PMn bits to be manipulated correspond to the interrupt priority range defined as the Maximum interrupt priority: maxintpri during configuration.
When passing control to the initialization routine, the RI850V4 disables acceptance of EI level maskable interrupts by manipulating the PMn bits in the priority mask register (PMR) and the ID bit in the program status word (PSW).
The PMn bits to be manipulated correspond to the interrupt priority range defined as the Maximum interrupt priority: maxintpri during configuration.
Note As the RI850V4 initialization processing is not completed, acceptance is disabled for EI level maskable interrupts corresponding to the Base clock timer exception code: tim_intno defined in the Basic information and Exception code: inhno defined in the Interrupt handler information.
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 MKn bits (or EIMKn bits) in the EI level interrupt mask register (IMRm) to enable acceptance of EI level maskable interrupts.
The RI850V4 supports the static registration of initialization routines only. They cannot be registered dynamically by issuing a service call from the processing program.