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

Go to the source code of this file.

Data Structures

struct  armv8_arch_cache
 
struct  armv8_cache_common
 
struct  armv8_cachesize
 
struct  armv8_common
 
struct  armv8_l2x_cache
 
struct  armv8_mmu_common
 

Macros

#define ARMV8_COMMON_MAGIC   0x0A450AAAU
 
#define CPUV8_DBG_AUTHSTATUS   0xFB8
 
#define CPUV8_DBG_BCR_BASE   0x408
 
#define CPUV8_DBG_BVR_BASE   0x400
 
#define CPUV8_DBG_CPUFEATURE0   0xD20
 
#define CPUV8_DBG_DBGFEATURE0   0xD28
 
#define CPUV8_DBG_DRCR   0x090
 
#define CPUV8_DBG_DSCR   0x088
 
#define CPUV8_DBG_DTRRX   0x080
 
#define CPUV8_DBG_DTRTX   0x08c
 
#define CPUV8_DBG_ECCR   0x098
 
#define CPUV8_DBG_EDECR   0x24
 
#define CPUV8_DBG_EDESR   0x20
 
#define CPUV8_DBG_EDWAR0   0x30
 
#define CPUV8_DBG_EDWAR1   0x34
 
#define CPUV8_DBG_ITR   0x084
 
#define CPUV8_DBG_LOCKACCESS   0xFB0
 
#define CPUV8_DBG_LOCKSTATUS   0xFB4
 
#define CPUV8_DBG_MAINID0   0xD00
 
#define CPUV8_DBG_MEMFEATURE0   0xD38
 
#define CPUV8_DBG_OSLAR   0x300
 
#define CPUV8_DBG_PRCR   0x310
 
#define CPUV8_DBG_PRSR   0x314
 
#define CPUV8_DBG_SCR   0x088
 
#define CPUV8_DBG_VCR   0x01C
 
#define CPUV8_DBG_WCR_BASE   0x808
 
#define CPUV8_DBG_WVR_BASE   0x800
 
#define PAGE_SIZE_4KB   0x1000
 
#define PAGE_SIZE_4KB_LEVEL0_BITS   39
 
#define PAGE_SIZE_4KB_LEVEL0_MASK   ((0x1FFULL) << PAGE_SIZE_4KB_LEVEL0_BITS)
 
#define PAGE_SIZE_4KB_LEVEL1_BITS   30
 
#define PAGE_SIZE_4KB_LEVEL1_MASK   ((0x1FFULL) << PAGE_SIZE_4KB_LEVEL1_BITS)
 
#define PAGE_SIZE_4KB_LEVEL2_BITS   21
 
#define PAGE_SIZE_4KB_LEVEL2_MASK   ((0x1FFULL) << PAGE_SIZE_4KB_LEVEL2_BITS)
 
#define PAGE_SIZE_4KB_LEVEL3_BITS   12
 
#define PAGE_SIZE_4KB_LEVEL3_MASK   ((0x1FFULL) << PAGE_SIZE_4KB_LEVEL3_BITS)
 
#define PAGE_SIZE_4KB_TRBBASE_MASK   0xFFFFFFFFF000
 
#define V2PCWPR   0
 
#define V2PCWPW   1
 
#define V2PCWUR   2
 
#define V2PCWUW   3
 
#define V2POWPR   4
 
#define V2POWPW   5
 
#define V2POWUR   6
 
#define V2POWUW   7
 

Enumerations

