Forums: Help (Thread #2146)

mexe_dsp.c (2003-03-05 20:59 by Anonymous #4056)

snd_mbx.cのスレッドを立てた者です。
お世話になっております。

tskstatについて疑問なのですが
mexe_dsp.cの69行目の

mtcb_top->tskstat = TTS_RDY

ですがここはTTS_RUNを代入すべきなのでは
ないでしょうか?
この直後でコンテキストの切り替えでmtcb_topが
実行タスクになるのですよね?

またソース中のどこにもTTS_RUNがtsk_statに
代入されている
個所はないように思ったのですが…

よろしくお願いいたします。

Reply to #4056×

You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.) Login

RE: mexe_dsp.c (2003-03-05 21:05 by m-arai #4057)

修正しました。
Reply to #4056

Reply to #4057×

You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.) Login

RE: mexe_dsp.c (2003-03-05 21:26 by ryuz #4060)


 お世話になります。Ryuzです。

> 修正しました。

 多分大丈夫だと思いますが、RDY or RUN でないと
まずいところを RDY のみで比較してるところがあると
まずいので、一応気をつけておいてください。

 デバッグ容易性という点では変えといたほうが
確かによさげですね。

 HOSは今のところRUNでもレディーキューに繋ぐ
タイプの実装なので実を言うと

 カレントタスクなら RUN
 レディーキューに繋がってれば RDY
 それ以外のキューなら WAI
 どこにも繋がってなければ DMT
 サスペンドカウンタが0でなければ SUS

 なので、ref_tsk などの実装を重くしてもよければ
tskstat を削除して、TCBサイズを減らす手もあるんで
すよ。
 逆も真で、tskstat があればキューを指す
ポインタを削る事も可能です。

 この辺は自動車プロファイルに向けて、構想を
温め中です (^^)


Reply to #4057

Reply to #4060×

You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.) Login

RE: mexe_dsp.c (2003-03-05 21:13 by ryuz #4059)

 お世話になります。Ryuzです。

> mtcb_top->tskstat = TTS_RDY
> ですがここはTTS_RUNを代入すべきなのでは
> ないでしょうか?

 RUNかどうかは、別途実行中タスクのポインタから
判別可能ですのであえて、効率化のためにこうして
おります。

 RUN時に、レディーキューから外すべきか、
付けたままにすべきかの議論と似ていて、
微妙な問題ですね (^^;;
Reply to #4056

Reply to #4059×

You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.) Login

RE: mexe_dsp.c (2003-03-05 21:29 by m-arai #4061)

なるほど、あまり考え無しに反応してしまいました。
それに、ただ単にここを修正しただけでは、上位優先度の
タスクにスイッチした場合、RUNからRDYにならない…か
な?

ただ、ref_tstの結果は正しくなくなりますね。

う~む。現状では、戻しておいた方が吉のような気がして
きたので、戻します。
Reply to #4059

Reply to #4061×

You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.) Login

RE: mexe_dsp.c (2003-03-05 21:35 by ryuz #4062)


> ただ、ref_tstの結果は正しくなくなりますね。

申し訳ないです。
 ひとまず、ref_tst 内で mknl_get_run_tsk() の値と
一致したら RUN を格納するようにして逃げていただければ
良いかと思います。

 根本的な治療(?)は、若干検証してからでないと
ちょっと怖いかもしれません。

 が、ポリシーは統一するべきですよね、やっぱり (^^;;
Reply to #4061

Reply to #4062×

You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.) Login

RE: mexe_dsp.c (2003-03-05 22:10 by m-arai #4063)

こんな感じですかね。次にリリースファイルを作成するま
でに何かしらのアクションが無くて、これで問題ないよう
なら、commitします。

確かに、tskstat等の情報は影響が及ぶ範囲が広いので、
検証無しに手を入れるのは禁物でした。

Index: ref_tst.c
===================================================================
RCS file: /cvsroot/hos/hos/hos-v4/src/kernel/tsk/ref_tst.c,v
retrieving revision 1.7
diff -u -r1.7 ref_tst.c
--- ref_tst.c 10 Nov 2002 15:28:41 -0000 1.7
+++ ref_tst.c 5 Mar 2003 12:56:19 -0000
@@ -41,6 +41,10 @@
}
#endif
tcb_ram = kernel_get_run_tsk();
+
+ /* タスク情報取得 */
+ p_rtst->tskstat = TTS_RUN;
+ p_rtst->tskwait = 0;
}
else
{
@@ -55,11 +59,11 @@
return (ER_UINT)E_NOEXS; /* オブジェクト未生成 */
}
#endif
+ /* タスク情報取得 */
+ p_rtst->tskstat = mknl_get_tskstat(&tcb_ram->mtcb);
+ p_rtst->tskwait = mknl_get_tskwait(&tcb_ram->mtcb);
}

- /* タスク情報取得 */
- p_rtst->tskstat = mknl_get_tskstat(&tcb_ram->mtcb);
- p_rtst->tskwait = mknl_get_tskwait(&tcb_ram->mtcb);
p_rtst->exinf = tcb_ram->tcb_rom->exinf;

mknl_unl_sys(); /* システムのロック解除 */
Reply to #4062

Reply to #4063×

You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.) Login

RE: mexe_dsp.c (2003-03-06 08:55 by m-arai #4064)

ああ、これじゃダメだった。こうですね。

Index: ref_tst.c
===================================================================
RCS file: /cvsroot/hos/hos/hos-v4/src/kernel/tsk/ref_tst.c,v
retrieving revision 1.7
diff -u -r1.7 ref_tst.c
--- ref_tst.c 10 Nov 2002 15:28:41 -0000 1.7
+++ ref_tst.c 5 Mar 2003 23:52:24 -0000
@@ -58,8 +58,13 @@
}

/* タスク情報取得 */
- p_rtst->tskstat = mknl_get_tskstat(&tcb_ram->mtcb);
- p_rtst->tskwait = mknl_get_tskwait(&tcb_ram->mtcb);
+ if ( tcb_ram == kernel_get_run_tsk()) {
+ p_rtst->tskstat = TTS_RUN;
+ p_rtst->tskwait = 0;
+ } else {
+ p_rtst->tskstat = mknl_get_tskstat(&tcb_ram->mtcb);
+ p_rtst->tskwait = mknl_get_tskwait(&tcb_ram->mtcb);
+ }
p_rtst->exinf = tcb_ram->tcb_rom->exinf;

mknl_unl_sys(); /* システムのロック解除 */
Reply to #4063

Reply to #4064×

You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.) Login