summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrtel <rtel@1d2547de-c912-0410-9cb9-b8ca96c0e9e2>2020-01-04 00:14:18 +0000
committerrtel <rtel@1d2547de-c912-0410-9cb9-b8ca96c0e9e2>2020-01-04 00:14:18 +0000
commit3944aaa70628e7036d1cb44fc9600f8820e4ea41 (patch)
treeedb8a9e3f175864e675d1df0652eb3e9acbb7de4
parent93cfab70aa349cbff2c285cda63aa3d5cf37465d (diff)
downloadfreertos-3944aaa70628e7036d1cb44fc9600f8820e4ea41.tar.gz
Add Source/portable/ARMClang file that directs users to the GCC port if they which to use the ARMClang compiler.
git-svn-id: http://svn.code.sf.net/p/freertos/code/trunk@2797 1d2547de-c912-0410-9cb9-b8ca96c0e9e2
-rw-r--r--FreeRTOS/Source/portable/ARMClang/Use-the-GCC-ports.txt2
-rw-r--r--FreeRTOS/Source/portable/GCC/ARM_CM3/portmacro.h2
-rw-r--r--FreeRTOS/Source/portable/GCC/RISC-V/port.c10
3 files changed, 9 insertions, 5 deletions
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
{