Commit ef1cfb23 authored by oharboe's avatar oharboe
Browse files

Duane Ellis: "target as an [tcl] object" feature.

git-svn-id: svn://svn.berlios.de/openocd/trunk@975 b42882b7-edfa-0310-969c-e2dbd0fdcd60
parent 3c8ef2c4
...@@ -210,7 +210,7 @@ command_t* register_command(command_context_t *context, command_t *parent, char ...@@ -210,7 +210,7 @@ command_t* register_command(command_context_t *context, command_t *parent, char
/* we now need to add an overrideable proc */ /* we now need to add an overrideable proc */
const char *override_name=alloc_printf("proc %s%s%s {args} {if {[catch {eval \"ocd_%s%s%s $args\"}]==0} {return \"\"} else { return -code error }", t1, t2, t3, t1, t2, t3); const char *override_name=alloc_printf("proc %s%s%s {args} {if {[catch {eval \"ocd_%s%s%s $args\"}]==0} {return \"\"} else { return -code error }", t1, t2, t3, t1, t2, t3);
Jim_Eval(interp, override_name); Jim_Eval_Named(interp, override_name, __FILE__, __LINE__ );
free((void *)override_name); free((void *)override_name);
/* accumulate help text in Tcl helptext list. */ /* accumulate help text in Tcl helptext list. */
...@@ -430,7 +430,7 @@ int command_run_line(command_context_t *context, char *line) ...@@ -430,7 +430,7 @@ int command_run_line(command_context_t *context, char *line)
retcode = Jim_SetAssocData(interp, "retval", NULL, &retval); retcode = Jim_SetAssocData(interp, "retval", NULL, &retval);
if (retcode == JIM_OK) if (retcode == JIM_OK)
{ {
retcode = Jim_Eval(interp, line); retcode = Jim_Eval_Named(interp, line, __FILE__, __LINE__ );
Jim_DeleteAssocData(interp, "retval"); Jim_DeleteAssocData(interp, "retval");
} }
...@@ -658,7 +658,7 @@ command_context_t* command_init() ...@@ -658,7 +658,7 @@ command_context_t* command_init()
#ifdef JIM_EMBEDDED #ifdef JIM_EMBEDDED
Jim_EventLoopOnLoad(interp); Jim_EventLoopOnLoad(interp);
#endif #endif
if (Jim_Eval(interp, startup_tcl)==JIM_ERR) if (Jim_Eval_Named(interp, startup_tcl, "embedded:startup.tcl",1)==JIM_ERR)
{ {
LOG_ERROR("Failed to run startup.tcl (embedded into OpenOCD compile time)"); LOG_ERROR("Failed to run startup.tcl (embedded into OpenOCD compile time)");
Jim_PrintErrorMessage(interp); Jim_PrintErrorMessage(interp);
......
...@@ -111,6 +111,33 @@ static Jim_HashTableType JimVariablesHashTableType; ...@@ -111,6 +111,33 @@ static Jim_HashTableType JimVariablesHashTableType;
* Utility functions * Utility functions
* ---------------------------------------------------------------------------*/ * ---------------------------------------------------------------------------*/
static char *
jim_vasprintf( const char *fmt, va_list ap )
{
#ifndef HAVE_VASPRINTF
/* yucky way */
static char buf[2048];
vsnprintf( buf, sizeof(buf), fmt, ap );
/* garentee termination */
buf[sizeof(buf)-1] = 0;
#else
char *buf;
vasprintf( &buf, fmt, ap );
#endif
return buf;
}
static void
jim_vasprintf_done( void *buf )
{
#ifndef HAVE_VASPRINTF
(void)(buf);
#else
free(buf);
#endif
}
/* /*
* Convert a string to a jim_wide INTEGER. * Convert a string to a jim_wide INTEGER.
* This function originates from BSD. * This function originates from BSD.
...@@ -2019,6 +2046,22 @@ void Jim_AppendString(Jim_Interp *interp, Jim_Obj *objPtr, const char *str, ...@@ -2019,6 +2046,22 @@ void Jim_AppendString(Jim_Interp *interp, Jim_Obj *objPtr, const char *str,
StringAppendString(objPtr, str, len); StringAppendString(objPtr, str, len);
} }
void Jim_AppendString_sprintf( Jim_Interp *interp, Jim_Obj *objPtr, const char *fmt, ... )
{
char *buf;
va_list ap;
va_start( ap, fmt );
buf = jim_vasprintf( fmt, ap );
va_end(ap);
if( buf ){
Jim_AppendString( interp, objPtr, buf, -1 );
jim_vasprintf_done(buf);
}
}
void Jim_AppendObj(Jim_Interp *interp, Jim_Obj *objPtr, void Jim_AppendObj(Jim_Interp *interp, Jim_Obj *objPtr,
Jim_Obj *appendObjPtr) Jim_Obj *appendObjPtr)
{ {
...@@ -8726,17 +8769,31 @@ int JimCallProcedure(Jim_Interp *interp, Jim_Cmd *cmd, int argc, ...@@ -8726,17 +8769,31 @@ int JimCallProcedure(Jim_Interp *interp, Jim_Cmd *cmd, int argc,
return retcode; return retcode;
} }
int Jim_Eval(Jim_Interp *interp, const char *script) int Jim_Eval_Named(Jim_Interp *interp, const char *script, const char *filename, int lineno)
{ {
Jim_Obj *scriptObjPtr = Jim_NewStringObj(interp, script, -1);
int retval; int retval;
Jim_Obj *scriptObjPtr;
scriptObjPtr = Jim_NewStringObj(interp, script, -1);
Jim_IncrRefCount(scriptObjPtr); Jim_IncrRefCount(scriptObjPtr);
if( filename ){
JimSetSourceInfo( interp, scriptObjPtr, filename, lineno );
}
retval = Jim_EvalObj(interp, scriptObjPtr); retval = Jim_EvalObj(interp, scriptObjPtr);
Jim_DecrRefCount(interp, scriptObjPtr); Jim_DecrRefCount(interp, scriptObjPtr);
return retval; return retval;
} }
int Jim_Eval(Jim_Interp *interp, const char *script)
{
return Jim_Eval_Named( interp, script, NULL, 0 );
}
/* Execute script in the scope of the global level */ /* Execute script in the scope of the global level */
int Jim_EvalGlobal(Jim_Interp *interp, const char *script) int Jim_EvalGlobal(Jim_Interp *interp, const char *script)
{ {
...@@ -9076,6 +9133,7 @@ void JimRegisterCoreApi(Jim_Interp *interp) ...@@ -9076,6 +9133,7 @@ void JimRegisterCoreApi(Jim_Interp *interp)
JIM_REGISTER_API(Alloc); JIM_REGISTER_API(Alloc);
JIM_REGISTER_API(Free); JIM_REGISTER_API(Free);
JIM_REGISTER_API(Eval); JIM_REGISTER_API(Eval);
JIM_REGISTER_API(Eval_Named);
JIM_REGISTER_API(EvalGlobal); JIM_REGISTER_API(EvalGlobal);
JIM_REGISTER_API(EvalFile); JIM_REGISTER_API(EvalFile);
JIM_REGISTER_API(EvalObj); JIM_REGISTER_API(EvalObj);
...@@ -9102,6 +9160,7 @@ void JimRegisterCoreApi(Jim_Interp *interp) ...@@ -9102,6 +9160,7 @@ void JimRegisterCoreApi(Jim_Interp *interp)
JIM_REGISTER_API(NewStringObj); JIM_REGISTER_API(NewStringObj);
JIM_REGISTER_API(NewStringObjNoAlloc); JIM_REGISTER_API(NewStringObjNoAlloc);
JIM_REGISTER_API(AppendString); JIM_REGISTER_API(AppendString);
JIM_REGISTER_API(AppendString_sprintf);
JIM_REGISTER_API(AppendObj); JIM_REGISTER_API(AppendObj);
JIM_REGISTER_API(AppendStrings); JIM_REGISTER_API(AppendStrings);
JIM_REGISTER_API(StringEqObj); JIM_REGISTER_API(StringEqObj);
...@@ -12536,27 +12595,15 @@ int ...@@ -12536,27 +12595,15 @@ int
Jim_SetResult_sprintf( Jim_Interp *interp, const char *fmt,... ) Jim_SetResult_sprintf( Jim_Interp *interp, const char *fmt,... )
{ {
va_list ap; va_list ap;
#ifndef HAVE_VASPRINTF
/* yucky way */
char buf[2048];
va_start(ap,fmt);
vsnprintf( buf, sizeof(buf), fmt, ap );
va_end(ap);
/* garentee termination */
buf[2047] = 0;
Jim_SetResultString( interp, buf, -1 );
#else
char *buf; char *buf;
va_start(ap,fmt); va_start(ap,fmt);
vasprintf( &buf, fmt, ap ); buf = jim_vasprintf( fmt, ap );
va_end(ap); va_end(ap);
if( buf ){ if( buf ){
Jim_SetResultString( interp, buf, -1 ); Jim_SetResultString( interp, buf, -1 );
free(buf); jim_vasprintf_done(buf);
} }
#endif
return JIM_OK; return JIM_OK;
} }
......
...@@ -675,6 +675,9 @@ JIM_STATIC char * JIM_API(Jim_StrDup) (const char *s); ...@@ -675,6 +675,9 @@ JIM_STATIC char * JIM_API(Jim_StrDup) (const char *s);
/* evaluation */ /* evaluation */
JIM_STATIC int JIM_API(Jim_Eval)(Jim_Interp *interp, const char *script); JIM_STATIC int JIM_API(Jim_Eval)(Jim_Interp *interp, const char *script);
/* in C code, you can do this and get better error messages */
/* Jim_Eval_Named( interp, "some tcl commands", __FILE__, __LINE__ ); */
JIM_STATIC int JIM_API(Jim_Eval_Named)(Jim_Interp *interp, const char *script,const char *filename, int lineno);
JIM_STATIC int JIM_API(Jim_EvalGlobal)(Jim_Interp *interp, const char *script); JIM_STATIC int JIM_API(Jim_EvalGlobal)(Jim_Interp *interp, const char *script);
JIM_STATIC int JIM_API(Jim_EvalFile)(Jim_Interp *interp, const char *filename); JIM_STATIC int JIM_API(Jim_EvalFile)(Jim_Interp *interp, const char *filename);
JIM_STATIC int JIM_API(Jim_EvalObj) (Jim_Interp *interp, Jim_Obj *scriptObjPtr); JIM_STATIC int JIM_API(Jim_EvalObj) (Jim_Interp *interp, Jim_Obj *scriptObjPtr);
...@@ -733,6 +736,8 @@ JIM_STATIC Jim_Obj * JIM_API(Jim_NewStringObjNoAlloc) (Jim_Interp *interp, ...@@ -733,6 +736,8 @@ JIM_STATIC Jim_Obj * JIM_API(Jim_NewStringObjNoAlloc) (Jim_Interp *interp,
char *s, int len); char *s, int len);
JIM_STATIC void JIM_API(Jim_AppendString) (Jim_Interp *interp, Jim_Obj *objPtr, JIM_STATIC void JIM_API(Jim_AppendString) (Jim_Interp *interp, Jim_Obj *objPtr,
const char *str, int len); const char *str, int len);
JIM_STATIC void JIM_API(Jim_AppendString_sprintf) (Jim_Interp *interp, Jim_Obj *objPtr,
const char *fmt, ... );
JIM_STATIC void JIM_API(Jim_AppendObj) (Jim_Interp *interp, Jim_Obj *objPtr, JIM_STATIC void JIM_API(Jim_AppendObj) (Jim_Interp *interp, Jim_Obj *objPtr,
Jim_Obj *appendObjPtr); Jim_Obj *appendObjPtr);
JIM_STATIC void JIM_API(Jim_AppendStrings) (Jim_Interp *interp, JIM_STATIC void JIM_API(Jim_AppendStrings) (Jim_Interp *interp,
...@@ -1169,6 +1174,7 @@ static void Jim_InitExtension(Jim_Interp *interp) ...@@ -1169,6 +1174,7 @@ static void Jim_InitExtension(Jim_Interp *interp)
JIM_GET_API(Alloc); JIM_GET_API(Alloc);
JIM_GET_API(Free); JIM_GET_API(Free);
JIM_GET_API(Eval); JIM_GET_API(Eval);
JIM_GET_API(Eval_Named);
JIM_GET_API(EvalGlobal); JIM_GET_API(EvalGlobal);
JIM_GET_API(EvalFile); JIM_GET_API(EvalFile);
JIM_GET_API(EvalObj); JIM_GET_API(EvalObj);
...@@ -1195,6 +1201,7 @@ static void Jim_InitExtension(Jim_Interp *interp) ...@@ -1195,6 +1201,7 @@ static void Jim_InitExtension(Jim_Interp *interp)
JIM_GET_API(NewStringObj); JIM_GET_API(NewStringObj);
JIM_GET_API(NewStringObjNoAlloc); JIM_GET_API(NewStringObjNoAlloc);
JIM_GET_API(AppendString); JIM_GET_API(AppendString);
JIM_GET_API(AppendString_sprintf);
JIM_GET_API(AppendObj); JIM_GET_API(AppendObj);
JIM_GET_API(AppendStrings); JIM_GET_API(AppendStrings);
JIM_GET_API(StringEqObj); JIM_GET_API(StringEqObj);
......
...@@ -109,18 +109,40 @@ proc unknown {args} { ...@@ -109,18 +109,40 @@ proc unknown {args} {
return -code error "Unknown command: $args" return -code error "Unknown command: $args"
} }
proc new_target_name { } {
return [target number [expr [target count] - 1 ]]
}
proc target_script {target_num eventname scriptname} { proc target_script {target_num eventname scriptname} {
if {[string compare $eventname reset]==0} {
set eventname post_reset
}
# This is the script we invoke set tname [target number $target_num]
proc "target_[set target_num]_[set eventname]" {} "script $scriptname"
if { 0 == [string compare $eventname "reset"] } {
$tname configure -event old-post_reset "script $scriptname"
return
}
if { 0 == [string compare $eventname "post_reset"] } {
$tname configure -event old-post_reset "script $scriptname"
return
}
if { 0 == [string compare $eventname "pre_reset"] } {
$tname configure -event old-pre_reset "script $scriptname"
return
}
if { 0 == [string compare $eventname "gdb_program_config"] } {
$tname configure -event old-gdb_program_config "script $scriptname"
return
}
return -code error "Unknown target (old) event: $eventname (try $tname configure -event NAME)"
} }
add_help_text target_script "<target#> <event=reset/pre_reset/post_halt/pre_resume/gdb_program_config> <script_file>" add_help_text target_script "DEPRECATED please see the new TARGETNAME configure -event interface"
# Try flipping / and \ to find file if the filename does not # Try flipping / and \ to find file if the filename does not
...@@ -170,4 +192,4 @@ proc jtag_rclk {fallback_speed_khz} { ...@@ -170,4 +192,4 @@ proc jtag_rclk {fallback_speed_khz} {
} }
} }
add_help_text jtag_rclk "fallback_speed_khz - set JTAG speed to RCLK or use fallback speed" add_help_text jtag_rclk "fallback_speed_khz - set JTAG speed to RCLK or use fallback speed"
\ No newline at end of file
...@@ -614,15 +614,6 @@ int gdb_output(struct command_context_s *context, const char* line) ...@@ -614,15 +614,6 @@ int gdb_output(struct command_context_s *context, const char* line)
return ERROR_OK; return ERROR_OK;
} }
int gdb_program_handler(struct target_s *target, enum target_event event, void *priv)
{
struct command_context_s *cmd_ctx = priv;
target_invoke_script(cmd_ctx, target, "gdb_program");
jtag_execute_queue();
return ERROR_OK;
}
static void gdb_frontend_halted(struct target_s *target, connection_t *connection) static void gdb_frontend_halted(struct target_s *target, connection_t *connection)
{ {
...@@ -664,13 +655,15 @@ int gdb_target_callback_event_handler(struct target_s *target, enum target_event ...@@ -664,13 +655,15 @@ int gdb_target_callback_event_handler(struct target_s *target, enum target_event
{ {
connection_t *connection = priv; connection_t *connection = priv;
target_handle_event( target, event );
switch (event) switch (event)
{ {
case TARGET_EVENT_HALTED: case TARGET_EVENT_HALTED:
gdb_frontend_halted(target, connection); gdb_frontend_halted(target, connection);
break; break;
case TARGET_EVENT_GDB_FLASH_ERASE_START: case TARGET_EVENT_GDB_FLASH_ERASE_START:
gdb_program_handler(target, event, connection->cmd_ctx); target_handle_event( target, TARGET_EVENT_OLD_gdb_program_config );
jtag_execute_queue();
break; break;
default: default:
break; break;
...@@ -748,7 +741,7 @@ int gdb_new_connection(connection_t *connection) ...@@ -748,7 +741,7 @@ int gdb_new_connection(connection_t *connection)
*/ */
if (initial_ack != '+') if (initial_ack != '+')
gdb_putback_char(connection, initial_ack); gdb_putback_char(connection, initial_ack);
target_call_event_callbacks(gdb_service->target, TARGET_EVENT_GDB_ATTACH );
return ERROR_OK; return ERROR_OK;
} }
...@@ -781,6 +774,7 @@ int gdb_connection_closed(connection_t *connection) ...@@ -781,6 +774,7 @@ int gdb_connection_closed(connection_t *connection)
target_unregister_event_callback(gdb_target_callback_event_handler, connection); target_unregister_event_callback(gdb_target_callback_event_handler, connection);
log_remove_callback(gdb_log_callback, connection); log_remove_callback(gdb_log_callback, connection);
target_call_event_callbacks(gdb_service->target, TARGET_EVENT_GDB_DETACH );
return ERROR_OK; return ERROR_OK;
} }
...@@ -1279,7 +1273,7 @@ int gdb_step_continue_packet(connection_t *connection, target_t *target, char *p ...@@ -1279,7 +1273,7 @@ int gdb_step_continue_packet(connection_t *connection, target_t *target, char *p
if (packet[0] == 'c') if (packet[0] == 'c')
{ {
LOG_DEBUG("continue"); LOG_DEBUG("continue");
target_invoke_script(connection->cmd_ctx, target, "pre_resume"); target_handle_event( target, TARGET_EVENT_OLD_pre_resume );
retval=target_resume(target, current, address, 0, 0); /* resume at current address, don't handle breakpoints, not debugging */ retval=target_resume(target, current, address, 0, 0); /* resume at current address, don't handle breakpoints, not debugging */
} }
else if (packet[0] == 's') else if (packet[0] == 's')
...@@ -1790,9 +1784,11 @@ int gdb_v_packet(connection_t *connection, target_t *target, char *packet, int p ...@@ -1790,9 +1784,11 @@ int gdb_v_packet(connection_t *connection, target_t *target, char *packet, int p
/* perform any target specific operations before the erase */ /* perform any target specific operations before the erase */
target_call_event_callbacks(gdb_service->target, TARGET_EVENT_GDB_FLASH_ERASE_START); target_call_event_callbacks(gdb_service->target, TARGET_EVENT_GDB_FLASH_ERASE_START);
result = flash_erase_address_range(gdb_service->target, addr, length );
target_call_event_callbacks(gdb_service->target, TARGET_EVENT_GDB_FLASH_ERASE_END);
/* perform erase */ /* perform erase */
if ((result = flash_erase_address_range(gdb_service->target, addr, length)) != ERROR_OK) if (result != ERROR_OK)
{ {
/* GDB doesn't evaluate the actual error number returned, /* GDB doesn't evaluate the actual error number returned,
* treat a failed erase as an I/O error * treat a failed erase as an I/O error
...@@ -1846,7 +1842,10 @@ int gdb_v_packet(connection_t *connection, target_t *target, char *packet, int p ...@@ -1846,7 +1842,10 @@ int gdb_v_packet(connection_t *connection, target_t *target, char *packet, int p
/* process the flashing buffer. No need to erase as GDB /* process the flashing buffer. No need to erase as GDB
* always issues a vFlashErase first. */ * always issues a vFlashErase first. */
if ((result = flash_write(gdb_service->target, gdb_connection->vflash_image, &written, 0)) != ERROR_OK) target_call_event_callbacks(gdb_service->target, TARGET_EVENT_GDB_FLASH_WRITE_START);
result = flash_write(gdb_service->target, gdb_connection->vflash_image, &written, 0);
target_call_event_callbacks(gdb_service->target, TARGET_EVENT_GDB_FLASH_WRITE_END);
if ( result != ERROR_OK)
{ {
if (result == ERROR_FLASH_DST_OUT_OF_BANK) if (result == ERROR_FLASH_DST_OUT_OF_BANK)
gdb_put_packet(connection, "E.memtype", 9); gdb_put_packet(connection, "E.memtype", 9);
...@@ -1872,10 +1871,11 @@ int gdb_v_packet(connection_t *connection, target_t *target, char *packet, int p ...@@ -1872,10 +1871,11 @@ int gdb_v_packet(connection_t *connection, target_t *target, char *packet, int p
int gdb_detach(connection_t *connection, target_t *target) int gdb_detach(connection_t *connection, target_t *target)
{ {
switch( detach_mode ) switch( detach_mode )
{ {
case GDB_DETACH_RESUME: case GDB_DETACH_RESUME:
target_invoke_script(connection->cmd_ctx, target, "pre_resume"); target_handle_event( target, TARGET_EVENT_OLD_pre_resume );
target_resume(target, 1, 0, 1, 0); target_resume(target, 1, 0, 1, 0);
break; break;
...@@ -1893,7 +1893,6 @@ int gdb_detach(connection_t *connection, target_t *target) ...@@ -1893,7 +1893,6 @@ int gdb_detach(connection_t *connection, target_t *target)
} }
gdb_put_packet(connection, "OK", 2); gdb_put_packet(connection, "OK", 2);
return ERROR_OK; return ERROR_OK;
} }
...@@ -2279,3 +2278,12 @@ int gdb_register_commands(command_context_t *command_context) ...@@ -2279,3 +2278,12 @@ int gdb_register_commands(command_context_t *command_context)
"is not sufficient"); "is not sufficient");
return ERROR_OK; return ERROR_OK;
} }
/*
* Local Variables: ***
* c-basic-offset: 4 ***
* tab-width: 4 ***
* End: ***
*/
...@@ -143,7 +143,7 @@ static int tcl_input(connection_t *connection) ...@@ -143,7 +143,7 @@ static int tcl_input(connection_t *connection)
} }
else { else {
tclc->tc_line[tclc->tc_lineoffset-1] = '\0'; tclc->tc_line[tclc->tc_lineoffset-1] = '\0';
retval = Jim_Eval(interp, tclc->tc_line); retval = Jim_Eval_Named(interp, tclc->tc_line, "remote:connection",1);
result = Jim_GetString(Jim_GetResult(interp), &reslen); result = Jim_GetString(Jim_GetResult(interp), &reslen);
retval = tcl_output(connection, result, reslen); retval = tcl_output(connection, result, reslen);
if (retval != ERROR_OK) if (retval != ERROR_OK)
......
...@@ -92,7 +92,7 @@ target_type_t arm11_target = ...@@ -92,7 +92,7 @@ target_type_t arm11_target =
ARM11_HANDLER(run_algorithm), ARM11_HANDLER(run_algorithm),
ARM11_HANDLER(register_commands), ARM11_HANDLER(register_commands),
ARM11_HANDLER(target_command), ARM11_HANDLER(target_create),
ARM11_HANDLER(init_target), ARM11_HANDLER(init_target),
ARM11_HANDLER(examine), ARM11_HANDLER(examine),
ARM11_HANDLER(quit), ARM11_HANDLER(quit),
...@@ -1351,28 +1351,21 @@ int arm11_run_algorithm(struct target_s *target, int num_mem_params, mem_param_t ...@@ -1351,28 +1351,21 @@ int arm11_run_algorithm(struct target_s *target, int num_mem_params, mem_param_t
return ERROR_OK; return ERROR_OK;
} }
int arm11_target_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc, struct target_s *target) int arm11_target_create(struct target_s *target, Jim_Interp *interp)
{ {
FNC_INFO; FNC_INFO;
if (argc < 4)
{
return ERROR_COMMAND_SYNTAX_ERROR;
}
int chain_pos = strtoul(args[3], NULL, 0);
NEW(arm11_common_t, arm11, 1); NEW(arm11_common_t, arm11, 1);
arm11->target = target; arm11->target = target;
/* prepare JTAG information for the new target */ /* prepare JTAG information for the new target */
arm11->jtag_info.chain_pos = chain_pos; arm11->jtag_info.chain_pos = target->chain_position;
arm11->jtag_info.scann_size = 5; arm11->jtag_info.scann_size = 5;
arm_jtag_setup_connection(&arm11->jtag_info); arm_jtag_setup_connection(&arm11->jtag_info);
jtag_device_t *device = jtag_get_device(chain_pos); jtag_device_t *device = jtag_get_device(target->chain_position);
if (device->ir_length != 5) if (device->ir_length != 5)
{ {
...@@ -1810,3 +1803,11 @@ int arm11_register_commands(struct command_context_s *cmd_ctx) ...@@ -1810,3 +1803,11 @@ int arm11_register_commands(struct command_context_s *cmd_ctx)
return ERROR_OK; return ERROR_OK;
} }
/*
* Local Variables: ***
* c-basic-offset: 4 ***
* tab-width: 4 ***
* End: ***
*/
...@@ -222,7 +222,7 @@ int arm11_remove_watchpoint(struct target_s *target, watchpoint_t *watchpoint); ...@@ -222,7 +222,7 @@ int arm11_remove_watchpoint(struct target_s *target, watchpoint_t *watchpoint);
int arm11_run_algorithm(struct target_s *target, int num_mem_params, mem_param_t *mem_params, int num_reg_params, reg_param_t *reg_param, u32 entry_point, u32 exit_point, int timeout_ms, void *arch_info); int arm11_run_algorithm(struct target_s *target, int num_mem_params, mem_param_t *mem_params, int num_reg_params, reg_param_t *reg_param, u32 entry_point, u32 exit_point, int timeout_ms, void *arch_info);
int arm11_register_commands(struct command_context_s *cmd_ctx); int arm11_register_commands(struct command_context_s *cmd_ctx);
int arm11_target_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc, struct target_s *target); int arm11_target_create(struct target_s *target, Jim_Interp *interp);
int arm11_init_target(struct command_context_s *cmd_ctx, struct target_s *target); int arm11_init_target(struct command_context_s *cmd_ctx, struct target_s *target);
int arm11_quit(void); int arm11_quit(void);
......
...@@ -42,7 +42,7 @@ int arm720t_handle_md_phys_command(struct command_context_s *cmd_ctx, char *cmd, ...@@ -42,7 +42,7 @@ int arm720t_handle_md_phys_command(struct command_context_s *cmd_ctx, char *cmd,
int arm720t_handle_mw_phys_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc); int arm720t_handle_mw_phys_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc);
/* forward declarations */ /* forward declarations */
int arm720t_target_command(struct command_context_s