]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdePkg/Library/BaseLib/Synchronization.c
Add in OFFSET_OF macro as defined in MDE Library spec
[mirror_edk2.git] / MdePkg / Library / BaseLib / Synchronization.c
index e08aa62cf98da10cf02d22d6a54a89d79b771fcd..59919a7f03b1ac1955d1075fd30585d060e10c94 100644 (file)
 \r
 #include "BaseLibInternals.h"\r
 \r
-#define SPIN_LOCK_RELEASED          ((SPIN_LOCK)1)\r
-#define SPIN_LOCK_ACQUIRED          ((SPIN_LOCK)2)\r
+//\r
+// SPIN_LOCK_RELEASED & SPIN_LOCK_ACQUIRED should belong to type "SPIN_LOCK".\r
+// Here we use type-case "UINTN" to avoid "volatile" modifier on const integers.\r
+//\r
+#define SPIN_LOCK_RELEASED          ((UINTN) 1)\r
+#define SPIN_LOCK_ACQUIRED          ((UINTN) 2)\r
 \r
 /**\r
   Retrieves the architecture specific spin lock alignment requirements for\r
@@ -151,7 +155,7 @@ AcquireSpinLockOrFail (
   IN OUT  SPIN_LOCK                 *SpinLock\r
   )\r
 {\r
-  volatile SPIN_LOCK    LockValue;\r
+  SPIN_LOCK    LockValue;\r
 \r
   ASSERT (SpinLock != NULL);\r
 \r
@@ -187,7 +191,7 @@ ReleaseSpinLock (
   IN OUT  SPIN_LOCK                 *SpinLock\r
   )\r
 {\r
-  volatile SPIN_LOCK    LockValue;\r
+  SPIN_LOCK    LockValue;\r
 \r
   ASSERT (SpinLock != NULL);\r
 \r