summaryrefslogtreecommitdiffstats
path: root/c/src/exec/score
diff options
context:
space:
mode:
Diffstat (limited to 'c/src/exec/score')
-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
30 files changed, 353 insertions, 576 deletions
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
*
*/