summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>1996-04-22 16:53:46 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>1996-04-22 16:53:46 +0000
commit8389628c1be0f40fb94c1d2859138a09616acf06 (patch)
tree0d58d8f544ace76749af5bfb6b0adac7f5cc191e
parent5a36154a60ce528d331602469ffea4ca4b9a0ea1 (diff)
downloadrtems-8389628c1be0f40fb94c1d2859138a09616acf06.tar.bz2
updates from Tony Bennett
-rw-r--r--c/src/exec/libcsupport/include/rtems/assoc.h2
-rw-r--r--c/src/exec/libcsupport/include/rtems/error.h9
-rw-r--r--c/src/exec/libcsupport/src/assoc.c3
-rw-r--r--c/src/exec/libcsupport/src/error.c3
-rw-r--r--c/src/exec/score/tools/hppa1.1/genoffsets.c41
-rw-r--r--c/src/lib/include/rtems/assoc.h2
-rw-r--r--c/src/lib/include/rtems/error.h9
-rw-r--r--c/src/lib/libbsp/hppa1.1/simhppa/include/bsp.h23
-rw-r--r--c/src/lib/libbsp/hppa1.1/simhppa/include/ttydrv.h2
-rw-r--r--c/src/lib/libbsp/hppa1.1/simhppa/startup/bspstart.c11
-rw-r--r--c/src/lib/libc/assoc.c3
-rw-r--r--c/src/lib/libc/assoc.h2
-rw-r--r--c/src/lib/libc/error.c3
-rw-r--r--c/src/lib/libc/error.h9
-rw-r--r--c/src/lib/libmisc/assoc/assoc.c3
-rw-r--r--c/src/lib/libmisc/assoc/assoc.h2
-rw-r--r--c/src/lib/libmisc/error/error.c3
-rw-r--r--c/src/lib/libmisc/error/error.h9
-rw-r--r--c/src/lib/libmisc/monitor/mon-command.c3
-rw-r--r--c/src/lib/libmisc/monitor/mon-config.c3
-rw-r--r--c/src/lib/libmisc/monitor/mon-dname.c3
-rw-r--r--c/src/lib/libmisc/monitor/mon-driver.c3
-rw-r--r--c/src/lib/libmisc/monitor/mon-extension.c3
-rw-r--r--c/src/lib/libmisc/monitor/mon-itask.c5
-rw-r--r--c/src/lib/libmisc/monitor/mon-manager.c7
-rw-r--r--c/src/lib/libmisc/monitor/mon-monitor.c41
-rw-r--r--c/src/lib/libmisc/monitor/mon-mpci.c3
-rw-r--r--c/src/lib/libmisc/monitor/mon-object.c5
-rw-r--r--c/src/lib/libmisc/monitor/mon-prmisc.c3
-rw-r--r--c/src/lib/libmisc/monitor/mon-queue.c2
-rw-r--r--c/src/lib/libmisc/monitor/mon-server.c5
-rw-r--r--c/src/lib/libmisc/monitor/mon-symbols.c144
-rw-r--r--c/src/lib/libmisc/monitor/mon-task.c3
-rw-r--r--c/src/lib/libmisc/monitor/monitor.h14
-rw-r--r--c/src/lib/libmisc/monitor/symbols.h11
-rw-r--r--c/src/lib/libmisc/stackchk/check.c36
-rw-r--r--c/src/libmisc/assoc/assoc.c3
-rw-r--r--c/src/libmisc/assoc/assoc.h2
-rw-r--r--c/src/libmisc/error/error.c3
-rw-r--r--c/src/libmisc/error/error.h9
-rw-r--r--c/src/libmisc/monitor/mon-command.c3
-rw-r--r--c/src/libmisc/monitor/mon-config.c3
-rw-r--r--c/src/libmisc/monitor/mon-dname.c3
-rw-r--r--c/src/libmisc/monitor/mon-driver.c3
-rw-r--r--c/src/libmisc/monitor/mon-extension.c3
-rw-r--r--c/src/libmisc/monitor/mon-itask.c5
-rw-r--r--c/src/libmisc/monitor/mon-manager.c7
-rw-r--r--c/src/libmisc/monitor/mon-monitor.c41
-rw-r--r--c/src/libmisc/monitor/mon-mpci.c3
-rw-r--r--c/src/libmisc/monitor/mon-object.c5
-rw-r--r--c/src/libmisc/monitor/mon-prmisc.c3
-rw-r--r--c/src/libmisc/monitor/mon-queue.c2
-rw-r--r--c/src/libmisc/monitor/mon-server.c5
-rw-r--r--c/src/libmisc/monitor/mon-symbols.c144
-rw-r--r--c/src/libmisc/monitor/mon-task.c3
-rw-r--r--c/src/libmisc/monitor/monitor.h14
-rw-r--r--c/src/libmisc/monitor/symbols.h11
-rw-r--r--c/src/libmisc/stackchk/check.c36
-rw-r--r--c/src/tests/sptests/spfatal/fatal.c3
-rw-r--r--c/src/tests/sptests/spfatal/system.h3
-rw-r--r--c/src/tests/tmtests/tm21/task1.c2
-rw-r--r--c/src/tests/tools/generic/difftest4
-rw-r--r--cpukit/libcsupport/include/rtems/assoc.h2
-rw-r--r--cpukit/libcsupport/include/rtems/error.h9
-rw-r--r--cpukit/libcsupport/src/assoc.c3
-rw-r--r--cpukit/libcsupport/src/error.c3
-rw-r--r--cpukit/libmisc/monitor/mon-command.c3
-rw-r--r--cpukit/libmisc/monitor/mon-config.c3
-rw-r--r--cpukit/libmisc/monitor/mon-dname.c3
-rw-r--r--cpukit/libmisc/monitor/mon-driver.c3
-rw-r--r--cpukit/libmisc/monitor/mon-extension.c3
-rw-r--r--cpukit/libmisc/monitor/mon-itask.c5
-rw-r--r--cpukit/libmisc/monitor/mon-manager.c7
-rw-r--r--cpukit/libmisc/monitor/mon-monitor.c41
-rw-r--r--cpukit/libmisc/monitor/mon-mpci.c3
-rw-r--r--cpukit/libmisc/monitor/mon-object.c5
-rw-r--r--cpukit/libmisc/monitor/mon-prmisc.c3
-rw-r--r--cpukit/libmisc/monitor/mon-queue.c2
-rw-r--r--cpukit/libmisc/monitor/mon-server.c5
-rw-r--r--cpukit/libmisc/monitor/mon-symbols.c144
-rw-r--r--cpukit/libmisc/monitor/mon-task.c3
-rw-r--r--cpukit/libmisc/monitor/monitor.h14
-rw-r--r--cpukit/libmisc/monitor/symbols.h11
-rw-r--r--cpukit/libmisc/stackchk/check.c36
-rw-r--r--testsuites/sptests/spfatal/fatal.c3
-rw-r--r--testsuites/sptests/spfatal/system.h3
-rw-r--r--testsuites/tmtests/tm21/task1.c2
-rw-r--r--tools/cpu/hppa1.1/genoffsets.c41
88 files changed, 494 insertions, 622 deletions
diff --git a/c/src/exec/libcsupport/include/rtems/assoc.h b/c/src/exec/libcsupport/include/rtems/assoc.h
index f9a444374c..1982d654ac 100644
--- a/c/src/exec/libcsupport/include/rtems/assoc.h
+++ b/c/src/exec/libcsupport/include/rtems/assoc.h
@@ -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)
diff --git a/c/src/exec/libcsupport/include/rtems/error.h b/c/src/exec/libcsupport/include/rtems/error.h
index 621ee16f65..e4d8c77200 100644
--- a/c/src/exec/libcsupport/include/rtems/error.h
+++ b/c/src/exec/libcsupport/include/rtems/error.h
@@ -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;
diff --git a/c/src/exec/libcsupport/src/assoc.c b/c/src/exec/libcsupport/src/assoc.c
index a3eabdb3b5..74387a8c5b 100644
--- a/c/src/exec/libcsupport/src/assoc.c
+++ b/c/src/exec/libcsupport/src/assoc.c
@@ -1,7 +1,4 @@
/*
- * @(#)assoc.c 1.6 - 95/10/25
- *
- *
* assoc.c
* rtems assoc routines
*
diff --git a/c/src/exec/libcsupport/src/error.c b/c/src/exec/libcsupport/src/error.c
index 715635072a..5bd481c3e6 100644
--- a/c/src/exec/libcsupport/src/error.c
+++ b/c/src/exec/libcsupport/src/error.c
@@ -1,7 +1,4 @@
/*
- * @(#)error.c 1.6 - 95/12/12
- *
- *
* report errors and panics to RTEMS' stderr.
* Currently just used by RTEMS monitor.
*
diff --git a/c/src/exec/score/tools/hppa1.1/genoffsets.c b/c/src/exec/score/tools/hppa1.1/genoffsets.c
index 578259e83d..39f900b48a 100644
--- a/c/src/exec/score/tools/hppa1.1/genoffsets.c
+++ b/c/src/exec/score/tools/hppa1.1/genoffsets.c
@@ -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);
/*
diff --git a/c/src/lib/include/rtems/assoc.h b/c/src/lib/include/rtems/assoc.h
index f9a444374c..1982d654ac 100644
--- a/c/src/lib/include/rtems/assoc.h
+++ b/c/src/lib/include/rtems/assoc.h
@@ -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)
diff --git a/c/src/lib/include/rtems/error.h b/c/src/lib/include/rtems/error.h
index 621ee16f65..e4d8c77200 100644
--- a/c/src/lib/include/rtems/error.h
+++ b/c/src/lib/include/rtems/error.h
@@ -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;
diff --git a/c/src/lib/libbsp/hppa1.1/simhppa/include/bsp.h b/c/src/lib/libbsp/hppa1.1/simhppa/include/bsp.h
index ead24536f5..2dfc2cc8df 100644
--- a/c/src/lib/libbsp/hppa1.1/simhppa/include/bsp.h
+++ b/c/src/lib/libbsp/hppa1.1/simhppa/include/bsp.h
@@ -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 );
diff --git a/c/src/lib/libbsp/hppa1.1/simhppa/include/ttydrv.h b/c/src/lib/libbsp/hppa1.1/simhppa/include/ttydrv.h
index 5b4e075578..b20878d99c 100644
--- a/c/src/lib/libbsp/hppa1.1/simhppa/include/ttydrv.h
+++ b/c/src/lib/libbsp/hppa1.1/simhppa/include/ttydrv.h
@@ -1,6 +1,4 @@
/*
- * @(#)ttydrv.h 1.1 - 95/06/02
- *
* $Id$
*/
diff --git a/c/src/lib/libbsp/hppa1.1/simhppa/startup/bspstart.c b/c/src/lib/libbsp/hppa1.1/simhppa/startup/bspstart.c
index a063d5f32b..d702f3f315 100644
--- a/c/src/lib/libbsp/hppa1.1/simhppa/startup/bspstart.c
+++ b/c/src/lib/libbsp/hppa1.1/simhppa/startup/bspstart.c
@@ -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
diff --git a/c/src/lib/libc/assoc.c b/c/src/lib/libc/assoc.c
index a3eabdb3b5..74387a8c5b 100644
--- a/c/src/lib/libc/assoc.c
+++ b/c/src/lib/libc/assoc.c
@@ -1,7 +1,4 @@
/*
- * @(#)assoc.c 1.6 - 95/10/25
- *
- *
* assoc.c
* rtems assoc routines
*
diff --git a/c/src/lib/libc/assoc.h b/c/src/lib/libc/assoc.h
index f9a444374c..1982d654ac 100644
--- a/c/src/lib/libc/assoc.h
+++ b/c/src/lib/libc/assoc.h
@@ -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)
diff --git a/c/src/lib/libc/error.c b/c/src/lib/libc/error.c
index 715635072a..5bd481c3e6 100644
--- a/c/src/lib/libc/error.c
+++ b/c/src/lib/libc/error.c
@@ -1,7 +1,4 @@
/*
- * @(#)error.c 1.6 - 95/12/12
- *
- *
* report errors and panics to RTEMS' stderr.
* Currently just used by RTEMS monitor.
*
diff --git a/c/src/lib/libc/error.h b/c/src/lib/libc/error.h
index 621ee16f65..e4d8c77200 100644
--- a/c/src/lib/libc/error.h
+++ b/c/src/lib/libc/error.h
@@ -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;
diff --git a/c/src/lib/libmisc/assoc/assoc.c b/c/src/lib/libmisc/assoc/assoc.c
index a3eabdb3b5..74387a8c5b 100644
--- a/c/src/lib/libmisc/assoc/assoc.c
+++ b/c/src/lib/libmisc/assoc/assoc.c
@@ -1,7 +1,4 @@
/*
- * @(#)assoc.c 1.6 - 95/10/25
- *
- *
* assoc.c
* rtems assoc routines
*
diff --git a/c/src/lib/libmisc/assoc/assoc.h b/c/src/lib/libmisc/assoc/assoc.h
index f9a444374c..1982d654ac 100644
--- a/c/src/lib/libmisc/assoc/assoc.h
+++ b/c/src/lib/libmisc/assoc/assoc.h
@@ -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)
diff --git a/c/src/lib/libmisc/error/error.c b/c/src/lib/libmisc/error/error.c
index 715635072a..5bd481c3e6 100644
--- a/c/src/lib/libmisc/error/error.c
+++ b/c/src/lib/libmisc/error/error.c
@@ -1,7 +1,4 @@
/*
- * @(#)error.c 1.6 - 95/12/12
- *
- *
* report errors and panics to RTEMS' stderr.
* Currently just used by RTEMS monitor.
*
diff --git a/c/src/lib/libmisc/error/error.h b/c/src/lib/libmisc/error/error.h
index 621ee16f65..e4d8c77200 100644
--- a/c/src/lib/libmisc/error/error.h
+++ b/c/src/lib/libmisc/error/error.h
@@ -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;
diff --git a/c/src/lib/libmisc/monitor/mon-command.c b/c/src/lib/libmisc/monitor/mon-command.c
index d231b3197a..87d31dfa2a 100644
--- a/c/src/lib/libmisc/monitor/mon-command.c
+++ b/c/src/lib/libmisc/monitor/mon-command.c
@@ -1,7 +1,4 @@
/*
- * @(#)command.c 1.5 - 95/08/02
- *
- *
* Command parsing routines for RTEMS monitor
*
* TODO:
diff --git a/c/src/lib/libmisc/monitor/mon-config.c b/c/src/lib/libmisc/monitor/mon-config.c
index 13d41cae1a..f5c9f6f093 100644
--- a/c/src/lib/libmisc/monitor/mon-config.c
+++ b/c/src/lib/libmisc/monitor/mon-config.c
@@ -1,7 +1,4 @@
/*
- * @(#)config.c 1.5 - 95/08/02
- *
- *
* RTEMS Config display support
*
* TODO
diff --git a/c/src/lib/libmisc/monitor/mon-dname.c b/c/src/lib/libmisc/monitor/mon-dname.c
index ad029f2400..e6993e18f7 100644
--- a/c/src/lib/libmisc/monitor/mon-dname.c
+++ b/c/src/lib/libmisc/monitor/mon-dname.c
@@ -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.
diff --git a/c/src/lib/libmisc/monitor/mon-driver.c b/c/src/lib/libmisc/monitor/mon-driver.c
index c12ac778ec..d5cff24a19 100644
--- a/c/src/lib/libmisc/monitor/mon-driver.c
+++ b/c/src/lib/libmisc/monitor/mon-driver.c
@@ -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.
diff --git a/c/src/lib/libmisc/monitor/mon-extension.c b/c/src/lib/libmisc/monitor/mon-extension.c
index 481a21e7dd..4afecaa617 100644
--- a/c/src/lib/libmisc/monitor/mon-extension.c
+++ b/c/src/lib/libmisc/monitor/mon-extension.c
@@ -1,7 +1,4 @@
/*
- * @(#)extension.c 1.6 - 95/09/25
- *
- *
* RTEMS Monitor extension support
*
* $Id$
diff --git a/c/src/lib/libmisc/monitor/mon-itask.c b/c/src/lib/libmisc/monitor/mon-itask.c
index 31cccce2b5..5ce4b55270 100644
--- a/c/src/lib/libmisc/monitor/mon-itask.c
+++ b/c/src/lib/libmisc/monitor/mon-itask.c
@@ -1,8 +1,5 @@
/*
- * @(#)itask.c 1.6 - 96/01/03
- *
- *
- * RTEMS Monitor init task support
+ * RTEMS Monitor init task support
*
* $Id$
*/
diff --git a/c/src/lib/libmisc/monitor/mon-manager.c b/c/src/lib/libmisc/monitor/mon-manager.c
index d36ec926b6..af8d530d3b 100644
--- a/c/src/lib/libmisc/monitor/mon-manager.c
+++ b/c/src/lib/libmisc/monitor/mon-manager.c
@@ -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$
*/
diff --git a/c/src/lib/libmisc/monitor/mon-monitor.c b/c/src/lib/libmisc/monitor/mon-monitor.c
index 7cf666f78e..a5a3fab131 100644
--- a/c/src/lib/libmisc/monitor/mon-monitor.c
+++ b/c/src/lib/libmisc/monitor/mon-monitor.c
@@ -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(
@@ -303,19 +311,6 @@ rtems_monitor_continue_cmd(
}
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,
char **argv,
@@ -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;
diff --git a/c/src/lib/libmisc/monitor/mon-mpci.c b/c/src/lib/libmisc/monitor/mon-mpci.c
index f8e50d0b85..5c4d2c2cb3 100644
--- a/c/src/lib/libmisc/monitor/mon-mpci.c
+++ b/c/src/lib/libmisc/monitor/mon-mpci.c
@@ -1,7 +1,4 @@
/*
- * @(#)mpci.c 1.6 - 95/08/02
- *
- *
* RTEMS MPCI Config display support
*
* TODO
diff --git a/c/src/lib/libmisc/monitor/mon-object.c b/c/src/lib/libmisc/monitor/mon-object.c
index eb590470d8..0dfc6513d2 100644
--- a/c/src/lib/libmisc/monitor/mon-object.c
+++ b/c/src/lib/libmisc/monitor/mon-object.c
@@ -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);
diff --git a/c/src/lib/libmisc/monitor/mon-prmisc.c b/c/src/lib/libmisc/monitor/mon-prmisc.c
index 6003695195..030bd020da 100644
--- a/c/src/lib/libmisc/monitor/mon-prmisc.c
+++ b/c/src/lib/libmisc/monitor/mon-prmisc.c
@@ -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.
*
diff --git a/c/src/lib/libmisc/monitor/mon-queue.c b/c/src/lib/libmisc/monitor/mon-queue.c
index a72a371bff..08c1d9474e 100644
--- a/c/src/lib/libmisc/monitor/mon-queue.c
+++ b/c/src/lib/libmisc/monitor/mon-queue.c
@@ -1,6 +1,4 @@
/*
- * @(#)queue.c 1.5 - 95/07/31
- *
* $Id$
*/
diff --git a/c/src/lib/libmisc/monitor/mon-server.c b/c/src/lib/libmisc/monitor/mon-server.c
index d492c5e9a2..cc26718c27 100644
--- a/c/src/lib/libmisc/monitor/mon-server.c
+++ b/c/src/lib/libmisc/monitor/mon-server.c
@@ -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$
diff --git a/c/src/lib/libmisc/monitor/mon-symbols.c b/c/src/lib/libmisc/monitor/mon-symbols.c
index 942209fc2d..6c6589d38f 100644
--- a/c/src/lib/libmisc/monitor/mon-symbols.c
+++ b/c/src/lib/libmisc/monitor/mon-symbols.c
@@ -1,12 +1,4 @@
/*
- * @(#)symbols.c 1.10 - 95/08/02
- *
- * $Id$
- */
-
-/* #define qsort _quicksort */
-
-/*
* File: symbols.c
*
* Description:
@@ -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
@@ -262,42 +215,79 @@ rtems_symbol_value_lookup(
}
/*
- * Search the symbol table by string name (case independent)
+ * 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.
*/
-
-rtems_symbol_t *
-rtems_symbol_name_lookup(
+const rtems_symbol_t *
+rtems_symbol_value_lookup_exact(
rtems_symbol_table_t *table,
- char *name
+ rtems_unsigned32 value
)
{
- 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;
+ }
+
+ 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;
+ }
- if ((table == 0) || (name == 0))
- goto done;
+ return NULL;
- if (table->sorted == 0)
- rtems_symbol_sort(table);
+}
- /*
- * dummy up one for bsearch()
- */
- key.name = name;
- key.value = 0;
+/*
+ * Search the symbol table by string name (case independent)
+ */
- sp = (rtems_symbol_t *) bsearch((const void *) &key,
- (const void *) table->symbols,
- (size_t) table->next,
- sizeof(rtems_symbol_t),
- rtems_symbol_string_compare);
+rtems_symbol_t *
+rtems_symbol_name_lookup(
+ rtems_symbol_table_t *table,
+ char *name
+ )
+{
+ int s;
+ rtems_symbol_t *sp;
-done:
- return 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;
+ }
+
+ 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;
diff --git a/c/src/lib/libmisc/monitor/mon-task.c b/c/src/lib/libmisc/monitor/mon-task.c
index 95b650d429..b1a7938eb5 100644
--- a/c/src/lib/libmisc/monitor/mon-task.c
+++ b/c/src/lib/libmisc/monitor/mon-task.c
@@ -1,7 +1,4 @@
/*
- * @(#)task.c 1.9 - 95/08/01
- *
- *
* RTEMS Monitor task support
*
* $Id$
diff --git a/c/src/lib/libmisc/monitor/monitor.h b/c/src/lib/libmisc/monitor/monitor.h
index 6379254158..8a86b2c7d0 100644
--- a/c/src/lib/libmisc/monitor/monitor.h
+++ b/c/src/lib/libmisc/monitor/monitor.h
@@ -1,17 +1,12 @@
/*
- * @(#)monitor.h 1.21 - 96/01/03
- *
- *
- * monitor.h,v 1.3 1995/09/29 17:19:02 joel Exp
- */
-
-/*
* File: monitor.h
*
* Description:
* 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 *);
diff --git a/c/src/lib/libmisc/monitor/symbols.h b/c/src/lib/libmisc/monitor/symbols.h
index 736e7a074b..061ccdd952 100644
--- a/c/src/lib/libmisc/monitor/symbols.h
+++ b/c/src/lib/libmisc/monitor/symbols.h
@@ -1,7 +1,4 @@
/*
- * @(#)symbols.h 1.3 - 95/06/09
- *
- *
* RTEMS monitor symbol table functions
*
* Description:
@@ -48,14 +45,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
*/
diff --git a/c/src/lib/libmisc/stackchk/check.c b/c/src/lib/libmisc/stackchk/check.c
index bf5bda7fdc..3d06d1dd12 100644
--- a/c/src/lib/libmisc/stackchk/check.c
+++ b/c/src/lib/libmisc/stackchk/check.c
@@ -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
}
diff --git a/c/src/libmisc/assoc/assoc.c b/c/src/libmisc/assoc/assoc.c
index a3eabdb3b5..74387a8c5b 100644
--- a/c/src/libmisc/assoc/assoc.c
+++ b/c/src/libmisc/assoc/assoc.c
@@ -1,7 +1,4 @@
/*
- * @(#)assoc.c 1.6 - 95/10/25
- *
- *
* assoc.c
* rtems assoc routines
*
diff --git a/c/src/libmisc/assoc/assoc.h b/c/src/libmisc/assoc/assoc.h
index f9a444374c..1982d654ac 100644
--- a/c/src/libmisc/assoc/assoc.h
+++ b/c/src/libmisc/assoc/assoc.h
@@ -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)
diff --git a/c/src/libmisc/error/error.c b/c/src/libmisc/error/error.c
index 715635072a..5bd481c3e6 100644
--- a/c/src/libmisc/error/error.c
+++ b/c/src/libmisc/error/error.c
@@ -1,7 +1,4 @@
/*
- * @(#)error.c 1.6 - 95/12/12
- *
- *
* report errors and panics to RTEMS' stderr.
* Currently just used by RTEMS monitor.
*
diff --git a/c/src/libmisc/error/error.h b/c/src/libmisc/error/error.h
index 621ee16f65..e4d8c77200 100644
--- a/c/src/libmisc/error/error.h
+++ b/c/src/libmisc/error/error.h
@@ -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;
diff --git a/c/src/libmisc/monitor/mon-command.c b/c/src/libmisc/monitor/mon-command.c
index d231b3197a..87d31dfa2a 100644
--- a/c/src/libmisc/monitor/mon-command.c
+++ b/c/src/libmisc/monitor/mon-command.c
@@ -1,7 +1,4 @@
/*
- * @(#)command.c 1.5 - 95/08/02
- *
- *
* Command parsing routines for RTEMS monitor
*
* TODO:
diff --git a/c/src/libmisc/monitor/mon-config.c b/c/src/libmisc/monitor/mon-config.c
index 13d41cae1a..f5c9f6f093 100644
--- a/c/src/libmisc/monitor/mon-config.c
+++ b/c/src/libmisc/monitor/mon-config.c
@@ -1,7 +1,4 @@
/*
- * @(#)config.c 1.5 - 95/08/02
- *
- *
* RTEMS Config display support
*
* TODO
diff --git a/c/src/libmisc/monitor/mon-dname.c b/c/src/libmisc/monitor/mon-dname.c
index ad029f2400..e6993e18f7 100644
--- a/c/src/libmisc/monitor/mon-dname.c
+++ b/c/src/libmisc/monitor/mon-dname.c
@@ -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.
diff --git a/c/src/libmisc/monitor/mon-driver.c b/c/src/libmisc/monitor/mon-driver.c
index c12ac778ec..d5cff24a19 100644
--- a/c/src/libmisc/monitor/mon-driver.c
+++ b/c/src/libmisc/monitor/mon-driver.c
@@ -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.
diff --git a/c/src/libmisc/monitor/mon-extension.c b/c/src/libmisc/monitor/mon-extension.c
index 481a21e7dd..4afecaa617 100644
--- a/c/src/libmisc/monitor/mon-extension.c
+++ b/c/src/libmisc/monitor/mon-extension.c
@@ -1,7 +1,4 @@
/*
- * @(#)extension.c 1.6 - 95/09/25
- *
- *
* RTEMS Monitor extension support
*
* $Id$
diff --git a/c/src/libmisc/monitor/mon-itask.c b/c/src/libmisc/monitor/mon-itask.c
index 31cccce2b5..5ce4b55270 100644
--- a/c/src/libmisc/monitor/mon-itask.c
+++ b/c/src/libmisc/monitor/mon-itask.c
@@ -1,8 +1,5 @@
/*
- * @(#)itask.c 1.6 - 96/01/03
- *
- *
- * RTEMS Monitor init task support
+ * RTEMS Monitor init task support
*
* $Id$
*/
diff --git a/c/src/libmisc/monitor/mon-manager.c b/c/src/libmisc/monitor/mon-manager.c
index d36ec926b6..af8d530d3b 100644
--- a/c/src/libmisc/monitor/mon-manager.c
+++ b/c/src/libmisc/monitor/mon-manager.c
@@ -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$
*/
diff --git a/c/src/libmisc/monitor/mon-monitor.c b/c/src/libmisc/monitor/mon-monitor.c
index 7cf666f78e..a5a3fab131 100644
--- a/c/src/libmisc/monitor/mon-monitor.c
+++ b/c/src/libmisc/monitor/mon-monitor.c
@@ -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(
@@ -303,19 +311,6 @@ rtems_monitor_continue_cmd(
}
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,
char **argv,
@@ -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;
diff --git a/c/src/libmisc/monitor/mon-mpci.c b/c/src/libmisc/monitor/mon-mpci.c
index f8e50d0b85..5c4d2c2cb3 100644
--- a/c/src/libmisc/monitor/mon-mpci.c
+++ b/c/src/libmisc/monitor/mon-mpci.c
@@ -1,7 +1,4 @@
/*
- * @(#)mpci.c 1.6 - 95/08/02
- *
- *
* RTEMS MPCI Config display support
*
* TODO
diff --git a/c/src/libmisc/monitor/mon-object.c b/c/src/libmisc/monitor/mon-object.c
index eb590470d8..0dfc6513d2 100644
--- a/c/src/libmisc/monitor/mon-object.c
+++ b/c/src/libmisc/monitor/mon-object.c
@@ -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);
diff --git a/c/src/libmisc/monitor/mon-prmisc.c b/c/src/libmisc/monitor/mon-prmisc.c
index 6003695195..030bd020da 100644
--- a/c/src/libmisc/monitor/mon-prmisc.c
+++ b/c/src/libmisc/monitor/mon-prmisc.c
@@ -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.
*
diff --git a/c/src/libmisc/monitor/mon-queue.c b/c/src/libmisc/monitor/mon-queue.c
index a72a371bff..08c1d9474e 100644
--- a/c/src/libmisc/monitor/mon-queue.c
+++ b/c/src/libmisc/monitor/mon-queue.c
@@ -1,6 +1,4 @@
/*
- * @(#)queue.c 1.5 - 95/07/31
- *
* $Id$
*/
diff --git a/c/src/libmisc/monitor/mon-server.c b/c/src/libmisc/monitor/mon-server.c
index d492c5e9a2..cc26718c27 100644
--- a/c/src/libmisc/monitor/mon-server.c
+++ b/c/src/libmisc/monitor/mon-server.c
@@ -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$
diff --git a/c/src/libmisc/monitor/mon-symbols.c b/c/src/libmisc/monitor/mon-symbols.c
index 942209fc2d..6c6589d38f 100644
--- a/c/src/libmisc/monitor/mon-symbols.c
+++ b/c/src/libmisc/monitor/mon-symbols.c
@@ -1,12 +1,4 @@
/*
- * @(#)symbols.c 1.10 - 95/08/02
- *
- * $Id$
- */
-
-/* #define qsort _quicksort */
-
-/*
* File: symbols.c
*
* Description:
@@ -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
@@ -262,42 +215,79 @@ rtems_symbol_value_lookup(
}
/*
- * Search the symbol table by string name (case independent)
+ * 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.
*/
-
-rtems_symbol_t *
-rtems_symbol_name_lookup(
+const rtems_symbol_t *
+rtems_symbol_value_lookup_exact(
rtems_symbol_table_t *table,
- char *name
+ rtems_unsigned32 value
)
{
- 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;
+ }
+
+ 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;
+ }
- if ((table == 0) || (name == 0))
- goto done;
+ return NULL;
- if (table->sorted == 0)
- rtems_symbol_sort(table);
+}
- /*
- * dummy up one for bsearch()
- */
- key.name = name;
- key.value = 0;
+/*
+ * Search the symbol table by string name (case independent)
+ */
- sp = (rtems_symbol_t *) bsearch((const void *) &key,
- (const void *) table->symbols,
- (size_t) table->next,
- sizeof(rtems_symbol_t),
- rtems_symbol_string_compare);
+rtems_symbol_t *
+rtems_symbol_name_lookup(
+ rtems_symbol_table_t *table,
+ char *name
+ )
+{
+ int s;
+ rtems_symbol_t *sp;
-done:
- return 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;
+ }
+
+ 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;
diff --git a/c/src/libmisc/monitor/mon-task.c b/c/src/libmisc/monitor/mon-task.c
index 95b650d429..b1a7938eb5 100644
--- a/c/src/libmisc/monitor/mon-task.c
+++ b/c/src/libmisc/monitor/mon-task.c
@@ -1,7 +1,4 @@
/*
- * @(#)task.c 1.9 - 95/08/01
- *
- *
* RTEMS Monitor task support
*
* $Id$
diff --git a/c/src/libmisc/monitor/monitor.h b/c/src/libmisc/monitor/monitor.h
index 6379254158..8a86b2c7d0 100644
--- a/c/src/libmisc/monitor/monitor.h
+++ b/c/src/libmisc/monitor/monitor.h
@@ -1,17 +1,12 @@
/*
- * @(#)monitor.h 1.21 - 96/01/03
- *
- *
- * monitor.h,v 1.3 1995/09/29 17:19:02 joel Exp
- */
-
-/*
* File: monitor.h
*
* Description:
* 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 *);
diff --git a/c/src/libmisc/monitor/symbols.h b/c/src/libmisc/monitor/symbols.h
index 736e7a074b..061ccdd952 100644
--- a/c/src/libmisc/monitor/symbols.h
+++ b/c/src/libmisc/monitor/symbols.h
@@ -1,7 +1,4 @@
/*
- * @(#)symbols.h 1.3 - 95/06/09
- *
- *
* RTEMS monitor symbol table functions
*
* Description:
@@ -48,14 +45,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
*/
diff --git a/c/src/libmisc/stackchk/check.c b/c/src/libmisc/stackchk/check.c
index bf5bda7fdc..3d06d1dd12 100644
--- a/c/src/libmisc/stackchk/check.c
+++ b/c/src/libmisc/stackchk/check.c
@@ -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
}
diff --git a/c/src/tests/sptests/spfatal/fatal.c b/c/src/tests/sptests/spfatal/fatal.c
index 3b2228bffd..fa3dd547bd 100644
--- a/c/src/tests/sptests/spfatal/fatal.c
+++ b/c/src/tests/sptests/spfatal/fatal.c
@@ -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;
diff --git a/c/src/tests/sptests/spfatal/system.h b/c/src/tests/sptests/spfatal/system.h
index 13f8a9db4a..a1e3578a64 100644
--- a/c/src/tests/sptests/spfatal/system.h
+++ b/c/src/tests/sptests/spfatal/system.h
@@ -28,7 +28,8 @@ void put_error(
);
rtems_extension Fatal_extension(
- rtems_unsigned32 error
+ rtems_unsigned32 error,
+ boolean is_internal
);
rtems_task Task_1(
diff --git a/c/src/tests/tmtests/tm21/task1.c b/c/src/tests/tmtests/tm21/task1.c
index a7a6a09ed7..5529cd5182 100644
--- a/c/src/tests/tmtests/tm21/task1.c
+++ b/c/src/tests/tmtests/tm21/task1.c
@@ -70,7 +70,7 @@ rtems_task Task_1(
status = rtems_message_queue_create(
index,
- 1,
+ OPERATION_COUNT,
16,
RTEMS_DEFAULT_ATTRIBUTES,
&id
diff --git a/c/src/tests/tools/generic/difftest b/c/src/tests/tools/generic/difftest
index 1f76cdf356..11d9ba9e2f 100644
--- a/c/src/tests/tools/generic/difftest
+++ b/c/src/tests/tools/generic/difftest
@@ -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" ]
diff --git a/cpukit/libcsupport/include/rtems/assoc.h b/cpukit/libcsupport/include/rtems/assoc.h
index f9a444374c..1982d654ac 100644
--- a/cpukit/libcsupport/include/rtems/assoc.h
+++ b/cpukit/libcsupport/include/rtems/assoc.h
@@ -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)
diff --git a/cpukit/libcsupport/include/rtems/error.h b/cpukit/libcsupport/include/rtems/error.h
index 621ee16f65..e4d8c77200 100644
--- a/cpukit/libcsupport/include/rtems/error.h
+++ b/cpukit/libcsupport/include/rtems/error.h
@@ -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;
diff --git a/cpukit/libcsupport/src/assoc.c b/cpukit/libcsupport/src/assoc.c
index a3eabdb3b5..74387a8c5b 100644
--- a/cpukit/libcsupport/src/assoc.c
+++ b/cpukit/libcsupport/src/assoc.c
@@ -1,7 +1,4 @@
/*
- * @(#)assoc.c 1.6 - 95/10/25
- *
- *
* assoc.c
* rtems assoc routines
*
diff --git a/cpukit/libcsupport/src/error.c b/cpukit/libcsupport/src/error.c
index 715635072a..5bd481c3e6 100644
--- a/cpukit/libcsupport/src/error.c
+++ b/cpukit/libcsupport/src/error.c
@@ -1,7 +1,4 @@
/*
- * @(#)error.c 1.6 - 95/12/12
- *
- *
* report errors and panics to RTEMS' stderr.
* Currently just used by RTEMS monitor.
*
diff --git a/cpukit/libmisc/monitor/mon-command.c b/cpukit/libmisc/monitor/mon-command.c
index d231b3197a..87d31dfa2a 100644
--- a/cpukit/libmisc/monitor/mon-command.c
+++ b/cpukit/libmisc/monitor/mon-command.c
@@ -1,7 +1,4 @@
/*
- * @(#)command.c 1.5 - 95/08/02
- *
- *
* Command parsing routines for RTEMS monitor
*
* TODO:
diff --git a/cpukit/libmisc/monitor/mon-config.c b/cpukit/libmisc/monitor/mon-config.c
index 13d41cae1a..f5c9f6f093 100644
--- a/cpukit/libmisc/monitor/mon-config.c
+++ b/cpukit/libmisc/monitor/mon-config.c
@@ -1,7 +1,4 @@
/*
- * @(#)config.c 1.5 - 95/08/02
- *
- *
* RTEMS Config display support
*
* TODO
diff --git a/cpukit/libmisc/monitor/mon-dname.c b/cpukit/libmisc/monitor/mon-dname.c
index ad029f2400..e6993e18f7 100644
--- a/cpukit/libmisc/monitor/mon-dname.c
+++ b/cpukit/libmisc/monitor/mon-dname.c
@@ -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.
diff --git a/cpukit/libmisc/monitor/mon-driver.c b/cpukit/libmisc/monitor/mon-driver.c
index c12ac778ec..d5cff24a19 100644
--- a/cpukit/libmisc/monitor/mon-driver.c
+++ b/cpukit/libmisc/monitor/mon-driver.c
@@ -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.
diff --git a/cpukit/libmisc/monitor/mon-extension.c b/cpukit/libmisc/monitor/mon-extension.c
index 481a21e7dd..4afecaa617 100644
--- a/cpukit/libmisc/monitor/mon-extension.c
+++ b/cpukit/libmisc/monitor/mon-extension.c
@@ -1,7 +1,4 @@
/*
- * @(#)extension.c 1.6 - 95/09/25
- *
- *
* RTEMS Monitor extension support
*
* $Id$
diff --git a/cpukit/libmisc/monitor/mon-itask.c b/cpukit/libmisc/monitor/mon-itask.c
index 31cccce2b5..5ce4b55270 100644
--- a/cpukit/libmisc/monitor/mon-itask.c
+++ b/cpukit/libmisc/monitor/mon-itask.c
@@ -1,8 +1,5 @@
/*
- * @(#)itask.c 1.6 - 96/01/03
- *
- *
- * RTEMS Monitor init task support
+ * RTEMS Monitor init task support
*
* $Id$
*/
diff --git a/cpukit/libmisc/monitor/mon-manager.c b/cpukit/libmisc/monitor/mon-manager.c
index d36ec926b6..af8d530d3b 100644
--- a/cpukit/libmisc/monitor/mon-manager.c
+++ b/cpukit/libmisc/monitor/mon-manager.c
@@ -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$
*/
diff --git a/cpukit/libmisc/monitor/mon-monitor.c b/cpukit/libmisc/monitor/mon-monitor.c
index 7cf666f78e..a5a3fab131 100644
--- a/cpukit/libmisc/monitor/mon-monitor.c
+++ b/cpukit/libmisc/monitor/mon-monitor.c
@@ -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(
@@ -303,19 +311,6 @@ rtems_monitor_continue_cmd(
}
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,
char **argv,
@@ -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;
diff --git a/cpukit/libmisc/monitor/mon-mpci.c b/cpukit/libmisc/monitor/mon-mpci.c
index f8e50d0b85..5c4d2c2cb3 100644
--- a/cpukit/libmisc/monitor/mon-mpci.c
+++ b/cpukit/libmisc/monitor/mon-mpci.c
@@ -1,7 +1,4 @@
/*
- * @(#)mpci.c 1.6 - 95/08/02
- *
- *
* RTEMS MPCI Config display support
*
* TODO
diff --git a/cpukit/libmisc/monitor/mon-object.c b/cpukit/libmisc/monitor/mon-object.c
index eb590470d8..0dfc6513d2 100644
--- a/cpukit/libmisc/monitor/mon-object.c
+++ b/cpukit/libmisc/monitor/mon-object.c
@@ -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);
diff --git a/cpukit/libmisc/monitor/mon-prmisc.c b/cpukit/libmisc/monitor/mon-prmisc.c
index 6003695195..030bd020da 100644
--- a/cpukit/libmisc/monitor/mon-prmisc.c
+++ b/cpukit/libmisc/monitor/mon-prmisc.c
@@ -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.
*
diff --git a/cpukit/libmisc/monitor/mon-queue.c b/cpukit/libmisc/monitor/mon-queue.c
index a72a371bff..08c1d9474e 100644
--- a/cpukit/libmisc/monitor/mon-queue.c
+++ b/cpukit/libmisc/monitor/mon-queue.c
@@ -1,6 +1,4 @@
/*
- * @(#)queue.c 1.5 - 95/07/31
- *
* $Id$
*/
diff --git a/cpukit/libmisc/monitor/mon-server.c b/cpukit/libmisc/monitor/mon-server.c
index d492c5e9a2..cc26718c27 100644
--- a/cpukit/libmisc/monitor/mon-server.c
+++ b/cpukit/libmisc/monitor/mon-server.c
@@ -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$
diff --git a/cpukit/libmisc/monitor/mon-symbols.c b/cpukit/libmisc/monitor/mon-symbols.c
index 942209fc2d..6c6589d38f 100644
--- a/cpukit/libmisc/monitor/mon-symbols.c
+++ b/cpukit/libmisc/monitor/mon-symbols.c
@@ -1,12 +1,4 @@
/*
- * @(#)symbols.c 1.10 - 95/08/02
- *
- * $Id$
- */
-
-/* #define qsort _quicksort */
-
-/*
* File: symbols.c
*
* Description:
@@ -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
@@ -262,42 +215,79 @@ rtems_symbol_value_lookup(
}
/*
- * Search the symbol table by string name (case independent)
+ * 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.
*/
-
-rtems_symbol_t *
-rtems_symbol_name_lookup(
+const rtems_symbol_t *
+rtems_symbol_value_lookup_exact(
rtems_symbol_table_t *table,
- char *name
+ rtems_unsigned32 value
)
{
- 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;
+ }
+
+ 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;
+ }
- if ((table == 0) || (name == 0))
- goto done;
+ return NULL;
- if (table->sorted == 0)
- rtems_symbol_sort(table);
+}
- /*
- * dummy up one for bsearch()
- */
- key.name = name;
- key.value = 0;
+/*
+ * Search the symbol table by string name (case independent)
+ */
- sp = (rtems_symbol_t *) bsearch((const void *) &key,
- (const void *) table->symbols,
- (size_t) table->next,
- sizeof(rtems_symbol_t),
- rtems_symbol_string_compare);
+rtems_symbol_t *
+rtems_symbol_name_lookup(
+ rtems_symbol_table_t *table,
+ char *name
+ )
+{
+ int s;
+ rtems_symbol_t *sp;
-done:
- return 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;
+ }
+
+ 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;
diff --git a/cpukit/libmisc/monitor/mon-task.c b/cpukit/libmisc/monitor/mon-task.c
index 95b650d429..b1a7938eb5 100644
--- a/cpukit/libmisc/monitor/mon-task.c
+++ b/cpukit/libmisc/monitor/mon-task.c
@@ -1,7 +1,4 @@
/*
- * @(#)task.c 1.9 - 95/08/01
- *
- *
* RTEMS Monitor task support
*
* $Id$
diff --git a/cpukit/libmisc/monitor/monitor.h b/cpukit/libmisc/monitor/monitor.h
index 6379254158..8a86b2c7d0 100644
--- a/cpukit/libmisc/monitor/monitor.h
+++ b/cpukit/libmisc/monitor/monitor.h
@@ -1,17 +1,12 @@
/*
- * @(#)monitor.h 1.21 - 96/01/03
- *
- *
- * monitor.h,v 1.3 1995/09/29 17:19:02 joel Exp
- */
-
-/*
* File: monitor.h
*
* Description:
* 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 *);
diff --git a/cpukit/libmisc/monitor/symbols.h b/cpukit/libmisc/monitor/symbols.h
index 736e7a074b..061ccdd952 100644
--- a/cpukit/libmisc/monitor/symbols.h
+++ b/cpukit/libmisc/monitor/symbols.h
@@ -1,7 +1,4 @@
/*
- * @(#)symbols.h 1.3 - 95/06/09
- *
- *
* RTEMS monitor symbol table functions
*
* Description:
@@ -48,14 +45,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
*/
diff --git a/cpukit/libmisc/stackchk/check.c b/cpukit/libmisc/stackchk/check.c
index bf5bda7fdc..3d06d1dd12 100644
--- a/cpukit/libmisc/stackchk/check.c
+++ b/cpukit/libmisc/stackchk/check.c
@@ -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
}
diff --git a/testsuites/sptests/spfatal/fatal.c b/testsuites/sptests/spfatal/fatal.c
index 3b2228bffd..fa3dd547bd 100644
--- a/testsuites/sptests/spfatal/fatal.c
+++ b/testsuites/sptests/spfatal/fatal.c
@@ -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;
diff --git a/testsuites/sptests/spfatal/system.h b/testsuites/sptests/spfatal/system.h
index 13f8a9db4a..a1e3578a64 100644
--- a/testsuites/sptests/spfatal/system.h
+++ b/testsuites/sptests/spfatal/system.h
@@ -28,7 +28,8 @@ void put_error(
);
rtems_extension Fatal_extension(
- rtems_unsigned32 error
+ rtems_unsigned32 error,
+ boolean is_internal
);
rtems_task Task_1(
diff --git a/testsuites/tmtests/tm21/task1.c b/testsuites/tmtests/tm21/task1.c
index a7a6a09ed7..5529cd5182 100644
--- a/testsuites/tmtests/tm21/task1.c
+++ b/testsuites/tmtests/tm21/task1.c
@@ -70,7 +70,7 @@ rtems_task Task_1(
status = rtems_message_queue_create(
index,
- 1,
+ OPERATION_COUNT,
16,
RTEMS_DEFAULT_ATTRIBUTES,
&id
diff --git a/tools/cpu/hppa1.1/genoffsets.c b/tools/cpu/hppa1.1/genoffsets.c
index 578259e83d..39f900b48a 100644
--- a/tools/cpu/hppa1.1/genoffsets.c
+++ b/tools/cpu/hppa1.1/genoffsets.c
@@ -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);
/*