|
|
@ -84,7 +84,7 @@ extern "C" {
|
|
|
|
typedef unsigned portSHORT portTickType;
|
|
|
|
typedef unsigned portSHORT portTickType;
|
|
|
|
#define portMAX_DELAY ( portTickType ) 0xffff
|
|
|
|
#define portMAX_DELAY ( portTickType ) 0xffff
|
|
|
|
#else
|
|
|
|
#else
|
|
|
|
typedef unsigned portLONG portTickType;
|
|
|
|
typedef unsigned long portTickType;
|
|
|
|
#define portMAX_DELAY ( portTickType ) 0xffffffff
|
|
|
|
#define portMAX_DELAY ( portTickType ) 0xffffffff
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
/*-----------------------------------------------------------*/
|
|
|
|
/*-----------------------------------------------------------*/
|
|
|
@ -96,28 +96,34 @@ extern "C" {
|
|
|
|
/*-----------------------------------------------------------*/
|
|
|
|
/*-----------------------------------------------------------*/
|
|
|
|
|
|
|
|
|
|
|
|
/* Critical section management. */
|
|
|
|
/* Critical section management. */
|
|
|
|
#define portIPL_SHIFT ( 10 )
|
|
|
|
#define portIPL_SHIFT ( 10UL )
|
|
|
|
#define portALL_IPL_BITS ( 0x3f << portIPL_SHIFT )
|
|
|
|
#define portALL_IPL_BITS ( 0x3fUL << portIPL_SHIFT )
|
|
|
|
#define portSW0_BIT ( 0x01 << 8 )
|
|
|
|
#define portSW0_BIT ( 0x01 << 8 )
|
|
|
|
|
|
|
|
|
|
|
|
#define portDISABLE_INTERRUPTS() \
|
|
|
|
/* This clears the IPL bits, then sets them to
|
|
|
|
{ \
|
|
|
|
configMAX_SYSCALL_INTERRUPT_PRIORITY. This function should not be called
|
|
|
|
unsigned portLONG ulStatus; \
|
|
|
|
from an interrupt, so therefore will not be called with an IPL setting
|
|
|
|
\
|
|
|
|
above configMAX_SYSCALL_INTERRUPT_PRIORITY. Therefore, when used correctly, the
|
|
|
|
/* Mask interrupts at and below the kernel interrupt priority. */ \
|
|
|
|
instructions in this macro can only result in the IPL being raised, and
|
|
|
|
ulStatus = _CP0_GET_STATUS(); \
|
|
|
|
therefore never lowered. */
|
|
|
|
ulStatus |= ( configMAX_SYSCALL_INTERRUPT_PRIORITY << portIPL_SHIFT ); \
|
|
|
|
#define portDISABLE_INTERRUPTS() \
|
|
|
|
_CP0_SET_STATUS( ulStatus ); \
|
|
|
|
{ \
|
|
|
|
|
|
|
|
unsigned long ulStatus; \
|
|
|
|
|
|
|
|
\
|
|
|
|
|
|
|
|
/* Mask interrupts at and below the kernel interrupt priority. */ \
|
|
|
|
|
|
|
|
ulStatus = _CP0_GET_STATUS(); \
|
|
|
|
|
|
|
|
ulStatus &= ~portALL_IPL_BITS; \
|
|
|
|
|
|
|
|
_CP0_SET_STATUS( ( ulStatus | ( configMAX_SYSCALL_INTERRUPT_PRIORITY << portIPL_SHIFT ) ) ); \
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#define portENABLE_INTERRUPTS() \
|
|
|
|
#define portENABLE_INTERRUPTS() \
|
|
|
|
{ \
|
|
|
|
{ \
|
|
|
|
unsigned portLONG ulStatus; \
|
|
|
|
unsigned long ulStatus; \
|
|
|
|
\
|
|
|
|
\
|
|
|
|
/* Unmask all interrupts. */ \
|
|
|
|
/* Unmask all interrupts. */ \
|
|
|
|
ulStatus = _CP0_GET_STATUS(); \
|
|
|
|
ulStatus = _CP0_GET_STATUS(); \
|
|
|
|
ulStatus &= ~portALL_IPL_BITS; \
|
|
|
|
ulStatus &= ~portALL_IPL_BITS; \
|
|
|
|
_CP0_SET_STATUS( ulStatus ); \
|
|
|
|
_CP0_SET_STATUS( ulStatus ); \
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -138,7 +144,7 @@ extern void vPortClearInterruptMaskFromISR( unsigned portBASE_TYPE );
|
|
|
|
|
|
|
|
|
|
|
|
#define portYIELD() \
|
|
|
|
#define portYIELD() \
|
|
|
|
{ \
|
|
|
|
{ \
|
|
|
|
unsigned portLONG ulStatus; \
|
|
|
|
unsigned long ulStatus; \
|
|
|
|
\
|
|
|
|
\
|
|
|
|
/* Trigger software interrupt. */ \
|
|
|
|
/* Trigger software interrupt. */ \
|
|
|
|
ulStatus = _CP0_GET_CAUSE(); \
|
|
|
|
ulStatus = _CP0_GET_CAUSE(); \
|
|
|
|