[PATCH 24] SPARC BSPS: added defines for set_vec type argument to bsp.h

Daniel Hellstrom daniel at gaisler.com
Thu Mar 29 11:52:15 UTC 2012


Signed-off-by: Daniel Hellstrom <daniel at gaisler.com>
---
 c/src/lib/libbsp/sparc/erc32/include/bsp.h    |    4 ++++
 c/src/lib/libbsp/sparc/erc32/startup/setvec.c |    2 +-
 c/src/lib/libbsp/sparc/leon2/include/bsp.h    |    4 ++++
 c/src/lib/libbsp/sparc/leon2/startup/setvec.c |    2 +-
 c/src/lib/libbsp/sparc/leon3/include/bsp.h    |    4 ++++
 c/src/lib/libbsp/sparc/leon3/startup/setvec.c |    2 +-
 6 files changed, 15 insertions(+), 3 deletions(-)

diff --git a/c/src/lib/libbsp/sparc/erc32/include/bsp.h b/c/src/lib/libbsp/sparc/erc32/include/bsp.h
index a88673e..70f1ce3 100644
--- a/c/src/lib/libbsp/sparc/erc32/include/bsp.h
+++ b/c/src/lib/libbsp/sparc/erc32/include/bsp.h
@@ -69,6 +69,10 @@ extern int   end;        /* last address in the program */
 
 /* functions */
 
+/* set_vec type */
+#define SET_VECTOR_RAW  0  /* Raw trap handler */
+#define SET_VECTOR_INT  1  /* Trap handler with _ISR_Handler interrupt handler */
+
 rtems_isr_entry set_vector(                     /* returns old vector */
     rtems_isr_entry     handler,                /* isr routine        */
     rtems_vector_number vector,                 /* vector number      */
diff --git a/c/src/lib/libbsp/sparc/erc32/startup/setvec.c b/c/src/lib/libbsp/sparc/erc32/startup/setvec.c
index 3a7601d..7e697a0 100644
--- a/c/src/lib/libbsp/sparc/erc32/startup/setvec.c
+++ b/c/src/lib/libbsp/sparc/erc32/startup/setvec.c
@@ -42,7 +42,7 @@ rtems_isr_entry set_vector(                   /* returns old vector */
   uint32_t        real_trap;
   uint32_t        source;
 
-  if ( type )
+  if ( type == SET_VECTOR_INT )
     rtems_interrupt_catch( handler, vector, &previous_isr );
   else
     _CPU_ISR_install_raw_handler( vector, handler, (void *)&previous_isr );
diff --git a/c/src/lib/libbsp/sparc/leon2/include/bsp.h b/c/src/lib/libbsp/sparc/leon2/include/bsp.h
index 796290e..a2f3360 100644
--- a/c/src/lib/libbsp/sparc/leon2/include/bsp.h
+++ b/c/src/lib/libbsp/sparc/leon2/include/bsp.h
@@ -88,6 +88,10 @@ extern int   end;        /* last address in the program */
 
 /* miscellaneous stuff assumed to exist */
 
+/* set_vec type */
+#define SET_VECTOR_RAW  0  /* Raw trap handler */
+#define SET_VECTOR_INT  1  /* Trap handler with _ISR_Handler interrupt handler */
+
 rtems_isr_entry set_vector(                     /* returns old vector */
     rtems_isr_entry     handler,                /* isr routine        */
     rtems_vector_number vector,                 /* vector number      */
diff --git a/c/src/lib/libbsp/sparc/leon2/startup/setvec.c b/c/src/lib/libbsp/sparc/leon2/startup/setvec.c
index c7b8af6..028b17a 100644
--- a/c/src/lib/libbsp/sparc/leon2/startup/setvec.c
+++ b/c/src/lib/libbsp/sparc/leon2/startup/setvec.c
@@ -42,7 +42,7 @@ rtems_isr_entry set_vector(                   /* returns old vector */
   uint32_t      real_trap;
   uint32_t      source;
 
-  if ( type )
+  if ( type == SET_VECTOR_INT )
     rtems_interrupt_catch( handler, vector, &previous_isr );
   else
     _CPU_ISR_install_raw_handler( vector, handler, (void *)&previous_isr );
diff --git a/c/src/lib/libbsp/sparc/leon3/include/bsp.h b/c/src/lib/libbsp/sparc/leon3/include/bsp.h
index 07a7412..04279d9 100644
--- a/c/src/lib/libbsp/sparc/leon3/include/bsp.h
+++ b/c/src/lib/libbsp/sparc/leon3/include/bsp.h
@@ -98,6 +98,10 @@ extern int   end;        /* last address in the program */
 
 /* miscellaneous stuff assumed to exist */
 
+/* set_vec type */
+#define SET_VECTOR_RAW  0  /* Raw trap handler */
+#define SET_VECTOR_INT  1  /* Trap handler with _ISR_Handler interrupt handler */
+
 rtems_isr_entry set_vector(                     /* returns old vector */
     rtems_isr_entry     handler,                /* isr routine        */
     rtems_vector_number vector,                 /* vector number      */
diff --git a/c/src/lib/libbsp/sparc/leon3/startup/setvec.c b/c/src/lib/libbsp/sparc/leon3/startup/setvec.c
index c7b8af6..028b17a 100644
--- a/c/src/lib/libbsp/sparc/leon3/startup/setvec.c
+++ b/c/src/lib/libbsp/sparc/leon3/startup/setvec.c
@@ -42,7 +42,7 @@ rtems_isr_entry set_vector(                   /* returns old vector */
   uint32_t      real_trap;
   uint32_t      source;
 
-  if ( type )
+  if ( type == SET_VECTOR_INT )
     rtems_interrupt_catch( handler, vector, &previous_isr );
   else
     _CPU_ISR_install_raw_handler( vector, handler, (void *)&previous_isr );
-- 
1.7.0.4




More information about the devel mailing list