2003-09-22 Ralf Corsepius <corsepiu@faw.uni-ulm.de>

* monitor/monitor.h:
	Add rtems_monitor_commands[] (Illegally applied by shell/).
	Remove ifdef(__mips64) (Make broken code visible again).
	* monitor/mon-command.c: Add several ifndef RTEMS_UNIX to avoid
	warnings.
	* monitor/mon-monitor.c: Remove RTEMS_CPU_HAS_16_BIT_ADDRESSES (Make
	broken code visible again).
	* shell/cmds.c: Remove local decls of rtems_monitor_commands[].
This commit is contained in:
Ralf Corsepius
2003-09-22 13:14:26 +00:00
parent d6879851f8
commit c6d35fa59f
5 changed files with 22 additions and 18 deletions

View File

@@ -1,3 +1,14 @@
2003-09-22 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
* monitor/monitor.h:
Add rtems_monitor_commands[] (Illegally applied by shell/).
Remove ifdef(__mips64) (Make broken code visible again).
* monitor/mon-command.c: Add several ifndef RTEMS_UNIX to avoid
warnings.
* monitor/mon-monitor.c: Remove RTEMS_CPU_HAS_16_BIT_ADDRESSES (Make
broken code visible again).
* shell/cmds.c: Remove local decls of rtems_monitor_commands[].
2003-09-19 Ralf Corsepius <corsepiu@faw.uni-ulm.de> 2003-09-19 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
* monitor/monitor.h: Remove STREQ, STNEQ (pollute namespace), * monitor/monitor.h: Remove STREQ, STNEQ (pollute namespace),

View File

