Updates from Derrick Ostertag <ostertag@transition.com> to fix bug in

interrupt handling.
This commit is contained in:
Joel Sherrill
1996-12-02 19:48:29 +00:00
parent f4b7e29710
commit 29d8227e6d
5 changed files with 63 additions and 23 deletions

View File

@@ -10,7 +10,7 @@
* $Id$
*
*/
/* @(#)a29k.h 09/12/96 1.2 */
/* @(#)a29k.h 10/21/96 1.3 */
#ifndef _INCLUDE_A29K_h
#define _INCLUDE_A29K_h
@@ -67,6 +67,12 @@ extern "C" {
#define CPU_NAME "AMD 29K"
/*
* Some bits in the CPS:
*/
#define TD 0x20000
#define DI 0x00002
#ifdef __cplusplus
}
#endif

View File

@@ -29,7 +29,7 @@
* $Id$
*/
#ifndef lint
static char _sccsid[] = "@(#)cpu.c 21 Aug 1996 1.6\n";
static char _sccsid[] = "@(#)cpu.c 10/21/96 1.8\n";
#endif
#include <rtems/system.h>
@@ -94,10 +94,16 @@ void _CPU_Initialize(
unsigned32 _CPU_ISR_Get_level( void )
{
unsigned32 cps;
/*
* This routine returns the current interrupt level.
*/
return 0;
cps = a29k_getops();
if (cps & (TD|DI))
return 1;
else
return 0;
}
/*PAGE
@@ -106,8 +112,8 @@ unsigned32 _CPU_ISR_Get_level( void )
*/
extern void intr14( void );
extern void intr3( void );
extern void intr2( void );
extern void intr18( void );
extern void intr19( void );
void _CPU_ISR_install_raw_handler(
unsigned32 vector,
@@ -124,12 +130,13 @@ void _CPU_ISR_install_raw_handler(
case 14:
_settrap( vector, intr14 );
break;
case 3:
_settrap( vector, intr3 );
case 18:
_settrap( vector, intr18 );
break;
case 2:
_settrap( vector, intr2 );
case 19:
_settrap( vector, intr19 );
break;
default:
break;
}

View File

@@ -30,7 +30,7 @@
*
* $Id$
*/
/* @(#)cpu.h 09/06/96 1.10 */
/* @(#)cpu.h 10/21/96 1.11 */
#ifndef __CPU_h
#define __CPU_h
@@ -46,6 +46,8 @@ extern "C" {
extern unsigned int a29k_disable( void );
extern void a29k_enable( unsigned int cookie );
extern unsigned int a29k_getops( void );
extern void a29k_getops_sup( void );
extern void a29k_disable_sup( void );
extern void a29k_enable_sup( void );
extern void a29k_disable_all( void );
@@ -655,6 +657,9 @@ extern void _CPU_Context_save(
(_the_context)->local_count = 1-1; \
(_the_context)->PC1 = _entry_point; \
(_the_context)->PC0 = (unsigned32)((char *)_entry_point + 4); \
if (_isr) { (_the_context)->OPS |= (TD | DI); } \
else \
{ (_the_context)->OPS &= ~(TD | DI); } \
}while(0)
/*

View File

@@ -391,6 +391,18 @@ __CPU_Context_save:
; jmpi lr0
; nop
.global _a29k_getops
_a29k_getops:
asneq 113, gr96, gr96
jmpi lr0
nop
.global _a29k_getops_sup
_a29k_getops_sup:
mfsr gr96, ops ; caller wants ops
iret
nop
.global _a29k_disable
_a29k_disable:
asneq 110, gr96, gr96
@@ -400,6 +412,7 @@ _a29k_disable:
.global _a29k_disable_sup
_a29k_disable_sup:
mfsr kt0, ops
add gr96, kt0, 0 ; return ops to caller
const kt1, (DI | TD)
consth kt1, (DI | TD)
or kt1, kt0, kt1
@@ -416,8 +429,8 @@ _a29k_disable_all:
.global _a29k_disable_all_sup
_a29k_disable_all_sup:
mfsr kt0, ops
const kt1, DA
consth kt1, DA
const kt1, (DI | TD)
consth kt1, (DI | TD)
or kt1, kt0, kt1
mtsr ops, kt1
iret
@@ -432,8 +445,8 @@ _a29k_enable_all:
.global _a29k_enable_all_sup
_a29k_enable_all_sup:
mfsr kt0, ops
const kt1, DA
consth kt1, DA
const kt1, (DI | TD)
consth kt1, (DI | TD)
andn kt1, kt0, kt1
mtsr ops, kt1
iret
@@ -450,7 +463,9 @@ _a29k_enable_sup:
mfsr kt0, ops
const kt1, (DI | TD)
consth kt1, (DI | TD)
andn kt1, kt0, kt1
and kt3, lr2, kt1
andn kt0, kt0, kt1
or kt1, kt0, kt3
mtsr ops, kt1
iret
nop

View File

@@ -29,7 +29,7 @@
* $Id$
*/
#ifndef lint
static char _sccsid[] = "@(#)cpu.c 21 Aug 1996 1.6\n";
static char _sccsid[] = "@(#)cpu.c 10/21/96 1.8\n";
#endif
#include <rtems/system.h>
@@ -94,10 +94,16 @@ void _CPU_Initialize(
unsigned32 _CPU_ISR_Get_level( void )
{
unsigned32 cps;
/*
* This routine returns the current interrupt level.
*/
return 0;
cps = a29k_getops();
if (cps & (TD|DI))
return 1;
else
return 0;
}
/*PAGE
@@ -106,8 +112,8 @@ unsigned32 _CPU_ISR_Get_level( void )
*/
extern void intr14( void );
extern void intr3( void );
extern void intr2( void );
extern void intr18( void );
extern void intr19( void );
void _CPU_ISR_install_raw_handler(
unsigned32 vector,
@@ -124,12 +130,13 @@ void _CPU_ISR_install_raw_handler(
case 14:
_settrap( vector, intr14 );
break;
case 3:
_settrap( vector, intr3 );
case 18:
_settrap( vector, intr18 );
break;
case 2:
_settrap( vector, intr2 );
case 19:
_settrap( vector, intr19 );
break;
default:
break;
}