Everything

CHAPTER 18 DATA TYPES AND MACROS


This chapter describes the data types and macros, which are used when issuing service calls provided by the RI600PX.
Note <ri_root> indicates the installation folder of RI600PX.
The default folder is "C:\Program Files\Renesas Electronics\CubeSuite+\RI600PX".
18.1 Data Types
The Following lists the data types of parameters specified when issuing a service call.
Macro definition of the data type is performed by <ri_root>\in600\kernel.h, or <ri_root>\inc600\itron.h that is included by kernel.h.
Table 18-1 Data Types
Macro
Data Type
Description
B
signed char
Signed 8-bit integer
H
signed short
Signed 16-bit integer
W
signed long
Signed 32-bit integer
D
signed long long
Signed 64-bit integer
UB
unsigned char
Unsigned 8-bit integer
UH
unsigned short
Unsigned 16-bit integer
UW
unsigned long
Unsigned 32-bit integer
UD
unsigned long long
Unsigned 64-bit integer
VB
signed char
8-bit value with unknown data type
VH
signed short
16-bit value with unknown data type
VW
signed long
32-bit value with unknown data type
VD
signed long long
64-bit value with unknown data type
VP
void *
Pointer to unknown data type
FP
void (*)
Processing unit start address (pointer to a function)
INT
signed long
Signed 32-bit integer
UINT
unsigned long
Unsigned 32-bit integer
BOOL
signed long
Boolean value (TRUE or FALSE)
ER
signed long
Error code
ID
signed short
Object ID
ATR
unsigned short
Object attribute
STAT
unsigned short
Object state
MODE
unsigned short
Service call operational mode
PRI
signed short
Priority for tasks or messages
SIZE
unsigned long
Memory area size (in bytes)
TMO
signed long
Time-out (in millisecond)
RELTIM
unsigned long
Relative time (in millisecond)
VP_INT
signed long
Pointer to unknown data type, or signed 32-bit integer
ER_ID
signed long
Error code, or object ID
ER_UINT
signed long
Error code, or signed 32-bit integer
ER_BOOL
signed long
Error code, or signed 32-bit integer
ACPTN
unsigned short
Access permission pattern
FLGPTN
unsigned long
Bit pattern of eventflag
IMASK
unsigned short
Interrupt mask level
TEXPTN
unsigned long
Task exception code

