sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 1 | |
| 2 | /*--------------------------------------------------------------------*/ |
nethercote | 5a2664c | 2004-09-02 15:37:39 +0000 | [diff] [blame] | 3 | /*--- Asm-specific core stuff. core_asm.h ---*/ |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +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. |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 9 | |
njn | 5361242 | 2005-03-12 16:22:54 +0000 | [diff] [blame] | 10 | Copyright (C) 2000-2005 Julian Seward |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 11 | jseward@acm.org |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +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 | |
njn25 | e49d8e7 | 2002-09-23 09:36:25 +0000 | [diff] [blame] | 28 | The GNU General Public License is contained in the file COPYING. |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 29 | */ |
| 30 | |
nethercote | 5a2664c | 2004-09-02 15:37:39 +0000 | [diff] [blame] | 31 | #ifndef __CORE_ASM_H |
| 32 | #define __CORE_ASM_H |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 33 | |
nethercote | c06e213 | 2004-09-03 13:45:29 +0000 | [diff] [blame] | 34 | #include "tool_asm.h" // tool asm stuff |
| 35 | #include "core_arch_asm.h" // arch-specific asm stuff |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 36 | |
| 37 | /* This file is included in all Valgrind source files, including |
| 38 | assembly ones. */ |
| 39 | |
sewardj | 91f6278 | 2004-11-29 19:47:54 +0000 | [diff] [blame] | 40 | |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 41 | /* Constants for the fast translation lookup cache. */ |
sewardj | fa8ec11 | 2005-01-19 11:55:34 +0000 | [diff] [blame] | 42 | #define VG_TT_FAST_BITS 16 |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 43 | #define VG_TT_FAST_SIZE (1 << VG_TT_FAST_BITS) |
| 44 | #define VG_TT_FAST_MASK ((VG_TT_FAST_SIZE) - 1) |
| 45 | |
nethercote | 463c63c | 2004-10-26 11:18:32 +0000 | [diff] [blame] | 46 | // XXX: all this will go into x86/ eventually... |
fitzhardinge | 2757417 | 2004-01-26 21:11:51 +0000 | [diff] [blame] | 47 | /* |
| 48 | 0 - standard feature flags |
| 49 | 1 - Intel extended flags |
| 50 | 2 - Valgrind internal flags |
| 51 | 3 - AMD-specific flags |
| 52 | */ |
| 53 | #define VG_N_FEATURE_WORDS 4 |
fitzhardinge | 0df2ac2 | 2004-01-25 02:38:29 +0000 | [diff] [blame] | 54 | |
fitzhardinge | 2757417 | 2004-01-26 21:11:51 +0000 | [diff] [blame] | 55 | #define VG_X86_FEAT 0 |
| 56 | #define VG_EXT_FEAT 1 |
| 57 | #define VG_INT_FEAT 2 |
| 58 | #define VG_AMD_FEAT 3 |
| 59 | |
| 60 | /* CPU features (generic) */ |
| 61 | #define VG_X86_FEAT_FPU (VG_X86_FEAT*32 + 0) |
| 62 | #define VG_X86_FEAT_VME (VG_X86_FEAT*32 + 1) |
| 63 | #define VG_X86_FEAT_DE (VG_X86_FEAT*32 + 2) |
| 64 | #define VG_X86_FEAT_PSE (VG_X86_FEAT*32 + 3) |
| 65 | #define VG_X86_FEAT_TSC (VG_X86_FEAT*32 + 4) |
| 66 | #define VG_X86_FEAT_MSR (VG_X86_FEAT*32 + 5) |
| 67 | #define VG_X86_FEAT_PAE (VG_X86_FEAT*32 + 6) |
| 68 | #define VG_X86_FEAT_MCE (VG_X86_FEAT*32 + 7) |
| 69 | #define VG_X86_FEAT_CX8 (VG_X86_FEAT*32 + 8) |
| 70 | #define VG_X86_FEAT_APIC (VG_X86_FEAT*32 + 9) |
| 71 | #define VG_X86_FEAT_SEP (VG_X86_FEAT*32 + 11) |
| 72 | #define VG_X86_FEAT_MTRR (VG_X86_FEAT*32 + 12) |
| 73 | #define VG_X86_FEAT_PGE (VG_X86_FEAT*32 + 13) |
| 74 | #define VG_X86_FEAT_MCA (VG_X86_FEAT*32 + 14) |
| 75 | #define VG_X86_FEAT_CMOV (VG_X86_FEAT*32 + 15) |
| 76 | #define VG_X86_FEAT_PAT (VG_X86_FEAT*32 + 16) |
| 77 | #define VG_X86_FEAT_PSE36 (VG_X86_FEAT*32 + 17) |
| 78 | #define VG_X86_FEAT_CLFSH (VG_X86_FEAT*32 + 19) |
| 79 | #define VG_X86_FEAT_DS (VG_X86_FEAT*32 + 21) |
| 80 | #define VG_X86_FEAT_ACPI (VG_X86_FEAT*32 + 22) |
| 81 | #define VG_X86_FEAT_MMX (VG_X86_FEAT*32 + 23) |
| 82 | #define VG_X86_FEAT_FXSR (VG_X86_FEAT*32 + 24) |
| 83 | #define VG_X86_FEAT_SSE (VG_X86_FEAT*32 + 25) |
| 84 | #define VG_X86_FEAT_SSE2 (VG_X86_FEAT*32 + 26) |
| 85 | #define VG_X86_FEAT_SS (VG_X86_FEAT*32 + 27) |
| 86 | #define VG_X86_FEAT_HT (VG_X86_FEAT*32 + 28) |
| 87 | #define VG_X86_FEAT_TM (VG_X86_FEAT*32 + 29) |
| 88 | #define VG_X86_FEAT_IA64 (VG_X86_FEAT*32 + 30) |
| 89 | #define VG_X86_FEAT_PBE (VG_X86_FEAT*32 + 31) |
| 90 | |
| 91 | /* Intel extended feature word */ |
| 92 | #define VG_X86_FEAT_SSE3 (VG_EXT_FEAT*32 + 0) |
| 93 | #define VG_X86_FEAT_MON (VG_EXT_FEAT*32 + 3) |
| 94 | #define VG_X86_FEAT_DSCPL (VG_EXT_FEAT*32 + 4) |
| 95 | #define VG_X86_FEAT_EST (VG_EXT_FEAT*32 + 7) |
| 96 | #define VG_X86_FEAT_TM2 (VG_EXT_FEAT*32 + 8) |
| 97 | #define VG_X86_FEAT_CNXTID (VG_EXT_FEAT*32 + 10) |
fitzhardinge | 0df2ac2 | 2004-01-25 02:38:29 +0000 | [diff] [blame] | 98 | |
| 99 | /* Used internally to mark whether CPUID is even implemented */ |
fitzhardinge | 2757417 | 2004-01-26 21:11:51 +0000 | [diff] [blame] | 100 | #define VG_X86_FEAT_CPUID (VG_INT_FEAT*32 + 0) |
fitzhardinge | 0df2ac2 | 2004-01-25 02:38:29 +0000 | [diff] [blame] | 101 | |
fitzhardinge | 2757417 | 2004-01-26 21:11:51 +0000 | [diff] [blame] | 102 | /* AMD special features */ |
| 103 | #define VG_AMD_FEAT_SYSCALL (VG_AMD_FEAT*32 + 11) |
| 104 | #define VG_AMD_FEAT_NXP (VG_AMD_FEAT*32 + 20) |
| 105 | #define VG_AMD_FEAT_MMXEXT (VG_AMD_FEAT*32 + 22) |
| 106 | #define VG_AMD_FEAT_FFXSR (VG_AMD_FEAT*32 + 25) |
| 107 | #define VG_AMD_FEAT_LONGMODE (VG_AMD_FEAT*32 + 29) |
| 108 | #define VG_AMD_FEAT_3DNOWEXT (VG_AMD_FEAT*32 + 30) |
| 109 | #define VG_AMD_FEAT_3DNOW (VG_AMD_FEAT*32 + 31) |
| 110 | |
nethercote | 463c63c | 2004-10-26 11:18:32 +0000 | [diff] [blame] | 111 | #endif /* __CORE_ASM_H */ |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 112 | |
| 113 | /*--------------------------------------------------------------------*/ |
nethercote | 5a2664c | 2004-09-02 15:37:39 +0000 | [diff] [blame] | 114 | /*--- end ---*/ |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 115 | /*--------------------------------------------------------------------*/ |