From: rtel Date: Sat, 4 Jan 2020 00:14:18 +0000 (+0000) Subject: Add Source/portable/ARMClang file that directs users to the GCC port if they which... X-Git-Tag: V10.3.0~26 X-Git-Url: https://git.sur5r.net/?p=freertos;a=commitdiff_plain;h=2de47fb440de73fd1eaa865eee82ca4d60df1619 Add Source/portable/ARMClang file that directs users to the GCC port if they which to use the ARMClang compiler. git-svn-id: https://svn.code.sf.net/p/freertos/code/trunk@2797 1d2547de-c912-0410-9cb9-b8ca96c0e9e2 --- diff --git a/FreeRTOS/Source/portable/ARMClang/Use-the-GCC-ports.txt b/FreeRTOS/Source/portable/ARMClang/Use-the-GCC-ports.txt new file mode 100644 index 000000000..4a23ecd57 --- /dev/null +++ b/FreeRTOS/Source/portable/ARMClang/Use-the-GCC-ports.txt @@ -0,0 +1,2 @@ +The FreeRTOS GCC port layer also builds and works with the ARMClang compiler. +To use the ARMClang compiler build the port files from FreeRTOS/Source/portable/GCC. \ No newline at end of file diff --git a/FreeRTOS/Source/portable/GCC/ARM_CM3/portmacro.h b/FreeRTOS/Source/portable/GCC/ARM_CM3/portmacro.h index a2462273b..dae91427b 100644 --- a/FreeRTOS/Source/portable/GCC/ARM_CM3/portmacro.h +++ b/FreeRTOS/Source/portable/GCC/ARM_CM3/portmacro.h @@ -166,6 +166,8 @@ not necessary for to use this port. They are defined so the common demo files #define portFORCE_INLINE inline __attribute__(( always_inline)) #endif +/*-----------------------------------------------------------*/ + portFORCE_INLINE static BaseType_t xPortIsInsideInterrupt( void ) { uint32_t ulCurrentInterrupt; diff --git a/FreeRTOS/Source/portable/GCC/RISC-V/port.c b/FreeRTOS/Source/portable/GCC/RISC-V/port.c index 652a8071e..ff72e4755 100644 --- a/FreeRTOS/Source/portable/GCC/RISC-V/port.c +++ b/FreeRTOS/Source/portable/GCC/RISC-V/port.c @@ -82,9 +82,9 @@ void vPortSetupTimerInterrupt( void ) __attribute__(( weak )); /* Used to program the machine timer compare register. */ uint64_t ullNextTime = 0ULL; 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 = ( volatile uint64_t * const ) ( configCLINT_BASE_ADDRESS + 0x4000 ); -volatile uint64_t * pullMachineTimerCompareRegister = 0; +const size_t uxTimerIncrementsForOneTick = ( size_t ) ( ( configCPU_CLOCK_HZ ) / ( configTICK_RATE_HZ ) ); /* Assumes increment won't go over 32-bits. */ +uint32_t const ullMachineTimerCompareRegisterBase = ( uint64_t const ) ( ( configCLINT_BASE_ADDRESS ) + 0x4000 ); +volatile uint64_t * pullMachineTimerCompareRegister = NULL; /* 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 @@ -115,10 +115,10 @@ task stack, not the ISR stack). */ uint32_t ulCurrentTimeHigh, ulCurrentTimeLow; volatile uint32_t * const pulTimeHigh = ( volatile uint32_t * const ) ( configCLINT_BASE_ADDRESS + 0xBFFC ); volatile uint32_t * const pulTimeLow = ( volatile uint32_t * const ) ( configCLINT_BASE_ADDRESS + 0xBFF8 ); - volatile uint32_t ulHartId = 0; + volatile uint32_t ulHartId; __asm volatile( "csrr %0, mhartid" : "=r"( ulHartId ) ); - pullMachineTimerCompareRegister = &( pullMachineTimerCompareRegisterBase[ ulHartId ] ); + pullMachineTimerCompareRegister = ( volatile uint64_t * ) ( ullMachineTimerCompareRegisterBase + ( ulHartId * sizeof( uint64_t ) ) ); do {