From 95273a610ff4ed4f4cf78d20a99f6a32acec8841 Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Mon, 3 Jan 2000 14:06:42 +0000 Subject: Combination of coverhd.h cleanup and MVME23xx/MCP750 patch from Eric Valette and Jay Kulpinski . --- .../powerpc/mpc6xx/exceptions/raw_exception.c | 99 +++++++++++++++++----- .../powerpc/mpc6xx/exceptions/raw_exception.h | 7 ++ 2 files changed, 87 insertions(+), 19 deletions(-) (limited to 'c/src/lib/libcpu/powerpc/mpc6xx/exceptions') 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 cd8274e2e1..5b4ac21ea4 100644 --- a/c/src/lib/libcpu/powerpc/mpc6xx/exceptions/raw_exception.c +++ b/c/src/lib/libcpu/powerpc/mpc6xx/exceptions/raw_exception.c @@ -11,6 +11,9 @@ * Copyright (C) 1999 Eric Valette (valette@crf.canon.fr) * Canon Centre Recherche France. * + * Enhanced by Jay Kulpinski + * to support 603, 603e, 604, 604e exceptions + * * The license and distribution terms for this file may be * found in found in the file LICENSE in this distribution or at * http://www.OARcorp.com/rtems/license.html. @@ -50,12 +53,61 @@ int mpc750_vector_is_valid(rtems_vector vector) } } +int mpc603_vector_is_valid(rtems_vector vector) +{ + switch(vector) { + case ASM_RESET_VECTOR: /* fall through */ + case ASM_MACH_VECTOR: + case ASM_PROT_VECTOR: + case ASM_ISI_VECTOR: + case ASM_EXT_VECTOR: + case ASM_ALIGN_VECTOR: + case ASM_PROG_VECTOR: + case ASM_FLOAT_VECTOR: + case ASM_DEC_VECTOR: + case ASM_SYS_VECTOR: + case ASM_TRACE_VECTOR: + return 1; + case ASM_PERFMON_VECTOR: + return 0; + case ASM_IMISS_VECTOR: /* fall through */ + case ASM_DLMISS_VECTOR: + case ASM_DSMISS_VECTOR: + case ASM_ADDR_VECTOR: + case ASM_SYSMGMT_VECTOR: + return 1; + case ASM_ITM_VECTOR: + return 0; + } + return 0; +} + int mpc604_vector_is_valid(rtems_vector vector) { - /* - * Please fill this for MVME2307 - */ - printk("Please complete libcpu/powerpc/XXX/raw_exception.c\n"); + switch(vector) { + case ASM_RESET_VECTOR: /* fall through */ + case ASM_MACH_VECTOR: + case ASM_PROT_VECTOR: + case ASM_ISI_VECTOR: + case ASM_EXT_VECTOR: + case ASM_ALIGN_VECTOR: + case ASM_PROG_VECTOR: + case ASM_FLOAT_VECTOR: + case ASM_DEC_VECTOR: + case ASM_SYS_VECTOR: + case ASM_TRACE_VECTOR: + case ASM_PERFMON_VECTOR: + return 1; + case ASM_IMISS_VECTOR: /* fall through */ + case ASM_DLMISS_VECTOR: + case ASM_DSMISS_VECTOR: + return 0; + case ASM_ADDR_VECTOR: /* fall through */ + case ASM_SYSMGMT_VECTOR: + return 1; + case ASM_ITM_VECTOR: + return 0; + } return 0; } @@ -63,22 +115,31 @@ int mpc60x_set_exception (const rtems_raw_except_connect_data* except) { unsigned int level; - if (current_ppc_cpu == PPC_750) { - if (!mpc750_vector_is_valid(except->exceptIndex)){ - return 0; - } - goto exception_ok; - } - if (current_ppc_cpu == PPC_604) { - if (!mpc604_vector_is_valid(except->exceptIndex)){ - return 0; - } - goto exception_ok; + switch (current_ppc_cpu) { + case PPC_750: + if (!mpc750_vector_is_valid(except->exceptIndex)) { + return 0; + } + break; + case PPC_604: + case PPC_604e: + case PPC_604r: + if (!mpc604_vector_is_valid(except->exceptIndex)) { + return 0; + } + break; + case PPC_603: + case PPC_603e: + if (!mpc603_vector_is_valid(except->exceptIndex)) { + return 0; + } + break; + default: + printk("Please complete libcpu/powerpc/mpc6xx/raw_exception.c\n"); + printk("current_ppc_cpu = %x\n", current_ppc_cpu); + return 0; } - printk("Please complete libcpu/powerpc/XXX/raw_exception.c\n"); - return 0; - -exception_ok: + /* * Check if default handler is actually connected. If not issue an error. * You must first get the current handler via mpc60x_get_current_exception diff --git a/c/src/lib/libcpu/powerpc/mpc6xx/exceptions/raw_exception.h b/c/src/lib/libcpu/powerpc/mpc6xx/exceptions/raw_exception.h index f6542b9dfe..4419fdda8e 100644 --- a/c/src/lib/libcpu/powerpc/mpc6xx/exceptions/raw_exception.h +++ b/c/src/lib/libcpu/powerpc/mpc6xx/exceptions/raw_exception.h @@ -13,6 +13,9 @@ * Copyright (C) 1999 Eric Valette (valette@crf.canon.fr) * Canon Centre Recherche France. * + * Enhanced by Jay Kulpinski + * to support 603, 603e, 604, 604e exceptions + * * The license and distribution terms for this file may be * found in found in the file LICENSE in this distribution or at * http://www.OARcorp.com/rtems/license.html. @@ -38,6 +41,10 @@ #define ASM_DEC_VECTOR 0x09 #define ASM_SYS_VECTOR 0x0C #define ASM_TRACE_VECTOR 0x0D +#define ASM_PERFMON_VECTOR 0x0F +#define ASM_IMISS_VECTOR 0x10 +#define ASM_DLMISS_VECTOR 0x11 +#define ASM_DSMISS_VECTOR 0x12 #define ASM_ADDR_VECTOR 0x13 #define ASM_SYSMGMT_VECTOR 0x14 #define ASM_ITM_VECTOR 0x17 -- cgit v1.2.3