From 503af721a1f2c831fb360d1c1b2af38e0866fc35 Mon Sep 17 00:00:00 2001 From: Patrick Georgi Date: Thu, 22 Nov 2012 10:48:18 +0100 Subject: x86 realmode: Adapt to x86emu/YABEL style return codes realmode int handlers must return the same codes as the YABEL int handlers now: 1 for "interrupt handled", 0 for "not handled" (ie. error). Change-Id: Idc01cf64e2c97150fc4643671a0bc4cca2ae6668 Signed-off-by: Patrick Georgi Reviewed-on: http://review.coreboot.org/1890 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer --- src/devices/oprom/realmode/x86.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/devices/oprom/realmode/x86.c') diff --git a/src/devices/oprom/realmode/x86.c b/src/devices/oprom/realmode/x86.c index 32d24ec1c3..2e016176f9 100644 --- a/src/devices/oprom/realmode/x86.c +++ b/src/devices/oprom/realmode/x86.c @@ -402,7 +402,7 @@ int __attribute__((regparm(0))) interrupt_handler(u32 intnumber, u32 ip; u32 cs; u32 flags; - int ret = -1; + int ret = 0; struct eregs reg_info; ip = cs_ip & 0xffff; @@ -455,15 +455,17 @@ int __attribute__((regparm(0))) interrupt_handler(u32 intnumber, *(volatile u32 *)&edi = reg_info.edi; flags = reg_info.eflags; - /* Pass errors back to our caller via the CARRY flag */ + /* Pass success or error back to our caller via the CARRY flag */ if (ret) { + flags &= ~1; // no error: clear carry + }else{ printk(BIOS_DEBUG,"int%02x call returned error.\n", intnumber); flags |= 1; // error: set carry - }else{ - flags &= ~1; // no error: clear carry } *(volatile u16 *)&stackflags = flags; + /* The assembler code doesn't actually care for the return value, + * but keep it around so its expectations are met */ return ret; } -- cgit v1.2.3