From: ntfreak at B. <nt...@ma...> - 2009-03-17 11:22:27
|
Author: ntfreak Date: 2009-03-17 11:22:26 +0100 (Tue, 17 Mar 2009) New Revision: 1415 Modified: trunk/src/helper/log.c trunk/src/jtag/jtag.c trunk/src/target/xscale.c Log: - remove build warnings Modified: trunk/src/helper/log.c =================================================================== --- trunk/src/helper/log.c 2009-03-17 09:48:46 UTC (rev 1414) +++ trunk/src/helper/log.c 2009-03-17 10:22:26 UTC (rev 1415) @@ -27,6 +27,8 @@ #include "config.h" #endif +#include "replacements.h" + #include "log.h" #include "configuration.h" #include "time_support.h" @@ -36,6 +38,7 @@ #include <stdio.h> #include <stdlib.h> #include <string.h> +#include <unistd.h> #include <stdarg.h> #define PRINT_MEM() 0 Modified: trunk/src/jtag/jtag.c =================================================================== --- trunk/src/jtag/jtag.c 2009-03-17 09:48:46 UTC (rev 1414) +++ trunk/src/jtag/jtag.c 2009-03-17 10:22:26 UTC (rev 1415) @@ -4,11 +4,11 @@ * * * Copyright (C) 2007,2008 vind Harboe * * oyv...@zy... * - * - * Copyright (C) 2009 SoftPLC Corporation - * http://softplc.com - * di...@so... * * + * Copyright (C) 2009 SoftPLC Corporation * + * http://softplc.com * + * di...@so... * + * * * 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 * * the Free Software Foundation; either version 2 of the License, or * @@ -44,7 +44,6 @@ */ int jtag_error=ERROR_OK; - typedef struct cmd_queue_page_s { void *address; @@ -220,8 +219,8 @@ void jtag_add_end_state(tap_state_t endstate); void jtag_add_sleep(u32 us); int jtag_execute_queue(void); +int tap_state_by_name(const char *name); - /* jtag commands */ int handle_interface_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc); int handle_jtag_speed_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc); @@ -276,14 +275,13 @@ return n; } - jtag_tap_t *jtag_TapByString( const char *s ) { jtag_tap_t *t; char *cp; t = jtag_AllTaps(); - // try name first + /* try name first */ while(t){ if( 0 == strcmp( t->dotted_name, s ) ){ break; @@ -291,7 +289,7 @@ t = t->next_tap; } } - // backup plan is by number + /* backup plan is by number */ if( t == NULL ){ /* ok - is "s" a number? */ int n; @@ -538,7 +536,6 @@ int nth_tap; int scan_size = 0; - last_cmd = jtag_get_last_command_p(); /* allocate memory for a new list member */ @@ -560,7 +557,7 @@ for(;;){ int found = 0; - // do this here so it is not forgotten + /* do this here so it is not forgotten */ tap = jtag_NextEnabledTap(tap); if( tap == NULL ){ break; @@ -1510,7 +1507,7 @@ return ERROR_JTAG_INIT_FAILED; } - // point at the 1st tap + /* point at the 1st tap */ tap = jtag_NextEnabledTap(NULL); if( tap == NULL ){ LOG_ERROR("JTAG: No taps enabled?"); @@ -1714,9 +1711,7 @@ { .name = NULL, .value = -1 } }; -static int -jtag_tap_configure_cmd( Jim_GetOptInfo *goi, - jtag_tap_t * tap) +static int jtag_tap_configure_cmd( Jim_GetOptInfo *goi, jtag_tap_t * tap) { Jim_Nvp *n; Jim_Obj *o; @@ -2741,14 +2736,14 @@ return ERROR_COMMAND_SYNTAX_ERROR; } - // optional "-endstate" - // "statename" - // at the end of the arguments. - // assume none. + /* optional "-endstate" */ + /* "statename" */ + /* at the end of the arguments. */ + /* assume none. */ endstate = -1; if( argc >= 4 ){ - // have at least one pair of numbers. - // is last pair the magic text? + /* have at least one pair of numbers. */ + /* is last pair the magic text? */ if( 0 == strcmp( "-endstate", args[ argc - 2 ] ) ){ const char *cpA; const char *cpS; @@ -2762,13 +2757,12 @@ if( endstate >= 16 ){ return ERROR_COMMAND_SYNTAX_ERROR; } else { - // found - remove the last 2 args + /* found - remove the last 2 args */ argc -= 2; } } } - fields = malloc(sizeof(scan_field_t) * argc / 2); for (i = 0; i < argc / 2; i++) @@ -2791,7 +2785,7 @@ } jtag_add_ir_scan(argc / 2, fields, -1); - // did we have an endstate? + /* did we have an endstate? */ if( endstate >= 0 ){ jtag_add_end_state(endstate); } @@ -2819,9 +2813,9 @@ * args[2] = num_bits * args[3] = hex string * ... repeat num bits and hex string ... - * + * * .. optionally: - * args[N-2] = "-endstate" + * args[N-2] = "-endstate" * args[N-1] = statename */ if ((argc < 4) || ((argc % 2)!=0)) @@ -2832,13 +2826,12 @@ /* assume no endstate */ endstate = -1; - // validate arguments as numbers + /* validate arguments as numbers */ e = JIM_OK; for (i = 2; i < argc; i+=2) { long bits; const char *cp; - e = Jim_GetLong(interp, args[i], &bits); /* If valid - try next arg */ @@ -2877,7 +2870,7 @@ /* Still an error? */ if( e != JIM_OK ){ return e; /* too bad */ - } + } } /* validate args */ tap = jtag_TapByJimObj( interp, args[1] ); @@ -2907,9 +2900,9 @@ fields[field_count].in_handler = NULL; fields[field_count++].in_handler_priv = NULL; } - + jtag_add_dr_scan(num_fields, fields, -1); - // did we get an end state? + /* did we get an end state? */ if( endstate >= 0 ){ jtag_add_end_state( (tap_state_t)endstate ); } @@ -3009,7 +3002,6 @@ } } - /*-----<Cable Helper API>---------------------------------------*/ /* these Cable Helper API functions are all documented in the jtag.h header file, @@ -3085,7 +3077,6 @@ return ndx; } - 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 @@ -3278,11 +3269,10 @@ return ret; } -int -tap_state_by_name( const char *name ) +int tap_state_by_name( const char *name ) { int x; - + for( x = 0 ; x < 16 ; x++ ){ /* be nice to the human */ if( 0 == strcasecmp( name, tap_state_name(x) ) ){ Modified: trunk/src/target/xscale.c =================================================================== --- trunk/src/target/xscale.c 2009-03-17 09:48:46 UTC (rev 1414) +++ trunk/src/target/xscale.c 2009-03-17 10:22:26 UTC (rev 1415) @@ -1450,17 +1450,18 @@ armv4_5_common_t *armv4_5 = target->arch_info; xscale_common_t *xscale = armv4_5->arch_info; - u32 current_pc, next_pc; + u32 next_pc; int retval; int i; - target->debug_reason = DBG_REASON_SINGLESTEP; /* calculate PC of next instruction */ 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); LOG_ERROR("BUG: couldn't calculate PC of next instruction, current opcode was 0x%8.8x", current_opcode); return retval; |