mirror of
git://sourceware.org/git/newlib-cygwin.git
synced 2025-02-28 03:27:46 +08:00
2002-10-04 Michael Snyder <msnyder@redhat.com>
* m32r/m32r-lib.c (exceptionHandler): Fix computation of exception vector address, as suggested by Mitsubishi. (getExceptionVector): Ditto.
This commit is contained in:
parent
2ed0e93ccc
commit
f545964009
@ -7,6 +7,12 @@
|
|||||||
* mips/ddb.ld: KEEP .init and .fini.
|
* mips/ddb.ld: KEEP .init and .fini.
|
||||||
* mips/ddb-kseg0.ld: Likewise.
|
* mips/ddb-kseg0.ld: Likewise.
|
||||||
|
|
||||||
|
2002-10-04 Michael Snyder <msnyder@redhat.com>
|
||||||
|
|
||||||
|
* m32r/m32r-lib.c (exceptionHandler): Fix computation of
|
||||||
|
exception vector address, as suggested by Mitsubishi.
|
||||||
|
(getExceptionVector): Ditto.
|
||||||
|
|
||||||
2002-08-01 Chris Demetriou <cgd@broadcom.com>
|
2002-08-01 Chris Demetriou <cgd@broadcom.com>
|
||||||
|
|
||||||
* mips/cfe.ld (STARTUP): New definition.
|
* mips/cfe.ld (STARTUP): New definition.
|
||||||
|
@ -109,15 +109,22 @@ void phex(long x)
|
|||||||
mesg(buf);
|
mesg(buf);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Setup trap TT to go to ROUTINE. */
|
/*
|
||||||
|
* These routines set and get exception handlers. They look a little
|
||||||
|
* funny because the M32R uses branch instructions in its exception
|
||||||
|
* vectors, not just the addresses. The instruction format used is
|
||||||
|
* BRA pcdisp24.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define TRAP_VECTOR_BASE_ADDR 0x00000040
|
||||||
|
|
||||||
|
/* Setup trap TT to go to ROUTINE. */
|
||||||
void
|
void
|
||||||
exceptionHandler (int tt, unsigned long routine)
|
exceptionHandler (int tt, unsigned long routine)
|
||||||
{
|
{
|
||||||
#ifndef REVC
|
#ifndef REVC
|
||||||
unsigned long *tb = (unsigned long *) 0x40; /* Trap vector base address */
|
unsigned long *tb = (unsigned long *) TRAP_VECTOR_BASE_ADDR;
|
||||||
|
tb[tt] = (0xff000000 | ((routine - (unsigned long) (&tb[tt])) >> 2));
|
||||||
tb[tt] = ((routine >> 2) | 0xff000000) - tt - (0x40 >> 2);
|
|
||||||
#else
|
#else
|
||||||
unsigned long *tb = 0; /* Trap vector base address */
|
unsigned long *tb = 0; /* Trap vector base address */
|
||||||
|
|
||||||
@ -126,14 +133,12 @@ exceptionHandler (int tt, unsigned long routine)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Return the address of trap TT handler */
|
/* Return the address of trap TT handler */
|
||||||
|
|
||||||
unsigned long
|
unsigned long
|
||||||
getExceptionHandler (int tt)
|
getExceptionHandler (int tt)
|
||||||
{
|
{
|
||||||
#ifndef REVC
|
#ifndef REVC
|
||||||
unsigned long *tb = (unsigned long *) 0x40; /* Trap vector base address */
|
unsigned long *tb = (unsigned long *) TRAP_VECTOR_BASE_ADDR;
|
||||||
|
return ((tb[tt] & ~0xff000000) << 2) + (unsigned long) (&tb[tt]);
|
||||||
return ((tb[tt] + tt + (0x40 >> 2)) | 0xff000000) << 2;
|
|
||||||
#else
|
#else
|
||||||
unsigned long *tb = 0; /* Trap vector base address */
|
unsigned long *tb = 0; /* Trap vector base address */
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user