]> 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 8e9ce0fbd86629b6cb010c8afa27111e8bc524c0..db8bcbf2cb9b27b3813960a7dadf80d0e08b030c 100644 (file)
@@ -160,11 +160,20 @@ not necessary for to use this port.  They are defined so the common demo files
 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
+#if defined( configCLINT_BASE_ADDRESS ) && !defined( configMTIME_BASE_ADDRESS ) && ( configCLINT_BASE_ADDRESS == 0 )\r
+       /* Legacy case where configCLINT_BASE_ADDRESS was defined as 0 to indicate\r
+       there was no CLINT.  Equivalent now is to set the MTIME and MTIMECMP\r
+       addresses to 0. */\r
+       #define configMTIME_BASE_ADDRESS        ( 0 )\r
+       #define configMTIMECMP_BASE_ADDRESS ( 0 )\r
+#elif defined( configCLINT_BASE_ADDRESS ) && !defined( configMTIME_BASE_ADDRESS )\r
+       /* Legacy case where configCLINT_BASE_ADDRESS was set to the base address of\r
+       the CLINT.  Equivalent now is to derive the MTIME and MTIMECMP addresses\r
+       from the CLINT 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
+       #error configMTIME_BASE_ADDRESS and configMTIMECMP_BASE_ADDRESS must be defined in FreeRTOSConfig.h.  Set them to zero if there is no MTIME (machine time) clock.  See https://www.freertos.org/Using-FreeRTOS-on-RISC-V.html\r
 #endif\r
 \r
 \r