μT-Kernel/DS Functions

This chapter describes details of the functions provided by μT-Kernel/DS (Debugger Support).

μT-Kernel/DS provides functions enabling a debugger to reference μT-Kernel internal states and run a trace. The functions provided by μT-Kernel/DS are only for debugger use and not for use by applications or other programs.

NoteOverall Note and Supplement
 

  • Except where otherwise noted, μT-Kernel/DS system calls (td_...) can be called from a task independent portion and while dispatching and interrupts are disabled.

    There may be some limitations, however, imposed by particular implementations.

  • When μT-Kernel/DS system calls (td_...) are invoked in interrupts disabled state, they are processed without enabling interrupts. Other kernel states likewise remain unchanged during this processing. Changes in kernel states may occur if a service call is invoked while interrupts or dispatching are enabled, since the kernel continues operating.

  • μT-Kernel/DS system calls (td_...) cannot be invoked from a lower protection level than that at which μT-Kernel/OS system calls can be invoked (lower than TSVCLimit)(E_OACV).

  • Error codes such as E_PAR, E_MACV, and E_CTX that can be returned in many situations are not described here always unless there is some special reason for doing so.

Kernel Internal State Acquisition Functions

Kernel internal state reference functions are functions for enabling a debugger to get T-Kernel internal states. They include functions for getting a list of objects, getting task precedence, getting the order in which tasks are queued, getting the status of objects, system, and task registers, and getting time.

td_lst_tsk - Reference Task ID List

C Language Interface

#include <tk/dbgspt.h>

INT ct = td_lst_tsk(ID list[], INT nent);

Parameter

ID list[] ListLocation of task ID list
INT nent Number of List EntriesMaximum number of entries in list

Return Parameter

INT ct CountNumber of used tasks
orError CodeError code

Valid Context

Task portionQuasi-task portionTask-independent portion
YESYESYES

Related Service Profile Items

Only when all the service profile items below are set to be effective, this system call can be used.

TK_SUPPORT_DBGSPT Support of μT-Kernel/DS

Description

Gets the list of the IDs of the currently used tasks, and puts in list up to nent IDs. The number of the used tasks is passed in the return code. If return code > nent, this means not all task IDs could be retrieved.

td_lst_sem - Reference Semaphore ID List

C Language Interface

#include <tk/dbgspt.h>

INT ct = td_lst_sem(ID list[], INT nent);

Parameter

ID list[] ListLocation of semaphore ID list
INT nent Number of List EntriesMaximum number of entries in list

Return Parameter

INT ct CountNumber of used semaphores
orError CodeError code

Valid Context

Task portionQuasi-task portionTask-independent portion
YESYESYES

Related Service Profile Items

Only when all the service profile items below are set to be effective, this system call can be used.

TK_SUPPORT_DBGSPT Support of μT-Kernel/DS

Description

Gets the list of the IDs of the currently used semaphores, and puts in list up to nent IDs. The number of the used semaphores is passed in the return code. If return code > nent, this means not all semaphore IDs could be retrieved.

td_lst_flg - Reference Event Flag ID List

C Language Interface

#include <tk/dbgspt.h>

INT ct = td_lst_flg(ID list[], INT nent);

Parameter

ID list[] ListLocation of event flag ID list
INT nent Number of List EntriesMaximum number of entries in list

Return Parameter

INT ct CountNumber of used event flags
orError CodeError code

Valid Context

Task portionQuasi-task portionTask-independent portion
YESYESYES

Related Service Profile Items

Only when all the service profile items below are set to be effective, this system call can be used.

TK_SUPPORT_DBGSPT Support of μT-Kernel/DS

Description

Gets the list of the IDs of the currently used event flags, and puts in list up to nent IDs. The number of the used event flags is passed in the return code. If return code > nent, this means not all event flag IDs could be retrieved.

td_lst_mbx - Reference Mailbox ID List

C Language Interface

#include <tk/dbgspt.h>

INT ct = td_lst_mbx(ID list[], INT nent);

Parameter

ID list[] ListLocation of mailbox ID list
INT nent Number of List EntriesMaximum number of entries in list

Return Parameter

INT ct CountNumber of used mailboxes
orError CodeError code

Valid Context

Task portionQuasi-task portionTask-independent portion
YESYESYES

Related Service Profile Items

Only when all the service profile items below are set to be effective, this system call can be used.

TK_SUPPORT_DBGSPT Support of μT-Kernel/DS

Description

Gets the list of the IDs of the currently used mailboxes, and puts in list up to nent IDs. The number of the used mailboxes is passed in the return code. If return code > nent, this means not all mailbox IDs could be retrieved.

td_lst_mtx - Reference Mutex ID List

C Language Interface

#include <tk/dbgspt.h>

INT ct = td_lst_mtx(ID list[], INT nent);

Parameter

ID list[] ListLocation of mutex ID list
INT nent Number of List EntriesMaximum number of entries in list

Return Parameter

INT ct CountNumber of used mutexes
orError CodeError code

Valid Context

Task portionQuasi-task portionTask-independent portion
YESYESYES

Related Service Profile Items

Only when all the service profile items below are set to be effective, this system call can be used.

TK_SUPPORT_DBGSPT Support of μT-Kernel/DS

Description

Gets the list of the IDs of the currently used mutexes, and puts in list up to nent IDs. The number of the used mutexes is passed in the return code. If return code > nent, this means not all mutex IDs could be retrieved.

td_lst_mbf - Reference Message Buffer ID List

C Language Interface

#include <tk/dbgspt.h>

INT ct = td_lst_mbf(ID list[], INT nent);

Parameter

ID list[] ListLocation of message buffer ID list
INT nent Number of List EntriesMaximum number of entries in list

Return Parameter

INT ct CountNumber of used message buffers
orError CodeError code

Valid Context

Task portionQuasi-task portionTask-independent portion
YESYESYES

Related Service Profile Items

Only when all the service profile items below are set to be effective, this system call can be used.

TK_SUPPORT_DBGSPT Support of μT-Kernel/DS

Description

Gets the list of the IDs of the currently used message buffers, and puts in list up to nent IDs. The number of the used message buffers is passed in the return code. If return code > nent, this means not all message buffer IDs could be retrieved.

td_lst_mpf - Reference Fixed-size Memory Pool ID List

C Language Interface

#include <tk/dbgspt.h>

INT ct = td_lst_mpf(ID list[], INT nent);

Parameter

ID list[] ListLocation of fixed-size memory pool ID list
INT nent Number of List EntriesMaximum number of entries in list

Return Parameter

INT ct CountNumber of used fixed-size memory pools
orError CodeError code

Valid Context

Task portionQuasi-task portionTask-independent portion
YESYESYES

Related Service Profile Items

Only when all the service profile items below are set to be effective, this system call can be used.

TK_SUPPORT_DBGSPT Support of μT-Kernel/DS

Description

Gets the list of the IDs of the currently used fixed-size memory pools, and puts in list up to nent IDs. The number of the used fixed-size memory pools is passed in the return code. If return code > nent, this means not all fixed-size memory pool IDs could be retrieved.

