]> granicus.if.org Git - esp-idf/commitdiff
freertos: Rename CORE_ID_PRO/CORE_ID_APP macros to CORE_ID_REGVAL_xxx
authorAngus Gratton <angus@espressif.com>
Mon, 12 Aug 2019 01:12:34 +0000 (11:12 +1000)
committerAngus Gratton <gus@projectgus.com>
Mon, 12 Aug 2019 01:12:34 +0000 (11:12 +1000)
Old values remain for compatibility.

As suggested in https://github.com/espressif/esp-idf/issues/2567

components/freertos/include/freertos/portmacro.h
components/freertos/include/freertos/xtensa_context.h
components/freertos/portmux_impl.h
components/freertos/portmux_impl.inc.h

index 6b09a2ce8bfa07b357a616d282759e45ddeca2da..d6b2184655d99579a1ef63c83a46b24bfe4aa0d8 100644 (file)
@@ -138,13 +138,13 @@ typedef struct {
        /* owner field values:
         * 0                            - Uninitialized (invalid)
         * portMUX_FREE_VAL - Mux is free, can be locked by either CPU
-        * CORE_ID_PRO / CORE_ID_APP - Mux is locked to the particular core
+        * CORE_ID_REGVAL_PRO / CORE_ID_REGVAL_APP - Mux is locked to the particular core
         *
         * Note that for performance reasons we use the full Xtensa CORE ID values
-        * (CORE_ID_PRO, CORE_ID_APP) and not the 0,1 values which are used in most
+        * (CORE_ID_REGVAL_PRO, CORE_ID_REGVAL_APP) and not the 0,1 values which are used in most
         * other FreeRTOS code.
         *
-        * Any value other than portMUX_FREE_VAL, CORE_ID_PRO, CORE_ID_APP indicates corruption
+        * Any value other than portMUX_FREE_VAL, CORE_ID_REGVAL_PRO, CORE_ID_REGVAL_APP indicates corruption
         */
        uint32_t owner;
        /* count field:
index 073a137bced97a4c0b76a46aecc5a355c5b29c38..120676dad47491adedff23347701414be7458c82 100644 (file)
@@ -325,11 +325,17 @@ STRUCT_END(XtSolFrame)
        .endm
 #endif
 
-/* Note: These are different to xCoreID used in ESP-IDF FreeRTOS, we just use
+/* Note: These are different to xCoreID used in ESP-IDF FreeRTOS, most places use
    0 and 1 which are determined by checking bit 13 (see previous comment)
 */
-#define CORE_ID_PRO 0xCDCD
-#define CORE_ID_APP 0xABAB
+#define CORE_ID_REGVAL_PRO 0xCDCD
+#define CORE_ID_REGVAL_APP 0xABAB
+
+/* Included for compatibility, recommend using CORE_ID_REGVAL_PRO instead */
+#define CORE_ID_PRO CORE_ID_REGVAL_PRO
+
+/* Included for compatibility, recommend using CORE_ID_REGVAL_APP instead */
+#define CORE_ID_APP CORE_ID_REGVAL_APP
 
 /*
 -------------------------------------------------------------------------------
index 5aef351b63849d8f621e22602f5977cfb9b5140e..691ad01e2f8e959a723f0ad9eddca6af7af48781 100644 (file)
@@ -49,7 +49,7 @@
 #include "soc/soc_memory_layout.h"
 
 /* XOR one core ID with this value to get the other core ID */
-#define CORE_ID_XOR_SWAP (CORE_ID_PRO ^ CORE_ID_APP)
+#define CORE_ID_REGVAL_XOR_SWAP (CORE_ID_REGVAL_PRO ^ CORE_ID_REGVAL_APP)
 
 
 
index 07a7ce9fe19a6fedb6888ce926b3f6b7e7a99a0d..908fec15396f22682efb136c821998db5f26554c 100644 (file)
@@ -61,7 +61,7 @@ PORTMUX_AQUIRE_MUX_FN_NAME(portMUX_TYPE *mux, int timeout_cycles) {
 
 #ifdef CONFIG_FREERTOS_PORTMUX_DEBUG
        uint32_t owner = mux->owner;
-       if (owner != portMUX_FREE_VAL && owner != CORE_ID_PRO && owner != CORE_ID_APP) {
+       if (owner != portMUX_FREE_VAL && owner != CORE_ID_REGVAL_PRO && owner != CORE_ID_REGVAL_APP) {
                ets_printf("ERROR: vPortCPUAcquireMutex: mux %p is uninitialized (0x%X)! Called from %s line %d.\n", mux, owner, fnName, line);
                mux->owner=portMUX_FREE_VAL;
        }
@@ -70,13 +70,13 @@ PORTMUX_AQUIRE_MUX_FN_NAME(portMUX_TYPE *mux, int timeout_cycles) {
        /* Spin until we own the core */
 
        RSR(PRID, coreID);
-       /* Note: coreID is the full 32 bit core ID (CORE_ID_PRO/CORE_ID_APP),
+       /* Note: coreID is the full 32 bit core ID (CORE_ID_REGVAL_PRO/CORE_ID_REGVAL_APP),
           not the 0/1 value returned by xPortGetCoreID()
        */
-       otherCoreID = CORE_ID_XOR_SWAP ^ coreID;
+       otherCoreID = CORE_ID_REGVAL_XOR_SWAP ^ coreID;
        do {
-               /* mux->owner should be one of portMUX_FREE_VAL, CORE_ID_PRO,
-                  CORE_ID_APP:
+               /* mux->owner should be one of portMUX_FREE_VAL, CORE_ID_REGVAL_PRO,
+                  CORE_ID_REGVAL_APP:
 
                   - If portMUX_FREE_VAL, we want to atomically set to 'coreID'.
                   - If "our" coreID, we can drop through immediately.
@@ -138,7 +138,7 @@ static inline void PORTMUX_RELEASE_MUX_FN_NAME(portMUX_TYPE *mux) {
        mux->lastLockedFn=fnName;
        mux->lastLockedLine=line;
        uint32_t owner = mux->owner;
-       if (owner != portMUX_FREE_VAL && owner != CORE_ID_PRO && owner != CORE_ID_APP) {
+       if (owner != portMUX_FREE_VAL && owner != CORE_ID_REGVAL_PRO && owner != CORE_ID_REGVAL_APP) {
                ets_printf("ERROR: vPortCPUReleaseMutex: mux %p is invalid (0x%x)!\n", mux, mux->owner);
        }
 #endif