jt_arm9.c File Reference

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

Functions

Variables


Detailed Description

ARM9TDMI Interface
The ARM9TDMI core uses scan chain 1 with a wide of 67 bits (with 32 bit instr, 32 bit data and 3 bit control) to send instructions and exchange data values to the debug unit.


Function Documentation

void jtag_arm9_ReadCpuRegs ( int  reset_inst_counter,
int  status 
)
void jtag_arm9_WriteCpuRegs ( void   ) 

Write back the stored CPU register to the ARM core.
(This function is used for test only.)

Parameters:
- 
Returns:
-

References ARM_LDMIA, ARM_NOP, CPU, DEBUG_REPEAT_SPEED, DEBUG_SPEED, jtag_arm9_mov_chain1_data(), reg_set::Regs::r, reg_set::regs, transactionActivate(), transactionCreate(), transactionErase(), transactionExecute(), transactionGet(), transactionPenting(), transaction::uplevel, and WRITE_ONLY.

Referenced by jtag_arm_WriteCpuRegs().

void jtag_arm9_PrepareExitDebug ( void   ) 

Write back the stored CPU register to the ARM core and restart execution to continue the current program.

-- note on exit we messed up the PC so we can't access the Memory within the debug state.
But we can correct this next time we read out the CPU register

Parameters:
- 
Returns:
-

References ARM_BX_R0, ARM_LD_R0_PC, ARM_LDMIA, ARM_MSR_CPSR_R0, ARM_NOP, reg_set::CPSR, CPU, CPU_CPSR_FLAG_THUMB, DEBUG_REPEAT_SPEED, DEBUG_SPEED, jtag_arm9_mov_chain1_data(), reg_set::Regs::r, reg_set::regs, SYSTEM_SPEED, THUMB_LD_R0_PC, THUMB_NOP, transactionActivate(), transactionCreate(), transactionErase(), transactionExecute(), transactionGet(), transactionPenting(), transaction::uplevel, and WRITE_ONLY.

Referenced by jtag_arm_PrepareExitDebug().

void jtag_arm9_Step ( uint32_t  next_instr  ) 
void jtag_arm9_ResynchStep ( void   ) 
void jtag_arm9_ReadWordMemory ( uint32_t  address,
int  howmanywords,
uint32_t *  buf 
)

Read out word memory into the given buffer.


Max read speed : 9 Kbytes/sec

Parameters:
address target machine address (memory at ARM side)
howmanywords number of words to read
buf pointer to destination read buffer (memory at server side)
Returns:
-

References ARM_LD_R0_PC, ARM_LDMIA, ARM_LDMIA_UPDATE, ARM_NOP, ARM_STMIA, DBG_LEVEL_GDB_ARM_INFO, dbgPrintf(), DEBUG_REPEAT_SPEED, DEBUG_SPEED, jtag_arm9_mov_chain1_data(), jtag_arm_chain1_sysspeed_restart(), transaction::parameter, READ_WRITE, SYSTEM_SPEED, transactionActivate(), transactionCreate(), transactionErase(), transactionExecute(), transactionGet(), transaction::uplevel, and WRITE_ONLY.

Referenced by jtag_arm_ReadWordMemory().

uint32_t jtag_arm9_ReadWord ( uint32_t  address  ) 
uint32_t jtag_arm9_ReadHalfword ( uint32_t  address  ) 
uint32_t jtag_arm9_ReadByte ( uint32_t  address  ) 
void jtag_arm9_WriteWord ( uint32_t  address,
uint32_t  value 
)

32-bit memory write

Parameters:
address target machine address (memory at ARM side)
value 32 bit value to write
Returns:
-

References ARM_LDMIA, ARM_NOP, ARM_STMDA, DEBUG_REPEAT_SPEED, DEBUG_SPEED, jtag_arm9_mov_chain1_data(), jtag_arm_chain1_sysspeed_restart(), SYSTEM_SPEED, transactionActivate(), transactionCreate(), transactionErase(), transactionGet(), transaction::uplevel, and WRITE_ONLY.

Referenced by jtag_arm_WriteWord().

void jtag_arm9_WriteHalfword ( uint32_t  address,
uint16_t  value 
)

16-bit memory write

Parameters:
address target machine address (memory at ARM side)
value 16 bit value to write
Returns:
-

References ARM_LDMIA, ARM_NOP, ARM_STRH, DEBUG_REPEAT_SPEED, DEBUG_SPEED, jtag_arm9_mov_chain1_data(), jtag_arm_chain1_sysspeed_restart(), SYSTEM_SPEED, transactionActivate(), transactionCreate(), transactionErase(), transactionGet(), transaction::uplevel, and WRITE_ONLY.

Referenced by jtag_arm_WriteHalfword().

void jtag_arm9_WriteByte ( uint32_t  address,
uint16_t  value 
)

8-bit memory write

Parameters:
address target machine address (memory at ARM side)
value 8 bit value to write
Returns:
-

References ARM_LDMIA, ARM_NOP, ARM_STRB, DEBUG_REPEAT_SPEED, DEBUG_SPEED, jtag_arm9_mov_chain1_data(), jtag_arm_chain1_sysspeed_restart(), SYSTEM_SPEED, transactionActivate(), transactionCreate(), transactionErase(), transactionGet(), transaction::uplevel, and WRITE_ONLY.

Referenced by jtag_arm_WriteByte().

void jtag_arm9_WriteMemoryBuf ( uint32_t  address,
int  howmanywords,
uint32_t *  buf 
)

Write back word memory from the given buffer.

Parameters:
address target machine address (memory at ARM side)
howmanywords number of words to read
buf pointer to source write buffer (memory at server side)
Returns:
-

References ARM_LDMIA, ARM_NOP, ARM_STMIA, DEBUG_REPEAT_SPEED, DEBUG_SPEED, jtag_arm9_mov_chain1_data(), jtag_arm_chain1_sysspeed_restart(), SYSTEM_SPEED, transactionActivate(), transactionCreate(), transactionErase(), transactionGet(), transaction::uplevel, and WRITE_ONLY.

Referenced by jtag_arm_WriteMemoryBuf().

void jtag_arm9_RunProgram ( uint32_t  address  ) 

Variable Documentation

uint32_t expect_cpsr_after_step[CPU_CPSR_MODE_FLAGS+1] [static]

XXX terrible hack for , ARM9TDMI soft core
it seems that we are loseing N- and Z- CPSR-Flags
so let the thumb_step_emu calculate them (or expect they are unchanged)
if we should use the emulating result based on an expected PC after the step, or it base on an expected modification (e.g. done by return).

Referenced by jtag_arm9_ReadCpuRegs(), and jtag_arm9_Step().

uint32_t expect_pc_after_step[CPU_CPSR_MODE_FLAGS+1] [static]

helper for expect_cpsr_after_step

Referenced by jtag_arm9_ReadCpuRegs(), and jtag_arm9_Step().

char expect_modified_pc_after_step[CPU_CPSR_MODE_FLAGS+1] [static]

helper for expect_cpsr_after_step

Referenced by jtag_arm9_ReadCpuRegs(), and jtag_arm9_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.