summaryrefslogtreecommitdiff
path: root/FreeRTOS/Source/portable/GCC/RISC-V/portmacro.h
diff options
context:
space:
mode:
authorrtel <rtel@1d2547de-c912-0410-9cb9-b8ca96c0e9e2>2020-01-07 01:14:36 +0000
committerrtel <rtel@1d2547de-c912-0410-9cb9-b8ca96c0e9e2>2020-01-07 01:14:36 +0000
commitac0bef4d173093e29dff1f809d2bd0b08aaa5261 (patch)
treecb83cb9f7f2eb2db10593b2080fe8fa59b6e54e4 /FreeRTOS/Source/portable/GCC/RISC-V/portmacro.h
parent3944aaa70628e7036d1cb44fc9600f8820e4ea41 (diff)
downloadfreertos-ac0bef4d173093e29dff1f809d2bd0b08aaa5261.tar.gz
Replace portasmHAS_CLINT with configMTIME_BASE_ADDRESS and configMTIMECMP_BASE_ADDRESS definitions in the GCC RISC-V port - portasmHAS_CLIT will still work by deriving the new definitions from the old.
git-svn-id: http://svn.code.sf.net/p/freertos/code/trunk@2798 1d2547de-c912-0410-9cb9-b8ca96c0e9e2
Diffstat (limited to 'FreeRTOS/Source/portable/GCC/RISC-V/portmacro.h')
-rw-r--r--FreeRTOS/Source/portable/GCC/RISC-V/portmacro.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/FreeRTOS/Source/portable/GCC/RISC-V/portmacro.h b/FreeRTOS/Source/portable/GCC/RISC-V/portmacro.h
index 8e185d6f6..8e9ce0fbd 100644
--- a/FreeRTOS/Source/portable/GCC/RISC-V/portmacro.h
+++ b/FreeRTOS/Source/portable/GCC/RISC-V/portmacro.h
@@ -153,6 +153,21 @@ not necessary for to use this port. They are defined so the common demo files
#endif
#define portMEMORY_BARRIER() __asm volatile( "" ::: "memory" )
+/*-----------------------------------------------------------*/
+
+
+/* configCLINT_BASE_ADDRESS is a legacy definition that was replaced by the
+configMTIME_BASE_ADDRESS and configMTIMECMP_BASE_ADDRESS definitions. For
+backward compatibility derive the newer definitions from the old if the old
+definition is found. */
+#if defined( configCLINT_BASE_ADDRESS ) && !defined( configMTIME_BASE_ADDRESS )
+ #define configMTIME_BASE_ADDRESS ( ( configCLINT_BASE_ADDRESS ) + 0xBFF8UL )
+ #define configMTIMECMP_BASE_ADDRESS ( ( configCLINT_BASE_ADDRESS ) + 0x4000UL )
+#elif !defined( configMTIME_BASE_ADDRESS ) || !defined( configMTIMECMP_BASE_ADDRESS )
+ #error configMTIME_BASE_ADDRESS and configMTIMECMP_BASE_ADDRESS must be defined in FreeRTOSConfig.h. See https://www.freertos.org/Using-FreeRTOS-on-RISC-V.html
+#endif
+
+
#ifdef __cplusplus
}