mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2025-04-19 21:11:57 -04:00
Fix RISC-V configMTIMECMP_BASE_ADDRESS (64-bit) stored in 32-bit int (#1176)
Related to #189 Update `configMTIMECMP_BASE_ADDRESS` to be stored in a 64-bit integer. * Change the type of `ullMachineTimerCompareRegisterBase` to `uint64_t` in `portable/GCC/RISC-V/port.c`. * Change the type of `ullMachineTimerCompareRegisterBase` to `uint64_t` in `portable/IAR/RISC-V/port.c`. * Update the initialization of `ullMachineTimerCompareRegisterBase` to use `configMTIMECMP_BASE_ADDRESS` in both files. Co-authored-by: Gaurav-Aggarwal-AWS <33462878+aggarg@users.noreply.github.com>
This commit is contained in:
parent
a27d6650ee
commit
b4a970729b
|
@ -90,7 +90,7 @@ void vPortSetupTimerInterrupt( void ) __attribute__( ( weak ) );
|
||||||
uint64_t ullNextTime = 0ULL;
|
uint64_t ullNextTime = 0ULL;
|
||||||
const uint64_t * pullNextTime = &ullNextTime;
|
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. */
|
const size_t uxTimerIncrementsForOneTick = ( size_t ) ( ( configCPU_CLOCK_HZ ) / ( configTICK_RATE_HZ ) ); /* Assumes increment won't go over 32-bits. */
|
||||||
uint32_t const ullMachineTimerCompareRegisterBase = configMTIMECMP_BASE_ADDRESS;
|
uint64_t const ullMachineTimerCompareRegisterBase = configMTIMECMP_BASE_ADDRESS;
|
||||||
volatile uint64_t * pullMachineTimerCompareRegister = NULL;
|
volatile uint64_t * pullMachineTimerCompareRegister = NULL;
|
||||||
|
|
||||||
/* Holds the critical nesting value - deliberately non-zero at start up to
|
/* Holds the critical nesting value - deliberately non-zero at start up to
|
||||||
|
|
|
@ -98,7 +98,7 @@ void vPortSetupTimerInterrupt( void ) __attribute__( ( weak ) );
|
||||||
uint64_t ullNextTime = 0ULL;
|
uint64_t ullNextTime = 0ULL;
|
||||||
const uint64_t * pullNextTime = &ullNextTime;
|
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. */
|
const size_t uxTimerIncrementsForOneTick = ( size_t ) ( ( configCPU_CLOCK_HZ ) / ( configTICK_RATE_HZ ) ); /* Assumes increment won't go over 32-bits. */
|
||||||
uint32_t const ullMachineTimerCompareRegisterBase = configMTIMECMP_BASE_ADDRESS;
|
uint64_t const ullMachineTimerCompareRegisterBase = configMTIMECMP_BASE_ADDRESS;
|
||||||
volatile uint64_t * pullMachineTimerCompareRegister = NULL;
|
volatile uint64_t * pullMachineTimerCompareRegister = NULL;
|
||||||
|
|
||||||
/* Holds the critical nesting value - deliberately non-zero at start up to
|
/* Holds the critical nesting value - deliberately non-zero at start up to
|
||||||
|
|
Loading…
Reference in a new issue