OpenSDE Packages Database (without history before r20070)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

95 lines
3.6 KiB

  1. # --- SDE-COPYRIGHT-NOTE-BEGIN ---
  2. # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
  3. #
  4. # Filename: package/.../qemu/qemu-0.9.0-x86_64-opts.patch
  5. # Copyright (C) 2007 The OpenSDE Project
  6. #
  7. # More information can be found in the files COPYING and README.
  8. #
  9. # This patch file is dual-licensed. It is available under the license the
  10. # patched project is licensed under, as long as it is an OpenSource license
  11. # as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
  12. # of the GNU General Public License as published by the Free Software
  13. # Foundation; either version 2 of the License, or (at your option) any later
  14. # version.
  15. # --- SDE-COPYRIGHT-NOTE-END ---
  16. 2007-04-12 rediffed for qemu 0.9.0
  17. 2007-02-03 Gwenole Beauchesne <gbeauchesne@mandriva.com>
  18. * dyngen-exec.h (AREG4, AREG5): Enable when building with GCC4.
  19. 2005-06-04 Gwenole Beauchesne <gbeauchesne@mandriva.com>
  20. * Add direct jump support to x86-64.
  21. diff -ruN qemu-0.9.0/dyngen-exec.h qemu-0.9.0-x86_64-opts/dyngen-exec.h
  22. --- qemu-0.9.0/dyngen-exec.h 2007-02-06 00:01:54.000000000 +0100
  23. +++ qemu-0.9.0-x86_64-opts/dyngen-exec.h 2007-04-12 17:32:09.000000000 +0200
  24. @@ -95,8 +95,11 @@
  25. #define AREG1 "rbx"
  26. #define AREG2 "r12"
  27. #define AREG3 "r13"
  28. -//#define AREG4 "r14"
  29. -//#define AREG5 "r15"
  30. +#if __GNUC__ >= 4
  31. +/* XXX: earlier GCC crashes */
  32. +#define AREG4 "r14"
  33. +#define AREG5 "r15"
  34. +#endif
  35. #endif
  36. #ifdef __powerpc__
  37. #define AREG0 "r27"
  38. diff -ruN qemu-0.9.0/dyngen.c qemu-0.9.0-x86_64-opts/dyngen.c
  39. --- qemu-0.9.0/dyngen.c 2007-02-06 00:01:54.000000000 +0100
  40. +++ qemu-0.9.0-x86_64-opts/dyngen.c 2007-04-12 17:32:09.000000000 +0200
  41. @@ -1891,6 +1891,17 @@
  42. if (rel->r_offset >= start_offset &&
  43. rel->r_offset < start_offset + copy_size) {
  44. sym_name = strtab + symtab[ELFW(R_SYM)(rel->r_info)].st_name;
  45. + if (strstart(sym_name, "__op_jmp", &p)) {
  46. + int n;
  47. + n = strtol(p, NULL, 10);
  48. + /* __op_jmp relocations are done at
  49. + runtime to do translated block
  50. + chaining: the offset of the instruction
  51. + needs to be stored */
  52. + fprintf(outfile, " jmp_offsets[%d] = %d + (gen_code_ptr - gen_code_buf);\n",
  53. + n, rel->r_offset - start_offset);
  54. + continue;
  55. + }
  56. get_reloc_expr(name, sizeof(name), sym_name);
  57. type = ELF32_R_TYPE(rel->r_info);
  58. addend = rel->r_addend;
  59. diff -ruN qemu-0.9.0/exec-all.h qemu-0.9.0-x86_64-opts/exec-all.h
  60. --- qemu-0.9.0/exec-all.h 2007-02-06 00:01:54.000000000 +0100
  61. +++ qemu-0.9.0-x86_64-opts/exec-all.h 2007-04-12 17:32:09.000000000 +0200
  62. @@ -159,6 +159,9 @@
  63. #if defined(__i386__) && !defined(_WIN32)
  64. #define USE_DIRECT_JUMP
  65. #endif
  66. +#if defined(__x86_64__)
  67. +#define USE_DIRECT_JUMP
  68. +#endif
  69. typedef struct TranslationBlock {
  70. target_ulong pc; /* simulated PC corresponding to this block (EIP + CS base) */
  71. @@ -245,7 +248,7 @@
  72. asm volatile ("sync" : : : "memory");
  73. asm volatile ("isync" : : : "memory");
  74. }
  75. -#elif defined(__i386__)
  76. +#elif defined(__i386__) || defined(__x86_64__)
  77. static inline void tb_set_jmp_target1(unsigned long jmp_addr, unsigned long addr)
  78. {
  79. /* patch the branch destination */
  80. @@ -324,7 +327,7 @@
  81. "1:\n");\
  82. } while (0)
  83. -#elif defined(__i386__) && defined(USE_DIRECT_JUMP)
  84. +#elif (defined(__i386__) || defined(__x86_64__)) && defined(USE_DIRECT_JUMP)
  85. /* we patch the jump instruction directly */
  86. #define GOTO_TB(opname, tbparam, n)\