diff options
author | Joel Sherrill <joel.sherrill@OARcorp.com> | 1995-05-24 21:39:42 +0000 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@OARcorp.com> | 1995-05-24 21:39:42 +0000 |
commit | 88d594a3d52cb5938521619bca0def8e5b040cf0 (patch) | |
tree | c687a29a2a3d62c87e496c4c4700183f17210a5c /c/src/exec/score/cpu | |
parent | Forcing RCS revision to 1.2 I hope (diff) | |
download | rtems-88d594a3d52cb5938521619bca0def8e5b040cf0.tar.bz2 |
Fully tested on all in-house targets
Diffstat (limited to '')
-rw-r--r-- | c/src/exec/score/cpu/hppa1.1/cpu.c | 2 | ||||
-rw-r--r-- | c/src/exec/score/cpu/hppa1.1/cpu.h | 7 | ||||
-rw-r--r-- | c/src/exec/score/cpu/hppa1.1/cpu_asm.h | 2 | ||||
-rw-r--r-- | c/src/exec/score/cpu/hppa1.1/cpu_asm.s | 4 | ||||
-rw-r--r-- | c/src/exec/score/cpu/hppa1.1/hppa.h | 236 | ||||
-rw-r--r-- | c/src/exec/score/cpu/hppa1.1/rtems.s | 4 | ||||
-rw-r--r-- | c/src/exec/score/cpu/i386/asm.h | 2 | ||||
-rw-r--r-- | c/src/exec/score/cpu/i386/cpu.h | 5 | ||||
-rw-r--r-- | c/src/exec/score/cpu/i386/i386.h | 47 | ||||
-rw-r--r-- | c/src/exec/score/cpu/i960/asm.h | 2 | ||||
-rw-r--r-- | c/src/exec/score/cpu/i960/cpu.h | 5 | ||||
-rw-r--r-- | c/src/exec/score/cpu/i960/i960.h | 74 | ||||
-rw-r--r-- | c/src/exec/score/cpu/m68k/asm.h | 2 | ||||
-rw-r--r-- | c/src/exec/score/cpu/m68k/cpu.h | 5 | ||||
-rw-r--r-- | c/src/exec/score/cpu/m68k/m68k.h | 38 | ||||
-rw-r--r-- | c/src/exec/score/cpu/no_cpu/asm.h | 2 | ||||
-rw-r--r-- | c/src/exec/score/cpu/no_cpu/cpu.h | 5 | ||||
-rw-r--r-- | c/src/exec/score/cpu/no_cpu/no_cpu.h | 40 | ||||
-rw-r--r-- | c/src/exec/score/cpu/unix/cpu.c | 25 | ||||
-rw-r--r-- | c/src/exec/score/cpu/unix/cpu.h | 8 | ||||
-rw-r--r-- | c/src/exec/score/cpu/unix/unix.h | 49 |
21 files changed, 266 insertions, 298 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 */ |