PPC405 work in progress.

This commit is contained in:
Richard Barry 2008-03-05 12:21:46 +00:00
parent ebcac1c4b5
commit 39b68e7fc5
2 changed files with 33 additions and 1 deletions

View File

@ -71,6 +71,8 @@ extern void vPortTickISR( void );
extern void vPortYield( void );
extern void vPortStartFirstTask( void );
static XIntc xInterruptController;
/*
* Initialise the stack of a task to look exactly as if a call to
* portSAVE_CONTEXT had been made.
@ -228,7 +230,7 @@ static unsigned portLONG ulTicks = 0;
}
/*-----------------------------------------------------------*/
void vPortISRHandler( void *DeviceId )
void vPortISRHandler( void *vNullDoNotUse )
{
Xuint32 IntrStatus;
Xuint32 IntrMask = 1;
@ -278,3 +280,29 @@ XIntc_Config *CfgPtr;// = xInterruptController.CfgPtr;
}
}
}
/*-----------------------------------------------------------*/
void vPortSetupInterruptController( void )
{
extern void vPortISRWrapper( void );
XExc_mDisableExceptions( XEXC_NON_CRITICAL );
XExc_Init();
XExc_RegisterHandler( XEXC_ID_NON_CRITICAL_INT, (XExceptionHandler)vPortISRWrapper, NULL );
XIntc_Initialize( &xInterruptController, XPAR_OPB_INTC_0_DEVICE_ID );
XIntc_Start( &xInterruptController, XIN_REAL_MODE );
}
/*-----------------------------------------------------------*/
portBASE_TYPE xPortInstallInterruptHandler( unsigned portCHAR ucInterruptID, XInterruptHandler pxHandler, void *pvCallBackRef )
{
portBASE_TYPE xReturn = pdFAIL;
if( XST_SUCCESS == XIntc_Connect( &xInterruptController, ucInterruptID, pxHandler, pvCallBackRef ) )
{
XIntc_Enable( &xInterruptController, ucInterruptID );
xReturn = pdPASS;
}
return xReturn;
}

View File

@ -110,6 +110,10 @@ void vPortYield( void );
#define portTASK_FUNCTION_PROTO( vFunction, pvParameters ) void vFunction( void *pvParameters )
#define portTASK_FUNCTION( vFunction, pvParameters ) void vFunction( void *pvParameters )
/* Port specific initialisation function. */
void vPortSetupInterruptController( void );
portBASE_TYPE xPortInstallInterruptHandler( unsigned portCHAR ucInterruptID, XInterruptHandler pxHandler, void *pvCallBackRef );
#ifdef __cplusplus
}
#endif