td_lst_mpl - Reference Variable-size Memory Pool ID List

C Language Interface

#include <tk/dbgspt.h>

INT ct = td_lst_mpl(ID list[], INT nent);

Parameter

ID list[] ListLocation of variable-size memory pool ID list
INT nent Number of List EntriesMaximum number of entries in list

Return Parameter

INT ct CountNumber of used variable-size memory pools
orError CodeError code

Valid Context

Task portionQuasi-task portionTask-independent portion
YESYESYES

Related Service Profile Items

Only when all the service profile items below are set to be effective, this system call can be used.

TK_SUPPORT_DBGSPT Support of μT-Kernel/DS

Description

Gets the list of the IDs of the currently used variable-size memory pools, and puts in list up to nent IDs. The number of the used variable-size memory pools is passed in the return code. If return code > nent, this means not all variable-size memory pool IDs could be retrieved.

td_lst_cyc - Reference Cyclic Handler ID List

C Language Interface

#include <tk/dbgspt.h>

INT ct = td_lst_cyc(ID list[], INT nent);

Parameter

ID list[] ListLocation of cyclic handler ID list
INT nent Number of List EntriesMaximum number of entries in list

Return Parameter

INT ct CountNumber of used cyclic handlers
orError CodeError code

Valid Context

Task portionQuasi-task portionTask-independent portion
YESYESYES

Related Service Profile Items

Only when all the service profile items below are set to be effective, this system call can be used.

TK_SUPPORT_DBGSPT Support of μT-Kernel/DS

Description

Gets the list of the IDs of the currently used cyclic handlers, and puts in list up to nent IDs. The number of the used cyclic handlers is passed in the return code. If return code > nent, this means not all cyclic handler IDs could be retrieved.

td_lst_alm - Reference Alarm Handler ID List

C Language Interface

#include <tk/dbgspt.h>

INT ct = td_lst_alm(ID list[], INT nent);

Parameter

ID list[] ListLocation of alarm handler ID list
INT nent Number of List EntriesMaximum number of entries in list

Return Parameter

INT ct CountNumber of used alarm handlers
orError CodeError code

Valid Context

Task portionQuasi-task portionTask-independent portion
YESYESYES

Related Service Profile Items

Only when all the service profile items below are set to be effective, this system call can be used.

TK_SUPPORT_DBGSPT Support of μT-Kernel/DS

Description

Gets the list of the IDs of the currently used alarm handlers, and puts in list up to nent IDs. The number of the used alarm handlers is passed in the return code. If return code > nent, this means not all alarm handler IDs could be retrieved.

td_lst_ssy - Reference Subsystem ID List

C Language Interface

#include <tk/dbgspt.h>

INT ct = td_lst_ssy(ID list[], INT nent);

Parameter

ID list[] ListLocation of subsystem ID list
INT nent Number of List EntriesMaximum number of entries in list

Return Parameter

INT ct CountNumber of used subsystems
orError CodeError code

Valid Context

Task portionQuasi-task portionTask-independent portion
YESYESYES

Related Service Profile Items

Only when all the service profile items below are set to be effective, this system call can be used.

TK_SUPPORT_DBGSPT Support of μT-Kernel/DS
TK_SUPPORT_SUBSYSTEM Support of subsystem management functions

Description

Gets the list of the IDs of the currently used subsystems, and puts in list up to nent IDs. The number of the used subsystems is passed in the return code. If return code > nent, this means not all subsystem IDs could be retrieved.

td_rdy_que - Reference Task Precedence

C Language Interface

#include <tk/dbgspt.h>

INT ct = td_rdy_que(PRI pri, ID list[], INT nent);

Parameter

PRI pri Task PriorityTask priority
ID list[] Task ID ListLocation of task ID list
INT nent Number of List EntriesMaximum number of entries in list

Return Parameter

INT ct CountNumber of tasks with priority pri in a run state
orError CodeError code

Error Code

E_PAR Parameter error (pri is invalid or cannot be used)

Valid Context

Task portionQuasi-task portionTask-independent portion
YESYESYES

Related Service Profile Items

Only when all the service profile items below are set to be effective, this system call can be used.

TK_SUPPORT_DBGSPT Support of μT-Kernel/DS

Description

Gets a list of IDs of the tasks in a run state (READY state or RUNNING state) whose task priority is pri, arranged in the order from the highest to the lowest precedence.

This function stores in list up to nent task IDs, arranged in the order of precedence starting from the highest-precedence task ID at the head of the list.

The number of tasks in a run state with priority pri is passed in the return code. If return code > nent, this means not all task IDs could be retrieved.

td_sem_que - Reference Semaphore Queue

C Language Interface

#include <tk/dbgspt.h>

INT ct = td_sem_que(ID semid, ID list[], INT nent);

Parameter

ID semid Semaphore IDTarget semaphore ID
ID list[] Task ID ListLocation of waiting task IDs
INT nent Number of List EntriesMaximum number of entries in list

Return Parameter

INT ct CountNumber of waiting tasks
orError CodeError code

Error Code

E_ID Invalid ID number (semid is invalid or cannot be used)
E_NOEXS Object does not exist (the semaphore specified in semid does not exist)

Valid Context

Task portionQuasi-task portionTask-independent portion
YESYESYES

Related Service Profile Items

Only when all the service profile items below are set to be effective, this system call can be used.

TK_SUPPORT_DBGSPT Support of μT-Kernel/DS

Description

Gets the list of the IDs of the queued tasks waiting for a semaphore specified in semid. This function stores in list up to nent task IDs, arranged in the order in which tasks are queued, starting from the first task in the semaphore queue. The number of the tasks in the semaphore queue is passed in the return code. If return code > nent, this means not all task IDs could be retrieved.

td_flg_que - Reference Event Flag Queue

C Language Interface

#include <tk/dbgspt.h>

INT ct = td_flg_que(ID flgid, ID list[], INT nent);

Parameter

ID flgid EventFlag IDTarget event flag ID
ID list[] Task ID ListLocation of waiting task IDs
INT nent Number of List EntriesMaximum number of entries in list

Return Parameter

INT ct CountNumber of waiting tasks
orError CodeError code

Error Code

E_ID Invalid ID number (flgid is invalid or cannot be used)
E_NOEXS Object does not exist (the event flag specified in flgid does not exist)

Valid Context

Task portionQuasi-task portionTask-independent portion
YESYESYES

Related Service Profile Items

Only when all the service profile items below are set to be effective, this system call can be used.

TK_SUPPORT_DBGSPT Support of μT-Kernel/DS

Description

Gets the list of the IDs of the queued tasks waiting for an event flag specified in flgid. This function stores in list up to nent task IDs, arranged in the order in which tasks are queued, starting from the first task in the event flag queue. The number of the tasks in the event flag queue is passed in the return code. If return code > nent, this means not all task IDs could be retrieved.

td_mbx_que - Reference Mailbox Queue

C Language Interface

#include <tk/dbgspt.h>

