]> git.sur5r.net Git - freertos/blobdiff - FreeRTOS/Source/portable/GCC/RISC-V/portmacro.h
Replace portasmHAS_CLINT with configMTIME_BASE_ADDRESS and configMTIMECMP_BASE_ADDRES...
[freertos] / FreeRTOS / Source / portable / GCC / RISC-V / portmacro.h
index 8e185d6f68e13c30254dac7be85e8118b18c4151..8e9ce0fbd86629b6cb010c8afa27111e8bc524c0 100644 (file)
@@ -153,6 +153,21 @@ not necessary for to use this port.  They are defined so the common demo files
 #endif\r
 \r
 #define portMEMORY_BARRIER() __asm volatile( "" ::: "memory" )\r
+/*-----------------------------------------------------------*/\r
+\r
+\r
+/* configCLINT_BASE_ADDRESS is a legacy definition that was replaced by the\r
+configMTIME_BASE_ADDRESS and configMTIMECMP_BASE_ADDRESS definitions.  For\r
+backward compatibility derive the newer definitions from the old if the old\r
+definition is found. */\r
+#if defined( configCLINT_BASE_ADDRESS ) && !defined( configMTIME_BASE_ADDRESS )\r
+       #define configMTIME_BASE_ADDRESS        ( ( configCLINT_BASE_ADDRESS ) + 0xBFF8UL )\r
+       #define configMTIMECMP_BASE_ADDRESS ( ( configCLINT_BASE_ADDRESS ) + 0x4000UL )\r
+#elif !defined( configMTIME_BASE_ADDRESS ) || !defined( configMTIMECMP_BASE_ADDRESS )\r
+       #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\r
+#endif\r
+\r
+\r
 \r
 #ifdef __cplusplus\r
 }\r