63: if (exinf != NULL) {
64: P("%08x", exinf);
65: for (i = 0; i < 4; i++) {
67: }
68: if (i >= 4) P(" %.4s", p);
69: }
70: P("\n");
71: }
82: if (er < E_OK) {
83: P("ERR [%#x]\n", er);
84: return;
85: }
86: P("MEMORY: ");
87: if (ms.total <= 0 || ms.free < 0) {
88: P("unknown\n");
89: return;
91: ratio = 100 - (ms.free * 100 / ms.total);
92: P("Blksz=%d Total=%d (%d KB) Free=%d (%d KB) [%d %% used]\n",
93: ms.blksz, ms.total, ms.total * (ms.blksz / 1024),
108: tk_get_cfn((UB*)"TMaxTskId", &maxid, 1);
109: P("TSK STATE (MAX:%d)\n", maxid);
110:
113:
114: P("TID PRI:BPR SLT WUP SUS STS(*:NODISWAI) ST+UT(x10) RID EXINF\n");
115:
119: if (er != E_NOEXS)
120: P("ERR id = %3d [%#x]\n", id, er);
121: continue;
124: /* TID PRI:BPR SLT WUP SUS */
125: P("%3d %3d:%3d %3d %3d %3d ",
126: id, ref.tskpri, ref.tskbpri, ref.slicetime,
138: }
139: P(p);
140:
161: }
162: if (tev == 0) P("-%-5s", p);
163: else P("-%2s:%02x", p, tev);
164:
165: P("%c", ((ref.tskstat & TTS_NODISWAI) != 0)? '*':' ');
166:
167: if (ref.wid > 0) P("[%3d]", ref.wid);
168: else P(" ");
169: } else {
170: P(" ");
171: }
174: tk_inf_tsk(id, &inf, FALSE);
175: P(" %5d+%-5d %3d ", inf.stime / 10,
176: inf.utime / 10, tk_get_rid(id));
190: tk_get_cfn((UB*)"TMaxSemId", &maxid, 1);
191: P("SEM STATE (MAX:%d):\n", maxid);
192:
195:
196: P(" ID WID CNT EXINF\n");
197:
201: if (er != E_NOEXS)
202: P("ERR id = %3d [%#x]\n", id, er);
203: continue;
204: }
205: P("%3d %3d %3d ", id, ref.wtsk, ref.semcnt);
206: dsp_exinf(ref.exinf);
219: tk_get_cfn((UB*)"TMaxMtxId", &maxid, 1);
220: P("MTX STATE (MAX:%d):\n", maxid);
221:
224:
225: P(" ID HID WID EXINF\n");
226:
230: if (er != E_NOEXS)
231: P("ERR id = %3d [%#x]\n", id, er);
232: continue;
233: }
234: P("%3d %3d %3d ", id, ref.htsk, ref.wtsk);
235: dsp_exinf(ref.exinf);
248: tk_get_cfn((UB*)"TMaxFlgId", &maxid, 1);
249: P("FLG STATE (MAX:%d):\n", maxid);
250:
253:
254: P(" ID WID PTN EXINF\n");
255:
259: if (er != E_NOEXS)
260: P("ERR id = %3d [%#x]\n", id, er);
261: continue;
262: }
263: P("%3d %3d %08x ", id, ref.wtsk, ref.flgptn);
264: dsp_exinf(ref.exinf);
277: tk_get_cfn((UB*)"TMaxMbxId", &maxid, 1);
278: P("MBX STATE (MAX:%d):\n", maxid);
279:
282:
283: P(" ID WID MSG EXINF\n");
284:
288: if (er != E_NOEXS)
289: P("ERR id = %3d [%#x]\n", id, er);
290: continue;
291: }
292: P("%3d %3d %08x ", id, ref.wtsk, ref.pk_msg);
293: dsp_exinf(ref.exinf);
306: tk_get_cfn((UB*)"TMaxMbfId", &maxid, 1);
307: P("MBF STATE (MAX:%d):\n", maxid);
308:
311:
312: P(" ID WID SID MSGSZ FREE MAX EXINF\n");
313:
317: if (er != E_NOEXS)
318: P("ERR id = %3d [%#x]\n", id, er);
319: continue;
320: }
321: P("%3d %3d %3d %6d %6d %6d ", id, ref.wtsk, ref.stsk,
322: ref.msgsz, ref.frbufsz, ref.maxmsz);
336: tk_get_cfn((UB*)"TMaxPorId", &maxid, 1);
337: P("POR STATE (MAX:%d):\n", maxid);
338:
341:
342: P(" ID WID AID MAXCSZ MAXRSZ EXINF\n");
343:
347: if (er != E_NOEXS)
348: P("ERR id = %3d [%#x]\n", id, er);
349: continue;
350: }
351: P("%3d %3d %3d %6d %6d ", id, ref.wtsk, ref.atsk,
352: ref.maxcmsz, ref.maxrmsz);
366: tk_get_cfn((UB*)"TMaxMplId", &maxid, 1);
367: P("MPL STATE (MAX:%d):\n", maxid);
368:
371:
372: P(" ID WID FREE MAX EXINF\n");
373:
377: if (er != E_NOEXS)
378: P("ERR id = %3d [%#x]\n", id, er);
379: continue;
380: }
381: P("%3d %3d %6d %6d ", id, ref.wtsk, ref.frsz, ref.maxsz);
382: dsp_exinf(ref.exinf);
395: tk_get_cfn((UB*)"TMaxMpfId", &maxid, 1);
396: P("MPF STATE (MAX:%d):\n", maxid);
397:
400:
401: P(" ID WID FREE EXINF\n");
402:
406: if (er != E_NOEXS)
407: P("ERR id = %3d [%#x]\n", id, er);
408: continue;
409: }
410: P("%3d %3d %4d ", id, ref.wtsk, ref.frbcnt);
411: dsp_exinf(ref.exinf);
424: tk_get_cfn((UB*)"TMaxCycId", &maxid, 1);
425: P("CYC STATE (MAX:%d):\n", maxid);
426:
429:
430: P(" ID STS TIME EXINF\n");
431:
435: if (er != E_NOEXS)
436: P("ERR id = %3d [%#x]\n", id, er);
437: continue;
438: }
439: P("%3d %3s %6d ", id, ((ref.cycstat & TCYC_STA) != 0) ?
440: "STA" : "", ref.lfttim);
454: tk_get_cfn((UB*)"TMaxAlmId", &maxid, 1);
455: P("ALM STATE (MAX:%d):\n", maxid);
456:
459:
460: P(" ID STS TIME EXINF\n");
461:
465: if (er != E_NOEXS)
466: P("ERR id = %3d [%#x]\n", id, er);
467: continue;
468: }
469: P("%3d %3s %6d ", id, ((ref.almstat & TALM_STA) != 0) ?
470: "STA" : "", ref.lfttim);
484:
485: P("TASK REGISTER (TID:%d)\n", tskid);
486:
488: if (er < E_OK) {
489: P("ERR [%#x]\n", er);
490: return;
497:
498: P("SYSTEM STACK AREA: 0x%08x - 0x%08x\n",
499: (UW)rtsk.isstack - rtsk.sstksz, (UW)rtsk.isstack);
500: if (rtsk.stksz > 0) {
501: P(" USER STACK AREA: 0x%08x - 0x%08x\n",
502: (UW)rtsk.istack - rtsk.stksz, (UW)rtsk.istack);
503: } else {
504: P(" USER STACK AREA: %10s - 0x%08x\n",
505: "?", (UW)rtsk.istack);
546: usage:
547: P("ref item [num] dump kernel resources\n");
548: P(" item: mem,tsk,sem,flg,mbx,mbf,por,mtx,mpl,mpf,cyc,alm\n");
549: P("ref reg tskid dump task registers\n");
550: }