18.2 Constant macros
The following lists the constant macros.
The constant macros are defined by either of following header files.
- <ri_root>\inc600\kernel.h
- <ri_root>\inc600\itron.h, which s included by kernel.h
- System information header file kernel_id.h, which is generated by the cfg600px.
The contents of this file is changed according to the system configuration file.
Table 18-2 Constant Macros
Classification
Macro
Definition
Where
Description
General
NULL
0
itron.h
Null pointer
TRUE
1
itron.h
True
FALSE
0
itron.h
False
E_OK
0
itron.h
Normal completion
Attribute
TA_NULL
0
itron.h
Object attribute unspecified
TA_HLNG
0x0000
kernel.h
High-level language interface
TA_TFIFO
0x0000
kernel.h
Task wait queue in FIFO order
TA_TPRI
0x0001
kernel.h
Task wait queue is managed in task current priority order. Among tasks with the same priority, they are queued in FIFO order.
TA_MFIFO
0x0000
kernel.h
Message queue in FIFO order
TA_MPRI
0x0002
kernel.h
Message queue is managed in message priority order. Among messages with the same priority, they are queued in FIFO order.
TA_ACT
0x0002
kernel.h
Task is activated after creation
TA_WSGL
0x0000
kernel.h
Do not allow multiple tasks to wait for eventflag
TA_WMUL
0x0002
kernel.h
Allow multiple tasks to wait for eventflag
TA_CLR
0x0004
kernel.h
Clear eventflag when freed from WAITING state
TA_CEILING
0x0003
kernel.h
Priority ceiling protocol
TA_STA
0x0002
kernel.h
Create cyclic hander in operational state
TA_PHS
0x0004
kernel.h
Save cyclic hander phase
Time-out
TMO_POL
0
itron.h
Polling
TMO_FEVR
-1
itron.h
Waiting forever
Operation mode
TWF_ANDW
0x0000
kernel.h
Eventflag AND wait
TWF_ORW
0x0001
kernel.h
Eventflag OR wait
Task
exception
TTEX_ENA
0x0000
kernel.h
Task exception enabled state
TTEX_DIS
0x0001
kernel.h
Task exception disabled state
Object
state
TTS_RUN
0x0001
kernel.h
RUNNING state
TTS_RDY
0x0002
kernel.h
READY state
TTS_WAI
0x0004
kernel.h
WAITING state
TTS_SUS
0x0008
kernel.h
SUSPENDED state
TTS_WAS
0x000C
kernel.h
WAITING-SUSPENDED state
TTS_DMT
0x0010
kernel.h
DORMANT state
TTW_SLP
0x0001
kernel.h
Sleeping state
TTW_DLY
0x0002
kernel.h
Delayed state
TTW_SEM
0x0004
kernel.h
Waiting state for a semaphore resource
TTW_FLG
0x0008
kernel.h
Waiting state for an eventflag
TTW_SDTQ
0x0010
kernel.h
Sending waiting state for a data queue
TTW_RDTQ
0x0020
kernel.h
Receiving waiting state for a data queue
TTW_MBX
0x0040
kernel.h
Receiving waiting state for a mailbox
TTW_MTX
0x0080
kernel.h
Waiting state for a mutex
TTW_SMBF
0x0100
kernel.h
Sending waiting state for a message buffer
TTW_RMBF
0x0200
kernel.h
Receiving waiting state for a message buffer
TTW_MPF
0x2000
kernel.h
Waiting state for a fixed-sized memory block
TTW_MPL
0x4000
kernel.h
Waiting state for a variable-sized memory block
TCYC_STP
0x0000
kernel.h
Cyclic handler in non-operational state
TCYC_STA
0x0001
kernel.h
Cyclic handler in operational state
TALM_STP
0x0000
kernel.h
Alarm handler in non-operational state
TALM_STA
0x0001
kernel.h
Alarm handler in operational state
Others
TSK_SELF
0
kernel.h
Specify invoking task
TSK_NONE
0
kernel.h
No relevant task
TPRI_SELF
0
kernel.h
Specify base priority of invoking task
TPRI_INI
0
kernel.h
Specify initial priority
Kernel configura-
tion
TMIN_TPRI
1
kernel.h
Minimum task priority
TMAX_TPRI
system.priority
kernel_id.h
Maximum task priority
TMIN_MPRI
1
kernel.h
Minimum message priority
TMAX_MPRI
system.message_pri
kernel_id.h
Maximum message priority
TKERNEL_MAKER
0x011B
kernel.h
Kernel maker code
TKERNEL_PRID
0x0004
kernel.h
Identification number of the kernel
TKERNEL_SPVER
0x5403
kernel.h
Version number of the ITRON specification
TKERNEL_PRVER
0x0120
kernel.h
Version number of the kernel
TMAX_ACTCNT
255
kernel.h
Maximum number of queued task activation requests
TMAX_WUPCNT
255
kernel.h
Maximum number of queued task wake-up requests
TMAX_SUSCNT
1
kernel.h
Maximum number of nested task suspension requests
TBIT_FLGPTN
32
kernel.h
Number of bits in an eventflag
TBIT_TEXPTN
32
kernel.h
Number of bits in task exception code
TIC_NUME
system.tic_nume
kernel_id.h
Numerator of base clock interval
TIC_DENO
system.tic_deno
kernel_id.h
Denominator of base clock interval
TMAX_MAXSEM
65535
kernel.h
Maximum value of the maximum semaphore resource count
VTMAX_DOMAIN
Refer to Note 1
kernel_id.h
Maximum domain ID
VTMAX_TSK
Refer to Note 1
kernel_id.h
Maximum task ID
VTMAX_SEM
Refer to Note 1
kernel_id.h
Maximum semaphore ID
VTMAX_FLG
Refer to Note 1
kernel_id.h
Maximum eventflag ID
VTMAX_DTQ
Refer to Note 1
kernel_id.h
Maximum data queue ID
VTMAX_MBX
Refer to Note 1
kernel_id.h
Maximum mailbox ID
VTMAX_MTX
Refer to Note 1
kernel_id.h
Maximum mutex ID
VTMAX_MBF
Refer to Note 1
kernel_id.h
Maximum message buffer ID
VTMAX_MPF
Refer to Note 1
kernel_id.h
Maximum fixed-sized memory pool ID
VTMAX_MPL
Refer to Note 1
kernel_id.h
Maximum variable-sized memory pool ID
VTMAX_CYH
Refer to Note 1
kernel_id.h
Maximum cyclic handler ID
VTMAX_ALH
Refer to Note 1
kernel_id.h
Maximum alarm handler ID
VTSZ_MBFTBL
4
kernel.h
Size of message buffer's message management table (in bytes)
VTMAX_AREASIZE
0x10000000
kernel.h
Maximum size of various areas (in bytes)
VTKNL_LVL
system.system_IPL
kernel_id.h
Kernel interrupt mask level
VTIM_LVL
clock.IPL
kernel_id.h
Base clock interrupt level
Error code
E_SYS
-5
itron.h
System error
E_NOSPT
-9
itron.h
Unsupported function
E_RSFN
-10
itron.h
Reserved function code
E_RSATR
-11
itron.h
Reserved attribute
E_PAR
-17
itron.h
Parameter error
E_ID
-18
itron.h
Invalid ID number
E_CTX
-25
itron.h
Context error
E_MACV
-26
itron.h
Memory access violation
E_OACV
-27
itron.h
Object access violation
E_ILUSE
-28
itron.h
Illegal use of service call
E_NOMEM
-33
itron.h
Insufficient memory
E_NOID
-34
itron.h
No ID number available
E_OBJ
-41
itron.h
Object state error
E_NOEXS
-42
itron.h
Non-existent object
E_QOVR
-43
itron.h
Queuing overflow
E_RLWAI
-49
itron.h
Forced release from WAITING state
E_TMOUT
-50
itron.h
Polling failure of time-out
E_DLT
-51
itron.h
Waiting object deleted
E_CLS
-52
itron.h
Waiting object state changed
EV_RST
-127
itron.h
Released from WAITING state by the object reset
Protection
extension
TDOM_SELF
0
kernel.h
Domain that invoking task belongs
TACP_SHARED
1u <<
VTMAX_DOMAIN -1
kernel.h
Access permission pattern that represents "all domain can access"
TACT_SRW
{TACP_SHARED,
TACP_SHARED,
TACP_SHARED}
kernel.h
Access permission vector that represents "all types of access (operand-read, operand-write, execution) are permitted for all domains"
Refer to Note 2.
TACT_SRO
{TACP_SHARED,
0,
TACP_SHARED}
kernel.h
Access permission vector that represents "operand-read access is permitted for all domains, and operand-write access and execution access are not permitted for all domains"
Refer to Note 2.
TPM_READ
1
kernel.h
Operand-read access
TPM_WRITE
2
kernel.h
Operand-write access
TPM_EXEC
4
kernel.h
Execution access