INT ct = td_mbx_que(ID mbxid, ID list[], INT nent);

Parameter

ID mbxid Mailbox IDTarget mailbox ID
ID list[] Task ID ListLocation of waiting task IDs
INT nent Number of List EntriesMaximum number of entries in list

Return Parameter

INT ct CountNumber of waiting tasks
orError CodeError code

Error Code

E_ID Invalid ID number (mbxid is invalid or cannot be used)
E_NOEXS Object does not exist (the mailbox specified in mbxid does not exist)

Valid Context

Task portionQuasi-task portionTask-independent portion
YESYESYES

Related Service Profile Items

Only when all the service profile items below are set to be effective, this system call can be used.

TK_SUPPORT_DBGSPT Support of μT-Kernel/DS

Description

Gets the list of the IDs of the queued tasks waiting for a mailbox specified in mbxid. This function stores in list up to nent task IDs, arranged in the order in which tasks are queued, starting from the first task in the mailbox queue. The number of the tasks in the mailbox queue is passed in the return code. If return code > nent, this means not all task IDs could be retrieved.

td_mtx_que - Reference Mutex Queue

C Language Interface

#include <tk/dbgspt.h>

INT ct = td_mtx_que(ID mtxid, ID list[], INT nent);

Parameter

ID mtxid Mutex IDTarget mutex ID
ID list[] Task ID ListLocation of waiting task IDs
INT nent Number of List EntriesMaximum number of entries in list

Return Parameter

INT ct CountNumber of waiting tasks
orError CodeError code

Error Code

E_ID Invalid ID number (mtxid is invalid or cannot be used)
E_NOEXS Object does not exist (the mutex specified in mtxid does not exist)

Valid Context

Task portionQuasi-task portionTask-independent portion
YESYESYES

Related Service Profile Items

Only when all the service profile items below are set to be effective, this system call can be used.

TK_SUPPORT_DBGSPT Support of μT-Kernel/DS

Description

Gets the list of the IDs of the queued tasks waiting for a mutex specified in mtxid. This function stores in list up to nent task IDs, arranged in the order in which tasks are queued, starting from the first task in the mutex queue. The number of the tasks in the mutex queue is passed in the return code. If return code > nent, this means not all task IDs could be retrieved.

td_smbf_que - Reference Message Buffer Send Queue

C Language Interface

#include <tk/dbgspt.h>

INT ct = td_smbf_que(ID mbfid, ID list[], INT nent);

Parameter

ID mbfid Message Buffer IDTarget message buffer ID
ID list[] Task ID ListLocation of waiting task IDs
INT nent Number of List EntriesMaximum number of entries in list

Return Parameter

INT ct CountNumber of waiting tasks
orError CodeError code

Error Code

E_ID Invalid ID number (mbfid is invalid or cannot be used)
E_NOEXS Object does not exist (the message buffer specified in mbfid does not exist)

Valid Context

Task portionQuasi-task portionTask-independent portion
YESYESYES

Related Service Profile Items

Only when all the service profile items below are set to be effective, this system call can be used.

TK_SUPPORT_DBGSPT Support of μT-Kernel/DS

Description

Gets the list of the IDs of the queued tasks waiting for sending a message to a message buffer specified in mbfid. This function stores in list up to nent task IDs, arranged in the order in which tasks are queued, starting from the first task in the message buffer send queue. The number of the tasks in the message buffer send queue is passed in the return code. If return code > nent, this means not all task IDs could be retrieved.

td_rmbf_que - Reference Message Buffer Receive Queue

C Language Interface

#include <tk/dbgspt.h>

INT ct = td_rmbf_que(ID mbfid, ID list[], INT nent);

Parameter

ID mbfid Message Buffer IDTarget message buffer ID
ID list[] Task ID ListLocation of waiting task IDs
INT nent Number of List EntriesMaximum number of entries in list

Return Parameter

INT ct CountNumber of waiting tasks
orError CodeError code

Error Code

E_ID Invalid ID number (mbfid is invalid or cannot be used)
E_NOEXS Object does not exist (the message buffer specified in mbfid does not exist)

Valid Context

Task portionQuasi-task portionTask-independent portion
YESYESYES

Related Service Profile Items

Only when all the service profile items below are set to be effective, this system call can be used.

TK_SUPPORT_DBGSPT Support of μT-Kernel/DS

Description

Gets the list of the IDs of the queued tasks waiting for receiving a message from a message buffer specified in mbfid. This function stores in list up to nent task IDs, arranged in the order in which tasks are queued, starting from the first task in the message buffer receive queue. The number of the tasks in the message buffer receive queue is passed in the return code. If return code > nent, this means not all task IDs could be retrieved.

td_mpf_que - Reference Fixed-size Memory Pool Queue

C Language Interface

#include <tk/dbgspt.h>

INT ct = td_mpf_que(ID mpfid, ID list[], INT nent);

Parameter

ID mpfid Memory Pool IDTarget fixed-size memory pool ID
ID list[] Task ID ListLocation of waiting task IDs
INT nent Number of List EntriesMaximum number of entries in list

Return Parameter

INT ct CountNumber of waiting tasks
orError CodeError code

Error Code

E_ID Invalid ID number (mpfid is invalid or cannot be used)
E_NOEXS Object does not exist (the fixed-size memory pool specified in mpfid does not exist)

Valid Context

Task portionQuasi-task portionTask-independent portion
YESYESYES

Related Service Profile Items

Only when all the service profile items below are set to be effective, this system call can be used.

TK_SUPPORT_DBGSPT Support of μT-Kernel/DS

Description

Gets the list of the IDs of the queued tasks waiting for allocation in a fixed-size memory pool specified in mpfid. This function stores in list up to nent task IDs, arranged in the order in which tasks are queued, starting from the first task in the fixed-size memory pool queue. The number of the tasks in the fixed-size memory pool queue is passed in the return code. If return code > nent, this means not all task IDs could be retrieved.

td_mpl_que - Reference Variable-size Memory Pool Queue

C Language Interface

#include <tk/dbgspt.h>

INT ct = td_mpl_que(ID mplid, ID list[], INT nent);

Parameter

ID mplid Memory Pool IDTarget variable-size memory pool ID
ID list[] Task ID ListLocation of waiting task IDs
INT nent Number of List EntriesMaximum number of entries in list

Return Parameter

INT ct CountNumber of waiting tasks
orError CodeError code

Error Code

E_ID Invalid ID number (mplid is invalid or cannot be used)
E_NOEXS Object does not exist (the variable-size memory pool specified in mplid does not exist)

Valid Context

Task portionQuasi-task portionTask-independent portion
YESYESYES

Related Service Profile Items

Only when all the service profile items below are set to be effective, this system call can be used.

TK_SUPPORT_DBGSPT Support of μT-Kernel/DS

Description

Gets the list of the IDs of the queued tasks waiting for allocation in a variable-size memory pool specified in mplid. This function stores in list up to nent task IDs, arranged in the order in which tasks are queued, starting from the first task in the variable-size memory pool queue. The number of the tasks in the variable-size memory pool queue is passed in the return code. If return code > nent, this means not all task IDs could be retrieved.

