jt_arm_support.c File Reference

#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <stdio.h>
#include "dbg_msg.h"
#include "jt_arm.h"
#include "jt_instr.h"

Functions


Detailed Description

ARM7TDMI / ARM9TDMI Interface (support functions)


Function Documentation

void jtag_supp_int2bitstr_MSB_First ( int  len,
int32_t  val,
char *  str 
)
void jtag_supp_int2bitstr_LSB_First ( int  len,
int32_t  val,
char *  str 
)

support function to create a bit string with LSB first
e.g.
len = 4
val = 12 = 0xC = 0b1100
str = "0011"

Parameters:
len bit string length
val original 32-bit integer value
str pointer to bit string
Returns:
-

Referenced by jtag_arm720_CP15DataExchange(), jtag_arm720_CP15InstrReg(), jtag_arm7_mov_chain1_data(), and jtag_arm9_mov_chain1_data().

void jtag_supp_bitstr2int_LSB_First ( int  len,
int32_t *  val,
char *  str 
)

support function to generate an integer value out of the bit string e.g.
len = 4
str = "0011"
val = 12 = 0xC = 0b1100

Parameters:
len bit string length
val pointer to 32-bit integer value
str pointer to source bit string
Returns:
-

Referenced by jtag_arm720_CP15DataExchange(), jtag_arm720_CP15InstrReg(), jtag_arm7_mov_chain1_data(), and jtag_arm9_mov_chain1_data().

void jtag_supp_bitstr2int_MSB_First ( int  len,
int32_t *  val,
char *  str 
)
int jtag_arm_identify ( void   ) 

support function to check if this is the correct device

Parameters:
- 
Return values:
1 if well known device
<= 0 no device or unknown device

References jtag_identify_devices().

Referenced by gdb_restart(), and jtag_test().

int is_arm_store_instr ( uint32_t  step_instr  ) 

support function to check type of instruction
check if this is a kind of ARM store instruction

Parameters:
step_instr intruction to check
Return values:
1 true
0 false

References ARM_STORE, ARM_STORE_COPROCESSOR_REG, ARM_STORE_COPROCESSOR_REG_MSK, ARM_STORE_MISC, ARM_STORE_MISC_MSK, ARM_STORE_MSK, ARM_STORE_MULTIPLE, and ARM_STORE_MULTIPLE_MSK.

Referenced by gdb_action_step().

int is_thumb_store_instr ( uint32_t  step_instr  ) 

support function to check type of instruction
check if this is a kind of THUMB store instruction

Parameters:
step_instr instruction to check
Return values:
1 true
0 false

References THUMB_STORE_A_1, THUMB_STORE_A_3, THUMB_STORE_A_BYTE_1, THUMB_STORE_A_HALF_1, THUMB_STORE_A_MSK, THUMB_STORE_A_MULTIPLE, THUMB_STORE_B_2, THUMB_STORE_B_BYTE_2, THUMB_STORE_B_HALF_2, THUMB_STORE_B_MSK, and THUMB_STORE_B_PUSH.

Referenced by gdb_action_step().

int is_arm_bl_instr ( uint32_t  step_instr  ) 

support function to check type of instruction
check if this is an ARM branch and link instruction

Parameters:
step_instr instruction to check
Return values:
1 true
0 false

References ARM_BL_INSTR, ARM_BL_MSK, ARM_BLX_1_INSTR, ARM_BLX_1_MSK, ARM_BLX_2_INSTR, ARM_BLX_2_MSK, and jt_arm_condition_pass().

Referenced by gdb_action_step(), and gdb_handle_exception().

int is_arm_load_banked_regs_instr ( uint32_t  step_instr  ) 

support function to check type of instruction
check if this is will change the banked registers

Parameters:
step_instr instruction to check
Return values:
1 true
0 false

References ARM_LOAD_MULTIPLE_BANK, ARM_LOAD_MULTIPLE_BANK_MSK, ARM_MSR_SPSR_IMM, ARM_MSR_SPSR_MSK, ARM_MSR_SPSR_REG, reg_set::CPSR, CPU, CPU_CPSR_MODE_ABORT, CPU_CPSR_MODE_FIQ, CPU_CPSR_MODE_FLAGS, CPU_CPSR_MODE_IRQ, CPU_CPSR_MODE_SVC, CPU_CPSR_MODE_UNDEF_INSTR, and jt_arm_condition_pass().

Referenced by jtag_arm_Step().

int jt_arm_condition_pass ( uint32_t  step_instr  ) 

check ARM condition flags of ARM instruction
cpsr flags: N Z C V

Parameters:
step_instr intruction to check
Return values:
1 pass (intr. will be executed)
0 fail

References reg_set::CPSR, CPU, and jt_arm_condition_check().

Referenced by arm_step_emu(), is_arm_bl_instr(), is_arm_load_banked_regs_instr(), jt_arm_instr_access_mem(), jt_arm_instr_bx_workaround(), jt_arm_instr_modifys_PC(), jt_thumb_instr_modifys_PC(), and thumb_step_emu().

int jt_arm_condition_check ( uint32_t  condition,
uint32_t  cpsr 
)
int jt_arm_instr_modifys_PC ( uint32_t  step_instr  ) 

support function to check if the given instruction will modify the program counter

Parameters:
step_instr instruction to check
Return values:
1 true
0 false

References jt_arm_condition_pass().

Referenced by gdb_action_step(), gdb_handle_exception(), jtag_arm7_Step(), and jtag_arm9_Step().

int jt_thumb_instr_modifys_PC ( uint32_t  step_instr  ) 

support function to check if the given instruction will modify the program counter

Parameters:
step_instr intruction to check
Return values:
1 true
0 false

References jt_arm_condition_pass().

Referenced by gdb_action_step(), gdb_handle_exception(), jtag_arm7_Step(), and jtag_arm9_Step().

int jt_arm_instr_access_mem ( uint32_t  step_instr  ) 

check if the ARM instruction is doing an access to the Memory.

Parameters:
step_instr intruction to check
Return values:
1 true
0 false

References jt_arm_condition_pass().

Referenced by jtag_arm7_Step(), and jtag_arm9_Step().

int jt_thumb_instr_access_mem ( uint32_t  step_instr  ) 

check if the THUMB instruction is doing an access to the Memory.

Parameters:
step_instr intruction to check
Return values:
1 true
0 false

Referenced by jtag_arm7_Step().

int jt_arm_instr_bx_workaround ( uint32_t  step_instr  ) 

check if this is the bx instruction and if so do the bx workaround, now

Parameters:
step_instr intruction to check
Return values:
1 true
0 false

References reg_set::CPSR, CPU, jt_arm_condition_pass(), reg_set::Regs::r, and reg_set::regs.

Referenced by gdb_action_step().

int jt_thumb_instr_bx_workaround ( uint32_t  step_instr  ) 

check if this is the bx instruction and if so do the bx workaround, now

Parameters:
step_instr intruction to check
Return values:
1 true
0 false

References reg_set::CPSR, CPU, reg_set::Regs::r, and reg_set::regs.

Referenced by gdb_action_step().


This file is part of the documentation for JTAG-GDB Server for ARM .

Generated on Mon Feb 15 21:23:21 2010 by doxygen 1.6.2.