]> git.proxmox.com Git - mirror_edk2.git/blame - MdePkg/Library/BaseLib/Ebc/Synchronization.c
Changed SwitchStack() to _SwitchStack()
[mirror_edk2.git] / MdePkg / Library / BaseLib / Ebc / Synchronization.c
CommitLineData
97d92bda 1/** @file\r
2 Implementation of synchronization functions on EBC.\r
3\r
4 Copyright (c) 2006, Intel Corporation<BR>\r
5 All rights reserved. This program and the accompanying materials\r
6 are licensed and made available under the terms and conditions of the BSD License\r
7 which accompanies this distribution. The full text of the license may be found at\r
8 http://opensource.org/licenses/bsd-license.php\r
9\r
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
12\r
13 Module Name: Synchronization.c\r
14\r
15**/\r
16\r
17UINT32\r
18EFIAPI\r
19InternalSyncCompareExchange32 (\r
20 IN volatile UINT32 *Value,\r
21 IN UINT32 CompareValue,\r
22 IN UINT32 ExchangeValue\r
23 )\r
24{\r
25 return *Value != CompareValue ? *Value :\r
26 ((*Value = ExchangeValue), CompareValue);\r
27}\r
28\r
29UINT64\r
30EFIAPI\r
31InternalSyncCompareExchange64 (\r
32 IN volatile UINT64 *Value,\r
33 IN UINT64 CompareValue,\r
34 IN UINT64 ExchangeValue\r
35 )\r
36{\r
37 return *Value != CompareValue ? *Value :\r
38 ((*Value = ExchangeValue), CompareValue);\r
39}\r
40\r
41UINT32\r
42EFIAPI\r
43InternalSyncIncrement (\r
44 IN volatile UINT32 *Value\r
45 )\r
46{\r
47 return ++*Value;\r
48}\r
49\r
50UINT32\r
51EFIAPI\r
52InternalSyncDecrement (\r
53 IN volatile UINT32 *Value\r
54 )\r
55{\r
56 return --*Value;\r
57}\r