Statistics
| Branch: | Revision:

root / dyngen-exec.h @ e3e87df4

History | View | Annotate | Download (2 kB)

1 79638566 bellard
/*
2 79638566 bellard
 *  dyngen defines for micro operation code
3 79638566 bellard
 *
4 79638566 bellard
 *  Copyright (c) 2003 Fabrice Bellard
5 79638566 bellard
 *
6 79638566 bellard
 * This library is free software; you can redistribute it and/or
7 79638566 bellard
 * modify it under the terms of the GNU Lesser General Public
8 79638566 bellard
 * License as published by the Free Software Foundation; either
9 79638566 bellard
 * version 2 of the License, or (at your option) any later version.
10 79638566 bellard
 *
11 79638566 bellard
 * This library is distributed in the hope that it will be useful,
12 79638566 bellard
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 79638566 bellard
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14 79638566 bellard
 * Lesser General Public License for more details.
15 79638566 bellard
 *
16 79638566 bellard
 * You should have received a copy of the GNU Lesser General Public
17 8167ee88 Blue Swirl
 * License along with this library; if not, see <http://www.gnu.org/licenses/>.
18 79638566 bellard
 */
19 67867308 bellard
#if !defined(__DYNGEN_EXEC_H__)
20 67867308 bellard
#define __DYNGEN_EXEC_H__
21 67867308 bellard
22 7316329a Stefan Weil
#if defined(CONFIG_TCG_INTERPRETER)
23 7316329a Stefan Weil
/* The TCG interpreter does not need a special register AREG0,
24 7316329a Stefan Weil
 * but it is possible to use one by defining AREG0.
25 7316329a Stefan Weil
 * On i386, register edi seems to work. */
26 7316329a Stefan Weil
/* Run without special register AREG0 or use a value defined elsewhere. */
27 7316329a Stefan Weil
#elif defined(__i386__)
28 79638566 bellard
#define AREG0 "ebp"
29 522777bb ths
#elif defined(__x86_64__)
30 43024c6a ths
#define AREG0 "r14"
31 e58ffeb3 malc
#elif defined(_ARCH_PPC)
32 79638566 bellard
#define AREG0 "r27"
33 522777bb ths
#elif defined(__arm__)
34 05b922dd Peter Maydell
#define AREG0 "r6"
35 f54b3f92 aurel32
#elif defined(__hppa__)
36 f54b3f92 aurel32
#define AREG0 "r17"
37 522777bb ths
#elif defined(__mips__)
38 60bf84cf Stefan Weil
#define AREG0 "s0"
39 522777bb ths
#elif defined(__sparc__)
40 dfe5fff3 Juan Quintela
#ifdef CONFIG_SOLARIS
41 fdbb4691 bellard
#define AREG0 "g2"
42 fdbb4691 bellard
#else
43 74ccb34e bellard
#ifdef __sparc_v9__
44 e97b640d blueswir1
#define AREG0 "g5"
45 74ccb34e bellard
#else
46 79638566 bellard
#define AREG0 "g6"
47 fdbb4691 bellard
#endif
48 74ccb34e bellard
#endif
49 522777bb ths
#elif defined(__s390__)
50 79638566 bellard
#define AREG0 "r10"
51 522777bb ths
#elif defined(__alpha__)
52 79638566 bellard
/* Note $15 is the frame pointer, so anything in op-i386.c that would
53 79638566 bellard
   require a frame pointer, like alloca, would probably loose.  */
54 79638566 bellard
#define AREG0 "$15"
55 522777bb ths
#elif defined(__mc68000)
56 38e584a0 bellard
#define AREG0 "%a5"
57 522777bb ths
#elif defined(__ia64__)
58 b8076a74 bellard
#define AREG0 "r7"
59 522777bb ths
#else
60 522777bb ths
#error unsupported CPU
61 79638566 bellard
#endif
62 79638566 bellard
63 7316329a Stefan Weil
#if defined(AREG0)
64 9349b4f9 Andreas Färber
register CPUArchState *env asm(AREG0);
65 7316329a Stefan Weil
#else
66 7316329a Stefan Weil
/* TODO: Try env = cpu_single_env. */
67 9349b4f9 Andreas Färber
extern CPUArchState *env;
68 7316329a Stefan Weil
#endif
69 3e457172 Blue Swirl
70 67867308 bellard
#endif /* !defined(__DYNGEN_EXEC_H__) */