summaryrefslogtreecommitdiffstats
path: root/c/src/lib/libcpu/powerpc/mpc6xx/exceptions/raw_exception.c
diff options
context:
space:
mode:
Diffstat (limited to 'c/src/lib/libcpu/powerpc/mpc6xx/exceptions/raw_exception.c')
-rw-r--r--c/src/lib/libcpu/powerpc/mpc6xx/exceptions/raw_exception.c31
1 files changed, 27 insertions, 4 deletions
diff --git a/c/src/lib/libcpu/powerpc/mpc6xx/exceptions/raw_exception.c b/c/src/lib/libcpu/powerpc/mpc6xx/exceptions/raw_exception.c
index e1770ebd58..5f697bfb0f 100644
--- a/c/src/lib/libcpu/powerpc/mpc6xx/exceptions/raw_exception.c
+++ b/c/src/lib/libcpu/powerpc/mpc6xx/exceptions/raw_exception.c
@@ -36,12 +36,29 @@ void * codemove(void *, const void *, unsigned int, unsigned long);
void* mpc60x_get_vector_addr(rtems_vector vector)
{
+ unsigned vaddr = ((unsigned)vector) << 8;
extern rtems_cpu_table Cpu_table;
+ /* Special case; altivec unavailable doesn't fit :-( */
+ if ( ASM_VEC_VECTOR == vector )
+ vaddr = ASM_VEC_VECTOR_OFFSET;
+
if ( Cpu_table.exceptions_in_RAM )
- return ((void*) (((unsigned) vector) << 8));
+ return ((void*) vaddr);
+
+ return ((void*) (vaddr + 0xfff00000));
+}
- return ((void*) (((unsigned) vector) << 8) + 0xfff00000);
+int altivec_vector_is_valid(rtems_vector vector)
+{
+ switch(vector) {
+ case ASM_VEC_VECTOR:
+ case ASM_VEC_ASSIST_VECTOR:
+ return 1;
+ default:
+ break;
+ }
+ return 0;
}
int mpc750_vector_is_valid(rtems_vector vector)
@@ -160,16 +177,22 @@ int mpc60x_vector_is_valid(rtems_vector vector)
{
switch (current_ppc_cpu) {
case PPC_7400:
+ if ( altivec_vector_is_valid(vector) )
+ return 1;
+ /* else fall thru */
case PPC_750:
if (!mpc750_vector_is_valid(vector)) {
return 0;
}
break;
+ case PPC_7455: /* Kate Feng */
+ case PPC_7457:
+ if ( altivec_vector_is_valid(vector) )
+ return 1;
+ /* else fall thru */
case PPC_604:
case PPC_604e:
case PPC_604r:
- case PPC_7455: /* Kate Feng */
- case PPC_7457:
if (!mpc604_vector_is_valid(vector)) {
return 0;
}