Fix two errors related to argument passing in the client interface:

i) client-call-iface did not set a return value of 0 on success; hence the top stack argument was dropped as part of the status 
check causing an off-by-one error.

ii) instead of setting pb->nret to be the number of arguments returned, the (random) value being passed in was being used to 
control the number of arguments being returned.


Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@siriusit.co.uk>



git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@732 f158a5a8-5612-0410-a976-696ce0be7e32
This commit is contained in:
Mark Cave-Ayland
2010-04-03 08:25:47 +00:00
committed by Mark Cave-Ayland
parent db3348538a
commit 3111a2293b
2 changed files with 4 additions and 3 deletions

View File

@@ -341,4 +341,5 @@ device-end
: client-call-iface ( [args] name len -- [args] -1 | [rets] 0 ) : client-call-iface ( [args] name len -- [args] -1 | [rets] 0 )
ciface-ph find-method 0= if -1 exit then ciface-ph find-method 0= if -1 exit then
execute execute
0
; ;

View File

@@ -302,11 +302,11 @@ of_client_interface( int *params )
return -1; return -1;
} }
for( i=0; i<pb->nret && dstackcnt > dstacksave ; i++ ) for( pb->nret=0; dstackcnt > dstacksave ; pb->nret++ )
pb->args[pb->nargs + i] = POP(); pb->args[pb->nargs + pb->nret] = POP();
#ifdef DEBUG_CIF #ifdef DEBUG_CIF
if( i != pb->nret || dstackcnt != dstacksave ) { if( dstackcnt != dstacksave ) {
printk("service %s: argument count error (%d %d)\n", printk("service %s: argument count error (%d %d)\n",
pb->service, i, dstackcnt - dstacksave ); pb->service, i, dstackcnt - dstacksave );
dstackcnt = dstacksave; dstackcnt = dstacksave;