blob: d95fd755d8227e8a785680d0a8f142c686838b69 [file] [log] [blame]
njnca0518d2004-11-26 19:34:36 +00001
2/*--------------------------------------------------------------------*/
njnc6168192004-11-29 13:54:10 +00003/*--- Arch-specific stuff for the core. arm/core_arch.h ---*/
njnca0518d2004-11-26 19:34:36 +00004/*--------------------------------------------------------------------*/
5
6/*
njnb9c427c2004-12-01 14:14:42 +00007 This file is part of Valgrind, a dynamic binary instrumentation
8 framework.
njnca0518d2004-11-26 19:34:36 +00009
njn53612422005-03-12 16:22:54 +000010 Copyright (C) 2000-2005 Nicholas Nethercote
njn2bc10122005-05-08 02:10:27 +000011 njn@valgrind.org
njnca0518d2004-11-26 19:34:36 +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 __ARM_CORE_ARCH_H
32#define __ARM_CORE_ARCH_H
33
34#include "core_arch_asm.h" // arch-specific asm stuff
35#include "tool_arch.h" // arch-specific tool stuff
36
37#include "libvex_guest_arm.h"
38
39
40/* ---------------------------------------------------------------------
njn09aa1282004-11-30 23:39:13 +000041 Basic properties
42 ------------------------------------------------------------------ */
43
njn35172bc2005-03-26 00:04:03 +000044#define VGA_ELF_ENDIANNESS ELFDATA2LSB
45#define VGA_ELF_MACHINE EM_ARM
46#define VGA_ELF_CLASS ELFCLASS32
njn09aa1282004-11-30 23:39:13 +000047
njn09aa1282004-11-30 23:39:13 +000048/* ---------------------------------------------------------------------
njnca0518d2004-11-26 19:34:36 +000049 Interesting registers
50 ------------------------------------------------------------------ */
51// Vex field names
njndaf5a362004-11-27 13:42:42 +000052// XXX: Not sure, but I think:
njnca0518d2004-11-26 19:34:36 +000053// r11 = frame pointer
njndaf5a362004-11-27 13:42:42 +000054// r12 = "implicit parameter" (neither caller-save, nor callee-save)
njnca0518d2004-11-26 19:34:36 +000055// r13 = stack pointer
56// r14 = link register
57// r15 = program counter
njn35172bc2005-03-26 00:04:03 +000058#define VGA_INSTR_PTR guest_R15
59#define VGA_STACK_PTR guest_R13
60#define VGA_FRAME_PTR guest_R11
njnca0518d2004-11-26 19:34:36 +000061
njn35172bc2005-03-26 00:04:03 +000062#define VGA_CLREQ_ARGS guest_R0
63#define VGA_CLREQ_RET guest_R0
njnca0518d2004-11-26 19:34:36 +000064
njnca0518d2004-11-26 19:34:36 +000065// Get stack pointer and frame pointer
njndb9b7732005-03-26 00:32:29 +000066#define VGA_GET_REAL_STACK_PTR(esp) do { \
njnca0518d2004-11-26 19:34:36 +000067 I_die_here; \
68} while (0)
69
njndb9b7732005-03-26 00:32:29 +000070#define VGA_GET_REAL_FRAME_PTR(ebp) do { \
njnca0518d2004-11-26 19:34:36 +000071 I_die_here; \
72} while (0)
73
njnca0518d2004-11-26 19:34:36 +000074/* ---------------------------------------------------------------------
njnca0518d2004-11-26 19:34:36 +000075 Architecture-specific part of a ThreadState
76 ------------------------------------------------------------------ */
77
78// Architecture-specific part of a ThreadState
79// XXX: eventually this should be made abstract, ie. the fields not visible
80// to the core... ??
81typedef struct {
82 /* Saved machine context. */
83 VexGuestARMState vex;
84
85 /* Saved shadow context. */
86 VexGuestARMState vex_shadow;
87
88 /* Spill area. */
89 UChar vex_spill[LibVEX_N_SPILL_BYTES];
90}
91ThreadArchState;
92
93typedef VexGuestARMState VexGuestArchState;
94
95/* ---------------------------------------------------------------------
njnca0518d2004-11-26 19:34:36 +000096 Miscellaneous constants
97 ------------------------------------------------------------------ */
98
njnca0518d2004-11-26 19:34:36 +000099#endif // __ARM_CORE_ARCH_H
100
101/*--------------------------------------------------------------------*/
102/*--- end ---*/
103/*--------------------------------------------------------------------*/