2008-03-12 Joel Sherrill <joel.sherrill@oarcorp.com>

* libmisc/shell/cmds.c: Directly register the command structure to
	avoid unnecessary duplication of static strings. We know best this
	time.
This commit is contained in:
Joel Sherrill
2008-03-12 16:20:07 +00:00
parent 66a9381db4
commit 9d7739369f
2 changed files with 26 additions and 3 deletions

View File

@@ -1,3 +1,9 @@
2008-03-12 Joel Sherrill <joel.sherrill@oarcorp.com>
* libmisc/shell/cmds.c: Directly register the command structure to
avoid unnecessary duplication of static strings. We know best this
time.
2008-03-11 Joel Sherrill <joel.sherrill@OARcorp.com>
* sapi/include/confdefs.h: Do not reserve 2 * minimum stack size

View File

@@ -18,6 +18,7 @@
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <rtems.h>
#include <rtems/monitor.h>
@@ -40,12 +41,28 @@ int rtems_shell_main_monitor(int argc,char * argv[]) {
void rtems_shell_register_monitor_commands(void)
{
rtems_monitor_command_entry_t *command;
/* monitor topic */
command = rtems_monitor_commands;
while (command) {
if (strcmp("exit",command->command)) /* Exclude EXIT (alias quit)*/
rtems_shell_add_cmd(command->command,"monitor",
command->usage,rtems_shell_main_monitor);
/* Exclude EXIT (alias quit)*/
if (strcmp("exit",command->command)) {
rtems_shell_cmd_t *shell_cmd;
shell_cmd = (rtems_shell_cmd_t *) malloc(sizeof(rtems_shell_cmd_t));
shell_cmd->name = command->command;
shell_cmd->topic = "monitor";
shell_cmd->usage = command->usage;
shell_cmd->command = rtems_shell_main_monitor;
shell_cmd->alias = (rtems_shell_cmd_t *) NULL;
shell_cmd->next = (rtems_shell_cmd_t *) NULL;
if (rtems_shell_add_cmd_struct( shell_cmd ) == NULL) {
free( shell_cmd );
shell_cmd = NULL;
}
}
command = command->next;
}
}