sample1-dual1.c#include <t_services.h>
#include <s_services.h>
#include "kernel_id.h"
#include "sample1-dual1.h"
#include "class_id.h"
sample1-dual1.cのインクルード依存関係図
ソースコードを見る。
関数
void cyclic_handler |
( |
VP_INT |
exinf |
) |
|
|
void led_handler |
( |
VP_INT |
exinf |
) |
|
|
|
LED周期ハンドラ
プロセッサが動作していることを示す
sample1-dual1.c の 258 行で定義されています。
参照先 set_led(). 00259 {
00260 static unsigned char led_data = 0;
00261
00262 set_led(led_data);
00263
00264 led_data = ~led_data;
00265 }
関数の呼び出しグラフ:
|
void main_task |
( |
VP_INT |
exinf |
) |
|
|
|
sample1-dual1.c の 270 行で定義されています。
参照先 act_tsk()・can_act()・can_wup()・chg_pri()・frsm_tsk()・get_pri()・get_tim()・HIGH_PRIORITY・IOCTL_CRLF・IOCTL_FCRCV・IOCTL_FCSND・kernel_exit()・LOG_EMERG・LOG_INFO・LOG_NOTICE・LOG_UPTO・LOOP_REF・LOW_PRIORITY・MERCD・message・MID_PRIORITY・mrot_rdq()・ras_tex()・rel_wai()・rsm_tsk()・serial_ctl_por()・serial_rea_dat()・sta_cyc()・stp_cyc()・sus_tsk()・syscall・syslog()・task_loop・TASK_PORTID・ter_tsk()・tex_loop・vmsk_log()・vxget_tim()・wup_tsk(). 00271 {
00272 char c;
00273 ID tskid = TASK1;
00274 INT clsid = PE1_CLASS_ID;
00275 volatile UW i;
00276 INT tskno = 1;
00277 ER_UINT ercd;
00278 PRI tskpri;
00279 SYSTIM stime1, stime2;
00280 #ifndef OMIT_VGET_TIM
00281 SYSUTIM utime1, utime2;
00282 #endif
00283
00284 vmsk_log(LOG_UPTO(LOG_INFO), LOG_UPTO(LOG_EMERG));
00285 syslog(LOG_NOTICE, "Sample program starts (exinf = %d).", exinf);
00286
00287 syscall(serial_ctl_por(TASK_PORTID,
00288 (IOCTL_CRLF | IOCTL_FCSND | IOCTL_FCRCV)));
00289
00290
00291
00292
00293 task_loop = LOOP_REF;
00294 get_tim(&stime1);
00295 for (i = 0; i < task_loop; i++);
00296 get_tim(&stime2);
00297 task_loop = LOOP_REF * 400 / (stime2 - stime1);
00298 tex_loop = task_loop / 5;
00299
00300
00301
00302
00303
00304
00305
00306
00307
00308
00309
00310 do {
00311 syscall(serial_rea_dat(TASK_PORTID, &c, 1));
00312 switch (c) {
00313 case 'e':
00314 case 's':
00315 case 'S':
00316 case 'd':
00317 case 'y':
00318 case 'Y':
00319 case 'z':
00320 case 'Z':
00321 message[tskno-1] = c;
00322 break;
00323 case '1':
00324 tskno = 1;
00325 tskid = TASK1 | (clsid << 16);
00326 break;
00327 case '2':
00328 tskno = 2;
00329 tskid = TASK2 | (clsid << 16);
00330 break;
00331 case '3':
00332 tskno = 3;
00333 tskid = TASK3 | (clsid << 16);
00334 break;
00335 case '4':
00336 clsid = PE1_CLASS_ID;
00337 tskid = (tskid & 0xffff) | (clsid << 16);
00338 syslog(LOG_INFO, "Select Processor %d",PE1_CLASS_ID);
00339 break;
00340 case '5':
00341 clsid = PE2_CLASS_ID;
00342 tskid = (tskid & 0xffff) | (clsid << 16);
00343 syslog(LOG_INFO, "Select Processor %d",PE2_CLASS_ID);
00344 break;
00345 case 'a':
00346 syslog(LOG_INFO, "#act_tsk(0x%x)", tskid);
00347 syscall(act_tsk(tskid));
00348 break;
00349 case 'A':
00350 syslog(LOG_INFO, "#can_act(0x%x)", tskid);
00351 syscall(ercd = can_act(tskid));
00352 if (MERCD(ercd) >= 0) {
00353 syslog(LOG_NOTICE, "can_act(0x%x) returns %d",
00354 tskid, ercd);
00355 }
00356 break;
00357 case 't':
00358 syslog(LOG_INFO, "#ter_tsk(0x%x)", tskid);
00359 syscall(ter_tsk(tskid));
00360 break;
00361 case '>':
00362 syslog(LOG_INFO, "#chg_pri(0x%x, HIGH_PRIORITY)", tskid);
00363 chg_pri(tskid, HIGH_PRIORITY);
00364 break;
00365 case '=':
00366 syslog(LOG_INFO, "#chg_pri(0x%x, MID_PRIORITY)", tskid);
00367 chg_pri(tskid, MID_PRIORITY);
00368 break;
00369 case '<':
00370 syslog(LOG_INFO, "#chg_pri(0x%x, LOW_PRIORITY)", tskid);
00371 chg_pri(tskid, LOW_PRIORITY);
00372 break;
00373 case 'G':
00374 syslog(LOG_INFO, "#get_pri(0x%x, &tskpri)", tskid);
00375 syscall(ercd = get_pri(tskid, &tskpri));
00376 if (MERCD(ercd) >= 0) {
00377 syslog(LOG_NOTICE, "priority of task 0x%x is %d",
00378 tskid, tskpri);
00379 }
00380 break;
00381 case 'w':
00382 syslog(LOG_INFO, "#wup_tsk(0x%x)", tskid);
00383 syscall(wup_tsk(tskid));
00384 break;
00385 case 'W':
00386 syslog(LOG_INFO, "#can_wup(0x%x)", tskid);
00387 syscall(ercd = can_wup(tskid));
00388 if (MERCD(ercd) >= 0) {
00389 syslog(LOG_NOTICE, "can_wup(0x%x) returns %d",
00390 tskid, ercd);
00391 }
00392 break;
00393 case 'l':
00394 syslog(LOG_INFO, "#rel_wai(0x%x)", tskid);
00395 syscall(rel_wai(tskid));
00396 break;
00397 case 'u':
00398 syslog(LOG_INFO, "#sus_tsk(0x%x)", tskid);
00399 syscall(sus_tsk(tskid));
00400 break;
00401 case 'm':
00402 syslog(LOG_INFO, "#rsm_tsk(0x%x)", tskid);
00403 syscall(rsm_tsk(tskid));
00404 break;
00405 case 'M':
00406 syslog(LOG_INFO, "#frsm_tsk(0x%x)", tskid);
00407 syscall(frsm_tsk(tskid));
00408 break;
00409 case 'x':
00410 syslog(LOG_INFO, "#ras_tex(0x%x, 0x0001)", tskid);
00411 syscall(ras_tex(tskid, 0x0001));
00412 break;
00413 case 'X':
00414 syslog(LOG_INFO, "#ras_tex(0x%x, 0x0002)", tskid);
00415 syscall(ras_tex(tskid, 0x0002));
00416 break;
00417 case 'r':
00418 syslog(LOG_INFO, "#mrot_rdq(%d, three priorities)", clsid);
00419 syscall(mrot_rdq(clsid, HIGH_PRIORITY));
00420 syscall(mrot_rdq(clsid, MID_PRIORITY));
00421 syscall(mrot_rdq(clsid, LOW_PRIORITY));
00422 break;
00423 case 'c':
00424 syslog(LOG_INFO, "#sta_cyc(PE2_CYCHDR1)");
00425 sta_cyc((clsid << 16) | CYCHDR1);
00426 break;
00427 case 'C':
00428 syslog(LOG_INFO, "#stp_cyc(PE2_CYCHDR1)");
00429 stp_cyc((clsid << 16) | CYCHDR1);
00430 break;
00431 case 'j':
00432 syslog(LOG_INFO, "#sta_cyc(LEDHDR1)");
00433 sta_cyc((clsid << 16) | LEDHDR1);
00434 break;
00435 case 'J':
00436 syslog(LOG_INFO, "#stp_cyc(LEDHDR1)");
00437 stp_cyc((clsid << 16) | LEDHDR1);
00438 break;
00439 #ifndef OMIT_VGET_TIM
00440 case 'V':
00441 syscall(vxget_tim(&utime1));
00442 syscall(vxget_tim(&utime2));
00443 syslog(LOG_NOTICE, "utime1 = %d, utime2 = %d",
00444 (UINT) utime1, (UINT) utime2);
00445 break;
00446 #endif
00447 case 'v':
00448 vmsk_log(LOG_UPTO(LOG_INFO), LOG_UPTO(LOG_EMERG));
00449 break;
00450 case 'q':
00451 vmsk_log(LOG_UPTO(LOG_NOTICE), LOG_UPTO(LOG_EMERG));
00452 break;
00453 default:
00454 break;
00455 }
00456 } while (c != '\003' && c != 'Q');
00457
00458 syslog(LOG_NOTICE, "Sample program ends.");
00459 kernel_exit();
00460 }
関数の呼び出しグラフ:
|
|
sample1-dual1.c の 125 行で定義されています。
参照先 dis_tex()・dly_tsk()・ena_tex()・ext_tsk()・loc_cpu()・LOG_INFO・LOG_NOTICE・message・slp_tsk()・syscall・syslog()・task_loop・tslp_tsk()・unl_cpu().
参照元 makeoffset(). 00126 {
00127 volatile UW i;
00128 INT n = 0;
00129 INT tskno = (INT) exinf;
00130 const char *graph[] = { "|", " +", " *" };
00131 char c;
00132
00133 ena_tex();
00134 while (1) {
00135 syslog(LOG_NOTICE, "task%d is running (%03d). %s",
00136 tskno, ++n, graph[tskno-1]);
00137 for (i = 0; i < task_loop; i++);
00138 c = message[tskno-1];
00139 message[tskno-1] = 0;
00140 switch (c) {
00141 case 'e':
00142 syslog(LOG_INFO, "#%d#ext_tsk()", tskno);
00143 ext_tsk();
00144 case 's':
00145 syslog(LOG_INFO, "#%d#slp_tsk()", tskno);
00146 syscall(slp_tsk());
00147 break;
00148 case 'S':
00149 syslog(LOG_INFO, "#%d#tslp_tsk(3000)", tskno);
00150 syscall(tslp_tsk(3000));
00151 break;
00152 case 'd':
00153 syslog(LOG_INFO, "#%d#dly_tsk(10000)", tskno);
00154 syscall(dly_tsk(10000));
00155 break;
00156 case 'y':
00157 syslog(LOG_INFO, "#%d#dis_tex()", tskno);
00158 syscall(dis_tex());
00159 break;
00160 case 'Y':
00161 syslog(LOG_INFO, "#%d#ena_tex()", tskno);
00162 syscall(ena_tex());
00163 break;
00164 #ifdef CPUEXC1
00165 case 'z':
00166 syslog(LOG_NOTICE, "#%d#raise CPU exception", tskno);
00167 RAISE_CPU_EXCEPTION;
00168 break;
00169 case 'Z':
00170 loc_cpu();
00171 syslog(LOG_NOTICE, "#%d#raise CPU exception", tskno);
00172 RAISE_CPU_EXCEPTION;
00173 unl_cpu();
00174 break;
00175 #endif
00176 default:
00177 break;
00178 }
00179 }
00180 }
関数の呼び出しグラフ:
|
変数
Copyright © 2006 by TAKAGI Nobuhisa.
このページは Mon Apr 3 23:49:17 2006 に Doxygen によって生成されました。
|
|