updates from Tony Bennett

This commit is contained in:
Joel Sherrill
1996-04-22 16:53:46 +00:00
parent 5a36154a60
commit 8389628c1b
88 changed files with 494 additions and 622 deletions

View File

@@ -1,6 +1,4 @@
/* /*
* @(#)assoc.h 1.4 - 95/10/25
*
* *
* Rtems associativity routines. Mainly used to convert a value from * 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) * one space to another (eg: our errno's to host errno's and v.v)

View File

@@ -1,8 +1,4 @@
/* /*
* @(#)error.h 1.3 - 95/10/25
*
*
* Defines and externs for rtems error reporting * Defines and externs for rtems error reporting
* *
* $Id$ * $Id$
@@ -24,7 +20,12 @@
const char *rtems_status_text(rtems_status_code); const char *rtems_status_text(rtems_status_code);
int rtems_error(int error_code, const char *printf_format, ...); 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, ...); void rtems_panic(const char *printf_format, ...);
#endif
extern int rtems_panic_in_progress; extern int rtems_panic_in_progress;

View File

@@ -1,7 +1,4 @@
/* /*
* @(#)assoc.c 1.6 - 95/10/25
*
*
* assoc.c * assoc.c
* rtems assoc routines * rtems assoc routines
* *

View File

@@ -1,7 +1,4 @@
/* /*
* @(#)error.c 1.6 - 95/12/12
*
*
* report errors and panics to RTEMS' stderr. * report errors and panics to RTEMS' stderr.
* Currently just used by RTEMS monitor. * Currently just used by RTEMS monitor.
* *

View File

@@ -1,7 +1,4 @@
/* /*
* @(#)genoffsets.c 1.7 - 95/09/25
*
*
* genoffsets.c * genoffsets.c
* *
* This file generates the offsets.h for the HP PA-RISC port of RTEMS. * This file generates the offsets.h for the HP PA-RISC port of RTEMS.
@@ -17,7 +14,6 @@
* notice must appear in all copies of this file and its derivatives. * notice must appear in all copies of this file and its derivatives.
* *
* $Id$ * $Id$
*
*/ */
#include <stdio.h> #include <stdio.h>
@@ -70,7 +66,7 @@ printf(
(int) &((TYPE)0)->FIELD ); (int) &((TYPE)0)->FIELD );
#define PRINT_SIZE( STRING, item ) \ #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, \ STRING, \
sizeof(item), \ sizeof(item), \
sizeof(item) ); sizeof(item) );
@@ -145,6 +141,39 @@ printf(
PRINT_COMMENT("Context_Control_fp information"); 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); PRINT_SIZE("CPU_CONTEXT_FP_SIZE", Context_Control_fp);
/* /*

View File

@@ -1,6 +1,4 @@
/* /*
* @(#)assoc.h 1.4 - 95/10/25
*
* *
* Rtems associativity routines. Mainly used to convert a value from * 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) * one space to another (eg: our errno's to host errno's and v.v)

View File

@@ -1,8 +1,4 @@
/* /*
* @(#)error.h 1.3 - 95/10/25
*
*
* Defines and externs for rtems error reporting * Defines and externs for rtems error reporting
* *
* $Id$ * $Id$
@@ -24,7 +20,12 @@
const char *rtems_status_text(rtems_status_code); const char *rtems_status_text(rtems_status_code);
int rtems_error(int error_code, const char *printf_format, ...); 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, ...); void rtems_panic(const char *printf_format, ...);
#endif
extern int rtems_panic_in_progress; extern int rtems_panic_in_progress;

View File

@@ -97,33 +97,10 @@ extern int use_print_buffer;
*/ */
#define BSP_LIBIO_MAX_FDS 20 #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 #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);
rtems_isr_entry set_vector(rtems_isr_entry, rtems_vector_number, int);
void bsp_start( void ); void bsp_start( void );
void bsp_cleanup( void ); void bsp_cleanup( void );

View File

@@ -1,6 +1,4 @@
/* /*
* @(#)ttydrv.h 1.1 - 95/06/02
*
* $Id$ * $Id$
*/ */

View File

