mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2026-03-09 18:13:30 -04:00
Merge 2fe3c61c26 into f1043c49d5
This commit is contained in:
commit
bdb15119c5
2 changed files with 16 additions and 12 deletions
|
|
@ -54,7 +54,7 @@
|
||||||
#ifdef configTASK_RETURN_ADDRESS
|
#ifdef configTASK_RETURN_ADDRESS
|
||||||
#define portTASK_RETURN_ADDRESS configTASK_RETURN_ADDRESS
|
#define portTASK_RETURN_ADDRESS configTASK_RETURN_ADDRESS
|
||||||
#else
|
#else
|
||||||
#define portTASK_RETURN_ADDRESS 0
|
#define portTASK_RETURN_ADDRESS NULL
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* The stack used by interrupt service routines. Set configISR_STACK_SIZE_WORDS
|
/* The stack used by interrupt service routines. Set configISR_STACK_SIZE_WORDS
|
||||||
|
|
@ -93,13 +93,16 @@ const size_t uxTimerIncrementsForOneTick = ( size_t ) ( ( configCPU_CLOCK_HZ ) /
|
||||||
UBaseType_t const ullMachineTimerCompareRegisterBase = configMTIMECMP_BASE_ADDRESS;
|
UBaseType_t const ullMachineTimerCompareRegisterBase = configMTIMECMP_BASE_ADDRESS;
|
||||||
volatile uint64_t * pullMachineTimerCompareRegister = NULL;
|
volatile uint64_t * pullMachineTimerCompareRegister = NULL;
|
||||||
|
|
||||||
|
volatile uint32_t * pulTimeHigh = ( volatile uint32_t * const ) ( ( configMTIME_BASE_ADDRESS ) + 4UL ); /* 8-byte type so high 32-bit word is 4 bytes up. */
|
||||||
|
volatile uint32_t * pulTimeLow = ( volatile uint32_t * const ) ( configMTIME_BASE_ADDRESS );
|
||||||
|
|
||||||
/* Holds the critical nesting value - deliberately non-zero at start up to
|
/* Holds the critical nesting value - deliberately non-zero at start up to
|
||||||
* ensure interrupts are not accidentally enabled before the scheduler starts. */
|
* ensure interrupts are not accidentally enabled before the scheduler starts. */
|
||||||
size_t xCriticalNesting = ( size_t ) 0xaaaaaaaa;
|
size_t xCriticalNesting = ( size_t ) 0xaaaaaaaa;
|
||||||
size_t * pxCriticalNesting = &xCriticalNesting;
|
size_t * pxCriticalNesting = &xCriticalNesting;
|
||||||
|
|
||||||
/* Used to catch tasks that attempt to return from their implementing function. */
|
/* Used to catch tasks that attempt to return from their implementing function. */
|
||||||
size_t xTaskReturnAddress = ( size_t ) portTASK_RETURN_ADDRESS;
|
ReturnFunctionType_t xTaskReturnAddress = ( ReturnFunctionType_t ) portTASK_RETURN_ADDRESS;
|
||||||
|
|
||||||
/* Set configCHECK_FOR_STACK_OVERFLOW to 3 to add ISR stack checking to task
|
/* Set configCHECK_FOR_STACK_OVERFLOW to 3 to add ISR stack checking to task
|
||||||
* stack checking. A problem in the ISR stack will trigger an assert, not call
|
* stack checking. A problem in the ISR stack will trigger an assert, not call
|
||||||
|
|
@ -130,13 +133,13 @@ size_t xTaskReturnAddress = ( size_t ) portTASK_RETURN_ADDRESS;
|
||||||
void vPortSetupTimerInterrupt( void )
|
void vPortSetupTimerInterrupt( void )
|
||||||
{
|
{
|
||||||
uint32_t ulCurrentTimeHigh, ulCurrentTimeLow;
|
uint32_t ulCurrentTimeHigh, ulCurrentTimeLow;
|
||||||
volatile uint32_t * const pulTimeHigh = ( volatile uint32_t * const ) ( ( configMTIME_BASE_ADDRESS ) + 4UL ); /* 8-byte type so high 32-bit word is 4 bytes up. */
|
#ifndef configMTIME_INIT_IN_BSP
|
||||||
volatile uint32_t * const pulTimeLow = ( volatile uint32_t * const ) ( configMTIME_BASE_ADDRESS );
|
{
|
||||||
volatile uint32_t ulHartId;
|
volatile uint32_t ulHartId;
|
||||||
|
__asm volatile ( "csrr %0, mhartid" : "=r" ( ulHartId ) );
|
||||||
__asm volatile ( "csrr %0, mhartid" : "=r" ( ulHartId ) );
|
pullMachineTimerCompareRegister = ( volatile uint64_t * ) ( ullMachineTimerCompareRegisterBase + ( ulHartId * sizeof( uint64_t ) ) );
|
||||||
|
}
|
||||||
pullMachineTimerCompareRegister = ( volatile uint64_t * ) ( ullMachineTimerCompareRegisterBase + ( ulHartId * sizeof( uint64_t ) ) );
|
#endif
|
||||||
|
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -48,13 +48,10 @@
|
||||||
|
|
||||||
/* Type definitions. */
|
/* Type definitions. */
|
||||||
#if __riscv_xlen == 64
|
#if __riscv_xlen == 64
|
||||||
#define portSTACK_TYPE uint64_t
|
|
||||||
#define portBASE_TYPE int64_t
|
#define portBASE_TYPE int64_t
|
||||||
#define portUBASE_TYPE uint64_t
|
#define portUBASE_TYPE uint64_t
|
||||||
#define portMAX_DELAY ( TickType_t ) 0xffffffffffffffffUL
|
#define portMAX_DELAY ( TickType_t ) 0xffffffffffffffffUL
|
||||||
#define portPOINTER_SIZE_TYPE uint64_t
|
|
||||||
#elif __riscv_xlen == 32
|
#elif __riscv_xlen == 32
|
||||||
#define portSTACK_TYPE uint32_t
|
|
||||||
#define portBASE_TYPE int32_t
|
#define portBASE_TYPE int32_t
|
||||||
#define portUBASE_TYPE uint32_t
|
#define portUBASE_TYPE uint32_t
|
||||||
#define portMAX_DELAY ( TickType_t ) 0xffffffffUL
|
#define portMAX_DELAY ( TickType_t ) 0xffffffffUL
|
||||||
|
|
@ -62,10 +59,14 @@
|
||||||
#error "Assembler did not define __riscv_xlen"
|
#error "Assembler did not define __riscv_xlen"
|
||||||
#endif /* if __riscv_xlen == 64 */
|
#endif /* if __riscv_xlen == 64 */
|
||||||
|
|
||||||
|
#define portPOINTER_SIZE_TYPE intptr_t
|
||||||
|
#define portSTACK_TYPE uintptr_t
|
||||||
|
|
||||||
typedef portSTACK_TYPE StackType_t;
|
typedef portSTACK_TYPE StackType_t;
|
||||||
typedef portBASE_TYPE BaseType_t;
|
typedef portBASE_TYPE BaseType_t;
|
||||||
typedef portUBASE_TYPE UBaseType_t;
|
typedef portUBASE_TYPE UBaseType_t;
|
||||||
typedef portUBASE_TYPE TickType_t;
|
typedef portUBASE_TYPE TickType_t;
|
||||||
|
typedef void (*ReturnFunctionType_t)( void );
|
||||||
|
|
||||||
/* Legacy type definitions. */
|
/* Legacy type definitions. */
|
||||||
#define portCHAR char
|
#define portCHAR char
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue