[Midnightbsd-cvs] src [10132] trunk/sys/contrib/x86emu: tag

laffer1 at midnightbsd.org laffer1 at midnightbsd.org
Mon May 28 14:53:36 EDT 2018


Revision: 10132
          http://svnweb.midnightbsd.org/src/?rev=10132
Author:   laffer1
Date:     2018-05-28 14:53:35 -0400 (Mon, 28 May 2018)
Log Message:
-----------
tag

Modified Paths:
--------------
    trunk/sys/contrib/x86emu/x86emu.c
    trunk/sys/contrib/x86emu/x86emu.h
    trunk/sys/contrib/x86emu/x86emu_regs.h

Modified: trunk/sys/contrib/x86emu/x86emu.c
===================================================================
--- trunk/sys/contrib/x86emu/x86emu.c	2018-05-28 18:53:19 UTC (rev 10131)
+++ trunk/sys/contrib/x86emu/x86emu.c	2018-05-28 18:53:35 UTC (rev 10132)
@@ -1,4 +1,5 @@
-/*	$OpenBSD: x86emu.c,v 1.5 2010/02/17 15:09:47 pirofti Exp $	*/
+/* $MidnightBSD$ */
+/*	$OpenBSD: x86emu.c,v 1.9 2014/06/15 11:04:49 pirofti Exp $	*/
 /*	$NetBSD: x86emu.c,v 1.7 2009/02/03 19:26:29 joerg Exp $	*/
 
 /*
@@ -33,7 +34,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
+__FBSDID("$FreeBSD: stable/10/sys/contrib/x86emu/x86emu.c 282050 2015-04-27 05:42:14Z delphij $");
 
 #include <contrib/x86emu/x86emu.h>
 #include <contrib/x86emu/x86emu_regs.h>
@@ -2151,21 +2152,24 @@
 static void
 x86emuOp_lea_word_R_M(struct x86emu *emu)
 {
-	uint16_t *srcreg;
 	uint32_t destoffset;
 
-/*
- * TODO: Need to handle address size prefix!
- *
- * lea  eax,[eax+ebx*2] ??
- */
 	fetch_decode_modrm(emu);
 	if (emu->cur_mod == 3)
 		x86emu_halt_sys(emu);
 
-	srcreg = decode_rh_word_register(emu);
 	destoffset = decode_rl_address(emu);
-	*srcreg = (uint16_t) destoffset;
+	if (emu->x86.mode & SYSMODE_PREFIX_ADDR) {
+		uint32_t *srcreg;
+
+		srcreg = decode_rh_long_register(emu);
+		*srcreg = (uint32_t) destoffset;
+	} else {
+		uint16_t *srcreg;
+
+		srcreg = decode_rh_word_register(emu);
+		*srcreg = (uint16_t) destoffset;
+	}
 }
 
 /*
@@ -3750,12 +3754,19 @@
 static void
 x86emuOp_call_near_IMM(struct x86emu *emu)
 {
-	int16_t ip;
-
-	ip = (int16_t) fetch_word_imm(emu);
-	ip += (int16_t) emu->x86.R_IP;	/* CHECK SIGN */
-	push_word(emu, emu->x86.R_IP);
-	emu->x86.R_IP = ip;
+	if (emu->x86.mode & SYSMODE_PREFIX_DATA) {
+		int32_t ip;
+		ip = (int32_t) fetch_long_imm(emu);
+		ip += (int32_t) emu->x86.R_EIP;
+		push_long(emu, emu->x86.R_EIP);
+		emu->x86.R_EIP = ip;
+	} else {
+		int16_t ip;
+		ip = (int16_t) fetch_word_imm(emu);
+		ip += (int16_t) emu->x86.R_IP;	/* CHECK SIGN */
+		push_word(emu, emu->x86.R_IP);
+		emu->x86.R_IP = ip;
+	}
 }
 
 /*
@@ -5240,7 +5251,7 @@
 static void
 hw_cpuid(uint32_t *a, uint32_t *b, uint32_t *c, uint32_t *d)
 {
-	__asm__ __volatile__("cpuid"
+	__asm__ volatile("cpuid"
 			     : "=a" (*a), "=b" (*b),
 			       "=c" (*c), "=d" (*d)
 			     : "a" (*a), "c" (*c)
@@ -5610,6 +5621,7 @@
 {
 	uint32_t *destreg;
 
+	fetch_decode_modrm(emu);
 	destreg = decode_rh_long_register(emu);
 	*destreg = (int32_t)(int8_t)decode_and_fetch_byte(emu);
 }

Modified: trunk/sys/contrib/x86emu/x86emu.h
===================================================================
--- trunk/sys/contrib/x86emu/x86emu.h	2018-05-28 18:53:19 UTC (rev 10131)
+++ trunk/sys/contrib/x86emu/x86emu.h	2018-05-28 18:53:35 UTC (rev 10132)
@@ -1,6 +1,7 @@
+/* $MidnightBSD$ */
 /*	$NetBSD: x86emu.h,v 1.1 2007/12/01 20:14:10 joerg Exp $	*/
 /*	$OpenBSD: x86emu.h,v 1.3 2009/06/06 03:45:05 matthieu Exp $ */
-/*	$FreeBSD$	*/
+/*	$FreeBSD: stable/10/sys/contrib/x86emu/x86emu.h 197019 2009-09-09 05:53:26Z delphij $	*/
 
 /****************************************************************************
 *

Modified: trunk/sys/contrib/x86emu/x86emu_regs.h
===================================================================
--- trunk/sys/contrib/x86emu/x86emu_regs.h	2018-05-28 18:53:19 UTC (rev 10131)
+++ trunk/sys/contrib/x86emu/x86emu_regs.h	2018-05-28 18:53:35 UTC (rev 10132)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
 /*	$NetBSD: x86emu_regs.h,v 1.1 2007/12/01 20:14:10 joerg Exp $	*/
 /*	$OpenBSD: x86emu_regs.h,v 1.2 2009/06/06 03:45:05 matthieu Exp $ */
 



More information about the Midnightbsd-cvs mailing list