Everything

def_tex

Outline
Define task exception handling routine.
C format
 ER      def_tex (ID tskid, T_DTEX *pk_dtex );
Parameter(s)
I/O
Parameter
Description
I
 ID      tskid;
ID number of the task.
TSK_SELF: Invoking task.
Value: ID number of the task.
I
 T_DTEX  *pk_dtex;
NULL: Cancel the definition of task exception handling routine.
Other than NULL: Pointer to the packet containing the task exception handling routine definition information.

[Task exception handling routine definition information packet : T_DTEX]
 typedef struct  t_dtex {
     ATR     texatr;         /*Task exception handling routine attribute*/
     FP      texrtn;         /*Task exception handling routine start address*/
 } T_DTEX;

Explanation
This service call can be called from tasks that belong to Trusted Domain.
This service call defines a task exception handling routine for the task indicated by tskid according to the content of pk_dtex. If a task exception handling routine has already been defined for the task, this service call updates the definition contents.
When NULL is specified for pk_dtex, the definition of the task exception handling routine for the task is cancelled. At this time, the task pending exception code is cleared to 0, and the task exception handling is disabled.
1 ) Task ID (tskid)
Specify the task ID to define a task exception handling routine for tskid. Specifying tskid = TSK_SELF ( = 0 ) means that the invoking task itself is specified.
2 ) Task exception handling routine attribute (texatr)
Only TA_HLNG can be specified for texatr.
- TA_HLNG ( = 0x0000)
Only C-language is supported for task exception handling routine description language.
3 ) Task exception handling routine start address (texrtn)
Specify the task exception handling routine start address for texrtn.
Return value
Macro
Value
Description
E_OK
0
Normal completion.
E_RSATR
-11
Reserved attribute
- texatr != TA_HLNG
E_PAR
-17
Parameter error.
- pk_dtex != NULL and texrtn == NULL
E_ID
-18
Invalid ID number.
- tskid < 0
- tskid > VTMAX_TSK
E_CTX
-25
Context error.
- This service call was issued in the CPU locked state.
- This service call was issued from non-task.
- This service call was issued in the status "PSW.IPL > kernel interrupt mask level".
E_MACV
-26
Memory access violation.
- Stack pointer points out of user stack for invoking task.
- pk_dtex != NULL and the operand-read access to the area indicated by pk_ctsk has not been permitted to the invoking task.
E_OACV
-27
Object access violation.
- The invoking task does not belong to trusted domain.
E_NOEXS
-42
Non-existent object.
- The task specified by tskid does not exist.