OpenOCD
arm_cti.c File Reference
Include dependency graph for arm_cti.c:

Go to the source code of this file.

Data Structures

struct  arm_cti
 

Functions

int arm_cti_ack_events (struct arm_cti *self, uint32_t event)
 
int arm_cti_cleanup_all (void)
 
int arm_cti_clear_channel (struct arm_cti *self, uint32_t channel)
 
int arm_cti_enable (struct arm_cti *self, bool enable)
 
int arm_cti_gate_channel (struct arm_cti *self, uint32_t channel)
 
static int arm_cti_mod_reg_bits (struct arm_cti *self, unsigned int reg, uint32_t mask, uint32_t value)
 
const char * arm_cti_name (struct arm_cti *self)
 
int arm_cti_pulse_channel (struct arm_cti *self, uint32_t channel)
 
int arm_cti_read_reg (struct arm_cti *self, unsigned int reg, uint32_t *p_value)
 
int arm_cti_set_channel (struct arm_cti *self, uint32_t channel)
 
int arm_cti_ungate_channel (struct arm_cti *self, uint32_t channel)
 
int arm_cti_write_reg (struct arm_cti *self, unsigned int reg, uint32_t value)
 
 COMMAND_HANDLER (cti_handle_names)
 
 COMMAND_HANDLER (handle_cti_ack)
 
 COMMAND_HANDLER (handle_cti_channel)
 
 COMMAND_HANDLER (handle_cti_dump)
 
 COMMAND_HANDLER (handle_cti_enable)
 
 COMMAND_HANDLER (handle_cti_read)
 
 COMMAND_HANDLER (handle_cti_testmode)
 
 COMMAND_HANDLER (handle_cti_write)
 
static int cti_configure (struct jim_getopt_info *goi, struct arm_cti *cti)
 
static int cti_create (struct jim_getopt_info *goi)
 
static int cti_find_reg_offset (const char *name)
 
struct arm_cticti_instance_by_jim_obj (Jim_Interp *interp, Jim_Obj *o)
 
int cti_register_commands (struct command_context *cmd_ctx)
 
static int jim_cti_create (Jim_Interp *interp, int argc, Jim_Obj *const *argv)
 
static LIST_HEAD (all_cti)
 

Variables

static const struct command_registration cti_command_handlers []
 
static const struct command_registration cti_instance_command_handlers []
 
struct {
   const char *   label
 