enum  {
  ARMV8_R0 = 0 , ARMV8_R1 , ARMV8_R2 , ARMV8_R3 ,
  ARMV8_R4 , ARMV8_R5 , ARMV8_R6 , ARMV8_R7 ,
  ARMV8_R8 , ARMV8_R9 , ARMV8_R10 , ARMV8_R11 ,
  ARMV8_R12 , ARMV8_R13 , ARMV8_R14 , ARMV8_R15 ,
  ARMV8_R16 , ARMV8_R17 , ARMV8_R18 , ARMV8_R19 ,
  ARMV8_R20 , ARMV8_R21 , ARMV8_R22 , ARMV8_R23 ,
  ARMV8_R24 , ARMV8_R25 , ARMV8_R26 , ARMV8_R27 ,
  ARMV8_R28 , ARMV8_R29 , ARMV8_R30 , ARMV8_SP = 31 ,
  ARMV8_PC = 32 , ARMV8_XPSR = 33 , ARMV8_V0 = 34 , ARMV8_V1 ,
  ARMV8_V2 , ARMV8_V3 , ARMV8_V4 , ARMV8_V5 ,
  ARMV8_V6 , ARMV8_V7 , ARMV8_V8 , ARMV8_V9 ,
  ARMV8_V10 , ARMV8_V11 , ARMV8_V12 , ARMV8_V13 ,
  ARMV8_V14 , ARMV8_V15 , ARMV8_V16 , ARMV8_V17 ,
  ARMV8_V18 , ARMV8_V19 , ARMV8_V20 , ARMV8_V21 ,
  ARMV8_V22 , ARMV8_V23 , ARMV8_V24 , ARMV8_V25 ,
  ARMV8_V26 , ARMV8_V27 , ARMV8_V28 , ARMV8_V29 ,
  ARMV8_V30 , ARMV8_V31 , ARMV8_FPSR , ARMV8_FPCR ,
  ARMV8_ELR_EL1 = 68 , ARMV8_ESR_EL1 = 69 , ARMV8_SPSR_EL1 = 70 , ARMV8_ELR_EL2 = 71 ,
  ARMV8_ESR_EL2 = 72 , ARMV8_SPSR_EL2 = 73 , ARMV8_ELR_EL3 = 74 , ARMV8_ESR_EL3 = 75 ,
  ARMV8_SPSR_EL3 = 76 , ARMV8_LAST_REG
}
 
enum  run_control_op { ARMV8_RUNCONTROL_UNKNOWN = 0 , ARMV8_RUNCONTROL_RESUME = 1 , ARMV8_RUNCONTROL_HALT = 2 , ARMV8_RUNCONTROL_STEP = 3 }
 

Functions

int armv8_arch_state (struct target *target)
 
static unsigned int armv8_curel_from_core_mode (enum arm_mode core_mode)
 
void armv8_free_reg_cache (struct target *target)
 
int armv8_handle_cache_info_command (struct command_invocation *cmd, struct armv8_cache_common *armv8_cache)
 
int armv8_identify_cache (struct armv8_common *armv8)
 
int armv8_init_arch_info (struct target *target, struct armv8_common *armv8)
 
int armv8_mmu_translate_va (struct target *target, target_addr_t va, target_addr_t *val)
 
int armv8_mmu_translate_va_pa (struct target *target, target_addr_t va, target_addr_t *val, int meminfo)
 
const char * armv8_mode_name (unsigned psr_mode)
 Map PSR mode bits to the name of an ARM processor operating mode. More...
 
int armv8_read_mpidr (struct armv8_common *armv8)
 
void armv8_select_reg_access (struct armv8_common *armv8, bool is_aarch64)
 
void armv8_set_cpsr (struct arm *arm, uint32_t cpsr)
 Configures host-side ARM records to reflect the specified CPSR. More...
 
int armv8_set_dbgreg_bits (struct armv8_common *armv8, unsigned int reg, unsigned long mask, unsigned long value)
 
static bool is_armv8 (struct armv8_common *armv8)
 
static struct armv8_commontarget_to_armv8 (struct target *target)
 

Variables

const struct command_registration armv8_command_handlers []
 

Macro Definition Documentation

◆ ARMV8_COMMON_MAGIC

#define ARMV8_COMMON_MAGIC   0x0A450AAAU

Definition at line 111 of file armv8.h.

◆ CPUV8_DBG_AUTHSTATUS

#define CPUV8_DBG_AUTHSTATUS   0xFB8

Definition at line 270 of file armv8.h.

◆ CPUV8_DBG_BCR_BASE

#define CPUV8_DBG_BCR_BASE   0x408

