Author: mcayland Date: Sat Mar 8 01:59:59 2014 New Revision: 1273 URL: http://tracker.coreboot.org/trac/openbios/changeset/1273
Log: client.c: fix up return value from CIF call-method/interpret
The handle_calls() function was accidentally using the client-call-iface return value instead of the catch wrapping the underlying call.
Return the correct catch result, and while we're at it add some extra logging to indicate when we've detected an error condition.
Signed-off-by: Mark Cave-Ayland mark.cave-ayland@ilande.co.uk
Modified: trunk/openbios-devel/libopenbios/client.c
Modified: trunk/openbios-devel/libopenbios/client.c ============================================================================== --- trunk/openbios-devel/libopenbios/client.c Wed Mar 5 01:04:32 2014 (r1272) +++ trunk/openbios-devel/libopenbios/client.c Sat Mar 8 01:59:59 2014 (r1273) @@ -261,15 +261,22 @@ push_str(get_service(pb)); fword("client-call-iface");
+ /* Ignore client-call-iface return */ + POP(); + /* If the catch result is non-zero, restore stack and exit */ val = POP(); if (val) { + printk("%s %s failed with error " FMT_ucellx "\n", get_service(pb), arg2pointer(pb->args[0]), val); dstackcnt = dstacksave; return 0; }
+ /* Store catch result */ + pb->args[pb->nargs] = val; + j = dstackcnt; - for (i = 0; i < pb->nret; i++, j--) { + for (i = 1; i < pb->nret; i++, j--) { if (dstackcnt > dstacksave) { pb->args[pb->nargs + i] = POP(); }