td_ref_tsk - Reference Task Status

C Language Interface

#include <tk/dbgspt.h>

ER ercd = td_ref_tsk(ID tskid, TD_RTSK *rtsk);

Parameter

ID tskid Task IDTarget task ID (TSK_SELF can be specified)
TD_RTSK* rtsk Packet to Return Task StatusPointer to the area to return the task status

Return Parameter

ER ercd Error CodeError code

rtsk Detail:

void* exinf Extended InformationExtended information
PRI tskpri Task PriorityCurrent priority
PRI tskbpri Task Base PriorityBase priority
UINT tskstat Task StateTask States
UW tskwait Task Wait FactorWait factor
ID wid Waiting Object IDWaiting object ID
INT wupcnt Wakeup CountWakeup request queuing count
INT suscnt Suspend CountSuspend request nesting count
UW waitmask Wait MaskDisabled wait factors
UINT texmask Task Exception MaskAllowed task exceptions
UINT tskevent Task EventRaised task event
FP task Task Start AddressTask start address
SZ stksz User Stack SizeUser stack size (in bytes)
SZ sstksz System Stack SizeSystem stack size (in bytes)
void* istack Initial User Stack PointerUser stack pointer initial value
void* isstack Initial System Stack PointerSystem stack pointer initial value

Error Code

E_OK Normal completion
E_ID Bad identifier
E_NOEXS Object does not exist

Valid Context

Task portionQuasi-task portionTask-independent portion
YESYESYES

Related Service Profile Items

Only when all the service profile items below are set to be effective, this system call can be used.

TK_SUPPORT_DBGSPT Support of μT-Kernel/DS

Additionally, the following service profile items are related to this system call.

TK_SUPPORT_DISWAI Information about disabled wait factors (waitmask) is obtainable
TK_SUPPORT_TASKEXCEPTION Task exception information (texmask) can be acquired.
TK_SUPPORT_TASKEVENT Generated task event(tskevent)can be acquired
TK_HAS_SYSSTACK Task can have a system stack independent of user-stack, and information can be acquired of the system stack as well as user stack(sstksz and isstack)

Description

Gets the state of the task designated in tskid. This function is similar to tk_ref_tsk, with the task start address and stack information added to the state information obtained.

The stack area extends from the stack pointer initial value toward the low addresses for the number of bytes designated as the stack size.

  • istack - stksz ≦ user stack area < istack

  • isstack - sstksz ≦ system stack area < isstack

Note that the stack pointer initial value (istack, isstack) is not the same as its current position. The stack area may be used even before a task is started. Calling td_get_reg gets the stack pointer current position.

td_ref_tex - Reference Task Exception Status

C Language Interface

#include <tk/dbgspt.h>

ER ercd = td_ref_tex(ID tskid, TD_RTEX *pk_rtex);

Parameter

ID tskid Task IDTarget task ID (TSK_SELF can be specified)
TD_RTEX* pk_rtex Packet to Return Task Exception StatusPointer to the area to return the task exception status

Return Parameter

ER ercd Error CodeError code

pk_rtex Detail:

UINT pendtex Pending Task ExceptionPending task exceptions
UINT texmask Task Exception MaskAllowed task exceptions

Error Code

E_OK Normal completion
E_ID Bad identifier
E_NOEXS Object does not exist

Valid Context

Task portionQuasi-task portionTask-independent portion
YESYESYES

Related Service Profile Items

Only when all the service profile items below are set to be effective, this system call can be used.

TK_SUPPORT_DBGSPT Support of μT-Kernel/DS
TK_SUPPORT_TASKEXCEPTION Support of task exception handling functions

Description

Gets the task exception status. This is similar to tk_ref_tex.

td_ref_sem - Reference Semaphore Status

C Language Interface

#include <tk/dbgspt.h>

ER ercd = td_ref_sem(ID semid, TD_RSEM *rsem);

Parameter

ID semid Semaphore IDTarget semaphore ID
TD_RSEM* rsem Packet to Return Semaphore StatusPointer to the area to return the semaphore status

Return Parameter

ER ercd Error CodeError code

rsem Detail:

void* exinf Extended InformationExtended information
ID wtsk Waiting Task IDWaiting task ID
INT semcnt Semaphore CountCurrent semaphore resource count

Error Code

E_OK Normal completion
E_ID Bad identifier
E_NOEXS Object does not exist

Valid Context

Task portionQuasi-task portionTask-independent portion
YESYESYES

Related Service Profile Items

Only when all the service profile items below are set to be effective, this system call can be used.

TK_SUPPORT_DBGSPT Support of μT-Kernel/DS

Description

References the semaphore status. This is similar to tk_ref_sem.

td_ref_flg - Reference Event Flag Status

C Language Interface

#include <tk/dbgspt.h>

ER ercd = td_ref_flg(ID flgid, TD_RFLG *rflg);

Parameter

ID flgid EventFlag IDTarget event flag ID
TD_RFLG* rflg Packet to Return EventFlag StatusPointer to the area to return the event flag status

Return Parameter

ER ercd Error CodeError code

rflg Detail:

void* exinf Extended InformationExtended information
ID wtsk Waiting Task IDWaiting task ID
UINT flgptn EventFlag Bit PatternThe current event flag bit pattern

Error Code

E_OK Normal completion
E_ID Bad identifier
E_NOEXS Object does not exist

Valid Context

Task portionQuasi-task portionTask-independent portion
YESYESYES

Related Service Profile Items

Only when all the service profile items below are set to be effective, this system call can be used.

TK_SUPPORT_DBGSPT Support of μT-Kernel/DS

Description

References the event flag status. This is similar to tk_ref_flg.

td_ref_mbx - Reference Mailbox Status

C Language Interface

#include <tk/dbgspt.h>

ER ercd = td_ref_mbx(ID mbxid, TD_RMBX *rmbx);

Parameter

ID mbxid Mailbox IDTarget mailbox ID
TD_RMBX* rmbx Packet to Return Mailbox StatusPointer to the area to return the mailbox status

Return Parameter

ER ercd Error CodeError code

rmbx Detail:

void* exinf Extended InformationExtended information
ID wtsk Waiting Task IDWaiting task ID
T_MSG* pk_msg Packet of MessageNext message to be received

Error Code

E_OK Normal completion
E_ID Bad identifier
E_NOEXS Object does not exist

Valid Context

Task portionQuasi-task portionTask-independent portion
YESYESYES

Related Service Profile Items

Only when all the service profile items below are set to be effective, this system call can be used.

TK_SUPPORT_DBGSPT Support of μT-Kernel/DS

Description

References the mailbox status. This is similar to tk_ref_mbx.

td_ref_mtx - Refer Mutex Status

C Language Interface

#include <tk/dbgspt.h>

ER ercd = td_ref_mtx(ID mtxid, TD_RMTX *rmtx);

Parameter