Definition at line 263 of file armv8.h.

◆ CPUV8_DBG_BVR_BASE

#define CPUV8_DBG_BVR_BASE   0x400

Definition at line 262 of file armv8.h.

◆ CPUV8_DBG_CPUFEATURE0

#define CPUV8_DBG_CPUFEATURE0   0xD20

Definition at line 240 of file armv8.h.

◆ CPUV8_DBG_DBGFEATURE0

#define CPUV8_DBG_DBGFEATURE0   0xD28

Definition at line 241 of file armv8.h.

◆ CPUV8_DBG_DRCR

#define CPUV8_DBG_DRCR   0x090

Definition at line 252 of file armv8.h.

◆ CPUV8_DBG_DSCR

#define CPUV8_DBG_DSCR   0x088

Definition at line 251 of file armv8.h.

◆ CPUV8_DBG_DTRRX

#define CPUV8_DBG_DTRRX   0x080

Definition at line 257 of file armv8.h.

◆ CPUV8_DBG_DTRTX

#define CPUV8_DBG_DTRTX   0x08c

Definition at line 260 of file armv8.h.

◆ CPUV8_DBG_ECCR

#define CPUV8_DBG_ECCR   0x098

Definition at line 253 of file armv8.h.

◆ CPUV8_DBG_EDECR

#define CPUV8_DBG_EDECR   0x24

Definition at line 248 of file armv8.h.

◆ CPUV8_DBG_EDESR

#define CPUV8_DBG_EDESR   0x20

Definition at line 247 of file armv8.h.

◆ CPUV8_DBG_EDWAR0

#define CPUV8_DBG_EDWAR0   0x30

Definition at line 249 of file armv8.h.

◆ CPUV8_DBG_EDWAR1

#define CPUV8_DBG_EDWAR1   0x34

Definition at line 250 of file armv8.h.

◆ CPUV8_DBG_ITR

#define CPUV8_DBG_ITR   0x084

Definition at line 258 of file armv8.h.

◆ CPUV8_DBG_LOCKACCESS

#define CPUV8_DBG_LOCKACCESS   0xFB0

Definition at line 244 of file armv8.h.

◆ CPUV8_DBG_LOCKSTATUS

#define CPUV8_DBG_LOCKSTATUS   0xFB4

Definition at line 245 of file armv8.h.

◆ CPUV8_DBG_MAINID0

#define CPUV8_DBG_MAINID0   0xD00

Definition at line 239 of file armv8.h.

◆ CPUV8_DBG_MEMFEATURE0

#define CPUV8_DBG_MEMFEATURE0   0xD38

Definition at line 242 of file armv8.h.

◆ CPUV8_DBG_OSLAR

#define CPUV8_DBG_OSLAR   0x300

Definition at line 268 of file armv8.h.

◆ CPUV8_DBG_PRCR

#define CPUV8_DBG_PRCR   0x310

Definition at line 254 of file armv8.h.

◆ CPUV8_DBG_PRSR

#define CPUV8_DBG_PRSR   0x314

Definition at line 255 of file armv8.h.

◆ CPUV8_DBG_SCR

#define CPUV8_DBG_SCR   0x088

Definition at line 259 of file armv8.h.

◆ CPUV8_DBG_VCR

#define CPUV8_DBG_VCR   0x01C

Definition at line 266 of file armv8.h.

◆ CPUV8_DBG_WCR_BASE

#define CPUV8_DBG_WCR_BASE   0x808

Definition at line 265 of file armv8.h.

◆ CPUV8_DBG_WVR_BASE

#define CPUV8_DBG_WVR_BASE   0x800

Definition at line 264 of file armv8.h.

◆ PAGE_SIZE_4KB

#define PAGE_SIZE_4KB   0x1000

Definition at line 272 of file armv8.h.

◆ PAGE_SIZE_4KB_LEVEL0_BITS

#define PAGE_SIZE_4KB_LEVEL0_BITS   39

Definition at line 273 of file armv8.h.

◆ PAGE_SIZE_4KB_LEVEL0_MASK

