njn | ca0518d | 2004-11-26 19:34:36 +0000 | [diff] [blame] | 1 | |
| 2 | /*--------------------------------------------------------------------*/ |
njn | c616819 | 2004-11-29 13:54:10 +0000 | [diff] [blame] | 3 | /*--- Arch-specific stuff for the core. arm/core_arch.h ---*/ |
njn | ca0518d | 2004-11-26 19:34:36 +0000 | [diff] [blame] | 4 | /*--------------------------------------------------------------------*/ |
| 5 | |
| 6 | /* |
njn | b9c427c | 2004-12-01 14:14:42 +0000 | [diff] [blame] | 7 | This file is part of Valgrind, a dynamic binary instrumentation |
| 8 | framework. |
njn | ca0518d | 2004-11-26 19:34:36 +0000 | [diff] [blame] | 9 | |
njn | 5361242 | 2005-03-12 16:22:54 +0000 | [diff] [blame] | 10 | Copyright (C) 2000-2005 Nicholas Nethercote |
njn | 2bc1012 | 2005-05-08 02:10:27 +0000 | [diff] [blame] | 11 | njn@valgrind.org |
njn | ca0518d | 2004-11-26 19:34:36 +0000 | [diff] [blame] | 12 | |
| 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 | /* --------------------------------------------------------------------- |
njn | 09aa128 | 2004-11-30 23:39:13 +0000 | [diff] [blame] | 41 | Basic properties |
| 42 | ------------------------------------------------------------------ */ |
| 43 | |
njn | 35172bc | 2005-03-26 00:04:03 +0000 | [diff] [blame] | 44 | #define VGA_ELF_ENDIANNESS ELFDATA2LSB |
| 45 | #define VGA_ELF_MACHINE EM_ARM |
| 46 | #define VGA_ELF_CLASS ELFCLASS32 |
njn | 09aa128 | 2004-11-30 23:39:13 +0000 | [diff] [blame] | 47 | |
njn | 09aa128 | 2004-11-30 23:39:13 +0000 | [diff] [blame] | 48 | /* --------------------------------------------------------------------- |
njn | ca0518d | 2004-11-26 19:34:36 +0000 | [diff] [blame] | 49 | Interesting registers |
| 50 | ------------------------------------------------------------------ */ |
| 51 | // Vex field names |
njn | daf5a36 | 2004-11-27 13:42:42 +0000 | [diff] [blame] | 52 | // XXX: Not sure, but I think: |
njn | ca0518d | 2004-11-26 19:34:36 +0000 | [diff] [blame] | 53 | // r11 = frame pointer |
njn | daf5a36 | 2004-11-27 13:42:42 +0000 | [diff] [blame] | 54 | // r12 = "implicit parameter" (neither caller-save, nor callee-save) |
njn | ca0518d | 2004-11-26 19:34:36 +0000 | [diff] [blame] | 55 | // r13 = stack pointer |
| 56 | // r14 = link register |
| 57 | // r15 = program counter |
njn | 35172bc | 2005-03-26 00:04:03 +0000 | [diff] [blame] | 58 | #define VGA_INSTR_PTR guest_R15 |
| 59 | #define VGA_STACK_PTR guest_R13 |
| 60 | #define VGA_FRAME_PTR guest_R11 |
njn | ca0518d | 2004-11-26 19:34:36 +0000 | [diff] [blame] | 61 | |
njn | 35172bc | 2005-03-26 00:04:03 +0000 | [diff] [blame] | 62 | #define VGA_CLREQ_ARGS guest_R0 |
| 63 | #define VGA_CLREQ_RET guest_R0 |
njn | ca0518d | 2004-11-26 19:34:36 +0000 | [diff] [blame] | 64 | |
njn | ca0518d | 2004-11-26 19:34:36 +0000 | [diff] [blame] | 65 | // Get stack pointer and frame pointer |
njn | db9b773 | 2005-03-26 00:32:29 +0000 | [diff] [blame] | 66 | #define VGA_GET_REAL_STACK_PTR(esp) do { \ |
njn | ca0518d | 2004-11-26 19:34:36 +0000 | [diff] [blame] | 67 | I_die_here; \ |
| 68 | } while (0) |
| 69 | |
njn | db9b773 | 2005-03-26 00:32:29 +0000 | [diff] [blame] | 70 | #define VGA_GET_REAL_FRAME_PTR(ebp) do { \ |
njn | ca0518d | 2004-11-26 19:34:36 +0000 | [diff] [blame] | 71 | I_die_here; \ |
| 72 | } while (0) |
| 73 | |
njn | ca0518d | 2004-11-26 19:34:36 +0000 | [diff] [blame] | 74 | /* --------------------------------------------------------------------- |
njn | ca0518d | 2004-11-26 19:34:36 +0000 | [diff] [blame] | 75 | 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... ?? |
| 81 | typedef 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 | } |
| 91 | ThreadArchState; |
| 92 | |
| 93 | typedef VexGuestARMState VexGuestArchState; |
| 94 | |
| 95 | /* --------------------------------------------------------------------- |
njn | ca0518d | 2004-11-26 19:34:36 +0000 | [diff] [blame] | 96 | Miscellaneous constants |
| 97 | ------------------------------------------------------------------ */ |
| 98 | |
njn | ca0518d | 2004-11-26 19:34:36 +0000 | [diff] [blame] | 99 | #endif // __ARM_CORE_ARCH_H |
| 100 | |
| 101 | /*--------------------------------------------------------------------*/ |
| 102 | /*--- end ---*/ |
| 103 | /*--------------------------------------------------------------------*/ |