OpenOCD
arc.h File Reference
Include dependency graph for arc.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  arc_actionpoint
 
struct  arc_common
 
struct  arc_reg_bitfield
 
struct  arc_reg_data_type
 
struct  arc_reg_desc
 

Macros

#define AP_AC_AT_AUXREG_ADDR   0x4
 
#define AP_AC_AT_INST_ADDR   0x0
 
#define AP_AC_AT_MEMORY_ADDR   0x2
 
#define AP_AC_TT_DISABLE   0x00
 
#define AP_AC_TT_READ   0x20
 
#define AP_AC_TT_READWRITE   0x30
 
#define AP_AC_TT_WRITE   0x10
 
#define ARC_COMMON_MAGIC   0xB32EB324U /* just a unique number */
 
#define ARC_SDBBP_16   0x7FFF /* BRK_S */
 
#define ARC_SDBBP_32   0x256F003FU /* BRK */
 
#define AUX_DC_CTRL_REG   0X48
 
#define AUX_DC_IVDC_REG   0X47
 
#define AUX_DEBUG_REG   0x5
 
#define AUX_IC_IVIC_REG   0X10
 
#define AUX_PC_REG   0x6
 
#define AUX_STATUS32_REG   0xA
 
#define AUX_STATUS32_REG_HALT_BIT   BIT(0)
 
#define AUX_STATUS32_REG_IE_BIT   BIT(31) /* STATUS32[31] = IE field */
 
#define CHECK_RETVAL(action)
 
#define CORE_REG_MAX_NUMBER   (63)
 
#define DC_CTRL_IM   BIT(6)
 
#define DC_IVDC_INVALIDATE   BIT(0)
 
#define ERROR_ARC_FIELD_IS_NOT_BITFIELD   (-703)
 
#define ERROR_ARC_REGISTER_FIELD_NOT_FOUND   (-701)
 
#define ERROR_ARC_REGISTER_IS_NOT_STRUCT   (-702)
 
#define ERROR_ARC_REGISTER_NOT_FOUND   (-700)
 
#define ERROR_ARC_REGTYPE_NOT_FOUND   (-704)
 
#define IC_IVIC_INVALIDATE   0XFFFFFFFF
 
#define JIM_CHECK_RETVAL(action)
 
#define L2_CTRL_BS   BIT(8) /* Busy flag */
 
#define L2_CTRL_IM   BIT(6)
 
#define L2_FLUSH_FL   BIT(0)
 
#define L2_INV_IV   BIT(0)
 
#define REG_TYPE_MAX_NAME_LENGTH   20
 
#define SET_CORE_AE_BIT   BIT(5)
 
#define SET_CORE_ENABLE_INTERRUPTS   BIT(31)
 
#define SET_CORE_FORCE_HALT   BIT(1)
 
#define SET_CORE_HALT_BIT   BIT(0) /* STATUS32[0] = H field */
 
#define SET_CORE_SINGLE_INSTR_STEP   BIT(11)
 
#define SLC_AUX_CACHE_CTRL   0x903
 
#define SLC_AUX_CACHE_FLUSH   0x904
 
#define SLC_AUX_CACHE_INV   0x905
 

Enumerations

enum  {
  ARC_R0 , ARC_R1 , ARC_R2 , ARC_R3 ,
  ARC_R4 , ARC_R5 , ARC_R6 , ARC_R7 ,
  ARC_R8 , ARC_R9 , ARC_R10 , ARC_R11 ,
  ARC_R12 , ARC_R13 , ARC_R14 , ARC_R15 ,
  ARC_R16 , ARC_R17 , ARC_R18 , ARC_R19 ,
  ARC_R20 , ARC_R21 , ARC_R22 , ARC_R23 ,
  ARC_R24 , ARC_R25 , ARC_GP = 26 , ARC_FP = 27 ,
  ARC_SP = 28 , ARC_ILINK = 29 , ARC_R30 , ARC_BLINK = 31 ,
  ARC_LP_COUNT = 60 , ARC_R61 = 61 , ARC_R62 = 62 , ARC_PCL = 63 ,
  ARC_PC = 64 , ARC_LP_START = 65 , ARC_LP_END = 66 , ARC_STATUS32 = 67
}
 
enum  arc_actionpointype { ARC_AP_BREAKPOINT , ARC_AP_WATCHPOINT }
 

Functions

int arc_add_auxreg_actionpoint (struct target *target, uint32_t auxreg_addr, uint32_t transaction)
 
int arc_cache_flush (struct target *target)
 
int arc_cache_invalidate (struct target *target)
 
