summaryrefslogtreecommitdiffstats
path: root/c/src/lib/libbsp/powerpc/shared/vectors/vectors_init.c
diff options
context:
space:
mode:
authorTill Straumann <strauman@slac.stanford.edu>2005-12-02 02:47:23 +0000
committerTill Straumann <strauman@slac.stanford.edu>2005-12-02 02:47:23 +0000
commitd8ada5b617c70f3b94a3c6117958b62e8e0cb9e4 (patch)
treec3f1eda21f8ba34740ee482fb6a03beba3c725fa /c/src/lib/libbsp/powerpc/shared/vectors/vectors_init.c
parent2005-11-29 Till Straumann <strauman@slac.stanford.edu> (diff)
downloadrtems-d8ada5b617c70f3b94a3c6117958b62e8e0cb9e4.tar.bz2
2005-12-01 Till Straumann <strauman@slac.stanford.edu>
* shared/vectors/vectors.h, shared/vectors/vectors.S, shared/vectors/vectors_init.c: Reduced size of default prologue (some exceptions, e.g., altivec unavail.) are only 0x20 bytes apart. Also introduced a modified prologue that switches r0..r3 shadowing off (r0..r3 undefined on certain 603e variants when incurring a TLB miss).
Diffstat (limited to 'c/src/lib/libbsp/powerpc/shared/vectors/vectors_init.c')
-rw-r--r--c/src/lib/libbsp/powerpc/shared/vectors/vectors_init.c23
1 files changed, 21 insertions, 2 deletions
diff --git a/c/src/lib/libbsp/powerpc/shared/vectors/vectors_init.c b/c/src/lib/libbsp/powerpc/shared/vectors/vectors_init.c
index 873e1c08ca..75f57898c3 100644
--- a/c/src/lib/libbsp/powerpc/shared/vectors/vectors_init.c
+++ b/c/src/lib/libbsp/powerpc/shared/vectors/vectors_init.c
@@ -12,12 +12,15 @@
*
* $Id$
*/
+#include <rtems.h>
+#include <bsp.h>
+
#include <rtems/bspIo.h>
#include <bsp/vectors.h>
#include <libcpu/raw_exception.h>
#include <libcpu/spr.h>
-#include <bsp.h>
+#include <libcpu/cpuIdent.h>
static rtems_raw_except_global_settings exception_config;
static rtems_raw_except_connect_data exception_table[LAST_VALID_EXC + 1];
@@ -143,6 +146,7 @@ int mpc60x_vector_is_valid(rtems_vector vector);
void initialize_exceptions()
{
int i;
+ int has_shadowed_gprs = 0;
/*
* Initialize pointer used by low level execption handling
@@ -162,12 +166,27 @@ void initialize_exceptions()
* is not a bug as it is defined a .set directly in asm...
*/
exception_config.defaultRawEntry.hdl.raw_hdl_size = (unsigned) default_exception_vector_code_prolog_size;
+
+ switch ( get_ppc_cpu_type() ) {
+ case PPC_603e:
+ case PPC_8240:
+ has_shadowed_gprs = 1;
+ default: break;
+ }
for (i=0; i <= exception_config.exceptSize; i++) {
if (!mpc60x_vector_is_valid (i)) {
continue;
}
exception_table[i].exceptIndex = i;
- exception_table[i].hdl = exception_config.defaultRawEntry.hdl;
+ if ( has_shadowed_gprs
+ && ( ASM_IMISS_VECTOR == i
+ || ASM_DLMISS_VECTOR == i
+ || ASM_DSMISS_VECTOR == i ) ) {
+ exception_table[i].hdl.raw_hdl = tgpr_clr_exception_vector_code_prolog;
+ exception_table[i].hdl.raw_hdl_size = (unsigned)tgpr_clr_exception_vector_code_prolog_size;
+ } else {
+ exception_table[i].hdl = exception_config.defaultRawEntry.hdl;
+ }
exception_table[i].hdl.vector = i;
exception_table[i].on = nop_except_enable;
exception_table[i].off = nop_except_enable;