Skip to content

Commit 72a7a6a

Browse files
committed
update
1 parent ba8df51 commit 72a7a6a

3 files changed

Lines changed: 17 additions & 1 deletion

File tree

intros/kernel/src/ostask.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,8 @@ void tsk_init( tsk_t *tsk, fun_t *proc, stk_t *stack, size_t size )
7575
priv_wrk_init(tsk, proc, NULL, stack, size);
7676
if (proc)
7777
{
78+
tsk->start = core_sys_time();
79+
7880
core_ctx_init(tsk);
7981
core_tsk_insert(tsk);
8082
}
@@ -93,6 +95,8 @@ void tsk_start( tsk_t *tsk )
9395
{
9496
if (tsk->hdr.id == ID_STOPPED) // active tasks cannot be started
9597
{
98+
tsk->start = core_sys_time();
99+
96100
core_ctx_init(tsk);
97101
core_tsk_insert(tsk);
98102
}
@@ -112,6 +116,7 @@ void tsk_startFrom( tsk_t *tsk, fun_t *proc )
112116
if (tsk->hdr.id == ID_STOPPED) // active tasks cannot be started
113117
{
114118
tsk->proc = proc;
119+
tsk->start = core_sys_time();
115120

116121
core_ctx_init(tsk);
117122
core_tsk_insert(tsk);
@@ -133,6 +138,7 @@ void tsk_startWith( tsk_t *tsk, fun_a *proc, void *arg )
133138
{
134139
tsk->proc = (fun_t *)proc;
135140
tsk->arg = arg;
141+
tsk->start = core_sys_time();
136142

137143
core_ctx_init(tsk);
138144
core_tsk_insert(tsk);

make/toolchain-x86-gcc.make

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ LIB_DIRS ?=
1717
#----------------------------------------------------------#
1818

1919
GCC ?= # toolchain path
20-
OPTF ?= # opimization level (0..3, s, fast, g)
20+
OPTF ?= # optimization level (0..3, s, fast, g)
2121
STDC ?= 23 # c dialect
2222
STDCXX ?= 23 # c++ dialect
2323

stateos/kernel/src/ostask.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,8 @@ void tsk_init( tsk_t *tsk, unsigned prio, fun_t *proc, stk_t *stack, size_t size
9999
priv_wrk_init(tsk, prio, proc, NULL, stack, size, NULL, false);
100100
if (proc)
101101
{
102+
tsk->start = core_sys_time();
103+
102104
core_ctx_init(tsk);
103105
core_tsk_insert(tsk);
104106
}
@@ -121,6 +123,8 @@ tsk_t *wrk_create( unsigned prio, fun_t *proc, size_t size, bool detached, bool
121123
tsk = priv_wrk_create(prio, proc, NULL, size, detached);
122124
if (tsk && autostart)
123125
{
126+
tsk->start = core_sys_time();
127+
124128
core_ctx_init(tsk);
125129
core_tsk_insert(tsk);
126130
}
@@ -144,6 +148,8 @@ tsk_t *tsk_setup( unsigned prio, fun_a *proc, void *arg, size_t size )
144148
tsk = priv_wrk_create(prio, (fun_t *)proc, arg, size, false);
145149
if (tsk && proc)
146150
{
151+
tsk->start = core_sys_time();
152+
147153
core_ctx_init(tsk);
148154
core_tsk_insert(tsk);
149155
}
@@ -166,6 +172,8 @@ void tsk_start( tsk_t *tsk )
166172
{
167173
if (tsk->hdr.id == ID_STOPPED) // active tasks cannot be started
168174
{
175+
tsk->start = core_sys_time();
176+
169177
core_ctx_init(tsk);
170178
core_tsk_insert(tsk);
171179
}
@@ -187,6 +195,7 @@ void tsk_startFrom( tsk_t *tsk, fun_t *proc )
187195
if (tsk->hdr.id == ID_STOPPED) // active tasks cannot be started
188196
{
189197
tsk->proc = proc;
198+
tsk->start = core_sys_time();
190199

191200
core_ctx_init(tsk);
192201
core_tsk_insert(tsk);
@@ -210,6 +219,7 @@ void tsk_startWith( tsk_t *tsk, fun_a *proc, void *arg )
210219
{
211220
tsk->proc = (fun_t *)proc;
212221
tsk->arg = arg;
222+
tsk->start = core_sys_time();
213223

214224
core_ctx_init(tsk);
215225
core_tsk_insert(tsk);

0 commit comments

Comments
 (0)