blob: 083e20bed789fd45831cbb9aef8ef306609231f0 [file] [log] [blame]
bellard79638562003-06-15 19:46:57 +00001/*
2 * dyngen defines for micro operation code
3 *
4 * Copyright (c) 2003 Fabrice Bellard
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version.
10 *
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
Blue Swirl8167ee82009-07-16 20:47:01 +000017 * License along with this library; if not, see <http://www.gnu.org/licenses/>.
bellard79638562003-06-15 19:46:57 +000018 */
bellard67867302003-11-23 17:05:30 +000019#if !defined(__DYNGEN_EXEC_H__)
20#define __DYNGEN_EXEC_H__
21
Stefan Weil73163292011-10-05 20:03:02 +020022#if defined(CONFIG_TCG_INTERPRETER)
23/* The TCG interpreter does not need a special register AREG0,
24 * but it is possible to use one by defining AREG0.
25 * On i386, register edi seems to work. */
26/* Run without special register AREG0 or use a value defined elsewhere. */
27#elif defined(__i386__)
bellard79638562003-06-15 19:46:57 +000028#define AREG0 "ebp"
ths522777b2007-05-08 23:30:44 +000029#elif defined(__x86_64__)
ths43024c62007-02-10 18:21:04 +000030#define AREG0 "r14"
malce58ffeb2009-01-14 18:39:49 +000031#elif defined(_ARCH_PPC)
bellard79638562003-06-15 19:46:57 +000032#define AREG0 "r27"
ths522777b2007-05-08 23:30:44 +000033#elif defined(__arm__)
Peter Maydell05b922d2011-12-26 00:02:18 +000034#define AREG0 "r6"
aurel32f54b3f92008-04-12 20:14:54 +000035#elif defined(__hppa__)
36#define AREG0 "r17"
ths522777b2007-05-08 23:30:44 +000037#elif defined(__mips__)
Stefan Weil60bf84c2010-04-09 17:28:40 +020038#define AREG0 "s0"
ths522777b2007-05-08 23:30:44 +000039#elif defined(__sparc__)
Juan Quinteladfe5fff2009-07-27 16:12:40 +020040#ifdef CONFIG_SOLARIS
bellardfdbb4692006-06-14 17:32:25 +000041#define AREG0 "g2"
bellardfdbb4692006-06-14 17:32:25 +000042#else
bellard74ccb342006-07-18 21:23:34 +000043#ifdef __sparc_v9__
blueswir1e97b6402008-07-26 17:19:35 +000044#define AREG0 "g5"
bellard74ccb342006-07-18 21:23:34 +000045#else
bellard79638562003-06-15 19:46:57 +000046#define AREG0 "g6"
bellardfdbb4692006-06-14 17:32:25 +000047#endif
bellard74ccb342006-07-18 21:23:34 +000048#endif
ths522777b2007-05-08 23:30:44 +000049#elif defined(__s390__)
bellard79638562003-06-15 19:46:57 +000050#define AREG0 "r10"
ths522777b2007-05-08 23:30:44 +000051#elif defined(__alpha__)
bellard79638562003-06-15 19:46:57 +000052/* Note $15 is the frame pointer, so anything in op-i386.c that would
53 require a frame pointer, like alloca, would probably loose. */
54#define AREG0 "$15"
ths522777b2007-05-08 23:30:44 +000055#elif defined(__mc68000)
bellard38e584a2003-08-10 22:14:22 +000056#define AREG0 "%a5"
ths522777b2007-05-08 23:30:44 +000057#elif defined(__ia64__)
bellardb8076a72005-04-07 22:20:31 +000058#define AREG0 "r7"
ths522777b2007-05-08 23:30:44 +000059#else
60#error unsupported CPU
bellard79638562003-06-15 19:46:57 +000061#endif
62
Stefan Weil73163292011-10-05 20:03:02 +020063#if defined(AREG0)
Andreas Färber9349b4f2012-03-14 01:38:32 +010064register CPUArchState *env asm(AREG0);
Stefan Weil73163292011-10-05 20:03:02 +020065#else
66/* TODO: Try env = cpu_single_env. */
Andreas Färber9349b4f2012-03-14 01:38:32 +010067extern CPUArchState *env;
Stefan Weil73163292011-10-05 20:03:02 +020068#endif
Blue Swirl3e457172011-07-13 12:44:15 +000069
bellard67867302003-11-23 17:05:30 +000070#endif /* !defined(__DYNGEN_EXEC_H__) */