CHAPTER 11 SERVICE CALL MANAGEMENT FUNCTIONS
The RI850V4's service call management function provides the function for manipulating the extended service call routine status, such as registering and calling of extended service call routines.
This is a routine to which user-defined functions are registered in the RI850V4, and will never be executed unless it is called explicitly, using service calls provided by the RI850V4.
The RI850V4 positions extended service call routines as extensions of the processing program that called the extended service call routine.
The RI850V4 manages interrupt handlers themselves, by using management objects (extended service call routine control blocks) corresponding to extended service call routines one-to-one.
Code extended service call routines by using the ER_UINT type argument that has three VP_INT type arguments.
Transferred data specified when a call request (cal_svc or ical_svc) is issued is set to arguments par1, par2, and par3.
The RI850V4 executes the original extended service call routine pre-processing when passing control from the processing program that issued a call request to an extended service call routine, as well as the original extended service call routine post-processing when returning control from the extended service call routine to the processing program.
- Coding method
Code extended service call 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 extended service call 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 positions extended service call routines as extensions of the processing program that called the extended service call routine. When passing control to an extended service call routine, stack switching processing is therefore not performed.
The RI850V4 positions extended service call routines as extensions of the processing program that called the extended service call routine. When passing control to an extended service call routine, stack switching processing is therefore not performed.
- Service call issue
The RI850V4 positions extended service call routines as extensions of the processing program that called the extended service call routine. Service calls that can be issued in extended service call routines depend on the type (task or non-task) of the processing program that called the extended service call routine.
The RI850V4 positions extended service call routines as extensions of the processing program that called the extended service call routine. Service calls that can be issued in extended service call routines depend on the type (task or non-task) of the processing program that called the extended service call routine.
- Acceptance of EI level maskable interrupts
The RI850V4 handles an extended service call routine as an extension of the processing program that called the extended service call routine.
Therefore, when passing control to an extended service call routine, manipulation related to acceptance of EI level maskable interrupts (manipulation of the PMn bits in the priority mask register (PMR) and the ID bit in the program status word (PSW)) is not performed.
The RI850V4 handles an extended service call routine as an extension of the processing program that called the extended service call routine.
Therefore, when passing control to an extended service call routine, manipulation related to acceptance of EI level maskable interrupts (manipulation of the PMn bits in the priority mask register (PMR) and the ID bit in the program status word (PSW)) is not performed.
The RI850V4 supports the static registration of extended service call routines only. They cannot be registered dynamically by issuing a service call from the processing program.
Static extended service call routine registration means defining of extended service call routines using static API "CRE_SVC" in the system configuration file.
For details about the static API "DEF_SVC", refer to "17.5.11 Extended service call routine information".
Extended service call routines can be called by issuing the following service call from the processing program.
- cal_svc, ical_svc
These service calls call the extended service call routine specified by parameter fncd.
The following describes an example for coding this service call.
These service calls call the extended service call routine specified by parameter fncd.
The following describes an example for coding this service call.
#include <kernel.h> /*Standard header file definition*/ #include <kernel_id.h> /*System information header file definition*/ void task (VP_INT exinf) { ER_UINT ercd; /*Declares variable*/ FN fncd = 1; /*Declares and initializes variable*/ VP_INT par1 = 123; /*Declares and initializes variable*/ VP_INT par2 = 456; /*Declares and initializes variable*/ VP_INT par3 = 789; /*Declares and initializes variable*/ ......... /*Invoke extended service call routine*/ ercd = cal_svc (fncd, par1, par2, par3); if (ercd != E_RSFN) { ......... /*Normal termination processing*/ } } |