ID mtxid Mutex IDTarget mutex ID
TD_RMTX* rmtx Packet to Return Mutex StatusPointer to the area to return the mutex status

Return Parameter

ER ercd Error CodeError code

rmtx Detail:

void* exinf Extended InformationExtended information
ID htsk Locking Task IDID of task locking the mutex
ID wtsk Lock Waiting Task IDID of tasks waiting to lock the mutex

Error Code

E_OK Normal completion
E_ID Bad identifier
E_NOEXS Object does not exist

Valid Context

Task portionQuasi-task portionTask-independent portion
YESYESYES

Related Service Profile Items

Only when all the service profile items below are set to be effective, this system call can be used.

TK_SUPPORT_DBGSPT Support of μT-Kernel/DS

Description

References the mutex status. This is similar to tk_ref_mtx.

td_ref_mbf - Reference Message Buffer Status

C Language Interface

#include <tk/dbgspt.h>

ER ercd = td_ref_mbf(ID mbfid, TD_RMBF *rmbf);

Parameter

ID mbfid Message Buffer IDTarget message buffer ID
TD_RMBF* rmbf Packet to Return Message Buffer StatusPointer to the area to return the message buffer status

Return Parameter

ER ercd Error CodeError code

rmbf Detail:

void* exinf Extended InformationExtended information
ID wtsk Waiting Task IDReceive waiting task ID
ID stsk Send Waiting Task IDSend waiting task ID
INT msgsz Message SizeSize of the next message to be received (in bytes)
SZ frbufsz Free Buffer SizeFree buffer size (in bytes)
INT maxmsz Maximum Message SizeMaximum message size (in bytes)

Error Code

E_OK Normal completion
E_ID Bad identifier
E_NOEXS Object does not exist

Valid Context

Task portionQuasi-task portionTask-independent portion
YESYESYES

Related Service Profile Items

Only when all the service profile items below are set to be effective, this system call can be used.

TK_SUPPORT_DBGSPT Support of μT-Kernel/DS

Description

References the message buffer status. This is similar to tk_ref_mbf.

td_ref_mpf - Reference Fixed-size Memory Pool Status

C Language Interface

#include <tk/dbgspt.h>

ER ercd = td_ref_mpf(ID mpfid, TD_RMPF *rmpf);

Parameter

ID mpfid Memory Pool IDTarget fixed-size memory pool ID
TD_RMPF* rmpf Packet to Return Memory Pool StatusPointer to the area to return the memory pool status

Return Parameter

ER ercd Error CodeError code

rmpf Detail:

void* exinf Extended InformationExtended information
ID wtsk Waiting Task IDWaiting task ID
SZ frbcnt Free Block CountFree block count

Error Code

E_OK Normal completion
E_ID Bad identifier
E_NOEXS Object does not exist

Valid Context

Task portionQuasi-task portionTask-independent portion
YESYESYES

Related Service Profile Items

Only when all the service profile items below are set to be effective, this system call can be used.

TK_SUPPORT_DBGSPT Support of μT-Kernel/DS

Description

References the fixed-size memory pool status. This is similar to tk_ref_mpf.

td_ref_mpl - Reference Variable-size Memory Pool Status

C Language Interface

#include <tk/dbgspt.h>

ER ercd = td_ref_mpl(ID mplid, TD_RMPL *rmpl);

Parameter

ID mplid Memory Pool IDTarget variable-size memory pool ID
TD_RMPL* rmpl Packet to Return Memory Pool StatusPointer to the area to return the memory pool status

Return Parameter

ER ercd Error CodeError code

rmpl Detail:

void* exinf Extended InformationExtended information
ID wtsk Waiting Task IDWaiting task ID
SZ frsz Free Memory SizeFree memory size (in bytes)
SZ maxsz Max Memory SizeMaximum memory space size (in bytes)

Error Code

E_OK Normal completion
E_ID Bad identifier
E_NOEXS Object does not exist

Valid Context

Task portionQuasi-task portionTask-independent portion
YESYESYES

Related Service Profile Items

Only when all the service profile items below are set to be effective, this system call can be used.

TK_SUPPORT_DBGSPT Support of μT-Kernel/DS

Description

References the variable-size memory pool status. This is similar to tk_ref_mpl.

td_ref_cyc - Reference Cyclic Handler Status

C Language Interface

#include <tk/dbgspt.h>

ER ercd = td_ref_cyc(ID cycid, TD_RCYC *rcyc);

Parameter

ID cycid Cyclic Handler IDTarget cyclic handler ID
TD_RCYC* rcyc Packet to Return Cyclic Handler StatusPointer to the area to return the cyclic handler status

Return Parameter

ER ercd Error CodeError code

rcyc Detail:

void* exinf Extended InformationExtended information
RELTIM lfttim Left TimeTime remaining until the next handler starts (ms)
UINT cycstat Cyclic Handler StatusCyclic handler activation state

Error Code

E_OK Normal completion
E_ID Bad identifier
E_NOEXS Object does not exist

Valid Context

Task portionQuasi-task portionTask-independent portion
YESYESYES

Related Service Profile Items

Only when all the service profile items below are set to be effective, this system call can be used.

TK_SUPPORT_DBGSPT Support of μT-Kernel/DS

Description

References the cyclic handler status. This is similar to tk_ref_cyc.

The time remaining lfttim returned in the cyclic handler status information (TD_RCYC) obtained by td_ref_cyc is a value rounded to milliseconds. To know the value in microseconds, call td_ref_cyc_u.

td_ref_cyc_u - Reference Cyclic Handler Status (Microseconds)

C Language Interface

#include <tk/dbgspt.h>

ER ercd = td_ref_cyc_u(ID cycid, TD_RCYC_U *rcyc_u);

Parameter

ID cycid Cyclic Handler IDTarget cyclic handler ID
TD_RCYC_U* rcyc_u Packet to Return Cyclic Handler StatusPointer to the area to return the cyclic handler status

Return Parameter

ER ercd Error CodeError code

rcyc_u Detail:

void* exinf Extended InformationExtended information
RELTIM_U lfttim_u Left TimeTime remaining until the next handler starts (in microseconds)
UINT cycstat Cyclic Handler StatusCyclic handler activation state

Error Code

E_OK Normal completion
E_ID Bad identifier
E_NOEXS Object does not exist

Valid Context

Task portionQuasi-task portionTask-independent portion
YESYESYES

Related Service Profile Items

Only when all the service profile items below are set to be effective, this system call can be used.

TK_SUPPORT_DBGSPT Support of μT-Kernel/DS
TK_SUPPORT_USEC Support of microsecond

Description

This system call takes 64-bit lfttim_u in microseconds instead of the return parameter lfttim of td_ref_cyc.

The specification of this system call is same as that of td_ref_cyc, except that the return parameter is replaced with lfttim_u. For more details, see the description of td_ref_cyc.

td_ref_alm - Reference Alarm Handler Status

C Language Interface

#include <tk/dbgspt.h>

ER ercd = td_ref_alm(ID almid, TD_RALM *ralm);

Parameter

