TI中文支持网
TI专业的中文技术问题搜集分享网站

TMS320F28379D args_main

int _args_main()
{
register int argc = 0;
register char **argv = 0;

#if USE_WEAK_REF
if (&__c_args__ != NULL)
{
argc = __c_args__.argc;
argv = __c_args__.argv;
}
#else
#pragma diag_suppress 1107,173
register ARGS *pargs = (ARGS*)_symval(&__c_args__);
#pragma diag_default 1107,173

if (_symval(&__c_args__) != NO_C_ARGS) {
argc = pargs->argc;
argv = pargs->argv;
}
#endif

return main(argc, argv);
}

这个函数干什么用的?

_args_main() at args main.c:131 0x085193 (an error occurred:Attempted to read past the end of memory at 0xFFFFFFFFFFFFFF4@DATA )

DEBUG窗口出现这个错误

Susan Yang:

这个函数一般是在 boot 时使用的,之后会return main(argc, argv);从而跳到main函数来开始执行程序

/******************************************************************************/
/* The ARGS data structure is defined according to a convention with linker.*/
/**/
/* If the user want to pass arguments to loader, "--args=###" option has to*/
/* be used in linking to generate executable. With this option, the linker*/
/* will allocate a section starting with __c_args__, and with this "###" many */
/* bytes. The loader when parses the arguments, will dump the number of*/
/* arguments, argc as the 1st arguments at address __c_args__, all the actual */
/* arguments will be dumped after that. The total space for these arguments*/
/* will not exceed "###" bytes.*/
/**/
/* if "--args="###" is not used as a linker option, linker will put -1 at*/
/* __c_args__ location.*//**/
/* Based on the above convention, the following code implements the access to */
/* these arguments when main is called.*/
/**/
/* This function is called from boot.asm or boot.c.*/
/******************************************************************************/

赞(0)
未经允许不得转载:TI中文支持网 » TMS320F28379D args_main
分享到: 更多 (0)