From b37e5d64b8013ed6753cdeccb5d7583d1aacc418 Mon Sep 17 00:00:00 2001 From: Mahavir Jain Date: Wed, 15 Nov 2017 11:15:31 +0530 Subject: [PATCH] freertos: port: add check for portMUX address validity Signed-off-by: Mahavir Jain --- components/freertos/port.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/components/freertos/port.c b/components/freertos/port.c index ba406d88fe..734e3d66c9 100644 --- a/components/freertos/port.c +++ b/components/freertos/port.c @@ -298,6 +298,11 @@ void vPortAssertIfInISR() * For kernel use: Initialize a per-CPU mux. Mux will be initialized unlocked. */ void vPortCPUInitializeMutex(portMUX_TYPE *mux) { +#if defined(CONFIG_SPIRAM_SUPPORT) + // Check if mux belongs to internal memory (DRAM), prerequisite for atomic operations + configASSERT(esp_ptr_internal((const void *) mux)); +#endif + #ifdef CONFIG_FREERTOS_PORTMUX_DEBUG ets_printf("Initializing mux %p\n", mux); mux->lastLockedFn="(never locked)"; -- 2.40.0