ID almid Alarm Handler IDTarget alarm handler ID
TD_RALM* ralm Packet to Return Alarm Handler StatusPointer to the area to return the alarm handler status

Return Parameter

ER ercd Error CodeError code

ralm Detail:

void* exinf Extended InformationExtended information
RELTIM lfttim Left TimeTime remaining until the handler starts (ms)
UINT almstat Alarm Handler StatusAlarm handler activation state

Error Code

E_OK Normal completion
E_ID Bad identifier
E_NOEXS Object does not exist

Valid Context

Task portionQuasi-task portionTask-independent portion
YESYESYES

Related Service Profile Items

Only when all the service profile items below are set to be effective, this system call can be used.

TK_SUPPORT_DBGSPT Support of μT-Kernel/DS

Description

References the alarm handler status. This is similar to tk_ref_alm.

The time remaining lfttim returned in the alarm handler status information (TD_RALM) obtained by td_ref_alm is a value rounded to milliseconds. To know the value in microseconds, call td_ref_alm_u.

td_ref_alm_u - Reference Alarm Handler Status (Microseconds)

C Language Interface

#include <tk/dbgspt.h>

ER ercd = td_ref_alm_u(ID almid, TD_RALM_U *ralm_u);

Parameter

ID almid Alarm Handler IDTarget alarm handler ID
TD_RALM_U* ralm_u Packet to Return Alarm Handler StatusPointer to the area to return the alarm handler status

Return Parameter

ER ercd Error CodeError code

ralm_u Detail:

void* exinf Extended InformationExtended information
RELTIM_U lfttim_u Left TimeTime remaining until the handler starts (in microseconds)
UINT almstat Alarm Handler StatusAlarm handler activation state

Error Code

E_OK Normal completion
E_ID Bad identifier
E_NOEXS Object does not exist

Valid Context

Task portionQuasi-task portionTask-independent portion
YESYESYES

Related Service Profile Items

Only when all the service profile items below are set to be effective, this system call can be used.

TK_SUPPORT_DBGSPT Support of μT-Kernel/DS
TK_SUPPORT_USEC Support of microsecond

Description

This system call takes 64-bit lfttim_u in microseconds instead of the return parameter lfttim of td_ref_alm.

The specification of this system call is same as that of td_ref_alm, except that the return parameter is replaced with lfttim_u. For more details, see the description of td_ref_alm.

td_ref_sys - Reference System Status

C Language Interface

#include <tk/dbgspt.h>

ER ercd = td_ref_sys(TD_RSYS *pk_rsys);

Parameter

TD_RSYS* pk_rsys Packet to Return System StatusPointer to the area to return the system status

Return Parameter

ER ercd Error CodeError code

pk_rsys Detail:

UINT sysstat System StateSystem State
ID runtskid Running Task IDID of the task currently in RUNNING state
ID schedtskid Scheduled Task IDID of the task scheduled to run next

Error Code

E_OK Normal completion

Valid Context

Task portionQuasi-task portionTask-independent portion
YESYESYES

Related Service Profile Items

Only when all the service profile items below are set to be effective, this system call can be used.

TK_SUPPORT_DBGSPT Support of μT-Kernel/DS

Description

Gets the system status. This is similar to tk_ref_sys.

td_ref_ssy - Reference Subsystem Status

C Language Interface

#include <tk/dbgspt.h>

ER ercd = td_ref_ssy(ID ssid, TD_RSSY *rssy);

Parameter

ID ssid Subsystem IDTarget subsystem ID
TD_RSSY* rssy Packet to Return Subsystem StatusPointer to the area to return the subsystem definition information

Return Parameter

ER ercd Error CodeError code

rssy Detail:

PRI ssypri Subsystem PrioritySubsystem priority

Error Code

E_OK Normal completion
E_ID Bad identifier
E_NOEXS Object does not exist

Valid Context

Task portionQuasi-task portionTask-independent portion
YESYESYES

Related Service Profile Items

Only when all the service profile items below are set to be effective, this system call can be used.

TK_SUPPORT_DBGSPT Support of μT-Kernel/DS
TK_SUPPORT_SUBSYSTEM Support of subsystem management functions

Description

References the subsystem status. This is similar to tk_ref_ssy.

td_get_reg - Get Task Register

C Language Interface

#include <tk/dbgspt.h>

ER ercd = td_get_reg(ID tskid, T_REGS *pk_regs, T_EIT *pk_eit, T_CREGS *pk_cregs);

Parameter

ID tskid Task IDTarget task ID (TSK_SELF cannot be specified)
T_REGS* pk_regs Packet of RegistersPointer to the area to return the general register values
T_EIT* pk_eit Packet of EIT RegistersPointer to the area to return the values of registers saved when an exception occurs
T_CREGS* pk_cregs Packet of Control RegistersPointer to the area to return the control register values

Return Parameter

ER ercd Error CodeError code

The contents of T_REGS, T_EIT, and T_CREGS are defined for each CPU and implementation.

Error Code

E_OK Normal completion
E_ID Invalid ID number (tskid is invalid or cannot be used)
E_NOEXS Object does not exist (the task specified in tskid does not exist)
E_OBJ Invalid object state (issued for a RUNNING state task)

Valid Context

Task portionQuasi-task portionTask-independent portion
YESYESYES

Related Service Profile Items

Only when all the service profile items below are set to be effective, this system call can be used.

TK_SUPPORT_DBGSPT Support of μT-Kernel/DS
TK_SUPPORT_REGOPS Support for task-register manipulation functions

Description

Gets the register values of the task designated in tskid. This is similar to tk_get_reg.

Registers cannot be referenced for the task currently in RUNNING state. Except when a task-independent portion is executing, the current RUNNING state task is the invoking task.

If NULL is set in pk_regs, pk_eit, or pk_cregs, the corresponding registers are not referenced.

The contents of T_REGS, T_EIT, and T_CREGS are implementation-dependent.

td_set_reg - Set Task Registers

C Language Interface

#include <tk/dbgspt.h>

ER ercd = td_set_reg(ID tskid, CONST T_REGS *pk_regs, CONST T_EIT *pk_eit, CONST T_CREGS *pk_cregs);

Parameter

ID tskid Task IDTarget task ID (TSK_SELF cannot be specified)
CONST T_REGS* pk_regs Packet of RegistersGeneral registers
CONST T_EIT* pk_eit Packet of EIT RegistersRegisters saved when EIT occurs
CONST T_CREGS* pk_cregs Packet of Control RegistersControl registers

The contents of T_REGS, T_EIT, and T_CREGS are defined for each CPU and implementation.

Return Parameter

ER ercd Error CodeError code

Error Code

E_OK Normal completion
E_ID Invalid ID number (tskid is invalid or cannot be used)
E_NOEXS Object does not exist (the task specified in tskid does not exist)
E_OBJ Invalid object state (issued for a RUNNING state task)

Valid Context

Task portionQuasi-task portionTask-independent portion
YESYESYES

Related Service Profile Items

Only when all the service profile items below are set to be effective, this system call can be used.

