X-Git-Url: https://review.openocd.org/gitweb?p=openocd.git;a=blobdiff_plain;f=src%2Fopenocd.c;h=839a6bb10d1a07052f6158c35916493044768c6d;hp=56576ee351fff82e970564c77e150dbbbf699d07;hb=490e2712904a718efb320d0557f3bb8485676709;hpb=1743395250abad9010c539459d301ade6c32d746 diff --git a/src/openocd.c b/src/openocd.c index 56576ee351..839a6bb10d 100644 --- a/src/openocd.c +++ b/src/openocd.c @@ -47,7 +47,6 @@ #include "tcl_server.h" #include -#include #include #include #include @@ -59,8 +58,7 @@ #define OPENOCD_VERSION \ "Open On-Chip Debugger " VERSION " (" PKGBLDDATE ") " RELSTR PKGBLDREV - -void print_version(void) +static void print_version(void) { /* DANGER!!! make sure that the line below does not appear in a patch, do not remove */ /* DANGER!!! make sure that the line below does not appear in a patch, do not remove */ @@ -76,7 +74,7 @@ void print_version(void) } /* Give TELNET a way to find out what version this is */ -int handle_version_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc) +static int handle_version_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc) { if (argc!=0) return ERROR_COMMAND_SYNTAX_ERROR; @@ -86,7 +84,7 @@ int handle_version_command(struct command_context_s *cmd_ctx, char *cmd, char ** return ERROR_OK; } -void exit_handler(void) +static void exit_handler(void) { /* close JTAG interface */ if (jtag && jtag->quit) @@ -120,7 +118,7 @@ static int log_target_callback_event_handler(struct target_s *target, enum targe int ioutil_init(struct command_context_s *cmd_ctx); /* OpenOCD can't really handle failure of this command. Patches welcome! :-) */ -int handle_init_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc) +static int handle_init_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc) { if (argc!=0) @@ -188,6 +186,7 @@ int handle_init_command(struct command_context_s *cmd_ctx, char *cmd, char **arg command_context_t *global_cmd_ctx; +/* NB! this fn can be invoked outside this file for non PC hosted builds */ command_context_t *setup_command_handler(void) { command_context_t *cmd_ctx; @@ -229,6 +228,21 @@ command_context_t *setup_command_handler(void) int httpd_start(void); void httpd_stop(void); + +#if !BUILD_HTTPD && !BUILD_ECOSBOARD +/* implementations of OpenOCD that uses multithreading needs to know when + * OpenOCD is sleeping. No-op in vanilla OpenOCD + */ +void openocd_sleep_prelude(void) +{ +} + +void openocd_sleep_postlude(void) +{ +} +#endif + + /* normally this is the main() function entry, but if OpenOCD is linked * into application, then this fn will not be invoked, but rather that * application will have it's own implementation of main(). */