mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2025-08-19 01:28:32 -04:00
Changed the way the ARM7/9 GCC ports enter interrupts that can cause a context switch.
This commit is contained in:
parent
c54ec1c639
commit
ada7fa862d
24 changed files with 322 additions and 275 deletions
|
@ -2,17 +2,18 @@
|
|||
#include "Semphr.h"
|
||||
#include "Task.h"
|
||||
|
||||
void vEMAC_ISR( void ) __attribute__((naked));
|
||||
/* The interrupt entry point. */
|
||||
void vEMAC_ISR_Wrapper( void ) __attribute__((naked));
|
||||
|
||||
/* The handler that does the actual work. */
|
||||
void vEMAC_ISR_Handler( void );
|
||||
|
||||
extern xSemaphoreHandle xEMACSemaphore;
|
||||
|
||||
void vEMAC_ISR( void )
|
||||
|
||||
void vEMAC_ISR_Handler( void )
|
||||
{
|
||||
portENTER_SWITCHING_ISR();
|
||||
|
||||
static portBASE_TYPE xSwitchRequired;
|
||||
|
||||
xSwitchRequired = pdFALSE;
|
||||
portBASE_TYPE xSwitchRequired = pdFALSE;
|
||||
|
||||
/* Clear the interrupt. */
|
||||
MAC_INTCLEAR = 0xffff;
|
||||
|
@ -21,11 +22,22 @@ void vEMAC_ISR( void )
|
|||
/* Ensure the uIP task is not blocked as data has arrived. */
|
||||
if( xSemaphoreGiveFromISR( xEMACSemaphore, pdFALSE ) )
|
||||
{
|
||||
xSwitchRequired = pdTRUE;
|
||||
/* Giving the semaphore woke a task. */
|
||||
portYIELD_FROM_ISR();
|
||||
}
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
/* Switch to the uIP task. */
|
||||
portEXIT_SWITCHING_ISR( xSwitchRequired );
|
||||
void vEMAC_ISR_Wrapper( void )
|
||||
{
|
||||
/* Save the context of the interrupted task. */
|
||||
portSAVE_CONTEXT();
|
||||
|
||||
/* Call the handler. This must be a separate function unless you can
|
||||
guarantee that no stack will be used. */
|
||||
vEMAC_ISR_Handler();
|
||||
|
||||
/* Restore the context of whichever task is going to run next. */
|
||||
portRESTORE_CONTEXT();
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue