0004-m68k-support-ISA-A-Coldfire-CPUs.patch 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. From 733bb188b898385cfb5ad28cc0e3ecaf38237350 Mon Sep 17 00:00:00 2001
  2. From: Waldemar Brodkorb <wbx@openadk.org>
  3. Date: Sat, 20 Aug 2016 00:52:19 +0200
  4. Subject: [PATCH] m68k: support ISA-A Coldfire CPUs
  5. Fix compilation for m68k/coldfire CPUs like mcf5208.
  6. Signed-off-by: Waldemar Brodkorb <wbx@openadk.org>
  7. Signed-off-by: Thorsten Glaser <tg@mirbsd.de>
  8. ---
  9. src/m68k/sysv.S | 29 ++++++++++++++++++++++++++++-
  10. 1 file changed, 28 insertions(+), 1 deletion(-)
  11. diff --git a/src/m68k/sysv.S b/src/m68k/sysv.S
  12. index ec2b14f..ea40f11 100644
  13. --- a/src/m68k/sysv.S
  14. +++ b/src/m68k/sysv.S
  15. @@ -3,7 +3,7 @@
  16. sysv.S - Copyright (c) 2012 Alan Hourihane
  17. Copyright (c) 1998, 2012 Andreas Schwab
  18. Copyright (c) 2008 Red Hat, Inc.
  19. - Copyright (c) 2012 Thorsten Glaser
  20. + Copyright (c) 2012, 2016 Thorsten Glaser
  21. m68k Foreign Function Interface
  22. @@ -72,6 +72,15 @@ CALLFUNC(ffi_call_SYSV):
  23. pea 4(%sp)
  24. #if !defined __PIC__
  25. jsr CALLFUNC(ffi_prep_args)
  26. +#elif defined(__uClinux__) && defined(__ID_SHARED_LIBRARY__)
  27. + move.l _current_shared_library_a5_offset_(%a5),%a0
  28. + move.l CALLFUNC(ffi_prep_args@GOT)(%a0),%a0
  29. + jsr (%a0)
  30. +#elif defined(__mcoldfire__) && !defined(__mcfisab__) && !defined(__mcfisac__)
  31. + move.l #_GLOBAL_OFFSET_TABLE_@GOTPC,%a0
  32. + lea (-6,%pc,%a0),%a0
  33. + move.l CALLFUNC(ffi_prep_args@GOT)(%a0),%a0
  34. + jsr (%a0)
  35. #else
  36. bsr.l CALLFUNC(ffi_prep_args@PLTPC)
  37. #endif
  38. @@ -215,6 +224,15 @@ CALLFUNC(ffi_closure_SYSV):
  39. move.l %a0,-(%sp)
  40. #if !defined __PIC__
  41. jsr CALLFUNC(ffi_closure_SYSV_inner)
  42. +#elif defined(__uClinux__) && defined(__ID_SHARED_LIBRARY__)
  43. + move.l _current_shared_library_a5_offset_(%a5),%a0
  44. + move.l CALLFUNC(ffi_closure_SYSV_inner@GOT)(%a0),%a0
  45. + jsr (%a0)
  46. +#elif defined(__mcoldfire__) && !defined(__mcfisab__) && !defined(__mcfisac__)
  47. + move.l #_GLOBAL_OFFSET_TABLE_@GOTPC,%a0
  48. + lea (-6,%pc,%a0),%a0
  49. + move.l CALLFUNC(ffi_closure_SYSV_inner@GOT)(%a0),%a0
  50. + jsr (%a0)
  51. #else
  52. bsr.l CALLFUNC(ffi_closure_SYSV_inner@PLTPC)
  53. #endif
  54. @@ -317,6 +335,15 @@ CALLFUNC(ffi_closure_struct_SYSV):
  55. move.l %a0,-(%sp)
  56. #if !defined __PIC__
  57. jsr CALLFUNC(ffi_closure_SYSV_inner)
  58. +#elif defined(__uClinux__) && defined(__ID_SHARED_LIBRARY__)
  59. + move.l _current_shared_library_a5_offset_(%a5),%a0
  60. + move.l CALLFUNC(ffi_closure_SYSV_inner@GOT)(%a0),%a0
  61. + jsr (%a0)
  62. +#elif defined(__mcoldfire__) && !defined(__mcfisab__) && !defined(__mcfisac__)
  63. + move.l #_GLOBAL_OFFSET_TABLE_@GOTPC,%a0
  64. + lea (-6,%pc,%a0),%a0
  65. + move.l CALLFUNC(ffi_closure_SYSV_inner@GOT)(%a0),%a0
  66. + jsr (%a0)
  67. #else
  68. bsr.l CALLFUNC(ffi_closure_SYSV_inner@PLTPC)
  69. #endif
  70. --
  71. 1.7.10.4