static void arc_h_u32_to_me (uint8_t *buf, int val)
 Convert data in host endianness to the middle endian. More...
 
static uint32_t arc_me_to_h_u32 (const uint8_t *buf)
 Convert data in middle endian to host endian. More...
 
int arc_reg_add (struct target *target, struct arc_reg_desc *arc_reg, const char *const type_name, const size_t type_name_len)
 
void arc_reg_data_type_add (struct target *target, struct arc_reg_data_type *data_type)
 
struct regarc_reg_get_by_name (struct reg_cache *first, const char *name, bool search_all)
 Private implementation of register_get_by_name() for ARC that doesn't skip not [yet] existing registers. More...
 
int arc_reg_get_field (struct target *target, const char *reg_name, const char *field_name, uint32_t *value_ptr)
 
int arc_remove_auxreg_actionpoint (struct target *target, uint32_t auxreg_addr)
 
int arc_set_actionpoints_num (struct target *target, uint32_t ap_num)
 
void free_reg_desc (struct arc_reg_desc *r)
 
static struct arc_commontarget_to_arc (struct target *target)
 

Variables

static const struct reg_data_type standard_gdb_types []
 

Macro Definition Documentation

◆ AP_AC_AT_AUXREG_ADDR

#define AP_AC_AT_AUXREG_ADDR   0x4

Definition at line 127 of file arc.h.

◆ AP_AC_AT_INST_ADDR

#define AP_AC_AT_INST_ADDR   0x0

Definition at line 125 of file arc.h.

◆ AP_AC_AT_MEMORY_ADDR

#define AP_AC_AT_MEMORY_ADDR   0x2

Definition at line 126 of file arc.h.

◆ AP_AC_TT_DISABLE

#define AP_AC_TT_DISABLE   0x00

Definition at line 129 of file arc.h.

◆ AP_AC_TT_READ

#define AP_AC_TT_READ   0x20

Definition at line 131 of file arc.h.

◆ AP_AC_TT_READWRITE

#define AP_AC_TT_READWRITE   0x30

Definition at line 132 of file arc.h.

◆ AP_AC_TT_WRITE

#define AP_AC_TT_WRITE   0x10

Definition at line 130 of file arc.h.

◆ ARC_COMMON_MAGIC

#define ARC_COMMON_MAGIC   0xB32EB324U /* just a unique number */

Definition at line 30 of file arc.h.

◆ ARC_SDBBP_16

#define ARC_SDBBP_16   0x7FFF /* BRK_S */

Definition at line 104 of file arc.h.

◆ ARC_SDBBP_32

#define ARC_SDBBP_32   0x256F003FU /* BRK */

Definition at line 101 of file arc.h.

◆ AUX_DC_CTRL_REG

#define AUX_DC_CTRL_REG   0X48

Definition at line 112 of file arc.h.

◆ AUX_DC_IVDC_REG

#define AUX_DC_IVDC_REG   0X47

Definition at line 110 of file arc.h.

◆ AUX_DEBUG_REG

#define AUX_DEBUG_REG   0x5

Definition at line 32 of file arc.h.

◆ AUX_IC_IVIC_REG

#define AUX_IC_IVIC_REG   0X10

Definition at line 107 of file arc.h.

◆ AUX_PC_REG

#define AUX_PC_REG   0x6

Definition at line 33 of file arc.h.

◆ AUX_STATUS32_REG

#define AUX_STATUS32_REG   0xA

Definition at line 34 of file arc.h.

◆ AUX_STATUS32_REG_HALT_BIT

#define AUX_STATUS32_REG_HALT_BIT   BIT(0)

Definition at line 45 of file arc.h.

◆ AUX_STATUS32_REG_IE_BIT

#define AUX_STATUS32_REG_IE_BIT   BIT(31) /* STATUS32[31] = IE field */

Definition at line 46 of file arc.h.

◆ CHECK_RETVAL

