]>
Commit | Line | Data |
---|---|---|
720d3c5f | 1 | /** @file\r |
65330ad3 | 2 | Declaration of internal functions in BaseSynchronizationLib.\r |
720d3c5f | 3 | \r |
9095d37b | 4 | Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>\r |
e2d9bfb2 | 5 | This program and the accompanying materials\r |
720d3c5f | 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 | |
2fc59a00 | 8 | http://opensource.org/licenses/bsd-license.php.\r |
720d3c5f | 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 | **/\r | |
14 | \r | |
65330ad3 | 15 | #ifndef __BASE_SYNCHRONIZATION_LIB_INTERNALS__\r |
16 | #define __BASE_SYNCHRONIZATION_LIB_INTERNALS__\r | |
720d3c5f | 17 | \r |
18 | #include <Base.h>\r | |
19 | #include <Library/SynchronizationLib.h>\r | |
20 | #include <Library/BaseLib.h>\r | |
21 | #include <Library/DebugLib.h>\r | |
22 | #include <Library/TimerLib.h>\r | |
23 | #include <Library/PcdLib.h>\r | |
24 | \r | |
25 | /**\r | |
26 | Performs an atomic increment of an 32-bit unsigned integer.\r | |
27 | \r | |
28 | Performs an atomic increment of the 32-bit unsigned integer specified by\r | |
29 | Value and returns the incremented value. The increment operation must be\r | |
17634d02 | 30 | performed using MP safe mechanisms.\r |
720d3c5f | 31 | \r |
32 | @param Value A pointer to the 32-bit value to increment.\r | |
33 | \r | |
34 | @return The incremented value.\r | |
35 | \r | |
36 | **/\r | |
37 | UINT32\r | |
38 | EFIAPI\r | |
39 | InternalSyncIncrement (\r | |
40 | IN volatile UINT32 *Value\r | |
41 | );\r | |
42 | \r | |
43 | \r | |
44 | /**\r | |
45 | Performs an atomic decrement of an 32-bit unsigned integer.\r | |
46 | \r | |
47 | Performs an atomic decrement of the 32-bit unsigned integer specified by\r | |
48 | Value and returns the decrement value. The decrement operation must be\r | |
17634d02 | 49 | performed using MP safe mechanisms.\r |
720d3c5f | 50 | \r |
51 | @param Value A pointer to the 32-bit value to decrement.\r | |
52 | \r | |
53 | @return The decrement value.\r | |
54 | \r | |
55 | **/\r | |
56 | UINT32\r | |
57 | EFIAPI\r | |
58 | InternalSyncDecrement (\r | |
59 | IN volatile UINT32 *Value\r | |
60 | );\r | |
61 | \r | |
62 | \r | |
9b89163e AB |
63 | /**\r |
64 | Performs an atomic compare exchange operation on a 16-bit unsigned integer.\r | |
65 | \r | |
66 | Performs an atomic compare exchange operation on the 16-bit unsigned integer\r | |
67 | specified by Value. If Value is equal to CompareValue, then Value is set to\r | |
68 | ExchangeValue and CompareValue is returned. If Value is not equal to CompareValue,\r | |
69 | then Value is returned. The compare exchange operation must be performed using\r | |
70 | MP safe mechanisms.\r | |
71 | \r | |
72 | @param Value A pointer to the 16-bit value for the compare exchange\r | |
73 | operation.\r | |
74 | @param CompareValue A 16-bit value used in compare operation.\r | |
75 | @param ExchangeValue A 16-bit value used in exchange operation.\r | |
76 | \r | |
77 | @return The original *Value before exchange.\r | |
78 | \r | |
79 | **/\r | |
80 | UINT16\r | |
81 | EFIAPI\r | |
82 | InternalSyncCompareExchange16 (\r | |
83 | IN volatile UINT16 *Value,\r | |
84 | IN UINT16 CompareValue,\r | |
85 | IN UINT16 ExchangeValue\r | |
86 | );\r | |
87 | \r | |
88 | \r | |
720d3c5f | 89 | /**\r |
90 | Performs an atomic compare exchange operation on a 32-bit unsigned integer.\r | |
91 | \r | |
92 | Performs an atomic compare exchange operation on the 32-bit unsigned integer\r | |
93 | specified by Value. If Value is equal to CompareValue, then Value is set to\r | |
94 | ExchangeValue and CompareValue is returned. If Value is not equal to CompareValue,\r | |
95 | then Value is returned. The compare exchange operation must be performed using\r | |
96 | MP safe mechanisms.\r | |
97 | \r | |
98 | @param Value A pointer to the 32-bit value for the compare exchange\r | |
99 | operation.\r | |
2fc59a00 | 100 | @param CompareValue A 32-bit value used in compare operation.\r |
101 | @param ExchangeValue A 32-bit value used in exchange operation.\r | |
720d3c5f | 102 | \r |
103 | @return The original *Value before exchange.\r | |
104 | \r | |
105 | **/\r | |
106 | UINT32\r | |
107 | EFIAPI\r | |
108 | InternalSyncCompareExchange32 (\r | |
109 | IN volatile UINT32 *Value,\r | |
110 | IN UINT32 CompareValue,\r | |
111 | IN UINT32 ExchangeValue\r | |
112 | );\r | |
113 | \r | |
114 | \r | |
115 | /**\r | |
116 | Performs an atomic compare exchange operation on a 64-bit unsigned integer.\r | |
117 | \r | |
118 | Performs an atomic compare exchange operation on the 64-bit unsigned integer specified\r | |
119 | by Value. If Value is equal to CompareValue, then Value is set to ExchangeValue and\r | |
120 | CompareValue is returned. If Value is not equal to CompareValue, then Value is returned.\r | |
121 | The compare exchange operation must be performed using MP safe mechanisms.\r | |
122 | \r | |
123 | @param Value A pointer to the 64-bit value for the compare exchange\r | |
124 | operation.\r | |
2fc59a00 | 125 | @param CompareValue A 64-bit value used in compare operation.\r |
126 | @param ExchangeValue A 64-bit value used in exchange operation.\r | |
720d3c5f | 127 | \r |
128 | @return The original *Value before exchange.\r | |
129 | \r | |
130 | **/\r | |
131 | UINT64\r | |
132 | EFIAPI\r | |
133 | InternalSyncCompareExchange64 (\r | |
134 | IN volatile UINT64 *Value,\r | |
135 | IN UINT64 CompareValue,\r | |
136 | IN UINT64 ExchangeValue\r | |
137 | );\r | |
138 | \r | |
5f0a17d8 JF |
139 | /**\r |
140 | Internal function to retrieve the architecture specific spin lock alignment\r | |
141 | requirements for optimal spin lock performance.\r | |
142 | \r | |
143 | @return The architecture specific spin lock alignment.\r | |
9095d37b | 144 | \r |
5f0a17d8 JF |
145 | **/\r |
146 | UINTN\r | |
147 | InternalGetSpinLockProperties (\r | |
148 | VOID\r | |
149 | );\r | |
150 | \r | |
720d3c5f | 151 | #endif\r |