Resolved SDOCM00101586. Added test cases to cover resolved issued
[keystone-rtos/rm-lld.git] / include / rm_internal.h
index 5923cabaf69688d46bbf741b4d61d006de2dfccf..40a56e0d2520f3bb61d5416813a699ebc07c3189 100644 (file)
@@ -51,14 +51,26 @@ extern "C" {
 #include <rm_osal.h>
 
 /* RM true/false definitions */
-#define RM_FALSE 0
-#define RM_TRUE  1
+#define RM_BOOL_UNDEF (-1)
+#define RM_FALSE      0
+#define RM_TRUE       1
+
+/* RM cache alignment */
+#define RM_MAX_CACHE_ALIGN 128
 
 /* Shared server enter critical section macro */
-#define RM_SS_INST_INV_ENTER_CS(csKey)                      \
-    Rm_osalBeginMemAccess((void *)rmInst, sizeof(Rm_Inst)); \
-    if (rmInst->instType == Rm_instType_SHARED_SERVER) {    \
-        csKey = Rm_osalCsEnter();                           \
+#define RM_SS_INST_INV_ENTER_CS(csKey)                          \
+    if (rmInst->instType == Rm_instType_SHARED_SERVER) {        \
+        csKey = Rm_osalCsEnter();                               \
+        Rm_osalBeginMemAccess((void *)rmInst, sizeof(Rm_Inst)); \
+    }
+
+/* Shared client enter critical section macro */
+#define RM_SC_INST_INV_ENTER_CS(csKey)                                           \
+    if (rmInst->instType == Rm_instType_SHARED_CLIENT) {                         \
+        csKey = Rm_osalCsEnter();                                                \
+        Rm_osalBeginMemAccess((void *)rmInst->u.sharedClient.sharedServerHandle, \
+                              sizeof(Rm_Inst));                                  \
     }
 
 /* Shared server exit critical section macro */
@@ -90,6 +102,9 @@ typedef struct {
     uint32_t length;
     /* Resource alignment */
     int32_t  alignment;
+    /* Resource owner count - number of instances that are in the
+     * resource's owner list */
+    int32_t  ownerCount;
     /* NameServer name tied to resource */
     char     nameServerName[RM_NAME_MAX_CHARS];
 } Rm_ResourceInfo;