diff --git a/Demo/MicroBlaze_Spartan-6_EthernetLite/SDKProjects/RTOSDemoSource/.cproject b/Demo/MicroBlaze_Spartan-6_EthernetLite/SDKProjects/RTOSDemoSource/.cproject
index 5aace26d5..38a198925 100644
--- a/Demo/MicroBlaze_Spartan-6_EthernetLite/SDKProjects/RTOSDemoSource/.cproject
+++ b/Demo/MicroBlaze_Spartan-6_EthernetLite/SDKProjects/RTOSDemoSource/.cproject
@@ -74,7 +74,7 @@
-
+
@@ -93,7 +93,7 @@
-
+
@@ -1066,7 +1066,7 @@
-
+
diff --git a/Demo/MicroBlaze_Spartan-6_EthernetLite/SDKProjects/RTOSDemoSource/FreeRTOSConfig.h b/Demo/MicroBlaze_Spartan-6_EthernetLite/SDKProjects/RTOSDemoSource/FreeRTOSConfig.h
index 81e8b79de..a0bdbb438 100644
--- a/Demo/MicroBlaze_Spartan-6_EthernetLite/SDKProjects/RTOSDemoSource/FreeRTOSConfig.h
+++ b/Demo/MicroBlaze_Spartan-6_EthernetLite/SDKProjects/RTOSDemoSource/FreeRTOSConfig.h
@@ -63,8 +63,6 @@
#ifndef FREERTOS_CONFIG_H
#define FREERTOS_CONFIG_H
-#include
-
/*-----------------------------------------------------------
* Application specific definitions.
*
diff --git a/Demo/MicroBlaze_Spartan-6_EthernetLite/SDKProjects/RTOSDemoSource/FreeRTOS_Source/portable/GCC/MicroBlaze/port.c b/Demo/MicroBlaze_Spartan-6_EthernetLite/SDKProjects/RTOSDemoSource/FreeRTOS_Source/portable/GCC/MicroBlaze/port.c
index b93bcc2fa..f5cdccf46 100644
--- a/Demo/MicroBlaze_Spartan-6_EthernetLite/SDKProjects/RTOSDemoSource/FreeRTOS_Source/portable/GCC/MicroBlaze/port.c
+++ b/Demo/MicroBlaze_Spartan-6_EthernetLite/SDKProjects/RTOSDemoSource/FreeRTOS_Source/portable/GCC/MicroBlaze/port.c
@@ -64,12 +64,10 @@
#include
/* Hardware includes. */
-#include
-#include
#include
-#include
#include
-#include
+#include
+#include
/* Tasks are started with a critical section nesting of 0 - however prior
to the scheduler being commenced we don't want the critical nesting level
@@ -87,6 +85,8 @@ to reach zero, so it is initialised to a high value. */
*/
static portBASE_TYPE prvInitialiseInterruptController( void );
+static void prvExceptionHandler( void *pvExceptionID );
+
/*
* Call an application provided callback to set up the periodic interrupt used
* for the RTOS tick. Using an application callback allows the application
@@ -344,6 +344,20 @@ extern void vApplicationClearTimerInterrupt( void );
}
/*-----------------------------------------------------------*/
+static void prvExceptionHandler( void *pvExceptionID )
+{
+volatile unsigned long ulExceptionID;
+
+ ulExceptionID = ( unsigned long ) pvExceptionID;
+ for( ;; )
+ {
+ portNOP();
+ }
+
+ ( void ) ulExceptionID;
+}
+/*-----------------------------------------------------------*/
+
static portBASE_TYPE prvInitialiseInterruptController( void )
{
portBASE_TYPE xStatus;
@@ -358,6 +372,47 @@ portBASE_TYPE xStatus;
/* Service all pending interrupts each time the handler is entered. */
XIntc_SetIntrSvcOption( xInterruptControllerInstance.BaseAddress, XIN_SVC_ALL_ISRS_OPTION );
+ /* Install exception handlers. */
+ #if MICROBLAZE_EXCEPTIONS_ENABLED == 1
+
+ #if XPAR_MICROBLAZE_0_UNALIGNED_EXCEPTIONS == 1
+ microblaze_register_exception_handler( XEXC_ID_UNALIGNED_ACCESS, prvExceptionHandler, ( void * ) XEXC_ID_UNALIGNED_ACCESS );
+ #endif /* XPAR_MICROBLAZE_0_UNALIGNED_EXCEPTIONS*/
+
+ #if XPAR_MICROBLAZE_0_ILL_OPCODE_EXCEPTION == 1
+ microblaze_register_exception_handler( XEXC_ID_ILLEGAL_OPCODE, prvExceptionHandler, ( void * ) XEXC_ID_ILLEGAL_OPCODE );
+ #endif /* XPAR_MICROBLAZE_0_ILL_OPCODE_EXCEPTION*/
+
+ #if XPAR_MICROBLAZE_0_M_AXI_I_BUS_EXCEPTION == 1
+ microblaze_register_exception_handler( XEXC_ID_M_AXI_I_EXCEPTION, prvExceptionHandler, ( void * ) XEXC_ID_M_AXI_I_EXCEPTION );
+ #endif /* XPAR_MICROBLAZE_0_M_AXI_I_BUS_EXCEPTION*/
+
+ #if XPAR_MICROBLAZE_0_M_AXI_D_BUS_EXCEPTION == 1
+ microblaze_register_exception_handler( XEXC_ID_M_AXI_D_EXCEPTION, prvExceptionHandler, ( void * ) XEXC_ID_M_AXI_D_EXCEPTION );
+ #endif /* XPAR_MICROBLAZE_0_M_AXI_D_BUS_EXCEPTION*/
+
+ #if XPAR_MICROBLAZE_0_IPLB_BUS_EXCEPTION == 1
+ microblaze_register_exception_handler( XEXC_ID_IPLB_EXCEPTION, prvExceptionHandler, ( void * ) XEXC_ID_IPLB_EXCEPTION );
+ #endif /* XPAR_MICROBLAZE_0_IPLB_BUS_EXCEPTION*/
+
+ #if XPAR_MICROBLAZE_0_DPLB_BUS_EXCEPTION == 1
+ microblaze_register_exception_handler( XEXC_ID_DPLB_EXCEPTION, prvExceptionHandler, ( void * ) XEXC_ID_DPLB_EXCEPTION );
+ #endif /* XPAR_MICROBLAZE_0_DPLB_BUS_EXCEPTION*/
+
+ #if XPAR_MICROBLAZE_0_DIV_ZERO_EXCEPTION == 1
+ microblaze_register_exception_handler( XEXC_ID_DIV_BY_ZERO, prvExceptionHandler, ( void * ) XEXC_ID_DIV_BY_ZERO );
+ #endif /* XPAR_MICROBLAZE_0_DIV_ZERO_EXCEPTION*/
+
+ #if XPAR_MICROBLAZE_0_FPU_EXCEPTION == 1
+ microblaze_register_exception_handler( XEXC_ID_FPU, prvExceptionHandler, ( void * ) XEXC_ID_FPU );
+ #endif /* XPAR_MICROBLAZE_0_FPU_EXCEPTION*/
+
+ #if XPAR_MICROBLAZE_0_FSL_EXCEPTION == 1
+ microblaze_register_exception_handler( XEXC_ID_FSL, prvExceptionHandler, ( void * ) XEXC_ID_FSL );
+ #endif /* XPAR_MICROBLAZE_0_FSL_EXCEPTION*/
+
+ #endif /* MICROBLAZE_EXCEPTIONS_ENABLED */
+
/* Start the interrupt controller. Interrupts are enabled when the
scheduler starts. */
xStatus = XIntc_Start( &xInterruptControllerInstance, XIN_REAL_MODE );
@@ -369,9 +424,15 @@ portBASE_TYPE xStatus;
configASSERT( ( xStatus == ( portBASE_TYPE ) XST_SUCCESS ) )
+/*_RB_ Exception test code.
+__asm volatile (
+ "bralid r15, 1234 \n"
+ "or r0, r0, r0 \n"
+ );
+*/
+
return xStatus;
}
-
-
+/*-----------------------------------------------------------*/
diff --git a/Demo/MicroBlaze_Spartan-6_EthernetLite/SDKProjects/RTOSDemoSource/FreeRTOS_Source/portable/GCC/MicroBlaze/portmacro.h b/Demo/MicroBlaze_Spartan-6_EthernetLite/SDKProjects/RTOSDemoSource/FreeRTOS_Source/portable/GCC/MicroBlaze/portmacro.h
index 40f05e4ea..cba69c7ce 100644
--- a/Demo/MicroBlaze_Spartan-6_EthernetLite/SDKProjects/RTOSDemoSource/FreeRTOS_Source/portable/GCC/MicroBlaze/portmacro.h
+++ b/Demo/MicroBlaze_Spartan-6_EthernetLite/SDKProjects/RTOSDemoSource/FreeRTOS_Source/portable/GCC/MicroBlaze/portmacro.h
@@ -59,7 +59,8 @@ extern "C" {
#endif
/* BSP includes. */
-#include "xbasic_types.h"
+#include
+#include
/*-----------------------------------------------------------
* Port specific definitions.
diff --git a/Demo/MicroBlaze_Spartan-6_EthernetLite/SDKProjects/RTOSDemoSource/main-full.c b/Demo/MicroBlaze_Spartan-6_EthernetLite/SDKProjects/RTOSDemoSource/main-full.c
index ed0792e80..301197736 100644
--- a/Demo/MicroBlaze_Spartan-6_EthernetLite/SDKProjects/RTOSDemoSource/main-full.c
+++ b/Demo/MicroBlaze_Spartan-6_EthernetLite/SDKProjects/RTOSDemoSource/main-full.c
@@ -533,16 +533,16 @@ static void prvSetupHardware( void )
taskDISABLE_INTERRUPTS();
vParTestInitialise();
- #ifdef MICROBLAZE_EXCEPTIONS_ENABLED
+ #if MICROBLAZE_EXCEPTIONS_ENABLED == 1
microblaze_enable_exceptions();
#endif
- #ifdef XPAR_MICROBLAZE_USE_ICACHE
+ #if XPAR_MICROBLAZE_USE_ICACHE == 1
microblaze_invalidate_icache();
microblaze_enable_icache();
#endif
- #ifdef XPAR_MICROBLAZE_USE_DCACHE
+ #if XPAR_MICROBLAZE_USE_DCACHE == 1
microblaze_invalidate_dcache();
microblaze_enable_dcache();
#endif