- remove build warnings
git-svn-id: svn://svn.berlios.de/openocd/trunk@1415 b42882b7-edfa-0310-969c-e2dbd0fdcd60
This commit is contained in:
parent
ae62743a4c
commit
c13924e32c
|
@ -27,6 +27,8 @@
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include "replacements.h"
|
||||||
|
|
||||||
#include "log.h"
|
#include "log.h"
|
||||||
#include "configuration.h"
|
#include "configuration.h"
|
||||||
#include "time_support.h"
|
#include "time_support.h"
|
||||||
|
@ -36,6 +38,7 @@
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#include <unistd.h>
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
|
|
||||||
#define PRINT_MEM() 0
|
#define PRINT_MEM() 0
|
||||||
|
|
|
@ -4,10 +4,10 @@
|
||||||
* *
|
* *
|
||||||
* Copyright (C) 2007,2008 Øyvind Harboe *
|
* Copyright (C) 2007,2008 Øyvind Harboe *
|
||||||
* oyvind.harboe@zylin.com *
|
* oyvind.harboe@zylin.com *
|
||||||
*
|
* *
|
||||||
* Copyright (C) 2009 SoftPLC Corporation
|
* Copyright (C) 2009 SoftPLC Corporation *
|
||||||
* http://softplc.com
|
* http://softplc.com *
|
||||||
* dick@softplc.com
|
* dick@softplc.com *
|
||||||
* *
|
* *
|
||||||
* This program is free software; you can redistribute it and/or modify *
|
* This program is free software; you can redistribute it and/or modify *
|
||||||
* it under the terms of the GNU General Public License as published by *
|
* it under the terms of the GNU General Public License as published by *
|
||||||
|
@ -44,7 +44,6 @@
|
||||||
*/
|
*/
|
||||||
int jtag_error=ERROR_OK;
|
int jtag_error=ERROR_OK;
|
||||||
|
|
||||||
|
|
||||||
typedef struct cmd_queue_page_s
|
typedef struct cmd_queue_page_s
|
||||||
{
|
{
|
||||||
void *address;
|
void *address;
|
||||||
|
@ -220,7 +219,7 @@ void jtag_add_runtest(int num_cycles, tap_state_t endstate);
|
||||||
void jtag_add_end_state(tap_state_t endstate);
|
void jtag_add_end_state(tap_state_t endstate);
|
||||||
void jtag_add_sleep(u32 us);
|
void jtag_add_sleep(u32 us);
|
||||||
int jtag_execute_queue(void);
|
int jtag_execute_queue(void);
|
||||||
|
int tap_state_by_name(const char *name);
|
||||||
|
|
||||||
/* jtag commands */
|
/* jtag commands */
|
||||||
int handle_interface_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc);
|
int handle_interface_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc);
|
||||||
|
@ -276,14 +275,13 @@ int jtag_NumEnabledTaps(void)
|
||||||
return n;
|
return n;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
jtag_tap_t *jtag_TapByString( const char *s )
|
jtag_tap_t *jtag_TapByString( const char *s )
|
||||||
{
|
{
|
||||||
jtag_tap_t *t;
|
jtag_tap_t *t;
|
||||||
char *cp;
|
char *cp;
|
||||||
|
|
||||||
t = jtag_AllTaps();
|
t = jtag_AllTaps();
|
||||||
// try name first
|
/* try name first */
|
||||||
while(t){
|
while(t){
|
||||||
if( 0 == strcmp( t->dotted_name, s ) ){
|
if( 0 == strcmp( t->dotted_name, s ) ){
|
||||||
break;
|
break;
|
||||||
|
@ -291,7 +289,7 @@ jtag_tap_t *jtag_TapByString( const char *s )
|
||||||
t = t->next_tap;
|
t = t->next_tap;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// backup plan is by number
|
/* backup plan is by number */
|
||||||
if( t == NULL ){
|
if( t == NULL ){
|
||||||
/* ok - is "s" a number? */
|
/* ok - is "s" a number? */
|
||||||
int n;
|
int n;
|
||||||
|
@ -538,7 +536,6 @@ int MINIDRIVER(interface_jtag_add_ir_scan)(int num_fields, scan_field_t *fields,
|
||||||
int nth_tap;
|
int nth_tap;
|
||||||
int scan_size = 0;
|
int scan_size = 0;
|
||||||
|
|
||||||
|
|
||||||
last_cmd = jtag_get_last_command_p();
|
last_cmd = jtag_get_last_command_p();
|
||||||
|
|
||||||
/* allocate memory for a new list member */
|
/* allocate memory for a new list member */
|
||||||
|
@ -560,7 +557,7 @@ int MINIDRIVER(interface_jtag_add_ir_scan)(int num_fields, scan_field_t *fields,
|
||||||
for(;;){
|
for(;;){
|
||||||
int found = 0;
|
int found = 0;
|
||||||
|
|
||||||
// do this here so it is not forgotten
|
/* do this here so it is not forgotten */
|
||||||
tap = jtag_NextEnabledTap(tap);
|
tap = jtag_NextEnabledTap(tap);
|
||||||
if( tap == NULL ){
|
if( tap == NULL ){
|
||||||
break;
|
break;
|
||||||
|
@ -1510,7 +1507,7 @@ int jtag_examine_chain(void)
|
||||||
return ERROR_JTAG_INIT_FAILED;
|
return ERROR_JTAG_INIT_FAILED;
|
||||||
}
|
}
|
||||||
|
|
||||||
// point at the 1st tap
|
/* point at the 1st tap */
|
||||||
tap = jtag_NextEnabledTap(NULL);
|
tap = jtag_NextEnabledTap(NULL);
|
||||||
if( tap == NULL ){
|
if( tap == NULL ){
|
||||||
LOG_ERROR("JTAG: No taps enabled?");
|
LOG_ERROR("JTAG: No taps enabled?");
|
||||||
|
@ -1714,9 +1711,7 @@ static Jim_Nvp nvp_config_opts[] = {
|
||||||
{ .name = NULL, .value = -1 }
|
{ .name = NULL, .value = -1 }
|
||||||
};
|
};
|
||||||
|
|
||||||
static int
|
static int jtag_tap_configure_cmd( Jim_GetOptInfo *goi, jtag_tap_t * tap)
|
||||||
jtag_tap_configure_cmd( Jim_GetOptInfo *goi,
|
|
||||||
jtag_tap_t * tap)
|
|
||||||
{
|
{
|
||||||
Jim_Nvp *n;
|
Jim_Nvp *n;
|
||||||
Jim_Obj *o;
|
Jim_Obj *o;
|
||||||
|
@ -2741,14 +2736,14 @@ int handle_irscan_command(struct command_context_s *cmd_ctx, char *cmd, char **a
|
||||||
return ERROR_COMMAND_SYNTAX_ERROR;
|
return ERROR_COMMAND_SYNTAX_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
// optional "-endstate"
|
/* optional "-endstate" */
|
||||||
// "statename"
|
/* "statename" */
|
||||||
// at the end of the arguments.
|
/* at the end of the arguments. */
|
||||||
// assume none.
|
/* assume none. */
|
||||||
endstate = -1;
|
endstate = -1;
|
||||||
if( argc >= 4 ){
|
if( argc >= 4 ){
|
||||||
// have at least one pair of numbers.
|
/* have at least one pair of numbers. */
|
||||||
// is last pair the magic text?
|
/* is last pair the magic text? */
|
||||||
if( 0 == strcmp( "-endstate", args[ argc - 2 ] ) ){
|
if( 0 == strcmp( "-endstate", args[ argc - 2 ] ) ){
|
||||||
const char *cpA;
|
const char *cpA;
|
||||||
const char *cpS;
|
const char *cpS;
|
||||||
|
@ -2762,13 +2757,12 @@ int handle_irscan_command(struct command_context_s *cmd_ctx, char *cmd, char **a
|
||||||
if( endstate >= 16 ){
|
if( endstate >= 16 ){
|
||||||
return ERROR_COMMAND_SYNTAX_ERROR;
|
return ERROR_COMMAND_SYNTAX_ERROR;
|
||||||
} else {
|
} else {
|
||||||
// found - remove the last 2 args
|
/* found - remove the last 2 args */
|
||||||
argc -= 2;
|
argc -= 2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
fields = malloc(sizeof(scan_field_t) * argc / 2);
|
fields = malloc(sizeof(scan_field_t) * argc / 2);
|
||||||
|
|
||||||
for (i = 0; i < argc / 2; i++)
|
for (i = 0; i < argc / 2; i++)
|
||||||
|
@ -2791,7 +2785,7 @@ int handle_irscan_command(struct command_context_s *cmd_ctx, char *cmd, char **a
|
||||||
}
|
}
|
||||||
|
|
||||||
jtag_add_ir_scan(argc / 2, fields, -1);
|
jtag_add_ir_scan(argc / 2, fields, -1);
|
||||||
// did we have an endstate?
|
/* did we have an endstate? */
|
||||||
if( endstate >= 0 ){
|
if( endstate >= 0 ){
|
||||||
jtag_add_end_state(endstate);
|
jtag_add_end_state(endstate);
|
||||||
}
|
}
|
||||||
|
@ -2821,7 +2815,7 @@ int Jim_Command_drscan(Jim_Interp *interp, int argc, Jim_Obj *const *args)
|
||||||
* ... repeat num bits and hex string ...
|
* ... repeat num bits and hex string ...
|
||||||
*
|
*
|
||||||
* .. optionally:
|
* .. optionally:
|
||||||
* args[N-2] = "-endstate"
|
* args[N-2] = "-endstate"
|
||||||
* args[N-1] = statename
|
* args[N-1] = statename
|
||||||
*/
|
*/
|
||||||
if ((argc < 4) || ((argc % 2)!=0))
|
if ((argc < 4) || ((argc % 2)!=0))
|
||||||
|
@ -2832,14 +2826,13 @@ int Jim_Command_drscan(Jim_Interp *interp, int argc, Jim_Obj *const *args)
|
||||||
|
|
||||||
/* assume no endstate */
|
/* assume no endstate */
|
||||||
endstate = -1;
|
endstate = -1;
|
||||||
// validate arguments as numbers
|
/* validate arguments as numbers */
|
||||||
e = JIM_OK;
|
e = JIM_OK;
|
||||||
for (i = 2; i < argc; i+=2)
|
for (i = 2; i < argc; i+=2)
|
||||||
{
|
{
|
||||||
long bits;
|
long bits;
|
||||||
const char *cp;
|
const char *cp;
|
||||||
|
|
||||||
|
|
||||||
e = Jim_GetLong(interp, args[i], &bits);
|
e = Jim_GetLong(interp, args[i], &bits);
|
||||||
/* If valid - try next arg */
|
/* If valid - try next arg */
|
||||||
if( e == JIM_OK ){
|
if( e == JIM_OK ){
|
||||||
|
@ -2909,7 +2902,7 @@ int Jim_Command_drscan(Jim_Interp *interp, int argc, Jim_Obj *const *args)
|
||||||
}
|
}
|
||||||
|
|
||||||
jtag_add_dr_scan(num_fields, fields, -1);
|
jtag_add_dr_scan(num_fields, fields, -1);
|
||||||
// did we get an end state?
|
/* did we get an end state? */
|
||||||
if( endstate >= 0 ){
|
if( endstate >= 0 ){
|
||||||
jtag_add_end_state( (tap_state_t)endstate );
|
jtag_add_end_state( (tap_state_t)endstate );
|
||||||
}
|
}
|
||||||
|
@ -3009,7 +3002,6 @@ void jtag_tap_handle_event( jtag_tap_t * tap, enum jtag_tap_event e)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*-----<Cable Helper API>---------------------------------------*/
|
/*-----<Cable Helper API>---------------------------------------*/
|
||||||
|
|
||||||
/* these Cable Helper API functions are all documented in the jtag.h header file,
|
/* these Cable Helper API functions are all documented in the jtag.h header file,
|
||||||
|
@ -3085,7 +3077,6 @@ int tap_move_ndx( tap_state_t astate )
|
||||||
return ndx;
|
return ndx;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int tap_get_tms_path( tap_state_t from, tap_state_t to )
|
int tap_get_tms_path( tap_state_t from, tap_state_t to )
|
||||||
{
|
{
|
||||||
/* tap_move[i][j]: tap movement command to go from state i to state j
|
/* tap_move[i][j]: tap movement command to go from state i to state j
|
||||||
|
@ -3278,8 +3269,7 @@ const char* tap_state_name(tap_state_t state)
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int tap_state_by_name( const char *name )
|
||||||
tap_state_by_name( const char *name )
|
|
||||||
{
|
{
|
||||||
int x;
|
int x;
|
||||||
|
|
||||||
|
|
|
@ -1450,17 +1450,18 @@ static int xscale_step_inner(struct target_s *target, int current, u32 address,
|
||||||
armv4_5_common_t *armv4_5 = target->arch_info;
|
armv4_5_common_t *armv4_5 = target->arch_info;
|
||||||
xscale_common_t *xscale = armv4_5->arch_info;
|
xscale_common_t *xscale = armv4_5->arch_info;
|
||||||
|
|
||||||
u32 current_pc, next_pc;
|
u32 next_pc;
|
||||||
int retval;
|
int retval;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
|
||||||
target->debug_reason = DBG_REASON_SINGLESTEP;
|
target->debug_reason = DBG_REASON_SINGLESTEP;
|
||||||
|
|
||||||
/* calculate PC of next instruction */
|
/* calculate PC of next instruction */
|
||||||
if ((retval = arm_simulate_step(target, &next_pc)) != ERROR_OK)
|
if ((retval = arm_simulate_step(target, &next_pc)) != ERROR_OK)
|
||||||
{
|
{
|
||||||
u32 current_opcode;
|
u32 current_opcode, current_pc;
|
||||||
|
current_pc = buf_get_u32(armv4_5->core_cache->reg_list[15].value, 0, 32);
|
||||||
|
|
||||||
target_read_u32(target, current_pc, ¤t_opcode);
|
target_read_u32(target, current_pc, ¤t_opcode);
|
||||||
LOG_ERROR("BUG: couldn't calculate PC of next instruction, current opcode was 0x%8.8x", current_opcode);
|
LOG_ERROR("BUG: couldn't calculate PC of next instruction, current opcode was 0x%8.8x", current_opcode);
|
||||||
return retval;
|
return retval;
|
||||||
|
|
Loading…
Reference in New Issue