-/* Define macros to access some of the gdbarch entries. */
-#define XTENSA_TARGET_FLAGS \
- (gdbarch_tdep (current_gdbarch)->target_flags)
-#define SPILL_LOCATION \
- (gdbarch_tdep (current_gdbarch)->spill_location)
-#define SPILL_SIZE \
- (gdbarch_tdep (current_gdbarch)->spill_size)
-#define CALL_ABI \
- (gdbarch_tdep (current_gdbarch)->call_abi)
-#define ISA_USE_WINDOWED_REGISTERS \
- (gdbarch_tdep (current_gdbarch)->isa_use_windowed_registers)
-#define ISA_USE_DENSITY_INSTRUCTIONS \
- (gdbarch_tdep (current_gdbarch)->isa_use_density_instructions)
-#define ISA_USE_EXCEPTIONS \
- (gdbarch_tdep (current_gdbarch)->isa_use_exceptions)
-#define ISA_USE_EXT_L32R \
- (gdbarch_tdep (current_gdbarch)->isa_use_ext_l32r)
-#define DEBUG_DATA_VADDR_TRAP_COUNT \
- (gdbarch_tdep (current_gdbarch)->debug_data_vaddr_trap_count)
-#define DEBUG_INST_VADDR_TRAP_COUNT \
- (gdbarch_tdep (current_gdbarch)->debug_inst_vaddr_trap_count)
-#define ISA_MAX_INSN_SIZE \
- (gdbarch_tdep (current_gdbarch)->isa_max_insn_size)
-#define DEBUG_NUM_IBREAKS \
- (gdbarch_tdep (current_gdbarch)->debug_num_ibreaks)
-#define DEBUG_NUM_DBREAKS \
- (gdbarch_tdep (current_gdbarch)->debug_num_dbreaks)
-
-#define NUM_AREGS (gdbarch_tdep (current_gdbarch)->num_aregs)
-#define WB_REGNUM (gdbarch_tdep (current_gdbarch)->wb_regnum)
-#define WS_REGNUM (gdbarch_tdep (current_gdbarch)->ws_regnum)
-#define LBEG_REGNUM (gdbarch_tdep (current_gdbarch)->lbeg_regnum)
-#define LEND_REGNUM (gdbarch_tdep (current_gdbarch)->lend_regnum)
-#define LCOUNT_REGNUM (gdbarch_tdep (current_gdbarch)->lcount_regnum)
-#define SAR_REGNUM (gdbarch_tdep (current_gdbarch)->sar_regnum)
-#define REGMAP (gdbarch_tdep (current_gdbarch)->regmap)
-
-#define LITBASE_REGNUM (gdbarch_tdep (current_gdbarch)->litbase_regnum)
-#define DEBUGCAUSE_REGNUM (gdbarch_tdep (current_gdbarch)->debugcause_regnum)
-#define EXCCAUSE_REGNUM (gdbarch_tdep (current_gdbarch)->exccause_regnum)
-#define EXCVADDR_REGNUM (gdbarch_tdep (current_gdbarch)->excvaddr_regnum)
-#define NUM_IBREAKS (gdbarch_tdep (current_gdbarch)->num_ibreaks)
-#define REGMAP_BYTES (gdbarch_tdep (current_gdbarch)->regmap_bytes)
-#define A0_BASE (gdbarch_tdep (current_gdbarch)->a0_base)
-#define AR_BASE (gdbarch_tdep (current_gdbarch)->ar_base)
-#define FP_ALIAS (NUM_REGS + NUM_PSEUDO_REGS)
-#define CALL_ABI (gdbarch_tdep (current_gdbarch)->call_abi)
-#define NUM_CONTEXTS (gdbarch_tdep (current_gdbarch)->num_contexts)
-
-#define FP_LAYOUT (gdbarch_tdep (current_gdbarch)->fp_layout)
-#define FP_LAYOUT_BYTES (gdbarch_tdep (current_gdbarch)->fp_layout_bytes)
-#define GREGMAP (gdbarch_tdep (current_gdbarch)->gregmap)
-
-#define AREGS_MASK (NUM_AREGS - 1)
-#define WB_MASK (AREGS_MASK >> 2)
+/* Macro to instantiate a gdbarch_tdep structure. */
+
+#define XTENSA_GDBARCH_TDEP_INSTANTIATE(rmap,spillsz) \
+ { \
+ 0, /* target_flags */ \
+ (unsigned) -1, /* spill_location */ \
+ (spillsz), /* spill_size */ \
+ 0, /* unused */ \
+ (XSHAL_ABI == XTHAL_ABI_CALL0 \
+ ? CallAbiCall0Only \
+ : CallAbiDefault), /* call_abi */ \
+ XCHAL_DEBUGLEVEL, /* debug_interrupt_level */ \
+ XCHAL_ICACHE_LINESIZE, /* icache_line_bytes */ \
+ XCHAL_DCACHE_LINESIZE, /* dcache_line_bytes */ \
+ XCHAL_DCACHE_IS_WRITEBACK, /* dcache_writeback */ \
+ (XSHAL_ABI != XTHAL_ABI_CALL0), /* isa_use_windowed_registers */ \
+ XCHAL_HAVE_DENSITY, /* isa_use_density_instructions */ \
+ XCHAL_HAVE_EXCEPTIONS, /* isa_use_exceptions */ \
+ XSHAL_USE_ABSOLUTE_LITERALS, /* isa_use_ext_l32r */ \
+ XCHAL_MAX_INSTRUCTION_SIZE, /* isa_max_insn_size */ \
+ XCHAL_NUM_IBREAK, /* debug_num_ibreaks */ \
+ XCHAL_NUM_DBREAK, /* debug_num_dbreaks */ \
+ rmap, /* regmap */ \
+ 0, /* num_regs */ \
+ 0, /* num_nopriv_regs */ \
+ 0, /* num_pseudo_regs */ \
+ XCHAL_NUM_AREGS, /* num_aregs */ \
+ XCHAL_NUM_CONTEXTS, /* num_contexts */ \
+ -1, /* ar_base */ \
+ -1, /* a0_base */ \
+ -1, /* wb_regnum */ \
+ -1, /* ws_regnum */ \
+ -1, /* pc_regnum */ \
+ -1, /* ps_regnum */ \
+ -1, /* lbeg_regnum */ \
+ -1, /* lend_regnum */ \
+ -1, /* lcount_regnum */ \
+ -1, /* sar_regnum */ \
+ -1, /* litbase_regnum */ \
+ -1, /* interrupt_regnum */ \
+ -1, /* interrupt2_regnum */ \
+ -1, /* cpenable_regnum */ \
+ -1, /* debugcause_regnum */ \
+ -1, /* exccause_regnum */ \
+ -1, /* excvaddr_regnum */ \
+ 0, /* max_register_raw_size */ \
+ 0, /* max_register_virtual_size */ \
+ 0, /* fp_layout */ \
+ 0, /* fp_layout_bytes */ \
+ 0, /* gregmap */ \
+ }
+#define XTENSA_CONFIG_INSTANTIATE(rmap,spill_size) \
+ struct gdbarch_tdep xtensa_tdep = \
+ XTENSA_GDBARCH_TDEP_INSTANTIATE(rmap,spill_size);
+
+#ifndef XCHAL_NUM_CONTEXTS
+#define XCHAL_NUM_CONTEXTS 0
+#endif
+#ifndef XCHAL_HAVE_EXCEPTIONS
+#define XCHAL_HAVE_EXCEPTIONS 1
+#endif