]> rtime.felk.cvut.cz Git - can-benchmark.git/blobdiff - rtems/gw/cangw/helpers.h
Adds conditional compilation for benchmarking and shell initialization cleanup.
[can-benchmark.git] / rtems / gw / cangw / helpers.h
index 0c3a0d012f8a463fa1b1509743bf52f151dbbfba..95dcf39dde15f7ea131c063f464f4c1aba9de602 100644 (file)
@@ -1,20 +1,80 @@
-#include <system_def.h>\r
-#include "system.h"\r
-#include "app_def.h"\r
-#include <unistd.h>\r
-#include <fcntl.h>\r
-#include <stdio.h>\r
-#include <errno.h>\r
-#include <stdlib.h>\r
-#include <rtems/error.h>\r
-#include <rtems/monitor.h>\r
-#include <rtems/shell.h>\r
-\r
-#include <bsp/mscan.h>\r
-#include <bsp/mscan-base.h>\r
-\r
+#ifndef __HELPERS_H_\r
+#define __HELPERS_H_\r
 \r
 int start_can(int argc, char** argv);\r
 int end_can(int argc, char** argv);\r
-int print_regs(int argc, char** argv);\r
-int print_can_totals(int argc, char** argv);
\ No newline at end of file
+int print_clocks(int argc, char** argv);\r
+int print_can_totals(int argc, char** argv);\r
+int start_net(int argc, char** argv);\r
+int show_net(int argc, char** argv);\r
+int start_load(int argc, char** argv);\r
+int stop_load(int argc, char** argv);\r
+\r
+/* chain of shell command descriptors */\r
+static rtems_shell_cmd_t shell_command_stop_load = {\r
+    "stop_load", /* name */\r
+    "stops cpu loading threads", /* usage */\r
+    "user", /* topic */\r
+    stop_load, /* command */\r
+    NULL, /* alias */\r
+    NULL /* next */\r
+};\r
+static rtems_shell_cmd_t shell_command_start_load = {\r
+    "start_load", /* name */\r
+    "starts cpu loading threads", /* usage */\r
+    "user", /* topic */\r
+    start_load, /* command */\r
+    NULL, /* alias */\r
+    &shell_command_stop_load /* next */\r
+};\r
+static rtems_shell_cmd_t shell_command_start_net = {\r
+    "startNET", /* name */\r
+    "starts ethernet driver", /* usage */\r
+    "user", /* topic */\r
+    start_net, /* command */\r
+    NULL, /* alias */\r
+    &shell_command_start_load /* next */\r
+};\r
+static rtems_shell_cmd_t shell_command_stop_gw = {\r
+    "stopGW", /* name */\r
+    "stops CAN gateway", /* usage */\r
+    "user", /* topic */\r
+    end_can, /* command */\r
+    NULL, /* alias */\r
+    &shell_command_start_net /* next */\r
+};\r
+static rtems_shell_cmd_t shell_command_start_gw = {\r
+    "startGW", /* name */\r
+    "starts CAN gateway", /* usage */\r
+    "user", /* topic */\r
+    start_can, /* command */\r
+    NULL, /* alias */\r
+    &shell_command_stop_gw /* next */\r
+};\r
+static rtems_shell_cmd_t shell_command_print_net = {\r
+    "show_net", /* name */\r
+    "shows some debug information about bsdnet", /* usage */\r
+    "user", /* topic */\r
+    show_net, /* command */\r
+    NULL, /* alias */\r
+    &shell_command_start_gw /* next */\r
+};\r
+static rtems_shell_cmd_t shell_command_print_clocks = {\r
+    "print_clocks", /* name */\r
+    "prints clock as taken from uboot", /* usage */\r
+    "user", /* topic */\r
+    print_clocks, /* command */\r
+    NULL, /* alias */\r
+    &shell_command_print_net /* next */\r
+};\r
+static rtems_shell_cmd_t shell_command_print_can_totals = {\r
+    "printcan", /* name */\r
+    "prints can stats", /* usage */\r
+    "user", /* topic */\r
+    print_can_totals, /* command */\r
+    NULL, /* alias */\r
+    &shell_command_print_clocks /* next */\r
+};\r
+\r
+\r
+#endif
\ No newline at end of file