   uint32_t   offset
 
cti_names []
 
static const struct command_registration cti_subcommand_handlers []
 

Function Documentation

◆ arm_cti_ack_events()

int arm_cti_ack_events ( struct arm_cti self,
uint32_t  event 
)

◆ arm_cti_cleanup_all()

int arm_cti_cleanup_all ( void  )

Definition at line 206 of file arm_cti.c.

References arm_cti::ap, dap_put_ap(), ERROR_OK, lh(), list_for_each_entry_safe, and arm_cti::name.

Referenced by openocd_main().

◆ arm_cti_clear_channel()

int arm_cti_clear_channel ( struct arm_cti self,
uint32_t  channel 
)

Definition at line 152 of file arm_cti.c.

References arm_cti_write_reg(), CTI_APPCLEAR, CTI_CHNL, and ERROR_COMMAND_ARGUMENT_INVALID.

Referenced by COMMAND_HANDLER().

◆ arm_cti_enable()

int arm_cti_enable ( struct arm_cti self,
bool  enable 
)

Definition at line 74 of file arm_cti.c.

References CTI_CTR, and mem_ap_write_atomic_u32().

Referenced by aarch64_init_debug_access(), and COMMAND_HANDLER().

◆ arm_cti_gate_channel()

int arm_cti_gate_channel ( struct arm_cti self,
uint32_t  channel 
)

◆ arm_cti_mod_reg_bits()

static int arm_cti_mod_reg_bits ( struct arm_cti self,
unsigned int  reg,
uint32_t  mask,
uint32_t  value 
)
static

◆ arm_cti_name()

const char* arm_cti_name ( struct arm_cti self)

Definition at line 30 of file arm_cti.c.

Referenced by aarch64_jim_configure().

◆ arm_cti_pulse_channel()

int arm_cti_pulse_channel ( struct arm_cti self,
uint32_t  channel 
)

◆ arm_cti_read_reg()

int arm_cti_read_reg ( struct arm_cti self,
unsigned int  reg,
uint32_t *  p_value 
)

Definition at line 128 of file arm_cti.c.

References ERROR_COMMAND_ARGUMENT_INVALID, and mem_ap_read_atomic_u32().

Referenced by COMMAND_HANDLER().

◆ arm_cti_set_channel()

int arm_cti_set_channel ( struct arm_cti self,
uint32_t  channel 
)

Definition at line 144 of file arm_cti.c.

References arm_cti_write_reg(), CTI_APPSET, CTI_CHNL, and ERROR_COMMAND_ARGUMENT_INVALID.

Referenced by COMMAND_HANDLER().

◆ arm_cti_ungate_channel()

int arm_cti_ungate_channel ( struct arm_cti self,
uint32_t  channel 
)

◆ arm_cti_write_reg()

int arm_cti_write_reg ( struct arm_cti self,
unsigned int  reg,
uint32_t  value 
)

◆ COMMAND_HANDLER() [1/8]

COMMAND_HANDLER ( cti_handle_names  )

◆ COMMAND_HANDLER() [2/8]

COMMAND_HANDLER ( handle_cti_ack  )

◆ COMMAND_HANDLER() [3/8]

◆ COMMAND_HANDLER() [4/8]

COMMAND_HANDLER ( handle_cti_dump  )

◆ COMMAND_HANDLER() [5/8]

COMMAND_HANDLER ( handle_cti_enable  )

◆ COMMAND_HANDLER() [6/8]

COMMAND_HANDLER ( handle_cti_read  )

◆ COMMAND_HANDLER() [7/8]

COMMAND_HANDLER ( handle_cti_testmode  )

◆ COMMAND_HANDLER() [8/8]

COMMAND_HANDLER ( handle_cti_write  )

◆ cti_configure()

static int cti_configure ( struct jim_getopt_info goi,
struct arm_cti cti 
)
static

◆ cti_create()

◆ cti_find_reg_offset()

static int cti_find_reg_offset ( const char *  name)
static

Definition at line 195 of file arm_cti.c.

References ARRAY_SIZE, cti_names, label, LOG_ERROR, name, and offset.

Referenced by COMMAND_HANDLER().

◆ cti_instance_by_jim_obj()

struct arm_cti* cti_instance_by_jim_obj ( Jim_Interp *  interp,
Jim_Obj *  o 
)

Definition at line 35 of file arm_cti.c.

References lh(), list_for_each_entry, arm_cti::name, name, and NULL.

Referenced by aarch64_jim_configure().

◆ cti_register_commands()

int cti_register_commands ( struct command_context cmd_ctx)

Definition at line 567 of file arm_cti.c.

Referenced by setup_command_handler().

◆ jim_cti_create()

static int jim_cti_create ( Jim_Interp *  interp,
int  argc,
Jim_Obj *const *  argv 
)
static

◆ LIST_HEAD()

static LIST_HEAD ( all_cti  )
static

Variable Documentation

◆ cti_command_handlers

const struct command_registration cti_command_handlers[]
static
Initial value:
= {
{
.name = "cti",
.mode = COMMAND_CONFIG,
.help = "CTI commands",
.usage = "",
},
}
static const struct command_registration cti_subcommand_handlers[]
Definition: arm_cti.c:538
#define COMMAND_REGISTRATION_DONE
Use this as the last entry in an array of command_registration records.
Definition: command.h:253
@ COMMAND_CONFIG
Definition: command.h:41
const char * usage
a string listing the options and arguments, required or optional
Definition: command.h:241

Definition at line 525 of file arm_cti.c.

◆ cti_instance_command_handlers

const struct command_registration cti_instance_command_handlers[]
static

Definition at line 329 of file arm_cti.c.

Referenced by cti_create().

◆ 

const { ... } cti_names[]

◆ cti_subcommand_handlers

const struct command_registration cti_subcommand_handlers[]
static
Initial value:
= {
{
.name = "create",
.mode = COMMAND_ANY,
.jim_handler = jim_cti_create,
.usage = "name '-chain-position' name [options ...]",
.help = "Creates a new CTI object",
},
{
.name = "names",
.mode = COMMAND_ANY,
.handler = cti_handle_names,
.usage = "",
.help = "Lists all registered CTI objects by name",
},
}
static int jim_cti_create(Jim_Interp *interp, int argc, Jim_Obj *const *argv)
Definition: arm_cti.c:513
@ COMMAND_ANY
Definition: command.h:42

Definition at line 525 of file arm_cti.c.

◆ label

const char* label

◆ offset

uint32_t offset

Definition at line 161 of file arm_cti.c.

Referenced by COMMAND_HANDLER(), and cti_find_reg_offset().