45e9809aff7304721fddb95654901b32195c9c7avboxsync/****************************************************************************
45e9809aff7304721fddb95654901b32195c9c7avboxsync* Realmode X86 Emulator Library
45e9809aff7304721fddb95654901b32195c9c7avboxsync* Copyright (C) 1996-1999 SciTech Software, Inc.
45e9809aff7304721fddb95654901b32195c9c7avboxsync* Copyright (C) David Mosberger-Tang
45e9809aff7304721fddb95654901b32195c9c7avboxsync* Copyright (C) 1999 Egbert Eich
45e9809aff7304721fddb95654901b32195c9c7avboxsync* ========================================================================
45e9809aff7304721fddb95654901b32195c9c7avboxsync* Permission to use, copy, modify, distribute, and sell this software and
45e9809aff7304721fddb95654901b32195c9c7avboxsync* its documentation for any purpose is hereby granted without fee,
45e9809aff7304721fddb95654901b32195c9c7avboxsync* provided that the above copyright notice appear in all copies and that
45e9809aff7304721fddb95654901b32195c9c7avboxsync* both that copyright notice and this permission notice appear in
45e9809aff7304721fddb95654901b32195c9c7avboxsync* supporting documentation, and that the name of the authors not be used
45e9809aff7304721fddb95654901b32195c9c7avboxsync* in advertising or publicity pertaining to distribution of the software
45e9809aff7304721fddb95654901b32195c9c7avboxsync* without specific, written prior permission. The authors makes no
45e9809aff7304721fddb95654901b32195c9c7avboxsync* representations about the suitability of this software for any purpose.
45e9809aff7304721fddb95654901b32195c9c7avboxsync* It is provided "as is" without express or implied warranty.
45e9809aff7304721fddb95654901b32195c9c7avboxsync* THE AUTHORS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
45e9809aff7304721fddb95654901b32195c9c7avboxsync* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
45e9809aff7304721fddb95654901b32195c9c7avboxsync* EVENT SHALL THE AUTHORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
45e9809aff7304721fddb95654901b32195c9c7avboxsync* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
45e9809aff7304721fddb95654901b32195c9c7avboxsync* USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
45e9809aff7304721fddb95654901b32195c9c7avboxsync* OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
45e9809aff7304721fddb95654901b32195c9c7avboxsync* PERFORMANCE OF THIS SOFTWARE.
45e9809aff7304721fddb95654901b32195c9c7avboxsync* ========================================================================
45e9809aff7304721fddb95654901b32195c9c7avboxsync* Language: ANSI C
45e9809aff7304721fddb95654901b32195c9c7avboxsync* Environment: Any
45e9809aff7304721fddb95654901b32195c9c7avboxsync* Developer: Kendall Bennett
45e9809aff7304721fddb95654901b32195c9c7avboxsync* Description: Header file for debug definitions.
45e9809aff7304721fddb95654901b32195c9c7avboxsync****************************************************************************/
45e9809aff7304721fddb95654901b32195c9c7avboxsync/*---------------------- Macros and type definitions ----------------------*/
45e9809aff7304721fddb95654901b32195c9c7avboxsync/* checks to be enabled for "runtime" */
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define CHECK_MEM_ACCESS_F 0x4 /*using regular linear pointer */
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define CHECK_DATA_ACCESS_F 0x8 /*using segment:offset*/
45e9809aff7304721fddb95654901b32195c9c7avboxsync# define CHECK_IP_FETCH() (M.x86.check & CHECK_IP_FETCH_F)
45e9809aff7304721fddb95654901b32195c9c7avboxsync# define CHECK_SP_ACCESS() (M.x86.check & CHECK_SP_ACCESS_F)
45e9809aff7304721fddb95654901b32195c9c7avboxsync# define CHECK_MEM_ACCESS() (M.x86.check & CHECK_MEM_ACCESS_F)
45e9809aff7304721fddb95654901b32195c9c7avboxsync# define CHECK_DATA_ACCESS() (M.x86.check & CHECK_DATA_ACCESS_F)
45e9809aff7304721fddb95654901b32195c9c7avboxsync# define DEBUG_INSTRUMENT() (M.x86.debug & DEBUG_INSTRUMENT_F)
45e9809aff7304721fddb95654901b32195c9c7avboxsync# define DEBUG_DECODE() (M.x86.debug & DEBUG_DECODE_F)
45e9809aff7304721fddb95654901b32195c9c7avboxsync# define DEBUG_TRACE() (M.x86.debug & DEBUG_TRACE_F)
45e9809aff7304721fddb95654901b32195c9c7avboxsync# define DEBUG_DISASSEMBLE() (M.x86.debug & DEBUG_DISASSEMBLE_F)
45e9809aff7304721fddb95654901b32195c9c7avboxsync# define DEBUG_BREAK() (M.x86.debug & DEBUG_BREAK_F)
45e9809aff7304721fddb95654901b32195c9c7avboxsync# define DEBUG_SAVE_IP_CS() (M.x86.debug & DEBUG_SAVE_IP_CS_F)
45e9809aff7304721fddb95654901b32195c9c7avboxsync# define DEBUG_SYSINT() (M.x86.debug & DEBUG_SYSINT_F)
45e9809aff7304721fddb95654901b32195c9c7avboxsync# define DEBUG_TRACECALL() (M.x86.debug & DEBUG_TRACECALL_F)
45e9809aff7304721fddb95654901b32195c9c7avboxsync# define DEBUG_TRACECALLREGS() (M.x86.debug & DEBUG_TRACECALL_REGS_F)
45e9809aff7304721fddb95654901b32195c9c7avboxsync# define DEBUG_MEM_TRACE() (M.x86.debug & DEBUG_MEM_TRACE_F)
45e9809aff7304721fddb95654901b32195c9c7avboxsync# define DEBUG_IO_TRACE() (M.x86.debug & DEBUG_IO_TRACE_F)
45e9809aff7304721fddb95654901b32195c9c7avboxsync# define DEBUG_DECODE_NOPRINT() (M.x86.debug & DEBUG_DECODE_NOPRINT_F)
45e9809aff7304721fddb95654901b32195c9c7avboxsync * The following allow us to look at the bytes of an instruction. The
45e9809aff7304721fddb95654901b32195c9c7avboxsync * first INCR_INSTRN_LEN, is called everytime bytes are consumed in
45e9809aff7304721fddb95654901b32195c9c7avboxsync * the decoding process. The SAVE_IP_CS is called initially when the
45e9809aff7304721fddb95654901b32195c9c7avboxsync * major opcode of the instruction is accessed.
45e9809aff7304721fddb95654901b32195c9c7avboxsync if (DEBUG_DECODE() | DEBUG_TRACECALL() | DEBUG_BREAK() \
45e9809aff7304721fddb95654901b32195c9c7avboxsync if (DEBUG_TRACE() || DEBUG_DECODE()) X86EMU_trace_regs()
45e9809aff7304721fddb95654901b32195c9c7avboxsync# define SINGLE_STEP() if (DEBUG_STEP()) x86emu_single_step()
45e9809aff7304721fddb95654901b32195c9c7avboxsync# define END_OF_INSTR() EndOfTheInstructionProcedure: x86emu_end_instr();
45e9809aff7304721fddb95654901b32195c9c7avboxsync# define END_OF_INSTR_NO_TRACE() x86emu_end_instr();
45e9809aff7304721fddb95654901b32195c9c7avboxsync printk("%04x:%04x: CALL %s%04x:%04x\n", u , v, s, w, x);
45e9809aff7304721fddb95654901b32195c9c7avboxsync/*-------------------------- Function Prototypes --------------------------*/
45e9809aff7304721fddb95654901b32195c9c7avboxsyncextern void x86emu_inc_decoded_inst_len (int x);
45e9809aff7304721fddb95654901b32195c9c7avboxsyncextern void x86emu_decode_printf (char *x);
45e9809aff7304721fddb95654901b32195c9c7avboxsyncextern void x86emu_decode_printf2 (char *x, int y);
45e9809aff7304721fddb95654901b32195c9c7avboxsyncextern void x86emu_just_disassemble (void);
45e9809aff7304721fddb95654901b32195c9c7avboxsyncextern void x86emu_single_step (void);
45e9809aff7304721fddb95654901b32195c9c7avboxsyncextern void x86emu_end_instr (void);
45e9809aff7304721fddb95654901b32195c9c7avboxsyncextern void x86emu_dump_regs (void);
45e9809aff7304721fddb95654901b32195c9c7avboxsyncextern void x86emu_dump_xregs (void);
45e9809aff7304721fddb95654901b32195c9c7avboxsyncextern void x86emu_instrument_instruction (void);
45e9809aff7304721fddb95654901b32195c9c7avboxsyncextern void x86emu_check_ip_access (void);
45e9809aff7304721fddb95654901b32195c9c7avboxsyncextern void x86emu_check_sp_access (void);
45e9809aff7304721fddb95654901b32195c9c7avboxsyncextern void x86emu_check_data_access (uint s, uint o);
45e9809aff7304721fddb95654901b32195c9c7avboxsync} /* End of "C" linkage for C++ */
45e9809aff7304721fddb95654901b32195c9c7avboxsync#endif /* __X86EMU_DEBUG_H */