Note 1 Refer to "20.7 Maximum ID (maxdefine)".
Note 2 These macros can be describe only at the right of an initial assignment statement.
18.3 Function Macros
The following lists the function macros.
The function macros are defined by either of following header files.
- <ri_root>\inc600\kernel.h
- <ri_root>\inc600\itron.h, which s included by kernel.h
18.3.1 Macros for Error Code
1 ) ER MERCD ( ER ercd )
Return the main error code of ercd.
2 ) ER SERCD ( ER ercd )
Return sub error code of ercd.
3 ) ER ERCD ( ER mercd, ER sercd )
Return the error code from the main error code indicated by mercd and sub error code indicated by sercd.
Note In the error code returned from the RI600PX, all sub error code is -1, and all main error code is same as the value described in Table 18-2.
18.3.2 Macros for Data Queue
1 ) SIZE TSZ_DTQ ( UINT dtqcnt )
Returns the size of a data queue area in which the dtqcnt number of data items can be stored. (in bytes)
18.3.3 Macros for Fixed-sized Memory Pool
1 ) SIZE TSZ_MPF ( UINT blkcnt, UINT blksz )
Returns the size of a fixed-sized memory pool from which blkcnt number of blksz-byte memory blocks can be acquired. (in bytes)
2 ) SIZE TSZ_MPFMB ( UINT blkcnt, UINT blksz )
Returns the size of the management area required for a fixed-sized memory pool from which blkcnt number of blksz-byte memory blocks can be acquired. (in bytes)
18.3.4 Macros for Domain
1 ) ATR TA_DOM ( ID domid )
Returns attribute which represents to belong to the domain indicated by domid. This macro is used for bit7-4 of tskatr (task attribute) at task creation.
18.3.5 Access permission
1 ) ACPTN TACP ( ID domid )
Returns access permission pattern that represents "only the domain indicated by domid can access".
2 ) ACVCT TACT_PRW ( ID domid )
Returns access permission vector that represents "all types of access (operand-read, operand-write, execution) are permitted only for the domain indicated by domid".
3 ) ACVCT TACT_PRO ( ID domid )
Returns access permission vector that represents "operand-wirte access is not permitted for all domain, operand-read and execution access are permitted only for the domain indicated by domid".
4 ) ACVCT TACT_SRPW ( ID domid )
Returns access permission vector that represents "operand-read and execution access are permitted for all domain, operand-write access is permitted only for the domain indicated by domid".