X-Git-Url: https://review.openocd.org/gitweb?a=blobdiff_plain;f=src%2Fopenocd.c;h=a352b702387234b374ce32a582d64e1eaca72015;hb=9f40d41f6867fcaa68636d2f958aa1df43ec3971;hp=a5002d19268b1f58c167bc18c9acf07002816404;hpb=3b7c9585db2dd49b48123d50e9e8af7bc527be52;p=openocd.git diff --git a/src/openocd.c b/src/openocd.c index a5002d1926..a352b70238 100644 --- a/src/openocd.c +++ b/src/openocd.c @@ -31,7 +31,7 @@ #include "openocd.h" #include #include -#include +#include #include #include #include @@ -301,7 +301,11 @@ struct command_context *setup_command_handler(Jim_Interp *interp) return cmd_ctx; } -static int main2(int argc, char *argv[], struct command_context *cmd_ctx) +/** OpenOCD runtime meat that can become single-thread in future. It parse + * commandline, reads configuration, sets up the target and starts server loop. + * Commandline arguments are passed into this function from openocd_main(). + */ +static int openocd_thread(int argc, char *argv[], struct command_context *cmd_ctx) { int ret; @@ -362,7 +366,8 @@ int openocd_main(int argc, char *argv[]) command_context_mode(cmd_ctx, COMMAND_CONFIG); command_set_output_handler(cmd_ctx, configuration_output_handler, NULL); - ret = main2(argc, argv, cmd_ctx); + /* Start the executable meat that can evolve into thread in future. */ + ret = openocd_thread(argc, argv, cmd_ctx); unregister_all_commands(cmd_ctx, NULL);