/*
- * COPYRIGHT: GPL - See COPYING in the top level directory
- * PROJECT: 386/486 CPU Emulation Library
- * FILE: soft386.h
- * PURPOSE: Header file for Soft386.
- * PROGRAMMERS: Aleksandar Andrejevic <theflash AT sdf DOT lonestar DOT org>
+ * Soft386 386/486 CPU Emulation Library
+ * soft386.h
+ *
+ * Copyright (C) 2013 Aleksandar Andrejevic <theflash AT sdf DOT lonestar DOT org>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#ifndef _SOFT386_H_
struct _SOFT386_STATE;
typedef struct _SOFT386_STATE SOFT386_STATE, *PSOFT386_STATE;
-enum _SOFT386_GEN_REGS
+typedef enum _SOFT386_GEN_REGS
{
SOFT386_REG_EAX,
SOFT386_REG_ECX,
SOFT386_REG_EBP,
SOFT386_REG_ESI,
SOFT386_REG_EDI
-};
+} SOFT386_GEN_REGS, *PSOFT386_GEN_REGS;
-enum _SOFT386_SEG_REGS
+typedef enum _SOFT386_SEG_REGS
{
SOFT386_REG_ES,
SOFT386_REG_CS,
SOFT386_REG_DS,
SOFT386_REG_FS,
SOFT386_REG_GS
-};
+} SOFT386_SEG_REGS, *PSOFT386_SEG_REGS;
-enum _SOFT386_CTRL_REGS
+typedef enum _SOFT386_CTRL_REGS
{
SOFT386_REG_CR0,
SOFT386_REG_CR1,
SOFT386_REG_CR5,
SOFT386_REG_CR6,
SOFT386_REG_CR7
-};
+} SOFT386_CTRL_REGS, *PSOFT386_CTRL_REGS;
-enum _SOFT386_DBG_REGS
+typedef enum _SOFT386_DBG_REGS
{
SOFT386_REG_DR0,
SOFT386_REG_DR1,
SOFT386_REG_DR5,
SOFT386_REG_DR6,
SOFT386_REG_DR7
-};
+} SOFT386_DBG_REGS, *PSOFT386_DBG_REGS;
-enum _SOFT386_EXCEPTIONS
+typedef enum _SOFT386_EXCEPTIONS
{
SOFT386_EXCEPTION_DE = 0x00,
SOFT386_EXCEPTION_DB = 0x01,
SOFT386_EXCEPTION_MF = 0x10,
SOFT386_EXCEPTION_AC = 0x11,
SOFT386_EXCEPTION_MC = 0x12
-};
+} SOFT386_EXCEPTIONS, *PSOFT386_EXCEPTIONS;
typedef
BOOLEAN
PSOFT386_STATE State
);
+typedef
+VOID
+(NTAPI *SOFT386_BOP_PROC)
+(
+ PSOFT386_STATE State,
+ USHORT BopCode
+);
+
typedef union _SOFT386_REG
{
union
typedef union _SOFT386_FLAGS_REG
{
+ USHORT LowWord;
ULONG Long;
+
struct
{
ULONG Cf : 1;
SOFT386_IO_READ_PROC IoReadCallback;
SOFT386_IO_WRITE_PROC IoWriteCallback;
SOFT386_IDLE_PROC IdleCallback;
+ SOFT386_BOP_PROC BopCallback;
SOFT386_REG GeneralRegs[SOFT386_NUM_GEN_REGS];
SOFT386_SEG_REG SegmentRegs[SOFT386_NUM_SEG_REGS];
SOFT386_REG InstPtr;
ULONG DebugRegisters[SOFT386_NUM_DBG_REGS];
ULONG ExceptionCount;
ULONG PrefixFlags;
- INT SegmentOverride;
+ SOFT386_SEG_REGS SegmentOverride;
BOOLEAN HardwareInt;
};
NTAPI
Soft386ExecuteAt(PSOFT386_STATE State, USHORT Segment, ULONG Offset);
+VOID
+NTAPI
+Soft386SetStack(PSOFT386_STATE State, USHORT Segment, ULONG Offset);
+
#endif // _SOFT386_H_
/* EOF */