blob: 0f7ddae314269a8778b39e737cead855f4064167 [file] [log] [blame]
nethercotec06e2132004-09-03 13:45:29 +00001
2/*--------------------------------------------------------------------*/
njnc6168192004-11-29 13:54:10 +00003/*--- Arch-specific stuff for the core. x86/core_arch.h ---*/
nethercotec06e2132004-09-03 13:45:29 +00004/*--------------------------------------------------------------------*/
5
6/*
njnb9c427c2004-12-01 14:14:42 +00007 This file is part of Valgrind, a dynamic binary instrumentation
8 framework.
nethercotec06e2132004-09-03 13:45:29 +00009
njn53612422005-03-12 16:22:54 +000010 Copyright (C) 2000-2005 Nicholas Nethercote
njn2bc10122005-05-08 02:10:27 +000011 njn@valgrind.org
nethercotec06e2132004-09-03 13:45:29 +000012
13 This program is free software; you can redistribute it and/or
14 modify it under the terms of the GNU General Public License as
15 published by the Free Software Foundation; either version 2 of the
16 License, or (at your option) any later version.
17
18 This program is distributed in the hope that it will be useful, but
19 WITHOUT ANY WARRANTY; without even the implied warranty of
20 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
21 General Public License for more details.
22
23 You should have received a copy of the GNU General Public License
24 along with this program; if not, write to the Free Software
25 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
26 02111-1307, USA.
27
28 The GNU General Public License is contained in the file COPYING.
29*/
30
31#ifndef __X86_CORE_ARCH_H
32#define __X86_CORE_ARCH_H
33
34#include "core_arch_asm.h" // arch-specific asm stuff
35#include "tool_arch.h" // arch-specific tool stuff
36
sewardj8b635a42004-11-22 19:01:47 +000037#include "libvex_guest_x86.h"
38
njn09aa1282004-11-30 23:39:13 +000039/* ---------------------------------------------------------------------
40 Basic properties
41 ------------------------------------------------------------------ */
42
njn35172bc2005-03-26 00:04:03 +000043#define VGA_ELF_ENDIANNESS ELFDATA2LSB
44#define VGA_ELF_MACHINE EM_386
45#define VGA_ELF_CLASS ELFCLASS32
njn09aa1282004-11-30 23:39:13 +000046
nethercotec06e2132004-09-03 13:45:29 +000047/* ---------------------------------------------------------------------
nethercote86c5dcb2004-09-05 21:32:37 +000048 Interesting registers
49 ------------------------------------------------------------------ */
50
njncf45fd42004-11-24 16:30:22 +000051// Vex field names
njn35172bc2005-03-26 00:04:03 +000052#define VGA_INSTR_PTR guest_EIP
53#define VGA_STACK_PTR guest_ESP
54#define VGA_FRAME_PTR guest_EBP
sewardj8b635a42004-11-22 19:01:47 +000055
njn35172bc2005-03-26 00:04:03 +000056#define VGA_CLREQ_ARGS guest_EAX
57#define VGA_CLREQ_RET guest_EDX
sewardjb5f6f512005-03-10 23:59:00 +000058
sewardjb5f6f512005-03-10 23:59:00 +000059//extern const Char VG_(helper_wrapper_before)[]; /* in dispatch.S */
60//extern const Char VG_(helper_wrapper_return)[]; /* in dispatch.S */
61
62//extern const Char VG_(helper_undefined_instruction)[];
63//extern const Char VG_(helper_INT)[];
64//extern const Char VG_(helper_breakpoint)[];
65
66
nethercote2e05c332004-09-06 16:43:37 +000067/* ---------------------------------------------------------------------
sewardj2a99cf62004-11-24 10:44:19 +000068 Architecture-specific part of a ThreadState
nethercotec06e2132004-09-03 13:45:29 +000069 ------------------------------------------------------------------ */
70
sewardj2a99cf62004-11-24 10:44:19 +000071typedef
72 struct {
sewardj2a99cf62004-11-24 10:44:19 +000073 /* --- BEGIN vex-mandated guest state --- */
nethercotec06e2132004-09-03 13:45:29 +000074
sewardj2a99cf62004-11-24 10:44:19 +000075 /* Saved machine context. */
76 VexGuestX86State vex;
77
78 /* Saved shadow context. */
79 VexGuestX86State vex_shadow;
80
81 /* Spill area. */
82 UChar vex_spill[LibVEX_N_SPILL_BYTES];
83
84 /* --- END vex-mandated guest state --- */
85 }
86 ThreadArchState;
87
njncf45fd42004-11-24 16:30:22 +000088typedef VexGuestX86State VexGuestArchState;
nethercotec06e2132004-09-03 13:45:29 +000089
nethercote9b3c7652004-10-19 13:18:00 +000090/* ---------------------------------------------------------------------
nethercote25130642004-10-18 14:08:16 +000091 Miscellaneous constants
nethercoteb24cbc82004-09-03 23:25:33 +000092 ------------------------------------------------------------------ */
93
sewardjb5f6f512005-03-10 23:59:00 +000094// Valgrind's stack size, in words.
njn80950732005-03-26 00:18:45 +000095#define VGA_STACK_SIZE_W 16384
sewardjb5f6f512005-03-10 23:59:00 +000096
nethercotec06e2132004-09-03 13:45:29 +000097#endif // __X86_CORE_ARCH_H
98
99/*--------------------------------------------------------------------*/
100/*--- end ---*/
101/*--------------------------------------------------------------------*/