mirror of
https://gitlab.rtems.org/rtems/rtos/rtems.git
synced 2026-11-16 19:04:53 +08:00
Reworked score/cpu/i960 so it can be safely compiled multilib. All
routines and structures that require CPU model specific information are now in libcpu. This required significant rework of the score/cpu header files and the creation of multiple header files and subdirectories in libcpu/i960.
This commit is contained in:
1 parent
9e52b29cbc
commit
bc85fd5a6d
44 files changed
+948
-1141
No files matched your search
@@ -10,7 +10,7 @@ SUBDIRS = rtems
|
||||
C_FILES = cpu.c
|
||||
C_O_FILES = $(C_FILES:%.c=$(ARCH)/%.o)
|
||||
|
||||
H_FILES = asm.h i960RP.h
|
||||
H_FILES = asm.h
|
||||
|
||||
S_FILES = cpu_asm.S
|
||||
S_O_FILES = $(S_FILES:%.S=$(ARCH)/%.o)
|
||||
|
||||
@@ -11,18 +11,6 @@
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
/*
|
||||
* 1999/04/26: added support for Intel i960RP
|
||||
*/
|
||||
|
||||
#if defined(__i960CA__) || defined(__i960_CA__) || defined(__i960CA)
|
||||
#elif defined(__i960RP__)
|
||||
#elif defined(__i960KA__)
|
||||
|
||||
#else
|
||||
#warning "*** ENTIRE FILE IMPLEMENTED & TESTED FOR CA & RP ONLY ***"
|
||||
#warning "*** THIS FILE WILL NOT COMPILE ON ANOTHER FAMILY MEMBER ***"
|
||||
#endif
|
||||
|
||||
#include <rtems/system.h>
|
||||
#include <rtems/score/isr.h>
|
||||
@@ -62,45 +50,6 @@ unsigned32 _CPU_ISR_Get_level( void )
|
||||
return level;
|
||||
}
|
||||
|
||||
/*PAGE
|
||||
*
|
||||
* _CPU_ISR_install_raw_handler
|
||||
*/
|
||||
|
||||
#if defined(__i960CA__) || defined(__i960_CA__) || defined(__i960CA)
|
||||
#define i960_vector_caching_enabled( _prcb ) \
|
||||
((_prcb)->control_tbl->icon & 0x2000)
|
||||
#elif defined(__i960RP__)
|
||||
#define i960_vector_caching_enabled( _prcb ) \
|
||||
((*((unsigned int *) ICON_ADDR)) & 0x2000)
|
||||
#elif defined(__i960KA__)
|
||||
#define i960_vector_caching_enabled( _prcb ) 0
|
||||
#endif
|
||||
|
||||
void _CPU_ISR_install_raw_handler(
|
||||
unsigned32 vector,
|
||||
proc_ptr new_handler,
|
||||
proc_ptr *old_handler
|
||||
)
|
||||
{
|
||||
i960_PRCB *prcb = _CPU_Table.Prcb;
|
||||
proc_ptr *cached_intr_tbl = NULL;
|
||||
|
||||
/* The i80960CA does not support vectors 0-7. The first 9 entries
|
||||
* in the Interrupt Table are used to manage pending interrupts.
|
||||
* Thus vector 8, the first valid vector number, is actually in
|
||||
* slot 9 in the table.
|
||||
*/
|
||||
|
||||
*old_handler = prcb->intr_tbl[ vector + 1 ];
|
||||
|
||||
prcb->intr_tbl[ vector + 1 ] = new_handler;
|
||||
|
||||
if ( i960_vector_caching_enabled( prcb ) )
|
||||
if ( (vector & 0xf) == 0x2 ) /* cacheable? */
|
||||
cached_intr_tbl[ vector >> 4 ] = new_handler;
|
||||
}
|
||||
|
||||
/*PAGE
|
||||
*
|
||||
* _CPU__ISR_install_vector
|
||||
@@ -130,60 +79,3 @@ void _CPU_ISR_install_vector(
|
||||
|
||||
_ISR_Vector_table[ vector ] = new_handler;
|
||||
}
|
||||
|
||||
/*PAGE
|
||||
*
|
||||
* _CPU_Install_interrupt_stack
|
||||
*/
|
||||
|
||||
#if defined(__i960CA__) || defined(__i960_CA__) || defined(__i960CA)
|
||||
#define soft_reset( prcb ) \
|
||||
{ register i960_PRCB *_prcb = (prcb); \
|
||||
register unsigned32 *_next=0; \
|
||||
register unsigned32 _cmd = 0x30000; \
|
||||
asm volatile( "lda next,%1; \
|
||||
sysctl %0,%1,%2; \
|
||||
next: mov g0,g0" \
|
||||
: "=d" (_cmd), "=d" (_next), "=d" (_prcb) \
|
||||
: "0" (_cmd), "1" (_next), "2" (_prcb) ); \
|
||||
}
|
||||
#elif defined(__i960RP__) || defined(__i960_RP__) || defined(__i960RP)
|
||||
#define soft_reset( prcb ) \
|
||||
{ register i960_PRCB *_prcb = (prcb); \
|
||||
register unsigned32 *_next=0; \
|
||||
register unsigned32 _cmd = 0x300; \
|
||||
asm volatile( "lda next,%1; \
|
||||
sysctl %0,%1,%2; \
|
||||
next: mov g0,g0" \
|
||||
: "=d" (_cmd), "=d" (_next), "=d" (_prcb) \
|
||||
: "0" (_cmd), "1" (_next), "2" (_prcb) ); \
|
||||
}
|
||||
#elif defined(__i960KA__)
|
||||
#define soft_reset( prcb )
|
||||
#endif
|
||||
|
||||
void _CPU_Install_interrupt_stack( void )
|
||||
{
|
||||
i960_PRCB *prcb = _CPU_Table.Prcb;
|
||||
unsigned32 level;
|
||||
#if defined(__i960RP__) || defined(__i960_RP__)
|
||||
unsigned32 *isp = (int *) ISP_ADDR;
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Set the Interrupt Stack in the PRCB and force a reload of it.
|
||||
* Interrupts are disabled for safety.
|
||||
*/
|
||||
|
||||
_CPU_ISR_Disable( level );
|
||||
|
||||
prcb->intr_stack = _CPU_Interrupt_stack_low;
|
||||
|
||||
#if defined(__i960CA__) || defined(__i960_CA__) || defined(__i960CA)
|
||||
soft_reset( prcb );
|
||||
#elif defined(__i960RP__) || defined(__i960_RP__) || defined(__i960RP)
|
||||
*isp = (unsigned32) prcb->intr_stack;
|
||||
#endif
|
||||
|
||||
_CPU_ISR_Enable( level );
|
||||
}
|
||||
@@ -1,7 +1,5 @@
|
||||
/* cpu_asm.s
|
||||
*
|
||||
* This file contains all assembly code for the i960CA implementation
|
||||
* of RTEMS.
|
||||
/*
|
||||
* This file contains all assembly code for the i960 port of RTEMS.
|
||||
*
|
||||
* COPYRIGHT (c) 1989-1999.
|
||||
* On-Line Applications Research Corporation (OAR).
|
||||
@@ -13,12 +11,6 @@
|
||||
* $Id$
|
||||
*/
|
||||
.data
|
||||
.align 4
|
||||
_soft_reset_reg_save:
|
||||
.word 0
|
||||
.word 0
|
||||
.word 0
|
||||
.word 0
|
||||
_ISR_reg_save:
|
||||
.word 0
|
||||
.word 0
|
||||
@@ -217,30 +209,3 @@ __ISR_Dispatch:
|
||||
movq r12,g4
|
||||
ret
|
||||
|
||||
|
||||
#if !defined(__i960KA__)
|
||||
/*PAGE
|
||||
*
|
||||
* void __i960_soft_reset_asm
|
||||
*
|
||||
* Flush the register cache and save the important (fp, pfp, sp) registers,
|
||||
* which are clobbered by the reinit operation. (Not documented, but it happens).
|
||||
*/
|
||||
|
||||
.globl __i960_soft_reset_asm
|
||||
__i960_soft_reset_asm:
|
||||
flushreg # flush register cache
|
||||
mov fp, r4
|
||||
mov pfp, r5
|
||||
mov sp, r6
|
||||
stt r4, _soft_reset_reg_save # save fp, pfp, sp
|
||||
lda __i960_reset_done, r4
|
||||
ldconst 0x300, r5
|
||||
sysctl r5, r4, g0 # reinit: clobbers almost all registers
|
||||
__i960_reset_done:
|
||||
ldt _soft_reset_reg_save, r4 # restore fp, pfp, sp
|
||||
mov r4, fp
|
||||
mov r5, pfp
|
||||
mov r6, sp
|
||||
ret
|
||||
#endif
|
||||
File diff suppressed because it is too large.
Load diff
@@ -165,8 +165,6 @@ typedef struct {
|
||||
void * (*stack_allocate_hook)( unsigned32 );
|
||||
void (*stack_free_hook)( void* );
|
||||
/* end of fields required on all CPUs */
|
||||
|
||||
i960_PRCB *Prcb;
|
||||
} rtems_cpu_table;
|
||||
|
||||
/*
|
||||
@@ -176,11 +174,10 @@ typedef struct {
|
||||
|
||||
/*
|
||||
* Macros to access i960 specific additions to the CPU Table
|
||||
*
|
||||
* NONE
|
||||
*/
|
||||
|
||||
#define rtems_cpu_configuration_get_prcb() \
|
||||
(_CPU_Table.Prcb)
|
||||
|
||||
/* variables */
|
||||
|
||||
SCORE_EXTERN void *_CPU_Interrupt_stack_low;
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
Reference in new issue
Block a user