@@ -1,7 +1,3 @@
/*
* @(#)bspstart.c 1.16 - 95/06/28
*/
/* bsp_start() /* bsp_start()
* *
* This routine starts the application. It includes application, * This routine starts the application. It includes application,
@@ -352,6 +348,12 @@ bsp_start(void)
Cpu_table.itimer_clicks_per_microsecond = 1; 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 * Determine the external interrupt processing order
* the external interrupt handler walks thru this table, in * the external interrupt handler walks thru this table, in
@@ -369,6 +371,7 @@ bsp_start(void)
HPPA_INTERRUPT_EXTERNAL_10 - HPPA_INTERRUPT_EXTERNAL_BASE; HPPA_INTERRUPT_EXTERNAL_10 - HPPA_INTERRUPT_EXTERNAL_BASE;
Cpu_table.external_interrupts++; Cpu_table.external_interrupts++;
} }
#endif
/* /*
* Add 1 region for RTEMS Malloc * Add 1 region for RTEMS Malloc

View File

@@ -1,7 +1,4 @@
/* /*
* @(#)assoc.c 1.6 - 95/10/25
*
*
* assoc.c * assoc.c
* rtems assoc routines * rtems assoc routines
* *

View File

@@ -1,6 +1,4 @@
/* /*
* @(#)assoc.h 1.4 - 95/10/25
*
* *
* Rtems associativity routines. Mainly used to convert a value from * 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) * one space to another (eg: our errno's to host errno's and v.v)

View File

@@ -1,7 +1,4 @@
/* /*
* @(#)error.c 1.6 - 95/12/12
*
*
* report errors and panics to RTEMS' stderr. * report errors and panics to RTEMS' stderr.
* Currently just used by RTEMS monitor. * Currently just used by RTEMS monitor.
* *

View File

@@ -1,8 +1,4 @@
/* /*
* @(#)error.h 1.3 - 95/10/25
*
*
* Defines and externs for rtems error reporting * Defines and externs for rtems error reporting
* *
* $Id$ * $Id$
@@ -24,7 +20,12 @@
const char *rtems_status_text(rtems_status_code); const char *rtems_status_text(rtems_status_code);
int rtems_error(int error_code, const char *printf_format, ...); 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, ...); void rtems_panic(const char *printf_format, ...);
#endif
extern int rtems_panic_in_progress; extern int rtems_panic_in_progress;

View File

@@ -1,7 +1,4 @@
/* /*
* @(#)assoc.c 1.6 - 95/10/25
*
*
* assoc.c * assoc.c
* rtems assoc routines * rtems assoc routines
* *

View File

@@ -1,6 +1,4 @@
/* /*
* @(#)assoc.h 1.4 - 95/10/25
*
* *
* Rtems associativity routines. Mainly used to convert a value from * 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) * one space to another (eg: our errno's to host errno's and v.v)

View File

@@ -1,7 +1,4 @@
/* /*
* @(#)error.c 1.6 - 95/12/12
*
*
* report errors and panics to RTEMS' stderr. * report errors and panics to RTEMS' stderr.
* Currently just used by RTEMS monitor. * Currently just used by RTEMS monitor.
* *

View File

@@ -1,8 +1,4 @@
/* /*
* @(#)error.h 1.3 - 95/10/25
*
*
* Defines and externs for rtems error reporting * Defines and externs for rtems error reporting
* *
* $Id$ * $Id$
@@ -24,7 +20,12 @@
const char *rtems_status_text(rtems_status_code); const char *rtems_status_text(rtems_status_code);
int rtems_error(int error_code, const char *printf_format, ...); 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, ...); void rtems_panic(const char *printf_format, ...);
#endif
extern int rtems_panic_in_progress; extern int rtems_panic_in_progress;

View File

@@ -1,7 +1,4 @@
/* /*
* @(#)command.c 1.5 - 95/08/02
*
*
* Command parsing routines for RTEMS monitor * Command parsing routines for RTEMS monitor
* *
* TODO: * TODO:

View File

@@ -1,7 +1,4 @@
/* /*
* @(#)config.c 1.5 - 95/08/02
*
*
* RTEMS Config display support * RTEMS Config display support
* *
* TODO * TODO

View File

@@ -1,7 +1,4 @@
/* /*
* @(#)dname.c 1.5 - 96/01/03
*
*
* RTEMS monitor driver names support. * RTEMS monitor driver names support.
* *
* There are 2 "driver" things the monitor knows about. * There are 2 "driver" things the monitor knows about.

View File

@@ -1,7 +1,4 @@
/* /*
* @(#)driver.c 1.4 - 95/08/02
*
*
* RTEMS monitor IO (device drivers) support * RTEMS monitor IO (device drivers) support
* *
* There are 2 "driver" things the monitor knows about. * There are 2 "driver" things the monitor knows about.

View File

@@ -1,7 +1,4 @@
/* /*
* @(#)extension.c 1.6 - 95/09/25
*
*
* RTEMS Monitor extension support * RTEMS Monitor extension support
* *
* $Id$ * $Id$

View File

@@ -1,7 +1,4 @@
/* /*
* @(#)itask.c 1.6 - 96/01/03
*
*
* RTEMS Monitor init task support * RTEMS Monitor init task support
* *
* $Id$ * $Id$

View File

@@ -1,7 +1,4 @@
/* /*
* @(#)manager.c 1.4 - 96/01/03
*
*
* RTEMS Monitor "manager" support. * RTEMS Monitor "manager" support.
* Used to traverse object (chain) lists and print them out. * Used to traverse object (chain) lists and print them out.
* *

View File

@@ -1,8 +1,4 @@
/* /*
* @(#)monitor.c 1.23 - 96/01/03
*
*
*
* RTEMS monitor main body * RTEMS monitor main body
* *
* TODO: * TODO:
@@ -18,7 +14,7 @@
* should have a separate monitor FILE stream (ala the debugger) * should have a separate monitor FILE stream (ala the debugger)
* remote request/response stuff should be cleaned up * remote request/response stuff should be cleaned up
* maybe we can use real rpc?? * maybe we can use real rpc??
* 'info' commadn to print out: * 'info' command to print out:
* interrupt stack location, direction and size * interrupt stack location, direction and size
* floating point config stuff * floating point config stuff
* interrupt config stuff * interrupt config stuff
@@ -262,6 +258,18 @@ rtems_monitor_wakeup(void)
status = rtems_event_send(rtems_monitor_task_id, MONITOR_WAKEUP_EVENT); 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 void
rtems_monitor_pause_cmd( rtems_monitor_pause_cmd(
@@ -302,19 +310,6 @@ rtems_monitor_continue_cmd(
rtems_monitor_suspend(RTEMS_NO_TIMEOUT); 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 void
rtems_monitor_node_cmd( rtems_monitor_node_cmd(
int argc, int argc,
@@ -340,7 +335,9 @@ rtems_monitor_node_cmd(
break; break;
} }
if ((new_node >= 1) && (new_node <= _Configuration_MP_table->maximum_nodes)) if ((new_node >= 1) &&
_Configuration_MP_table &&
(new_node <= _Configuration_MP_table->maximum_nodes))
rtems_monitor_default_node = new_node; rtems_monitor_default_node = new_node;
} }
@@ -383,11 +380,7 @@ rtems_monitor_symbols_loadup(void)
if (rtems_monitor_symbols == 0) if (rtems_monitor_symbols == 0)
return; return;
#ifdef SIMHPPA
fp = fdopen(8, "r"); /* don't ask; don't tell */
#else
fp = fopen("symbols", "r"); fp = fopen("symbols", "r");
#endif
if (fp == 0) if (fp == 0)
return; return;

View File

@@ -1,7 +1,4 @@
/* /*
* @(#)mpci.c 1.6 - 95/08/02
*
*
* RTEMS MPCI Config display support * RTEMS MPCI Config display support
* *
* TODO * TODO

View File

@@ -1,7 +1,4 @@
/* /*
* @(#)object.c 1.9 - 96/01/03
*
*
* RTEMS Monitor "object" support. * RTEMS Monitor "object" support.
* *
* Used to traverse object lists and print them out. * Used to traverse object lists and print them out.
@@ -341,7 +338,7 @@ rtems_monitor_object_cmd(
for (arg=1; argv[arg]; arg++) 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); id = rtems_monitor_id_fixup(id, default_node, type);
type = (rtems_monitor_object_type_t) rtems_get_class(id); type = (rtems_monitor_object_type_t) rtems_get_class(id);

View File

@@ -1,7 +1,4 @@
/* /*
* @(#)prmisc.c 1.9 - 95/08/02
*
*
* Print misc stuff for the monitor dump routines * Print misc stuff for the monitor dump routines
* Each routine returns the number of characters it output. * Each routine returns the number of characters it output.
* *

View File

@@ -1,6 +1,4 @@
/* /*
* @(#)queue.c 1.5 - 95/07/31
*
* $Id$ * $Id$
*/ */

