]> git.sur5r.net Git - freertos/commitdiff
PPC405 work in progress.
authorrichardbarry <richardbarry@1d2547de-c912-0410-9cb9-b8ca96c0e9e2>
Wed, 5 Mar 2008 12:21:46 +0000 (12:21 +0000)
committerrichardbarry <richardbarry@1d2547de-c912-0410-9cb9-b8ca96c0e9e2>
Wed, 5 Mar 2008 12:21:46 +0000 (12:21 +0000)
git-svn-id: https://svn.code.sf.net/p/freertos/code/trunk@232 1d2547de-c912-0410-9cb9-b8ca96c0e9e2

Source/portable/GCC/PPC405/port.c
Source/portable/GCC/PPC405/portmacro.h

index 02aedd2d529ade05f5531a26d5d2d2f8fc192c9a..b97444b3c4e1727653ab7d6f9b88267ce97d16a9 100644 (file)
@@ -71,6 +71,8 @@ extern void vPortTickISR( void );
 extern void vPortYield( void );\r
 extern void vPortStartFirstTask( void );\r
 \r
+static XIntc xInterruptController;\r
+\r
 /* \r
  * Initialise the stack of a task to look exactly as if a call to \r
  * portSAVE_CONTEXT had been made.\r
@@ -228,7 +230,7 @@ static unsigned portLONG ulTicks = 0;
 }\r
 /*-----------------------------------------------------------*/\r
 \r
-void vPortISRHandler( void *DeviceId )\r
+void vPortISRHandler( void *vNullDoNotUse )\r
 {\r
 Xuint32 IntrStatus;\r
 Xuint32 IntrMask = 1;\r
@@ -278,3 +280,29 @@ XIntc_Config *CfgPtr;// = xInterruptController.CfgPtr;
         }\r
     }\r
 }\r
+/*-----------------------------------------------------------*/\r
+\r
+void vPortSetupInterruptController( void )\r
+{\r
+extern void vPortISRWrapper( void );\r
+\r
+       XExc_mDisableExceptions( XEXC_NON_CRITICAL );\r
+       XExc_Init();\r
+       XExc_RegisterHandler( XEXC_ID_NON_CRITICAL_INT, (XExceptionHandler)vPortISRWrapper, NULL );\r
+       XIntc_Initialize( &xInterruptController, XPAR_OPB_INTC_0_DEVICE_ID );\r
+       XIntc_Start( &xInterruptController, XIN_REAL_MODE );\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+portBASE_TYPE xPortInstallInterruptHandler( unsigned portCHAR ucInterruptID, XInterruptHandler pxHandler, void *pvCallBackRef )\r
+{\r
+portBASE_TYPE xReturn = pdFAIL;\r
+\r
+       if( XST_SUCCESS == XIntc_Connect( &xInterruptController, ucInterruptID, pxHandler, pvCallBackRef ) )\r
+       {\r
+               XIntc_Enable( &xInterruptController, ucInterruptID );\r
+               xReturn = pdPASS;\r
+       }\r
+\r
+       return xReturn;         \r
+}\r
index 461eed85f9b1a855a22db7db0b5338fd3770b8fd..6ba2c7f0847c846d599dfcacd03c9caa847c71ce 100644 (file)
@@ -110,6 +110,10 @@ void vPortYield( void );
 #define portTASK_FUNCTION_PROTO( vFunction, pvParameters ) void vFunction( void *pvParameters )\r
 #define portTASK_FUNCTION( vFunction, pvParameters ) void vFunction( void *pvParameters )\r
 \r
+/* Port specific initialisation function. */\r
+void vPortSetupInterruptController( void );\r
+portBASE_TYPE xPortInstallInterruptHandler( unsigned portCHAR ucInterruptID, XInterruptHandler pxHandler, void *pvCallBackRef );\r
+\r
 #ifdef __cplusplus\r
 }\r
 #endif\r