- 171 -
get_tid Reference task ID in the RUNNING state iget_tid Reference task ID in the RUNNING state (handler only)
[
[[
[
C
C
L
La
an
ng
gu
ua
ag
ge
e
A
AP
PI
I
]
]]
]
ER ercd = get_tid( ID *p_tskid );
ER ercd = iget_tid( ID *p_tskid );
z
z
P
Pa
ar
ra
am
me
et
te
er
rs
s
ID *p_tskid Po in ter to task ID
z
z
R
Re
et
tu
ur
rn
n
P
Pa
ar
ra
am
me
et
te
er
rs
s
ER ercd Terminated normally (E_OK)
ID *p_tskid Pointer to task ID
[
[[
[
A
As
ss
se
em
mb
bl
ly
y
l
la
an
ng
gu
ua
ag
ge
e
A
AP
PI
I
]
]]
]
.include mr100.inc
get_tid
iget_tid
z
z
P
Pa
ar
ra
am
me
et
te
er
rs
s
None
z
z
R
Re
eg
gi
is
st
te
er
r
c
co
on
nt
te
en
nt
ts
s
a
af
ft
te
er
r
s
se
er
rv
vi
ic
ce
e
c
ca
al
ll
l
i
is
s
i
is
ss
su
ue
ed
d
Register name Content after service call is issued
R0 Error code
R2 Acquired task ID
[
[[
[
E
Er
rr
ro
or
r
c
co
od
de
e
]
]]
]
None
[
[[
[
F
Fu
un
nc
ct
ti
io
on
na
al
l
d
de
es
sc
cr
ri
ip
pt
ti
io
on
n
]
]]
]
This service call returns the task ID currently in RUNNING state to the area pointed to by p_tskid. If this service call is
issued from a task, the ID number of the issuing task is returned. If this service call is issued from non-task context, the task
ID being executed at that point in time is returned. If there are no tasks currently in an executing state, TSK_NONE is re-
turned.
If this service call is to be issued from task context, use get_tid; if issued from non-task context, use iget_tid.
[
[[
[
E
Ex
xa
am
mp
pl
le
e
p
pr
ro
og
gr
ra
am
m
s
st
ta
at
te
em
me
en
nt
t
]
]]
]
<<Example statement in C language>>
#include <itron.h>
#include <kernel.h>
#include “kernel_id.h”
void task()
{
ID tskid;
:
get_tid(&tskid);
:
}
<<Example statement in assembly language>>
.include mr100.inc
.GLB task
task: :
get_tid
: