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 <patrick.georgi@secunet.com>
Reviewed-on: http://review.coreboot.org/1890
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
diff --git a/src/devices/oprom/realmode/x86.c b/src/devices/oprom/realmode/x86.c
index 32d24ec..2e01617 100644
--- a/src/devices/oprom/realmode/x86.c
+++ b/src/devices/oprom/realmode/x86.c
@@ -402,7 +402,7 @@
 	u32 ip;
 	u32 cs;
 	u32 flags;
-	int ret = -1;
+	int ret = 0;
 	struct eregs reg_info;
 
 	ip = cs_ip & 0xffff;
@@ -455,15 +455,17 @@
 	*(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;
 }
 
diff --git a/src/devices/oprom/realmode/x86_interrupts.c b/src/devices/oprom/realmode/x86_interrupts.c
index 2ea05d4..b4ff135 100644
--- a/src/devices/oprom/realmode/x86_interrupts.c
+++ b/src/devices/oprom/realmode/x86_interrupts.c
@@ -40,11 +40,11 @@
 
 int int10_handler(struct eregs *regs)
 {
-	int res=-1;
+	int res=0;
 	static u8 cursor_row=0, cursor_col=0;
 	switch((regs->eax & 0xff00)>>8) {
 	case 0x01: // Set cursor shape
-		res = 0;
+		res = 1;
 		break;
 	case 0x02: // Set cursor position
 		if (cursor_row != ((regs->edx >> 8) & 0xff) ||
@@ -53,31 +53,31 @@
 		}
 		cursor_row = (regs->edx >> 8) & 0xff;
 		cursor_col = regs->edx & 0xff;
-		res = 0;
+		res = 1;
 		break;
 	case 0x03: // Get cursor position
 		regs->eax &= 0x00ff;
 		regs->ecx = 0x0607;
 		regs->edx = (cursor_row << 8) | cursor_col;
-		res = 0;
+		res = 1;
 		break;
 	case 0x06: // Scroll up
 		printk(BIOS_INFO, "\n");
-		res = 0;
+		res = 1;
 		break;
 	case 0x08: // Get Character and Mode at Cursor Position
 		regs->eax = 0x0f00 | 'A'; // White on black 'A'
-		res = 0;
+		res = 1;
 		break;
 	case 0x09: // Write Character and attribute
 	case 0x0e: // Write Character
 		printk(BIOS_INFO, "%c", regs->eax & 0xff);
-		res = 0;
+		res = 1;
 		break;
 	case 0x0f: // Get video mode
 		regs->eax = 0x5002; //80x25
 		regs->ebx &= 0x00ff;
-		res = 0;
+		res = 1;
 		break;
         default:
 		printk(BIOS_WARNING, "Unknown INT10 function %04x!\n",
@@ -90,20 +90,20 @@
 int int12_handler(struct eregs *regs)
 {
 	regs->eax = 64 * 1024;
-	return 0;
+	return 1;
 }
 
 int int16_handler(struct eregs *regs)
 {
-	int res=-1;
+	int res=0;
 	switch((regs->eax & 0xff00)>>8) {
 	case 0x00: // Check for Keystroke
 		regs->eax = 0x6120; // Space Bar, Space
-		res = 0;
+		res = 1;
 		break;
 	case 0x01: // Check for Keystroke
 		regs->eflags |= 1<<6; // Zero Flag set (no key available)
-		res = 0;
+		res = 1;
 		break;
         default:
 		printk(BIOS_WARNING, "Unknown INT16 function %04x!\n",
@@ -119,7 +119,7 @@
 int int1a_handler(struct eregs *regs)
 {
 	unsigned short func = (unsigned short)regs->eax;
-	int retval = 0;
+	int retval = 1;
 	unsigned short devid, vendorid, devfn;
 	/* Use short to get rid of gabage in upper half of 32-bit register */
 	short devindex;
@@ -138,7 +138,7 @@
 		// dev_enumerate() does not seem to tell us (publically)
 		regs->ecx = 0xff;
 		regs->edi = 0x00000000;	/* protected mode entry */
-		retval = 0;
+		retval = 1;
 		break;
 	case 0xb102: /* Find Device */
 		devid = regs->ecx;
@@ -160,11 +160,11 @@
 			    | (dev->path.pci.devfn & 0xff);
 			printk(BIOS_DEBUG, "0x%x: return 0x%x\n", func, busdevfn);
 			regs->ebx = busdevfn;
-			retval = 0;
+			retval = 1;
 		} else {
 			regs->eax &= 0xffff00ff; /* Clear AH */
 			regs->eax |= PCIBIOS_NODEV;
-			retval = -1;
+			retval = 0;
 		}
 		break;
 	case 0xb10a: /* Read Config Dword */
@@ -182,7 +182,7 @@
 			// Or are we supposed to return PCIBIOS_NODEV?
 			regs->eax &= 0xffff00ff; /* Clear AH */
 			regs->eax |= PCIBIOS_BADREG;
-			retval = -1;
+			retval = 0;
 			return retval;
 		}
 		switch (func) {
@@ -218,13 +218,13 @@
 #endif
 		regs->eax &= 0xffff00ff; /* Clear AH */
 		regs->eax |= PCIBIOS_SUCCESSFUL;
-		retval = 0;
+		retval = 1;
 		break;
 	default:
 		printk(BIOS_ERR, "UNSUPPORTED PCIBIOS FUNCTION 0x%x\n", func);
 		regs->eax &= 0xffff00ff; /* Clear AH */
 		regs->eax |= PCIBIOS_UNSUPPORTED;
-		retval = -1;
+		retval = 0;
 		break;
 	}
 
diff --git a/src/mainboard/intel/emeraldlake2/mainboard.c b/src/mainboard/intel/emeraldlake2/mainboard.c
index f65a064..ae7f72a 100644
--- a/src/mainboard/intel/emeraldlake2/mainboard.c
+++ b/src/mainboard/intel/emeraldlake2/mainboard.c
@@ -45,7 +45,7 @@
 #if defined(CONFIG_PCI_OPTION_ROM_RUN_REALMODE) && CONFIG_PCI_OPTION_ROM_RUN_REALMODE
 static int int15_handler(struct eregs *regs)
 {
-	int res=-1;
+	int res=0;
 
 	printk(BIOS_DEBUG, "%s: INT15 function %04x!\n",
 			__func__, regs->eax & 0xffff);
@@ -63,7 +63,7 @@
 		regs->eax |= 0x005f;
 		regs->ecx &= 0xffffff00;
 		regs->ecx |= 0x01;
-		res = 0;
+		res = 1;
 		break;
 	case 0x5f35:
 		/*
@@ -81,7 +81,7 @@
 		regs->eax |= 0x005f;
 		regs->ecx &= 0xffff0000;
 		regs->ecx |= 0x0000;
-		res = 0;
+		res = 1;
 		break;
 	case 0x5f51:
 		/*
@@ -95,7 +95,7 @@
 		regs->eax |= 0x005f;
 		regs->ecx &= 0xffff0000;
 		regs->ecx |= 0x0003;
-		res = 0;
+		res = 1;
 		break;
 	case 0x5f70:
 		switch ((regs->ecx >> 8) & 0xff) {
@@ -105,7 +105,7 @@
 			regs->eax |= 0x005f;
 			regs->ecx &= 0xffff0000;
 			regs->ecx |= 0x0000;
-			res = 0;
+			res = 1;
 			break;
 		case 1:
 			/* Set Mux */
@@ -113,7 +113,7 @@
 			regs->eax |= 0x005f;
 			regs->ecx &= 0xffff0000;
 			regs->ecx |= 0x0000;
-			res = 0;
+			res = 1;
 			break;
 		case 2:
 			/* Get SG/Non-SG mode */
@@ -121,13 +121,13 @@
 			regs->eax |= 0x005f;
 			regs->ecx &= 0xffff0000;
 			regs->ecx |= 0x0000;
-			res = 0;
+			res = 1;
 			break;
 		default:
-			/* Interrupt was not handled */
+			/* FIXME: Interrupt was not handled, but return success? */
 			printk(BIOS_DEBUG, "Unknown INT15 5f70 function: 0x%02x\n",
 				((regs->ecx >> 8) & 0xff));
-			return 0;
+			return 1;
 		}
 		break;
 
diff --git a/src/mainboard/kontron/986lcd-m/mainboard.c b/src/mainboard/kontron/986lcd-m/mainboard.c
index cde4389..3951ce6 100644
--- a/src/mainboard/kontron/986lcd-m/mainboard.c
+++ b/src/mainboard/kontron/986lcd-m/mainboard.c
@@ -66,7 +66,7 @@
 #if defined(CONFIG_PCI_OPTION_ROM_RUN_REALMODE) && CONFIG_PCI_OPTION_ROM_RUN_REALMODE
 static int int15_handler(struct eregs *regs)
 {
-	int res = -1;
+	int res = 0;
 
 	/* This int15 handler is Intel IGD. specific. Other chipsets need other
 	 * handlers. The right way to do this is to move this handler code into
@@ -87,13 +87,13 @@
 	case 0x5f35:
 		regs->eax = 0x5f;
 		regs->ecx = BOOT_DISPLAY_DEFAULT;
-		res = 0;
+		res = 1;
 		break;
 	case 0x5f40:
 		regs->eax = 0x5f;
 		regs->ecx = 3; // This is mainboard specific
 		printk(BIOS_DEBUG, "DISPLAY=%x\n", regs->ecx);
-		res = 0;
+		res = 1;
 		break;
 	default:
 		printk(BIOS_DEBUG, "Unknown INT15 function %04x!\n",
diff --git a/src/mainboard/roda/rk886ex/mainboard.c b/src/mainboard/roda/rk886ex/mainboard.c
index 4b35e7b..f4e43bd 100644
--- a/src/mainboard/roda/rk886ex/mainboard.c
+++ b/src/mainboard/roda/rk886ex/mainboard.c
@@ -93,7 +93,7 @@
 #if CONFIG_PCI_OPTION_ROM_RUN_REALMODE
 static int int15_handler(struct eregs *regs)
 {
-	int res = -1;
+	int res = 0;
 
 	/* This int15 handler is Intel IGD. specific. Other chipsets need other
 	 * handlers. The right way to do this is to move this handler code into
@@ -114,13 +114,13 @@
 	case 0x5f35:
 		regs->eax = 0x5f;
 		regs->ecx = BOOT_DISPLAY_DEFAULT;
-		res = 0;
+		res = 1;
 		break;
 	case 0x5f40:
 		regs->eax = 0x5f;
 		regs->ecx = 3; // This is mainboard specific
 		printk(BIOS_DEBUG, "DISPLAY=%x\n", regs->ecx);
-		res = 0;
+		res = 1;
 		break;
 	default:
 		printk(BIOS_DEBUG, "Unknown INT15 function %04x!\n",
diff --git a/src/mainboard/samsung/lumpy/mainboard.c b/src/mainboard/samsung/lumpy/mainboard.c
index a8b8b3a..3408248 100644
--- a/src/mainboard/samsung/lumpy/mainboard.c
+++ b/src/mainboard/samsung/lumpy/mainboard.c
@@ -52,7 +52,7 @@
 #if defined(CONFIG_PCI_OPTION_ROM_RUN_REALMODE) && CONFIG_PCI_OPTION_ROM_RUN_REALMODE
 static int int15_handler(struct eregs *regs)
 {
-	int res=-1;
+	int res=0;
 
 	printk(BIOS_DEBUG, "%s: INT15 function %04x!\n",
 			__func__, regs->eax & 0xffff);
@@ -70,7 +70,7 @@
 		regs->eax |= 0x005f;
 		regs->ecx &= 0xffffff00;
 		regs->ecx |= 0x00;
-		res = 0;
+		res = 1;
 		break;
 	case 0x5f35:
 		/*
@@ -88,7 +88,7 @@
 		regs->eax |= 0x005f;
 		regs->ecx &= 0xffff0000;
 		regs->ecx |= 0x0000;
-		res = 0;
+		res = 1;
 		break;
 	case 0x5f51:
 		/*
@@ -102,7 +102,7 @@
 		regs->eax |= 0x005f;
 		regs->ecx &= 0xffff0000;
 		regs->ecx |= 0x0001;
-		res = 0;
+		res = 1;
 		break;
 	case 0x5f70:
 		switch ((regs->ecx >> 8) & 0xff) {
@@ -112,7 +112,7 @@
 			regs->eax |= 0x005f;
 			regs->ecx &= 0xffff0000;
 			regs->ecx |= 0x0000;
-			res = 0;
+			res = 1;
 			break;
 		case 1:
 			/* Set Mux */
@@ -120,7 +120,7 @@
 			regs->eax |= 0x005f;
 			regs->ecx &= 0xffff0000;
 			regs->ecx |= 0x0000;
-			res = 0;
+			res = 1;
 			break;
 		case 2:
 			/* Get SG/Non-SG mode */
@@ -128,13 +128,13 @@
 			regs->eax |= 0x005f;
 			regs->ecx &= 0xffff0000;
 			regs->ecx |= 0x0000;
-			res = 0;
+			res = 1;
 			break;
 		default:
-			/* Interrupt was not handled */
+			/* FIXME: Interrupt was not handled, but return success? */
 			printk(BIOS_DEBUG, "Unknown INT15 5f70 function: 0x%02x\n",
 				((regs->ecx >> 8) & 0xff));
-			return 0;
+			return 1;
 		}
 		break;
 
diff --git a/src/mainboard/samsung/stumpy/mainboard.c b/src/mainboard/samsung/stumpy/mainboard.c
index eab75f4..fe70948f 100644
--- a/src/mainboard/samsung/stumpy/mainboard.c
+++ b/src/mainboard/samsung/stumpy/mainboard.c
@@ -45,7 +45,7 @@
 #if defined(CONFIG_PCI_OPTION_ROM_RUN_REALMODE) && CONFIG_PCI_OPTION_ROM_RUN_REALMODE
 static int int15_handler(struct eregs *regs)
 {
-	int res=-1;
+	int res=0;
 
 	printk(BIOS_DEBUG, "%s: INT15 function %04x!\n",
 			__func__, regs->eax & 0xffff);
@@ -63,7 +63,7 @@
 		regs->eax |= 0x005f;
 		regs->ecx &= 0xffffff00;
 		regs->ecx |= 0x01;
-		res = 0;
+		res = 1;
 		break;
 	case 0x5f35:
 		/*
@@ -81,7 +81,7 @@
 		regs->eax |= 0x005f;
 		regs->ecx &= 0xffff0000;
 		regs->ecx |= 0x0000;
-		res = 0;
+		res = 1;
 		break;
 	case 0x5f51:
 		/*
@@ -95,7 +95,7 @@
 		regs->eax |= 0x005f;
 		regs->ecx &= 0xffff0000;
 		regs->ecx |= 0x0003;
-		res = 0;
+		res = 1;
 		break;
 	case 0x5f70:
 		switch ((regs->ecx >> 8) & 0xff) {
@@ -105,7 +105,7 @@
 			regs->eax |= 0x005f;
 			regs->ecx &= 0xffff0000;
 			regs->ecx |= 0x0000;
-			res = 0;
+			res = 1;
 			break;
 		case 1:
 			/* Set Mux */
@@ -113,7 +113,7 @@
 			regs->eax |= 0x005f;
 			regs->ecx &= 0xffff0000;
 			regs->ecx |= 0x0000;
-			res = 0;
+			res = 1;
 			break;
 		case 2:
 			/* Get SG/Non-SG mode */
@@ -121,13 +121,13 @@
 			regs->eax |= 0x005f;
 			regs->ecx &= 0xffff0000;
 			regs->ecx |= 0x0000;
-			res = 0;
+			res = 1;
 			break;
 		default:
-			/* Interrupt was not handled */
+			/* FIXME: Interrupt was not handled, but return sucess? */
 			printk(BIOS_DEBUG, "Unknown INT15 5f70 function: 0x%02x\n",
 				((regs->ecx >> 8) & 0xff));
-			return 0;
+			return 1;
 		}
 		break;
 
diff --git a/src/mainboard/technexion/tim5690/vgabios.c b/src/mainboard/technexion/tim5690/vgabios.c
index 372c4b6..6c9b45e 100644
--- a/src/mainboard/technexion/tim5690/vgabios.c
+++ b/src/mainboard/technexion/tim5690/vgabios.c
@@ -40,7 +40,7 @@
 /* BIOS int15 function */
 int tim5690_int15_handler(struct eregs *regs)
 {
-        int res = -1;
+        int res = 0;
 
         printk(BIOS_DEBUG, "tim5690_int15_handler\n");
 
@@ -50,12 +50,12 @@
                 case 0x00:
                         regs->eax &= ~(0xff);
                         regs->ebx = (regs->ebx & ~(0xff)) | vbios_regs_local.int15_regs.fun00_panel_id;
-                        res = 0;
+                        res = 1;
                         break;
                 case 0x05:
                         regs->eax &= ~(0xff);
                         regs->ebx = (regs->ebx & ~(0xff)) | vbios_regs_local.int15_regs.fun05_tv_standard;
-                        res = 0;
+                        res = 1;
                         break;
                 }
                 break;
diff --git a/src/northbridge/via/cn400/vga.c b/src/northbridge/via/cn400/vga.c
index 8c75a4f..fa598aa 100644
--- a/src/northbridge/via/cn400/vga.c
+++ b/src/northbridge/via/cn400/vga.c
@@ -39,7 +39,7 @@
 
 static int via_cn400_int15_handler(struct eregs *regs)
 {
-	int res=-1;
+	int res=0;
 	printk(BIOS_DEBUG, "via_cn400_int15_handler\n");
 	switch(regs->eax & 0xffff) {
 	case 0x5f19:
@@ -48,7 +48,7 @@
 		regs->eax=0x5f;
 		regs->ebx=0x545; // MCLK = 133, 32M frame buffer, 256 M main memory
 		regs->ecx=0x060;
-		res=0;
+		res=1;
 		break;
 	case 0x5f00:
 		regs->eax = 0x8600;
@@ -56,14 +56,14 @@
 	case 0x5f01:
 		regs->eax = 0x5f;
 		regs->ecx = (regs->ecx & 0xffffff00 ) | 2; // panel type =  2 = 1024 * 768
-		res = 0;
+		res = 1;
 		break;
 	case 0x5f02:
 		regs->eax=0x5f;
 		regs->ebx= (regs->ebx & 0xffff0000) | 2;
 		regs->ecx= (regs->ecx & 0xffff0000) | 0x401;  // PAL + crt only
 		regs->edx= (regs->edx & 0xffff0000) | 0;  // TV Layout - default
-		res=0;
+		res=1;
 		break;
 	case 0x5f0f:
 		regs->eax=0x860f;
diff --git a/src/northbridge/via/cn700/vga.c b/src/northbridge/via/cn700/vga.c
index d184644..c231459 100644
--- a/src/northbridge/via/cn700/vga.c
+++ b/src/northbridge/via/cn700/vga.c
@@ -39,7 +39,7 @@
 
 static int via_cn700_int15_handler(struct eregs *regs)
 {
-	int res=-1;
+	int res=0;
 	printk(BIOS_DEBUG, "via_cn700_int15_handler\n");
 	switch(regs->eax & 0xffff) {
 	case 0x5f19:
@@ -48,7 +48,7 @@
 		regs->eax=0x5f;
 		regs->ebx=0x545; // MCLK = 133, 32M frame buffer, 256 M main memory
 		regs->ecx=0x060;
-		res=0;
+		res=1;
 		break;
 	case 0x5f00:
 		regs->eax = 0x8600;
@@ -56,14 +56,14 @@
 	case 0x5f01:
 		regs->eax = 0x5f;
 		regs->ecx = (regs->ecx & 0xffffff00 ) | 2; // panel type =  2 = 1024 * 768
-		res = 0;
+		res = 1;
 		break;
 	case 0x5f02:
 		regs->eax=0x5f;
 		regs->ebx= (regs->ebx & 0xffff0000) | 2;
 		regs->ecx= (regs->ecx & 0xffff0000) | 0x401;  // PAL + crt only
 		regs->edx= (regs->edx & 0xffff0000) | 0;  // TV Layout - default
-		res=0;
+		res=1;
 		break;
 	case 0x5f0f:
 		regs->eax=0x860f;
diff --git a/src/northbridge/via/cx700/vga.c b/src/northbridge/via/cx700/vga.c
index 4acad7e..658535d 100644
--- a/src/northbridge/via/cx700/vga.c
+++ b/src/northbridge/via/cx700/vga.c
@@ -46,7 +46,7 @@
 
 static int via_cx700_int15_handler(struct eregs *regs)
 {
-	int res=-1;
+	int res=0;
 	u8 mem_speed;
 
 #define MEMORY_SPEED_66MHZ	(0 << 4)
@@ -70,14 +70,14 @@
 	switch(regs->eax & 0xffff) {
 	case 0x5f00:	/* VGA POST Initialization Signal */
 		regs->eax = (regs->eax & 0xffff0000 ) | 0x5f;
-		res = 0;
+		res = 1;
 		break;
 
 	case 0x5f01:	/* Software Panel Type Configuration */
 		regs->eax = (regs->eax & 0xffff0000 ) | 0x5f;
 		// panel type =  2 = 1024 * 768
 		regs->ecx = (regs->ecx & 0xffffff00 ) | 2;
-		res = 0;
+		res = 1;
 		break;
 
 	case 0x5f27:	/* Boot Device Selection */
@@ -87,7 +87,7 @@
 		regs->ecx = 0x00000000; // 0 -> default
 		// TV Layout - default
 		regs->edx = (regs->edx & 0xffffff00) | 0;
-		res=0;
+		res=1;
 		break;
 
 	case 0x5f0b:	/* Get Expansion Setting */
@@ -95,12 +95,12 @@
 
 		regs->ecx = regs->ecx & 0xffffff00; // non-expansion
 		// regs->ecx = regs->ecx & 0xffffff00 | 1; // expansion
-		res=0;
+		res=1;
 		break;
 
 	case 0x5f0f:	/* VGA Post Completion */
 		regs->eax = (regs->eax & 0xffff0000 ) | 0x5f;
-		res=0;
+		res=1;
 		break;
 
 	case 0x5f18:
@@ -117,7 +117,7 @@
 
 		regs->ebx |= memory_mapping[mem_speed];
 
-		res=0;
+		res=1;
 		break;
 
         default:
diff --git a/src/northbridge/via/vt8623/vga.c b/src/northbridge/via/vt8623/vga.c
index fea691e..8e9bd6d 100644
--- a/src/northbridge/via/vt8623/vga.c
+++ b/src/northbridge/via/vt8623/vga.c
@@ -36,7 +36,7 @@
 
 static int via_vt8623_int15_handler(struct eregs *regs)
 {
-	int res=-1;
+	int res=0;
 	printk(BIOS_DEBUG, "via_vt8623_int15_handler\n");
 	switch(regs->eax & 0xffff) {
 	case 0x5f19:
@@ -45,7 +45,7 @@
 		regs->eax=0x5f;
 		regs->ebx=0x545; // MCLK = 133, 32M frame buffer, 256 M main memory
 		regs->ecx=0x060;
-		res=0;
+		res=1;
 		break;
 	case 0x5f00:
 		regs->eax = 0x8600;
@@ -53,14 +53,14 @@
 	case 0x5f01:
 		regs->eax = 0x5f;
 		regs->ecx = (regs->ecx & 0xffffff00 ) | 2; // panel type =  2 = 1024 * 768
-		res = 0;
+		res = 1;
 		break;
 	case 0x5f02:
 		regs->eax=0x5f;
 		regs->ebx= (regs->ebx & 0xffff0000) | 2;
 		regs->ecx= (regs->ecx & 0xffff0000) | 0x401;  // PAL + crt only
 		regs->edx= (regs->edx & 0xffff0000) | 0;  // TV Layout - default
-		res=0;
+		res=1;
 		break;
 	case 0x5f0f:
 		regs->eax=0x860f;
diff --git a/src/northbridge/via/vx800/vga.c b/src/northbridge/via/vx800/vga.c
index d91ad9f..be522f8 100644
--- a/src/northbridge/via/vx800/vga.c
+++ b/src/northbridge/via/vx800/vga.c
@@ -52,13 +52,13 @@
 
 static int via_vx800_int15_handler(struct eregs *regs)
 {
-	int res=-1;
+	int res=0;
 	printk(BIOS_DEBUG, "via_vx800_int15_handler\n");
 	switch(regs->eax & 0xffff) {
 	case 0x5f19:
 		regs->eax=0x5f;
 		regs->ecx=0x03;
-		res=0;
+		res=1;
 		break;
 	case 0x5f18:
 	{
@@ -95,28 +95,28 @@
 		i = i << 4;
 		regs->ebx = regs->ebx + ((u32) i);
 		regs->eax = 0x5f;
-		res = 0;
+		res = 1;
 		break;
 	}
 	case 0x5f00:
 		regs->eax = 0x005f;
-		res = 0;
+		res = 1;
 		break;
 	case 0x5f01:
 		regs->eax = 0x5f;
 		regs->ecx = (regs->ecx & 0xffffff00 ) | 2; // panel type =  2 = 1024 * 768
-		res = 0;
+		res = 1;
 		break;
 	case 0x5f02:
 		regs->eax=0x5f;
 		regs->ebx= (regs->ebx & 0xffff0000) | 2;
 		regs->ecx= (regs->ecx & 0xffff0000) | 0x401;  // PAL + crt only
 		regs->edx= (regs->edx & 0xffff0000) | 0;  // TV Layout - default
-		res=0;
+		res=1;
 		break;
 	case 0x5f0f:
 		regs->eax = 0x005f;
-		res = 0;
+		res = 1;
 		break;
         default:
 		printk(BIOS_DEBUG, "Unknown INT15 function %04x!\n",