#include "jtag.h"
#include "configuration.h"
#include "xsvf.h"
+#include "svf.h"
#include "target.h"
#include "flash.h"
#include "nand.h"
}
#ifdef CYGPKG_PROFILE_GPROF
-extern void start_profile();
+extern void start_profile(void);
int eCosBoard_handle_eCosBoard_profile_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
{
#endif
-externC void phi_init_all_network_interfaces();
+externC void phi_init_all_network_interfaces(void);
command_context_t *cmd_ctx;
static bool webRunning = false;
-void keep_webserver()
+void keep_webserver(void)
{
// Target initialisation is only attempted at startup, so we sleep forever and
// let the http server bail us out(i.e. get config files set up).
(CYG_ADDRWORD) &filedata[0] );
#endif
-void openocd_sleep_prelude()
+void openocd_sleep_prelude(void)
{
cyg_mutex_unlock(&httpstate.jim_lock);
}
-void openocd_sleep_postlude()
+void openocd_sleep_postlude(void)
{
cyg_mutex_lock(&httpstate.jim_lock);
}
return JIM_OK;
}
-static int zylinjtag_Jim_Command_mac(Jim_Interp *interp, int argc,
- Jim_Obj * const *argv)
-{
-
- Jim_Obj *tclOutput = Jim_NewStringObj(interp, "", 0);
-
- Jim_AppendString(httpstate.jim_interp, tclOutput, hwaddr, strlen(hwaddr));
-
- Jim_SetResult(interp, tclOutput);
-
- return JIM_OK;
-}
-
-static int zylinjtag_Jim_Command_ip(Jim_Interp *interp, int argc,
- Jim_Obj * const *argv)
-{
- Jim_Obj *tclOutput = Jim_NewStringObj(interp, "", 0);
-
- struct ifaddrs *ifa = NULL, *ifp = NULL;
-
- if (getifaddrs(&ifp) < 0)
- {
- return JIM_ERR;
- }
-
- for (ifa = ifp; ifa; ifa = ifa->ifa_next)
- {
- char ip[200];
- socklen_t salen;
-
- if (ifa->ifa_addr->sa_family == AF_INET)
- salen = sizeof(struct sockaddr_in);
- else if (ifa->ifa_addr->sa_family == AF_INET6)
- salen = sizeof(struct sockaddr_in6);
- else
- continue;
-
- if (getnameinfo(ifa->ifa_addr, salen, ip, sizeof(ip), NULL, 0,
- NI_NUMERICHOST) < 0)
- {
- continue;
- }
-
- Jim_AppendString(httpstate.jim_interp, tclOutput, ip, strlen(ip));
- break;
-
- }
-
- freeifaddrs(ifp);
-
- Jim_SetResult(interp, tclOutput);
-
- return JIM_OK;
-}
extern Jim_Interp *interp;
-static void zylinjtag_startNetwork()
+static void zylinjtag_startNetwork(void)
{
// Bring TCP/IP up immediately before we're ready to accept commands.
//
zylinjtag_Jim_Command_reboot, NULL, NULL);
Jim_CreateCommand(httpstate.jim_interp, "threads",
zylinjtag_Jim_Command_threads, NULL, NULL);
- Jim_CreateCommand(httpstate.jim_interp, "mac", zylinjtag_Jim_Command_mac,
- NULL, NULL);
- Jim_CreateCommand(httpstate.jim_interp, "ip", zylinjtag_Jim_Command_ip,
- NULL, NULL);
Jim_CreateCommand(httpstate.jim_interp, "format_jffs2",
zylinjtag_Jim_Command_format_jffs2, NULL, NULL);
int boolParam(char *var);
-command_context_t *setup_command_handler();
+command_context_t *setup_command_handler(void);
extern const char *zylin_config_dir;
return ERROR_OK;
}
+int ioutil_init(struct command_context_s *cmd_ctx);
+
int main(int argc, char *argv[])
{
/* ramblockdevice will be the same address every time. The deflate app uses a buffer 16mBytes out, so we
command_set_output_handler(cmd_ctx, configuration_output_handler, NULL);
command_context_mode(cmd_ctx, COMMAND_CONFIG);
+#if BUILD_IOUTIL
+ if (ioutil_init(cmd_ctx) != ERROR_OK)
+ {
+ return EXIT_FAILURE;
+ }
+#endif
+
+
#ifdef CYGPKG_PROFILE_GPROF
register_command(cmd_ctx, NULL, "ecosboard_profile", eCosBoard_handle_eCosBoard_profile_command,
COMMAND_ANY, NULL);