blob: abf72402ef3cc136cd62c4cd0ac2a6fc20dc3dc1 [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
sewardjde4a1d02002-03-22 01:27:54 +000013
14 This program is free software; you can redistribute it and/or
15 modify it under the terms of the GNU General Public License as
16 published by the Free Software Foundation; either version 2 of the
17 License, or (at your option) any later version.
18
19 This program is distributed in the hope that it will be useful, but
20 WITHOUT ANY WARRANTY; without even the implied warranty of
21 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
22 General Public License for more details.
23
24 You should have received a copy of the GNU General Public License
25 along with this program; if not, write to the Free Software
26 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
27 02111-1307, USA.
28
njn25e49d8e72002-09-23 09:36:25 +000029 The GNU General Public License is contained in the file COPYING.
sewardjde4a1d02002-03-22 01:27:54 +000030*/
31
32#ifndef __VG_CONSTANTS_H
33#define __VG_CONSTANTS_H
34
njn25e49d8e72002-09-23 09:36:25 +000035#include "vg_constants_skin.h"
sewardjde4a1d02002-03-22 01:27:54 +000036
37/* This file is included in all Valgrind source files, including
38 assembly ones. */
39
sewardj2e93c502002-04-12 11:12:52 +000040/* Magic values that %ebp might be set to when returning to the
sewardjde4a1d02002-03-22 01:27:54 +000041 dispatcher. The only other legitimate value is to point to the
sewardj2e93c502002-04-12 11:12:52 +000042 start of VG_(baseBlock). These also are return values from
sewardj54cacf02002-04-12 23:24:59 +000043 VG_(run_innerloop) to the scheduler.
sewardj2e93c502002-04-12 11:12:52 +000044
sewardj54cacf02002-04-12 23:24:59 +000045 EBP means %ebp can legitimately have this value when a basic block
46 returns to the dispatch loop. TRC means that this value is a valid
47 thread return code, which the dispatch loop may return to the
48 scheduler. */
sewardj54cacf02002-04-12 23:24:59 +000049#define VG_TRC_EBP_JMP_SYSCALL 19 /* EBP and TRC */
50#define VG_TRC_EBP_JMP_CLIENTREQ 23 /* EBP and TRC */
51
njn25e49d8e72002-09-23 09:36:25 +000052#define VG_TRC_INNER_FASTMISS 31 /* TRC only; means fast-cache miss. */
53#define VG_TRC_INNER_COUNTERZERO 29 /* TRC only; means bb ctr == 0 */
54#define VG_TRC_UNRESUMABLE_SIGNAL 37 /* TRC only; got sigsegv/sigbus */
sewardj54cacf02002-04-12 23:24:59 +000055
sewardjde4a1d02002-03-22 01:27:54 +000056
57/* Debugging hack for assembly code ... sigh. */
58#if 0
59#define OYNK(nnn) pushal; pushl $nnn; call VG_(oynk) ; addl $4,%esp; popal
60#else
61#define OYNK(nnn)
62#endif
63
sewardj2e93c502002-04-12 11:12:52 +000064#if 0
sewardjde4a1d02002-03-22 01:27:54 +000065#define OYNNK(nnn) pushal; pushl $nnn; call VG_(oynk) ; addl $4,%esp; popal
66#else
67#define OYNNK(nnn)
68#endif
69
sewardj2e93c502002-04-12 11:12:52 +000070
sewardjde4a1d02002-03-22 01:27:54 +000071/* Constants for the fast translation lookup cache. */
72#define VG_TT_FAST_BITS 15
73#define VG_TT_FAST_SIZE (1 << VG_TT_FAST_BITS)
74#define VG_TT_FAST_MASK ((VG_TT_FAST_SIZE) - 1)
75
76/* Constants for the fast original-code-write check cache. */
77
sewardj2e93c502002-04-12 11:12:52 +000078
sewardj20917d82002-05-28 01:36:45 +000079/* Assembly code stubs make this request */
sewardj54cacf02002-04-12 23:24:59 +000080#define VG_USERREQ__SIGNAL_RETURNS 0x4001
sewardj54cacf02002-04-12 23:24:59 +000081
njn25e49d8e72002-09-23 09:36:25 +000082#endif /* ndef __VG_CONSTANTS_H */
sewardjde4a1d02002-03-22 01:27:54 +000083
84/*--------------------------------------------------------------------*/
85/*--- end vg_constants.h ---*/
86/*--------------------------------------------------------------------*/