View File

@@ -1,7 +1,4 @@
/* /*
* @(#)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) * running on other nodes)
* *

View File

@@ -1,11 +1,3 @@
/*
* @(#)symbols.c 1.10 - 95/08/02
*
* $Id$
*/
/* #define qsort _quicksort */
/* /*
* File: symbols.c * File: symbols.c
* *
@@ -15,6 +7,8 @@
* *
* *
* TODO: * TODO:
*
* $Id$
*/ */
#define __RTEMS_VIOLATE_KERNEL_VISIBILITY__ #define __RTEMS_VIOLATE_KERNEL_VISIBILITY__
@@ -50,11 +44,6 @@ rtems_symbol_table_destroy(rtems_symbol_table_t *table)
if (table->addresses) if (table->addresses)
(void) free(table->addresses); (void) free(table->addresses);
table->addresses = 0; table->addresses = 0;
if (table->symbols)
(void) free(table->symbols);
table->symbols = 0;
p = table->string_buffer_head; p = table->string_buffer_head;
while (p) while (p)
{ {
@@ -93,11 +82,6 @@ rtems_symbol_create(
table->addresses = (rtems_symbol_t *) realloc((void *) table->addresses, newsize * sizeof(rtems_symbol_t)); table->addresses = (rtems_symbol_t *) realloc((void *) table->addresses, newsize * sizeof(rtems_symbol_t));
if (table->addresses == 0) /* blew it; lost orig */ if (table->addresses == 0) /* blew it; lost orig */
goto failed; 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; table->size = newsize;
} }
@@ -129,9 +113,6 @@ rtems_symbol_create(
(void) strcpy(sp->name, name); (void) strcpy(sp->name, name);
table->strings_next += symbol_length; table->strings_next += symbol_length;
table->symbols[table->next] = *sp;
table->sorted = 0; table->sorted = 0;
table->next++; table->next++;
@@ -147,7 +128,7 @@ failed:
* Qsort entry point for compare by address * Qsort entry point for compare by address
*/ */
int static int
rtems_symbol_compare(const void *e1, rtems_symbol_compare(const void *e1,
const void *e2) const void *e2)
{ {
@@ -162,48 +143,20 @@ rtems_symbol_compare(const void *e1,
return 0; 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 * Sort the symbol table using qsort
*/ */
void static void
rtems_symbol_sort(rtems_symbol_table_t *table) 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, qsort((void *) table->addresses, (size_t) table->next,
sizeof(rtems_symbol_t), rtems_symbol_compare); 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; table->sorted = 1;
} }
/* /*
* Search the symbol table by address * Search the symbol table by address
* This code based on CYGNUS newlib bsearch, but changed * This code based on CYGNUS newlib bsearch, but changed
@@ -261,6 +214,53 @@ rtems_symbol_value_lookup(
return best; 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) * Search the symbol table by string name (case independent)
*/ */
@@ -271,35 +271,25 @@ rtems_symbol_name_lookup(
char *name char *name
) )
{ {
rtems_symbol_t *sp = 0; int s;
rtems_symbol_t key; rtems_symbol_t *sp;
if (table == 0) if (table == 0)
{
table = rtems_monitor_symbols; table = rtems_monitor_symbols;
if (table == 0)
return NULL;
}
if ((table == 0) || (name == 0)) for (s = 0, sp = table->addresses; s < table->next; s++, sp++)
goto done; {
if ( strcasecmp(sp->name, name) == 0 )
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 sp;
} }
return NULL;
}
void * void *
rtems_monitor_symbol_next( rtems_monitor_symbol_next(
void *object_info, void *object_info,
@@ -325,7 +315,7 @@ rtems_monitor_symbol_next(
_Thread_Disable_dispatch(); _Thread_Disable_dispatch();
*next_id += 1; *next_id += 1;
return (void *) (table->symbols + n); return (void *) (table->addresses + n);
failed: failed:
*next_id = RTEMS_OBJECT_ID_FINAL; *next_id = RTEMS_OBJECT_ID_FINAL;
@@ -438,7 +428,7 @@ rtems_monitor_symbol_dump_all(
if (table->sorted == 0) if (table->sorted == 0)
rtems_symbol_sort(table); 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; rtems_monitor_symbol_t canonical_symbol;

View File

@@ -1,7 +1,4 @@
/* /*
* @(#)task.c 1.9 - 95/08/01
*
*
* RTEMS Monitor task support * RTEMS Monitor task support
* *
* $Id$ * $Id$

View File

@@ -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 * File: monitor.h
* *
@@ -12,6 +5,8 @@
* The RTEMS monitor task include file. * The RTEMS monitor task include file.
* *
* TODO: * TODO:
*
* $Id$
*/ */
#ifndef __MONITOR_H #ifndef __MONITOR_H
@@ -25,7 +20,7 @@ extern "C" {
#endif #endif
/* /*
* XXX this should be in rtems proper when type becomes part of id * Monitor types are derived from rtems object classes
*/ */
typedef enum { typedef enum {
@@ -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_create(rtems_symbol_table_t *, char *, unsigned32);
rtems_symbol_t *rtems_symbol_value_lookup(rtems_symbol_table_t *, 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 *); 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_next(void *object_info, rtems_monitor_symbol_t *, rtems_id *);
void rtems_monitor_symbol_canonical(rtems_monitor_symbol_t *, rtems_symbol_t *); void rtems_monitor_symbol_canonical(rtems_monitor_symbol_t *, rtems_symbol_t *);

View File

@@ -1,7 +1,4 @@
/* /*
* @(#)symbols.h 1.3 - 95/06/09
*
*
* RTEMS monitor symbol table functions * RTEMS monitor symbol table functions
* *
* Description: * Description:
@@ -47,14 +44,6 @@ typedef struct {
rtems_symbol_t *addresses; /* symbol array by address */ 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 * String pool, unsorted, a list of blocks of string data
*/ */

View File

@@ -20,6 +20,19 @@
#include <rtems.h> #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; extern rtems_configuration_table BSP_Configuration;
#include <assert.h> #include <assert.h>
@@ -49,7 +62,11 @@ rtems_extensions_table Stack_check_Extension_table = {
Stack_check_Switch_extension, /* task_switch */ Stack_check_Switch_extension, /* task_switch */
Stack_check_Begin_extension, /* task_begin */ Stack_check_Begin_extension, /* task_begin */
0, /* task_exitted */ 0, /* task_exitted */
#ifdef DONT_USE_FATAL_EXTENSION
0, /* fatal */
#else
Stack_check_Fatal_extension, /* fatal */ Stack_check_Fatal_extension, /* fatal */
#endif
}; };
/* /*
@@ -167,10 +184,6 @@ void Stack_check_Initialize( void )
Stack_check_Blown_task = 0; 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 * If installed by a task, that task will not get setup properly
* since it missed out on the create hook. This will cause a * 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); 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; stack_check_initialized = 1;
} }
@@ -437,8 +461,10 @@ void Stack_check_Fatal_extension(
unsigned32 status unsigned32 status
) )
{ {
#ifndef DONT_USE_FATAL_EXTENSION
if (status == 0) if (status == 0)
Stack_check_Dump_usage(); Stack_check_Dump_usage();
#endif
} }

View File

@@ -1,7 +1,4 @@
/* /*
* @(#)assoc.c 1.6 - 95/10/25
*
*
* assoc.c * assoc.c
* rtems assoc routines * rtems assoc routines
* *

View File

@@ -1,6 +1,4 @@
/* /*
* @(#)assoc.h 1.4 - 95/10/25
*
* *
* Rtems associativity routines. Mainly used to convert a value from * 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) * one space to another (eg: our errno's to host errno's and v.v)

View File

@@ -1,7 +1,4 @@
/* /*
* @(#)error.c 1.6 - 95/12/12
*
*
* report errors and panics to RTEMS' stderr. * report errors and panics to RTEMS' stderr.
* Currently just used by RTEMS monitor. * Currently just used by RTEMS monitor.
* *

View File

@@ -1,8 +1,4 @@
/* /*
* @(#)error.h 1.3 - 95/10/25
*
*
* Defines and externs for rtems error reporting * Defines and externs for rtems error reporting
* *
* $Id$ * $Id$
@@ -24,7 +20,12 @@
const char *rtems_status_text(rtems_status_code); const char *rtems_status_text(rtems_status_code);
int rtems_error(int error_code, const char *printf_format, ...); 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, ...); void rtems_panic(const char *printf_format, ...);
#endif
extern int rtems_panic_in_progress; extern int rtems_panic_in_progress;

View File

@@ -1,7 +1,4 @@
/* /*
* @(#)command.c 1.5 - 95/08/02
*
*
* Command parsing routines for RTEMS monitor * Command parsing routines for RTEMS monitor
* *
* TODO: * TODO:

View File

@@ -1,7 +1,4 @@
/* /*
* @(#)config.c 1.5 - 95/08/02
*
*
* RTEMS Config display support * RTEMS Config display support
* *
* TODO * TODO

View File

@@ -1,7 +1,4 @@
/* /*
* @(#)dname.c 1.5 - 96/01/03
*
*
* RTEMS monitor driver names support. * RTEMS monitor driver names support.
* *
* There are 2 "driver" things the monitor knows about. * There are 2 "driver" things the monitor knows about.

View File

@@ -1,7 +1,4 @@
/* /*
* @(#)driver.c 1.4 - 95/08/02
*
*
* RTEMS monitor IO (device drivers) support * RTEMS monitor IO (device drivers) support
* *
* There are 2 "driver" things the monitor knows about. * There are 2 "driver" things the monitor knows about.

View File

@@ -1,7 +1,4 @@
/* /*
* @(#)extension.c 1.6 - 95/09/25
*
*
* RTEMS Monitor extension support * RTEMS Monitor extension support
* *
* $Id$ * $Id$

View File

@@ -1,7 +1,4 @@
/* /*
* @(#)itask.c 1.6 - 96/01/03
*
*
* RTEMS Monitor init task support * RTEMS Monitor init task support
* *
* $Id$ * $Id$

View File

@@ -1,7 +1,4 @@
/* /*
* @(#)manager.c 1.4 - 96/01/03
*
*
* RTEMS Monitor "manager" support. * RTEMS Monitor "manager" support.
* Used to traverse object (chain) lists and print them out. * Used to traverse object (chain) lists and print them out.
* *

View File

@@ -1,8 +1,4 @@
/* /*
* @(#)monitor.c 1.23 - 96/01/03
*
*
*
* RTEMS monitor main body * RTEMS monitor main body
* *
* TODO: * TODO:
@@ -18,7 +14,7 @@
* should have a separate monitor FILE stream (ala the debugger) * should have a separate monitor FILE stream (ala the debugger)
* remote request/response stuff should be cleaned up * remote request/response stuff should be cleaned up
* maybe we can use real rpc?? * maybe we can use real rpc??
* 'info' commadn to print out: * 'info' command to print out:
* interrupt stack location, direction and size * interrupt stack location, direction and size
* floating point config stuff * floating point config stuff
* interrupt config stuff * interrupt config stuff
@@ -262,6 +258,18 @@ rtems_monitor_wakeup(void)
status = rtems_event_send(rtems_monitor_task_id, MONITOR_WAKEUP_EVENT); 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 void
rtems_monitor_pause_cmd( rtems_monitor_pause_cmd(
@@ -302,19 +310,6 @@ rtems_monitor_continue_cmd(
rtems_monitor_suspend(RTEMS_NO_TIMEOUT); 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 void
rtems_monitor_node_cmd( rtems_monitor_node_cmd(
int argc, int argc,
@@ -340,7 +335,9 @@ rtems_monitor_node_cmd(
break; break;
} }
if ((new_node >= 1) && (new_node <= _Configuration_MP_table->maximum_nodes)) if ((new_node >= 1) &&
_Configuration_MP_table &&
(new_node <= _Configuration_MP_table->maximum_nodes))
rtems_monitor_default_node = new_node; rtems_monitor_default_node = new_node;
} }
@@ -383,11 +380,7 @@ rtems_monitor_symbols_loadup(void)
if (rtems_monitor_symbols == 0) if (rtems_monitor_symbols == 0)
return; return;
#ifdef SIMHPPA
fp = fdopen(8, "r"); /* don't ask; don't tell */
#else
fp = fopen("symbols", "r"); fp = fopen("symbols", "r");
#endif
if (fp == 0) if (fp == 0)
return; return;

View File

@@ -1,7 +1,4 @@
/* /*
* @(#)mpci.c 1.6 - 95/08/02
*
*
* RTEMS MPCI Config display support * RTEMS MPCI Config display support
* *
* TODO * TODO

View File

@@ -1,7 +1,4 @@
/* /*
* @(#)object.c 1.9 - 96/01/03
*
*
* RTEMS Monitor "object" support. * RTEMS Monitor "object" support.
* *
* Used to traverse object lists and print them out. * Used to traverse object lists and print them out.
@@ -341,7 +338,7 @@ rtems_monitor_object_cmd(
for (arg=1; argv[arg]; arg++) 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); id = rtems_monitor_id_fixup(id, default_node, type);
type = (rtems_monitor_object_type_t) rtems_get_class(id); type = (rtems_monitor_object_type_t) rtems_get_class(id);

View File

@@ -1,7 +1,4 @@
/* /*
* @(#)prmisc.c 1.9 - 95/08/02
*
*
* Print misc stuff for the monitor dump routines * Print misc stuff for the monitor dump routines
* Each routine returns the number of characters it output. * Each routine returns the number of characters it output.
* *

View File

@@ -1,6 +1,4 @@
/* /*
* @(#)queue.c 1.5 - 95/07/31
*
* $Id$ * $Id$
*/ */

View File

@@ -1,7 +1,4 @@
/* /*
* @(#)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) * running on other nodes)
* *

View File

@@ -1,11 +1,3 @@
/*
* @(#)symbols.c 1.10 - 95/08/02
*
* $Id$
*/
/* #define qsort _quicksort */
/* /*
* File: symbols.c * File: symbols.c
* *
@@ -15,6 +7,8 @@
* *
* *
* TODO: * TODO:
*
* $Id$
*/ */
#define __RTEMS_VIOLATE_KERNEL_VISIBILITY__ #define __RTEMS_VIOLATE_KERNEL_VISIBILITY__
@@ -50,11 +44,6 @@ rtems_symbol_table_destroy(rtems_symbol_table_t *table)
if (table->addresses) if (table->addresses)
(void) free(table->addresses); (void) free(table->addresses);
table->addresses = 0; table->addresses = 0;
if (table->symbols)
(void) free(table->symbols);
table->symbols = 0;
p = table->string_buffer_head; p = table->string_buffer_head;
while (p) while (p)
{ {
@@ -93,11 +82,6 @@ rtems_symbol_create(
table->addresses = (rtems_symbol_t *) realloc((void *) table->addresses, newsize * sizeof(rtems_symbol_t)); table->addresses = (rtems_symbol_t *) realloc((void *) table->addresses, newsize * sizeof(rtems_symbol_t));
if (table->addresses == 0) /* blew it; lost orig */ if (table->addresses == 0) /* blew it; lost orig */
goto failed; 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; table->size = newsize;
} }
@@ -129,9 +113,6 @@ rtems_symbol_create(
(void) strcpy(sp->name, name); (void) strcpy(sp->name, name);
table->strings_next += symbol_length; table->strings_next += symbol_length;
table->symbols[table->next] = *sp;
table->sorted = 0; table->sorted = 0;
table->next++; table->next++;
@@ -147,7 +128,7 @@ failed:
* Qsort entry point for compare by address * Qsort entry point for compare by address
*/ */
int static int
rtems_symbol_compare(const void *e1, rtems_symbol_compare(const void *e1,
const void *e2) const void *e2)
{ {
@@ -162,48 +143,20 @@ rtems_symbol_compare(const void *e1,
return 0; 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 * Sort the symbol table using qsort
*/ */
void static void
rtems_symbol_sort(rtems_symbol_table_t *table) 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, qsort((void *) table->addresses, (size_t) table->next,
sizeof(rtems_symbol_t), rtems_symbol_compare); 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; table->sorted = 1;
} }
/* /*
* Search the symbol table by address * Search the symbol table by address
* This code based on CYGNUS newlib bsearch, but changed * This code based on CYGNUS newlib bsearch, but changed
@@ -261,6 +214,53 @@ rtems_symbol_value_lookup(
return best; 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) * Search the symbol table by string name (case independent)
*/ */
@@ -271,35 +271,25 @@ rtems_symbol_name_lookup(
char *name char *name
) )
{ {
rtems_symbol_t *sp = 0; int s;
rtems_symbol_t key; rtems_symbol_t *sp;
if (table == 0) if (table == 0)
{
table = rtems_monitor_symbols; table = rtems_monitor_symbols;
if (table == 0)
return NULL;
}
if ((table == 0) || (name == 0)) for (s = 0, sp = table->addresses; s < table->next; s++, sp++)
goto done; {
if ( strcasecmp(sp->name, name) == 0 )
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 sp;
} }
return NULL;
}
void * void *
rtems_monitor_symbol_next( rtems_monitor_symbol_next(
void *object_info, void *object_info,
@@ -325,7 +315,7 @@ rtems_monitor_symbol_next(
_Thread_Disable_dispatch(); _Thread_Disable_dispatch();
*next_id += 1; *next_id += 1;
return (void *) (table->symbols + n); return (void *) (table->addresses + n);
failed: failed:
*next_id = RTEMS_OBJECT_ID_FINAL; *next_id = RTEMS_OBJECT_ID_FINAL;
@@ -438,7 +428,7 @@ rtems_monitor_symbol_dump_all(
if (table->sorted == 0) if (table->sorted == 0)
rtems_symbol_sort(table); 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; rtems_monitor_symbol_t canonical_symbol;

View File

@@ -1,7 +1,4 @@
/* /*
* @(#)task.c 1.9 - 95/08/01
*
*
* RTEMS Monitor task support * RTEMS Monitor task support
* *
* $Id$ * $Id$

View File

@@ -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 * File: monitor.h
* *
@@ -12,6 +5,8 @@
* The RTEMS monitor task include file. * The RTEMS monitor task include file.
* *
* TODO: * TODO:
*
* $Id$
*/ */
#ifndef __MONITOR_H #ifndef __MONITOR_H
@@ -25,7 +20,7 @@ extern "C" {
#endif #endif
/* /*
* XXX this should be in rtems proper when type becomes part of id * Monitor types are derived from rtems object classes
*/ */
typedef enum { typedef enum {
@@ -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_create(rtems_symbol_table_t *, char *, unsigned32);
rtems_symbol_t *rtems_symbol_value_lookup(rtems_symbol_table_t *, 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 *); 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_next(void *object_info, rtems_monitor_symbol_t *, rtems_id *);
void rtems_monitor_symbol_canonical(rtems_monitor_symbol_t *, rtems_symbol_t *); void rtems_monitor_symbol_canonical(rtems_monitor_symbol_t *, rtems_symbol_t *);

View File

@@ -1,7 +1,4 @@
/* /*
* @(#)symbols.h 1.3 - 95/06/09
*
*
* RTEMS monitor symbol table functions * RTEMS monitor symbol table functions
* *
* Description: * Description:
@@ -47,14 +44,6 @@ typedef struct {
rtems_symbol_t *addresses; /* symbol array by address */ 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 * String pool, unsorted, a list of blocks of string data
*/ */

View File

@@ -20,6 +20,19 @@
#include <rtems.h> #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; extern rtems_configuration_table BSP_Configuration;
#include <assert.h> #include <assert.h>
@@ -49,7 +62,11 @@ rtems_extensions_table Stack_check_Extension_table = {
Stack_check_Switch_extension, /* task_switch */ Stack_check_Switch_extension, /* task_switch */
Stack_check_Begin_extension, /* task_begin */ Stack_check_Begin_extension, /* task_begin */
0, /* task_exitted */ 0, /* task_exitted */
#ifdef DONT_USE_FATAL_EXTENSION
0, /* fatal */
#else
Stack_check_Fatal_extension, /* fatal */ Stack_check_Fatal_extension, /* fatal */
#endif
}; };
/* /*
@@ -167,10 +184,6 @@ void Stack_check_Initialize( void )
Stack_check_Blown_task = 0; 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 * If installed by a task, that task will not get setup properly
* since it missed out on the create hook. This will cause a * 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); 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; stack_check_initialized = 1;
} }
@@ -437,8 +461,10 @@ void Stack_check_Fatal_extension(
unsigned32 status unsigned32 status
) )
{ {
#ifndef DONT_USE_FATAL_EXTENSION
if (status == 0) if (status == 0)
Stack_check_Dump_usage(); Stack_check_Dump_usage();
#endif
} }

View File

@@ -57,7 +57,8 @@ rtems_unsigned32 First_Time_Through;
void Process_case(); void Process_case();
rtems_extension Fatal_extension( rtems_extension Fatal_extension(
rtems_unsigned32 error rtems_unsigned32 error,
boolean is_internal
) )
{ {
int index; int index;

View File

@@ -28,7 +28,8 @@ void put_error(
); );
rtems_extension Fatal_extension( rtems_extension Fatal_extension(
rtems_unsigned32 error rtems_unsigned32 error,
boolean is_internal
); );
rtems_task Task_1( rtems_task Task_1(

View File

@@ -70,7 +70,7 @@ rtems_task Task_1(
status = rtems_message_queue_create( status = rtems_message_queue_create(
index, index,
1, OPERATION_COUNT,
16, 16,
RTEMS_DEFAULT_ATTRIBUTES, RTEMS_DEFAULT_ATTRIBUTES,
&id &id

View File

@@ -1,6 +1,7 @@
#!KSHELL -p #!KSHELL -p
# #
# Check test results against official output in the src tree # Check test results against official output in the src tree
#
# $Id$ # $Id$
# #
@@ -64,8 +65,7 @@ args=$*
# Run the tests # Run the tests
# #
cd $RTEMS_HOME/tests/$logdir || cd $RTEMS_HOME/tests/$logdir || fatal "No log directory: $RTEMS_HOME/tests/$logdir"
fatal "No log directory: $RTEMS_HOME/tests/$logdir"
tests="$args" tests="$args"
if [ ! "$tests" ] if [ ! "$tests" ]

View File

@@ -1,6 +1,4 @@
/* /*
* @(#)assoc.h 1.4 - 95/10/25
*
* *
* Rtems associativity routines. Mainly used to convert a value from * 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) * one space to another (eg: our errno's to host errno's and v.v)

View File

@@ -1,8 +1,4 @@
/* /*
* @(#)error.h 1.3 - 95/10/25
*
*
* Defines and externs for rtems error reporting * Defines and externs for rtems error reporting
* *
* $Id$ * $Id$
@@ -24,7 +20,12 @@
const char *rtems_status_text(rtems_status_code); const char *rtems_status_text(rtems_status_code);
int rtems_error(int error_code, const char *printf_format, ...); 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, ...); void rtems_panic(const char *printf_format, ...);
#endif
extern int rtems_panic_in_progress; extern int rtems_panic_in_progress;

View File

@@ -1,7 +1,4 @@
/* /*
* @(#)assoc.c 1.6 - 95/10/25
*
*
* assoc.c * assoc.c
* rtems assoc routines * rtems assoc routines
* *

View File

@@ -1,7 +1,4 @@
/* /*
* @(#)error.c 1.6 - 95/12/12
*
*
* report errors and panics to RTEMS' stderr. * report errors and panics to RTEMS' stderr.
* Currently just used by RTEMS monitor. * Currently just used by RTEMS monitor.
* *

View File

@@ -1,7 +1,4 @@
/* /*
* @(#)command.c 1.5 - 95/08/02
*
*
* Command parsing routines for RTEMS monitor * Command parsing routines for RTEMS monitor
* *
* TODO: * TODO:

View File

@@ -1,7 +1,4 @@
/* /*
* @(#)config.c 1.5 - 95/08/02
*
*
* RTEMS Config display support * RTEMS Config display support
* *
* TODO * TODO

View File

@@ -1,7 +1,4 @@
/* /*
* @(#)dname.c 1.5 - 96/01/03
*
*
* RTEMS monitor driver names support. * RTEMS monitor driver names support.
* *
* There are 2 "driver" things the monitor knows about. * There are 2 "driver" things the monitor knows about.

View File

@@ -1,7 +1,4 @@
/* /*
* @(#)driver.c 1.4 - 95/08/02
*
*
* RTEMS monitor IO (device drivers) support * RTEMS monitor IO (device drivers) support
* *
* There are 2 "driver" things the monitor knows about. * There are 2 "driver" things the monitor knows about.

View File

@@ -1,7 +1,4 @@
/* /*
* @(#)extension.c 1.6 - 95/09/25
*
*
* RTEMS Monitor extension support * RTEMS Monitor extension support
* *
* $Id$ * $Id$

View File

@@ -1,7 +1,4 @@
/* /*
* @(#)itask.c 1.6 - 96/01/03
*
*
* RTEMS Monitor init task support * RTEMS Monitor init task support
* *
* $Id$ * $Id$

View File

@@ -1,7 +1,4 @@
/* /*
* @(#)manager.c 1.4 - 96/01/03
*
*
* RTEMS Monitor "manager" support. * RTEMS Monitor "manager" support.
* Used to traverse object (chain) lists and print them out. * Used to traverse object (chain) lists and print them out.
* *

View File

@@ -1,8 +1,4 @@
/* /*
* @(#)monitor.c 1.23 - 96/01/03
*
*
*
* RTEMS monitor main body * RTEMS monitor main body
* *
* TODO: * TODO:
@@ -18,7 +14,7 @@
* should have a separate monitor FILE stream (ala the debugger) * should have a separate monitor FILE stream (ala the debugger)
* remote request/response stuff should be cleaned up * remote request/response stuff should be cleaned up
* maybe we can use real rpc?? * maybe we can use real rpc??
* 'info' commadn to print out: * 'info' command to print out:
* interrupt stack location, direction and size * interrupt stack location, direction and size
* floating point config stuff * floating point config stuff
* interrupt config stuff * interrupt config stuff
@@ -262,6 +258,18 @@ rtems_monitor_wakeup(void)
status = rtems_event_send(rtems_monitor_task_id, MONITOR_WAKEUP_EVENT); 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 void
rtems_monitor_pause_cmd( rtems_monitor_pause_cmd(
@@ -302,19 +310,6 @@ rtems_monitor_continue_cmd(
rtems_monitor_suspend(RTEMS_NO_TIMEOUT); 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 void
rtems_monitor_node_cmd( rtems_monitor_node_cmd(
int argc, int argc,
@@ -340,7 +335,9 @@ rtems_monitor_node_cmd(
break; break;
} }
if ((new_node >= 1) && (new_node <= _Configuration_MP_table->maximum_nodes)) if ((new_node >= 1) &&
_Configuration_MP_table &&
(new_node <= _Configuration_MP_table->maximum_nodes))
rtems_monitor_default_node = new_node; rtems_monitor_default_node = new_node;
} }
@@ -383,11 +380,7 @@ rtems_monitor_symbols_loadup(void)
if (rtems_monitor_symbols == 0) if (rtems_monitor_symbols == 0)
return; return;
#ifdef SIMHPPA
fp = fdopen(8, "r"); /* don't ask; don't tell */
#else
fp = fopen("symbols", "r"); fp = fopen("symbols", "r");
#endif
if (fp == 0) if (fp == 0)
return; return;

View File

@@ -1,7 +1,4 @@
/* /*
* @(#)mpci.c 1.6 - 95/08/02
*
*
* RTEMS MPCI Config display support * RTEMS MPCI Config display support
* *
* TODO * TODO

View File

@@ -1,7 +1,4 @@
/* /*
* @(#)object.c 1.9 - 96/01/03
*
*
* RTEMS Monitor "object" support. * RTEMS Monitor "object" support.
* *
* Used to traverse object lists and print them out. * Used to traverse object lists and print them out.
@@ -341,7 +338,7 @@ rtems_monitor_object_cmd(
for (arg=1; argv[arg]; arg++) 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); id = rtems_monitor_id_fixup(id, default_node, type);
type = (rtems_monitor_object_type_t) rtems_get_class(id); type = (rtems_monitor_object_type_t) rtems_get_class(id);

View File

@@ -1,7 +1,4 @@
/* /*
* @(#)prmisc.c 1.9 - 95/08/02
*
*
* Print misc stuff for the monitor dump routines * Print misc stuff for the monitor dump routines
* Each routine returns the number of characters it output. * Each routine returns the number of characters it output.
* *

View File

@@ -1,6 +1,4 @@
/* /*
* @(#)queue.c 1.5 - 95/07/31
*
* $Id$ * $Id$
*/ */

View File

@@ -1,7 +1,4 @@
/* /*
* @(#)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) * running on other nodes)
* *

View File

@@ -1,11 +1,3 @@
/*
* @(#)symbols.c 1.10 - 95/08/02
*
* $Id$
*/
/* #define qsort _quicksort */
/* /*
* File: symbols.c * File: symbols.c
* *
@@ -15,6 +7,8 @@
* *
* *
* TODO: * TODO:
*
* $Id$
*/ */
#define __RTEMS_VIOLATE_KERNEL_VISIBILITY__ #define __RTEMS_VIOLATE_KERNEL_VISIBILITY__
@@ -50,11 +44,6 @@ rtems_symbol_table_destroy(rtems_symbol_table_t *table)
if (table->addresses) if (table->addresses)
(void) free(table->addresses); (void) free(table->addresses);
table->addresses = 0; table->addresses = 0;
if (table->symbols)
(void) free(table->symbols);
table->symbols = 0;
p = table->string_buffer_head; p = table->string_buffer_head;
while (p) while (p)
{ {
@@ -93,11 +82,6 @@ rtems_symbol_create(
table->addresses = (rtems_symbol_t *) realloc((void *) table->addresses, newsize * sizeof(rtems_symbol_t)); table->addresses = (rtems_symbol_t *) realloc((void *) table->addresses, newsize * sizeof(rtems_symbol_t));
if (table->addresses == 0) /* blew it; lost orig */ if (table->addresses == 0) /* blew it; lost orig */
goto failed; 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; table->size = newsize;
} }
@@ -129,9 +113,6 @@ rtems_symbol_create(
(void) strcpy(sp->name, name); (void) strcpy(sp->name, name);
table->strings_next += symbol_length; table->strings_next += symbol_length;
table->symbols[table->next] = *sp;
table->sorted = 0; table->sorted = 0;
table->next++; table->next++;
@@ -147,7 +128,7 @@ failed:
* Qsort entry point for compare by address * Qsort entry point for compare by address
*/ */
int static int
rtems_symbol_compare(const void *e1, rtems_symbol_compare(const void *e1,
const void *e2) const void *e2)
{ {
@@ -162,48 +143,20 @@ rtems_symbol_compare(const void *e1,
return 0; 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 * Sort the symbol table using qsort
*/ */
void static void
rtems_symbol_sort(rtems_symbol_table_t *table) 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, qsort((void *) table->addresses, (size_t) table->next,
sizeof(rtems_symbol_t), rtems_symbol_compare); 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; table->sorted = 1;
} }
/* /*
* Search the symbol table by address * Search the symbol table by address
* This code based on CYGNUS newlib bsearch, but changed * This code based on CYGNUS newlib bsearch, but changed
@@ -261,6 +214,53 @@ rtems_symbol_value_lookup(
return best; 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) * Search the symbol table by string name (case independent)
*/ */
@@ -271,35 +271,25 @@ rtems_symbol_name_lookup(
char *name char *name
) )
{ {
rtems_symbol_t *sp = 0; int s;
rtems_symbol_t key; rtems_symbol_t *sp;
if (table == 0) if (table == 0)
{
table = rtems_monitor_symbols; table = rtems_monitor_symbols;
if (table == 0)
return NULL;
}
if ((table == 0) || (name == 0)) for (s = 0, sp = table->addresses; s < table->next; s++, sp++)
goto done; {
if ( strcasecmp(sp->name, name) == 0 )
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 sp;
} }
return NULL;
}
void * void *
rtems_monitor_symbol_next( rtems_monitor_symbol_next(
void *object_info, void *object_info,
@@ -325,7 +315,7 @@ rtems_monitor_symbol_next(
_Thread_Disable_dispatch(); _Thread_Disable_dispatch();
*next_id += 1; *next_id += 1;
return (void *) (table->symbols + n); return (void *) (table->addresses + n);
failed: failed:
*next_id = RTEMS_OBJECT_ID_FINAL; *next_id = RTEMS_OBJECT_ID_FINAL;
@@ -438,7 +428,7 @@ rtems_monitor_symbol_dump_all(
if (table->sorted == 0) if (table->sorted == 0)
rtems_symbol_sort(table); 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; rtems_monitor_symbol_t canonical_symbol;

View File

@@ -1,7 +1,4 @@
/* /*
* @(#)task.c 1.9 - 95/08/01
*
*
* RTEMS Monitor task support * RTEMS Monitor task support
* *
* $Id$ * $Id$

View File

@@ -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 * File: monitor.h
* *
@@ -12,6 +5,8 @@
* The RTEMS monitor task include file. * The RTEMS monitor task include file.
* *
* TODO: * TODO:
*
* $Id$
*/ */
#ifndef __MONITOR_H #ifndef __MONITOR_H
@@ -25,7 +20,7 @@ extern "C" {
#endif #endif
/* /*
* XXX this should be in rtems proper when type becomes part of id * Monitor types are derived from rtems object classes
*/ */
typedef enum { typedef enum {
@@ -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_create(rtems_symbol_table_t *, char *, unsigned32);
rtems_symbol_t *rtems_symbol_value_lookup(rtems_symbol_table_t *, 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 *); 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_next(void *object_info, rtems_monitor_symbol_t *, rtems_id *);
void rtems_monitor_symbol_canonical(rtems_monitor_symbol_t *, rtems_symbol_t *); void rtems_monitor_symbol_canonical(rtems_monitor_symbol_t *, rtems_symbol_t *);

View File

@@ -1,7 +1,4 @@
/* /*
* @(#)symbols.h 1.3 - 95/06/09
*
*
* RTEMS monitor symbol table functions * RTEMS monitor symbol table functions
* *
* Description: * Description:
@@ -47,14 +44,6 @@ typedef struct {
rtems_symbol_t *addresses; /* symbol array by address */ 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 * String pool, unsorted, a list of blocks of string data
*/ */

View File

@@ -20,6 +20,19 @@
#include <rtems.h> #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; extern rtems_configuration_table BSP_Configuration;
#include <assert.h> #include <assert.h>
@@ -49,7 +62,11 @@ rtems_extensions_table Stack_check_Extension_table = {
Stack_check_Switch_extension, /* task_switch */ Stack_check_Switch_extension, /* task_switch */
Stack_check_Begin_extension, /* task_begin */ Stack_check_Begin_extension, /* task_begin */
0, /* task_exitted */ 0, /* task_exitted */
#ifdef DONT_USE_FATAL_EXTENSION
0, /* fatal */
#else
Stack_check_Fatal_extension, /* fatal */ Stack_check_Fatal_extension, /* fatal */
#endif
}; };
/* /*
@@ -167,10 +184,6 @@ void Stack_check_Initialize( void )
Stack_check_Blown_task = 0; 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 * If installed by a task, that task will not get setup properly
* since it missed out on the create hook. This will cause a * 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); 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; stack_check_initialized = 1;
} }
@@ -437,8 +461,10 @@ void Stack_check_Fatal_extension(
unsigned32 status unsigned32 status
) )
{ {
#ifndef DONT_USE_FATAL_EXTENSION
if (status == 0) if (status == 0)
Stack_check_Dump_usage(); Stack_check_Dump_usage();
#endif
} }

View File

@@ -57,7 +57,8 @@ rtems_unsigned32 First_Time_Through;
void Process_case(); void Process_case();
rtems_extension Fatal_extension( rtems_extension Fatal_extension(
rtems_unsigned32 error rtems_unsigned32 error,
boolean is_internal
) )
{ {
int index; int index;

View File

@@ -28,7 +28,8 @@ void put_error(
); );
rtems_extension Fatal_extension( rtems_extension Fatal_extension(
rtems_unsigned32 error rtems_unsigned32 error,
boolean is_internal
); );
rtems_task Task_1( rtems_task Task_1(

View File

@@ -70,7 +70,7 @@ rtems_task Task_1(
status = rtems_message_queue_create( status = rtems_message_queue_create(
index, index,
1, OPERATION_COUNT,
16, 16,
RTEMS_DEFAULT_ATTRIBUTES, RTEMS_DEFAULT_ATTRIBUTES,
&id &id

View File

@@ -1,7 +1,4 @@
/* /*
* @(#)genoffsets.c 1.7 - 95/09/25
*
*
* genoffsets.c * genoffsets.c
* *
* This file generates the offsets.h for the HP PA-RISC port of RTEMS. * This file generates the offsets.h for the HP PA-RISC port of RTEMS.
@@ -17,7 +14,6 @@
* notice must appear in all copies of this file and its derivatives. * notice must appear in all copies of this file and its derivatives.
* *
* $Id$ * $Id$
*
*/ */
#include <stdio.h> #include <stdio.h>
@@ -70,7 +66,7 @@ printf(
(int) &((TYPE)0)->FIELD ); (int) &((TYPE)0)->FIELD );
#define PRINT_SIZE( STRING, item ) \ #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, \ STRING, \
sizeof(item), \ sizeof(item), \
sizeof(item) ); sizeof(item) );
@@ -145,6 +141,39 @@ printf(
PRINT_COMMENT("Context_Control_fp information"); 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); PRINT_SIZE("CPU_CONTEXT_FP_SIZE", Context_Control_fp);
/* /*