#define CHECK_RETVAL (   action)
Value:
do { \
int __retval = (action); \
if (__retval != ERROR_OK) { \
LOG_DEBUG("error while calling \"%s\"", \
# action); \
return __retval; \
} \
} while (0)
#define ERROR_OK
Definition: log.h:155

Definition at line 246 of file arc.h.

◆ CORE_REG_MAX_NUMBER

#define CORE_REG_MAX_NUMBER   (63)

Definition at line 95 of file arc.h.

◆ DC_CTRL_IM

#define DC_CTRL_IM   BIT(6)

Definition at line 113 of file arc.h.

◆ DC_IVDC_INVALIDATE

#define DC_IVDC_INVALIDATE   BIT(0)

Definition at line 111 of file arc.h.

◆ ERROR_ARC_FIELD_IS_NOT_BITFIELD

#define ERROR_ARC_FIELD_IS_NOT_BITFIELD   (-703)

Definition at line 334 of file arc.h.

◆ ERROR_ARC_REGISTER_FIELD_NOT_FOUND

#define ERROR_ARC_REGISTER_FIELD_NOT_FOUND   (-701)

Definition at line 332 of file arc.h.

◆ ERROR_ARC_REGISTER_IS_NOT_STRUCT

#define ERROR_ARC_REGISTER_IS_NOT_STRUCT   (-702)

Definition at line 333 of file arc.h.

◆ ERROR_ARC_REGISTER_NOT_FOUND

#define ERROR_ARC_REGISTER_NOT_FOUND   (-700)

Definition at line 331 of file arc.h.

◆ ERROR_ARC_REGTYPE_NOT_FOUND

#define ERROR_ARC_REGTYPE_NOT_FOUND   (-704)

Definition at line 335 of file arc.h.

◆ IC_IVIC_INVALIDATE

#define IC_IVIC_INVALIDATE   0XFFFFFFFF

Definition at line 108 of file arc.h.

◆ JIM_CHECK_RETVAL

#define JIM_CHECK_RETVAL (   action)
Value:
do { \
int __retval = (action); \
if (__retval != JIM_OK) { \
LOG_DEBUG("error while calling \"%s\"", \
# action); \
return __retval; \
} \
} while (0)

Definition at line 256 of file arc.h.

◆ L2_CTRL_BS

#define L2_CTRL_BS   BIT(8) /* Busy flag */

Definition at line 118 of file arc.h.

◆ L2_CTRL_IM

#define L2_CTRL_IM   BIT(6)

Definition at line 117 of file arc.h.

◆ L2_FLUSH_FL

#define L2_FLUSH_FL   BIT(0)

Definition at line 120 of file arc.h.

◆ L2_INV_IV

#define L2_INV_IV   BIT(0)

Definition at line 122 of file arc.h.

◆ REG_TYPE_MAX_NAME_LENGTH

#define REG_TYPE_MAX_NAME_LENGTH   20

Definition at line 98 of file arc.h.

◆ SET_CORE_AE_BIT

#define SET_CORE_AE_BIT   BIT(5)

Definition at line 41 of file arc.h.

◆ SET_CORE_ENABLE_INTERRUPTS

#define SET_CORE_ENABLE_INTERRUPTS   BIT(31)

Definition at line 39 of file arc.h.

◆ SET_CORE_FORCE_HALT

#define SET_CORE_FORCE_HALT   BIT(1)

Definition at line 37 of file arc.h.

◆ SET_CORE_HALT_BIT

#define SET_CORE_HALT_BIT   BIT(0) /* STATUS32[0] = H field */

Definition at line 38 of file arc.h.

◆ SET_CORE_SINGLE_INSTR_STEP

#define SET_CORE_SINGLE_INSTR_STEP   BIT(11)

Definition at line 43 of file arc.h.

◆ SLC_AUX_CACHE_CTRL

#define SLC_AUX_CACHE_CTRL   0x903

Definition at line 116 of file arc.h.

◆ SLC_AUX_CACHE_FLUSH

#define SLC_AUX_CACHE_FLUSH   0x904

Definition at line 119 of file arc.h.

◆ SLC_AUX_CACHE_INV

#define SLC_AUX_CACHE_INV   0x905

Definition at line 121 of file arc.h.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
ARC_R0 
ARC_R1 
ARC_R2 
ARC_R3 
ARC_R4 
ARC_R5 
ARC_R6 
ARC_R7 
ARC_R8 
ARC_R9 
ARC_R10 
ARC_R11 
ARC_R12 
ARC_R13 
ARC_R14 
ARC_R15 
ARC_R16 
ARC_R17 
ARC_R18 
ARC_R19 
ARC_R20 
ARC_R21 
ARC_R22 
ARC_R23 
ARC_R24 
ARC_R25 
ARC_GP 
ARC_FP 
ARC_SP 
ARC_ILINK 
ARC_R30 
ARC_BLINK 
ARC_LP_COUNT 
ARC_R61 
ARC_R62 
ARC_PCL 
ARC_PC 
ARC_LP_START 
ARC_LP_END 
ARC_STATUS32 

Definition at line 49 of file arc.h.

◆ arc_actionpointype

Enumerator
ARC_AP_BREAKPOINT 
ARC_AP_WATCHPOINT 

Definition at line 172 of file arc.h.

Function Documentation

◆ arc_add_auxreg_actionpoint()

◆ arc_cache_flush()

int arc_cache_flush ( struct target target)

◆ arc_cache_invalidate()

◆ arc_h_u32_to_me()

static void arc_h_u32_to_me ( uint8_t *  buf,
int  val 
)
inlinestatic

Convert data in host endianness to the middle endian.

This is required to write 4-byte instructions.

Definition at line 277 of file arc.h.

Referenced by arc_write_instruction_u32().

◆ arc_me_to_h_u32()

static uint32_t arc_me_to_h_u32 ( const uint8_t *  buf)
inlinestatic

Convert data in middle endian to host endian.

This is required to read 32-bit instruction from little endian ARCs.

Definition at line 289 of file arc.h.

Referenced by arc_read_instruction_u32().

◆ arc_reg_add()

◆ arc_reg_data_type_add()

void arc_reg_data_type_add ( struct target target,
struct arc_reg_data_type data_type 
)

◆ arc_reg_get_by_name()

struct reg* arc_reg_get_by_name ( struct reg_cache first,
const char *  name,
bool  search_all 
)

Private implementation of register_get_by_name() for ARC that doesn't skip not [yet] existing registers.

Used in many places for iteration through registers and even for marking required registers as existing.

Definition at line 70 of file arc.c.

References name, reg::name, reg_cache::next, NULL, reg_cache::num_regs, and reg_cache::reg_list.

Referenced by arc_configure(), arc_get_register_value(), arc_reg_get_field(), arc_set_register_value(), and COMMAND_HANDLER().

◆ arc_reg_get_field()

◆ arc_remove_auxreg_actionpoint()

◆ arc_set_actionpoints_num()

int arc_set_actionpoints_num ( struct target target,
uint32_t  ap_num 
)

◆ free_reg_desc()

void free_reg_desc ( struct arc_reg_desc r)

Definition at line 656 of file arc_cmd.c.

References arc_reg_desc::gdb_xml_feature, and arc_reg_desc::name.

Referenced by arc_deinit_target(), and jim_arc_add_reg().

◆ target_to_arc()

Variable Documentation

◆ standard_gdb_types

const struct reg_data_type standard_gdb_types[]
static
Initial value:
= {
{ .type = REG_TYPE_INT, .id = "int" },
{ .type = REG_TYPE_INT8, .id = "int8" },
{ .type = REG_TYPE_INT16, .id = "int16" },
{ .type = REG_TYPE_INT32, .id = "int32" },
{ .type = REG_TYPE_INT64, .id = "int64" },
{ .type = REG_TYPE_INT128, .id = "int128" },
{ .type = REG_TYPE_UINT8, .id = "uint8" },
{ .type = REG_TYPE_UINT16, .id = "uint16" },
{ .type = REG_TYPE_UINT32, .id = "uint32" },
{ .type = REG_TYPE_UINT64, .id = "uint64" },
{ .type = REG_TYPE_UINT128, .id = "uint128" },
{ .type = REG_TYPE_CODE_PTR, .id = "code_ptr" },
{ .type = REG_TYPE_DATA_PTR, .id = "data_ptr" },
{ .type = REG_TYPE_FLOAT, .id = "float" },
{ .type = REG_TYPE_IEEE_SINGLE, .id = "ieee_single" },
{ .type = REG_TYPE_IEEE_DOUBLE, .id = "ieee_double" },
}
@ REG_TYPE_INT
Definition: register.h:21
@ REG_TYPE_UINT16
Definition: register.h:29
@ REG_TYPE_IEEE_DOUBLE
Definition: register.h:37
@ REG_TYPE_INT64
Definition: register.h:25
@ REG_TYPE_INT16
Definition: register.h:23
@ REG_TYPE_UINT32
Definition: register.h:30
@ REG_TYPE_CODE_PTR
Definition: register.h:33
@ REG_TYPE_DATA_PTR
Definition: register.h:34
@ REG_TYPE_INT32
Definition: register.h:24
@ REG_TYPE_INT128
Definition: register.h:26
@ REG_TYPE_UINT128
Definition: register.h:32
@ REG_TYPE_FLOAT
Definition: register.h:35
@ REG_TYPE_UINT64
Definition: register.h:31
@ REG_TYPE_INT8
Definition: register.h:22
@ REG_TYPE_IEEE_SINGLE
Definition: register.h:36
@ REG_TYPE_UINT8
Definition: register.h:28

Definition at line 1 of file arc.h.

Referenced by arc_init_arch_info().