summaryrefslogtreecommitdiff
path: root/MdePkg/Library/BaseSynchronizationLib/InterlockedIncrementMsc.c
diff options
context:
space:
mode:
Diffstat (limited to 'MdePkg/Library/BaseSynchronizationLib/InterlockedIncrementMsc.c')
-rw-r--r--MdePkg/Library/BaseSynchronizationLib/InterlockedIncrementMsc.c40
1 files changed, 40 insertions, 0 deletions
diff --git a/MdePkg/Library/BaseSynchronizationLib/InterlockedIncrementMsc.c b/MdePkg/Library/BaseSynchronizationLib/InterlockedIncrementMsc.c
new file mode 100644
index 000000000000..ebd9349cca90
--- /dev/null
+++ b/MdePkg/Library/BaseSynchronizationLib/InterlockedIncrementMsc.c
@@ -0,0 +1,40 @@
+/** @file
+ InterLockedIncrement function
+
+ Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
+ SPDX-License-Identifier: BSD-2-Clause-Patent
+
+**/
+
+/**
+ Microsoft Visual Studio 7.1 Function Prototypes for I/O Intrinsics.
+**/
+
+long _InterlockedIncrement(
+ long * lpAddend
+);
+
+#pragma intrinsic(_InterlockedIncrement)
+
+/**
+ Performs an atomic increment of an 32-bit unsigned integer.
+
+ Performs an atomic increment of the 32-bit unsigned integer specified by
+ Value and returns the incremented value. The increment operation must be
+ performed using MP safe mechanisms. The state of the return value is not
+ guaranteed to be MP safe.
+
+ @param Value A pointer to the 32-bit value to increment.
+
+ @return The incremented value.
+
+**/
+UINT32
+EFIAPI
+InternalSyncIncrement (
+ IN volatile UINT32 *Value
+ )
+{
+ return _InterlockedIncrement ((long *)(Value));
+}
+