forked from Imagelibrary/rtems
updates from Tony Bennett
This commit is contained in:
@@ -1,6 +1,4 @@
|
||||
/*
|
||||
* @(#)assoc.h 1.4 - 95/10/25
|
||||
*
|
||||
*
|
||||
* Rtems associativity routines. Mainly used to convert a value from
|
||||
* one space to another (eg: our errno's to host errno's and v.v)
|
||||
|
||||
@@ -1,8 +1,4 @@
|
||||
|
||||
/*
|
||||
* @(#)error.h 1.3 - 95/10/25
|
||||
*
|
||||
*
|
||||
* Defines and externs for rtems error reporting
|
||||
*
|
||||
* $Id$
|
||||
@@ -24,7 +20,12 @@
|
||||
|
||||
const char *rtems_status_text(rtems_status_code);
|
||||
int rtems_error(int error_code, const char *printf_format, ...);
|
||||
#ifdef __GNUC__
|
||||
void rtems_panic(const char *printf_format, ...)
|
||||
__attribute__ ((__noreturn__));
|
||||
#else
|
||||
void rtems_panic(const char *printf_format, ...);
|
||||
#endif
|
||||
|
||||
extern int rtems_panic_in_progress;
|
||||
|
||||
|
||||
@@ -1,7 +1,4 @@
|
||||
/*
|
||||
* @(#)assoc.c 1.6 - 95/10/25
|
||||
*
|
||||
*
|
||||
* assoc.c
|
||||
* rtems assoc routines
|
||||
*
|
||||
|
||||
@@ -1,7 +1,4 @@
|
||||
/*
|
||||
* @(#)error.c 1.6 - 95/12/12
|
||||
*
|
||||
*
|
||||
* report errors and panics to RTEMS' stderr.
|
||||
* Currently just used by RTEMS monitor.
|
||||
*
|
||||
|
||||
@@ -1,12 +1,9 @@
|
||||
/*
|
||||
* @(#)genoffsets.c 1.7 - 95/09/25
|
||||
*
|
||||
*
|
||||
* genoffsets.c
|
||||
*
|
||||
* This file generates the offsets.h for the HP PA-RISC port of RTEMS.
|
||||
*
|
||||
* NOTE: It only prints the offset for structures actually used
|
||||
* NOTE: It only prints the offset for structures actually used
|
||||
* by the assembly code.
|
||||
*
|
||||
* COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
|
||||
@@ -17,7 +14,6 @@
|
||||
* notice must appear in all copies of this file and its derivatives.
|
||||
*
|
||||
* $Id$
|
||||
*
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
@@ -70,7 +66,7 @@ printf(
|
||||
(int) &((TYPE)0)->FIELD );
|
||||
|
||||
#define PRINT_SIZE( STRING, item ) \
|
||||
printf( "#define\t%s\t%d\t\t/* 0x%x */\n", \
|
||||
printf( "#ifdef ASM\n#define\t%s\t%d\t\t/* 0x%x */\n#endif\n", \
|
||||
STRING, \
|
||||
sizeof(item), \
|
||||
sizeof(item) );
|
||||
@@ -145,6 +141,39 @@ printf(
|
||||
|
||||
PRINT_COMMENT("Context_Control_fp information");
|
||||
|
||||
PRINT_IT( "FR0_OFFSET", Context_Control_fp *, fr0 );
|
||||
PRINT_IT( "FR1_OFFSET", Context_Control_fp *, fr1 );
|
||||
PRINT_IT( "FR2_OFFSET", Context_Control_fp *, fr2 );
|
||||
PRINT_IT( "FR3_OFFSET", Context_Control_fp *, fr3 );
|
||||
PRINT_IT( "FR4_OFFSET", Context_Control_fp *, fr4 );
|
||||
PRINT_IT( "FR5_OFFSET", Context_Control_fp *, fr5 );
|
||||
PRINT_IT( "FR6_OFFSET", Context_Control_fp *, fr6 );
|
||||
PRINT_IT( "FR7_OFFSET", Context_Control_fp *, fr7 );
|
||||
PRINT_IT( "FR8_OFFSET", Context_Control_fp *, fr8 );
|
||||
PRINT_IT( "FR9_OFFSET", Context_Control_fp *, fr9 );
|
||||
PRINT_IT( "FR10_OFFSET", Context_Control_fp *, fr10 );
|
||||
PRINT_IT( "FR11_OFFSET", Context_Control_fp *, fr11 );
|
||||
PRINT_IT( "FR12_OFFSET", Context_Control_fp *, fr12 );
|
||||
PRINT_IT( "FR13_OFFSET", Context_Control_fp *, fr13 );
|
||||
PRINT_IT( "FR14_OFFSET", Context_Control_fp *, fr14 );
|
||||
PRINT_IT( "FR15_OFFSET", Context_Control_fp *, fr15 );
|
||||
PRINT_IT( "FR16_OFFSET", Context_Control_fp *, fr16 );
|
||||
PRINT_IT( "FR17_OFFSET", Context_Control_fp *, fr17 );
|
||||
PRINT_IT( "FR18_OFFSET", Context_Control_fp *, fr18 );
|
||||
PRINT_IT( "FR19_OFFSET", Context_Control_fp *, fr19 );
|
||||
PRINT_IT( "FR20_OFFSET", Context_Control_fp *, fr20 );
|
||||
PRINT_IT( "FR21_OFFSET", Context_Control_fp *, fr21 );
|
||||
PRINT_IT( "FR22_OFFSET", Context_Control_fp *, fr22 );
|
||||
PRINT_IT( "FR23_OFFSET", Context_Control_fp *, fr23 );
|
||||
PRINT_IT( "FR24_OFFSET", Context_Control_fp *, fr24 );
|
||||
PRINT_IT( "FR25_OFFSET", Context_Control_fp *, fr25 );
|
||||
PRINT_IT( "FR26_OFFSET", Context_Control_fp *, fr26 );
|
||||
PRINT_IT( "FR27_OFFSET", Context_Control_fp *, fr27 );
|
||||
PRINT_IT( "FR28_OFFSET", Context_Control_fp *, fr28 );
|
||||
PRINT_IT( "FR29_OFFSET", Context_Control_fp *, fr29 );
|
||||
PRINT_IT( "FR30_OFFSET", Context_Control_fp *, fr30 );
|
||||
PRINT_IT( "FR31_OFFSET", Context_Control_fp *, fr31 );
|
||||
|
||||
PRINT_SIZE("CPU_CONTEXT_FP_SIZE", Context_Control_fp);
|
||||
|
||||
/*
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
/*
|
||||
* @(#)assoc.h 1.4 - 95/10/25
|
||||
*
|
||||
*
|
||||
* Rtems associativity routines. Mainly used to convert a value from
|
||||
* one space to another (eg: our errno's to host errno's and v.v)
|
||||
|
||||
@@ -1,8 +1,4 @@
|
||||
|
||||
/*
|
||||
* @(#)error.h 1.3 - 95/10/25
|
||||
*
|
||||
*
|
||||
* Defines and externs for rtems error reporting
|
||||
*
|
||||
* $Id$
|
||||
@@ -24,7 +20,12 @@
|
||||
|
||||
const char *rtems_status_text(rtems_status_code);
|
||||
int rtems_error(int error_code, const char *printf_format, ...);
|
||||
#ifdef __GNUC__
|
||||
void rtems_panic(const char *printf_format, ...)
|
||||
__attribute__ ((__noreturn__));
|
||||
#else
|
||||
void rtems_panic(const char *printf_format, ...);
|
||||
#endif
|
||||
|
||||
extern int rtems_panic_in_progress;
|
||||
|
||||
|
||||
@@ -97,33 +97,10 @@ extern int use_print_buffer;
|
||||
*/
|
||||
#define BSP_LIBIO_MAX_FDS 20
|
||||
|
||||
/*
|
||||
* Device Driver Table Entries
|
||||
*/
|
||||
|
||||
/*
|
||||
* When not doing printf to a buffer, we do printf thru RTEMS libio
|
||||
* and our tty driver. Set it up so that console is right.
|
||||
*/
|
||||
|
||||
#define CONSOLE_DRIVER_TABLE_ENTRY \
|
||||
{ tty_initialize, tty_open, tty_close, tty_read, tty_write, tty_control }
|
||||
|
||||
/*
|
||||
* NOTE: Use the standard Clock driver entry
|
||||
*/
|
||||
|
||||
/*
|
||||
* How many libio files we want
|
||||
*/
|
||||
#define BSP_LIBIO_MAX_FDS 20
|
||||
|
||||
#define HPPA_INTERRUPT_EXTERNAL_MPCI HPPA_INTERRUPT_EXTERNAL_10
|
||||
|
||||
rtems_isr_entry set_vector(rtems_isr_entry, rtems_vector_number, int);
|
||||
|
||||
rtems_isr_entry set_vector(rtems_isr_entry, rtems_vector_number, int);
|
||||
|
||||
void bsp_start( void );
|
||||
void bsp_cleanup( void );
|
||||
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
/*
|
||||
* @(#)ttydrv.h 1.1 - 95/06/02
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
|
||||
@@ -1,7 +1,3 @@
|
||||
/*
|
||||
* @(#)bspstart.c 1.16 - 95/06/28
|
||||
*/
|
||||
|
||||
/* bsp_start()
|
||||
*
|
||||
* This routine starts the application. It includes application,
|
||||
@@ -352,6 +348,12 @@ bsp_start(void)
|
||||
|
||||
Cpu_table.itimer_clicks_per_microsecond = 1;
|
||||
|
||||
#ifdef 0
|
||||
/*
|
||||
* Commented by DIVISION INC. External interrupt
|
||||
* processing is now divorced from RTEMS for HPPA.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Determine the external interrupt processing order
|
||||
* the external interrupt handler walks thru this table, in
|
||||
@@ -369,6 +371,7 @@ bsp_start(void)
|
||||
HPPA_INTERRUPT_EXTERNAL_10 - HPPA_INTERRUPT_EXTERNAL_BASE;
|
||||
Cpu_table.external_interrupts++;
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Add 1 region for RTEMS Malloc
|
||||
|
||||
@@ -1,7 +1,4 @@
|
||||
/*
|
||||
* @(#)assoc.c 1.6 - 95/10/25
|
||||
*
|
||||
*
|
||||
* assoc.c
|
||||
* rtems assoc routines
|
||||
*
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
/*
|
||||
* @(#)assoc.h 1.4 - 95/10/25
|
||||
*
|
||||
*
|
||||
* Rtems associativity routines. Mainly used to convert a value from
|
||||
* one space to another (eg: our errno's to host errno's and v.v)
|
||||
|
||||
@@ -1,7 +1,4 @@
|
||||
/*
|
||||
* @(#)error.c 1.6 - 95/12/12
|
||||
*
|
||||
*
|
||||
* report errors and panics to RTEMS' stderr.
|
||||
* Currently just used by RTEMS monitor.
|
||||
*
|
||||
|
||||
@@ -1,8 +1,4 @@
|
||||
|
||||
/*
|
||||
* @(#)error.h 1.3 - 95/10/25
|
||||
*
|
||||
*
|
||||
* Defines and externs for rtems error reporting
|
||||
*
|
||||
* $Id$
|
||||
@@ -24,7 +20,12 @@
|
||||
|
||||
const char *rtems_status_text(rtems_status_code);
|
||||
int rtems_error(int error_code, const char *printf_format, ...);
|
||||
#ifdef __GNUC__
|
||||
void rtems_panic(const char *printf_format, ...)
|
||||
__attribute__ ((__noreturn__));
|
||||
#else
|
||||
void rtems_panic(const char *printf_format, ...);
|
||||
#endif
|
||||
|
||||
extern int rtems_panic_in_progress;
|
||||
|
||||
|
||||
@@ -1,7 +1,4 @@
|
||||
/*
|
||||
* @(#)assoc.c 1.6 - 95/10/25
|
||||
*
|
||||
*
|
||||
* assoc.c
|
||||
* rtems assoc routines
|
||||
*
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
/*
|
||||
* @(#)assoc.h 1.4 - 95/10/25
|
||||
*
|
||||
*
|
||||
* Rtems associativity routines. Mainly used to convert a value from
|
||||
* one space to another (eg: our errno's to host errno's and v.v)
|
||||
|
||||
@@ -1,7 +1,4 @@
|
||||
/*
|
||||
* @(#)error.c 1.6 - 95/12/12
|
||||
*
|
||||
*
|
||||
* report errors and panics to RTEMS' stderr.
|
||||
* Currently just used by RTEMS monitor.
|
||||
*
|
||||
|
||||
@@ -1,8 +1,4 @@
|
||||
|
||||
/*
|
||||
* @(#)error.h 1.3 - 95/10/25
|
||||
*
|
||||
*
|
||||
* Defines and externs for rtems error reporting
|
||||
*
|
||||
* $Id$
|
||||
@@ -24,7 +20,12 @@
|
||||
|
||||
const char *rtems_status_text(rtems_status_code);
|
||||
int rtems_error(int error_code, const char *printf_format, ...);
|
||||
#ifdef __GNUC__
|
||||
void rtems_panic(const char *printf_format, ...)
|
||||
__attribute__ ((__noreturn__));
|
||||
#else
|
||||
void rtems_panic(const char *printf_format, ...);
|
||||
#endif
|
||||
|
||||
extern int rtems_panic_in_progress;
|
||||
|
||||
|
||||
@@ -1,7 +1,4 @@
|
||||
/*
|
||||
* @(#)command.c 1.5 - 95/08/02
|
||||
*
|
||||
*
|
||||
* Command parsing routines for RTEMS monitor
|
||||
*
|
||||
* TODO:
|
||||
|
||||
@@ -1,7 +1,4 @@
|
||||
/*
|
||||
* @(#)config.c 1.5 - 95/08/02
|
||||
*
|
||||
*
|
||||
* RTEMS Config display support
|
||||
*
|
||||
* TODO
|
||||
|
||||
@@ -1,7 +1,4 @@
|
||||
/*
|
||||
* @(#)dname.c 1.5 - 96/01/03
|
||||
*
|
||||
*
|
||||
* RTEMS monitor driver names support.
|
||||
*
|
||||
* There are 2 "driver" things the monitor knows about.
|
||||
|
||||
@@ -1,7 +1,4 @@
|
||||
/*
|
||||
* @(#)driver.c 1.4 - 95/08/02
|
||||
*
|
||||
*
|
||||
* RTEMS monitor IO (device drivers) support
|
||||
*
|
||||
* There are 2 "driver" things the monitor knows about.
|
||||
|
||||
@@ -1,7 +1,4 @@
|
||||
/*
|
||||
* @(#)extension.c 1.6 - 95/09/25
|
||||
*
|
||||
*
|
||||
* RTEMS Monitor extension support
|
||||
*
|
||||
* $Id$
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
/*
|
||||
* @(#)itask.c 1.6 - 96/01/03
|
||||
*
|
||||
*
|
||||
* RTEMS Monitor init task support
|
||||
* RTEMS Monitor init task support
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
@@ -1,9 +1,6 @@
|
||||
/*
|
||||
* @(#)manager.c 1.4 - 96/01/03
|
||||
*
|
||||
*
|
||||
* RTEMS Monitor "manager" support.
|
||||
* Used to traverse object (chain) lists and print them out.
|
||||
* RTEMS Monitor "manager" support.
|
||||
* Used to traverse object (chain) lists and print them out.
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
@@ -1,8 +1,4 @@
|
||||
/*
|
||||
* @(#)monitor.c 1.23 - 96/01/03
|
||||
*
|
||||
*
|
||||
*
|
||||
* RTEMS monitor main body
|
||||
*
|
||||
* TODO:
|
||||
@@ -18,7 +14,7 @@
|
||||
* should have a separate monitor FILE stream (ala the debugger)
|
||||
* remote request/response stuff should be cleaned up
|
||||
* maybe we can use real rpc??
|
||||
* 'info' commadn to print out:
|
||||
* 'info' command to print out:
|
||||
* interrupt stack location, direction and size
|
||||
* floating point config stuff
|
||||
* interrupt config stuff
|
||||
@@ -262,6 +258,18 @@ rtems_monitor_wakeup(void)
|
||||
status = rtems_event_send(rtems_monitor_task_id, MONITOR_WAKEUP_EVENT);
|
||||
}
|
||||
|
||||
void
|
||||
rtems_monitor_debugger_cmd(
|
||||
int argc,
|
||||
char **argv,
|
||||
unsigned32 command_arg,
|
||||
boolean verbose
|
||||
)
|
||||
{
|
||||
#ifdef CPU_INVOKE_DEBUGGER
|
||||
CPU_INVOKE_DEBUGGER;
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
rtems_monitor_pause_cmd(
|
||||
@@ -302,19 +310,6 @@ rtems_monitor_continue_cmd(
|
||||
rtems_monitor_suspend(RTEMS_NO_TIMEOUT);
|
||||
}
|
||||
|
||||
void
|
||||
rtems_monitor_debugger_cmd(
|
||||
int argc,
|
||||
char **argv,
|
||||
unsigned32 command_arg,
|
||||
boolean verbose
|
||||
)
|
||||
{
|
||||
#ifdef CPU_INVOKE_DEBUGGER
|
||||
CPU_INVOKE_DEBUGGER;
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
rtems_monitor_node_cmd(
|
||||
int argc,
|
||||
@@ -340,8 +335,10 @@ rtems_monitor_node_cmd(
|
||||
break;
|
||||
}
|
||||
|
||||
if ((new_node >= 1) && (new_node <= _Configuration_MP_table->maximum_nodes))
|
||||
rtems_monitor_default_node = new_node;
|
||||
if ((new_node >= 1) &&
|
||||
_Configuration_MP_table &&
|
||||
(new_node <= _Configuration_MP_table->maximum_nodes))
|
||||
rtems_monitor_default_node = new_node;
|
||||
}
|
||||
|
||||
|
||||
@@ -383,11 +380,7 @@ rtems_monitor_symbols_loadup(void)
|
||||
if (rtems_monitor_symbols == 0)
|
||||
return;
|
||||
|
||||
#ifdef SIMHPPA
|
||||
fp = fdopen(8, "r"); /* don't ask; don't tell */
|
||||
#else
|
||||
fp = fopen("symbols", "r");
|
||||
#endif
|
||||
|
||||
if (fp == 0)
|
||||
return;
|
||||
|
||||
@@ -1,7 +1,4 @@
|
||||
/*
|
||||
* @(#)mpci.c 1.6 - 95/08/02
|
||||
*
|
||||
*
|
||||
* RTEMS MPCI Config display support
|
||||
*
|
||||
* TODO
|
||||
|
||||
@@ -1,7 +1,4 @@
|
||||
/*
|
||||
* @(#)object.c 1.9 - 96/01/03
|
||||
*
|
||||
*
|
||||
* RTEMS Monitor "object" support.
|
||||
*
|
||||
* Used to traverse object lists and print them out.
|
||||
@@ -341,7 +338,7 @@ rtems_monitor_object_cmd(
|
||||
|
||||
for (arg=1; argv[arg]; arg++)
|
||||
{
|
||||
id = (rtems_id) strtoul(argv[arg], 0, 0);
|
||||
id = (rtems_id) strtoul(argv[arg], 0, 16);
|
||||
id = rtems_monitor_id_fixup(id, default_node, type);
|
||||
type = (rtems_monitor_object_type_t) rtems_get_class(id);
|
||||
|
||||
|
||||
@@ -1,7 +1,4 @@
|
||||
/*
|
||||
* @(#)prmisc.c 1.9 - 95/08/02
|
||||
*
|
||||
*
|
||||
* Print misc stuff for the monitor dump routines
|
||||
* Each routine returns the number of characters it output.
|
||||
*
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
/*
|
||||
* @(#)queue.c 1.5 - 95/07/31
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
/*
|
||||
* @(#)server.c 1.5 - 96/01/03
|
||||
*
|
||||
*
|
||||
* RTEMS monitor server (handles requests for info from RTEMS monitors
|
||||
* RTEMS monitor server (handles requests for info from RTEMS monitors
|
||||
* running on other nodes)
|
||||
*
|
||||
* $Id$
|
||||
|
||||
@@ -1,11 +1,3 @@
|
||||
/*
|
||||
* @(#)symbols.c 1.10 - 95/08/02
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
/* #define qsort _quicksort */
|
||||
|
||||
/*
|
||||
* File: symbols.c
|
||||
*
|
||||
@@ -15,6 +7,8 @@
|
||||
*
|
||||
*
|
||||
* TODO:
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#define __RTEMS_VIOLATE_KERNEL_VISIBILITY__
|
||||
@@ -50,11 +44,6 @@ rtems_symbol_table_destroy(rtems_symbol_table_t *table)
|
||||
if (table->addresses)
|
||||
(void) free(table->addresses);
|
||||
table->addresses = 0;
|
||||
|
||||
if (table->symbols)
|
||||
(void) free(table->symbols);
|
||||
table->symbols = 0;
|
||||
|
||||
p = table->string_buffer_head;
|
||||
while (p)
|
||||
{
|
||||
@@ -93,11 +82,6 @@ rtems_symbol_create(
|
||||
table->addresses = (rtems_symbol_t *) realloc((void *) table->addresses, newsize * sizeof(rtems_symbol_t));
|
||||
if (table->addresses == 0) /* blew it; lost orig */
|
||||
goto failed;
|
||||
|
||||
table->symbols = (rtems_symbol_t *) realloc((void *) table->symbols, newsize * sizeof(rtems_symbol_t));
|
||||
if (table->symbols == 0) /* blew it; lost orig */
|
||||
goto failed;
|
||||
|
||||
table->size = newsize;
|
||||
}
|
||||
|
||||
@@ -129,9 +113,6 @@ rtems_symbol_create(
|
||||
(void) strcpy(sp->name, name);
|
||||
|
||||
table->strings_next += symbol_length;
|
||||
|
||||
table->symbols[table->next] = *sp;
|
||||
|
||||
table->sorted = 0;
|
||||
table->next++;
|
||||
|
||||
@@ -147,7 +128,7 @@ failed:
|
||||
* Qsort entry point for compare by address
|
||||
*/
|
||||
|
||||
int
|
||||
static int
|
||||
rtems_symbol_compare(const void *e1,
|
||||
const void *e2)
|
||||
{
|
||||
@@ -162,48 +143,20 @@ rtems_symbol_compare(const void *e1,
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* Qsort entry point for compare by string name (case independent)
|
||||
*/
|
||||
|
||||
int
|
||||
rtems_symbol_string_compare(const void *e1,
|
||||
const void *e2)
|
||||
{
|
||||
rtems_symbol_t *s1, *s2;
|
||||
s1 = (rtems_symbol_t *) e1;
|
||||
s2 = (rtems_symbol_t *) e2;
|
||||
|
||||
return strcasecmp(s1->name, s2->name);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Sort the symbol table using qsort
|
||||
*/
|
||||
|
||||
void
|
||||
static void
|
||||
rtems_symbol_sort(rtems_symbol_table_t *table)
|
||||
{
|
||||
#ifdef RTEMS_ON_SIMULATOR
|
||||
printf("Sorting symbols ... "); /* so slow we need a msg */
|
||||
fflush(stdout);
|
||||
#endif
|
||||
|
||||
qsort((void *) table->addresses, (size_t) table->next,
|
||||
sizeof(rtems_symbol_t), rtems_symbol_compare);
|
||||
|
||||
qsort((void *) table->symbols, (size_t) table->next,
|
||||
sizeof(rtems_symbol_t), rtems_symbol_string_compare);
|
||||
|
||||
#ifdef RTEMS_ON_SIMULATOR
|
||||
/* so slow we need a msg */
|
||||
printf("done\n");
|
||||
#endif
|
||||
|
||||
table->sorted = 1;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Search the symbol table by address
|
||||
* This code based on CYGNUS newlib bsearch, but changed
|
||||
@@ -261,6 +214,53 @@ rtems_symbol_value_lookup(
|
||||
return best;
|
||||
}
|
||||
|
||||
/*
|
||||
* Search the symbol table for the exact matching address.
|
||||
* If the symbol table has already been sorted, then
|
||||
* call the regular symbol value lookup, however, it it
|
||||
* has not yet been sorted, search it sequentially.
|
||||
* This routine is primarily used for low level symbol
|
||||
* lookups (eg. from exception handler and interrupt routines)
|
||||
* where the penality of sorted is not wanted and where
|
||||
* an exact match is needed such that symbol table order
|
||||
* is not important.
|
||||
*/
|
||||
const rtems_symbol_t *
|
||||
rtems_symbol_value_lookup_exact(
|
||||
rtems_symbol_table_t *table,
|
||||
rtems_unsigned32 value
|
||||
)
|
||||
{
|
||||
int s;
|
||||
rtems_symbol_t *sp;
|
||||
|
||||
if (table == 0)
|
||||
{
|
||||
table = rtems_monitor_symbols;
|
||||
if (table == 0)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (table->sorted)
|
||||
{
|
||||
sp = rtems_symbol_value_lookup(table, value);
|
||||
if ( rtems_symbol_value(sp) == value )
|
||||
return sp;
|
||||
else
|
||||
return NULL; /* not an exact match */
|
||||
}
|
||||
|
||||
for (s = 0, sp = table->addresses; s < table->next; s++, sp++)
|
||||
{
|
||||
if ( sp->value == value )
|
||||
return sp;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Search the symbol table by string name (case independent)
|
||||
*/
|
||||
@@ -271,33 +271,23 @@ rtems_symbol_name_lookup(
|
||||
char *name
|
||||
)
|
||||
{
|
||||
rtems_symbol_t *sp = 0;
|
||||
rtems_symbol_t key;
|
||||
int s;
|
||||
rtems_symbol_t *sp;
|
||||
|
||||
if (table == 0)
|
||||
{
|
||||
table = rtems_monitor_symbols;
|
||||
if (table == 0)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
for (s = 0, sp = table->addresses; s < table->next; s++, sp++)
|
||||
{
|
||||
if ( strcasecmp(sp->name, name) == 0 )
|
||||
return sp;
|
||||
}
|
||||
|
||||
if ((table == 0) || (name == 0))
|
||||
goto done;
|
||||
|
||||
if (table->sorted == 0)
|
||||
rtems_symbol_sort(table);
|
||||
|
||||
/*
|
||||
* dummy up one for bsearch()
|
||||
*/
|
||||
|
||||
key.name = name;
|
||||
key.value = 0;
|
||||
|
||||
sp = (rtems_symbol_t *) bsearch((const void *) &key,
|
||||
(const void *) table->symbols,
|
||||
(size_t) table->next,
|
||||
sizeof(rtems_symbol_t),
|
||||
rtems_symbol_string_compare);
|
||||
|
||||
done:
|
||||
return sp;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void *
|
||||
@@ -325,7 +315,7 @@ rtems_monitor_symbol_next(
|
||||
_Thread_Disable_dispatch();
|
||||
|
||||
*next_id += 1;
|
||||
return (void *) (table->symbols + n);
|
||||
return (void *) (table->addresses + n);
|
||||
|
||||
failed:
|
||||
*next_id = RTEMS_OBJECT_ID_FINAL;
|
||||
@@ -438,7 +428,7 @@ rtems_monitor_symbol_dump_all(
|
||||
if (table->sorted == 0)
|
||||
rtems_symbol_sort(table);
|
||||
|
||||
for (s = 0, sp = table->symbols; s < table->next; s++, sp++)
|
||||
for (s = 0, sp = table->addresses; s < table->next; s++, sp++)
|
||||
{
|
||||
rtems_monitor_symbol_t canonical_symbol;
|
||||
|
||||
|
||||
@@ -1,7 +1,4 @@
|
||||
/*
|
||||
* @(#)task.c 1.9 - 95/08/01
|
||||
*
|
||||
*
|
||||
* RTEMS Monitor task support
|
||||
*
|
||||
* $Id$
|
||||
|
||||
@@ -1,10 +1,3 @@
|
||||
/*
|
||||
* @(#)monitor.h 1.21 - 96/01/03
|
||||
*
|
||||
*
|
||||
* monitor.h,v 1.3 1995/09/29 17:19:02 joel Exp
|
||||
*/
|
||||
|
||||
/*
|
||||
* File: monitor.h
|
||||
*
|
||||
@@ -12,6 +5,8 @@
|
||||
* The RTEMS monitor task include file.
|
||||
*
|
||||
* TODO:
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#ifndef __MONITOR_H
|
||||
@@ -25,7 +20,7 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
/*
|
||||
* XXX this should be in rtems proper when type becomes part of id
|
||||
* Monitor types are derived from rtems object classes
|
||||
*/
|
||||
|
||||
typedef enum {
|
||||
@@ -306,7 +301,7 @@ typedef void (*rtems_monitor_object_dump_header_fn)(boolean);
|
||||
typedef void (*rtems_monitor_object_dump_fn)(void *, boolean);
|
||||
|
||||
typedef struct {
|
||||
rtems_monitor_object_type_t type;
|
||||
rtems_monitor_object_type_t type;
|
||||
void *object_information;
|
||||
int size; /* of canonical object */
|
||||
rtems_monitor_object_next_fn next;
|
||||
@@ -419,6 +414,7 @@ void rtems_symbol_table_destroy(rtems_symbol_table_t *table);
|
||||
|
||||
rtems_symbol_t *rtems_symbol_create(rtems_symbol_table_t *, char *, unsigned32);
|
||||
rtems_symbol_t *rtems_symbol_value_lookup(rtems_symbol_table_t *, unsigned32);
|
||||
const rtems_symbol_t *rtems_symbol_value_lookup_exact(rtems_symbol_table_t *, unsigned32);
|
||||
rtems_symbol_t *rtems_symbol_name_lookup(rtems_symbol_table_t *, char *);
|
||||
void *rtems_monitor_symbol_next(void *object_info, rtems_monitor_symbol_t *, rtems_id *);
|
||||
void rtems_monitor_symbol_canonical(rtems_monitor_symbol_t *, rtems_symbol_t *);
|
||||
|
||||
@@ -1,7 +1,4 @@
|
||||
/*
|
||||
* @(#)symbols.h 1.3 - 95/06/09
|
||||
*
|
||||
*
|
||||
* RTEMS monitor symbol table functions
|
||||
*
|
||||
* Description:
|
||||
@@ -47,14 +44,6 @@ typedef struct {
|
||||
|
||||
rtems_symbol_t *addresses; /* symbol array by address */
|
||||
|
||||
/*
|
||||
* String list -- sorted by name (when we do a lookup)
|
||||
* This is a duplicate of the info in table->addresses, but it's
|
||||
* pretty small, so I don't worry about it.
|
||||
*/
|
||||
|
||||
rtems_symbol_t *symbols; /* symbol array */
|
||||
|
||||
/*
|
||||
* String pool, unsorted, a list of blocks of string data
|
||||
*/
|
||||
|
||||
@@ -20,6 +20,19 @@
|
||||
|
||||
#include <rtems.h>
|
||||
|
||||
/*
|
||||
* HACK
|
||||
* the stack dump information should be printed by a "fatal" extension.
|
||||
* Fatal extensions only get called via rtems_fatal_error_occurred()
|
||||
* and not when rtems_shutdown_executive() is called.
|
||||
* I hope/think this is changing so that fatal extensions are renamed
|
||||
* to "shutdown" extensions.
|
||||
* When that happens, this #define should be deleted and all the code
|
||||
* it marks.
|
||||
*/
|
||||
#define DONT_USE_FATAL_EXTENSION
|
||||
|
||||
|
||||
extern rtems_configuration_table BSP_Configuration;
|
||||
|
||||
#include <assert.h>
|
||||
@@ -49,7 +62,11 @@ rtems_extensions_table Stack_check_Extension_table = {
|
||||
Stack_check_Switch_extension, /* task_switch */
|
||||
Stack_check_Begin_extension, /* task_begin */
|
||||
0, /* task_exitted */
|
||||
#ifdef DONT_USE_FATAL_EXTENSION
|
||||
0, /* fatal */
|
||||
#else
|
||||
Stack_check_Fatal_extension, /* fatal */
|
||||
#endif
|
||||
};
|
||||
|
||||
/*
|
||||
@@ -167,10 +184,6 @@ void Stack_check_Initialize( void )
|
||||
|
||||
Stack_check_Blown_task = 0;
|
||||
|
||||
#ifdef STACK_CHECKER_REPORT_USAGE
|
||||
atexit( Stack_check_Dump_usage );
|
||||
#endif
|
||||
|
||||
/*
|
||||
* If installed by a task, that task will not get setup properly
|
||||
* since it missed out on the create hook. This will cause a
|
||||
@@ -217,6 +230,17 @@ void Stack_check_Initialize( void )
|
||||
stack_check_dope_stack(&stack_check_interrupt_stack);
|
||||
}
|
||||
|
||||
#ifdef DONT_USE_FATAL_EXTENSION
|
||||
#ifdef RTEMS_DEBUG
|
||||
/*
|
||||
* this would normally be called by a fatal extension
|
||||
* handler, but we don't run fatal extensions unless
|
||||
* we fatal error.
|
||||
*/
|
||||
atexit(Stack_check_Dump_usage);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
stack_check_initialized = 1;
|
||||
}
|
||||
|
||||
@@ -431,14 +455,16 @@ void Stack_check_Dump_threads_usage(
|
||||
* Stack_check_Fatal_extension
|
||||
*/
|
||||
|
||||
void Stack_check_Fatal_extension(
|
||||
void Stack_check_Fatal_extension(
|
||||
Internal_errors_Source source,
|
||||
boolean is_internal,
|
||||
unsigned32 status
|
||||
)
|
||||
{
|
||||
#ifndef DONT_USE_FATAL_EXTENSION
|
||||
if (status == 0)
|
||||
Stack_check_Dump_usage();
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,7 +1,4 @@
|
||||
/*
|
||||
* @(#)assoc.c 1.6 - 95/10/25
|
||||
*
|
||||
*
|
||||
* assoc.c
|
||||
* rtems assoc routines
|
||||
*
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
/*
|
||||
* @(#)assoc.h 1.4 - 95/10/25
|
||||
*
|
||||
*
|
||||
* Rtems associativity routines. Mainly used to convert a value from
|
||||
* one space to another (eg: our errno's to host errno's and v.v)
|
||||
|
||||
@@ -1,7 +1,4 @@
|
||||
/*
|
||||
* @(#)error.c 1.6 - 95/12/12
|
||||
*
|
||||
*
|
||||
* report errors and panics to RTEMS' stderr.
|
||||
* Currently just used by RTEMS monitor.
|
||||
*
|
||||
|
||||
@@ -1,8 +1,4 @@
|
||||
|
||||
/*
|
||||
* @(#)error.h 1.3 - 95/10/25
|
||||
*
|
||||
*
|
||||
* Defines and externs for rtems error reporting
|
||||
*
|
||||
* $Id$
|
||||
@@ -24,7 +20,12 @@
|
||||
|
||||
const char *rtems_status_text(rtems_status_code);
|
||||
int rtems_error(int error_code, const char *printf_format, ...);
|
||||
#ifdef __GNUC__
|
||||
void rtems_panic(const char *printf_format, ...)
|
||||
__attribute__ ((__noreturn__));
|
||||
#else
|
||||
void rtems_panic(const char *printf_format, ...);
|
||||
#endif
|
||||
|
||||
extern int rtems_panic_in_progress;
|
||||
|
||||
|
||||
@@ -1,7 +1,4 @@
|
||||
/*
|
||||
* @(#)command.c 1.5 - 95/08/02
|
||||
*
|
||||
*
|
||||
* Command parsing routines for RTEMS monitor
|
||||
*
|
||||
* TODO:
|
||||
|
||||
@@ -1,7 +1,4 @@
|
||||
/*
|
||||
* @(#)config.c 1.5 - 95/08/02
|
||||
*
|
||||
*
|
||||
* RTEMS Config display support
|
||||
*
|
||||
* TODO
|
||||
|
||||
@@ -1,7 +1,4 @@
|
||||
/*
|
||||
* @(#)dname.c 1.5 - 96/01/03
|
||||
*
|
||||
*
|
||||
* RTEMS monitor driver names support.
|
||||
*
|
||||
* There are 2 "driver" things the monitor knows about.
|
||||
|
||||
@@ -1,7 +1,4 @@
|
||||
/*
|
||||
* @(#)driver.c 1.4 - 95/08/02
|
||||
*
|
||||
*
|
||||
* RTEMS monitor IO (device drivers) support
|
||||
*
|
||||
* There are 2 "driver" things the monitor knows about.
|
||||
|
||||
@@ -1,7 +1,4 @@
|
||||
/*
|
||||
* @(#)extension.c 1.6 - 95/09/25
|
||||
*
|
||||
*
|
||||
* RTEMS Monitor extension support
|
||||
*
|
||||
* $Id$
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
/*
|
||||
* @(#)itask.c 1.6 - 96/01/03
|
||||
*
|
||||
*
|
||||
* RTEMS Monitor init task support
|
||||
* RTEMS Monitor init task support
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
@@ -1,9 +1,6 @@
|
||||
/*
|
||||
* @(#)manager.c 1.4 - 96/01/03
|
||||
*
|
||||
*
|
||||
* RTEMS Monitor "manager" support.
|
||||
* Used to traverse object (chain) lists and print them out.
|
||||
* RTEMS Monitor "manager" support.
|
||||
* Used to traverse object (chain) lists and print them out.
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
@@ -1,8 +1,4 @@
|
||||
/*
|
||||
* @(#)monitor.c 1.23 - 96/01/03
|
||||
*
|
||||
*
|
||||
*
|
||||
* RTEMS monitor main body
|
||||
*
|
||||
* TODO:
|
||||
@@ -18,7 +14,7 @@
|
||||
* should have a separate monitor FILE stream (ala the debugger)
|
||||
* remote request/response stuff should be cleaned up
|
||||
* maybe we can use real rpc??
|
||||
* 'info' commadn to print out:
|
||||
* 'info' command to print out:
|
||||
* interrupt stack location, direction and size
|
||||
* floating point config stuff
|
||||
* interrupt config stuff
|
||||
@@ -262,6 +258,18 @@ rtems_monitor_wakeup(void)
|
||||
status = rtems_event_send(rtems_monitor_task_id, MONITOR_WAKEUP_EVENT);
|
||||
}
|
||||
|
||||
void
|
||||
rtems_monitor_debugger_cmd(
|
||||
int argc,
|
||||
char **argv,
|
||||
unsigned32 command_arg,
|
||||
boolean verbose
|
||||
)
|
||||
{
|
||||
#ifdef CPU_INVOKE_DEBUGGER
|
||||
CPU_INVOKE_DEBUGGER;
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
rtems_monitor_pause_cmd(
|
||||
@@ -302,19 +310,6 @@ rtems_monitor_continue_cmd(
|
||||
rtems_monitor_suspend(RTEMS_NO_TIMEOUT);
|
||||
}
|
||||
|
||||
void
|
||||
rtems_monitor_debugger_cmd(
|
||||
int argc,
|
||||
char **argv,
|
||||
unsigned32 command_arg,
|
||||
boolean verbose
|
||||
)
|
||||
{
|
||||
#ifdef CPU_INVOKE_DEBUGGER
|
||||
CPU_INVOKE_DEBUGGER;
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
rtems_monitor_node_cmd(
|
||||
int argc,
|
||||
@@ -340,8 +335,10 @@ rtems_monitor_node_cmd(
|
||||
break;
|
||||
}
|
||||
|
||||
if ((new_node >= 1) && (new_node <= _Configuration_MP_table->maximum_nodes))
|
||||
rtems_monitor_default_node = new_node;
|
||||
if ((new_node >= 1) &&
|
||||
_Configuration_MP_table &&
|
||||
(new_node <= _Configuration_MP_table->maximum_nodes))
|
||||
rtems_monitor_default_node = new_node;
|
||||
}
|
||||
|
||||
|
||||
@@ -383,11 +380,7 @@ rtems_monitor_symbols_loadup(void)
|
||||
if (rtems_monitor_symbols == 0)
|
||||
return;
|
||||
|
||||
#ifdef SIMHPPA
|
||||
fp = fdopen(8, "r"); /* don't ask; don't tell */
|
||||
#else
|
||||
fp = fopen("symbols", "r");
|
||||
#endif
|
||||
|
||||
if (fp == 0)
|
||||
return;
|
||||
|
||||
@@ -1,7 +1,4 @@
|
||||
/*
|
||||
* @(#)mpci.c 1.6 - 95/08/02
|
||||
*
|
||||
*
|
||||
* RTEMS MPCI Config display support
|
||||
*
|
||||
* TODO
|
||||
|
||||
@@ -1,7 +1,4 @@
|
||||
/*
|
||||
* @(#)object.c 1.9 - 96/01/03
|
||||
*
|
||||
*
|
||||
* RTEMS Monitor "object" support.
|
||||
*
|
||||
* Used to traverse object lists and print them out.
|
||||
@@ -341,7 +338,7 @@ rtems_monitor_object_cmd(
|
||||
|
||||
for (arg=1; argv[arg]; arg++)
|
||||
{
|
||||
id = (rtems_id) strtoul(argv[arg], 0, 0);
|
||||
id = (rtems_id) strtoul(argv[arg], 0, 16);
|
||||
id = rtems_monitor_id_fixup(id, default_node, type);
|
||||
type = (rtems_monitor_object_type_t) rtems_get_class(id);
|
||||
|
||||
|
||||
@@ -1,7 +1,4 @@
|
||||
/*
|
||||
* @(#)prmisc.c 1.9 - 95/08/02
|
||||
*
|
||||
*
|
||||
* Print misc stuff for the monitor dump routines
|
||||
* Each routine returns the number of characters it output.
|
||||
*
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
/*
|
||||
* @(#)queue.c 1.5 - 95/07/31
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
/*
|
||||
* @(#)server.c 1.5 - 96/01/03
|
||||
*
|
||||
*
|
||||
* RTEMS monitor server (handles requests for info from RTEMS monitors
|
||||
* RTEMS monitor server (handles requests for info from RTEMS monitors
|
||||
* running on other nodes)
|
||||
*
|
||||
* $Id$
|
||||
|
||||
@@ -1,11 +1,3 @@
|
||||
/*
|
||||
* @(#)symbols.c 1.10 - 95/08/02
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
/* #define qsort _quicksort */
|
||||
|
||||
/*
|
||||
* File: symbols.c
|
||||
*
|
||||
@@ -15,6 +7,8 @@
|
||||
*
|
||||
*
|
||||
* TODO:
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#define __RTEMS_VIOLATE_KERNEL_VISIBILITY__
|
||||
@@ -50,11 +44,6 @@ rtems_symbol_table_destroy(rtems_symbol_table_t *table)
|
||||
if (table->addresses)
|
||||
(void) free(table->addresses);
|
||||
table->addresses = 0;
|
||||
|
||||
if (table->symbols)
|
||||
(void) free(table->symbols);
|
||||
table->symbols = 0;
|
||||
|
||||
p = table->string_buffer_head;
|
||||
while (p)
|
||||
{
|
||||
@@ -93,11 +82,6 @@ rtems_symbol_create(
|
||||
table->addresses = (rtems_symbol_t *) realloc((void *) table->addresses, newsize * sizeof(rtems_symbol_t));
|
||||
if (table->addresses == 0) /* blew it; lost orig */
|
||||
goto failed;
|
||||
|
||||
table->symbols = (rtems_symbol_t *) realloc((void *) table->symbols, newsize * sizeof(rtems_symbol_t));
|
||||
if (table->symbols == 0) /* blew it; lost orig */
|
||||
goto failed;
|
||||
|
||||
table->size = newsize;
|
||||
}
|
||||
|
||||
@@ -129,9 +113,6 @@ rtems_symbol_create(
|
||||
(void) strcpy(sp->name, name);
|
||||
|
||||
table->strings_next += symbol_length;
|
||||
|
||||
table->symbols[table->next] = *sp;
|
||||
|
||||
table->sorted = 0;
|
||||
table->next++;
|
||||
|
||||
@@ -147,7 +128,7 @@ failed:
|
||||
* Qsort entry point for compare by address
|
||||
*/
|
||||
|
||||
int
|
||||
static int
|
||||
rtems_symbol_compare(const void *e1,
|
||||
const void *e2)
|
||||
{
|
||||
@@ -162,48 +143,20 @@ rtems_symbol_compare(const void *e1,
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* Qsort entry point for compare by string name (case independent)
|
||||
*/
|
||||
|
||||
int
|
||||
rtems_symbol_string_compare(const void *e1,
|
||||
const void *e2)
|
||||
{
|
||||
rtems_symbol_t *s1, *s2;
|
||||
s1 = (rtems_symbol_t *) e1;
|
||||
s2 = (rtems_symbol_t *) e2;
|
||||
|
||||
return strcasecmp(s1->name, s2->name);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Sort the symbol table using qsort
|
||||
*/
|
||||
|
||||
void
|
||||
static void
|
||||
rtems_symbol_sort(rtems_symbol_table_t *table)
|
||||
{
|
||||
#ifdef RTEMS_ON_SIMULATOR
|
||||
printf("Sorting symbols ... "); /* so slow we need a msg */
|
||||
fflush(stdout);
|
||||
#endif
|
||||
|
||||
qsort((void *) table->addresses, (size_t) table->next,
|
||||
sizeof(rtems_symbol_t), rtems_symbol_compare);
|
||||
|
||||
qsort((void *) table->symbols, (size_t) table->next,
|
||||
sizeof(rtems_symbol_t), rtems_symbol_string_compare);
|
||||
|
||||
#ifdef RTEMS_ON_SIMULATOR
|
||||
/* so slow we need a msg */
|
||||
printf("done\n");
|
||||
#endif
|
||||
|
||||
table->sorted = 1;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Search the symbol table by address
|
||||
* This code based on CYGNUS newlib bsearch, but changed
|
||||
@@ -261,6 +214,53 @@ rtems_symbol_value_lookup(
|
||||
return best;
|
||||
}
|
||||
|
||||
/*
|
||||
* Search the symbol table for the exact matching address.
|
||||
* If the symbol table has already been sorted, then
|
||||
* call the regular symbol value lookup, however, it it
|
||||
* has not yet been sorted, search it sequentially.
|
||||
* This routine is primarily used for low level symbol
|
||||
* lookups (eg. from exception handler and interrupt routines)
|
||||
* where the penality of sorted is not wanted and where
|
||||
* an exact match is needed such that symbol table order
|
||||
* is not important.
|
||||
*/
|
||||
const rtems_symbol_t *
|
||||
rtems_symbol_value_lookup_exact(
|
||||
rtems_symbol_table_t *table,
|
||||
rtems_unsigned32 value
|
||||
)
|
||||
{
|
||||
int s;
|
||||
rtems_symbol_t *sp;
|
||||
|
||||
if (table == 0)
|
||||
{
|
||||
table = rtems_monitor_symbols;
|
||||
if (table == 0)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (table->sorted)
|
||||
{
|
||||
sp = rtems_symbol_value_lookup(table, value);
|
||||
if ( rtems_symbol_value(sp) == value )
|
||||
return sp;
|
||||
else
|
||||
return NULL; /* not an exact match */
|
||||
}
|
||||
|
||||
for (s = 0, sp = table->addresses; s < table->next; s++, sp++)
|
||||
{
|
||||
if ( sp->value == value )
|
||||
return sp;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Search the symbol table by string name (case independent)
|
||||
*/
|
||||
@@ -271,33 +271,23 @@ rtems_symbol_name_lookup(
|
||||
char *name
|
||||
)
|
||||
{
|
||||
rtems_symbol_t *sp = 0;
|
||||
rtems_symbol_t key;
|
||||
int s;
|
||||
rtems_symbol_t *sp;
|
||||
|
||||
if (table == 0)
|
||||
{
|
||||
table = rtems_monitor_symbols;
|
||||
if (table == 0)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
for (s = 0, sp = table->addresses; s < table->next; s++, sp++)
|
||||
{
|
||||
if ( strcasecmp(sp->name, name) == 0 )
|
||||
return sp;
|
||||
}
|
||||
|
||||
if ((table == 0) || (name == 0))
|
||||
goto done;
|
||||
|
||||
if (table->sorted == 0)
|
||||
rtems_symbol_sort(table);
|
||||
|
||||
/*
|
||||
* dummy up one for bsearch()
|
||||
*/
|
||||
|
||||
key.name = name;
|
||||
key.value = 0;
|
||||
|
||||
sp = (rtems_symbol_t *) bsearch((const void *) &key,
|
||||
(const void *) table->symbols,
|
||||
(size_t) table->next,
|
||||
sizeof(rtems_symbol_t),
|
||||
rtems_symbol_string_compare);
|
||||
|
||||
done:
|
||||
return sp;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void *
|
||||
@@ -325,7 +315,7 @@ rtems_monitor_symbol_next(
|
||||
_Thread_Disable_dispatch();
|
||||
|
||||
*next_id += 1;
|
||||
return (void *) (table->symbols + n);
|
||||
return (void *) (table->addresses + n);
|
||||
|
||||
failed:
|
||||
*next_id = RTEMS_OBJECT_ID_FINAL;
|
||||
@@ -438,7 +428,7 @@ rtems_monitor_symbol_dump_all(
|
||||
if (table->sorted == 0)
|
||||
rtems_symbol_sort(table);
|
||||
|
||||
for (s = 0, sp = table->symbols; s < table->next; s++, sp++)
|
||||
for (s = 0, sp = table->addresses; s < table->next; s++, sp++)
|
||||
{
|
||||
rtems_monitor_symbol_t canonical_symbol;
|
||||
|
||||
|
||||
@@ -1,7 +1,4 @@
|
||||
/*
|
||||
* @(#)task.c 1.9 - 95/08/01
|
||||
*
|
||||
*
|
||||
* RTEMS Monitor task support
|
||||
*
|
||||
* $Id$
|
||||
|
||||
@@ -1,10 +1,3 @@
|
||||
/*
|
||||
* @(#)monitor.h 1.21 - 96/01/03
|
||||
*
|
||||
*
|
||||
* monitor.h,v 1.3 1995/09/29 17:19:02 joel Exp
|
||||
*/
|
||||
|
||||
/*
|
||||
* File: monitor.h
|
||||
*
|
||||
@@ -12,6 +5,8 @@
|
||||
* The RTEMS monitor task include file.
|
||||
*
|
||||
* TODO:
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#ifndef __MONITOR_H
|
||||
@@ -25,7 +20,7 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
/*
|
||||
* XXX this should be in rtems proper when type becomes part of id
|
||||
* Monitor types are derived from rtems object classes
|
||||
*/
|
||||
|
||||
typedef enum {
|
||||
@@ -306,7 +301,7 @@ typedef void (*rtems_monitor_object_dump_header_fn)(boolean);
|
||||
typedef void (*rtems_monitor_object_dump_fn)(void *, boolean);
|
||||
|
||||
typedef struct {
|
||||
rtems_monitor_object_type_t type;
|
||||
rtems_monitor_object_type_t type;
|
||||
void *object_information;
|
||||
int size; /* of canonical object */
|
||||
rtems_monitor_object_next_fn next;
|
||||
@@ -419,6 +414,7 @@ void rtems_symbol_table_destroy(rtems_symbol_table_t *table);
|
||||
|
||||
rtems_symbol_t *rtems_symbol_create(rtems_symbol_table_t *, char *, unsigned32);
|
||||
rtems_symbol_t *rtems_symbol_value_lookup(rtems_symbol_table_t *, unsigned32);
|
||||
const rtems_symbol_t *rtems_symbol_value_lookup_exact(rtems_symbol_table_t *, unsigned32);
|
||||
rtems_symbol_t *rtems_symbol_name_lookup(rtems_symbol_table_t *, char *);
|
||||
void *rtems_monitor_symbol_next(void *object_info, rtems_monitor_symbol_t *, rtems_id *);
|
||||
void rtems_monitor_symbol_canonical(rtems_monitor_symbol_t *, rtems_symbol_t *);
|
||||
|
||||
@@ -1,7 +1,4 @@
|
||||
/*
|
||||
* @(#)symbols.h 1.3 - 95/06/09
|
||||
*
|
||||
*
|
||||
* RTEMS monitor symbol table functions
|
||||
*
|
||||
* Description:
|
||||
@@ -47,14 +44,6 @@ typedef struct {
|
||||
|
||||
rtems_symbol_t *addresses; /* symbol array by address */
|
||||
|
||||
/*
|
||||
* String list -- sorted by name (when we do a lookup)
|
||||
* This is a duplicate of the info in table->addresses, but it's
|
||||
* pretty small, so I don't worry about it.
|
||||
*/
|
||||
|
||||
rtems_symbol_t *symbols; /* symbol array */
|
||||
|
||||
/*
|
||||
* String pool, unsorted, a list of blocks of string data
|
||||
*/
|
||||
|
||||
@@ -20,6 +20,19 @@
|
||||
|
||||
#include <rtems.h>
|
||||
|
||||
/*
|
||||
* HACK
|
||||
* the stack dump information should be printed by a "fatal" extension.
|
||||
* Fatal extensions only get called via rtems_fatal_error_occurred()
|
||||
* and not when rtems_shutdown_executive() is called.
|
||||
* I hope/think this is changing so that fatal extensions are renamed
|
||||
* to "shutdown" extensions.
|
||||
* When that happens, this #define should be deleted and all the code
|
||||
* it marks.
|
||||
*/
|
||||
#define DONT_USE_FATAL_EXTENSION
|
||||
|
||||
|
||||
extern rtems_configuration_table BSP_Configuration;
|
||||
|
||||
#include <assert.h>
|
||||
@@ -49,7 +62,11 @@ rtems_extensions_table Stack_check_Extension_table = {
|
||||
Stack_check_Switch_extension, /* task_switch */
|
||||
Stack_check_Begin_extension, /* task_begin */
|
||||
0, /* task_exitted */
|
||||
#ifdef DONT_USE_FATAL_EXTENSION
|
||||
0, /* fatal */
|
||||
#else
|
||||
Stack_check_Fatal_extension, /* fatal */
|
||||
#endif
|
||||
};
|
||||
|
||||
/*
|
||||
@@ -167,10 +184,6 @@ void Stack_check_Initialize( void )
|
||||
|
||||
Stack_check_Blown_task = 0;
|
||||
|
||||
#ifdef STACK_CHECKER_REPORT_USAGE
|
||||
atexit( Stack_check_Dump_usage );
|
||||
#endif
|
||||
|
||||
/*
|
||||
* If installed by a task, that task will not get setup properly
|
||||
* since it missed out on the create hook. This will cause a
|
||||
@@ -217,6 +230,17 @@ void Stack_check_Initialize( void )
|
||||
stack_check_dope_stack(&stack_check_interrupt_stack);
|
||||
}
|
||||
|
||||
#ifdef DONT_USE_FATAL_EXTENSION
|
||||
#ifdef RTEMS_DEBUG
|
||||
/*
|
||||
* this would normally be called by a fatal extension
|
||||
* handler, but we don't run fatal extensions unless
|
||||
* we fatal error.
|
||||
*/
|
||||
atexit(Stack_check_Dump_usage);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
stack_check_initialized = 1;
|
||||
}
|
||||
|
||||
@@ -431,14 +455,16 @@ void Stack_check_Dump_threads_usage(
|
||||
* Stack_check_Fatal_extension
|
||||
*/
|
||||
|
||||
void Stack_check_Fatal_extension(
|
||||
void Stack_check_Fatal_extension(
|
||||
Internal_errors_Source source,
|
||||
boolean is_internal,
|
||||
unsigned32 status
|
||||
)
|
||||
{
|
||||
#ifndef DONT_USE_FATAL_EXTENSION
|
||||
if (status == 0)
|
||||
Stack_check_Dump_usage();
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -57,7 +57,8 @@ rtems_unsigned32 First_Time_Through;
|
||||
void Process_case();
|
||||
|
||||
rtems_extension Fatal_extension(
|
||||
rtems_unsigned32 error
|
||||
rtems_unsigned32 error,
|
||||
boolean is_internal
|
||||
)
|
||||
{
|
||||
int index;
|
||||
|
||||
@@ -28,7 +28,8 @@ void put_error(
|
||||
);
|
||||
|
||||
rtems_extension Fatal_extension(
|
||||
rtems_unsigned32 error
|
||||
rtems_unsigned32 error,
|
||||
boolean is_internal
|
||||
);
|
||||
|
||||
rtems_task Task_1(
|
||||
|
||||
@@ -70,7 +70,7 @@ rtems_task Task_1(
|
||||
|
||||
status = rtems_message_queue_create(
|
||||
index,
|
||||
1,
|
||||
OPERATION_COUNT,
|
||||
16,
|
||||
RTEMS_DEFAULT_ATTRIBUTES,
|
||||
&id
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#!KSHELL -p
|
||||
#
|
||||
# Check test results against official output in the src tree
|
||||
#
|
||||
# $Id$
|
||||
#
|
||||
|
||||
@@ -64,8 +65,7 @@ args=$*
|
||||
# Run the tests
|
||||
#
|
||||
|
||||
cd $RTEMS_HOME/tests/$logdir ||
|
||||
fatal "No log directory: $RTEMS_HOME/tests/$logdir"
|
||||
cd $RTEMS_HOME/tests/$logdir || fatal "No log directory: $RTEMS_HOME/tests/$logdir"
|
||||
|
||||
tests="$args"
|
||||
if [ ! "$tests" ]
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
/*
|
||||
* @(#)assoc.h 1.4 - 95/10/25
|
||||
*
|
||||
*
|
||||
* Rtems associativity routines. Mainly used to convert a value from
|
||||
* one space to another (eg: our errno's to host errno's and v.v)
|
||||
|
||||
@@ -1,8 +1,4 @@
|
||||
|
||||
/*
|
||||
* @(#)error.h 1.3 - 95/10/25
|
||||
*
|
||||
*
|
||||
* Defines and externs for rtems error reporting
|
||||
*
|
||||
* $Id$
|
||||
@@ -24,7 +20,12 @@
|
||||
|
||||
const char *rtems_status_text(rtems_status_code);
|
||||
int rtems_error(int error_code, const char *printf_format, ...);
|
||||
#ifdef __GNUC__
|
||||
void rtems_panic(const char *printf_format, ...)
|
||||
__attribute__ ((__noreturn__));
|
||||
#else
|
||||
void rtems_panic(const char *printf_format, ...);
|
||||
#endif
|
||||
|
||||
extern int rtems_panic_in_progress;
|
||||
|
||||
|
||||
@@ -1,7 +1,4 @@
|
||||
/*
|
||||
* @(#)assoc.c 1.6 - 95/10/25
|
||||
*
|
||||
*
|
||||
* assoc.c
|
||||
* rtems assoc routines
|
||||
*
|
||||
|
||||
@@ -1,7 +1,4 @@
|
||||
/*
|
||||
* @(#)error.c 1.6 - 95/12/12
|
||||
*
|
||||
*
|
||||
* report errors and panics to RTEMS' stderr.
|
||||
* Currently just used by RTEMS monitor.
|
||||
*
|
||||
|
||||
@@ -1,7 +1,4 @@
|
||||
/*
|
||||
* @(#)command.c 1.5 - 95/08/02
|
||||
*
|
||||
*
|
||||
* Command parsing routines for RTEMS monitor
|
||||
*
|
||||
* TODO:
|
||||
|
||||
@@ -1,7 +1,4 @@
|
||||
/*
|
||||
* @(#)config.c 1.5 - 95/08/02
|
||||
*
|
||||
*
|
||||
* RTEMS Config display support
|
||||
*
|
||||
* TODO
|
||||
|
||||
@@ -1,7 +1,4 @@
|
||||
/*
|
||||
* @(#)dname.c 1.5 - 96/01/03
|
||||
*
|
||||
*
|
||||
* RTEMS monitor driver names support.
|
||||
*
|
||||
* There are 2 "driver" things the monitor knows about.
|
||||
|
||||
@@ -1,7 +1,4 @@
|
||||
/*
|
||||
* @(#)driver.c 1.4 - 95/08/02
|
||||
*
|
||||
*
|
||||
* RTEMS monitor IO (device drivers) support
|
||||
*
|
||||
* There are 2 "driver" things the monitor knows about.
|
||||
|
||||
@@ -1,7 +1,4 @@
|
||||
/*
|
||||
* @(#)extension.c 1.6 - 95/09/25
|
||||
*
|
||||
*
|
||||
* RTEMS Monitor extension support
|
||||
*
|
||||
* $Id$
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
/*
|
||||
* @(#)itask.c 1.6 - 96/01/03
|
||||
*
|
||||
*
|
||||
* RTEMS Monitor init task support
|
||||
* RTEMS Monitor init task support
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
@@ -1,9 +1,6 @@
|
||||
/*
|
||||
* @(#)manager.c 1.4 - 96/01/03
|
||||
*
|
||||
*
|
||||
* RTEMS Monitor "manager" support.
|
||||
* Used to traverse object (chain) lists and print them out.
|
||||
* RTEMS Monitor "manager" support.
|
||||
* Used to traverse object (chain) lists and print them out.
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
@@ -1,8 +1,4 @@
|
||||
/*
|
||||
* @(#)monitor.c 1.23 - 96/01/03
|
||||
*
|
||||
*
|
||||
*
|
||||
* RTEMS monitor main body
|
||||
*
|
||||
* TODO:
|
||||
@@ -18,7 +14,7 @@
|
||||
* should have a separate monitor FILE stream (ala the debugger)
|
||||
* remote request/response stuff should be cleaned up
|
||||
* maybe we can use real rpc??
|
||||
* 'info' commadn to print out:
|
||||
* 'info' command to print out:
|
||||
* interrupt stack location, direction and size
|
||||
* floating point config stuff
|
||||
* interrupt config stuff
|
||||
@@ -262,6 +258,18 @@ rtems_monitor_wakeup(void)
|
||||
status = rtems_event_send(rtems_monitor_task_id, MONITOR_WAKEUP_EVENT);
|
||||
}
|
||||
|
||||
void
|
||||
rtems_monitor_debugger_cmd(
|
||||
int argc,
|
||||
char **argv,
|
||||
unsigned32 command_arg,
|
||||
boolean verbose
|
||||
)
|
||||
{
|
||||
#ifdef CPU_INVOKE_DEBUGGER
|
||||
CPU_INVOKE_DEBUGGER;
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
rtems_monitor_pause_cmd(
|
||||
@@ -302,19 +310,6 @@ rtems_monitor_continue_cmd(
|
||||
rtems_monitor_suspend(RTEMS_NO_TIMEOUT);
|
||||
}
|
||||
|
||||
void
|
||||
rtems_monitor_debugger_cmd(
|
||||
int argc,
|
||||
char **argv,
|
||||
unsigned32 command_arg,
|
||||
boolean verbose
|
||||
)
|
||||
{
|
||||
#ifdef CPU_INVOKE_DEBUGGER
|
||||
CPU_INVOKE_DEBUGGER;
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
rtems_monitor_node_cmd(
|
||||
int argc,
|
||||
@@ -340,8 +335,10 @@ rtems_monitor_node_cmd(
|
||||
break;
|
||||
}
|
||||
|
||||
if ((new_node >= 1) && (new_node <= _Configuration_MP_table->maximum_nodes))
|
||||
rtems_monitor_default_node = new_node;
|
||||
if ((new_node >= 1) &&
|
||||
_Configuration_MP_table &&
|
||||
(new_node <= _Configuration_MP_table->maximum_nodes))
|
||||
rtems_monitor_default_node = new_node;
|
||||
}
|
||||
|
||||
|
||||
@@ -383,11 +380,7 @@ rtems_monitor_symbols_loadup(void)
|
||||
if (rtems_monitor_symbols == 0)
|
||||
return;
|
||||
|
||||
#ifdef SIMHPPA
|
||||
fp = fdopen(8, "r"); /* don't ask; don't tell */
|
||||
#else
|
||||
fp = fopen("symbols", "r");
|
||||
#endif
|
||||
|
||||
if (fp == 0)
|
||||
return;
|
||||
|
||||
@@ -1,7 +1,4 @@
|
||||
/*
|
||||
* @(#)mpci.c 1.6 - 95/08/02
|
||||
*
|
||||
*
|
||||
* RTEMS MPCI Config display support
|
||||
*
|
||||
* TODO
|
||||
|
||||
@@ -1,7 +1,4 @@
|
||||
/*
|
||||
* @(#)object.c 1.9 - 96/01/03
|
||||
*
|
||||
*
|
||||
* RTEMS Monitor "object" support.
|
||||
*
|
||||
* Used to traverse object lists and print them out.
|
||||
@@ -341,7 +338,7 @@ rtems_monitor_object_cmd(
|
||||
|
||||
for (arg=1; argv[arg]; arg++)
|
||||
{
|
||||
id = (rtems_id) strtoul(argv[arg], 0, 0);
|
||||
id = (rtems_id) strtoul(argv[arg], 0, 16);
|
||||
id = rtems_monitor_id_fixup(id, default_node, type);
|
||||
type = (rtems_monitor_object_type_t) rtems_get_class(id);
|
||||
|
||||
|
||||
@@ -1,7 +1,4 @@
|
||||
/*
|
||||
* @(#)prmisc.c 1.9 - 95/08/02
|
||||
*
|
||||
*
|
||||
* Print misc stuff for the monitor dump routines
|
||||
* Each routine returns the number of characters it output.
|
||||
*
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
/*
|
||||
* @(#)queue.c 1.5 - 95/07/31
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
/*
|
||||
* @(#)server.c 1.5 - 96/01/03
|
||||
*
|
||||
*
|
||||
* RTEMS monitor server (handles requests for info from RTEMS monitors
|
||||
* RTEMS monitor server (handles requests for info from RTEMS monitors
|
||||
* running on other nodes)
|
||||
*
|
||||
* $Id$
|
||||
|
||||
@@ -1,11 +1,3 @@
|
||||
/*
|
||||
* @(#)symbols.c 1.10 - 95/08/02
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
/* #define qsort _quicksort */
|
||||
|
||||
/*
|
||||
* File: symbols.c
|
||||
*
|
||||
@@ -15,6 +7,8 @@
|
||||
*
|
||||
*
|
||||
* TODO:
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#define __RTEMS_VIOLATE_KERNEL_VISIBILITY__
|
||||
@@ -50,11 +44,6 @@ rtems_symbol_table_destroy(rtems_symbol_table_t *table)
|
||||
if (table->addresses)
|
||||
(void) free(table->addresses);
|
||||
table->addresses = 0;
|
||||
|
||||
if (table->symbols)
|
||||
(void) free(table->symbols);
|
||||
table->symbols = 0;
|
||||
|
||||
p = table->string_buffer_head;
|
||||
while (p)
|
||||
{
|
||||
@@ -93,11 +82,6 @@ rtems_symbol_create(
|
||||
table->addresses = (rtems_symbol_t *) realloc((void *) table->addresses, newsize * sizeof(rtems_symbol_t));
|
||||
if (table->addresses == 0) /* blew it; lost orig */
|
||||
goto failed;
|
||||
|
||||
table->symbols = (rtems_symbol_t *) realloc((void *) table->symbols, newsize * sizeof(rtems_symbol_t));
|
||||
if (table->symbols == 0) /* blew it; lost orig */
|
||||
goto failed;
|
||||
|
||||
table->size = newsize;
|
||||
}
|
||||
|
||||
@@ -129,9 +113,6 @@ rtems_symbol_create(
|
||||
(void) strcpy(sp->name, name);
|
||||
|
||||
table->strings_next += symbol_length;
|
||||
|
||||
table->symbols[table->next] = *sp;
|
||||
|
||||
table->sorted = 0;
|
||||
table->next++;
|
||||
|
||||
@@ -147,7 +128,7 @@ failed:
|
||||
* Qsort entry point for compare by address
|
||||
*/
|
||||
|
||||
int
|
||||
static int
|
||||
rtems_symbol_compare(const void *e1,
|
||||
const void *e2)
|
||||
{
|
||||
@@ -162,48 +143,20 @@ rtems_symbol_compare(const void *e1,
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* Qsort entry point for compare by string name (case independent)
|
||||
*/
|
||||
|
||||
int
|
||||
rtems_symbol_string_compare(const void *e1,
|
||||
const void *e2)
|
||||
{
|
||||
rtems_symbol_t *s1, *s2;
|
||||
s1 = (rtems_symbol_t *) e1;
|
||||
s2 = (rtems_symbol_t *) e2;
|
||||
|
||||
return strcasecmp(s1->name, s2->name);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Sort the symbol table using qsort
|
||||
*/
|
||||
|
||||
void
|
||||
static void
|
||||
rtems_symbol_sort(rtems_symbol_table_t *table)
|
||||
{
|
||||
#ifdef RTEMS_ON_SIMULATOR
|
||||
printf("Sorting symbols ... "); /* so slow we need a msg */
|
||||
fflush(stdout);
|
||||
#endif
|
||||
|
||||
qsort((void *) table->addresses, (size_t) table->next,
|
||||
sizeof(rtems_symbol_t), rtems_symbol_compare);
|
||||
|
||||
qsort((void *) table->symbols, (size_t) table->next,
|
||||
sizeof(rtems_symbol_t), rtems_symbol_string_compare);
|
||||
|
||||
#ifdef RTEMS_ON_SIMULATOR
|
||||
/* so slow we need a msg */
|
||||
printf("done\n");
|
||||
#endif
|
||||
|
||||
table->sorted = 1;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Search the symbol table by address
|
||||
* This code based on CYGNUS newlib bsearch, but changed
|
||||
@@ -261,6 +214,53 @@ rtems_symbol_value_lookup(
|
||||
return best;
|
||||
}
|
||||
|
||||
/*
|
||||
* Search the symbol table for the exact matching address.
|
||||
* If the symbol table has already been sorted, then
|
||||
* call the regular symbol value lookup, however, it it
|
||||
* has not yet been sorted, search it sequentially.
|
||||
* This routine is primarily used for low level symbol
|
||||
* lookups (eg. from exception handler and interrupt routines)
|
||||
* where the penality of sorted is not wanted and where
|
||||
* an exact match is needed such that symbol table order
|
||||
* is not important.
|
||||
*/
|
||||
const rtems_symbol_t *
|
||||
rtems_symbol_value_lookup_exact(
|
||||
rtems_symbol_table_t *table,
|
||||
rtems_unsigned32 value
|
||||
)
|
||||
{
|
||||
int s;
|
||||
rtems_symbol_t *sp;
|
||||
|
||||
if (table == 0)
|
||||
{
|
||||
table = rtems_monitor_symbols;
|
||||
if (table == 0)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (table->sorted)
|
||||
{
|
||||
sp = rtems_symbol_value_lookup(table, value);
|
||||
if ( rtems_symbol_value(sp) == value )
|
||||
return sp;
|
||||
else
|
||||
return NULL; /* not an exact match */
|
||||
}
|
||||
|
||||
for (s = 0, sp = table->addresses; s < table->next; s++, sp++)
|
||||
{
|
||||
if ( sp->value == value )
|
||||
return sp;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Search the symbol table by string name (case independent)
|
||||
*/
|
||||
@@ -271,33 +271,23 @@ rtems_symbol_name_lookup(
|
||||
char *name
|
||||
)
|
||||
{
|
||||
rtems_symbol_t *sp = 0;
|
||||
rtems_symbol_t key;
|
||||
int s;
|
||||
rtems_symbol_t *sp;
|
||||
|
||||
if (table == 0)
|
||||
{
|
||||
table = rtems_monitor_symbols;
|
||||
if (table == 0)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
for (s = 0, sp = table->addresses; s < table->next; s++, sp++)
|
||||
{
|
||||
if ( strcasecmp(sp->name, name) == 0 )
|
||||
return sp;
|
||||
}
|
||||
|
||||
if ((table == 0) || (name == 0))
|
||||
goto done;
|
||||
|
||||
if (table->sorted == 0)
|
||||
rtems_symbol_sort(table);
|
||||
|
||||
/*
|
||||
* dummy up one for bsearch()
|
||||
*/
|
||||
|
||||
key.name = name;
|
||||
key.value = 0;
|
||||
|
||||
sp = (rtems_symbol_t *) bsearch((const void *) &key,
|
||||
(const void *) table->symbols,
|
||||
(size_t) table->next,
|
||||
sizeof(rtems_symbol_t),
|
||||
rtems_symbol_string_compare);
|
||||
|
||||
done:
|
||||
return sp;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void *
|
||||
@@ -325,7 +315,7 @@ rtems_monitor_symbol_next(
|
||||
_Thread_Disable_dispatch();
|
||||
|
||||
*next_id += 1;
|
||||
return (void *) (table->symbols + n);
|
||||
return (void *) (table->addresses + n);
|
||||
|
||||
failed:
|
||||
*next_id = RTEMS_OBJECT_ID_FINAL;
|
||||
@@ -438,7 +428,7 @@ rtems_monitor_symbol_dump_all(
|
||||
if (table->sorted == 0)
|
||||
rtems_symbol_sort(table);
|
||||
|
||||
for (s = 0, sp = table->symbols; s < table->next; s++, sp++)
|
||||
for (s = 0, sp = table->addresses; s < table->next; s++, sp++)
|
||||
{
|
||||
rtems_monitor_symbol_t canonical_symbol;
|
||||
|
||||
|
||||
@@ -1,7 +1,4 @@
|
||||
/*
|
||||
* @(#)task.c 1.9 - 95/08/01
|
||||
*
|
||||
*
|
||||
* RTEMS Monitor task support
|
||||
*
|
||||
* $Id$
|
||||
|
||||
@@ -1,10 +1,3 @@
|
||||
/*
|
||||
* @(#)monitor.h 1.21 - 96/01/03
|
||||
*
|
||||
*
|
||||
* monitor.h,v 1.3 1995/09/29 17:19:02 joel Exp
|
||||
*/
|
||||
|
||||
/*
|
||||
* File: monitor.h
|
||||
*
|
||||
@@ -12,6 +5,8 @@
|
||||
* The RTEMS monitor task include file.
|
||||
*
|
||||
* TODO:
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#ifndef __MONITOR_H
|
||||
@@ -25,7 +20,7 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
/*
|
||||
* XXX this should be in rtems proper when type becomes part of id
|
||||
* Monitor types are derived from rtems object classes
|
||||
*/
|
||||
|
||||
typedef enum {
|
||||
@@ -306,7 +301,7 @@ typedef void (*rtems_monitor_object_dump_header_fn)(boolean);
|
||||
typedef void (*rtems_monitor_object_dump_fn)(void *, boolean);
|
||||
|
||||
typedef struct {
|
||||
rtems_monitor_object_type_t type;
|
||||
rtems_monitor_object_type_t type;
|
||||
void *object_information;
|
||||
int size; /* of canonical object */
|
||||
rtems_monitor_object_next_fn next;
|
||||
@@ -419,6 +414,7 @@ void rtems_symbol_table_destroy(rtems_symbol_table_t *table);
|
||||
|
||||
rtems_symbol_t *rtems_symbol_create(rtems_symbol_table_t *, char *, unsigned32);
|
||||
rtems_symbol_t *rtems_symbol_value_lookup(rtems_symbol_table_t *, unsigned32);
|
||||
const rtems_symbol_t *rtems_symbol_value_lookup_exact(rtems_symbol_table_t *, unsigned32);
|
||||
rtems_symbol_t *rtems_symbol_name_lookup(rtems_symbol_table_t *, char *);
|
||||
void *rtems_monitor_symbol_next(void *object_info, rtems_monitor_symbol_t *, rtems_id *);
|
||||
void rtems_monitor_symbol_canonical(rtems_monitor_symbol_t *, rtems_symbol_t *);
|
||||
|
||||
@@ -1,7 +1,4 @@
|
||||
/*
|
||||
* @(#)symbols.h 1.3 - 95/06/09
|
||||
*
|
||||
*
|
||||
* RTEMS monitor symbol table functions
|
||||
*
|
||||
* Description:
|
||||
@@ -47,14 +44,6 @@ typedef struct {
|
||||
|
||||
rtems_symbol_t *addresses; /* symbol array by address */
|
||||
|
||||
/*
|
||||
* String list -- sorted by name (when we do a lookup)
|
||||
* This is a duplicate of the info in table->addresses, but it's
|
||||
* pretty small, so I don't worry about it.
|
||||
*/
|
||||
|
||||
rtems_symbol_t *symbols; /* symbol array */
|
||||
|
||||
/*
|
||||
* String pool, unsorted, a list of blocks of string data
|
||||
*/
|
||||
|
||||
@@ -20,6 +20,19 @@
|
||||
|
||||
#include <rtems.h>
|
||||
|
||||
/*
|
||||
* HACK
|
||||
* the stack dump information should be printed by a "fatal" extension.
|
||||
* Fatal extensions only get called via rtems_fatal_error_occurred()
|
||||
* and not when rtems_shutdown_executive() is called.
|
||||
* I hope/think this is changing so that fatal extensions are renamed
|
||||
* to "shutdown" extensions.
|
||||
* When that happens, this #define should be deleted and all the code
|
||||
* it marks.
|
||||
*/
|
||||
#define DONT_USE_FATAL_EXTENSION
|
||||
|
||||
|
||||
extern rtems_configuration_table BSP_Configuration;
|
||||
|
||||
#include <assert.h>
|
||||
@@ -49,7 +62,11 @@ rtems_extensions_table Stack_check_Extension_table = {
|
||||
Stack_check_Switch_extension, /* task_switch */
|
||||
Stack_check_Begin_extension, /* task_begin */
|
||||
0, /* task_exitted */
|
||||
#ifdef DONT_USE_FATAL_EXTENSION
|
||||
0, /* fatal */
|
||||
#else
|
||||
Stack_check_Fatal_extension, /* fatal */
|
||||
#endif
|
||||
};
|
||||
|
||||
/*
|
||||
@@ -167,10 +184,6 @@ void Stack_check_Initialize( void )
|
||||
|
||||
Stack_check_Blown_task = 0;
|
||||
|
||||
#ifdef STACK_CHECKER_REPORT_USAGE
|
||||
atexit( Stack_check_Dump_usage );
|
||||
#endif
|
||||
|
||||
/*
|
||||
* If installed by a task, that task will not get setup properly
|
||||
* since it missed out on the create hook. This will cause a
|
||||
@@ -217,6 +230,17 @@ void Stack_check_Initialize( void )
|
||||
stack_check_dope_stack(&stack_check_interrupt_stack);
|
||||
}
|
||||
|
||||
#ifdef DONT_USE_FATAL_EXTENSION
|
||||
#ifdef RTEMS_DEBUG
|
||||
/*
|
||||
* this would normally be called by a fatal extension
|
||||
* handler, but we don't run fatal extensions unless
|
||||
* we fatal error.
|
||||
*/
|
||||
atexit(Stack_check_Dump_usage);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
stack_check_initialized = 1;
|
||||
}
|
||||
|
||||
@@ -431,14 +455,16 @@ void Stack_check_Dump_threads_usage(
|
||||
* Stack_check_Fatal_extension
|
||||
*/
|
||||
|
||||
void Stack_check_Fatal_extension(
|
||||
void Stack_check_Fatal_extension(
|
||||
Internal_errors_Source source,
|
||||
boolean is_internal,
|
||||
unsigned32 status
|
||||
)
|
||||
{
|
||||
#ifndef DONT_USE_FATAL_EXTENSION
|
||||
if (status == 0)
|
||||
Stack_check_Dump_usage();
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -57,7 +57,8 @@ rtems_unsigned32 First_Time_Through;
|
||||
void Process_case();
|
||||
|
||||
rtems_extension Fatal_extension(
|
||||
rtems_unsigned32 error
|
||||
rtems_unsigned32 error,
|
||||
boolean is_internal
|
||||
)
|
||||
{
|
||||
int index;
|
||||
|
||||
@@ -28,7 +28,8 @@ void put_error(
|
||||
);
|
||||
|
||||
rtems_extension Fatal_extension(
|
||||
rtems_unsigned32 error
|
||||
rtems_unsigned32 error,
|
||||
boolean is_internal
|
||||
);
|
||||
|
||||
rtems_task Task_1(
|
||||
|
||||
@@ -70,7 +70,7 @@ rtems_task Task_1(
|
||||
|
||||
status = rtems_message_queue_create(
|
||||
index,
|
||||
1,
|
||||
OPERATION_COUNT,
|
||||
16,
|
||||
RTEMS_DEFAULT_ATTRIBUTES,
|
||||
&id
|
||||
|
||||
@@ -1,12 +1,9 @@
|
||||
/*
|
||||
* @(#)genoffsets.c 1.7 - 95/09/25
|
||||
*
|
||||
*
|
||||
* genoffsets.c
|
||||
*
|
||||
* This file generates the offsets.h for the HP PA-RISC port of RTEMS.
|
||||
*
|
||||
* NOTE: It only prints the offset for structures actually used
|
||||
* NOTE: It only prints the offset for structures actually used
|
||||
* by the assembly code.
|
||||
*
|
||||
* COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
|
||||
@@ -17,7 +14,6 @@
|
||||
* notice must appear in all copies of this file and its derivatives.
|
||||
*
|
||||
* $Id$
|
||||
*
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
@@ -70,7 +66,7 @@ printf(
|
||||
(int) &((TYPE)0)->FIELD );
|
||||
|
||||
#define PRINT_SIZE( STRING, item ) \
|
||||
printf( "#define\t%s\t%d\t\t/* 0x%x */\n", \
|
||||
printf( "#ifdef ASM\n#define\t%s\t%d\t\t/* 0x%x */\n#endif\n", \
|
||||
STRING, \
|
||||
sizeof(item), \
|
||||
sizeof(item) );
|
||||
@@ -145,6 +141,39 @@ printf(
|
||||
|
||||
PRINT_COMMENT("Context_Control_fp information");
|
||||
|
||||
PRINT_IT( "FR0_OFFSET", Context_Control_fp *, fr0 );
|
||||
PRINT_IT( "FR1_OFFSET", Context_Control_fp *, fr1 );
|
||||
PRINT_IT( "FR2_OFFSET", Context_Control_fp *, fr2 );
|
||||
PRINT_IT( "FR3_OFFSET", Context_Control_fp *, fr3 );
|
||||
PRINT_IT( "FR4_OFFSET", Context_Control_fp *, fr4 );
|
||||
PRINT_IT( "FR5_OFFSET", Context_Control_fp *, fr5 );
|
||||
PRINT_IT( "FR6_OFFSET", Context_Control_fp *, fr6 );
|
||||
PRINT_IT( "FR7_OFFSET", Context_Control_fp *, fr7 );
|
||||
PRINT_IT( "FR8_OFFSET", Context_Control_fp *, fr8 );
|
||||
PRINT_IT( "FR9_OFFSET", Context_Control_fp *, fr9 );
|
||||
PRINT_IT( "FR10_OFFSET", Context_Control_fp *, fr10 );
|
||||
PRINT_IT( "FR11_OFFSET", Context_Control_fp *, fr11 );
|
||||
PRINT_IT( "FR12_OFFSET", Context_Control_fp *, fr12 );
|
||||
PRINT_IT( "FR13_OFFSET", Context_Control_fp *, fr13 );
|
||||
PRINT_IT( "FR14_OFFSET", Context_Control_fp *, fr14 );
|
||||
PRINT_IT( "FR15_OFFSET", Context_Control_fp *, fr15 );
|
||||
PRINT_IT( "FR16_OFFSET", Context_Control_fp *, fr16 );
|
||||
PRINT_IT( "FR17_OFFSET", Context_Control_fp *, fr17 );
|
||||
PRINT_IT( "FR18_OFFSET", Context_Control_fp *, fr18 );
|
||||
PRINT_IT( "FR19_OFFSET", Context_Control_fp *, fr19 );
|
||||
PRINT_IT( "FR20_OFFSET", Context_Control_fp *, fr20 );
|
||||
PRINT_IT( "FR21_OFFSET", Context_Control_fp *, fr21 );
|
||||
PRINT_IT( "FR22_OFFSET", Context_Control_fp *, fr22 );
|
||||
PRINT_IT( "FR23_OFFSET", Context_Control_fp *, fr23 );
|
||||
PRINT_IT( "FR24_OFFSET", Context_Control_fp *, fr24 );
|
||||
PRINT_IT( "FR25_OFFSET", Context_Control_fp *, fr25 );
|
||||
PRINT_IT( "FR26_OFFSET", Context_Control_fp *, fr26 );
|
||||
PRINT_IT( "FR27_OFFSET", Context_Control_fp *, fr27 );
|
||||
PRINT_IT( "FR28_OFFSET", Context_Control_fp *, fr28 );
|
||||
PRINT_IT( "FR29_OFFSET", Context_Control_fp *, fr29 );
|
||||
PRINT_IT( "FR30_OFFSET", Context_Control_fp *, fr30 );
|
||||
PRINT_IT( "FR31_OFFSET", Context_Control_fp *, fr31 );
|
||||
|
||||
PRINT_SIZE("CPU_CONTEXT_FP_SIZE", Context_Control_fp);
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user