cpu-csky.c 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. /* BFD support for C-SKY processors.
  2. Copyright (C) 1994-2022 Free Software Foundation, Inc.
  3. Contributed by C-SKY Microsystems and Mentor Graphics.
  4. This file is part of BFD, the Binary File Descriptor library.
  5. This program is free software; you can redistribute it and/or modify
  6. it under the terms of the GNU General Public License as published by
  7. the Free Software Foundation; either version 3 of the License, or
  8. (at your option) any later version.
  9. This program is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. GNU General Public License for more details.
  13. You should have received a copy of the GNU General Public License
  14. along with this program; if not, write to the Free Software
  15. Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
  16. MA 02110-1301, USA. */
  17. #include "sysdep.h"
  18. #include "bfd.h"
  19. #include "libbfd.h"
  20. #define N(NUMBER, PRINT, ISDEFAULT, NEXT) \
  21. { \
  22. 32, /* Bits in a word. */ \
  23. 32, /* Bits in an address. */ \
  24. 8, /* Bits in a byte. */ \
  25. bfd_arch_csky, /* Architecture. */ \
  26. NUMBER, /* Machine number. */ \
  27. "csky", /* Architecture name. */ \
  28. PRINT, /* Printable name. */ \
  29. 3, /* Section align power. */ \
  30. ISDEFAULT, /* Is this the default architecture ? */ \
  31. bfd_default_compatible, /* Architecture comparison function. */ \
  32. bfd_default_scan, /* String to architecture conversion. */ \
  33. bfd_arch_default_fill, \
  34. NEXT, /* Next in list. */ \
  35. 0 /* Maximum offset of a reloc from the start of an insn. */ \
  36. }
  37. static const bfd_arch_info_type arch_info_struct[] =
  38. {
  39. /* ABI v1 processors. */
  40. N (bfd_mach_ck510, "csky:ck510", false, & arch_info_struct[1]),
  41. N (bfd_mach_ck610, "csky:ck610", false, & arch_info_struct[2]),
  42. /* ABI v2 processors. */
  43. N (bfd_mach_ck801, "csky:ck801", false, & arch_info_struct[3]),
  44. N (bfd_mach_ck802, "csky:ck802", false, & arch_info_struct[4]),
  45. N (bfd_mach_ck803, "csky:ck803", false, & arch_info_struct[5]),
  46. N (bfd_mach_ck807, "csky:ck807", false, & arch_info_struct[6]),
  47. N (bfd_mach_ck810, "csky:ck810", false, & arch_info_struct[7]),
  48. N (bfd_mach_ck860, "csky:ck860", false, & arch_info_struct[8]),
  49. N (bfd_mach_ck_unknown, "csky:any", false, NULL)
  50. };
  51. const bfd_arch_info_type bfd_csky_arch =
  52. N (0, "csky", true, & arch_info_struct[0]);