⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 sysdepend.c

📁 T-Kernel Shell Sample
💻 C
字号:
/*""FILE COMMENT""**************************************************************   System Name : RENESAS T-Engine / micro T-Engine*   File Name   : sysdepend.c*   Version     : 1.01.00*   Contents    : task monitor system depend routiones*   Model       : RENESAS T-Engine / micro T-Engine*   CPU         : SuperH / M32R *   Compiler    : GNU*   OS          : T-Kernel**   note        : The Software is being delivered to you "AS IS" *               : and Renesas,whether explicitly or implicitly makes  *               : no warranty as to its Use or performance. *               : RENESAS AND ITS SUPPLIER DO NOT AND CANNOT WARRANT *               : THE PERFORMANCE OR RESULTS YOU MAY OBTAIN  BY USING *               : THE SOFTWARE. AS TO ANY MATTER INCLUDING WITHOUT *               : LIMITATION NONINFRINGEMENT OF THIRD PARTY RIGHTS,*               : MERCHANTABILITY, INTEGRATION, SATISFACTORY QUALITY, *               : OR FITNESS FOR ANY PARTICULAR PURPOSE.**   Copyright (c) 2004-2006 RENESAS TECHNOLOGY CORP. All Rights Reserved.*   AND RENESAS SOLUTIONS CORP. All Rights Reserved.**   history     : 2004.12.21 ver1.00.00*               : 2005.12.01 ver1.01.00*""FILE COMMENT END""*********************************************************/#ifdef _MIC_SH7145_#include "shell.h"#include "shelldisp.h"#include <sys/consio.h>#include "breakcmd.h"const char *openingSystem = "Renesas SH7145 micro T-Engine Task Monitor \n";extern W errcode;#ifdef NOUSE_STDIO/*""FUNC COMMENT""******************************************************* * ID          : X.Y.Z * Outline     : Display the contents of gr, er, and cr *----------------------------------------------------------------------- * Include     : tk/tkernel.h  *----------------------------------------------------------------------- * Definition  : W PrintTaskRegisterNOSTDIO(T_REGS *gr, T_EIT *er, T_CREGS *cr ) *----------------------------------------------------------------------- * Function    : Display the contents of gr, er, and cr. *----------------------------------------------------------------------- * Argument    : T_REGS *gr; *             : T_EIT *er; *             : T_CREGS *cr; *-----------------------------------------------------------------------  * Return      : 6 (row) *----------------------------------------------------------------------- * Input       : None  * Output      : None  *----------------------------------------------------------------------- * Used Func   : convertstring() *             : _PutString()  *----------------------------------------------------------------------- * Notice      : None *""FUNC COMMENT END""***************************************************/EXPORT W PrintTaskRegisterNOSTDIO(T_REGS *gr, T_EIT *er, T_CREGS *cr ){/* *	PC: 12345678 SR: 12345678  *	R0: 12345678 R1: 12345678 R2: 12345678 R3: 12345678 *	R4: 12345678 R5: 12345678 R6: 12345678 R7: 12345678 *	R8: 12345678 R9: 12345678 R10:12345678 R11:12345678 *	R12:12345678 R13:12345678 R14:12345678 *	MAC:12345678 12345678     GBR:12345678 PR: 12345678 */	printargs[0] = (VP)er->pc;	printargs[1] = (VP)er->sr;	convertstring(strstrstr,"PC: %08x SR: %08x \n",printargs);	DSP;	printargs[0] = (VP)gr->r[0];	printargs[1] = (VP)gr->r[1];	printargs[2] = (VP)gr->r[2];	printargs[3] = (VP)gr->r[3];	convertstring(strstrstr,"R0: %08x R1: %08x R2: %08x R3: %08x\n",printargs);	DSP;	printargs[0] = (VP)gr->r[4];	printargs[1] = (VP)gr->r[5];	printargs[2] = (VP)gr->r[6];	printargs[3] = (VP)gr->r[7];	convertstring(strstrstr,"R4: %08x R5: %08x R6: %08x R7: %08x\n",printargs);	DSP;	printargs[0] = (VP)gr->r[8];	printargs[1] = (VP)gr->r[9];	printargs[2] = (VP)gr->r[10];	printargs[3] = (VP)gr->r[11];	convertstring(strstrstr,"R8: %08x R9: %08x R10:%08x R11:%08x\n",printargs);	DSP;	printargs[0] = (VP)gr->r[12];	printargs[1] = (VP)gr->r[13];	printargs[2] = (VP)gr->r[14];	convertstring(strstrstr,"R12:%08x R13:%08x R14:%08x\n",printargs);	DSP;	printargs[0] = (VP)gr->mach;	printargs[1] = (VP)gr->macl;	printargs[2] = (VP)gr->gbr;	printargs[3] = (VP)gr->pr;	convertstring(strstrstr,"MAC:%08x %08x     GBR:%08x PR: %08x\n",printargs);	DSP;	return 6;  /* Number of display rows */}#endif // NOUSE_STDIO#define REGNUM	21char *RegName[] = {	"MACH","MACL","PR","GBR",	"R14","R13","R12","R11","R10","R9","R8","R7","R6","R5","R4",	"R1","R0","R2","R3",	"PC","SR"};extern char *cmdargs[];/*""FUNC COMMENT""******************************************************* * ID          : X.Y.Z * Outline     : set value to registers *----------------------------------------------------------------------- * Include     :  *----------------------------------------------------------------------- * Definition  : void setBreakRegisters(RegTable *regs) *----------------------------------------------------------------------- * Function    : set value to registers *----------------------------------------------------------------------- * Argument    : RegTable *regs;  *-----------------------------------------------------------------------  * Return      : None *----------------------------------------------------------------------- * Input       : char *cmdargs[]; input command * Output      : None  *----------------------------------------------------------------------- * Used Func   : strcmp() *             : get_ulnum() *----------------------------------------------------------------------- * Notice      : set data is available after continue program *             : (exit breakmode ) *""FUNC COMMENT END""***************************************************/void setBreakRegisters(RegTable *regs){	int i,idx,err;	unsigned long val;	idx = -1;	for(i=0;i<REGNUM;i++){		if ( strcmp(RegName[i], cmdargs[1]) == 0 ) {			idx= i;break;		}	}	if(idx == -1 ) goto illegalpar_error;	val = get_ulnum(cmdargs[2],&err);	if(err) goto illegalpar_error;	switch(idx){		case 0: regs->mach = val; break; /* MACH */		case 1: regs->macl = val; break; /* MACL */		case 2: regs->pr = val; break;   /* PR */		case 3: regs->gbr = val; break;  /* GBR */		case 19: regs->pc = val; break;  /* PC */		case 20: break; /* SR */		default: /* R0-R14 */			regs->r[idx-4] = val; break;	}	return;illegalpar_error:	errcode = ER_ILLEGALPAR;	return;		}/*""FUNC COMMENT""******************************************************* * ID          : X.Y.Z * Outline     : print registers value *----------------------------------------------------------------------- * Include     :  *----------------------------------------------------------------------- * Definition  : void printBreakRegisters(RegTable *regs) *----------------------------------------------------------------------- * Function    : print registers value *----------------------------------------------------------------------- * Argument    : RegTable *regs;  *-----------------------------------------------------------------------  * Return      : None *----------------------------------------------------------------------- * Input       : None * Output      : None  *----------------------------------------------------------------------- * Used Func   : convertstring() *             : _PutString() *----------------------------------------------------------------------- * Notice      : None *""FUNC COMMENT END""***************************************************/void printBreakRegisters(RegTable *regs){	printargs[0] = (VP)regs->pc;	printargs[1] = (VP)regs->sr;	convertstring(strstrstr,"PC: %08x SR: %08x \n",printargs);	DSP;	printargs[0] = (VP)regs->r[12];	printargs[1] = (VP)regs->r[11];	printargs[2] = (VP)regs->r[13];	printargs[3] = (VP)regs->r[14];	convertstring(strstrstr,"R0: %08x R1: %08x R2: %08x R3: %08x\n",printargs);	DSP;	printargs[0] = (VP)regs->r[10];	printargs[1] = (VP)regs->r[9];	printargs[2] = (VP)regs->r[8];	printargs[3] = (VP)regs->r[7];	convertstring(strstrstr,"R4: %08x R5: %08x R6: %08x R7: %08x\n",printargs);	DSP;	printargs[0] = (VP)regs->r[6];	printargs[1] = (VP)regs->r[5];	printargs[2] = (VP)regs->r[4];	printargs[3] = (VP)regs->r[3];	convertstring(strstrstr,"R8: %08x R9: %08x R10:%08x R11:%08x\n",printargs);	DSP;	printargs[0] = (VP)regs->r[2];	printargs[1] = (VP)regs->r[1];	printargs[2] = (VP)regs->r[0];	convertstring(strstrstr,"R12:%08x R13:%08x R14:%08x\n",printargs);	DSP;	printargs[0] = (VP)regs->mach;	printargs[1] = (VP)regs->macl;	printargs[2] = (VP)regs->gbr;	printargs[3] = (VP)regs->pr;	convertstring(strstrstr,"MAC:%08x %08x     GBR:%08x PR: %08x\n",printargs);	DSP;}const char systeminfomsg[] =  {	"T-Kernel           : 1.02.01(open-source/build:060201)\n"	"CPU                : SH7145F 50MHz\n"	"FlashMemory(Inner) : 0000 0000 - 0003 FFFF : 256KB\n"	"                   : 0000 0000 - 0000 037F : Vector table\n"	"                   : 0000 0380 - 0000 0BFF : T-Monitor Area\n"	"                   : 0000 0C00 - 0000 0FFF : ROMINFO/ System Info \n"	"                   : 0000 1000 - 0002 7FFF : T-Kernel Area\n"	"FlashMemory(Outer) : 0020 0000 - 002F FFFF : 1MB\n"	"SRAM(Outer)        : 0030 0000 - 003F FFFF : 1MB\n"	"                   : 0030 0000 - 0037 FFFF : System Area\n"	"SRAM(Inner)        : FFFF E000 - FFFF FFFF : 8KB\n"	"                   : FFFF E000 - FFFF E1FF : SystemCommonInfo Area\n"};#endif // _MIC_SH7145_

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -