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
/* 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);
Jim_Eval(interp, override_name);
Jim_Eval_Named(interp, override_name, __FILE__, __LINE__ );
free((void *)override_name);
/* accumulate help text in Tcl helptext list. */
......@@ -430,7 +430,7 @@ int command_run_line(command_context_t *context, char *line)
retcode = Jim_SetAssocData(interp, "retval", NULL, &retval);
if (retcode == JIM_OK)
{
retcode = Jim_Eval(interp, line);
retcode = Jim_Eval_Named(interp, line, __FILE__, __LINE__ );
Jim_DeleteAssocData(interp, "retval");
}
......@@ -658,7 +658,7 @@ command_context_t* command_init()
#ifdef JIM_EMBEDDED
Jim_EventLoopOnLoad(interp);
#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)");
Jim_PrintErrorMessage(interp);
......
......@@ -111,6 +111,33 @@ static Jim_HashTableType JimVariablesHashTableType;
* 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.
* This function originates from BSD.
......@@ -2019,6 +2046,22 @@ void Jim_AppendString(Jim_Interp *interp, Jim_Obj *objPtr, const char *str,
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,
Jim_Obj *appendObjPtr)
{
......@@ -8726,17 +8769,31 @@ int JimCallProcedure(Jim_Interp *interp, Jim_Cmd *cmd, int argc,
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;
Jim_Obj *scriptObjPtr;
scriptObjPtr = Jim_NewStringObj(interp, script, -1);
Jim_IncrRefCount(scriptObjPtr);
if( filename ){
JimSetSourceInfo( interp, scriptObjPtr, filename, lineno );
}
retval = Jim_EvalObj(interp, scriptObjPtr);
Jim_DecrRefCount(interp, scriptObjPtr);
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 */
int Jim_EvalGlobal(Jim_Interp *interp, const char *script)
{
......@@ -9076,6 +9133,7 @@ void JimRegisterCoreApi(Jim_Interp *interp)
JIM_REGISTER_API(Alloc);
JIM_REGISTER_API(Free);
JIM_REGISTER_API(Eval);
JIM_REGISTER_API(Eval_Named);
JIM_REGISTER_API(EvalGlobal);
JIM_REGISTER_API(EvalFile);
JIM_REGISTER_API(EvalObj);
......@@ -9102,6 +9160,7 @@ void JimRegisterCoreApi(Jim_Interp *interp)
JIM_REGISTER_API(NewStringObj);
JIM_REGISTER_API(NewStringObjNoAlloc);
JIM_REGISTER_API(AppendString);
JIM_REGISTER_API(AppendString_sprintf);
JIM_REGISTER_API(AppendObj);
JIM_REGISTER_API(AppendStrings);
JIM_REGISTER_API(StringEqObj);
......@@ -12536,27 +12595,15 @@ int
Jim_SetResult_sprintf( Jim_Interp *interp, const char *fmt,... )
{
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;
va_start(ap,fmt);
vasprintf( &buf, fmt, ap );
buf = jim_vasprintf( fmt, ap );
va_end(ap);
if( buf ){
Jim_SetResultString( interp, buf, -1 );
free(buf);
jim_vasprintf_done(buf);
}
#endif
return JIM_OK;
}
......
......@@ -675,6 +675,9 @@ JIM_STATIC char * JIM_API(Jim_StrDup) (const char *s);
/* evaluation */
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_EvalFile)(Jim_Interp *interp, const char *filename);
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,
char *s, int len);
JIM_STATIC void JIM_API(Jim_AppendString) (Jim_Interp *interp, Jim_Obj *objPtr,
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_Obj *appendObjPtr);
JIM_STATIC void JIM_API(Jim_AppendStrings) (Jim_Interp *interp,
......@@ -1169,6 +1174,7 @@ static void Jim_InitExtension(Jim_Interp *interp)
JIM_GET_API(Alloc);
JIM_GET_API(Free);
JIM_GET_API(Eval);
JIM_GET_API(Eval_Named);
JIM_GET_API(EvalGlobal);
JIM_GET_API(EvalFile);
JIM_GET_API(EvalObj);
......@@ -1195,6 +1201,7 @@ static void Jim_InitExtension(Jim_Interp *interp)
JIM_GET_API(NewStringObj);
JIM_GET_API(NewStringObjNoAlloc);
JIM_GET_API(AppendString);
JIM_GET_API(AppendString_sprintf);
JIM_GET_API(AppendObj);
JIM_GET_API(AppendStrings);
JIM_GET_API(StringEqObj);
......
......@@ -109,18 +109,40 @@ proc unknown {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} {
if {[string compare $eventname reset]==0} {
set eventname post_reset
}
# This is the script we invoke
proc "target_[set target_num]_[set eventname]" {} "script $scriptname"
set tname [target number $target_num]
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
......@@ -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"
\ No newline at end of file
add_help_text jtag_rclk "fallback_speed_khz - set JTAG speed to RCLK or use fallback speed"
......@@ -614,15 +614,6 @@ int gdb_output(struct command_context_s *context, const char* line)
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)
{
......@@ -664,13 +655,15 @@ int gdb_target_callback_event_handler(struct target_s *target, enum target_event
{
connection_t *connection = priv;
target_handle_event( target, event );
switch (event)
{
case TARGET_EVENT_HALTED:
gdb_frontend_halted(target, connection);
break;
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;
default:
break;
......@@ -748,7 +741,7 @@ int gdb_new_connection(connection_t *connection)
*/
if (initial_ack != '+')
gdb_putback_char(connection, initial_ack);
target_call_event_callbacks(gdb_service->target, TARGET_EVENT_GDB_ATTACH );
return ERROR_OK;
}
......@@ -781,6 +774,7 @@ int gdb_connection_closed(connection_t *connection)
target_unregister_event_callback(gdb_target_callback_event_handler, connection);
log_remove_callback(gdb_log_callback, connection);
target_call_event_callbacks(gdb_service->target, TARGET_EVENT_GDB_DETACH );
return ERROR_OK;
}
......@@ -1279,7 +1273,7 @@ int gdb_step_continue_packet(connection_t *connection, target_t *target, char *p
if (packet[0] == 'c')
{
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 */
}
else if (packet[0] == 's')
......@@ -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 */
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 */
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,
* 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
/* process the flashing buffer. No need to erase as GDB
* 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)
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
int gdb_detach(connection_t *connection, target_t *target)
{
switch( detach_mode )
{
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);
break;
......@@ -1893,7 +1893,6 @@ int gdb_detach(connection_t *connection, target_t *target)
}
gdb_put_packet(connection, "OK", 2);
return ERROR_OK;
}
......@@ -2279,3 +2278,12 @@ int gdb_register_commands(command_context_t *command_context)
"is not sufficient");
return ERROR_OK;
}
/*
* Local Variables: ***
* c-basic-offset: 4 ***
* tab-width: 4 ***
* End: ***
*/
......@@ -143,7 +143,7 @@ static int tcl_input(connection_t *connection)
}
else {
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);
retval = tcl_output(connection, result, reslen);
if (retval != ERROR_OK)
......
......@@ -92,7 +92,7 @@ target_type_t arm11_target =
ARM11_HANDLER(run_algorithm),
ARM11_HANDLER(register_commands),
ARM11_HANDLER(target_command),
ARM11_HANDLER(target_create),
ARM11_HANDLER(init_target),
ARM11_HANDLER(examine),
ARM11_HANDLER(quit),
......@@ -1351,28 +1351,21 @@ int arm11_run_algorithm(struct target_s *target, int num_mem_params, mem_param_t
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;
if (argc < 4)
{
return ERROR_COMMAND_SYNTAX_ERROR;
}
int chain_pos = strtoul(args[3], NULL, 0);
NEW(arm11_common_t, arm11, 1);
arm11->target = 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;
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)
{
......@@ -1810,3 +1803,11 @@ int arm11_register_commands(struct command_context_s *cmd_ctx)
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);
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_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_quit(void);
......
......@@ -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);
/* forward declarations */
int arm720t_target_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc, struct target_s *target);
int arm720t_target_create(struct target_s *target,Jim_Interp *interp);
int arm720t_init_target(struct command_context_s *cmd_ctx, struct target_s *target);
int arm720t_quit(void);
int arm720t_arch_state(struct target_s *target);
......@@ -81,7 +81,7 @@ target_type_t arm720t_target =
.remove_watchpoint = arm7_9_remove_watchpoint,
.register_commands = arm720t_register_commands,
.target_command = arm720t_target_command,
.target_create = arm720t_target_create,
.init_target = arm720t_init_target,
.examine = arm7tdmi_examine,
.quit = arm720t_quit
......@@ -436,7 +436,7 @@ int arm720t_quit(void)
return ERROR_OK;
}
int arm720t_init_arch_info(target_t *target, arm720t_common_t *arm720t, int chain_pos, char *variant)
int arm720t_init_arch_info(target_t *target, arm720t_common_t *arm720t, int chain_pos, const char *variant)
{
arm7tdmi_common_t *arm7tdmi = &arm720t->arm7tdmi_common;
arm7_9_common_t *arm7_9 = &arm7tdmi->arm7_9_common;
......@@ -461,27 +461,11 @@ int arm720t_init_arch_info(target_t *target, arm720t_common_t *arm720t, int chai
return ERROR_OK;
}
int arm720t_target_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc, struct target_s *target)
int arm720t_target_create(struct target_s *target, Jim_Interp *interp)
{
int chain_pos;
char *variant = NULL;
arm720t_common_t *arm720t = malloc(sizeof(arm720t_common_t));
memset(arm720t, 0, sizeof(*arm720t));
arm720t_common_t *arm720t = calloc(1,sizeof(arm720t_common_t));
if (argc < 4)
{
LOG_ERROR("'target arm720t' requires at least one additional argument");
exit(-1);
}
chain_pos = strtoul(args[3], NULL, 0);
if (argc >= 5)
variant = args[4];
LOG_DEBUG("chain_pos: %i, variant: %s", chain_pos, variant);
arm720t_init_arch_info(target, arm720t, chain_pos, variant);
arm720t_init_arch_info(target, arm720t, target->chain_position, target->variant);
return ERROR_OK;
}
......@@ -644,3 +628,10 @@ int arm720t_handle_mw_phys_command(command_context_t *cmd_ctx, char *cmd, char *
return armv4_5_mmu_handle_mw_phys_command(cmd_ctx, cmd, args, argc, target, &arm720t->armv4_5_mmu);
}
/*
* Local Variables: ***
* c-basic-offset: 4 ***
* tab-width: 4 ***
* End: ***
*/
......@@ -44,8 +44,8 @@
int arm7tdmi_register_commands(struct command_context_s *cmd_ctx);
/* forward declarations */
int arm7tdmi_target_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc, struct target_s *target);
int arm7tdmi_target_create(Jim_Interp *interp, struct target_s *target);
int arm7tdmi_target_create(struct target_s *target,Jim_Interp *interp);
int arm7tdmi_init_target(struct command_context_s *cmd_ctx, struct target_s *target);
int arm7tdmi_quit(void);
......@@ -85,9 +85,8 @@ target_type_t arm7tdmi_target =
.add_watchpoint = arm7_9_add_watchpoint,
.remove_watchpoint = arm7_9_remove_watchpoint,
.register_commands = arm7tdmi_register_commands,
.target_command = arm7tdmi_target_command,
// .target_create = arm7tdmi_target_create,
.register_commands = arm7tdmi_register_commands,
.target_create = arm7tdmi_target_create,
.init_target = arm7tdmi_init_target,
.examine = arm7tdmi_examine,
.quit = arm7tdmi_quit
......@@ -829,32 +828,9 @@ int arm7tdmi_init_arch_info(target_t *target, arm7tdmi_common_t *arm7tdmi, int c
return ERROR_OK;
}
/* target arm7tdmi <endianess> <startup_mode> <chain_pos> <variant> */
int arm7tdmi_target_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc, struct target_s *target)
{
int chain_pos;
char *variant = NULL;
arm7tdmi_common_t *arm7tdmi = malloc(sizeof(arm7tdmi_common_t));
memset(arm7tdmi, 0, sizeof(*arm7tdmi));
if (argc < 4)
{
LOG_ERROR("'target arm7tdmi' requires at least one additional argument");
exit(-1);
}
chain_pos = strtoul(args[3], NULL, 0);
if (argc >= 5)
variant = args[4];
arm7tdmi_init_arch_info(target, arm7tdmi, chain_pos, variant);
return ERROR_OK;
}
int arm7tdmi_target_create(Jim_Interp *interp,
struct target_s *target)
int arm7tdmi_target_create( struct target_s *target, Jim_Interp *interp )
{
arm7tdmi_common_t *arm7tdmi;
......@@ -866,7 +842,6 @@ int arm7tdmi_target_create(Jim_Interp *interp,
}
int arm7tdmi_register_commands(struct command_context_s *cmd_ctx)
{
int retval;
......@@ -878,6 +853,8 @@ int arm7tdmi_register_commands(struct command_context_s *cmd_ctx)
}
/*
* Local Variables: ***
* c-basic-offset: 4 ***
......
......@@ -47,7 +47,7 @@ int arm920t_handle_read_cache_command(struct command_context_s *cmd_ctx, char *c
int arm920t_handle_read_mmu_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc);
/* forward declarations */
int arm920t_target_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc, struct target_s *target);
int arm920t_target_create(struct target_s *target, Jim_Interp *interp);
int arm920t_init_target(struct command_context_s *cmd_ctx, struct target_s *target);
int arm920t_quit(void);
int arm920t_arch_state(struct target_s *target);
......@@ -90,7 +90,7 @@ target_type_t arm920t_target =
.remove_watchpoint = arm7_9_remove_watchpoint,
.register_commands = arm920t_register_commands,
.target_command = arm920t_target_command,
.target_create = arm920t_target_create,
.init_target = arm920t_init_target,
.examine = arm9tdmi_examine,
.quit = arm920t_quit
......@@ -699,7 +699,7 @@ int arm920t_quit(void)
return ERROR_OK;
}
int arm920t_init_arch_info(target_t *target, arm920t_common_t *arm920t, int chain_pos, char *variant)
int arm920t_init_arch_info(target_t *target, arm920t_common_t *arm920t, int chain_pos, const char *variant)
{
arm9tdmi_common_t *arm9tdmi = &arm920t->arm9tdmi_common;
arm7_9_common_t *arm7_9 = &arm9tdmi->arm7_9_common;
......@@ -735,27 +735,11 @@ int arm920t_init_arch_info(target_t *target, arm920t_common_t *arm920t, int chai
return ERROR_OK;
}
int arm920t_target_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc, struct target_s *target)
int arm920t_target_create(struct target_s *target, Jim_Interp *interp)
{
int chain_pos;
char *variant = NULL;
arm920t_common_t *arm920t = malloc(sizeof(arm920t_common_t));