dyngen-exec.h 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. /*
  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
  17. * License along with this library; if not, see <http://www.gnu.org/licenses/>.
  18. */
  19. #if !defined(__DYNGEN_EXEC_H__)
  20. #define __DYNGEN_EXEC_H__
  21. #if defined(CONFIG_TCG_INTERPRETER)
  22. /* The TCG interpreter does not need a special register AREG0,
  23. * but it is possible to use one by defining AREG0.
  24. * On i386, register edi seems to work. */
  25. /* Run without special register AREG0 or use a value defined elsewhere. */
  26. #elif defined(__i386__)
  27. #define AREG0 "ebp"
  28. #elif defined(__x86_64__)
  29. #define AREG0 "r14"
  30. #elif defined(_ARCH_PPC)
  31. #define AREG0 "r27"
  32. #elif defined(__arm__)
  33. #define AREG0 "r7"
  34. #elif defined(__hppa__)
  35. #define AREG0 "r17"
  36. #elif defined(__mips__)
  37. #define AREG0 "s0"
  38. #elif defined(__sparc__)
  39. #ifdef CONFIG_SOLARIS
  40. #define AREG0 "g2"
  41. #else
  42. #ifdef __sparc_v9__
  43. #define AREG0 "g5"
  44. #else
  45. #define AREG0 "g6"
  46. #endif
  47. #endif
  48. #elif defined(__s390__)
  49. #define AREG0 "r10"
  50. #elif defined(__alpha__)
  51. /* Note $15 is the frame pointer, so anything in op-i386.c that would
  52. require a frame pointer, like alloca, would probably loose. */
  53. #define AREG0 "$15"
  54. #elif defined(__mc68000)
  55. #define AREG0 "%a5"
  56. #elif defined(__ia64__)
  57. #define AREG0 "r7"
  58. #else
  59. #error unsupported CPU
  60. #endif
  61. #if defined(AREG0)
  62. register CPUState *env asm(AREG0);
  63. #else
  64. /* TODO: Try env = cpu_single_env. */
  65. extern CPUState *env;
  66. #endif
  67. #endif /* !defined(__DYNGEN_EXEC_H__) */