summaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorStefan Reinauer <stepan@coresystems.de>2009-01-20 21:36:39 +0000
committerStefan Reinauer <stepan@openbios.org>2009-01-20 21:36:39 +0000
commit5833f7c0e69df069aec918ba9f34b4a0fe0019f5 (patch)
treebf9a13d4e152164f953ad06b5861845a011580b1 /src/include
parent20b261dacf56a0bf09a74931cd511537b79b6983 (diff)
Backport all x86emu fixes from Pattrick Hueper to coreboot v2 (acked in v2,
hence I consider it trivial in this case). This does not include the Yabel work. Signed-off-by: Stefan Reinauer <stepan@coresystems.de> Acked-by: Stefan Reinauer <stepan@coresystems.de> git-svn-id: svn://svn.coreboot.org/coreboot/trunk@3880 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'src/include')
-rw-r--r--src/include/x86emu/fpu_regs.h5
-rw-r--r--src/include/x86emu/regs.h14
-rw-r--r--src/include/x86emu/types.h12
-rw-r--r--src/include/x86emu/x86emu.h6
4 files changed, 28 insertions, 9 deletions
diff --git a/src/include/x86emu/fpu_regs.h b/src/include/x86emu/fpu_regs.h
index 56e9a04d75..67a82d8a05 100644
--- a/src/include/x86emu/fpu_regs.h
+++ b/src/include/x86emu/fpu_regs.h
@@ -39,6 +39,11 @@
#ifndef __X86EMU_FPU_REGS_H
#define __X86EMU_FPU_REGS_H
+
+#if defined(DEBUG) && (DEBUG == 0)
+#undef DEBUG
+#endif
+
#ifdef X86_FPU_SUPPORT
#pragma pack(1)
diff --git a/src/include/x86emu/regs.h b/src/include/x86emu/regs.h
index 718d22fc86..8f89b22c53 100644
--- a/src/include/x86emu/regs.h
+++ b/src/include/x86emu/regs.h
@@ -40,6 +40,10 @@
#ifndef __X86EMU_REGS_H
#define __X86EMU_REGS_H
+#if defined(DEBUG) && (DEBUG == 0)
+#undef DEBUG
+#endif
+
/*---------------------- Macros and type definitions ----------------------*/
#pragma pack(1)
@@ -231,6 +235,9 @@ struct i386_segment_regs {
#define SYSMODE_PREFIX_REPNE 0x00000100
#define SYSMODE_PREFIX_DATA 0x00000200
#define SYSMODE_PREFIX_ADDR 0x00000400
+// for REP(E|NE) Instructions, we need to decide wether it should be using
+// the 32bit ECX register as or the 16bit CX register as count register
+#define SYSMODE_32BIT_REP 0x00000800
#define SYSMODE_INTR_PENDING 0x10000000
#define SYSMODE_EXTRN_INTR 0x20000000
#define SYSMODE_HALTED 0x40000000
@@ -250,7 +257,8 @@ struct i386_segment_regs {
SYSMODE_SEGOVR_GS | \
SYSMODE_SEGOVR_SS | \
SYSMODE_PREFIX_DATA | \
- SYSMODE_PREFIX_ADDR)
+ SYSMODE_PREFIX_ADDR | \
+ SYSMODE_32BIT_REP)
#define INTR_SYNCH 0x1
#define INTR_ASYNCH 0x2
@@ -274,9 +282,9 @@ typedef struct {
*/
u32 mode;
volatile int intr; /* mask of pending interrupts */
- int debug;
+ volatile int debug;
#ifdef DEBUG
- int check;
+ int check;
u16 saved_ip;
u16 saved_cs;
int enc_pos;
diff --git a/src/include/x86emu/types.h b/src/include/x86emu/types.h
index c347181100..5bd595e997 100644
--- a/src/include/x86emu/types.h
+++ b/src/include/x86emu/types.h
@@ -74,15 +74,15 @@ typedef unsigned int u32;
typedef unsigned long long u64;
#endif
-typedef char s8;
-typedef short s16;
-typedef int s32;
+typedef signed char s8;
+typedef signed short s16;
+typedef signed int s32;
#ifdef __HAS_LONG_LONG__
-typedef long long s64;
+typedef signed long long s64;
#endif
-typedef unsigned int uint;
-typedef int sint;
+typedef unsigned int uint;
+typedef signed int sint;
typedef u16 X86EMU_pioAddr;
diff --git a/src/include/x86emu/x86emu.h b/src/include/x86emu/x86emu.h
index bd45fea423..e5614ea183 100644
--- a/src/include/x86emu/x86emu.h
+++ b/src/include/x86emu/x86emu.h
@@ -42,6 +42,10 @@
#ifndef __X86EMU_X86EMU_H
#define __X86EMU_X86EMU_H
+#if defined(DEBUG) && (DEBUG == 0)
+#undef DEBUG
+#endif
+
/* FIXME: undefine printk for the moment */
#ifdef COREBOOT_VERSION
#include "console/console.h"
@@ -187,6 +191,8 @@ void X86EMU_halt_sys(void);
#define DEBUG_TRACECALL_REGS_F 0x004000
#define DEBUG_DECODE_NOPRINT_F 0x008000
#define DEBUG_SAVE_IP_CS_F 0x010000
+#define DEBUG_TRACEJMP_F 0x020000
+#define DEBUG_TRACEJMP_REGS_F 0x040000
#define DEBUG_SYS_F (DEBUG_SVC_F|DEBUG_FS_F|DEBUG_PROC_F)
void X86EMU_trace_regs(void);