]> git.sur5r.net Git - freertos/blobdiff - FreeRTOS/Source/portable/GCC/RISC-V/port.c
Add Source/portable/ARMClang file that directs users to the GCC port if they which...
[freertos] / FreeRTOS / Source / portable / GCC / RISC-V / port.c
index 652a8071ec036fbe9d7f08fc4279cd8d4f06d55a..ff72e4755388a5ad9a03356db106c38dad0a04f6 100644 (file)
@@ -82,9 +82,9 @@ void vPortSetupTimerInterrupt( void ) __attribute__(( weak ));
 /* Used to program the machine timer compare register. */\r
 uint64_t ullNextTime = 0ULL;\r
 const uint64_t *pullNextTime = &ullNextTime;\r
-const size_t uxTimerIncrementsForOneTick = ( size_t ) ( configCPU_CLOCK_HZ / configTICK_RATE_HZ ); /* Assumes increment won't go over 32-bits. */\r
-volatile uint64_t * const pullMachineTimerCompareRegisterBase = ( volatile uint64_t * const ) ( configCLINT_BASE_ADDRESS + 0x4000 );\r
-volatile uint64_t * pullMachineTimerCompareRegister = 0;\r
+const size_t uxTimerIncrementsForOneTick = ( size_t ) ( ( configCPU_CLOCK_HZ ) / ( configTICK_RATE_HZ ) ); /* Assumes increment won't go over 32-bits. */\r
+uint32_t const ullMachineTimerCompareRegisterBase = ( uint64_t const ) ( ( configCLINT_BASE_ADDRESS ) + 0x4000 );\r
+volatile uint64_t * pullMachineTimerCompareRegister = NULL;\r
 \r
 /* Set configCHECK_FOR_STACK_OVERFLOW to 3 to add ISR stack checking to task\r
 stack checking.  A problem in the ISR stack will trigger an assert, not call the\r
@@ -115,10 +115,10 @@ task stack, not the ISR stack). */
        uint32_t ulCurrentTimeHigh, ulCurrentTimeLow;\r
        volatile uint32_t * const pulTimeHigh = ( volatile uint32_t * const ) ( configCLINT_BASE_ADDRESS + 0xBFFC );\r
        volatile uint32_t * const pulTimeLow = ( volatile uint32_t * const ) ( configCLINT_BASE_ADDRESS + 0xBFF8 );\r
-       volatile uint32_t ulHartId = 0;\r
+       volatile uint32_t ulHartId;\r
 \r
                __asm volatile( "csrr %0, mhartid" : "=r"( ulHartId ) );\r
-               pullMachineTimerCompareRegister  = &( pullMachineTimerCompareRegisterBase[ ulHartId ] );\r
+               pullMachineTimerCompareRegister  = ( volatile uint64_t * ) ( ullMachineTimerCompareRegisterBase + ( ulHartId * sizeof( uint64_t ) ) );\r
 \r
                do\r
                {\r