arc-ext.h 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. /* ARC target-dependent stuff. Extension data structures.
  2. Copyright (C) 1995-2015 Free Software Foundation, Inc.
  3. This file is part of libopcodes.
  4. This library is free software; you can redistribute it and/or modify
  5. it under the terms of the GNU General Public License as published by
  6. the Free Software Foundation; either version 3, or (at your option)
  7. any later version.
  8. It is distributed in the hope that it will be useful, but WITHOUT
  9. ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
  10. or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
  11. License for more details.
  12. You should have received a copy of the GNU General Public License
  13. along with this program; if not, write to the Free Software
  14. Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
  15. MA 02110-1301, USA. */
  16. /*This header file defines a table of extensions to the ARC processor
  17. architecture. These extensions are read from the '.arcextmap' or
  18. '.gnu.linkonce.arcextmap.<type>.<N>' sections in the ELF file which
  19. is identified by the bfd parameter to the build_ARC_extmap function.
  20. These extensions may include:
  21. core registers
  22. auxiliary registers
  23. instructions
  24. condition codes
  25. Once the table has been constructed, accessor functions may be used
  26. to retrieve information from it.
  27. The build_ARC_extmap constructor function build_ARC_extmap may be
  28. called as many times as required; it will re-initialize the table
  29. each time. */
  30. #ifndef ARC_EXTENSIONS_H
  31. #define ARC_EXTENSIONS_H
  32. #define IGNORE_FIRST_OPD 1
  33. /* Define this if we do not want to encode instructions based on the
  34. ARCompact Programmer's Reference. */
  35. #define UNMANGLED
  36. /* This defines the kinds of extensions which may be read from the
  37. ections in the executable files. */
  38. enum ExtOperType
  39. {
  40. EXT_INSTRUCTION = 0,
  41. EXT_CORE_REGISTER = 1,
  42. EXT_AUX_REGISTER = 2,
  43. EXT_COND_CODE = 3,
  44. EXT_INSTRUCTION32 = 4,
  45. EXT_AC_INSTRUCTION = 4,
  46. EXT_REMOVE_CORE_REG = 5,
  47. EXT_LONG_CORE_REGISTER = 6,
  48. EXT_AUX_REGISTER_EXTENDED = 7,
  49. EXT_INSTRUCTION32_EXTENDED = 8,
  50. EXT_CORE_REGISTER_CLASS = 9
  51. };
  52. enum ExtReadWrite
  53. {
  54. REG_INVALID,
  55. REG_READ,
  56. REG_WRITE,
  57. REG_READWRITE
  58. };
  59. /* Constructor function. */
  60. extern void build_ARC_extmap (bfd *);
  61. /* Accessor functions. */
  62. extern enum ExtReadWrite arcExtMap_coreReadWrite (int);
  63. extern const char * arcExtMap_coreRegName (int);
  64. extern const char * arcExtMap_auxRegName (long);
  65. extern const char * arcExtMap_condCodeName (int);
  66. extern const char * arcExtMap_instName (int, int, int *);
  67. /* Dump function (for debugging). */
  68. extern void dump_ARC_extmap (void);
  69. #endif /* ARC_EXTENSIONS_H */