TK_SUPPORT_DBGSPT Support of μT-Kernel/DS
TK_SUPPORT_REGOPS Support for task-register manipulation functions

Description

Sets registers of the task designated in tskid. This is similar to tk_set_reg.

Registers cannot be set for the task currently in RUNNING state. Except when a task-independent portion is executing, the current RUNNING state task is the invoking task.

If NULL is set in pk_regs, pk_eit, or pk_cregs, the corresponding registers are not set.

The contents of T_REGS, T_EIT, and T_CREGS are implementation-dependent.

td_get_utc - Get System Time

C Language Interface

#include <tk/dbgspt.h>

ER ercd = td_get_utc(SYSTIM *tim, UW *ofs);

Parameter

SYSTIM* tim TimePointer to the area to return the current time (ms)
UW* ofs OffsetPointer to the area to return the return parameter ofs

Return Parameter

ER ercd Error CodeError code
SYSTIM tim TimeCurrent time (in milliseconds)
UW ofs OffsetElapsed time from tim (in nanoseconds)

tim Detail:

W hi High 32 bitsHigher 32 bits of current time of the system time
UW lo Low 32 bitsLower 32 bits of current time of the system time

Error Code

E_OK Normal completion

Valid Context

Task portionQuasi-task portionTask-independent portion
YESYESYES

Related Service Profile Items

Only when all the service profile items below are set to be effective, this system call can be used.

TK_SUPPORT_DBGSPT Support of μT-Kernel/DS
TK_SUPPORT_UTC Support of UNIX time

Description

Gets the current time as total elapsed milliseconds since 0:00:00, January 1, 1970 (UTC). The value returned in tim is the same as that obtained by tk_get_utc. tim is the resolution of timer interrupt intervals (cycles), but even more precise time information is obtained in ofs as the elapsed time from tim in nanoseconds. The resolution of ofs is implementation-dependent, but generally is the resolution of hardware timer.

Since tim is a cumulative time counted based on timer interrupts, in some cases time is not refreshed, when a timer interrupt cycle arrives while interrupts are disabled and the timer interrupt handler is not started (is delayed). In such cases, the time as updated by the previous timer interrupt is returned in tim, and the elapsed time from the previous timer interrupt is returned in ofs. Accordingly, in some cases ofs will be longer than the timer interrupt cycle. The length of elapsed time that can be measured by ofs depends on the hardware, but preferably it should be possible to measure at least up to twice the timer interrupt cycle (0 ≦ ofs < twice the timer interrupt cycle).

Note that the time returned in tim and ofs is the time at some point between the calling of and return from td_get_utc. It is neither the time at which td_get_utc was called nor the time of return from td_get_utc. In order to obtain more accurate information, this function should be called in interrupts disabled state.

td_get_utc_u - Get System Time (Microseconds)

C Language Interface

#include <tk/dbgspt.h>

ER ercd = td_get_utc_u(SYSTIM_U *tim_u, UW *ofs);

Parameter

SYSTIM_U* tim_u TimePointer to the area to return the current time (in microseconds)
UW* ofs OffsetPointer to the area to return the return parameter ofs

Return Parameter

ER ercd Error CodeError code
SYSTIM_U tim_u TimeCurrent time (in microseconds)
UW ofs OffsetElapsed time from tim_u (in nanoseconds)

Error Code

E_OK Normal completion

Valid Context

Task portionQuasi-task portionTask-independent portion
YESYESYES

Related Service Profile Items

Only when all the service profile items below are set to be effective, this system call can be used.

TK_SUPPORT_DBGSPT Support of μT-Kernel/DS
TK_SUPPORT_UTC Support of UNIX time
TK_SUPPORT_USEC Support of microsecond

Description

This system call takes 64-bit tim_u in microseconds instead of the return parameter tim of td_get_utc.

The specification of this system call is same as that of td_get_utc, except that the return parameter is replaced with tim_u. For more details, see the description of td_get_utc.

td_get_tim - Get System Time (TRON)

C Language Interface

#include <tk/dbgspt.h>

ER ercd = td_get_tim(SYSTIM *tim, UW *ofs);

Parameter

SYSTIM* tim TimePointer to the area to return the current time (ms)
UW* ofs OffsetPointer to the area to return the return parameter ofs

Return Parameter

ER ercd Error CodeError code
SYSTIM tim TimeCurrent time (in milliseconds)
UW ofs OffsetElapsed time from tim (in nanoseconds)

tim Detail:

W hi High 32 bitsHigher 32 bits of current time of the system time
UW lo Low 32 bitsLower 32 bits of current time of the system time

Error Code

E_OK Normal completion

Valid Context

Task portionQuasi-task portionTask-independent portion
YESYESYES

Related Service Profile Items

Only when all the service profile items below are set to be effective, this system call can be used.

TK_SUPPORT_DBGSPT Support of μT-Kernel/DS
TK_SUPPORT_TRONTIME Support of TRON time

Description

Gets the current time as total elapsed milliseconds since 0:00:00 (GMT), January 1, 1985. The value returned in tim is the same as that obtained by tk_get_tim. tim is the resolution of timer interrupt intervals (cycles), but even more precise time information is obtained in ofs as the elapsed time from tim in nanoseconds. The resolution of ofs is implementation-dependent, but generally is the resolution of hardware timer.

Since tim is a cumulative time counted based on timer interrupts, in some cases time is not refreshed, when a timer interrupt cycle arrives while interrupts are disabled and the timer interrupt handler is not started (is delayed). In such cases, the time as updated by the previous timer interrupt is returned in tim, and the elapsed time from the previous timer interrupt is returned in ofs. Accordingly, in some cases ofs will be longer than the timer interrupt cycle. The length of elapsed time that can be measured by ofs depends on the hardware, but preferably it should be possible to measure at least up to twice the timer interrupt cycle (0 ≦ ofs < twice the timer interrupt cycle).

Note that the time returned in tim and ofs is the time at some point between the calling of and return from td_get_tim. It is neither the time at which td_get_tim was called nor the time of return from td_get_tim. In order to obtain more accurate information, this function should be called in interrupts disabled state.

Additional Notes

td_get_tim is very similar to td_get_utc. However, it uses the time system with a different epoch. td_get_tim is an API to keep compatibility with legacy μT-Kernel or T-Kernel specifications.

td_get_tim_u - Get System Time (TRON, Microseconds)

C Language Interface

#include <tk/dbgspt.h>

ER ercd = td_get_tim_u(SYSTIM_U *tim_u, UW *ofs);

Parameter

SYSTIM_U* tim_u TimePointer to the area to return the current time (in microseconds)
UW* ofs OffsetPointer to the area to return the return parameter ofs

Return Parameter

ER ercd Error CodeError code
SYSTIM_U tim_u TimeCurrent time (in microseconds)
UW ofs OffsetElapsed time from tim_u (in nanoseconds)

Error Code

E_OK Normal completion

Valid Context

Task portionQuasi-task portionTask-independent portion
YESYESYES

Related Service Profile Items

Only when all the service profile items below are set to be effective, this system call can be used.

