X-Git-Url: https://git.sur5r.net/?p=freertos;a=blobdiff_plain;f=FreeRTOS%2FSource%2Fportable%2FIAR%2FRISC-V%2Fport.c;h=a5ec465538b65faa0ce4da61a14cff055d9398c4;hp=dd32a8e50ef5b072d4742cb0dc302b3b975ca273;hb=92f04df81b2bbeed4284668fc50e455731202555;hpb=e1bec754ec5a7501af5dd1de2a8c325d418680d6 diff --git a/FreeRTOS/Source/portable/IAR/RISC-V/port.c b/FreeRTOS/Source/portable/IAR/RISC-V/port.c index dd32a8e50..a5ec46553 100644 --- a/FreeRTOS/Source/portable/IAR/RISC-V/port.c +++ b/FreeRTOS/Source/portable/IAR/RISC-V/port.c @@ -34,6 +34,9 @@ #include "task.h" #include "portmacro.h" +/* Standard includes. */ +#include "string.h" + #ifndef configCLINT_BASE_ADDRESS #warning configCLINT_BASE_ADDRESS must be defined in FreeRTOSConfig.h. If the target chip includes a Core Local Interrupter (CLINT) then set configCLINT_BASE_ADDRESS to the CLINT base address. Otherwise set configCLINT_BASE_ADDRESS to 0. #endif @@ -57,6 +60,11 @@ interrupt stack after the scheduler has started. */ #ifdef configISR_STACK_SIZE_WORDS static __attribute__ ((aligned(16))) StackType_t xISRStack[ configISR_STACK_SIZE_WORDS ] = { 0 }; const StackType_t xISRStackTop = ( StackType_t ) &( xISRStack[ configISR_STACK_SIZE_WORDS & ~portBYTE_ALIGNMENT_MASK ] ); + + /* Don't use 0xa5 as the stack fill bytes as that is used by the kernerl for + the task stacks, and so will legitimately appear in many positions within + the ISR stack. */ + #define portISR_STACK_FILL_BYTE 0xee #else extern const uint32_t __freertos_irq_stack_top[]; const StackType_t xISRStackTop = ( StackType_t ) __freertos_irq_stack_top; @@ -77,17 +85,12 @@ const uint64_t *pullNextTime = &ullNextTime; const size_t uxTimerIncrementsForOneTick = ( size_t ) ( configCPU_CLOCK_HZ / configTICK_RATE_HZ ); /* Assumes increment won't go over 32-bits. */ volatile uint64_t * const pullMachineTimerCompareRegisterBase = ( uint64_t * ) ( configCLINT_BASE_ADDRESS + 0x4000 ); volatile uint64_t * pullMachineTimerCompareRegister = 0; - /* 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 the stack overflow hook function (because the stack overflow hook is specific to a task stack, not the ISR stack). */ -#if( configCHECK_FOR_STACK_OVERFLOW > 2 ) +#if defined( configISR_STACK_SIZE_WORDS ) && ( configCHECK_FOR_STACK_OVERFLOW > 2 ) #warning This path not tested, or even compiled yet. - /* Don't use 0xa5 as the stack fill bytes as that is used by the kernerl for - the task stacks, and so will legitimately appear in many positions within - the ISR stack. */ - #define portISR_STACK_FILL_BYTE 0xee static const uint8_t ucExpectedStackBytes[] = { portISR_STACK_FILL_BYTE, portISR_STACK_FILL_BYTE, portISR_STACK_FILL_BYTE, portISR_STACK_FILL_BYTE, \