Skip to contentSkip to conversation

raw go command

RFC In review Kumar Gala 4 participants 24 messages Feb 13, 2008 – Feb 16, 2008

lore
Share & tools
lore

Kumar Gala

author
#0 lore raw

RFC 1/1 raw go command

This patch is just a quick work up to see how to handle a particular problem I've got. The idea is that I want finer control over what happens when I 'go' to piece of code. The idea is it looks more like a native function call than the current go which is more main() like.

The calling convention/num of args is specific to the PPC ABI.

I'm looking for suggestions, better names, etc.

thanks

- k

common/cmd_boot.c +36 -0
index e68f16f..5b0bbe4 100644
@@ -32,6 +32,42 @@
 DECLARE_GLOBAL_DATA_PTR;
 #endif
 
+int do_go_raw (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+{
+	ulong	addr, i;
+	ulong	r[8] = { 0 };
+
+	void	(*img)(ulong, ulong, ulong, ulong,
+		       ulong, ulong, ulong, ulong);
+
+	if ((argc < 2) || (argc > 9)) {
+		printf ("Usage:\n%s\n", cmdtp->usage);
+		return 1;
+	}
+
+	addr = simple_strtoul(argv[1], NULL, 16);
+
+	img = (void (*)(ulong, ulong, ulong, ulong,
+			ulong, ulong, ulong, ulong)) addr;
+
+	for (i = 2; i < argc; i++)
+		r[i-2] = simple_strtoul(argv[i], NULL, 16);
+
+	(*img)(r[0], r[1], r[2], r[3], r[4], r[5], r[6], r[7]);
+	/* does not return */
+
+	return 0;
+}
+
+/* -------------------------------------------------------------------- */
+
+U_BOOT_CMD(
+	go_raw, CFG_MAXARGS, 1,	do_go_raw,
+	"go_raw  - start application at address 'addr'\n",
+	"addr [arg ...]\n    - start application@address 'addr'\n"
+	"      passing 'arg' as arguments\n"
+);
+
 int do_go (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 {
 	ulong	addr, rc;
#1 lore raw
Quoted 4 lines · In message <[email protected]> you wrote:

This patch is just a quick work up to see how to handle a particular problem I've got. The idea is that I want finer control over what happens when I 'go' to piece of code. The idea is it looks more like a native function call than the current go which is more main() like.

To me it looks different, but not more native.

Best regards,

Wolfgang Denk

Signature · 6 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
You see things; and you say ``Why?'' But I dream  things  that  never
were; and I say ``Why not?''
       - George Bernard Shaw _Back to Methuselah_ (1921) pt. 1, act 1
author
#2 lore raw
Quoted 10 lines · Wolfgang Denk

In message <Pine.LNX.

Quoted 6 lines · 4.64.0802131746070.29374 at blarg.am.freescale.net> you wrote:

This patch is just a quick work up to see how to handle a particular problem I've got. The idea is that I want finer control over what happens
when I 'go' to piece of code. The idea is it looks more like a native
function call than the current go which is more main() like.

To me it looks different, but not more native.

Maybe my descriptions not the best, but its intended to provide a mechanism similar to how we boot a kernel that the user can specify the values in the registers.

- k

#3 lore raw
In reply to Kumar Gala

common/cmd_boot.c

Quoted 6 lines · On Wed, 13 Feb 2008 17:50:20 -0600 (CST) Kumar Gala…

The calling convention/num of args is specific to the PPC ABI.

common/cmd_boot.c +0 -0
index e68f16f..5b0bbe4 100644

So what's it doing under common/ with a generic-sounding name?

Haavard

author
#4 lore raw
Quoted 11 lines · Haavard Skinnemoen

common/cmd_boot.c

Quoted 6 lines · On Wed, 13 Feb 2008 17:50:20 -0600 (CST) Kumar Gala…

The calling convention/num of args is specific to the PPC ABI.

common/cmd_boot.c +0 -0
index e68f16f..5b0bbe4 100644

So what's it doing under common/ with a generic-sounding name?

there is no reason it couldn't be implemented by other arch's but I get your point. Any suggestions on a better name?

I hadn't thought about putting this in lib_ppc, thus the RFC on the email :)

- k

author
#5 lore raw

PATCH 1/1 Add call command on PPC

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 is attempt to at the concept I was trying to get a w/the raw go thread.

 lib_ppc/Makefile   |    4 ++-
 lib_ppc/cmd_call.c |   64 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 67 insertions(+), 1 deletions(-)
 create mode 100644 lib_ppc/cmd_call.c
lib_ppc/Makefile +3 -1
index afbd5ca..a776052 100644
@@ -25,9 +25,11 @@ include $(TOPDIR)/config.mk
 
 LIB	= $(obj)lib$(ARCH).a
 
+COBJS-$(CONFIG_CMD_CALL) += cmd_call.o
+
 SOBJS	= ppccache.o ppcstring.o ticks.o
 
-COBJS	= board.o \
+COBJS	= board.o $(COBJS-y) \
 	  bat_rw.o cache.o extable.o kgdb.o time.o interrupts.o
 
 SRCS 	:= $(SOBJS:.o=.S) $(COBJS:.o=.c)
lib_ppc/cmd_call.c new file +64 -0

64 lines not on this page · raw message

Signature · 1 line
1.5.3.8
#6 lore raw

PATCH 1/1 Add call command on PPC

lib_ppc/cmd_call.c

Quoted 2 lines · Kumar Gala
lib_ppc/cmd_call.c new file +0 -0

there's nothing ppc specific about this

lib_ppc/cmd_call.c line 60

Quoted 4 lines
lib_ppc/cmd_call.c new file +3 -0
+	if ((argc < 2) || (argc > 10)) {
...
+U_BOOT_CMD(
+	call, CFG_MAXARGS, 1,	do_call,

considering the u-boot infrastructure for commands will do the max checking for you, there's no need to check the upper bound of argc. it's also out of
sync: in one place you have a random "10" but in another you have "CFG_MAXARGS".

lib_ppc/cmd_call.c line 54

Quoted 5 lines
lib_ppc/cmd_call.c new file +5 -0
+	(*img)(r[0], r[1], r[2], r[3], r[4], r[5], r[6], r[7]);
+
+	/* may not return */
+
+	return 0;

why not ? you might as well not arbitrarily limit things and have the prototype return an int and have it return that instead of "0":

	return (*img)(r[0], r[1], r[2], r[3], r[4], r[5], r[6], r[7]);

-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 827 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20080215/6ceb1be8/attachment.pgp

author
#7 lore raw

PATCH 1/1 Add call command on PPC

Quoted 5 lines · Mike Frysinger

lib_ppc/cmd_call.c

Quoted 2 lines · Kumar Gala
lib_ppc/cmd_call.c new file +0 -0

there's nothing ppc specific about this

I'm not familiar w/other architecture ABIs to say if that's true or not. Clearly the upper limit may vary based on the differences in the ABIs.

Quoted 11 lines

lib_ppc/cmd_call.c line 60

Quoted 4 lines
lib_ppc/cmd_call.c new file +3 -0
+	if ((argc < 2) || (argc > 10)) {
...
+U_BOOT_CMD(
+	call, CFG_MAXARGS, 1,	do_call,

considering the u-boot infrastructure for commands will do the max checking
for you, there's no need to check the upper bound of argc. it's also out of
sync: in one place you have a random "10" but in another you have "CFG_MAXARGS".

agreed. At first I was going for something more generic.

Quoted 9 lines

lib_ppc/cmd_call.c line 54

Quoted 5 lines
lib_ppc/cmd_call.c new file +5 -0
+	(*img)(r[0], r[1], r[2], r[3], r[4], r[5], r[6], r[7]);
+
+	/* may not return */
+
+	return 0;

why not ? you might as well not arbitrarily limit things and have the prototype return an int and have it return that instead of "0":

	return (*img)(r[0], r[1], r[2], r[3], r[4], r[5], r[6], r[7]);

will do.

- k

author
#8 lore raw

PATCH v2 1/1 Add call command on PPC

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.

---

Incorporate Mike's feedback on using u-boot max arg checking and allow the function to return.

 lib_ppc/Makefile   |    4 ++-
 lib_ppc/cmd_call.c |   60 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 63 insertions(+), 1 deletions(-)
 create mode 100644 lib_ppc/cmd_call.c
lib_ppc/Makefile +3 -1
index afbd5ca..a776052 100644
@@ -25,9 +25,11 @@ include $(TOPDIR)/config.mk
 
 LIB	= $(obj)lib$(ARCH).a
 
+COBJS-$(CONFIG_CMD_CALL) += cmd_call.o
+
 SOBJS	= ppccache.o ppcstring.o ticks.o
 
-COBJS	= board.o \
+COBJS	= board.o $(COBJS-y) \
 	  bat_rw.o cache.o extable.o kgdb.o time.o interrupts.o
 
 SRCS 	:= $(SOBJS:.o=.S) $(COBJS:.o=.c)
lib_ppc/cmd_call.c new file +60 -0

60 lines not on this page · raw message

Signature · 1 line
1.5.3.8
#9 lore raw

PATCH v2 1/1 Add call command on PPC

Quoted 6 lines · In message <[email protected]> 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:

Quoted 8 lines

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.

lib_ppc/cmd_call.c line 50

Quoted 7 lines
lib_ppc/cmd_call.c new file +7 -0
+	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

Signature · 6 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
"More software projects have gone awry for lack of calendar time than
for all other causes combined."
                         - Fred Brooks, Jr., _The Mythical Man Month_
#10 lore raw

PATCH v2 1/1 Add call command on PPC

Quoted 3 lines · Wolfgang Denk

lib_ppc/cmd_call.c line 50

Quoted 1 line
lib_ppc/cmd_call.c new file +1 -0
+	return (*img)(r[0], r[1], r[2], r[3], r[4], r[5], r[6], r[7]);

I see no difference between this call and what "go" does.

well there's an obvious difference. go passes argc/argv[] as parameters where as this passes everything as parameters. as for whether you think it's needed at all, that's a different matter ;)
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 827 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20080216/4011dc80/attachment.pgp

#11 lore raw

PATCH 1/1 Add call command on PPC

In reply to Kumar Gala
Quoted 10 lines · Kumar Gala
Quoted 5 lines · Mike Frysinger

lib_ppc/cmd_call.c

Quoted 2 lines · Kumar Gala
lib_ppc/cmd_call.c new file +0 -0

there's nothing ppc specific about this

I'm not familiar w/other architecture ABIs to say if that's true or not. Clearly the upper limit may vary based on the differences in the ABIs.

if the code were written in assembly, i'd agree. you've written it in pure C though, so the compiler worries about the ABI. if your ABI has different semantics for function pointers than normal function calls, it's a piece of crap. i dont think any ports of u-boot need worry about this.
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 827 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20080215/eea233b2/attachment.pgp

author
#12 lore raw

PATCH 1/1 Add call command on PPC

Quoted 13 lines · Mike Frysinger
Quoted 11 lines · Kumar Gala
Quoted 5 lines · Mike Frysinger

lib_ppc/cmd_call.c

Quoted 2 lines · Kumar Gala
lib_ppc/cmd_call.c new file +0 -0

there's nothing ppc specific about this

I'm not familiar w/other architecture ABIs to say if that's true or not. Clearly the upper limit may vary based on the differences in the
ABIs.

Quoted 7 lines

if the code were written in assembly, i'd agree. you've written it in pure C
though, so the compiler worries about the ABI. if your ABI has different
semantics for function pointers than normal function calls, it's a piece of
crap. i dont think any ports of u-boot need worry about this.

agreed there.

The main reason for me doing this was to provide a "generic" mechanism that mimic how we boot kernels on PPC.

The other issue w/providing this on all arch's is that the number of params passed via regs may vary and I don't know what is for arm, avr32, blackfin, i386, m68k, microblaze, mips, nios, nios2, and sh.

and each variation will require a different prototype.

if someone can tell me what the number of args are for each arch we can see about providing this everywhere.

- k

#13 lore raw

PATCH 1/1 Add call command on PPC

Quoted 27 lines · Kumar Gala
Quoted 13 lines · Mike Frysinger
Quoted 11 lines · Kumar Gala
Quoted 5 lines · Mike Frysinger

lib_ppc/cmd_call.c

Quoted 2 lines · Kumar Gala
lib_ppc/cmd_call.c new file +0 -0

there's nothing ppc specific about this

I'm not familiar w/other architecture ABIs to say if that's true or not. Clearly the upper limit may vary based on the differences in the
ABIs.

Quoted 7 lines

if the code were written in assembly, i'd agree. you've written it in pure C
though, so the compiler worries about the ABI. if your ABI has different
semantics for function pointers than normal function calls, it's a piece of
crap. i dont think any ports of u-boot need worry about this.

agreed there.

The main reason for me doing this was to provide a "generic" mechanism that mimic how we boot kernels on PPC.

Quoted 8 lines

The other issue w/providing this on all arch's is that the number of params passed via regs may vary and I don't know what is for arm, avr32, blackfin, i386, m68k, microblaze, mips, nios, nios2, and sh.

and each variation will require a different prototype.

if someone can tell me what the number of args are for each arch we can see about providing this everywhere.

are you sure you actually need to worry about such things ? i'm pretty sure any relevant architecture says that the first X arguments go via registers and the rest go on the stack. let the compiler worry about the exact value for X.
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 827 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20080215/05dde53e/attachment.pgp

#14 lore raw

PATCH 1/1 Add call command on PPC

Quoted 7 lines · On Fri, 15 Feb 2008 02:08:23 -0500 Mike Frysinger <[email protected]> wrote:
Quoted 2 lines

if someone can tell me what the number of args are for each arch we can see about providing this everywhere.

are you sure you actually need to worry about such things ? i'm pretty sure any relevant architecture says that the first X arguments go via registers and the rest go on the stack. let the compiler worry about the exact value for X.

I guess the real question is whether it's acceptable to pass arguments on the stack to such subprograms. If the answer is yes, why not simply use varargs?

If the answer is no: avr32 can pass up to 5 arguments through registers.

Haavard

#15 lore raw

PATCH 1/1 Add call command on PPC

Quoted 4 lines · Haavard Skinnemoen
Quoted 3 lines · Mike Frysinger
Quoted 2 lines

if someone can tell me what the number of args are for each arch we can see about providing this everywhere.

Quoted 8 lines
Quoted 4 lines

are you sure you actually need to worry about such things ? i'm pretty sure any relevant architecture says that the first X arguments go via registers and the rest go on the stack. let the compiler worry about the exact value for X.

I guess the real question is whether it's acceptable to pass arguments on the stack to such subprograms. If the answer is yes, why not simply use varargs?

if the goal is to keep things in registers, "call" and its description are way too vague. the description makes me think this is meant to be a "go" for functions.

Quoted 1 line

If the answer is no: avr32 can pass up to 5 arguments through registers.

x86 does 0 while Blackfin does 3.
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 827 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20080215/90d02255/attachment.pgp

author
#16 lore raw

PATCH 1/1 Add call command on PPC

Quoted 19 lines · Mike Frysinger
Quoted 12 lines · Haavard Skinnemoen
Quoted 10 lines · Mike Frysinger
Quoted 2 lines

if someone can tell me what the number of args are for each arch we can see about providing this everywhere.

are you sure you actually need to worry about such things ? i'm pretty
sure any relevant architecture says that the first X arguments go via
registers and the rest go on the stack. let the compiler worry about the
exact value for X.

Quoted 5 lines

I guess the real question is whether it's acceptable to pass arguments
on the stack to such subprograms. If the answer is yes, why not simply
use varargs?

Quoted 5 lines

if the goal is to keep things in registers, "call" and its description are way
too vague. the description makes me think this is meant to be a "go" for
functions.

As per Wolfgang's desires the help is terse, the commit message was suppose to convey more details. But I can see where the confusion comes from. I'm open to better wording and will try to think of some myself.

Quoted 4 lines
Quoted 2 lines

If the answer is no: avr32 can pass up to 5 arguments through registers.

x86 does 0 while Blackfin does 3.

3 arch's down, 6 to go.

- k

#17 lore raw

PATCH 1/1 Add call command on PPC

In reply to Mike Frysinger
Quoted 1 line · On Fri, 15 Feb 2008 02:29:39 -0500 Mike Frysinger <[email protected]> wrote:

x86 does 0 while Blackfin does 3.

x86 can do more (at least 3) if you use the regparm attribute. But you obviously need to keep both sides in sync.

Haavard

#18 lore raw

PATCH 1/1 Add call command on PPC

Quoted 5 lines · Haavard Skinnemoen
Quoted 1 line · Mike Frysinger

x86 does 0 while Blackfin does 3.

x86 can do more (at least 3) if you use the regparm attribute. But you obviously need to keep both sides in sync.

i'm aware of all the neat tricks you can do with gcc, but we were talking about the ABI standard (which the gcc tricks violate)
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 827 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20080215/1ee98017/attachment.pgp

author
#19 lore raw

PATCH 1/1 Add call command on PPC

In reply to Haavard Skinnemoen
Quoted 14 lines · Haavard Skinnemoen
Quoted 10 lines · On Fri, 15 Feb 2008 02:08:23 -0500 Mike Frysinger <[email protected]> wrote:
Quoted 2 lines

if someone can tell me what the number of args are for each arch we can see about providing this everywhere.

are you sure you actually need to worry about such things ? i'm pretty sure
any relevant architecture says that the first X arguments go via registers
and the rest go on the stack. let the compiler worry about the exact value
for X.

Quoted 3 lines

I guess the real question is whether it's acceptable to pass arguments on the stack to such subprograms. If the answer is yes, why not simply use varargs?

for my purposes the answer is no.

Quoted 3 lines

If the answer is no: avr32 can pass up to 5 arguments through registers.

thanks

- k

#20 lore raw

PATCH 1/1 Add call command on PPC

Quoted 6 lines · In message <[email protected]> you wrote:
Quoted 4 lines

I guess the real question is whether it's acceptable to pass arguments on the stack to such subprograms. If the answer is yes, why not simply use varargs?

for my purposes the answer is no.

Then you cannot use C code. Or you rely on the ABI, and then you can use "go" as well.

Best regards,

Wolfgang Denk

Signature · 5 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Generally speaking, there are other ways to accomplish whatever it is
that you think you need ...                               - Doug Gwyn
#21 lore raw

PATCH 1/1 Add call command on PPC

In reply to Kumar Gala
Quoted 3 lines · In message <[email protected]> you wrote:

The main reason for me doing this was to provide a "generic" mechanism that mimic how we boot kernels on PPC.

May I ask why exactly this is needed at all? Kernels should be booted using the bootm command - if somethingis missing there, it should be added / fixed in this contexzt instead of adding another highly specialized command.

And *if* we add this, then please let's make it general enough so we can use it on all architectures without adding a lot of #ifdef mess.

Quoted 4 lines

The other issue w/providing this on all arch's is that the number of params passed via regs may vary and I don't know what is for arm, avr32, blackfin, i386, m68k, microblaze, mips, nios, nios2, and sh. and each variation will require a different prototype.

No, just change the design, then. Make it a varargs function and pass the number of registers as one argument.

Best regards,

Wolfgang Denk

Signature · 6 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Death. Destruction. Disease. Horror. That's what war  is  all  about.
That's what makes it a thing to be avoided.
	-- Kirk, "A Taste of Armageddon", stardate 3193.0
#22 lore raw

PATCH 1/1 Add call command on PPC

In reply to Kumar Gala
Quoted 2 lines · Kumar Gala

The main reason for me doing this was to provide a "generic" mechanism that mimic how we boot kernels on PPC.

is that the only reason ? what format is the kernel that you're attempting to boot ? assuming it's an ELF ...

at the moment, the Blackfin code base maintained on blackfin.uclinux.org has hacked the "bootelf" command to assume it is always booting a kernel. this way we can load/boot the ELF image of our kernels in memory and have the $(bootargs) and such actually get passed properly (dont yell at me for this, the change was before my time, and i agree it's crap :p).

in other words, a common function for booting a linux ELF kernel image would be great. especially considering the fact we have a "bootvx" that takes an ELF image, sets up the bootargs, and then boots it properly. seems messed up that booting vxworks sees better support than booting linux ;)
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 827 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20080216/9472ea25/attachment.pgp

#23 lore raw

PATCH 1/1 Add call command on PPC

In reply to Kumar Gala
Quoted 6 lines · In message <[email protected]> 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:

Quoted 8 lines

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.

Sorry, but this looks still broken to me.

Best regards,

Wolfgang Denk

Signature · 5 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
A Puritan is someone who is deathly afraid that  someone,  somewhere,
is having fun.