TK_SUPPORT_DBGSPT Support of μT-Kernel/DS
TK_SUPPORT_TRONTIME Support of TRON time
TK_SUPPORT_USEC Support of microsecond

Description

This system call takes 64-bit tim_u in microseconds instead of the return parameter tim of td_get_tim.

The specification of this system call is same as that of td_get_tim, except that the return parameter is replaced with tim_u. For more details, see the description of td_get_tim.

Additional Notes

td_get_tim_u is very similar to td_get_utc_u. However, it uses the time system with a different epoch. td_get_tim_u is an API to keep compatibility with legacy μT-Kernel or T-Kernel specifications.

td_get_otm - Get Operating Time

C Language Interface

#include <tk/dbgspt.h>

ER ercd = td_get_otm(SYSTIM *tim, UW *ofs);

Parameter

SYSTIM* tim TimePointer to the area to return the operating time (ms)
UW* ofs OffsetPointer to the area to return the return parameter ofs

Return Parameter

ER ercd Error CodeError code
SYSTIM tim TimeOperating time (in milliseconds)
UW ofs OffsetElapsed time from tim (in nanoseconds)

tim Detail:

W hi High 32 bitsHigher 32 bits of the system operating time
UW lo Low 32 bitsLower 32 bits of the system operating time

Error Code

E_OK Normal completion

Valid Context

Task portionQuasi-task portionTask-independent portion
YESYESYES

Related Service Profile Items

Only when all the service profile items below are set to be effective, this system call can be used.

TK_SUPPORT_DBGSPT Support of μT-Kernel/DS

Description

Gets the system operating time (uptime, as elapsed milliseconds since the system was booted). The value returned in tim is the same as that obtained by tk_get_otm. tim is the resolution of timer interrupt intervals (cycles), but even more precise time information is obtained in ofs as the elapsed time from tim in nanoseconds. The resolution of ofs is implementation-dependent, but generally is the resolution of hardware timer.

Since tim is a cumulative time counted based on timer interrupts, in some cases time is not refreshed, when a timer interrupt cycle arrives while interrupts are disabled and the timer interrupt handler is not started (is delayed). In such cases, the time as updated by the previous timer interrupt is returned in tim, and the elapsed time from the previous timer interrupt is returned in ofs. Accordingly, in some cases ofs will be longer than the timer interrupt cycle. The length of elapsed time that can be measured by ofs depends on the hardware, but preferably it should be possible to measure at least up to twice the timer interrupt cycle (0 ≦ ofs < twice the timer interrupt cycle).

Note that the time returned in tim and ofs is the time at some point between the calling of and return from td_get_otm. It is neither the time at which td_get_otm was called nor the time of return from td_get_otm. In order to obtain more accurate information, this function should be called in interrupts disabled state.

td_get_otm_u - Get Operating Time (Microseconds)

C Language Interface

#include <tk/dbgspt.h>

ER ercd = td_get_otm_u(SYSTIM_U *tim_u, UW *ofs);

Parameter

SYSTIM_U* tim_u TimePointer to the area to return the operating time (in microseconds)
UW* ofs OffsetPointer to the area to return the return parameter ofs

Return Parameter

ER ercd Error CodeError code
SYSTIM_U tim_u TimeOperating time (in microseconds)
UW ofs OffsetElapsed time from tim_u (in nanoseconds)

Error Code

E_OK Normal completion

Valid Context

Task portionQuasi-task portionTask-independent portion
YESYESYES

Related Service Profile Items

Only when all the service profile items below are set to be effective, this system call can be used.

TK_SUPPORT_DBGSPT Support of μT-Kernel/DS
TK_SUPPORT_USEC Support of microsecond

Description

This system call takes 64-bit tim_u in microseconds instead of the return parameter tim of td_get_otm.

The specification of this system call is same as that of td_get_otm, except that the return parameter is replaced with tim_u. For more details, see the description of td_get_otm.

td_ref_dsname - Refer to DS Object Name

C Language Interface

#include <tk/dbgspt.h>

ER ercd = td_ref_dsname(UINT type, ID id, UB *dsname);

Parameter

UINT type Object TypeTarget object type
ID id Object IDObject ID
UB* dsname DS Object NamePointer to the area to return the DS object name

Return Parameter

ER ercd Error CodeError code

dsname Detail:

DS object name, set at object creation or by td_set_dsname

Error Code

E_OK Normal completion
E_PAR Invalid object type
E_NOEXS Object does not exist
E_OBJ DS object name is not used

Valid Context

Task portionQuasi-task portionTask-independent portion
YESYESYES

Related Service Profile Items

Only when all the service profile items below are set to be effective, this system call can be used.

TK_SUPPORT_DSNAME Support for DS object name

Description

References the DS object name (dsname), which is set at object creation. The object is specified by object type (type) and object ID (id).

Object types (type) are as follows:

TN_TSK 0x01Task
TN_SEM 0x02Semaphore
TN_FLG 0x03Event Flag
TN_MBX 0x04Mailbox
TN_MBF 0x05Message Buffer
TN_POR 0x06(reserved)
TN_MTX 0x07Mutex
TN_MPL 0x08Variable-size Memory Pool
TN_MPF 0x09Fixed-size Memory Pool
TN_CYC 0x0aCyclic Handler
TN_ALM 0x0bAlarm Handler

DS object name is valid if TA_DSNAME is set as object attribute. If DS object name is changed by td_set_dsname, then td_ref_dsname references the new name.

DS object name needs to satisfy the following conditions. However, character code range is not checked by μT-Kernel.

Available characters (UB)

a to z, A to Z, 0 to 9, _

Name length

Up to 8 bytes (not including '\0')

Additional Notes

The DS object name that is read is terminated with a '\0' character. Hence, dsname must have a area of 9 or more bytes.

td_set_dsname - Set DS Object Name

C Language Interface

#include <tk/dbgspt.h>

ER ercd = td_set_dsname(UINT type, ID id, CONST UB *dsname);

Parameter

UINT type Object TypeTarget object type
ID id Object IDObject ID
CONST UB* dsname DS Object NameDS object name to be set

Return Parameter

ER ercd Error CodeError code

Error Code

E_OK Normal completion
E_PAR Invalid object type
E_NOEXS Object does not exist
E_OBJ DS object name is not used

Valid Context

Task portionQuasi-task portionTask-independent portion
YESYESYES

Related Service Profile Items

Only when all the service profile items below are set to be effective, this system call can be used.

TK_SUPPORT_DSNAME Support for DS object name

Description

Re-sets DS object name (dsname), which is set at object creation. The object is specified by object type (type) and object ID (id).

Object types (type) are as same as that of td_ref_dsname.

DS object name needs to satisfy the following conditions. However, character code range is not checked by μT-Kernel.

Available characters (UB)

a to z, A to Z, 0 to 9, _

Name length

Up to 8 bytes (not including '\0')

DS object name is valid if TA_DSNAME is set as object attribute. td_set_dsname returns E_OBJ error if TA_DSNAME attribute is not specified.