#define PAGE_SIZE_4KB_LEVEL0_MASK   ((0x1FFULL) << PAGE_SIZE_4KB_LEVEL0_BITS)

Definition at line 278 of file armv8.h.

◆ PAGE_SIZE_4KB_LEVEL1_BITS

#define PAGE_SIZE_4KB_LEVEL1_BITS   30

Definition at line 274 of file armv8.h.

◆ PAGE_SIZE_4KB_LEVEL1_MASK

#define PAGE_SIZE_4KB_LEVEL1_MASK   ((0x1FFULL) << PAGE_SIZE_4KB_LEVEL1_BITS)

Definition at line 279 of file armv8.h.

◆ PAGE_SIZE_4KB_LEVEL2_BITS

#define PAGE_SIZE_4KB_LEVEL2_BITS   21

Definition at line 275 of file armv8.h.

◆ PAGE_SIZE_4KB_LEVEL2_MASK

#define PAGE_SIZE_4KB_LEVEL2_MASK   ((0x1FFULL) << PAGE_SIZE_4KB_LEVEL2_BITS)

Definition at line 280 of file armv8.h.

◆ PAGE_SIZE_4KB_LEVEL3_BITS

#define PAGE_SIZE_4KB_LEVEL3_BITS   12

Definition at line 276 of file armv8.h.

◆ PAGE_SIZE_4KB_LEVEL3_MASK

#define PAGE_SIZE_4KB_LEVEL3_MASK   ((0x1FFULL) << PAGE_SIZE_4KB_LEVEL3_BITS)

Definition at line 281 of file armv8.h.

◆ PAGE_SIZE_4KB_TRBBASE_MASK

#define PAGE_SIZE_4KB_TRBBASE_MASK   0xFFFFFFFFF000

Definition at line 283 of file armv8.h.

◆ V2PCWPR

#define V2PCWPR   0

Definition at line 114 of file armv8.h.

◆ V2PCWPW

#define V2PCWPW   1

Definition at line 115 of file armv8.h.

◆ V2PCWUR

#define V2PCWUR   2

Definition at line 116 of file armv8.h.

◆ V2PCWUW

#define V2PCWUW   3

Definition at line 117 of file armv8.h.

◆ V2POWPR

#define V2POWPR   4

Definition at line 118 of file armv8.h.

◆ V2POWPW

#define V2POWPW   5

Definition at line 119 of file armv8.h.

◆ V2POWUR

#define V2POWUR   6

Definition at line 120 of file armv8.h.

◆ V2POWUW

#define V2POWUW   7

Definition at line 121 of file armv8.h.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
ARMV8_R0 
ARMV8_R1 
ARMV8_R2 
ARMV8_R3 
ARMV8_R4 
ARMV8_R5 
ARMV8_R6 
ARMV8_R7 
ARMV8_R8 
ARMV8_R9 
ARMV8_R10 
ARMV8_R11 
ARMV8_R12 
ARMV8_R13 
ARMV8_R14 
ARMV8_R15 
ARMV8_R16 
ARMV8_R17 
ARMV8_R18 
ARMV8_R19 
ARMV8_R20 
ARMV8_R21 
ARMV8_R22 
ARMV8_R23 
ARMV8_R24 
ARMV8_R25 
ARMV8_R26 
ARMV8_R27 
ARMV8_R28 
ARMV8_R29 
ARMV8_R30 
ARMV8_SP 
ARMV8_PC 
ARMV8_XPSR 
ARMV8_V0 
ARMV8_V1 
ARMV8_V2 
ARMV8_V3 
ARMV8_V4 
ARMV8_V5 
ARMV8_V6 
ARMV8_V7 
ARMV8_V8 
ARMV8_V9 
ARMV8_V10 
ARMV8_V11 
ARMV8_V12 
ARMV8_V13 
ARMV8_V14 
ARMV8_V15 
ARMV8_V16 
ARMV8_V17 
ARMV8_V18 
ARMV8_V19 
ARMV8_V20 
ARMV8_V21 
ARMV8_V22 
ARMV8_V23 
ARMV8_V24 
ARMV8_V25 
ARMV8_V26 
ARMV8_V27 
ARMV8_V28 
ARMV8_V29 
ARMV8_V30 
ARMV8_V31 
ARMV8_FPSR 
ARMV8_FPCR 
ARMV8_ELR_EL1 
ARMV8_ESR_EL1 
ARMV8_SPSR_EL1 
ARMV8_ELR_EL2 
ARMV8_ESR_EL2 
ARMV8_SPSR_EL2 
ARMV8_ELR_EL3 
ARMV8_ESR_EL3 
ARMV8_SPSR_EL3 
ARMV8_LAST_REG 

