ffitarget.h 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. /* -----------------------------------------------------------------*-C-*-
  2. ffitarget.h - Copyright (c) 2012 Anthony Green
  3. Copyright (c) 2010 CodeSourcery
  4. Copyright (c) 1996-2003 Red Hat, Inc.
  5. Target configuration macros for CSKY.
  6. Permission is hereby granted, free of charge, to any person obtaining
  7. a copy of this software and associated documentation files (the
  8. ``Software''), to deal in the Software without restriction, including
  9. without limitation the rights to use, copy, modify, merge, publish,
  10. distribute, sublicense, and/or sell copies of the Software, and to
  11. permit persons to whom the Software is furnished to do so, subject to
  12. the following conditions:
  13. The above copyright notice and this permission notice shall be included
  14. in all copies or substantial portions of the Software.
  15. THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND,
  16. EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  17. MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
  18. NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
  19. HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
  20. WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  21. OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
  22. DEALINGS IN THE SOFTWARE.
  23. ----------------------------------------------------------------------- */
  24. #ifndef LIBFFI_TARGET_H
  25. #define LIBFFI_TARGET_H
  26. #ifndef LIBFFI_H
  27. #error "Please do not include ffitarget.h directly into your source. Use ffi.h instead."
  28. #endif
  29. #ifndef LIBFFI_ASM
  30. typedef unsigned long ffi_arg;
  31. typedef signed long ffi_sarg;
  32. typedef enum ffi_abi {
  33. FFI_FIRST_ABI = 0,
  34. FFI_SYSV,
  35. FFI_LAST_ABI,
  36. FFI_DEFAULT_ABI = FFI_SYSV,
  37. } ffi_abi;
  38. #endif
  39. #ifdef __CSKYABIV2__
  40. #define FFI_ASM_ARGREG_SIZE 16
  41. #define TRAMPOLINE_SIZE 16
  42. #define FFI_TRAMPOLINE_SIZE 24
  43. #else
  44. #define FFI_ASM_ARGREG_SIZE 24
  45. #define TRAMPOLINE_SIZE 20
  46. #define FFI_TRAMPOLINE_SIZE 28
  47. #endif
  48. /* ---- Definitions for closures ----------------------------------------- */
  49. #define FFI_CLOSURES 1
  50. #define FFI_NATIVE_RAW_API 0
  51. #endif