]> git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Library/BaseSynchronizationLib/InterlockedIncrementMsc.c
MdePkg: Replace BSD License with BSD+Patent License
[mirror_edk2.git] / MdePkg / Library / BaseSynchronizationLib / InterlockedIncrementMsc.c
1 /** @file
2 InterLockedIncrement function
3
4 Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
5 SPDX-License-Identifier: BSD-2-Clause-Patent
6
7 **/
8
9 /**
10 Microsoft Visual Studio 7.1 Function Prototypes for I/O Intrinsics.
11 **/
12
13 long _InterlockedIncrement(
14 long * lpAddend
15 );
16
17 #pragma intrinsic(_InterlockedIncrement)
18
19 /**
20 Performs an atomic increment of an 32-bit unsigned integer.
21
22 Performs an atomic increment of the 32-bit unsigned integer specified by
23 Value and returns the incremented value. The increment operation must be
24 performed using MP safe mechanisms. The state of the return value is not
25 guaranteed to be MP safe.
26
27 @param Value A pointer to the 32-bit value to increment.
28
29 @return The incremented value.
30
31 **/
32 UINT32
33 EFIAPI
34 InternalSyncIncrement (
35 IN volatile UINT32 *Value
36 )
37 {
38 return _InterlockedIncrement ((long *)(Value));
39 }
40