123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236 |
- #ifndef _NIOS2_H_
- #define _NIOS2_H_
- #include "bfd.h"
- #ifdef __cplusplus
- extern "C" {
- #endif
- enum iw_format_type {
-
- iw_i_type,
- iw_r_type,
- iw_j_type,
- iw_custom_type,
-
- iw_L26_type,
- iw_F2I16_type,
- iw_F2X4I12_type,
- iw_F1X4I12_type,
- iw_F1X4L17_type,
- iw_F3X6L5_type,
- iw_F2X6L10_type,
- iw_F3X6_type,
- iw_F3X8_type,
-
- iw_I10_type,
- iw_T1I7_type,
- iw_T2I4_type,
- iw_T1X1I6_type,
- iw_X1I7_type,
- iw_L5I4X1_type,
- iw_T2X1L3_type,
- iw_T2X1I3_type,
- iw_T3X1_type,
- iw_T2X3_type,
- iw_F1X1_type,
- iw_X2L5_type,
- iw_F1I5_type,
- iw_F2_type
- };
- enum overflow_type
- {
- call_target_overflow = 0,
- branch_target_overflow,
- address_offset_overflow,
- signed_immed16_overflow,
- unsigned_immed16_overflow,
- unsigned_immed5_overflow,
- signed_immed12_overflow,
- custom_opcode_overflow,
- enumeration_overflow,
- no_overflow
- };
- struct nios2_opcode
- {
- const char *name;
- const char *args;
- const char *args_test;
- unsigned long num_args;
- unsigned size;
- enum iw_format_type format;
- unsigned long match;
- unsigned long mask;
- unsigned long pinfo;
- enum overflow_type overflow_msg;
- };
- #define NIOS2_INSN_MACRO 0x80000000
- #define NIOS2_INSN_MACRO_MOV 0x80000001
- #define NIOS2_INSN_MACRO_MOVI 0x80000002
- #define NIOS2_INSN_MACRO_MOVIA 0x80000004
- #define NIOS2_INSN_RELAXABLE 0x40000000
- #define NIOS2_INSN_UBRANCH 0x00000010
- #define NIOS2_INSN_CBRANCH 0x00000020
- #define NIOS2_INSN_CALL 0x00000040
- #define NIOS2_INSN_OPTARG 0x00000080
- #define REG_NORMAL (1<<0) /* Normal registers. */
- #define REG_CONTROL (1<<1) /* Control registers. */
- #define REG_COPROCESSOR (1<<2) /* For custom instructions. */
- #define REG_3BIT (1<<3) /* For R2 CDX instructions. */
- #define REG_LDWM (1<<4) /* For R2 ldwm/stwm. */
- #define REG_POP (1<<5) /* For R2 pop.n/push.n. */
- struct nios2_reg
- {
- const char *name;
- const int index;
- unsigned long regtype;
- };
- #include "nios2r1.h"
- #include "nios2r2.h"
- extern const struct nios2_opcode nios2_r1_opcodes[];
- extern const int nios2_num_r1_opcodes;
- extern const struct nios2_opcode nios2_r2_opcodes[];
- extern const int nios2_num_r2_opcodes;
- extern struct nios2_opcode *nios2_opcodes;
- extern int nios2_num_opcodes;
- extern const struct nios2_reg nios2_builtin_regs[];
- extern struct nios2_reg *nios2_regs;
- extern const int nios2_num_builtin_regs;
- extern int nios2_num_regs;
- extern const struct nios2_opcode *
- nios2_find_opcode_hash (unsigned long, unsigned long);
- extern unsigned int nios2_r2_asi_n_mappings[];
- extern const int nios2_num_r2_asi_n_mappings;
- extern unsigned int nios2_r2_shi_n_mappings[];
- extern const int nios2_num_r2_shi_n_mappings;
- extern unsigned int nios2_r2_andi_n_mappings[];
- extern const int nios2_num_r2_andi_n_mappings;
- extern int nios2_r2_reg3_mappings[];
- extern const int nios2_num_r2_reg3_mappings;
- extern unsigned long nios2_r2_reg_range_mappings[];
- extern const int nios2_num_r2_reg_range_mappings;
- #ifdef __cplusplus
- }
- #endif
- #endif /* _NIOS2_H */
|