dyngen-exec.h 2.0 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
/*
 *  dyngen defines for micro operation code
 *
 *  Copyright (c) 2003 Fabrice Bellard
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
17
 * License along with this library; if not, see <http://www.gnu.org/licenses/>.
18
 */
19 20 21
#if !defined(__DYNGEN_EXEC_H__)
#define __DYNGEN_EXEC_H__

22 23 24 25 26 27
#if defined(CONFIG_TCG_INTERPRETER)
/* The TCG interpreter does not need a special register AREG0,
 * but it is possible to use one by defining AREG0.
 * On i386, register edi seems to work. */
/* Run without special register AREG0 or use a value defined elsewhere. */
#elif defined(__i386__)
28
#define AREG0 "ebp"
29
#elif defined(__x86_64__)
30
#define AREG0 "r14"
M
malc 已提交
31
#elif defined(_ARCH_PPC)
32
#define AREG0 "r27"
33
#elif defined(__arm__)
34
#define AREG0 "r6"
A
aurel32 已提交
35 36
#elif defined(__hppa__)
#define AREG0 "r17"
37
#elif defined(__mips__)
38
#define AREG0 "s0"
39
#elif defined(__sparc__)
40
#ifdef CONFIG_SOLARIS
B
bellard 已提交
41 42
#define AREG0 "g2"
#else
B
bellard 已提交
43
#ifdef __sparc_v9__
44
#define AREG0 "g5"
B
bellard 已提交
45
#else
46
#define AREG0 "g6"
B
bellard 已提交
47
#endif
B
bellard 已提交
48
#endif
49
#elif defined(__s390__)
50
#define AREG0 "r10"
51
#elif defined(__alpha__)
52 53 54
/* Note $15 is the frame pointer, so anything in op-i386.c that would
   require a frame pointer, like alloca, would probably loose.  */
#define AREG0 "$15"
55
#elif defined(__mc68000)
B
bellard 已提交
56
#define AREG0 "%a5"
57
#elif defined(__ia64__)
B
bellard 已提交
58
#define AREG0 "r7"
59 60
#else
#error unsupported CPU
61 62
#endif

63
#if defined(AREG0)
64
register CPUArchState *env asm(AREG0);
65 66
#else
/* TODO: Try env = cpu_single_env. */
67
extern CPUArchState *env;
68
#endif
B
Blue Swirl 已提交
69

70
#endif /* !defined(__DYNGEN_EXEC_H__) */