@@ -94,6 +94,7 @@ struct translation_table
unsigned int key; unsigned int key;
}; };
#ifndef RTEMS_UNIX
static struct translation_table trans_two[] = static struct translation_table trans_two[] =
{ {
{ '~', 0, KEYS_INS }, { '~', 0, KEYS_INS },
@@ -150,6 +151,7 @@ static struct translation_table trans_tab[] =
{ 'O', trans_tab_O, 0 }, /* O are the fuction keys */ { 'O', trans_tab_O, 0 }, /* O are the fuction keys */
{ 0, 0, 0 } { 0, 0, 0 }
}; };
#endif
/* /*
* Perform a basic tranlation for some ANSI/VT100 key codes. * Perform a basic tranlation for some ANSI/VT100 key codes.
@@ -158,6 +160,7 @@ static struct translation_table trans_tab[] =
* line editor below so considiered not worth the effort. * line editor below so considiered not worth the effort.
*/ */
#ifndef RTEMS_UNIX
static unsigned int static unsigned int
rtems_monitor_getchar ( rtems_monitor_getchar (
) )
@@ -213,6 +216,7 @@ rtems_monitor_getchar (
} }
} }
} }
#endif
#ifndef RTEMS_UNIX #ifndef RTEMS_UNIX
/* /*

View File

@@ -130,11 +130,7 @@ rtems_monitor_command_entry_t rtems_monitor_commands[] = {
" symbol [ symbolname [symbolname ... ] ]", " symbol [ symbolname [symbolname ... ] ]",
0, 0,
rtems_monitor_symbol_cmd, rtems_monitor_symbol_cmd,
#if defined(RTEMS_CPU_HAS_16_BIT_ADDRESSES)
0, /* XXX find a way to fix the compile time error on h8 */
#else
(rtems_monitor_command_arg_t) &rtems_monitor_symbols, (rtems_monitor_command_arg_t) &rtems_monitor_symbols,
#endif
&rtems_monitor_commands[8], &rtems_monitor_commands[8],
}, },
{ "extension", { "extension",
@@ -219,11 +215,7 @@ rtems_monitor_command_entry_t rtems_monitor_commands[] = {
"help [ command [ command ] ]", "help [ command [ command ] ]",
0, 0,
rtems_monitor_help_cmd, rtems_monitor_help_cmd,
#if defined(RTEMS_CPU_HAS_16_BIT_ADDRESSES)
0, /* XXX find a way to fix the compile time error on h8 */
#else
(rtems_monitor_command_arg_t) rtems_monitor_commands, (rtems_monitor_command_arg_t) rtems_monitor_commands,
#endif
&rtems_monitor_commands[18], &rtems_monitor_commands[18],
}, },
#ifdef CPU_INVOKE_DEBUGGER #ifdef CPU_INVOKE_DEBUGGER
@@ -522,7 +514,7 @@ rtems_monitor_task(
debugee = _Thread_Executing; debugee = _Thread_Executing;
rp = &debugee->Registers; rp = &debugee->Registers;
#if (CPU_HARDWARE_FP == TRUE) || (CPU_SOFTWARE_FP == TRUE) #if (CPU_HARDWARE_FP == TRUE) || (CPU_SOFTWARE_FP == TRUE)
fp = (rtems_context_fp *) debugee->fp_context; /* possibly 0 */ fp = debugee->fp_context; /* possibly 0 */
#else #else
fp = 0; fp = 0;
#endif #endif

View File

@@ -285,6 +285,9 @@ extern unsigned32 rtems_monitor_default_node; /* current default for commands *
typedef struct rtems_monitor_command_entry_s rtems_monitor_command_entry_t; typedef struct rtems_monitor_command_entry_s rtems_monitor_command_entry_t;
/* FIXME: This should not be here */
extern rtems_monitor_command_entry_t rtems_monitor_commands[];
typedef void ( *rtems_monitor_command_function_t )( typedef void ( *rtems_monitor_command_function_t )(
int argc, int argc,
char **argv, char **argv,
@@ -292,11 +295,7 @@ typedef void ( *rtems_monitor_command_function_t )(
boolean verbose boolean verbose
); );
#if defined(__mips64) typedef unsigned32 rtems_monitor_command_arg_t;
typedef unsigned64 rtems_monitor_command_arg_t;
#else
typedef unsigned32 rtems_monitor_command_arg_t;
#endif
struct rtems_monitor_command_entry_s { struct rtems_monitor_command_entry_s {
char *command; /* command name */ char *command; /* command name */
@@ -305,7 +304,7 @@ struct rtems_monitor_command_entry_s {
rtems_monitor_command_function_t command_function; rtems_monitor_command_function_t command_function;
/* Some argument for the command */ /* Some argument for the command */
rtems_monitor_command_arg_t command_arg; rtems_monitor_command_arg_t command_arg;
struct rtems_monitor_command_entry_s *next; rtems_monitor_command_entry_t *next;
}; };
typedef void *(*rtems_monitor_object_next_fn)(void *, void *, rtems_id *); typedef void *(*rtems_monitor_object_next_fn)(void *, void *, rtems_id *);

View File

@@ -469,18 +469,16 @@ int main_chmod(int argc,char *argv[])
*-----------------------------------------------------------*/ *-----------------------------------------------------------*/
int main_monitor(int argc,char * argv[]) { int main_monitor(int argc,char * argv[]) {
rtems_monitor_command_entry_t *command; rtems_monitor_command_entry_t *command;
extern rtems_monitor_command_entry_t rtems_monitor_commands[];
rtems_task_ident(RTEMS_SELF,0,&rtems_monitor_task_id); rtems_task_ident(RTEMS_SELF,0,&rtems_monitor_task_id);
rtems_monitor_node = rtems_get_node(rtems_monitor_task_id); rtems_monitor_node = rtems_get_node(rtems_monitor_task_id);
rtems_monitor_default_node = rtems_monitor_node; rtems_monitor_default_node = rtems_monitor_node;
if ((command=rtems_monitor_command_lookup(rtems_monitor_commands,argc,argv))) if ((command=rtems_monitor_command_lookup(rtems_monitor_commands,argc,argv)))
command->command_function(argc, argv, command->command_arg, 0); command->command_function(argc, argv, &command->command_arg, 0);
return 0; return 0;
} }
/*-----------------------------------------------------------*/ /*-----------------------------------------------------------*/
void register_cmds(void) { void register_cmds(void) {
rtems_monitor_command_entry_t *command; rtems_monitor_command_entry_t *command;
extern rtems_monitor_command_entry_t rtems_monitor_commands[];
/* monitor topic */ /* monitor topic */
command=rtems_monitor_commands; command=rtems_monitor_commands;
while (command) { while (command) {