
In message Pine.LNX.4.64.0802150001460.1512@blarg.am.freescale.net you wrote:
The call command tries to mimic a function call in that the 'arg's to the command are passed in registers according to the PPC ABI.
The prototype that call mimics is some variation of the following depending on how many arguments are passed to the command:
void func(void) void func(unsigned long r3) void func(unsigned long r3, unsigned long r4) ... void func(unsigned long r3, unsigned long r4, ... unsigned long r10)
The maximum number of 'arg's is 8. There are no arguments passed on a stack, no floating point or vector arguments.
This really makes zero sense to me.
- img = (int (*)(ulong, ulong, ulong, ulong,
ulong, ulong, ulong, ulong)) addr;
- for (i = 2; i < argc; i++)
r[i-2] = simple_strtoul(argv[i], NULL, 16);
- return (*img)(r[0], r[1], r[2], r[3], r[4], r[5], r[6], r[7]);
This looks not clean. Either this is a function with exactly 8 arguments, or it isn't. And where is the code that makes sure that ``the 'arg's to the command are passed in registers'' ? I see no difference between this call and what "go" does.
Best regards,
Wolfgang Denk