Definition at line 17 of file armv8.h.

◆ run_control_op

Enumerator
ARMV8_RUNCONTROL_UNKNOWN 
ARMV8_RUNCONTROL_RESUME 
ARMV8_RUNCONTROL_HALT 
ARMV8_RUNCONTROL_STEP 

Definition at line 104 of file armv8.h.

Function Documentation

◆ armv8_arch_state()

int armv8_arch_state ( struct target target)

Definition at line 1144 of file armv8.c.

◆ armv8_curel_from_core_mode()

static unsigned int armv8_curel_from_core_mode ( enum arm_mode  core_mode)
inlinestatic

◆ armv8_free_reg_cache()

void armv8_free_reg_cache ( struct target target)

Definition at line 1726 of file armv8.c.

Referenced by aarch64_deinit_target().

◆ armv8_handle_cache_info_command()

int armv8_handle_cache_info_command ( struct command_invocation cmd,
struct armv8_cache_common armv8_cache 
)

◆ armv8_identify_cache()

◆ armv8_init_arch_info()

◆ armv8_mmu_translate_va()

int armv8_mmu_translate_va ( struct target target,
target_addr_t  va,
target_addr_t val 
)

Definition at line 922 of file armv8.c.

References ERROR_OK.

◆ armv8_mmu_translate_va_pa()

◆ armv8_mode_name()

const char* armv8_mode_name ( unsigned  psr_mode)

Map PSR mode bits to the name of an ARM processor operating mode.

Definition at line 107 of file armv8.c.

References armv8_mode_data, ARRAY_SIZE, LOG_ERROR, and psr.

Referenced by aarch64_post_debug_entry(), aarch64_restore_system_control_reg(), armv8_aarch64_state(), and armv8_set_cpsr().

◆ armv8_read_mpidr()

◆ armv8_select_reg_access()

◆ armv8_set_cpsr()

void armv8_set_cpsr ( struct arm arm,
uint32_t  cpsr 
)

Configures host-side ARM records to reflect the specified CPSR.

Later, code can use arm_reg_current() to map register numbers according to how they are exposed by this mode.

Definition at line 675 of file armv8.c.

References ARM_STATE_AARCH64, ARM_STATE_ARM, ARM_STATE_JAZELLE, ARM_STATE_THUMB, ARM_STATE_THUMB_EE, armv8_mode_name(), armv8_state_strings, buf_set_u32(), arm::core_mode, arm::core_state, arm::cpsr, reg::dirty, LOG_DEBUG, LOG_ERROR, LOG_WARNING, mode, state, reg::valid, and reg::value.

Referenced by armv8_dpm_read_current_registers().

◆ armv8_set_dbgreg_bits()

int armv8_set_dbgreg_bits ( struct armv8_common armv8,
unsigned int  reg,
unsigned long  mask,
unsigned long  value 
)

◆ is_armv8()

static bool is_armv8 ( struct armv8_common armv8)
inlinestatic

Definition at line 233 of file armv8.h.

References ARMV8_COMMON_MAGIC, and armv8_common::common_magic.

Referenced by arm_semihosting(), arm_semihosting_resume(), and post_result().

◆ target_to_armv8()

Variable Documentation

◆ armv8_command_handlers

const struct command_registration armv8_command_handlers[]
extern

Definition at line 1726 of file armv8.c.