]>
Commit | Line | Data |
---|---|---|
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 | |
17 | UINT32\r | |
18 | EFIAPI\r | |
19 | InternalSyncCompareExchange32 (\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 | |
29 | UINT64\r | |
30 | EFIAPI\r | |
31 | InternalSyncCompareExchange64 (\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 | |
41 | UINT32\r | |
42 | EFIAPI\r | |
43 | InternalSyncIncrement (\r | |
44 | IN volatile UINT32 *Value\r | |
45 | )\r | |
46 | {\r | |
47 | return ++*Value;\r | |
48 | }\r | |
49 | \r | |
50 | UINT32\r | |
51 | EFIAPI\r | |
52 | InternalSyncDecrement (\r | |
53 | IN volatile UINT32 *Value\r | |
54 | )\r | |
55 | {\r | |
56 | return --*Value;\r | |
57 | }\r |