blob: b1b1b32e7d54e753034306aaf8928e8d5779fdbb [file] [log] [blame]
sewardjde4a1d02002-03-22 01:27:54 +00001
2/*--------------------------------------------------------------------*/
3/*--- A header file containing constants (for assembly code). ---*/
4/*--- vg_constants.h ---*/
5/*--------------------------------------------------------------------*/
6
7/*
8 This file is part of Valgrind, an x86 protected-mode emulator
9 designed for debugging and profiling binaries on x86-Unixes.
10
11 Copyright (C) 2000-2002 Julian Seward
12 jseward@acm.org
13 Julian_Seward@muraroa.demon.co.uk
14
15 This program is free software; you can redistribute it and/or
16 modify it under the terms of the GNU General Public License as
17 published by the Free Software Foundation; either version 2 of the
18 License, or (at your option) any later version.
19
20 This program is distributed in the hope that it will be useful, but
21 WITHOUT ANY WARRANTY; without even the implied warranty of
22 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
23 General Public License for more details.
24
25 You should have received a copy of the GNU General Public License
26 along with this program; if not, write to the Free Software
27 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
28 02111-1307, USA.
29
30 The GNU General Public License is contained in the file LICENSE.
31*/
32
33#ifndef __VG_CONSTANTS_H
34#define __VG_CONSTANTS_H
35
36
37/* This file is included in all Valgrind source files, including
38 assembly ones. */
39
40/* All symbols externally visible from valgrind.so are prefixed
41 as specified here. The prefix can be changed, so as to avoid
42 namespace conflict problems.
43*/
44#define VGAPPEND(str1,str2) str1##str2
45
46/* These macros should add different prefixes so the same base
47 name can safely be used across different macros. */
48#define VG_(str) VGAPPEND(vgPlain_,str)
49#define VGM_(str) VGAPPEND(vgMem_,str)
50#define VGP_(str) VGAPPEND(vgProf_,str)
51#define VGOFF_(str) VGAPPEND(vgOff_,str)
52
sewardjde4a1d02002-03-22 01:27:54 +000053
sewardj2e93c502002-04-12 11:12:52 +000054/* Magic values that %ebp might be set to when returning to the
sewardjde4a1d02002-03-22 01:27:54 +000055 dispatcher. The only other legitimate value is to point to the
sewardj2e93c502002-04-12 11:12:52 +000056 start of VG_(baseBlock). These also are return values from
57 VG_(run_innerloop) to the scheduler. */
58#define VG_TRC_EBP_JMP_SPECIAL 17
59#define VG_TRC_EBP_JMP_SYSCALL 19
60#define VG_TRC_EBP_JMP_CLIENTREQ 23
61
62#define VG_TRC_INNER_COUNTERZERO 29 /* ebp can't have this; sched return only */
63#define VG_TRC_INNER_FASTMISS 31 /* ditto. Means fast-cache miss. */
64#define VG_TRC_UNRESUMABLE_SIGNAL 37 /* ditto; got sigsegv/sigbus */
sewardjde4a1d02002-03-22 01:27:54 +000065
66/* Debugging hack for assembly code ... sigh. */
67#if 0
68#define OYNK(nnn) pushal; pushl $nnn; call VG_(oynk) ; addl $4,%esp; popal
69#else
70#define OYNK(nnn)
71#endif
72
sewardj2e93c502002-04-12 11:12:52 +000073#if 0
sewardjde4a1d02002-03-22 01:27:54 +000074#define OYNNK(nnn) pushal; pushl $nnn; call VG_(oynk) ; addl $4,%esp; popal
75#else
76#define OYNNK(nnn)
77#endif
78
sewardj2e93c502002-04-12 11:12:52 +000079
sewardjde4a1d02002-03-22 01:27:54 +000080/* Constants for the fast translation lookup cache. */
81#define VG_TT_FAST_BITS 15
82#define VG_TT_FAST_SIZE (1 << VG_TT_FAST_BITS)
83#define VG_TT_FAST_MASK ((VG_TT_FAST_SIZE) - 1)
84
85/* Constants for the fast original-code-write check cache. */
86
sewardj2e93c502002-04-12 11:12:52 +000087
sewardjde4a1d02002-03-22 01:27:54 +000088/* Usually you want this to be zero. */
89#define VG_SMC_FASTCHECK_IN_C 0
90
91#define VG_SMC_CACHE_BITS 19
92#define VG_SMC_CACHE_SIZE (1 << VG_SMC_CACHE_BITS)
93#define VG_SMC_CACHE_MASK ((VG_SMC_CACHE_SIZE) - 1)
94
95#define VG_SMC_CACHE_SHIFT 6
96
97
98#endif /* ndef __VG_INCLUDE_H */
99
100/*--------------------------------------------------------------------*/
101/*--- end vg_constants.h ---*/
102/*--------------------------------------------------------------------*/