summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--c/UPDATE_HELP53
-rw-r--r--c/src/exec/libcsupport/src/__brk.c6
-rw-r--r--c/src/exec/libcsupport/src/__gettod.c51
-rw-r--r--c/src/exec/libcsupport/src/newlibc.c10
-rw-r--r--c/src/exec/rtems/src/rtemstimer.c7
-rw-r--r--c/src/exec/rtems/src/timer.c7
-rw-r--r--c/src/exec/sapi/headers/io.h6
-rw-r--r--c/src/exec/sapi/headers/sptables.h2
-rw-r--r--c/src/exec/sapi/include/rtems/io.h6
-rw-r--r--c/src/exec/sapi/include/rtems/sptables.h2
-rw-r--r--c/src/exec/sapi/src/exinit.c7
-rw-r--r--c/src/exec/sapi/src/io.c6
-rw-r--r--c/src/exec/score/cpu/hppa1.1/cpu.c2
-rw-r--r--c/src/exec/score/cpu/hppa1.1/cpu.h7
-rw-r--r--c/src/exec/score/cpu/hppa1.1/cpu_asm.h2
-rw-r--r--c/src/exec/score/cpu/hppa1.1/cpu_asm.s4
-rw-r--r--c/src/exec/score/cpu/hppa1.1/hppa.h236
-rw-r--r--c/src/exec/score/cpu/hppa1.1/rtems.s4
-rw-r--r--c/src/exec/score/cpu/i386/asm.h2
-rw-r--r--c/src/exec/score/cpu/i386/cpu.h5
-rw-r--r--c/src/exec/score/cpu/i386/i386.h47
-rw-r--r--c/src/exec/score/cpu/i960/asm.h2
-rw-r--r--c/src/exec/score/cpu/i960/cpu.h5
-rw-r--r--c/src/exec/score/cpu/i960/i960.h74
-rw-r--r--c/src/exec/score/cpu/m68k/asm.h2
-rw-r--r--c/src/exec/score/cpu/m68k/cpu.h5
-rw-r--r--c/src/exec/score/cpu/m68k/m68k.h38
-rw-r--r--c/src/exec/score/cpu/no_cpu/asm.h2
-rw-r--r--c/src/exec/score/cpu/no_cpu/cpu.h5
-rw-r--r--c/src/exec/score/cpu/no_cpu/no_cpu.h40
-rw-r--r--c/src/exec/score/cpu/unix/cpu.c25
-rw-r--r--c/src/exec/score/cpu/unix/cpu.h8
-rw-r--r--c/src/exec/score/cpu/unix/unix.h49
-rw-r--r--c/src/exec/score/headers/watchdog.h61
-rw-r--r--c/src/exec/score/include/rtems/score/watchdog.h61
-rw-r--r--c/src/exec/score/inline/rtems/score/watchdog.inl35
-rw-r--r--c/src/exec/score/inline/watchdog.inl35
-rw-r--r--c/src/exec/score/macros/rtems/score/watchdog.inl27
-rw-r--r--c/src/exec/score/macros/watchdog.inl27
-rw-r--r--c/src/exec/score/src/heap.c40
-rw-r--r--c/src/exec/score/src/watchdog.c71
-rw-r--r--c/src/exec/score/tools/hppa1.1/genoffsets.c8
-rw-r--r--c/src/lib/libbsp/hppa1.1/simhppa/startup/bspstart.c8
-rw-r--r--c/src/lib/libbsp/i960/cvme961/shmsupp/lock.c5
-rw-r--r--c/src/lib/libbsp/m68k/idp/clock/ckinit.c7
-rw-r--r--c/src/lib/libbsp/m68k/idp/include/bsp.h9
-rw-r--r--c/src/lib/libbsp/m68k/idp/startup/bspstart.c7
-rw-r--r--c/src/lib/libbsp/m68k/idp/timer/timer.c7
-rw-r--r--c/src/lib/libbsp/shmdr/poll.c29
-rw-r--r--c/src/lib/libbsp/shmdr/shm.h4
-rw-r--r--c/src/lib/libbsp/shmdr/shm_driver.h4
-rw-r--r--c/src/lib/libc/__brk.c6
-rw-r--r--c/src/lib/libc/__gettod.c51
-rw-r--r--c/src/lib/libc/newlibc.c10
-rw-r--r--c/src/lib/libmisc/stackchk/check.c1
-rw-r--r--c/src/libchip/shmdr/poll.c29
-rw-r--r--c/src/libchip/shmdr/shm_driver.h4
-rw-r--r--c/src/libmisc/stackchk/check.c1
-rw-r--r--c/src/tests/mptests/mp01/task1.c4
-rw-r--r--c/src/tests/sptests/sp04/tswitch.c4
-rw-r--r--c/src/tests/sptests/sp09/screen14.c8
-rw-r--r--c/src/tests/sptests/sp09/sp09.scn1
-rw-r--r--c/src/tests/sptests/sp20/sp20.scn2
-rw-r--r--c/src/tests/sptests/spsize/size.c3
-rw-r--r--cpukit/libcsupport/src/__brk.c6
-rw-r--r--cpukit/libcsupport/src/__gettod.c51
-rw-r--r--cpukit/libcsupport/src/newlibc.c10
-rw-r--r--cpukit/libmisc/stackchk/check.c1
-rw-r--r--cpukit/rtems/src/rtemstimer.c7
-rw-r--r--cpukit/sapi/include/rtems/io.h6
-rw-r--r--cpukit/sapi/src/exinit.c7
-rw-r--r--cpukit/sapi/src/io.c6
-rw-r--r--cpukit/score/cpu/hppa1.1/cpu.c2
-rw-r--r--cpukit/score/cpu/i386/asm.h2
-rw-r--r--cpukit/score/cpu/i386/rtems/asm.h2
-rw-r--r--cpukit/score/cpu/i960/asm.h2
-rw-r--r--cpukit/score/cpu/m68k/asm.h2
-rw-r--r--cpukit/score/cpu/m68k/rtems/asm.h2
-rw-r--r--cpukit/score/cpu/no_cpu/asm.h2
-rw-r--r--cpukit/score/cpu/no_cpu/rtems/asm.h2
-rw-r--r--cpukit/score/cpu/unix/cpu.c25
-rw-r--r--cpukit/score/include/rtems/score/watchdog.h61
-rw-r--r--cpukit/score/inline/rtems/score/watchdog.inl35
-rw-r--r--cpukit/score/macros/rtems/score/watchdog.inl27
-rw-r--r--cpukit/score/src/heap.c40
-rw-r--r--cpukit/score/src/watchdog.c71
-rw-r--r--testsuites/mptests/mp01/task1.c4
-rw-r--r--testsuites/sptests/sp04/tswitch.c4
-rw-r--r--testsuites/sptests/sp09/screen14.c8
-rw-r--r--testsuites/sptests/sp09/sp09.scn1
-rw-r--r--testsuites/sptests/sp20/sp20.scn2
-rw-r--r--testsuites/sptests/spsize/size.c3
-rw-r--r--tools/cpu/hppa1.1/genoffsets.c8
93 files changed, 756 insertions, 939 deletions
diff --git a/c/UPDATE_HELP b/c/UPDATE_HELP
index cf6feffff0..520d99aafc 100644
--- a/c/UPDATE_HELP
+++ b/c/UPDATE_HELP
@@ -2,16 +2,51 @@
# $Id$
#
-In the directory "update_tools", there are a set of tools to aid in
-making the application source changes necessary to address some
-of the changes in the RTEMS API between release 3.1.0 and 3.2.0.
+Between RTEMS 3.1.0 and 3.2.0, every RTEMS defined symbol made visible
+was renamed. This document describes the change and the tools provided
+to assist you in updating your RTEMS 3.1.0 application.
-The primary change addressed by these tools is the addition of
-"rtems_" or "RTEMS_" as a prefix on EVERY user visible RTEMS
-provided constant and routine. The primary factor in the decision
-to make such a sweeping change was conflicts between the
-the RTEMS and POSIX API's.
+[NOTE: This change was not included in snapshots prior to 3.1.15.]
+
+DESCRIPTION OF NAME CHANGES:
+============================
+
+The primary change was the addition of the prefix "rtems_" or "RTEMS_" to
+EVERY user visible RTEMS provided constant and routine. The primary
+factor in the decision to make such a sweeping change was conflicts
+between the the RTEMS and POSIX API's.
+
+
+TO UPDATE YOUR APPLICATION:
+===========================
+
+The update script requires that Perl be installed on your computer.
+It has only been tested with Perl 5.x.
+
+After RTEMS has been built, in the directory "$r/<BSP>/update_tools", will
+be a set of tools to aid in making the application source changes necessary
+to address (hopefully) all of the name changes in the RTEMS API between
+releases 3.1.0 and 3.2.0.
+
+The update shell script is the only executable which is invoked by the
+user directly. The word-replace Perl script is invoked by the update
+shell script.
WARNING: These tools modify the files IN PLACE!!! Backup your
- source before using these tools.
+ source before using these tools.
+
+To udpate your application, change directories to the top of your application
+source tree and execute the update script. It should be something similar
+to the following:
+
+cd MY_APP
+$r/<BSP>/update-tools/update
+
+The update script will ask if you have backed up your source code before
+beginning the update process. While operating on files, it will print
+the name of each file and a dot for each change made to the source file.
+NOTE: These scripts do not attempt to address changes in calling
+ sequences. After the script has run, you will need to update
+ calls to rtems_clock_get(), rtems_timer_fire_after(), and
+ rtems_timer_fire_when() by hand.
diff --git a/c/src/exec/libcsupport/src/__brk.c b/c/src/exec/libcsupport/src/__brk.c
index 6fb15342fe..7c43ffa32b 100644
--- a/c/src/exec/libcsupport/src/__brk.c
+++ b/c/src/exec/libcsupport/src/__brk.c
@@ -1,3 +1,5 @@
+#if !defined(RTEMS_UNIX)
+
/*
* RTEMS "Broken" __brk/__sbrk Implementation
*
@@ -12,7 +14,7 @@
* to the copyright license under the clause at DFARS 252.227-7013. This
* notice must appear in all copies of this file and its derivatives.
*
- * $Id$
+ * __brk.c,v 1.2 1995/05/09 20:24:28 joel Exp
*/
#include <rtems.h>
@@ -38,3 +40,5 @@ int __brk( const void *endds )
errno = EINVAL;
return -1;
}
+
+#endif
diff --git a/c/src/exec/libcsupport/src/__gettod.c b/c/src/exec/libcsupport/src/__gettod.c
index a1ab9776c8..6f8df8a65f 100644
--- a/c/src/exec/libcsupport/src/__gettod.c
+++ b/c/src/exec/libcsupport/src/__gettod.c
@@ -11,7 +11,7 @@
* to the copyright license under the clause at DFARS 252.227-7013. This
* notice must appear in all copies of this file and its derivatives.
*
- * $Id$
+ * __gettod.c,v 1.2 1995/05/09 20:24:31 joel Exp
*/
#include <rtems.h>
@@ -19,8 +19,10 @@
#ifdef RTEMS_NEWLIB
#include <sys/reent.h>
#endif
+
#include <time.h>
#include <sys/time.h>
+
#include <errno.h>
#include <assert.h>
@@ -29,14 +31,14 @@
*/
int gettimeofday(
- struct timeval *tp,
- struct timezone *tzp
+ struct timeval *tp,
+ struct timezone *tzp
)
{
rtems_status_code status;
rtems_clock_time_value time;
- if ( !tp || !tzp ) {
+ if ( !tp ) {
errno = EFAULT;
return -1;
}
@@ -51,34 +53,51 @@ int gettimeofday(
tp->tv_sec = time.seconds;
tp->tv_usec = time.microseconds;
-#if 0
- tzp->minuteswest = timezone / 60; /* from seconds to minutes */
- tzp->dsttime = daylight;
-#endif
-
/*
* newlib does not have timezone and daylight savings time
* yet. When it does this needs to be fixed.
*/
- tzp->tz_minuteswest = 0; /* at UTC */
- tzp->tz_dsttime = 0; /* no daylight savings */
+ if ( tzp ) {
+ tzp->tz_minuteswest = 0; /* at UTC */
+ tzp->tz_dsttime = 0; /* no daylight savings */
+#if 0
+ tzp->minuteswest = timezone / 60; /* from seconds to minutes */
+ tzp->dsttime = daylight;
+#endif
+ }
return 0;
}
+#if defined(RTEMS_NEWLIB)
+
+#if 0
/*
- * "Reentrant" versions of the above routines implemented above.
+ * "Reentrant" version
*/
-#if 0
int _gettimeofday_r(
- struct _reent *ignored_reentrancy_stuff,
- struct timeval *tp,
- struct timezone *tzp
+ struct _reent *ignored_reentrancy_stuff,
+ struct timeval *tp,
+ struct timezone *tzp
)
{
return gettimeofday( tp, tzp );
}
#endif
+/*
+ * "System call" version
+ */
+
+int _gettimeofday(
+ struct timeval *tp,
+ struct timezone *tzp
+)
+{
+ return gettimeofday( tp, tzp );
+}
+
+#endif /* defined(RTEMS_NEWLIB) */
+
#endif
diff --git a/c/src/exec/libcsupport/src/newlibc.c b/c/src/exec/libcsupport/src/newlibc.c
index 3c5e58b67c..39dea67775 100644
--- a/c/src/exec/libcsupport/src/newlibc.c
+++ b/c/src/exec/libcsupport/src/newlibc.c
@@ -1,16 +1,16 @@
/*
- * @(#)newlibc.c 1.8 - 95/04/25
+ * @(#)newlibc.c 1.9 - 95/05/16
*
*/
#if defined(RTEMS_NEWLIB)
/*
- * File: $RCSfile$
+ * File: newlibc.c,v
* Project: PixelFlow
* Created: 94/12/7
- * Revision: $Revision$
- * Last Mod: $Date$
+ * Revision: 1.2
+ * Last Mod: 1995/05/09 20:24:37
*
* COPYRIGHT (c) 1994 by Division Incorporated
*
@@ -35,7 +35,7 @@
*
* NOTE:
*
- * $Id$
+ * newlibc.c,v 1.2 1995/05/09 20:24:37 joel Exp
*
*/
diff --git a/c/src/exec/rtems/src/rtemstimer.c b/c/src/exec/rtems/src/rtemstimer.c
index 076091bee4..abab4cc7b4 100644
--- a/c/src/exec/rtems/src/rtemstimer.c
+++ b/c/src/exec/rtems/src/rtemstimer.c
@@ -146,13 +146,10 @@ rtems_status_code rtems_timer_cancel(
case OBJECTS_REMOTE: /* should never return this */
return( RTEMS_INTERNAL_ERROR );
case OBJECTS_LOCAL:
- if ( !_Timer_Is_dormant_class( the_timer->the_class ) ) {
+ if ( !_Timer_Is_dormant_class( the_timer->the_class ) )
(void) _Watchdog_Remove( &the_timer->Ticker );
- _Thread_Enable_dispatch();
- return( RTEMS_SUCCESSFUL );
- }
_Thread_Enable_dispatch();
- return( RTEMS_INCORRECT_STATE );
+ return( RTEMS_SUCCESSFUL );
}
return( RTEMS_INTERNAL_ERROR ); /* unreached - only to remove warnings */
diff --git a/c/src/exec/rtems/src/timer.c b/c/src/exec/rtems/src/timer.c
index 076091bee4..abab4cc7b4 100644
--- a/c/src/exec/rtems/src/timer.c
+++ b/c/src/exec/rtems/src/timer.c
@@ -146,13 +146,10 @@ rtems_status_code rtems_timer_cancel(
case OBJECTS_REMOTE: /* should never return this */
return( RTEMS_INTERNAL_ERROR );
case OBJECTS_LOCAL:
- if ( !_Timer_Is_dormant_class( the_timer->the_class ) ) {
+ if ( !_Timer_Is_dormant_class( the_timer->the_class ) )
(void) _Watchdog_Remove( &the_timer->Ticker );
- _Thread_Enable_dispatch();
- return( RTEMS_SUCCESSFUL );
- }
_Thread_Enable_dispatch();
- return( RTEMS_INCORRECT_STATE );
+ return( RTEMS_SUCCESSFUL );
}
return( RTEMS_INTERNAL_ERROR ); /* unreached - only to remove warnings */
diff --git a/c/src/exec/sapi/headers/io.h b/c/src/exec/sapi/headers/io.h
index 6824377170..43c52cd35d 100644
--- a/c/src/exec/sapi/headers/io.h
+++ b/c/src/exec/sapi/headers/io.h
@@ -187,11 +187,11 @@ void _IO_Initialize_all_drivers( void );
*/
rtems_status_code _IO_Handler_routine(
- IO_operations operation,
+ IO_operations operation,
rtems_device_major_number major,
rtems_device_minor_number minor,
- void *argument,
- unsigned32 *return_value
+ void *argument,
+ unsigned32 *return_value
);
#include <rtems/io.inl>
diff --git a/c/src/exec/sapi/headers/sptables.h b/c/src/exec/sapi/headers/sptables.h
index 53dc50df5f..7983c3a67f 100644
--- a/c/src/exec/sapi/headers/sptables.h
+++ b/c/src/exec/sapi/headers/sptables.h
@@ -42,7 +42,7 @@ const rtems_multiprocessing_table
*/
const char _RTEMS_version[] =
- "RTEMS RELEASE V3.1.15 (" CPU_NAME "/" RTEMS_MODEL_NAME ")";
+ "RTEMS RELEASE V3.1.16 (" CPU_NAME "/" RTEMS_MODEL_NAME ")";
/*
diff --git a/c/src/exec/sapi/include/rtems/io.h b/c/src/exec/sapi/include/rtems/io.h
index 6824377170..43c52cd35d 100644
--- a/c/src/exec/sapi/include/rtems/io.h
+++ b/c/src/exec/sapi/include/rtems/io.h
@@ -187,11 +187,11 @@ void _IO_Initialize_all_drivers( void );
*/
rtems_status_code _IO_Handler_routine(
- IO_operations operation,
+ IO_operations operation,
rtems_device_major_number major,
rtems_device_minor_number minor,
- void *argument,
- unsigned32 *return_value
+ void *argument,
+ unsigned32 *return_value
);
#include <rtems/io.inl>
diff --git a/c/src/exec/sapi/include/rtems/sptables.h b/c/src/exec/sapi/include/rtems/sptables.h
index 53dc50df5f..7983c3a67f 100644
--- a/c/src/exec/sapi/include/rtems/sptables.h
+++ b/c/src/exec/sapi/include/rtems/sptables.h
@@ -42,7 +42,7 @@ const rtems_multiprocessing_table
*/
const char _RTEMS_version[] =
- "RTEMS RELEASE V3.1.15 (" CPU_NAME "/" RTEMS_MODEL_NAME ")";
+ "RTEMS RELEASE V3.1.16 (" CPU_NAME "/" RTEMS_MODEL_NAME ")";
/*
diff --git a/c/src/exec/sapi/src/exinit.c b/c/src/exec/sapi/src/exinit.c
index cc45a11c94..984dca68be 100644
--- a/c/src/exec/sapi/src/exinit.c
+++ b/c/src/exec/sapi/src/exinit.c
@@ -107,6 +107,13 @@ rtems_interrupt_level rtems_initialize_executive_early(
_CPU_Initialize( cpu_table, _Thread_Dispatch );
+ /*
+ * Do this as early as possible to insure no debugging output
+ * is even attempted to be printed.
+ */
+
+ _Debug_Manager_initialization();
+
multiprocessing_table = configuration_table->User_multiprocessing_table;
if ( multiprocessing_table == NULL )
multiprocessing_table =
diff --git a/c/src/exec/sapi/src/io.c b/c/src/exec/sapi/src/io.c
index cf78bb9f71..916053da7e 100644
--- a/c/src/exec/sapi/src/io.c
+++ b/c/src/exec/sapi/src/io.c
@@ -256,11 +256,11 @@ rtems_status_code rtems_io_control(
*/
rtems_status_code _IO_Handler_routine(
- IO_operations operation,
+ IO_operations operation,
rtems_device_major_number major,
rtems_device_minor_number minor,
- void *argument,
- unsigned32 *return_value
+ void *argument,
+ unsigned32 *return_value
)
{
rtems_device_driver_entry io_callout;
diff --git a/c/src/exec/score/cpu/hppa1.1/cpu.c b/c/src/exec/score/cpu/hppa1.1/cpu.c
index b69a172b4e..027ed07333 100644
--- a/c/src/exec/score/cpu/hppa1.1/cpu.c
+++ b/c/src/exec/score/cpu/hppa1.1/cpu.c
@@ -14,7 +14,7 @@
* Division Incorporated makes no representations about the
* suitability of this software for any purpose.
*
- * $Id$
+ * cpu.c,v 1.2 1995/05/09 20:11:35 joel Exp
*/
#include <rtems/system.h>
diff --git a/c/src/exec/score/cpu/hppa1.1/cpu.h b/c/src/exec/score/cpu/hppa1.1/cpu.h
index 3e8f31fcf0..887cbc6c01 100644
--- a/c/src/exec/score/cpu/hppa1.1/cpu.h
+++ b/c/src/exec/score/cpu/hppa1.1/cpu.h
@@ -20,7 +20,7 @@
* Note:
* This file is included by both C and assembler code ( -DASM )
*
- * $Id$
+ * cpu.h,v 1.2 1995/05/09 20:11:36 joel Exp
*/
#ifndef __CPU_h
@@ -30,7 +30,10 @@
extern "C" {
#endif
-#include <hppa.h> /* pick up machine definitions */
+#include <rtems/hppa.h> /* pick up machine definitions */
+#ifndef ASM
+#include <rtems/hppatypes.h>
+#endif
/* conditional compilation parameters */
diff --git a/c/src/exec/score/cpu/hppa1.1/cpu_asm.h b/c/src/exec/score/cpu/hppa1.1/cpu_asm.h
index 8e480c2a5c..2d40ca2d55 100644
--- a/c/src/exec/score/cpu/hppa1.1/cpu_asm.h
+++ b/c/src/exec/score/cpu/hppa1.1/cpu_asm.h
@@ -19,7 +19,7 @@
*
* Utah $Hdr: asm.h 1.6 91/12/03$
*
- * RTEMS: $Id$
+ * RTEMS: cpu_asm.h,v 1.2 1995/05/09 20:11:39 joel Exp
*/
/*
diff --git a/c/src/exec/score/cpu/hppa1.1/cpu_asm.s b/c/src/exec/score/cpu/hppa1.1/cpu_asm.s
index 43a5bb2499..9e7293d554 100644
--- a/c/src/exec/score/cpu/hppa1.1/cpu_asm.s
+++ b/c/src/exec/score/cpu/hppa1.1/cpu_asm.s
@@ -1,4 +1,4 @@
-# @(#)cpu_asm.S 1.5 - 95/04/24
+# @(#)cpu_asm.S 1.6 - 95/05/16
#
#
# TODO:
@@ -24,7 +24,7 @@
# Division Incorporated makes no representations about the
# suitability of this software for any purpose.
#
-# $Id$
+# cpu_asm.S,v 1.2 1995/05/09 20:11:37 joel Exp
#
#include <rtems/hppa.h>
diff --git a/c/src/exec/score/cpu/hppa1.1/hppa.h b/c/src/exec/score/cpu/hppa1.1/hppa.h
index 8829bb8c87..e7a75e285c 100644
--- a/c/src/exec/score/cpu/hppa1.1/hppa.h
+++ b/c/src/exec/score/cpu/hppa1.1/hppa.h
@@ -1,14 +1,7 @@
/*
- * @(#)hppa.h 1.5 - 95/04/25
+ * @(#)hppa.h 1.7 - 95/05/16
*
*
- * File: $RCSfile$
- * Project: PixelFlow
- * Created: 94/10/4
- * RespEngr: tony bennett
- * Revision: $Revision$
- * Last Mod: $Date$
- *
* Description:
*
* Definitions for HP PA Risc
@@ -31,7 +24,7 @@
* Note:
* This file is included by both C and assembler code ( -DASM )
*
- * $Id$
+ * hppa.h,v 1.2 1995/05/09 20:11:40 joel Exp
*/
#ifndef _INCLUDE_HPPA_H
@@ -48,8 +41,19 @@ extern "C" {
* with the name of the appropriate macro for this target CPU.
*/
+#ifdef hppa1_1
+#undef hppa1_1
+#endif
#define hppa1_1
+
+#ifdef REPLACE_THIS_WITH_THE_CPU_MODEL
+#undef REPLACE_THIS_WITH_THE_CPU_MODEL
+#endif
#define REPLACE_THIS_WITH_THE_CPU_MODEL
+
+#ifdef REPLACE_THIS_WITH_THE_BSP
+#undef REPLACE_THIS_WITH_THE_BSP
+#endif
#define REPLACE_THIS_WITH_THE_BSP
/*
@@ -80,30 +84,6 @@ extern "C" {
#define CPU_NAME "HP PA-RISC 1.1"
-#ifndef ASM
-/*
- * This section defines the basic types for this processor.
- */
-
-typedef unsigned char unsigned8; /* 8-bit unsigned integer */
-typedef unsigned short unsigned16; /* 16-bit unsigned integer */
-typedef unsigned int unsigned32; /* 32-bit unsigned integer */
-typedef unsigned long long unsigned64; /* 64-bit unsigned integer */
-
-typedef unsigned16 Priority_Bit_map_control;
-
-typedef char signed8; /* 8-bit signed integer */
-typedef short signed16; /* 16-bit signed integer */
-typedef int signed32; /* 32-bit signed integer */
-typedef long long signed64; /* 64 bit signed integer */
-
-typedef unsigned32 boolean; /* Boolean value */
-
-typedef float single_precision; /* single precision float */
-typedef double double_precision; /* double precision float */
-
-#endif /* !ASM */
-
/*
* Processor Status Word (PSW) Masks
@@ -230,6 +210,14 @@ typedef double double_precision; /* double precision float */
#define HPPA_INTERRUPT_MAX 64
/*
+ * Cache characteristics
+ */
+
+#define HPPA_CACHELINE_SIZE 32
+#define HPPA_CACHELINE_MASK (HPPA_CACHELINE_SIZE - 1)
+
+
+/*
* Inline macros for misc. interesting opcodes
*/
@@ -520,102 +508,102 @@ typedef double double_precision; /* double precision float */
*/
/* Hardware Space Registers */
-#define SR0 0
-#define SR1 1
-#define SR2 2
-#define SR3 3
-#define SR4 4
-#define SR5 5
-#define SR6 6
-#define SR7 7
+#define HPPA_SR0 0
+#define HPPA_SR1 1
+#define HPPA_SR2 2
+#define HPPA_SR3 3
+#define HPPA_SR4 4
+#define HPPA_SR5 5
+#define HPPA_SR6 6
+#define HPPA_SR7 7
/* Hardware Control Registers */
-#define CR0 0
-#define RCTR 0 /* Recovery Counter Register */
+#define HPPA_CR0 0
+#define HPPA_RCTR 0 /* Recovery Counter Register */
-#define CR8 8 /* Protection ID 1 */
-#define PIDR1 8
+#define HPPA_CR8 8 /* Protection ID 1 */
+#define HPPA_PIDR1 8
-#define CR9 9 /* Protection ID 2 */
-#define PIDR2 9
+#define HPPA_CR9 9 /* Protection ID 2 */
+#define HPPA_PIDR2 9
-#define CR10 10
-#define CCR 10 /* Coprocessor Confiquration Register */
+#define HPPA_CR10 10
+#define HPPA_CCR 10 /* Coprocessor Confiquration Register */
-#define CR11 11
-#define SAR 11 /* Shift Amount Register */
+#define HPPA_CR11 11
+#define HPPA_SAR 11 /* Shift Amount Register */
-#define CR12 12
-#define PIDR3 12 /* Protection ID 3 */
+#define HPPA_CR12 12
+#define HPPA_PIDR3 12 /* Protection ID 3 */
-#define CR13 13
-#define PIDR4 13 /* Protection ID 4 */
+#define HPPA_CR13 13
+#define HPPA_PIDR4 13 /* Protection ID 4 */
-#define CR14 14
-#define IVA 14 /* Interrupt Vector Address */
+#define HPPA_CR14 14
+#define HPPA_IVA 14 /* Interrupt Vector Address */
-#define CR15 15
-#define EIEM 15 /* External Interrupt Enable Mask */
+#define HPPA_CR15 15
+#define HPPA_EIEM 15 /* External Interrupt Enable Mask */
-#define CR16 16
-#define ITMR 16 /* Interval Timer */
+#define HPPA_CR16 16
+#define HPPA_ITMR 16 /* Interval Timer */
-#define CR17 17
-#define PCSQ 17 /* Program Counter Space queue */
+#define HPPA_CR17 17
+#define HPPA_PCSQ 17 /* Program Counter Space queue */
-#define CR18 18
-#define PCOQ 18 /* Program Counter Offset queue */
+#define HPPA_CR18 18
+#define HPPA_PCOQ 18 /* Program Counter Offset queue */
-#define CR19 19
-#define IIR 19 /* Interruption Instruction Register */
+#define HPPA_CR19 19
+#define HPPA_IIR 19 /* Interruption Instruction Register */
-#define CR20 20
-#define ISR 20 /* Interruption Space Register */
+#define HPPA_CR20 20
+#define HPPA_ISR 20 /* Interruption Space Register */
-#define CR21 21
-#define IOR 21 /* Interruption Offset Register */
+#define HPPA_CR21 21
+#define HPPA_IOR 21 /* Interruption Offset Register */
-#define CR22 22
-#define IPSW 22 /* Interrpution Processor Status Word */
+#define HPPA_CR22 22
+#define HPPA_IPSW 22 /* Interrpution Processor Status Word */
-#define CR23 23
-#define EIRR 23 /* External Interrupt Request */
+#define HPPA_CR23 23
+#define HPPA_EIRR 23 /* External Interrupt Request */
-#define CR24 24
-#define PPDA 24 /* Physcial Page Directory Address */
-#define TR0 24 /* Temporary register 0 */
+#define HPPA_CR24 24
+#define HPPA_PPDA 24 /* Physcial Page Directory Address */
+#define HPPA_TR0 24 /* Temporary register 0 */
-#define CR25 25
-#define HTA 25 /* Hash Table Address */
-#define TR1 25 /* Temporary register 1 */
+#define HPPA_CR25 25
+#define HPPA_HTA 25 /* Hash Table Address */
+#define HPPA_TR1 25 /* Temporary register 1 */
-#define CR26 26
-#define TR2 26 /* Temporary register 2 */
+#define HPPA_CR26 26
+#define HPPA_TR2 26 /* Temporary register 2 */
-#define CR27 27
-#define TR3 27 /* Temporary register 3 */
+#define HPPA_CR27 27
+#define HPPA_TR3 27 /* Temporary register 3 */
-#define CR28 28
-#define TR4 28 /* Temporary register 4 */
+#define HPPA_CR28 28
+#define HPPA_TR4 28 /* Temporary register 4 */
-#define CR29 29
-#define TR5 29 /* Temporary register 5 */
+#define HPPA_CR29 29
+#define HPPA_TR5 29 /* Temporary register 5 */
-#define CR30 30
-#define TR6 30 /* Temporary register 6 */
+#define HPPA_CR30 30
+#define HPPA_TR6 30 /* Temporary register 6 */
-#define CR31 31
-#define CPUID 31 /* MP identifier */
+#define HPPA_CR31 31
+#define HPPA_CPUID 31 /* MP identifier */
/*
* Diagnose registers
*/
-#define DR0 0
-#define DR1 1
-#define DR8 8
-#define DR24 24
-#define DR25 25
+#define HPPA_DR0 0
+#define HPPA_DR1 1
+#define HPPA_DR8 8
+#define HPPA_DR24 24
+#define HPPA_DR25 25
/*
* Tear apart a break instruction to find its type.
@@ -653,32 +641,32 @@ set_ ## name (unsigned int new_value) \
EMIT_GET_CONTROL(name, reg) \
EMIT_SET_CONTROL(name, reg)
-EMIT_CONTROLS(recovery, RCTR); /* CR0 */
-EMIT_CONTROLS(pid1, PIDR1); /* CR8 */
-EMIT_CONTROLS(pid2, PIDR2); /* CR9 */
-EMIT_CONTROLS(ccr, CCR); /* CR10; CCR and SCR share CR10 */
-EMIT_CONTROLS(scr, CCR); /* CR10; CCR and SCR share CR10 */
-EMIT_CONTROLS(sar, SAR); /* CR11 */
-EMIT_CONTROLS(pid3, PIDR3); /* CR12 */
-EMIT_CONTROLS(pid4, PIDR4); /* CR13 */
-EMIT_CONTROLS(iva, IVA); /* CR14 */
-EMIT_CONTROLS(eiem, EIEM); /* CR15 */
-EMIT_CONTROLS(itimer, ITMR); /* CR16 */
-EMIT_CONTROLS(pcsq, PCSQ); /* CR17 */
-EMIT_CONTROLS(pcoq, PCOQ); /* CR18 */
-EMIT_CONTROLS(iir, IIR); /* CR19 */
-EMIT_CONTROLS(isr, ISR); /* CR20 */
-EMIT_CONTROLS(ior, IOR); /* CR21 */
-EMIT_CONTROLS(ipsw, IPSW); /* CR22 */
-EMIT_CONTROLS(eirr, EIRR); /* CR23 */
-EMIT_CONTROLS(tr0, TR0); /* CR24 */
-EMIT_CONTROLS(tr1, TR1); /* CR25 */
-EMIT_CONTROLS(tr2, TR2); /* CR26 */
-EMIT_CONTROLS(tr3, TR3); /* CR27 */
-EMIT_CONTROLS(tr4, TR4); /* CR28 */
-EMIT_CONTROLS(tr5, TR5); /* CR29 */
-EMIT_CONTROLS(tr6, TR6); /* CR30 */
-EMIT_CONTROLS(tr7, CR31); /* CR31 */
+EMIT_CONTROLS(recovery, HPPA_RCTR); /* CR0 */
+EMIT_CONTROLS(pid1, HPPA_PIDR1); /* CR8 */
+EMIT_CONTROLS(pid2, HPPA_PIDR2); /* CR9 */
+EMIT_CONTROLS(ccr, HPPA_CCR); /* CR10; CCR and SCR share CR10 */
+EMIT_CONTROLS(scr, HPPA_CCR); /* CR10; CCR and SCR share CR10 */
+EMIT_CONTROLS(sar, HPPA_SAR); /* CR11 */
+EMIT_CONTROLS(pid3, HPPA_PIDR3); /* CR12 */
+EMIT_CONTROLS(pid4, HPPA_PIDR4); /* CR13 */
+EMIT_CONTROLS(iva, HPPA_IVA); /* CR14 */
+EMIT_CONTROLS(eiem, HPPA_EIEM); /* CR15 */
+EMIT_CONTROLS(itimer, HPPA_ITMR); /* CR16 */
+EMIT_CONTROLS(pcsq, HPPA_PCSQ); /* CR17 */
+EMIT_CONTROLS(pcoq, HPPA_PCOQ); /* CR18 */
+EMIT_CONTROLS(iir, HPPA_IIR); /* CR19 */
+EMIT_CONTROLS(isr, HPPA_ISR); /* CR20 */
+EMIT_CONTROLS(ior, HPPA_IOR); /* CR21 */
+EMIT_CONTROLS(ipsw, HPPA_IPSW); /* CR22 */
+EMIT_CONTROLS(eirr, HPPA_EIRR); /* CR23 */
+EMIT_CONTROLS(tr0, HPPA_TR0); /* CR24 */
+EMIT_CONTROLS(tr1, HPPA_TR1); /* CR25 */
+EMIT_CONTROLS(tr2, HPPA_TR2); /* CR26 */
+EMIT_CONTROLS(tr3, HPPA_TR3); /* CR27 */
+EMIT_CONTROLS(tr4, HPPA_TR4); /* CR28 */
+EMIT_CONTROLS(tr5, HPPA_TR5); /* CR29 */
+EMIT_CONTROLS(tr6, HPPA_TR6); /* CR30 */
+EMIT_CONTROLS(tr7, HPPA_CR31); /* CR31 */
/*
* If and How to invoke the debugger (a ROM debugger generally)
diff --git a/c/src/exec/score/cpu/hppa1.1/rtems.s b/c/src/exec/score/cpu/hppa1.1/rtems.s
index dd215c9af0..be8a5e8c1e 100644
--- a/c/src/exec/score/cpu/hppa1.1/rtems.s
+++ b/c/src/exec/score/cpu/hppa1.1/rtems.s
@@ -11,10 +11,10 @@
* to the copyright license under the clause at DFARS 252.227-7013. This
* notice must appear in all copies of this file and its derivatives.
*
- * $Id$
+ * rtems.S,v 1.2 1995/05/09 20:11:41 joel Exp
*/
-#include <hppa.h>
+#include <rtems/hppa.h>
#include <rtems/cpu_asm.h>
.SPACE $PRIVATE$
diff --git a/c/src/exec/score/cpu/i386/asm.h b/c/src/exec/score/cpu/i386/asm.h
index f123defcd9..16cf6c3235 100644
--- a/c/src/exec/score/cpu/i386/asm.h
+++ b/c/src/exec/score/cpu/i386/asm.h
@@ -31,7 +31,7 @@
*/
#define ASM
-#include <i386.h>
+#include <rtems/i386.h>
/*
* Recent versions of GNU cpp define variables which indicate the
diff --git a/c/src/exec/score/cpu/i386/cpu.h b/c/src/exec/score/cpu/i386/cpu.h
index a66cb37abc..04518e1daf 100644
--- a/c/src/exec/score/cpu/i386/cpu.h
+++ b/c/src/exec/score/cpu/i386/cpu.h
@@ -21,7 +21,10 @@
extern "C" {
#endif
-#include <i386.h>
+#ifndef ASM
+#include <rtems/i386types.h>
+#endif
+#include <rtems/i386.h>
/* conditional compilation parameters */
diff --git a/c/src/exec/score/cpu/i386/i386.h b/c/src/exec/score/cpu/i386/i386.h
index a8db759984..f85f0777cf 100644
--- a/c/src/exec/score/cpu/i386/i386.h
+++ b/c/src/exec/score/cpu/i386/i386.h
@@ -28,8 +28,19 @@ extern "C" {
* with the name of the appropriate macro for this target CPU.
*/
+#ifdef i386
+#undef i386
+#endif
#define i386
+
+#ifdef REPLACE_THIS_WITH_THE_CPU_MODEL
+#undef REPLACE_THIS_WITH_THE_CPU_MODEL
+#endif
#define REPLACE_THIS_WITH_THE_CPU_MODEL
+
+#ifdef REPLACE_THIS_WITH_THE_BSP
+#undef REPLACE_THIS_WITH_THE_BSP
+#endif
#define REPLACE_THIS_WITH_THE_BSP
/*
@@ -92,37 +103,16 @@ extern "C" {
#ifndef ASM
/*
- * This section defines the basic types for this processor.
- */
-
-typedef unsigned char unsigned8; /* 8-bit unsigned integer */
-typedef unsigned short unsigned16; /* 16-bit unsigned integer */
-typedef unsigned int unsigned32; /* 32-bit unsigned integer */
-typedef unsigned long long unsigned64; /* 64-bit unsigned integer */
-
-typedef unsigned16 Priority_Bit_map_control;
-
-typedef unsigned char signed8; /* 8-bit signed integer */
-typedef unsigned short signed16; /* 16-bit signed integer */
-typedef unsigned int signed32; /* 32-bit signed integer */
-typedef long long signed64; /* 64-bit signed integer */
-
-typedef unsigned32 boolean; /* Boolean value */
-
-typedef float single_precision; /* single precision float */
-typedef double double_precision; /* double precision float */
-
-/*
* Structure which makes it easier to deal with LxDT and SxDT instructions.
*/
-
+
typedef struct {
unsigned short limit;
unsigned short physical_address[ 2 ];
} i386_DTR_load_save_format;
-
+
/* See Chapter 5 - Memory Management in i386 manual */
-
+
typedef struct {
unsigned short limit_0_15;
unsigned short base_0_15;
@@ -131,12 +121,12 @@ typedef struct {
unsigned char limit_16_19_granularity;
unsigned char base_24_31;
} i386_GDT_slot;
-
+
/* See Chapter 9 - Exceptions and Interrupts in i386 manual
*
* NOTE: This is the IDT entry for interrupt gates ONLY.
*/
-
+
typedef struct {
unsigned short offset_0_15;
unsigned short segment_selector;
@@ -145,7 +135,9 @@ typedef struct {
unsigned short offset_16_31;
} i386_IDT_slot;
-typedef void ( *i386_isr )( void );
+/*
+ * Interrupt Level Macros
+ */
#define i386_disable_interrupts( _level ) \
{ \
@@ -186,7 +178,6 @@ static inline unsigned int i386_swap_U32(
asm volatile( "rorw $8,%%ax;"
"rorl $16,%0;"
"rorw $8,%%ax" : "=a" (value) : "0" (value) );
-
return( value );
}
diff --git a/c/src/exec/score/cpu/i960/asm.h b/c/src/exec/score/cpu/i960/asm.h
index 1c40601473..e8fc986402 100644
--- a/c/src/exec/score/cpu/i960/asm.h
+++ b/c/src/exec/score/cpu/i960/asm.h
@@ -31,7 +31,7 @@
*/
#define ASM
-#include <i960.h>
+#include <rtems/i960.h>
/*
* Recent versions of GNU cpp define variables which indicate the
diff --git a/c/src/exec/score/cpu/i960/cpu.h b/c/src/exec/score/cpu/i960/cpu.h
index 71a3341702..3d48d32672 100644
--- a/c/src/exec/score/cpu/i960/cpu.h
+++ b/c/src/exec/score/cpu/i960/cpu.h
@@ -23,7 +23,10 @@ extern "C" {
#pragma align 4 /* for GNU C structure alignment */
-#include <i960.h>
+#include <rtems/i960.h>
+#ifndef ASM
+#include <rtems/i960types.h>
+#endif
#define CPU_INLINE_ENABLE_DISPATCH FALSE
#define CPU_UNROLL_ENQUEUE_PRIORITY FALSE
diff --git a/c/src/exec/score/cpu/i960/i960.h b/c/src/exec/score/cpu/i960/i960.h
index fe7e68e95f..53b99f469a 100644
--- a/c/src/exec/score/cpu/i960/i960.h
+++ b/c/src/exec/score/cpu/i960/i960.h
@@ -28,8 +28,19 @@ extern "C" {
* with the name of the appropriate macro for this target CPU.
*/
+#ifdef i960
+#undef i960
+#endif
#define i960
+
+#ifdef REPLACE_THIS_WITH_THE_CPU_MODEL
+#undef REPLACE_THIS_WITH_THE_CPU_MODEL
+#endif
#define REPLACE_THIS_WITH_THE_CPU_MODEL
+
+#ifdef REPLACE_THIS_WITH_THE_BSP
+#undef REPLACE_THIS_WITH_THE_BSP
+#endif
#define REPLACE_THIS_WITH_THE_BSP
/*
@@ -63,37 +74,16 @@ extern "C" {
#ifndef ASM
/*
- * This section defines the basic types for this processor.
- */
-
-typedef unsigned char unsigned8; /* 8-bit unsigned integer */
-typedef unsigned short unsigned16; /* 16-bit unsigned integer */
-typedef unsigned int unsigned32; /* 32-bit unsigned integer */
-typedef unsigned long long unsigned64; /* 64-bit unsigned integer */
-
-typedef unsigned32 Priority_Bit_map_control;
-
-typedef char signed8; /* 8-bit signed integer */
-typedef short signed16; /* 16-bit signed integer */
-typedef int signed32; /* 32-bit signed integer */
-typedef long long signed64; /* 64-bit signed integer */
-
-typedef unsigned32 boolean; /* Boolean value */
-
-typedef float single_precision; /* single precision float */
-typedef double double_precision; /* double precision float */
-
-/*
* XXX should have an ifdef here and have stuff for the other
* XXX family members...
*/
-
+
#if defined(__i960CA__) || defined(__i960_CA__) || defined(__i960CA)
-
+
/* i960CA control structures */
-
+
/* Intel i960CA Control Table */
-
+
typedef struct {
/* Control Group 0 */
unsigned int ipb0; /* IP breakpoint 0 */
@@ -131,9 +121,9 @@ typedef struct {
unsigned int bcon; /* bus configuration control */
unsigned int reserved; /* reserved */
} i960ca_control_table;
-
+
/* Intel i960CA Processor Control Block */
-
+
typedef struct {
unsigned int *fault_tbl; /* fault table base address */
i960ca_control_table
@@ -149,10 +139,12 @@ typedef struct {
configuration word */
unsigned int reg_cache_cfg; /* register cache configuration word */
} i960ca_PRCB;
-
+
#endif
-typedef void ( *i960_isr )( void );
+/*
+ * Interrupt Level Routines
+ */
#define i960_disable_interrupts( oldlevel ) \
{ (oldlevel) = 0x1f0000; \
@@ -191,22 +183,22 @@ typedef void ( *i960_isr )( void );
i960_atomic_modify( _mask, _address, _previous )
#define i960_enable_tracing() \
- { register unsigned32 _pc = 0x1; \
+ { register unsigned int _pc = 0x1; \
asm volatile( "modpc 0,%0,%0" : "=d" (_pc) : "0" (_pc) ); \
}
#define i960_unmask_intr( xint ) \
- { register unsigned32 _mask= (1<<(xint)); \
+ { register unsigned int _mask= (1<<(xint)); \
asm volatile( "or sf1,%0,sf1" : "=d" (_mask) : "0" (_mask) ); \
}
#define i960_mask_intr( xint ) \
- { register unsigned32 _mask= (1<<(xint)); \
+ { register unsigned int _mask= (1<<(xint)); \
asm volatile( "andnot %0,sf1,sf1" : "=d" (_mask) : "0" (_mask) ); \
}
#define i960_clear_intr( xint ) \
- { register unsigned32 _xint=(xint); \
+ { register unsigned int _xint=(xint); \
asm volatile( "loop_til_cleared:
clrbit %0,sf0,sf0 ; \
bbs %0,sf0,loop_til_cleared" \
@@ -225,8 +217,8 @@ typedef void ( *i960_isr )( void );
#define i960_soft_reset( prcb ) \
{ register i960ca_PRCB *_prcb = (prcb); \
- register unsigned32 *_next=0; \
- register unsigned32 _cmd = 0x30000; \
+ register unsigned int *_next=0; \
+ register unsigned int _cmd = 0x30000; \
asm volatile( "lda next,%1; \
sysctl %0,%1,%2; \
next: mov g0,g0" \
@@ -234,20 +226,20 @@ typedef void ( *i960_isr )( void );
: "0" (_cmd), "1" (_next), "2" (_prcb) ); \
}
-static inline unsigned32 i960_pend_intrs()
-{ register unsigned32 _intr=0;
+static inline unsigned int i960_pend_intrs()
+{ register unsigned int _intr=0;
asm volatile( "mov sf0,%0" : "=d" (_intr) : "0" (_intr) );
return ( _intr );
}
-static inline unsigned32 i960_mask_intrs()
-{ register unsigned32 _intr=0;
+static inline unsigned int i960_mask_intrs()
+{ register unsigned int _intr=0;
asm volatile( "mov sf1,%0" : "=d" (_intr) : "0" (_intr) );
return( _intr );
}
-static inline unsigned32 i960_get_fp()
-{ register unsigned32 _fp=0;
+static inline unsigned int i960_get_fp()
+{ register unsigned int _fp=0;
asm volatile( "mov fp,%0" : "=d" (_fp) : "0" (_fp) );
return ( _fp );
}
diff --git a/c/src/exec/score/cpu/m68k/asm.h b/c/src/exec/score/cpu/m68k/asm.h
index 068c58058c..58bb04bdf9 100644
--- a/c/src/exec/score/cpu/m68k/asm.h
+++ b/c/src/exec/score/cpu/m68k/asm.h
@@ -31,7 +31,7 @@
*/
#define ASM
-#include <m68k.h>
+#include <rtems/m68k.h>
/*
* Recent versions of GNU cpp define variables which indicate the
diff --git a/c/src/exec/score/cpu/m68k/cpu.h b/c/src/exec/score/cpu/m68k/cpu.h
index a1dd27db57..38bd16e0c3 100644
--- a/c/src/exec/score/cpu/m68k/cpu.h
+++ b/c/src/exec/score/cpu/m68k/cpu.h
@@ -30,7 +30,10 @@ extern "C" {
#define NO_UNINITIALIZED_WARNINGS
-#include <m68k.h>
+#include <rtems/m68k.h>
+#ifndef ASM
+#include <rtems/m68ktypes.h>
+#endif
/* conditional compilation parameters */
diff --git a/c/src/exec/score/cpu/m68k/m68k.h b/c/src/exec/score/cpu/m68k/m68k.h
index 3a62b7553b..b86db286cb 100644
--- a/c/src/exec/score/cpu/m68k/m68k.h
+++ b/c/src/exec/score/cpu/m68k/m68k.h
@@ -28,8 +28,19 @@ extern "C" {
* with the name of the appropriate macro for this target CPU.
*/
+#ifdef m68k
+#undef m68k
+#endif
#define m68k
+
+#ifdef REPLACE_THIS_WITH_THE_CPU_MODEL
+#undef REPLACE_THIS_WITH_THE_CPU_MODEL
+#endif
#define REPLACE_THIS_WITH_THE_CPU_MODEL
+
+#ifdef REPLACE_THIS_WITH_THE_BSP
+#undef REPLACE_THIS_WITH_THE_BSP
+#endif
#define REPLACE_THIS_WITH_THE_BSP
/*
@@ -151,33 +162,6 @@ extern "C" {
#ifndef ASM
-/*
- * This section defines the basic types for this processor.
- */
-
-typedef unsigned char unsigned8; /* unsigned 8-bit integer */
-typedef unsigned short unsigned16; /* unsigned 16-bit integer */
-typedef unsigned int unsigned32; /* unsigned 32-bit integer */
-typedef unsigned long long unsigned64; /* unsigned 64-bit integer */
-
-typedef unsigned16 Priority_Bit_map_control;
-
-typedef char signed8; /* signed 8-bit integer */
-typedef short signed16; /* signed 16-bit integer */
-typedef int signed32; /* signed 32-bit integer */
-typedef long long signed64; /* signed 64-bit integer */
-
-typedef unsigned32 boolean; /* Boolean value */
-
-typedef float single_precision; /* single precision float */
-typedef double double_precision; /* double precision float */
-
-/*
- *
- */
-
-typedef void ( *m68k_isr )( void );
-
#ifdef NO_UNINITIALIZED_WARNINGS
#define m68k_disable_interrupts( _level ) \
{ \
diff --git a/c/src/exec/score/cpu/no_cpu/asm.h b/c/src/exec/score/cpu/no_cpu/asm.h
index 69b1f0f825..97464d5b3a 100644
--- a/c/src/exec/score/cpu/no_cpu/asm.h
+++ b/c/src/exec/score/cpu/no_cpu/asm.h
@@ -31,7 +31,7 @@
*/
#define ASM
-#include <no_cpu.h>
+#include <rtems/no_cpu.h>
/*
* Recent versions of GNU cpp define variables which indicate the
diff --git a/c/src/exec/score/cpu/no_cpu/cpu.h b/c/src/exec/score/cpu/no_cpu/cpu.h
index cf38b64a4d..5bd0f69c8c 100644
--- a/c/src/exec/score/cpu/no_cpu/cpu.h
+++ b/c/src/exec/score/cpu/no_cpu/cpu.h
@@ -21,7 +21,10 @@
extern "C" {
#endif
-#include <no_cpu.h> /* pick up machine definitions */
+#include <rtems/no_cpu.h> /* pick up machine definitions */
+#ifndef ASM
+#include <rtems/no_cputypes.h>
+#endif
/* conditional compilation parameters */
diff --git a/c/src/exec/score/cpu/no_cpu/no_cpu.h b/c/src/exec/score/cpu/no_cpu/no_cpu.h
index ec973dadcf..465c45f7b0 100644
--- a/c/src/exec/score/cpu/no_cpu/no_cpu.h
+++ b/c/src/exec/score/cpu/no_cpu/no_cpu.h
@@ -1,4 +1,7 @@
-/*
+/* no_cpu.h
+ *
+ * This file is an example (i.e. "no CPU") of the file which is
+ * created for each CPU family port of RTEMS.
*
*
* COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
@@ -26,9 +29,21 @@ extern "C" {
* with the name of the appropriate macro for this target CPU.
*/
+#ifdef no_cpu
+#undef no_cpu
+#endif
#define no_cpu
+
+#ifdef REPLACE_THIS_WITH_THE_CPU_MODEL
+#undef REPLACE_THIS_WITH_THE_CPU_MODEL
+#endif
#define REPLACE_THIS_WITH_THE_CPU_MODEL
+#ifdef REPLACE_THIS_WITH_THE_BSP
+#undef REPLACE_THIS_WITH_THE_BSP
+#endif
+#define REPLACE_THIS_WITH_THE_BSP
+
/*
* This file contains the information required to build
* RTEMS for a particular member of the "no cpu"
@@ -55,29 +70,6 @@ extern "C" {
#define CPU_NAME "NO CPU"
-/*
- * This section defines the basic types for this processor.
- */
-
-typedef unsigned char unsigned8; /* 8-bit unsigned integer */
-typedef unsigned short unsigned16; /* 16-bit unsigned integer */
-typedef unsigned int unsigned32; /* 32-bit unsigned integer */
-typedef unsigned long long unsigned64; /* 64-bit unsigned integer */
-
-typedef unsigned16 Priority_Bit_map_control;
-
-typedef char signed8; /* 8-bit signed integer */
-typedef short signed16; /* 16-bit signed integer */
-typedef int signed32; /* 32-bit signed integer */
-typedef long long signed64; /* 64-bit signed integer */
-
-typedef unsigned32 boolean; /* Boolean value */
-
-typedef float single_precision; /* single precision float */
-typedef double double_precision; /* double precision float */
-
-typedef void ( *no_cpu_isr_entry )( void );
-
#ifdef __cplusplus
}
#endif
diff --git a/c/src/exec/score/cpu/unix/cpu.c b/c/src/exec/score/cpu/unix/cpu.c
index ed94953d58..68397a4e29 100644
--- a/c/src/exec/score/cpu/unix/cpu.c
+++ b/c/src/exec/score/cpu/unix/cpu.c
@@ -35,7 +35,6 @@
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
-#include <string.h>
#include <signal.h>
#include <time.h>
@@ -225,18 +224,28 @@ void _CPU_Context_Initialize(
unsigned32 *_stack_base,
unsigned32 _size,
unsigned32 _new_level,
- proc_ptr *_entry_point
+ void *_entry_point
)
{
unsigned32 *addr;
unsigned32 jmp_addr;
- unsigned32 _stack;
+ unsigned32 _stack_low; /* lowest "stack aligned" address */
+ unsigned32 _stack_high; /* highest "stack aligned" address */
unsigned32 _the_size;
jmp_addr = (unsigned32) _entry_point;
- _stack = ((unsigned32)(_stack_base) + CPU_STACK_ALIGNMENT);
- _stack &= ~(CPU_STACK_ALIGNMENT - 1);
+ /*
+ * On CPUs with stacks which grow down, we build the stack
+ * based on the _stack_high address. On CPUs with stacks which
+ * grow up, we build the stack based on the _stack_low address.
+ */
+
+ _stack_low = ((unsigned32)(_stack_base) + CPU_STACK_ALIGNMENT);
+ _stack_low &= ~(CPU_STACK_ALIGNMENT - 1);
+
+ _stack_high = ((unsigned32)(_stack_base) + _size);
+ _stack_high &= ~(CPU_STACK_ALIGNMENT - 1);
_the_size = _size & ~(CPU_STACK_ALIGNMENT - 1);
@@ -250,7 +259,7 @@ void _CPU_Context_Initialize(
#if defined(hppa1_1)
*(addr + RP_OFF) = jmp_addr;
- *(addr + SP_OFF) = (unsigned32)(_stack + CPU_FRAME_SIZE);
+ *(addr + SP_OFF) = (unsigned32)(_stack_low + CPU_FRAME_SIZE);
/*
* See if we are using shared libraries by checking
@@ -274,8 +283,8 @@ void _CPU_Context_Initialize(
asm ("ta 0x03"); /* flush registers */
*(addr + RP_OFF) = jmp_addr + ADDR_ADJ_OFFSET;
- *(addr + SP_OFF) = (unsigned32)(_stack +_the_size - CPU_FRAME_SIZE);
- *(addr + FP_OFF) = (unsigned32)(_stack +_the_size);
+ *(addr + SP_OFF) = (unsigned32)(_stack_high - CPU_FRAME_SIZE);
+ *(addr + FP_OFF) = (unsigned32)(_stack_high);
#else
#error "UNKNOWN CPU!!!"
#endif
diff --git a/c/src/exec/score/cpu/unix/cpu.h b/c/src/exec/score/cpu/unix/cpu.h
index e6b29bcd74..4a016e5879 100644
--- a/c/src/exec/score/cpu/unix/cpu.h
+++ b/c/src/exec/score/cpu/unix/cpu.h
@@ -27,8 +27,10 @@ extern "C" {
#endif
#include <setjmp.h>
-#include <string.h>
-#include <unix.h>
+#include <rtems/unix.h>
+#ifndef ASM
+#include <rtems/unixtypes.h>
+#endif
/* conditional compilation parameters */
@@ -676,7 +678,7 @@ extern void _CPU_Context_Initialize(
unsigned32 *_stack_base,
unsigned32 _size,
unsigned32 _new_level,
- proc_ptr *_entry_point
+ void *_entry_point
);
/* end of Context handler macros */
diff --git a/c/src/exec/score/cpu/unix/unix.h b/c/src/exec/score/cpu/unix/unix.h
index 823bbcfb34..10c4b6917c 100644
--- a/c/src/exec/score/cpu/unix/unix.h
+++ b/c/src/exec/score/cpu/unix/unix.h
@@ -1,6 +1,6 @@
/* unix.h
*
- * This include file contains the basic type definitions required by RTEMS
+ * This include file contains the definitions required by RTEMS
* which are typical for a modern UNIX computer using GCC.
*
* COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
@@ -11,7 +11,7 @@
* to the copyright license under the clause at DFARS 252.227-7013. This
* notice must appear in all copies of this file and its derivatives.
*
- * $Id$
+ * unix.h,v 1.2 1995/05/09 20:12:28 joel Exp
*/
#ifndef __UNIX_h
@@ -28,12 +28,31 @@ extern "C" {
* with the name of the appropriate macro for this target CPU.
*/
+#ifdef unix
+#undef unix
+#endif
#define unix
+
+#ifdef REPLACE_THIS_WITH_THE_CPU_FAMILY
+#undef REPLACE_THIS_WITH_THE_CPU_FAMILY
+#endif
#define REPLACE_THIS_WITH_THE_CPU_FAMILY
+
+#ifdef REPLACE_THIS_WITH_THE_BSP
+#undef REPLACE_THIS_WITH_THE_BSP
+#endif
#define REPLACE_THIS_WITH_THE_BSP
+
+#ifdef REPLACE_THIS_WITH_THE_CPU_MODEL
+#undef REPLACE_THIS_WITH_THE_CPU_MODEL
+#endif
#define REPLACE_THIS_WITH_THE_CPU_MODEL
+
+#ifdef REPLACE_THIS_WITH_THE_UNIX_FLAVOR
+#undef REPLACE_THIS_WITH_THE_UNIX_FLAVOR
+#endif
#define REPLACE_THIS_WITH_THE_UNIX_FLAVOR
-
+
/*
* This file contains the information required to build
* RTEMS for a particular member of the "unix"
@@ -57,34 +76,10 @@ extern "C" {
#endif
-#ifndef ASM
-
-/* type definitions */
-
-typedef unsigned char unsigned8; /* 8-bit unsigned integer */
-typedef unsigned short unsigned16; /* 16-bit unsigned integer */
-typedef unsigned int unsigned32; /* 32-bit unsigned integer */
-typedef unsigned long long unsigned64; /* 64-bit unsigned integer */
-
-typedef unsigned16 Priority_Bit_map_control;
-
-typedef char signed8; /* 8-bit signed integer */
-typedef short signed16; /* 16-bit signed integer */
-typedef int signed32; /* 32-bit signed integer */
-typedef long long signed64; /* 64-bit signed integer */
-
-typedef unsigned32 boolean; /* Boolean value */
-
-typedef float single_precision; /* single precision float */
-typedef double double_precision; /* double precision float */
-
-typedef void ( *unix_isr_entry )( void );
-
#ifdef __cplusplus
}
#endif
-#endif /* !ASM */
#endif
/* end of include file */
diff --git a/c/src/exec/score/headers/watchdog.h b/c/src/exec/score/headers/watchdog.h
index 5c897615f7..c7665bfea2 100644
--- a/c/src/exec/score/headers/watchdog.h
+++ b/c/src/exec/score/headers/watchdog.h
@@ -100,17 +100,12 @@ typedef struct {
} Watchdog_Control;
/*
- * The following type is used for synchronization purposes
+ * The following are used for synchronization purposes
* during an insert on a watchdog delta chain.
- *
- * NOTE: Watchdog_Pointer is only used to insure that
- * Watchdog_Synchronization_pointer is a pointer
- * which is volatile rather than a pointer to a
- * volatile block of memory.
*/
-typedef Watchdog_Control *Watchdog_Pointer;
-typedef volatile Watchdog_Pointer Watchdog_Synchronization_pointer;
+volatile unsigned32 _Watchdog_Sync_level;
+volatile unsigned32 _Watchdog_Sync_count;
/*
* The following defines the watchdog chains which are managed
@@ -121,14 +116,6 @@ EXTERN Chain_Control _Watchdog_Ticks_chain;
EXTERN Chain_Control _Watchdog_Seconds_chain;
/*
- * The following defines the synchronization variable used to
- * allow interrupts to be enabled while inserting a watchdog
- * on a watchdog chain.
- */
-
-EXTERN Watchdog_Synchronization_pointer _Watchdog_Sync;
-
-/*
* _Watchdog_Handler_initialization
*
* DESCRIPTION:
@@ -376,46 +363,6 @@ STATIC INLINE Watchdog_Control *_Watchdog_Last(
);
/*
- *
- * _Watchdog_Get_sync
- *
- * DESCRIPTION:
- *
- * This routine returns the current synchronization timer. This
- * routine is used so that interrupts can be enabled while a
- * watchdog timer is being inserted into a watchdog chain.
- */
-
-STATIC INLINE Watchdog_Control *_Watchdog_Get_sync( void );
-
-/*
- *
- * _Watchdog_Set_sync
- *
- * DESCRIPTION:
- *
- * This routine sets the current synchronization timer. This
- * routine is used so that interrupts can be enabled while a
- * watchdog timer is being inserted into a watchdog chain.
- */
-
-STATIC INLINE void _Watchdog_Set_sync(
- Watchdog_Control *the_watchdog
-);
-
-/*
- *
- * _Watchdog_Clear_sync
- *
- * DESCRIPTION:
- *
- * This routine will set the watchdog synchronization flag to a
- * NULL address indicating synchronization is unnecessary.
- */
-
-STATIC INLINE void _Watchdog_Clear_sync( void );
-
-/*
* _Watchdog_Adjust
*
* DESCRIPTION:
@@ -427,7 +374,7 @@ STATIC INLINE void _Watchdog_Clear_sync( void );
void _Watchdog_Adjust (
Chain_Control *header,
Watchdog_Adjust_directions direction,
- rtems_interval units
+ rtems_interval units
);
/*
diff --git a/c/src/exec/score/include/rtems/score/watchdog.h b/c/src/exec/score/include/rtems/score/watchdog.h
index 5c897615f7..c7665bfea2 100644
--- a/c/src/exec/score/include/rtems/score/watchdog.h
+++ b/c/src/exec/score/include/rtems/score/watchdog.h
@@ -100,17 +100,12 @@ typedef struct {
} Watchdog_Control;
/*
- * The following type is used for synchronization purposes
+ * The following are used for synchronization purposes
* during an insert on a watchdog delta chain.
- *
- * NOTE: Watchdog_Pointer is only used to insure that
- * Watchdog_Synchronization_pointer is a pointer
- * which is volatile rather than a pointer to a
- * volatile block of memory.
*/
-typedef Watchdog_Control *Watchdog_Pointer;
-typedef volatile Watchdog_Pointer Watchdog_Synchronization_pointer;
+volatile unsigned32 _Watchdog_Sync_level;
+volatile unsigned32 _Watchdog_Sync_count;
/*
* The following defines the watchdog chains which are managed
@@ -121,14 +116,6 @@ EXTERN Chain_Control _Watchdog_Ticks_chain;
EXTERN Chain_Control _Watchdog_Seconds_chain;
/*
- * The following defines the synchronization variable used to
- * allow interrupts to be enabled while inserting a watchdog
- * on a watchdog chain.
- */
-
-EXTERN Watchdog_Synchronization_pointer _Watchdog_Sync;
-
-/*
* _Watchdog_Handler_initialization
*
* DESCRIPTION:
@@ -376,46 +363,6 @@ STATIC INLINE Watchdog_Control *_Watchdog_Last(
);
/*
- *
- * _Watchdog_Get_sync
- *
- * DESCRIPTION:
- *
- * This routine returns the current synchronization timer. This
- * routine is used so that interrupts can be enabled while a
- * watchdog timer is being inserted into a watchdog chain.
- */
-
-STATIC INLINE Watchdog_Control *_Watchdog_Get_sync( void );
-
-/*
- *
- * _Watchdog_Set_sync
- *
- * DESCRIPTION:
- *
- * This routine sets the current synchronization timer. This
- * routine is used so that interrupts can be enabled while a
- * watchdog timer is being inserted into a watchdog chain.
- */
-
-STATIC INLINE void _Watchdog_Set_sync(
- Watchdog_Control *the_watchdog
-);
-
-/*
- *
- * _Watchdog_Clear_sync
- *
- * DESCRIPTION:
- *
- * This routine will set the watchdog synchronization flag to a
- * NULL address indicating synchronization is unnecessary.
- */
-
-STATIC INLINE void _Watchdog_Clear_sync( void );
-
-/*
* _Watchdog_Adjust
*
* DESCRIPTION:
@@ -427,7 +374,7 @@ STATIC INLINE void _Watchdog_Clear_sync( void );
void _Watchdog_Adjust (
Chain_Control *header,
Watchdog_Adjust_directions direction,
- rtems_interval units
+ rtems_interval units
);
/*
diff --git a/c/src/exec/score/inline/rtems/score/watchdog.inl b/c/src/exec/score/inline/rtems/score/watchdog.inl
index d5d12cbeef..2e7dca0381 100644
--- a/c/src/exec/score/inline/rtems/score/watchdog.inl
+++ b/c/src/exec/score/inline/rtems/score/watchdog.inl
@@ -257,40 +257,5 @@ STATIC INLINE Watchdog_Control *_Watchdog_Last(
}
-/*PAGE
- *
- * _Watchdog_Get_sync
- *
- */
-
-STATIC INLINE Watchdog_Control *_Watchdog_Get_sync( void )
-{
- return (Watchdog_Control *) _Watchdog_Sync;
-}
-
-/*PAGE
- *
- * _Watchdog_Set_sync
- *
- */
-
-STATIC INLINE void _Watchdog_Set_sync(
- Watchdog_Control *the_watchdog
-)
-{
- _Watchdog_Sync = (Watchdog_Synchronization_pointer) the_watchdog;
-}
-
-/*PAGE
- *
- * _Watchdog_Clear_sync
- *
- */
-
-STATIC INLINE void _Watchdog_Clear_sync( void )
-{
- _Watchdog_Sync = NULL;
-}
-
#endif
/* end of include file */
diff --git a/c/src/exec/score/inline/watchdog.inl b/c/src/exec/score/inline/watchdog.inl
index d5d12cbeef..2e7dca0381 100644
--- a/c/src/exec/score/inline/watchdog.inl
+++ b/c/src/exec/score/inline/watchdog.inl
@@ -257,40 +257,5 @@ STATIC INLINE Watchdog_Control *_Watchdog_Last(
}
-/*PAGE
- *
- * _Watchdog_Get_sync
- *
- */
-
-STATIC INLINE Watchdog_Control *_Watchdog_Get_sync( void )
-{
- return (Watchdog_Control *) _Watchdog_Sync;
-}
-
-/*PAGE
- *
- * _Watchdog_Set_sync
- *
- */
-
-STATIC INLINE void _Watchdog_Set_sync(
- Watchdog_Control *the_watchdog
-)
-{
- _Watchdog_Sync = (Watchdog_Synchronization_pointer) the_watchdog;
-}
-
-/*PAGE
- *
- * _Watchdog_Clear_sync
- *
- */
-
-STATIC INLINE void _Watchdog_Clear_sync( void )
-{
- _Watchdog_Sync = NULL;
-}
-
#endif
/* end of include file */
diff --git a/c/src/exec/score/macros/rtems/score/watchdog.inl b/c/src/exec/score/macros/rtems/score/watchdog.inl
index 1b150d8dab..4e965420ce 100644
--- a/c/src/exec/score/macros/rtems/score/watchdog.inl
+++ b/c/src/exec/score/macros/rtems/score/watchdog.inl
@@ -171,32 +171,5 @@
#define _Watchdog_Last( _header ) \
((Watchdog_Control *) (_header)->last)
-/*PAGE
- *
- * _Watchdog_Get_sync
- *
- */
-
-#define _Watchdog_Get_sync() \
- ((Watchdog_Control *) _Watchdog_Sync)
-
-/*PAGE
- *
- * _Watchdog_Set_sync
- *
- */
-
-#define _Watchdog_Set_sync( _the_watchdog ) \
- _Watchdog_Sync = (Watchdog_Synchronization_pointer) (_the_watchdog)
-
-/*PAGE
- *
- * _Watchdog_Clear_sync
- *
- */
-
-#define _Watchdog_Clear_sync() \
- _Watchdog_Sync = NULL;
-
#endif
/* end of include file */
diff --git a/c/src/exec/score/macros/watchdog.inl b/c/src/exec/score/macros/watchdog.inl
index 1b150d8dab..4e965420ce 100644
--- a/c/src/exec/score/macros/watchdog.inl
+++ b/c/src/exec/score/macros/watchdog.inl
@@ -171,32 +171,5 @@
#define _Watchdog_Last( _header ) \
((Watchdog_Control *) (_header)->last)
-/*PAGE
- *
- * _Watchdog_Get_sync
- *
- */
-
-#define _Watchdog_Get_sync() \
- ((Watchdog_Control *) _Watchdog_Sync)
-
-/*PAGE
- *
- * _Watchdog_Set_sync
- *
- */
-
-#define _Watchdog_Set_sync( _the_watchdog ) \
- _Watchdog_Sync = (Watchdog_Synchronization_pointer) (_the_watchdog)
-
-/*PAGE
- *
- * _Watchdog_Clear_sync
- *
- */
-
-#define _Watchdog_Clear_sync() \
- _Watchdog_Sync = NULL;
-
#endif
/* end of include file */
diff --git a/c/src/exec/score/src/heap.c b/c/src/exec/score/src/heap.c
index 485012ddf7..eb1c5d769e 100644
--- a/c/src/exec/score/src/heap.c
+++ b/c/src/exec/score/src/heap.c
@@ -116,8 +116,13 @@ Heap_Extend_status _Heap_Extend(
)
{
Heap_Block *the_block;
- Heap_Block *next_block;
- Heap_Block *previous_block;
+
+ /*
+ * The overhead was taken from the original heap memory.
+ */
+
+ Heap_Block *old_final;
+ Heap_Block *new_final;
/*
* There are five possibilities for the location of starting
@@ -150,24 +155,27 @@ Heap_Extend_status _Heap_Extend(
/*
* Currently only case 4 should make it to this point.
+ * The basic trick is to make the extend area look like a used
+ * block and free it.
*/
- *amount_extended = size - HEAP_BLOCK_USED_OVERHEAD;
+ *amount_extended = size;
- previous_block = the_heap->last;
+ old_final = the_heap->final;
+ new_final = _Addresses_Add_offset( old_final, size );
+ /* SAME AS: _Addresses_Add_offset( starting_address, size-HEAP_OVERHEAD ); */
- the_block = (Heap_Block *) starting_address;
- the_block->front_flag = size;
- the_block->next = previous_block->next;
- the_block->previous = previous_block;
+ the_heap->final = new_final;
- previous_block->next = the_block;
- the_heap->last = the_block;
+ old_final->front_flag =
+ new_final->back_flag = _Heap_Build_flag( size, HEAP_BLOCK_USED );
+ new_final->front_flag = HEAP_DUMMY_FLAG;
- next_block = _Heap_Next_block( the_block );
- next_block->back_flag = size;
- next_block->front_flag = HEAP_DUMMY_FLAG;
- the_heap->final = next_block;
+ /*
+ * Must pass in address of "user" area
+ */
+
+ _Heap_Free( the_heap, &old_final->next );
return HEAP_EXTEND_SUCCESSFUL;
}
@@ -392,8 +400,8 @@ void _Heap_Walk(
boolean do_dump
)
{
- Heap_Block *the_block;
- Heap_Block *next_block;
+ Heap_Block *the_block = 0; /* avoid warnings */
+ Heap_Block *next_block = 0; /* avoid warnings */
int notdone = 1;
/*
diff --git a/c/src/exec/score/src/watchdog.c b/c/src/exec/score/src/watchdog.c
index 7db26c0cd5..3c46f9b535 100644
--- a/c/src/exec/score/src/watchdog.c
+++ b/c/src/exec/score/src/watchdog.c
@@ -30,7 +30,8 @@
void _Watchdog_Handler_initialization( void )
{
- _Watchdog_Clear_sync();
+ _Watchdog_Sync_count = 0;
+ _Watchdog_Sync_level = 0;
_Chain_Initialize_empty( &_Watchdog_Ticks_chain );
_Chain_Initialize_empty( &_Watchdog_Seconds_chain );
}
@@ -56,8 +57,17 @@ Watchdog_States _Watchdog_Remove(
switch ( previous_state ) {
case WATCHDOG_INACTIVE:
break;
+
+ case WATCHDOG_REINSERT:
+
+ /*
+ * It is not actually on the chain so just change the state and
+ * the Insert operation we interrupted will be aborted.
+ */
+ the_watchdog->state = WATCHDOG_INACTIVE;
+ break;
+
case WATCHDOG_ACTIVE:
- case WATCHDOG_REINSERT:
case WATCHDOG_REMOVE_IT:
the_watchdog->state = WATCHDOG_INACTIVE;
@@ -66,8 +76,8 @@ Watchdog_States _Watchdog_Remove(
if ( _Watchdog_Next(next_watchdog) )
next_watchdog->delta_interval += the_watchdog->delta_interval;
- if ( the_watchdog == _Watchdog_Sync )
- _Watchdog_Sync = _Watchdog_Previous( the_watchdog );
+ if ( _Watchdog_Sync_count )
+ _Watchdog_Sync_level = _ISR_Nest_level;
_Chain_Extract_unprotected( &the_watchdog->Node );
break;
@@ -94,7 +104,7 @@ Watchdog_States _Watchdog_Remove(
void _Watchdog_Adjust(
Chain_Control *header,
Watchdog_Adjust_directions direction,
- rtems_interval units
+ rtems_interval units
)
{
if ( !_Chain_Is_empty( header ) ) {
@@ -136,45 +146,66 @@ void _Watchdog_Insert(
{
ISR_Level level;
Watchdog_Control *after;
+ unsigned32 insert_isr_nest_level;
+ rtems_interval delta_interval;
+
+
+ insert_isr_nest_level = _ISR_Nest_level;
+ the_watchdog->state = WATCHDOG_REINSERT;
- the_watchdog->state = WATCHDOG_REINSERT;
- the_watchdog->delta_interval = the_watchdog->initial;
+ _Watchdog_Sync_count++;
+restart:
+ delta_interval = the_watchdog->initial;
_ISR_Disable( level );
for ( after = _Watchdog_First( header ) ;
;
- after = _Watchdog_Next( _Watchdog_Get_sync() ) ) {
+ after = _Watchdog_Next( after ) ) {
- if ( the_watchdog->delta_interval == 0 || !_Watchdog_Next( after ) )
+ if ( delta_interval == 0 || !_Watchdog_Next( after ) )
break;
- if ( the_watchdog->delta_interval < after->delta_interval ) {
- after->delta_interval -= the_watchdog->delta_interval;
+ if ( delta_interval < after->delta_interval ) {
+ after->delta_interval -= delta_interval;
break;
}
- the_watchdog->delta_interval -= after->delta_interval;
- _Watchdog_Set_sync( after );
+ delta_interval -= after->delta_interval;
/*
- * If you experience problems comment out the _ISR_Flash line. Under
- * certain circumstances, this flash allows interrupts to execute
- * which violate the design assumptions. The critical section
- * mechanism used here must be redesigned to address this.
+ * If you experience problems comment out the _ISR_Flash line. This
+ * (3.2.0) is the first release with this critical section redesigned.
+ * Under certain circumstances, the PREVIOUS critical section algorithm
+ * used around this flash point allows interrupts to execute
+ * which violated the design assumptions. The critical section
+ * mechanism used here WAS redesigned to address this.
*/
_ISR_Flash( level );
+
+ if ( the_watchdog->state != WATCHDOG_REINSERT ) {
+ goto exit_insert;
+ }
+
+ if ( _Watchdog_Sync_level > insert_isr_nest_level ) {
+ _Watchdog_Sync_level = insert_isr_nest_level;
+ _ISR_Enable( level );
+ goto restart;
+ }
}
if ( insert_mode == WATCHDOG_ACTIVATE_NOW )
_Watchdog_Activate( the_watchdog );
- _Chain_Insert_unprotected( after->Node.previous, &the_watchdog->Node );
+ the_watchdog->delta_interval = delta_interval;
- _Watchdog_Clear_sync();
+ _Chain_Insert_unprotected( after->Node.previous, &the_watchdog->Node );
- _ISR_Enable( level );
+exit_insert:
+ _Watchdog_Sync_level = insert_isr_nest_level;
+ _Watchdog_Sync_count--;
+ _ISR_Enable( level );
}
/*PAGE
diff --git a/c/src/exec/score/tools/hppa1.1/genoffsets.c b/c/src/exec/score/tools/hppa1.1/genoffsets.c
index 6563681f11..3820620b3a 100644
--- a/c/src/exec/score/tools/hppa1.1/genoffsets.c
+++ b/c/src/exec/score/tools/hppa1.1/genoffsets.c
@@ -1,12 +1,12 @@
/*
- * @(#)genoffsets.c 1.3 - 95/03/15
- *
+ * @(#)genoffsets.c 1.5 - 95/05/16
+ *
*
* 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.
@@ -16,7 +16,7 @@
* to the copyright license under the clause at DFARS 252.227-7013. This
* notice must appear in all copies of this file and its derivatives.
*
- * $Id$
+ * genoffsets.c,v 1.2 1995/05/09 20:16:48 joel Exp
*
*/
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 765e60c62c..115a5bd136 100644
--- a/c/src/lib/libbsp/hppa1.1/simhppa/startup/bspstart.c
+++ b/c/src/lib/libbsp/hppa1.1/simhppa/startup/bspstart.c
@@ -1,5 +1,5 @@
/*
- * @(#)bspstart.c 1.13 - 95/04/25
+ * @(#)bspstart.c 1.14 - 95/05/16
*
*/
@@ -24,7 +24,7 @@
* to the copyright license under the clause at DFARS 252.227-7013. This
* notice must appear in all copies of this file and its derivatives.
*
- * $Id$
+ * bspstart.c,v 1.2 1995/05/09 20:17:33 joel Exp
*/
#include <bsp.h>
@@ -255,11 +255,11 @@ bsp_start(void)
#ifdef hppa7200
/*
- * Use DR0 if supported
+ * Use HPPA_DR0 if supported
*/
{
int dr0;
- HPPA_ASM_MFCPU(DR0, dr0);
+ HPPA_ASM_MFCPU(HPPA_DR0, dr0);
cpu_number = (dr0 >> 4) & 0x7;
}
#else
diff --git a/c/src/lib/libbsp/i960/cvme961/shmsupp/lock.c b/c/src/lib/libbsp/i960/cvme961/shmsupp/lock.c
index de62ec670d..69b458f099 100644
--- a/c/src/lib/libbsp/i960/cvme961/shmsupp/lock.c
+++ b/c/src/lib/libbsp/i960/cvme961/shmsupp/lock.c
@@ -18,9 +18,8 @@
*/
#include <rtems.h>
-#include "cpu.h"
-#include "bsp.h"
-#include "shm.h"
+#include <bsp.h>
+#include <shm.h>
/*
* Shm_Initialize_lock
diff --git a/c/src/lib/libbsp/m68k/idp/clock/ckinit.c b/c/src/lib/libbsp/m68k/idp/clock/ckinit.c
index abee1418cc..b27e9bbe38 100644
--- a/c/src/lib/libbsp/m68k/idp/clock/ckinit.c
+++ b/c/src/lib/libbsp/m68k/idp/clock/ckinit.c
@@ -26,10 +26,9 @@
#include <stdlib.h>
-#include "rtems.h"
-#include "clockdrv.h"
-#include "bsp.h"
-#include "cpu.h"
+#include <rtems.h>
+#include <clockdrv.h>
+#include <bsp.h>
rtems_unsigned32 Clock_isrs; /* ISRs until next tick */
volatile rtems_unsigned32 Clock_driver_ticks;
diff --git a/c/src/lib/libbsp/m68k/idp/include/bsp.h b/c/src/lib/libbsp/m68k/idp/include/bsp.h
index ec8221f1f9..826ab8cad2 100644
--- a/c/src/lib/libbsp/m68k/idp/include/bsp.h
+++ b/c/src/lib/libbsp/m68k/idp/include/bsp.h
@@ -8,11 +8,10 @@
#ifndef __IDP_BSP_H
#define __IDP_BSP_H
-#include "rtems.h"
-#include "cpu.h"
-#include "console.h"
-#include "mc68230.h"
-#include "mc68681.h"
+#include <rtems.h>
+#include <console.h>
+#include <mc68230.h>
+#include <mc68681.h>
/*
* Define the time limits for RTEMS Test Suite test durations.
diff --git a/c/src/lib/libbsp/m68k/idp/startup/bspstart.c b/c/src/lib/libbsp/m68k/idp/startup/bspstart.c
index 843a137485..80d619ebe8 100644
--- a/c/src/lib/libbsp/m68k/idp/startup/bspstart.c
+++ b/c/src/lib/libbsp/m68k/idp/startup/bspstart.c
@@ -20,10 +20,9 @@
* $Id$
*/
-#include "rtems.h"
-#include "bsp.h"
-#include "cpu.h"
-#include "libcsupport.h"
+#include <rtems.h>
+#include <bsp.h>
+#include <libcsupport.h>
unsigned char *duart_base;
extern struct duart_regs duart_info;
diff --git a/c/src/lib/libbsp/m68k/idp/timer/timer.c b/c/src/lib/libbsp/m68k/idp/timer/timer.c
index 176f393e45..6fa1ae206d 100644
--- a/c/src/lib/libbsp/m68k/idp/timer/timer.c
+++ b/c/src/lib/libbsp/m68k/idp/timer/timer.c
@@ -27,10 +27,9 @@
*/
-#include "rtems.h"
-#include "cpu.h"
-#include "bsp.h"
-#include "mc68230.h"
+#include <rtems.h>
+#include <bsp.h>
+#include <mc68230.h>
#define TIMER_VECTOR 0x4D
diff --git a/c/src/lib/libbsp/shmdr/poll.c b/c/src/lib/libbsp/shmdr/poll.c
index 43f6711ff9..c833d49254 100644
--- a/c/src/lib/libbsp/shmdr/poll.c
+++ b/c/src/lib/libbsp/shmdr/poll.c
@@ -16,10 +16,11 @@
* to the copyright license under the clause at DFARS 252.227-7013. This
* notice must appear in all copies of this file and its derivatives.
*
- * $Id$
+ * poll.c,v 1.2 1995/05/09 20:22:57 joel Exp
*/
#include <rtems.h>
+#include <rtems/sysstate.h>
#include "shm.h"
#include "clockdrv.h"
@@ -29,12 +30,22 @@ void Shm_Poll()
Clock_isr( 0 ); /* invoke standard clock ISR */
- /* enable_tracing(); */
- /* ticks += 1; */
- Shm_Lock( Shm_Local_receive_queue );
- tmpfront = Shm_Local_receive_queue->front;
- Shm_Unlock( Shm_Local_receive_queue );
- if ( Shm_Convert(tmpfront) == Shm_Locked_queue_End_of_list ) return;
- rtems_multiprocessing_announce();
- Shm_Interrupt_count++;
+
+ /*
+ * Check for msgs only if we are "up"
+ * This avoids a race condition where we may get a clock
+ * interrupt before MPCI has completed its init
+ */
+
+ if (_System_state_Is_up(_System_state_Get()))
+ {
+ /* enable_tracing(); */
+ /* ticks += 1; */
+ Shm_Lock( Shm_Local_receive_queue );
+ tmpfront = Shm_Local_receive_queue->front;
+ Shm_Unlock( Shm_Local_receive_queue );
+ if ( Shm_Convert(tmpfront) == Shm_Locked_queue_End_of_list ) return;
+ rtems_multiprocessing_announce();
+ Shm_Interrupt_count++;
+ }
}
diff --git a/c/src/lib/libbsp/shmdr/shm.h b/c/src/lib/libbsp/shmdr/shm.h
index bee930138c..08ff6c3812 100644
--- a/c/src/lib/libbsp/shmdr/shm.h
+++ b/c/src/lib/libbsp/shmdr/shm.h
@@ -14,7 +14,7 @@
* to the copyright license under the clause at DFARS 252.227-7013. This
* notice must appear in all copies of this file and its derivatives.
*
- * $Id$
+ * shm.h,v 1.2 1995/05/09 20:23:03 joel Exp
*/
#ifndef __SHM_h
@@ -24,8 +24,6 @@
extern "C" {
#endif
-#include <cpu.h>
-
/* The information contained in the Node Status, Locked Queue, and
* Envelope Control Blocks must be maintained in a NEUTRAL format.
* Currently the neutral format may be selected as big or little
diff --git a/c/src/lib/libbsp/shmdr/shm_driver.h b/c/src/lib/libbsp/shmdr/shm_driver.h
index bee930138c..08ff6c3812 100644
--- a/c/src/lib/libbsp/shmdr/shm_driver.h
+++ b/c/src/lib/libbsp/shmdr/shm_driver.h
@@ -14,7 +14,7 @@
* to the copyright license under the clause at DFARS 252.227-7013. This
* notice must appear in all copies of this file and its derivatives.
*
- * $Id$
+ * shm.h,v 1.2 1995/05/09 20:23:03 joel Exp
*/
#ifndef __SHM_h
@@ -24,8 +24,6 @@
extern "C" {
#endif
-#include <cpu.h>
-
/* The information contained in the Node Status, Locked Queue, and
* Envelope Control Blocks must be maintained in a NEUTRAL format.
* Currently the neutral format may be selected as big or little
diff --git a/c/src/lib/libc/__brk.c b/c/src/lib/libc/__brk.c
index 6fb15342fe..7c43ffa32b 100644
--- a/c/src/lib/libc/__brk.c
+++ b/c/src/lib/libc/__brk.c
@@ -1,3 +1,5 @@
+#if !defined(RTEMS_UNIX)
+
/*
* RTEMS "Broken" __brk/__sbrk Implementation
*
@@ -12,7 +14,7 @@
* to the copyright license under the clause at DFARS 252.227-7013. This
* notice must appear in all copies of this file and its derivatives.
*
- * $Id$
+ * __brk.c,v 1.2 1995/05/09 20:24:28 joel Exp
*/
#include <rtems.h>
@@ -38,3 +40,5 @@ int __brk( const void *endds )
errno = EINVAL;
return -1;
}
+
+#endif
diff --git a/c/src/lib/libc/__gettod.c b/c/src/lib/libc/__gettod.c
index a1ab9776c8..6f8df8a65f 100644
--- a/c/src/lib/libc/__gettod.c
+++ b/c/src/lib/libc/__gettod.c
@@ -11,7 +11,7 @@
* to the copyright license under the clause at DFARS 252.227-7013. This
* notice must appear in all copies of this file and its derivatives.
*
- * $Id$
+ * __gettod.c,v 1.2 1995/05/09 20:24:31 joel Exp
*/
#include <rtems.h>
@@ -19,8 +19,10 @@
#ifdef RTEMS_NEWLIB
#include <sys/reent.h>
#endif
+
#include <time.h>
#include <sys/time.h>
+
#include <errno.h>
#include <assert.h>
@@ -29,14 +31,14 @@
*/
int gettimeofday(
- struct timeval *tp,
- struct timezone *tzp
+ struct timeval *tp,
+ struct timezone *tzp
)
{
rtems_status_code status;
rtems_clock_time_value time;
- if ( !tp || !tzp ) {
+ if ( !tp ) {
errno = EFAULT;
return -1;
}
@@ -51,34 +53,51 @@ int gettimeofday(
tp->tv_sec = time.seconds;
tp->tv_usec = time.microseconds;
-#if 0
- tzp->minuteswest = timezone / 60; /* from seconds to minutes */
- tzp->dsttime = daylight;
-#endif
-
/*
* newlib does not have timezone and daylight savings time
* yet. When it does this needs to be fixed.
*/
- tzp->tz_minuteswest = 0; /* at UTC */
- tzp->tz_dsttime = 0; /* no daylight savings */
+ if ( tzp ) {
+ tzp->tz_minuteswest = 0; /* at UTC */
+ tzp->tz_dsttime = 0; /* no daylight savings */
+#if 0
+ tzp->minuteswest = timezone / 60; /* from seconds to minutes */
+ tzp->dsttime = daylight;
+#endif
+ }
return 0;
}
+#if defined(RTEMS_NEWLIB)
+
+#if 0
/*
- * "Reentrant" versions of the above routines implemented above.
+ * "Reentrant" version
*/
-#if 0
int _gettimeofday_r(
- struct _reent *ignored_reentrancy_stuff,
- struct timeval *tp,
- struct timezone *tzp
+ struct _reent *ignored_reentrancy_stuff,
+ struct timeval *tp,
+ struct timezone *tzp
)
{
return gettimeofday( tp, tzp );
}
#endif
+/*
+ * "System call" version
+ */
+
+int _gettimeofday(
+ struct timeval *tp,
+ struct timezone *tzp
+)
+{
+ return gettimeofday( tp, tzp );
+}
+
+#endif /* defined(RTEMS_NEWLIB) */
+
#endif
diff --git a/c/src/lib/libc/newlibc.c b/c/src/lib/libc/newlibc.c
index 3c5e58b67c..39dea67775 100644
--- a/c/src/lib/libc/newlibc.c
+++ b/c/src/lib/libc/newlibc.c
@@ -1,16 +1,16 @@
/*
- * @(#)newlibc.c 1.8 - 95/04/25
+ * @(#)newlibc.c 1.9 - 95/05/16
*
*/
#if defined(RTEMS_NEWLIB)
/*
- * File: $RCSfile$
+ * File: newlibc.c,v
* Project: PixelFlow
* Created: 94/12/7
- * Revision: $Revision$
- * Last Mod: $Date$
+ * Revision: 1.2
+ * Last Mod: 1995/05/09 20:24:37
*
* COPYRIGHT (c) 1994 by Division Incorporated
*
@@ -35,7 +35,7 @@
*
* NOTE:
*
- * $Id$
+ * newlibc.c,v 1.2 1995/05/09 20:24:37 joel Exp
*
*/
diff --git a/c/src/lib/libmisc/stackchk/check.c b/c/src/lib/libmisc/stackchk/check.c
index 8b923f5c02..2d25f51f3e 100644
--- a/c/src/lib/libmisc/stackchk/check.c
+++ b/c/src/lib/libmisc/stackchk/check.c
@@ -329,6 +329,7 @@ void *Stack_check_find_high_water_mark(
* match pattern
*/
+ base += 4;
for (ebase = base + length; base < ebase; base++)
if (*base != U32_PATTERN)
return (void *) base;
diff --git a/c/src/libchip/shmdr/poll.c b/c/src/libchip/shmdr/poll.c
index 43f6711ff9..c833d49254 100644
--- a/c/src/libchip/shmdr/poll.c
+++ b/c/src/libchip/shmdr/poll.c
@@ -16,10 +16,11 @@
* to the copyright license under the clause at DFARS 252.227-7013. This
* notice must appear in all copies of this file and its derivatives.
*
- * $Id$
+ * poll.c,v 1.2 1995/05/09 20:22:57 joel Exp
*/
#include <rtems.h>
+#include <rtems/sysstate.h>
#include "shm.h"
#include "clockdrv.h"
@@ -29,12 +30,22 @@ void Shm_Poll()
Clock_isr( 0 ); /* invoke standard clock ISR */
- /* enable_tracing(); */
- /* ticks += 1; */
- Shm_Lock( Shm_Local_receive_queue );
- tmpfront = Shm_Local_receive_queue->front;
- Shm_Unlock( Shm_Local_receive_queue );
- if ( Shm_Convert(tmpfront) == Shm_Locked_queue_End_of_list ) return;
- rtems_multiprocessing_announce();
- Shm_Interrupt_count++;
+
+ /*
+ * Check for msgs only if we are "up"
+ * This avoids a race condition where we may get a clock
+ * interrupt before MPCI has completed its init
+ */
+
+ if (_System_state_Is_up(_System_state_Get()))
+ {
+ /* enable_tracing(); */
+ /* ticks += 1; */
+ Shm_Lock( Shm_Local_receive_queue );
+ tmpfront = Shm_Local_receive_queue->front;
+ Shm_Unlock( Shm_Local_receive_queue );
+ if ( Shm_Convert(tmpfront) == Shm_Locked_queue_End_of_list ) return;
+ rtems_multiprocessing_announce();
+ Shm_Interrupt_count++;
+ }
}
diff --git a/c/src/libchip/shmdr/shm_driver.h b/c/src/libchip/shmdr/shm_driver.h
index bee930138c..08ff6c3812 100644
--- a/c/src/libchip/shmdr/shm_driver.h
+++ b/c/src/libchip/shmdr/shm_driver.h
@@ -14,7 +14,7 @@
* to the copyright license under the clause at DFARS 252.227-7013. This
* notice must appear in all copies of this file and its derivatives.
*
- * $Id$
+ * shm.h,v 1.2 1995/05/09 20:23:03 joel Exp
*/
#ifndef __SHM_h
@@ -24,8 +24,6 @@
extern "C" {
#endif
-#include <cpu.h>
-
/* The information contained in the Node Status, Locked Queue, and
* Envelope Control Blocks must be maintained in a NEUTRAL format.
* Currently the neutral format may be selected as big or little
diff --git a/c/src/libmisc/stackchk/check.c b/c/src/libmisc/stackchk/check.c
index 8b923f5c02..2d25f51f3e 100644
--- a/c/src/libmisc/stackchk/check.c
+++ b/c/src/libmisc/stackchk/check.c
@@ -329,6 +329,7 @@ void *Stack_check_find_high_water_mark(
* match pattern
*/
+ base += 4;
for (ebase = base + length; base < ebase; base++)
if (*base != U32_PATTERN)
return (void *) base;
diff --git a/c/src/tests/mptests/mp01/task1.c b/c/src/tests/mptests/mp01/task1.c
index a2c3ec3a1d..465ae7063e 100644
--- a/c/src/tests/mptests/mp01/task1.c
+++ b/c/src/tests/mptests/mp01/task1.c
@@ -21,7 +21,7 @@
* to the copyright license under the clause at DFARS 252.227-7013. This
* notice must appear in all copies of this file and its derivatives.
*
- * $Id$
+ * task1.c,v 1.2 1995/05/09 20:26:24 joel Exp
*/
#include "system.h"
@@ -43,7 +43,7 @@ rtems_task Test_task(
put_name( Task_name[ task_number( tid ) ], FALSE );
print_time( " - rtems_clock_get - ", &time, "\n" );
- status = rtems_task_wake_after( task_number( tid ) * 5 * TICKS_PER_SECOND );
+ status = rtems_task_wake_after( task_number( tid ) * 1 * TICKS_PER_SECOND );
directive_failed( status, "rtems_task_wake_after" );
status = rtems_clock_get( RTEMS_CLOCK_GET_TOD, &time );
diff --git a/c/src/tests/sptests/sp04/tswitch.c b/c/src/tests/sptests/sp04/tswitch.c
index 3f0c2047bc..250ec5c9a7 100644
--- a/c/src/tests/sptests/sp04/tswitch.c
+++ b/c/src/tests/sptests/sp04/tswitch.c
@@ -18,7 +18,7 @@
* to the copyright license under the clause at DFARS 252.227-7013. This
* notice must appear in all copies of this file and its derivatives.
*
- * $Id$
+ * tswitch.c,v 1.2 1995/05/09 20:32:43 joel Exp
*/
#include "system.h"
@@ -44,7 +44,7 @@ rtems_extension Task_switch(
directive_failed( status, "rtems_clock_get" );
put_name( Task_name[ index ], FALSE );
- print_time( " - ", &time, "\n" );
+ print_time( "- ", &time, "\n" );
if ( time.second >= 16 ) {
puts( "*** END OF TEST 4 ***" );
diff --git a/c/src/tests/sptests/sp09/screen14.c b/c/src/tests/sptests/sp09/screen14.c
index bf80f04c3c..c0e75b1b98 100644
--- a/c/src/tests/sptests/sp09/screen14.c
+++ b/c/src/tests/sptests/sp09/screen14.c
@@ -76,14 +76,6 @@ void Screen14()
);
puts( "TA1 - rtems_timer_cancel - RTEMS_INVALID_ID" );
- status = rtems_timer_cancel( Timer_id[ 1 ] );
- fatal_directive_status(
- status,
- RTEMS_INCORRECT_STATE,
- "rtems_timer_cancel before initiated"
- );
- puts( "TA1 - rtems_timer_cancel - RTEMS_INCORRECT_STATE" );
-
status = rtems_timer_reset( 0x010100 );
fatal_directive_status(
status,
diff --git a/c/src/tests/sptests/sp09/sp09.scn b/c/src/tests/sptests/sp09/sp09.scn
index 534fc47e09..158593dcba 100644
--- a/c/src/tests/sptests/sp09/sp09.scn
+++ b/c/src/tests/sptests/sp09/sp09.scn
@@ -237,7 +237,6 @@ TA1 - rtems_timer_delete - local RTEMS_INVALID_ID
TA1 - rtems_timer_delete - global RTEMS_INVALID_ID
TA1 - rtems_timer_ident - RTEMS_INVALID_NAME
TA1 - rtems_timer_cancel - RTEMS_INVALID_ID
-TA1 - rtems_timer_cancel - RTEMS_INCORRECT_STATE
TA1 - rtems_timer_reset - RTEMS_INVALID_ID
TA1 - rtems_timer_reset - RTEMS_NOT_DEFINED
TA1 - rtems_timer_fire_after - RTEMS_INVALID_ID
diff --git a/c/src/tests/sptests/sp20/sp20.scn b/c/src/tests/sptests/sp20/sp20.scn
index 1de3c18db8..9e71a3d003 100644
--- a/c/src/tests/sptests/sp20/sp20.scn
+++ b/c/src/tests/sptests/sp20/sp20.scn
@@ -13,7 +13,7 @@ TA4 - rtems_rate_monotonic_ident id = 0x00010004
TA4 - (0x00010004) period 2
TA5 - rtems_rate_monotonic_create id = 0x00010005
TA5 - rtems_rate_monotonic_ident id = 0x00010005
-TA5 - (0x00010005) period 50
+TA5 - (0x00010005) period 100
TA5 - PERIODS CHECK OK (1)
TA5 - PERIODS CHECK OK (2)
TA5 - PERIODS CHECK OK (3)
diff --git a/c/src/tests/sptests/spsize/size.c b/c/src/tests/sptests/spsize/size.c
index 52404272fd..e890807ca3 100644
--- a/c/src/tests/sptests/spsize/size.c
+++ b/c/src/tests/sptests/spsize/size.c
@@ -332,7 +332,8 @@ uninitialized =
/*watchdog.h*/ (sizeof _Watchdog_Ticks_chain) +
(sizeof _Watchdog_Seconds_chain) +
- (sizeof _Watchdog_Sync) +
+ (sizeof _Watchdog_Sync_count) +
+ (sizeof _Watchdog_Sync_level) +
/*wkspace.h*/ (sizeof _Workspace_Area);
diff --git a/cpukit/libcsupport/src/__brk.c b/cpukit/libcsupport/src/__brk.c
index 6fb15342fe..7c43ffa32b 100644
--- a/cpukit/libcsupport/src/__brk.c
+++ b/cpukit/libcsupport/src/__brk.c
@@ -1,3 +1,5 @@
+#if !defined(RTEMS_UNIX)
+
/*
* RTEMS "Broken" __brk/__sbrk Implementation
*
@@ -12,7 +14,7 @@
* to the copyright license under the clause at DFARS 252.227-7013. This
* notice must appear in all copies of this file and its derivatives.
*
- * $Id$
+ * __brk.c,v 1.2 1995/05/09 20:24:28 joel Exp
*/
#include <rtems.h>
@@ -38,3 +40,5 @@ int __brk( const void *endds )
errno = EINVAL;
return -1;
}
+
+#endif
diff --git a/cpukit/libcsupport/src/__gettod.c b/cpukit/libcsupport/src/__gettod.c
index a1ab9776c8..6f8df8a65f 100644
--- a/cpukit/libcsupport/src/__gettod.c
+++ b/cpukit/libcsupport/src/__gettod.c
@@ -11,7 +11,7 @@
* to the copyright license under the clause at DFARS 252.227-7013. This
* notice must appear in all copies of this file and its derivatives.
*
- * $Id$
+ * __gettod.c,v 1.2 1995/05/09 20:24:31 joel Exp
*/
#include <rtems.h>
@@ -19,8 +19,10 @@
#ifdef RTEMS_NEWLIB
#include <sys/reent.h>
#endif
+
#include <time.h>
#include <sys/time.h>
+
#include <errno.h>
#include <assert.h>
@@ -29,14 +31,14 @@
*/
int gettimeofday(
- struct timeval *tp,
- struct timezone *tzp
+ struct timeval *tp,
+ struct timezone *tzp
)
{
rtems_status_code status;
rtems_clock_time_value time;
- if ( !tp || !tzp ) {
+ if ( !tp ) {
errno = EFAULT;
return -1;
}
@@ -51,34 +53,51 @@ int gettimeofday(
tp->tv_sec = time.seconds;
tp->tv_usec = time.microseconds;
-#if 0
- tzp->minuteswest = timezone / 60; /* from seconds to minutes */
- tzp->dsttime = daylight;
-#endif
-
/*
* newlib does not have timezone and daylight savings time
* yet. When it does this needs to be fixed.
*/
- tzp->tz_minuteswest = 0; /* at UTC */
- tzp->tz_dsttime = 0; /* no daylight savings */
+ if ( tzp ) {
+ tzp->tz_minuteswest = 0; /* at UTC */
+ tzp->tz_dsttime = 0; /* no daylight savings */
+#if 0
+ tzp->minuteswest = timezone / 60; /* from seconds to minutes */
+ tzp->dsttime = daylight;
+#endif
+ }
return 0;
}
+#if defined(RTEMS_NEWLIB)
+
+#if 0
/*
- * "Reentrant" versions of the above routines implemented above.
+ * "Reentrant" version
*/
-#if 0
int _gettimeofday_r(
- struct _reent *ignored_reentrancy_stuff,
- struct timeval *tp,
- struct timezone *tzp
+ struct _reent *ignored_reentrancy_stuff,
+ struct timeval *tp,
+ struct timezone *tzp
)
{
return gettimeofday( tp, tzp );
}
#endif
+/*
+ * "System call" version
+ */
+
+int _gettimeofday(
+ struct timeval *tp,
+ struct timezone *tzp
+)
+{
+ return gettimeofday( tp, tzp );
+}
+
+#endif /* defined(RTEMS_NEWLIB) */
+
#endif
diff --git a/cpukit/libcsupport/src/newlibc.c b/cpukit/libcsupport/src/newlibc.c
index 3c5e58b67c..39dea67775 100644
--- a/cpukit/libcsupport/src/newlibc.c
+++ b/cpukit/libcsupport/src/newlibc.c
@@ -1,16 +1,16 @@
/*
- * @(#)newlibc.c 1.8 - 95/04/25
+ * @(#)newlibc.c 1.9 - 95/05/16
*
*/
#if defined(RTEMS_NEWLIB)
/*
- * File: $RCSfile$
+ * File: newlibc.c,v
* Project: PixelFlow
* Created: 94/12/7
- * Revision: $Revision$
- * Last Mod: $Date$
+ * Revision: 1.2
+ * Last Mod: 1995/05/09 20:24:37
*
* COPYRIGHT (c) 1994 by Division Incorporated
*
@@ -35,7 +35,7 @@
*
* NOTE:
*
- * $Id$
+ * newlibc.c,v 1.2 1995/05/09 20:24:37 joel Exp
*
*/
diff --git a/cpukit/libmisc/stackchk/check.c b/cpukit/libmisc/stackchk/check.c
index 8b923f5c02..2d25f51f3e 100644
--- a/cpukit/libmisc/stackchk/check.c
+++ b/cpukit/libmisc/stackchk/check.c
@@ -329,6 +329,7 @@ void *Stack_check_find_high_water_mark(
* match pattern
*/
+ base += 4;
for (ebase = base + length; base < ebase; base++)
if (*base != U32_PATTERN)
return (void *) base;
diff --git a/cpukit/rtems/src/rtemstimer.c b/cpukit/rtems/src/rtemstimer.c
index 076091bee4..abab4cc7b4 100644
--- a/cpukit/rtems/src/rtemstimer.c
+++ b/cpukit/rtems/src/rtemstimer.c
@@ -146,13 +146,10 @@ rtems_status_code rtems_timer_cancel(
case OBJECTS_REMOTE: /* should never return this */
return( RTEMS_INTERNAL_ERROR );
case OBJECTS_LOCAL:
- if ( !_Timer_Is_dormant_class( the_timer->the_class ) ) {
+ if ( !_Timer_Is_dormant_class( the_timer->the_class ) )
(void) _Watchdog_Remove( &the_timer->Ticker );
- _Thread_Enable_dispatch();
- return( RTEMS_SUCCESSFUL );
- }
_Thread_Enable_dispatch();
- return( RTEMS_INCORRECT_STATE );
+ return( RTEMS_SUCCESSFUL );
}
return( RTEMS_INTERNAL_ERROR ); /* unreached - only to remove warnings */
diff --git a/cpukit/sapi/include/rtems/io.h b/cpukit/sapi/include/rtems/io.h
index 6824377170..43c52cd35d 100644
--- a/cpukit/sapi/include/rtems/io.h
+++ b/cpukit/sapi/include/rtems/io.h
@@ -187,11 +187,11 @@ void _IO_Initialize_all_drivers( void );
*/
rtems_status_code _IO_Handler_routine(
- IO_operations operation,
+ IO_operations operation,
rtems_device_major_number major,
rtems_device_minor_number minor,
- void *argument,
- unsigned32 *return_value
+ void *argument,
+ unsigned32 *return_value
);
#include <rtems/io.inl>
diff --git a/cpukit/sapi/src/exinit.c b/cpukit/sapi/src/exinit.c
index cc45a11c94..984dca68be 100644
--- a/cpukit/sapi/src/exinit.c
+++ b/cpukit/sapi/src/exinit.c
@@ -107,6 +107,13 @@ rtems_interrupt_level rtems_initialize_executive_early(
_CPU_Initialize( cpu_table, _Thread_Dispatch );
+ /*
+ * Do this as early as possible to insure no debugging output
+ * is even attempted to be printed.
+ */
+
+ _Debug_Manager_initialization();
+
multiprocessing_table = configuration_table->User_multiprocessing_table;
if ( multiprocessing_table == NULL )
multiprocessing_table =
diff --git a/cpukit/sapi/src/io.c b/cpukit/sapi/src/io.c
index cf78bb9f71..916053da7e 100644
--- a/cpukit/sapi/src/io.c
+++ b/cpukit/sapi/src/io.c
@@ -256,11 +256,11 @@ rtems_status_code rtems_io_control(
*/
rtems_status_code _IO_Handler_routine(
- IO_operations operation,
+ IO_operations operation,
rtems_device_major_number major,
rtems_device_minor_number minor,
- void *argument,
- unsigned32 *return_value
+ void *argument,
+ unsigned32 *return_value
)
{
rtems_device_driver_entry io_callout;
diff --git a/cpukit/score/cpu/hppa1.1/cpu.c b/cpukit/score/cpu/hppa1.1/cpu.c
index b69a172b4e..027ed07333 100644
--- a/cpukit/score/cpu/hppa1.1/cpu.c
+++ b/cpukit/score/cpu/hppa1.1/cpu.c
@@ -14,7 +14,7 @@
* Division Incorporated makes no representations about the
* suitability of this software for any purpose.
*
- * $Id$
+ * cpu.c,v 1.2 1995/05/09 20:11:35 joel Exp
*/
#include <rtems/system.h>
diff --git a/cpukit/score/cpu/i386/asm.h b/cpukit/score/cpu/i386/asm.h
index f123defcd9..16cf6c3235 100644
--- a/cpukit/score/cpu/i386/asm.h
+++ b/cpukit/score/cpu/i386/asm.h
@@ -31,7 +31,7 @@
*/
#define ASM
-#include <i386.h>
+#include <rtems/i386.h>
/*
* Recent versions of GNU cpp define variables which indicate the
diff --git a/cpukit/score/cpu/i386/rtems/asm.h b/cpukit/score/cpu/i386/rtems/asm.h
index f123defcd9..16cf6c3235 100644
--- a/cpukit/score/cpu/i386/rtems/asm.h
+++ b/cpukit/score/cpu/i386/rtems/asm.h
@@ -31,7 +31,7 @@
*/
#define ASM
-#include <i386.h>
+#include <rtems/i386.h>
/*
* Recent versions of GNU cpp define variables which indicate the
diff --git a/cpukit/score/cpu/i960/asm.h b/cpukit/score/cpu/i960/asm.h
index 1c40601473..e8fc986402 100644
--- a/cpukit/score/cpu/i960/asm.h
+++ b/cpukit/score/cpu/i960/asm.h
@@ -31,7 +31,7 @@
*/
#define ASM
-#include <i960.h>
+#include <rtems/i960.h>
/*
* Recent versions of GNU cpp define variables which indicate the
diff --git a/cpukit/score/cpu/m68k/asm.h b/cpukit/score/cpu/m68k/asm.h
index 068c58058c..58bb04bdf9 100644
--- a/cpukit/score/cpu/m68k/asm.h
+++ b/cpukit/score/cpu/m68k/asm.h
@@ -31,7 +31,7 @@
*/
#define ASM
-#include <m68k.h>
+#include <rtems/m68k.h>
/*
* Recent versions of GNU cpp define variables which indicate the
diff --git a/cpukit/score/cpu/m68k/rtems/asm.h b/cpukit/score/cpu/m68k/rtems/asm.h
index 068c58058c..58bb04bdf9 100644
--- a/cpukit/score/cpu/m68k/rtems/asm.h
+++ b/cpukit/score/cpu/m68k/rtems/asm.h
@@ -31,7 +31,7 @@
*/
#define ASM
-#include <m68k.h>
+#include <rtems/m68k.h>
/*
* Recent versions of GNU cpp define variables which indicate the
diff --git a/cpukit/score/cpu/no_cpu/asm.h b/cpukit/score/cpu/no_cpu/asm.h
index 69b1f0f825..97464d5b3a 100644
--- a/cpukit/score/cpu/no_cpu/asm.h
+++ b/cpukit/score/cpu/no_cpu/asm.h
@@ -31,7 +31,7 @@
*/
#define ASM
-#include <no_cpu.h>
+#include <rtems/no_cpu.h>
/*
* Recent versions of GNU cpp define variables which indicate the
diff --git a/cpukit/score/cpu/no_cpu/rtems/asm.h b/cpukit/score/cpu/no_cpu/rtems/asm.h
index 69b1f0f825..97464d5b3a 100644
--- a/cpukit/score/cpu/no_cpu/rtems/asm.h
+++ b/cpukit/score/cpu/no_cpu/rtems/asm.h
@@ -31,7 +31,7 @@
*/
#define ASM
-#include <no_cpu.h>
+#include <rtems/no_cpu.h>
/*
* Recent versions of GNU cpp define variables which indicate the
diff --git a/cpukit/score/cpu/unix/cpu.c b/cpukit/score/cpu/unix/cpu.c
index ed94953d58..68397a4e29 100644
--- a/cpukit/score/cpu/unix/cpu.c
+++ b/cpukit/score/cpu/unix/cpu.c
@@ -35,7 +35,6 @@
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
-#include <string.h>
#include <signal.h>
#include <time.h>
@@ -225,18 +224,28 @@ void _CPU_Context_Initialize(
unsigned32 *_stack_base,
unsigned32 _size,
unsigned32 _new_level,
- proc_ptr *_entry_point
+ void *_entry_point
)
{
unsigned32 *addr;
unsigned32 jmp_addr;
- unsigned32 _stack;
+ unsigned32 _stack_low; /* lowest "stack aligned" address */
+ unsigned32 _stack_high; /* highest "stack aligned" address */
unsigned32 _the_size;
jmp_addr = (unsigned32) _entry_point;
- _stack = ((unsigned32)(_stack_base) + CPU_STACK_ALIGNMENT);
- _stack &= ~(CPU_STACK_ALIGNMENT - 1);
+ /*
+ * On CPUs with stacks which grow down, we build the stack
+ * based on the _stack_high address. On CPUs with stacks which
+ * grow up, we build the stack based on the _stack_low address.
+ */
+
+ _stack_low = ((unsigned32)(_stack_base) + CPU_STACK_ALIGNMENT);
+ _stack_low &= ~(CPU_STACK_ALIGNMENT - 1);
+
+ _stack_high = ((unsigned32)(_stack_base) + _size);
+ _stack_high &= ~(CPU_STACK_ALIGNMENT - 1);
_the_size = _size & ~(CPU_STACK_ALIGNMENT - 1);
@@ -250,7 +259,7 @@ void _CPU_Context_Initialize(
#if defined(hppa1_1)
*(addr + RP_OFF) = jmp_addr;
- *(addr + SP_OFF) = (unsigned32)(_stack + CPU_FRAME_SIZE);
+ *(addr + SP_OFF) = (unsigned32)(_stack_low + CPU_FRAME_SIZE);
/*
* See if we are using shared libraries by checking
@@ -274,8 +283,8 @@ void _CPU_Context_Initialize(
asm ("ta 0x03"); /* flush registers */
*(addr + RP_OFF) = jmp_addr + ADDR_ADJ_OFFSET;
- *(addr + SP_OFF) = (unsigned32)(_stack +_the_size - CPU_FRAME_SIZE);
- *(addr + FP_OFF) = (unsigned32)(_stack +_the_size);
+ *(addr + SP_OFF) = (unsigned32)(_stack_high - CPU_FRAME_SIZE);
+ *(addr + FP_OFF) = (unsigned32)(_stack_high);
#else
#error "UNKNOWN CPU!!!"
#endif
diff --git a/cpukit/score/include/rtems/score/watchdog.h b/cpukit/score/include/rtems/score/watchdog.h
index 5c897615f7..c7665bfea2 100644
--- a/cpukit/score/include/rtems/score/watchdog.h
+++ b/cpukit/score/include/rtems/score/watchdog.h
@@ -100,17 +100,12 @@ typedef struct {
} Watchdog_Control;
/*
- * The following type is used for synchronization purposes
+ * The following are used for synchronization purposes
* during an insert on a watchdog delta chain.
- *
- * NOTE: Watchdog_Pointer is only used to insure that
- * Watchdog_Synchronization_pointer is a pointer
- * which is volatile rather than a pointer to a
- * volatile block of memory.
*/
-typedef Watchdog_Control *Watchdog_Pointer;
-typedef volatile Watchdog_Pointer Watchdog_Synchronization_pointer;
+volatile unsigned32 _Watchdog_Sync_level;
+volatile unsigned32 _Watchdog_Sync_count;
/*
* The following defines the watchdog chains which are managed
@@ -121,14 +116,6 @@ EXTERN Chain_Control _Watchdog_Ticks_chain;
EXTERN Chain_Control _Watchdog_Seconds_chain;
/*
- * The following defines the synchronization variable used to
- * allow interrupts to be enabled while inserting a watchdog
- * on a watchdog chain.
- */
-
-EXTERN Watchdog_Synchronization_pointer _Watchdog_Sync;
-
-/*
* _Watchdog_Handler_initialization
*
* DESCRIPTION:
@@ -376,46 +363,6 @@ STATIC INLINE Watchdog_Control *_Watchdog_Last(
);
/*
- *
- * _Watchdog_Get_sync
- *
- * DESCRIPTION:
- *
- * This routine returns the current synchronization timer. This
- * routine is used so that interrupts can be enabled while a
- * watchdog timer is being inserted into a watchdog chain.
- */
-
-STATIC INLINE Watchdog_Control *_Watchdog_Get_sync( void );
-
-/*
- *
- * _Watchdog_Set_sync
- *
- * DESCRIPTION:
- *
- * This routine sets the current synchronization timer. This
- * routine is used so that interrupts can be enabled while a
- * watchdog timer is being inserted into a watchdog chain.
- */
-
-STATIC INLINE void _Watchdog_Set_sync(
- Watchdog_Control *the_watchdog
-);
-
-/*
- *
- * _Watchdog_Clear_sync
- *
- * DESCRIPTION:
- *
- * This routine will set the watchdog synchronization flag to a
- * NULL address indicating synchronization is unnecessary.
- */
-
-STATIC INLINE void _Watchdog_Clear_sync( void );
-
-/*
* _Watchdog_Adjust
*
* DESCRIPTION:
@@ -427,7 +374,7 @@ STATIC INLINE void _Watchdog_Clear_sync( void );
void _Watchdog_Adjust (
Chain_Control *header,
Watchdog_Adjust_directions direction,
- rtems_interval units
+ rtems_interval units
);
/*
diff --git a/cpukit/score/inline/rtems/score/watchdog.inl b/cpukit/score/inline/rtems/score/watchdog.inl
index d5d12cbeef..2e7dca0381 100644
--- a/cpukit/score/inline/rtems/score/watchdog.inl
+++ b/cpukit/score/inline/rtems/score/watchdog.inl
@@ -257,40 +257,5 @@ STATIC INLINE Watchdog_Control *_Watchdog_Last(
}
-/*PAGE
- *
- * _Watchdog_Get_sync
- *
- */
-
-STATIC INLINE Watchdog_Control *_Watchdog_Get_sync( void )
-{
- return (Watchdog_Control *) _Watchdog_Sync;
-}
-
-/*PAGE
- *
- * _Watchdog_Set_sync
- *
- */
-
-STATIC INLINE void _Watchdog_Set_sync(
- Watchdog_Control *the_watchdog
-)
-{
- _Watchdog_Sync = (Watchdog_Synchronization_pointer) the_watchdog;
-}
-
-/*PAGE
- *
- * _Watchdog_Clear_sync
- *
- */
-
-STATIC INLINE void _Watchdog_Clear_sync( void )
-{
- _Watchdog_Sync = NULL;
-}
-
#endif
/* end of include file */
diff --git a/cpukit/score/macros/rtems/score/watchdog.inl b/cpukit/score/macros/rtems/score/watchdog.inl
index 1b150d8dab..4e965420ce 100644
--- a/cpukit/score/macros/rtems/score/watchdog.inl
+++ b/cpukit/score/macros/rtems/score/watchdog.inl
@@ -171,32 +171,5 @@
#define _Watchdog_Last( _header ) \
((Watchdog_Control *) (_header)->last)
-/*PAGE
- *
- * _Watchdog_Get_sync
- *
- */
-
-#define _Watchdog_Get_sync() \
- ((Watchdog_Control *) _Watchdog_Sync)
-
-/*PAGE
- *
- * _Watchdog_Set_sync
- *
- */
-
-#define _Watchdog_Set_sync( _the_watchdog ) \
- _Watchdog_Sync = (Watchdog_Synchronization_pointer) (_the_watchdog)
-
-/*PAGE
- *
- * _Watchdog_Clear_sync
- *
- */
-
-#define _Watchdog_Clear_sync() \
- _Watchdog_Sync = NULL;
-
#endif
/* end of include file */
diff --git a/cpukit/score/src/heap.c b/cpukit/score/src/heap.c
index 485012ddf7..eb1c5d769e 100644
--- a/cpukit/score/src/heap.c
+++ b/cpukit/score/src/heap.c
@@ -116,8 +116,13 @@ Heap_Extend_status _Heap_Extend(
)
{
Heap_Block *the_block;
- Heap_Block *next_block;
- Heap_Block *previous_block;
+
+ /*
+ * The overhead was taken from the original heap memory.
+ */
+
+ Heap_Block *old_final;
+ Heap_Block *new_final;
/*
* There are five possibilities for the location of starting
@@ -150,24 +155,27 @@ Heap_Extend_status _Heap_Extend(
/*
* Currently only case 4 should make it to this point.
+ * The basic trick is to make the extend area look like a used
+ * block and free it.
*/
- *amount_extended = size - HEAP_BLOCK_USED_OVERHEAD;
+ *amount_extended = size;
- previous_block = the_heap->last;
+ old_final = the_heap->final;
+ new_final = _Addresses_Add_offset( old_final, size );
+ /* SAME AS: _Addresses_Add_offset( starting_address, size-HEAP_OVERHEAD ); */
- the_block = (Heap_Block *) starting_address;
- the_block->front_flag = size;
- the_block->next = previous_block->next;
- the_block->previous = previous_block;
+ the_heap->final = new_final;
- previous_block->next = the_block;
- the_heap->last = the_block;
+ old_final->front_flag =
+ new_final->back_flag = _Heap_Build_flag( size, HEAP_BLOCK_USED );
+ new_final->front_flag = HEAP_DUMMY_FLAG;
- next_block = _Heap_Next_block( the_block );
- next_block->back_flag = size;
- next_block->front_flag = HEAP_DUMMY_FLAG;
- the_heap->final = next_block;
+ /*
+ * Must pass in address of "user" area
+ */
+
+ _Heap_Free( the_heap, &old_final->next );
return HEAP_EXTEND_SUCCESSFUL;
}
@@ -392,8 +400,8 @@ void _Heap_Walk(
boolean do_dump
)
{
- Heap_Block *the_block;
- Heap_Block *next_block;
+ Heap_Block *the_block = 0; /* avoid warnings */
+ Heap_Block *next_block = 0; /* avoid warnings */
int notdone = 1;
/*
diff --git a/cpukit/score/src/watchdog.c b/cpukit/score/src/watchdog.c
index 7db26c0cd5..3c46f9b535 100644
--- a/cpukit/score/src/watchdog.c
+++ b/cpukit/score/src/watchdog.c
@@ -30,7 +30,8 @@
void _Watchdog_Handler_initialization( void )
{
- _Watchdog_Clear_sync();
+ _Watchdog_Sync_count = 0;
+ _Watchdog_Sync_level = 0;
_Chain_Initialize_empty( &_Watchdog_Ticks_chain );
_Chain_Initialize_empty( &_Watchdog_Seconds_chain );
}
@@ -56,8 +57,17 @@ Watchdog_States _Watchdog_Remove(
switch ( previous_state ) {
case WATCHDOG_INACTIVE:
break;
+
+ case WATCHDOG_REINSERT:
+
+ /*
+ * It is not actually on the chain so just change the state and
+ * the Insert operation we interrupted will be aborted.
+ */
+ the_watchdog->state = WATCHDOG_INACTIVE;
+ break;
+
case WATCHDOG_ACTIVE:
- case WATCHDOG_REINSERT:
case WATCHDOG_REMOVE_IT:
the_watchdog->state = WATCHDOG_INACTIVE;
@@ -66,8 +76,8 @@ Watchdog_States _Watchdog_Remove(
if ( _Watchdog_Next(next_watchdog) )
next_watchdog->delta_interval += the_watchdog->delta_interval;
- if ( the_watchdog == _Watchdog_Sync )
- _Watchdog_Sync = _Watchdog_Previous( the_watchdog );
+ if ( _Watchdog_Sync_count )
+ _Watchdog_Sync_level = _ISR_Nest_level;
_Chain_Extract_unprotected( &the_watchdog->Node );
break;
@@ -94,7 +104,7 @@ Watchdog_States _Watchdog_Remove(
void _Watchdog_Adjust(
Chain_Control *header,
Watchdog_Adjust_directions direction,
- rtems_interval units
+ rtems_interval units
)
{
if ( !_Chain_Is_empty( header ) ) {
@@ -136,45 +146,66 @@ void _Watchdog_Insert(
{
ISR_Level level;
Watchdog_Control *after;
+ unsigned32 insert_isr_nest_level;
+ rtems_interval delta_interval;
+
+
+ insert_isr_nest_level = _ISR_Nest_level;
+ the_watchdog->state = WATCHDOG_REINSERT;
- the_watchdog->state = WATCHDOG_REINSERT;
- the_watchdog->delta_interval = the_watchdog->initial;
+ _Watchdog_Sync_count++;
+restart:
+ delta_interval = the_watchdog->initial;
_ISR_Disable( level );
for ( after = _Watchdog_First( header ) ;
;
- after = _Watchdog_Next( _Watchdog_Get_sync() ) ) {
+ after = _Watchdog_Next( after ) ) {
- if ( the_watchdog->delta_interval == 0 || !_Watchdog_Next( after ) )
+ if ( delta_interval == 0 || !_Watchdog_Next( after ) )
break;
- if ( the_watchdog->delta_interval < after->delta_interval ) {
- after->delta_interval -= the_watchdog->delta_interval;
+ if ( delta_interval < after->delta_interval ) {
+ after->delta_interval -= delta_interval;
break;
}
- the_watchdog->delta_interval -= after->delta_interval;
- _Watchdog_Set_sync( after );
+ delta_interval -= after->delta_interval;
/*
- * If you experience problems comment out the _ISR_Flash line. Under
- * certain circumstances, this flash allows interrupts to execute
- * which violate the design assumptions. The critical section
- * mechanism used here must be redesigned to address this.
+ * If you experience problems comment out the _ISR_Flash line. This
+ * (3.2.0) is the first release with this critical section redesigned.
+ * Under certain circumstances, the PREVIOUS critical section algorithm
+ * used around this flash point allows interrupts to execute
+ * which violated the design assumptions. The critical section
+ * mechanism used here WAS redesigned to address this.
*/
_ISR_Flash( level );
+
+ if ( the_watchdog->state != WATCHDOG_REINSERT ) {
+ goto exit_insert;
+ }
+
+ if ( _Watchdog_Sync_level > insert_isr_nest_level ) {
+ _Watchdog_Sync_level = insert_isr_nest_level;
+ _ISR_Enable( level );
+ goto restart;
+ }
}
if ( insert_mode == WATCHDOG_ACTIVATE_NOW )
_Watchdog_Activate( the_watchdog );
- _Chain_Insert_unprotected( after->Node.previous, &the_watchdog->Node );
+ the_watchdog->delta_interval = delta_interval;
- _Watchdog_Clear_sync();
+ _Chain_Insert_unprotected( after->Node.previous, &the_watchdog->Node );
- _ISR_Enable( level );
+exit_insert:
+ _Watchdog_Sync_level = insert_isr_nest_level;
+ _Watchdog_Sync_count--;
+ _ISR_Enable( level );
}
/*PAGE
diff --git a/testsuites/mptests/mp01/task1.c b/testsuites/mptests/mp01/task1.c
index a2c3ec3a1d..465ae7063e 100644
--- a/testsuites/mptests/mp01/task1.c
+++ b/testsuites/mptests/mp01/task1.c
@@ -21,7 +21,7 @@
* to the copyright license under the clause at DFARS 252.227-7013. This
* notice must appear in all copies of this file and its derivatives.
*
- * $Id$
+ * task1.c,v 1.2 1995/05/09 20:26:24 joel Exp
*/
#include "system.h"
@@ -43,7 +43,7 @@ rtems_task Test_task(
put_name( Task_name[ task_number( tid ) ], FALSE );
print_time( " - rtems_clock_get - ", &time, "\n" );
- status = rtems_task_wake_after( task_number( tid ) * 5 * TICKS_PER_SECOND );
+ status = rtems_task_wake_after( task_number( tid ) * 1 * TICKS_PER_SECOND );
directive_failed( status, "rtems_task_wake_after" );
status = rtems_clock_get( RTEMS_CLOCK_GET_TOD, &time );
diff --git a/testsuites/sptests/sp04/tswitch.c b/testsuites/sptests/sp04/tswitch.c
index 3f0c2047bc..250ec5c9a7 100644
--- a/testsuites/sptests/sp04/tswitch.c
+++ b/testsuites/sptests/sp04/tswitch.c
@@ -18,7 +18,7 @@
* to the copyright license under the clause at DFARS 252.227-7013. This
* notice must appear in all copies of this file and its derivatives.
*
- * $Id$
+ * tswitch.c,v 1.2 1995/05/09 20:32:43 joel Exp
*/
#include "system.h"
@@ -44,7 +44,7 @@ rtems_extension Task_switch(
directive_failed( status, "rtems_clock_get" );
put_name( Task_name[ index ], FALSE );
- print_time( " - ", &time, "\n" );
+ print_time( "- ", &time, "\n" );
if ( time.second >= 16 ) {
puts( "*** END OF TEST 4 ***" );
diff --git a/testsuites/sptests/sp09/screen14.c b/testsuites/sptests/sp09/screen14.c
index bf80f04c3c..c0e75b1b98 100644
--- a/testsuites/sptests/sp09/screen14.c
+++ b/testsuites/sptests/sp09/screen14.c
@@ -76,14 +76,6 @@ void Screen14()
);
puts( "TA1 - rtems_timer_cancel - RTEMS_INVALID_ID" );
- status = rtems_timer_cancel( Timer_id[ 1 ] );
- fatal_directive_status(
- status,
- RTEMS_INCORRECT_STATE,
- "rtems_timer_cancel before initiated"
- );
- puts( "TA1 - rtems_timer_cancel - RTEMS_INCORRECT_STATE" );
-
status = rtems_timer_reset( 0x010100 );
fatal_directive_status(
status,
diff --git a/testsuites/sptests/sp09/sp09.scn b/testsuites/sptests/sp09/sp09.scn
index 534fc47e09..158593dcba 100644
--- a/testsuites/sptests/sp09/sp09.scn
+++ b/testsuites/sptests/sp09/sp09.scn
@@ -237,7 +237,6 @@ TA1 - rtems_timer_delete - local RTEMS_INVALID_ID
TA1 - rtems_timer_delete - global RTEMS_INVALID_ID
TA1 - rtems_timer_ident - RTEMS_INVALID_NAME
TA1 - rtems_timer_cancel - RTEMS_INVALID_ID
-TA1 - rtems_timer_cancel - RTEMS_INCORRECT_STATE
TA1 - rtems_timer_reset - RTEMS_INVALID_ID
TA1 - rtems_timer_reset - RTEMS_NOT_DEFINED
TA1 - rtems_timer_fire_after - RTEMS_INVALID_ID
diff --git a/testsuites/sptests/sp20/sp20.scn b/testsuites/sptests/sp20/sp20.scn
index 1de3c18db8..9e71a3d003 100644
--- a/testsuites/sptests/sp20/sp20.scn
+++ b/testsuites/sptests/sp20/sp20.scn
@@ -13,7 +13,7 @@ TA4 - rtems_rate_monotonic_ident id = 0x00010004
TA4 - (0x00010004) period 2
TA5 - rtems_rate_monotonic_create id = 0x00010005
TA5 - rtems_rate_monotonic_ident id = 0x00010005
-TA5 - (0x00010005) period 50
+TA5 - (0x00010005) period 100
TA5 - PERIODS CHECK OK (1)
TA5 - PERIODS CHECK OK (2)
TA5 - PERIODS CHECK OK (3)
diff --git a/testsuites/sptests/spsize/size.c b/testsuites/sptests/spsize/size.c
index 52404272fd..e890807ca3 100644
--- a/testsuites/sptests/spsize/size.c
+++ b/testsuites/sptests/spsize/size.c
@@ -332,7 +332,8 @@ uninitialized =
/*watchdog.h*/ (sizeof _Watchdog_Ticks_chain) +
(sizeof _Watchdog_Seconds_chain) +
- (sizeof _Watchdog_Sync) +
+ (sizeof _Watchdog_Sync_count) +
+ (sizeof _Watchdog_Sync_level) +
/*wkspace.h*/ (sizeof _Workspace_Area);
diff --git a/tools/cpu/hppa1.1/genoffsets.c b/tools/cpu/hppa1.1/genoffsets.c
index 6563681f11..3820620b3a 100644
--- a/tools/cpu/hppa1.1/genoffsets.c
+++ b/tools/cpu/hppa1.1/genoffsets.c
@@ -1,12 +1,12 @@
/*
- * @(#)genoffsets.c 1.3 - 95/03/15
- *
+ * @(#)genoffsets.c 1.5 - 95/05/16
+ *
*
* 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.
@@ -16,7 +16,7 @@
* to the copyright license under the clause at DFARS 252.227-7013. This
* notice must appear in all copies of this file and its derivatives.
*
- * $Id$
+ * genoffsets.c,v 1.2 1995/05/09 20:16:48 joel Exp
*
*/