VirtualBox

source: vbox/trunk/src/VBox/Devices/EFI/FirmwareNew/MdePkg/Library/BaseSynchronizationLib/BaseSynchronizationLibInternals.h@ 99396

最後變更 在這個檔案從99396是 80721,由 vboxsync 提交於 6 年 前

Devices/EFI/FirmwareNew: Start upgrade process to edk2-stable201908 (compiles on Windows and works to some extent), bugref:4643

  • 屬性 svn:eol-style 設為 native
檔案大小: 4.3 KB
 
1/** @file
2 Declaration of internal functions in BaseSynchronizationLib.
3
4 Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
5 SPDX-License-Identifier: BSD-2-Clause-Patent
6
7**/
8
9#ifndef __BASE_SYNCHRONIZATION_LIB_INTERNALS__
10#define __BASE_SYNCHRONIZATION_LIB_INTERNALS__
11
12#include <Base.h>
13#include <Library/SynchronizationLib.h>
14#include <Library/BaseLib.h>
15#include <Library/DebugLib.h>
16#include <Library/TimerLib.h>
17#include <Library/PcdLib.h>
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.
25
26 @param Value A pointer to the 32-bit value to increment.
27
28 @return The incremented value.
29
30**/
31UINT32
32EFIAPI
33InternalSyncIncrement (
34 IN volatile UINT32 *Value
35 );
36
37
38/**
39 Performs an atomic decrement of an 32-bit unsigned integer.
40
41 Performs an atomic decrement of the 32-bit unsigned integer specified by
42 Value and returns the decrement value. The decrement operation must be
43 performed using MP safe mechanisms.
44
45 @param Value A pointer to the 32-bit value to decrement.
46
47 @return The decrement value.
48
49**/
50UINT32
51EFIAPI
52InternalSyncDecrement (
53 IN volatile UINT32 *Value
54 );
55
56
57/**
58 Performs an atomic compare exchange operation on a 16-bit unsigned integer.
59
60 Performs an atomic compare exchange operation on the 16-bit unsigned integer
61 specified by Value. If Value is equal to CompareValue, then Value is set to
62 ExchangeValue and CompareValue is returned. If Value is not equal to CompareValue,
63 then Value is returned. The compare exchange operation must be performed using
64 MP safe mechanisms.
65
66 @param Value A pointer to the 16-bit value for the compare exchange
67 operation.
68 @param CompareValue A 16-bit value used in compare operation.
69 @param ExchangeValue A 16-bit value used in exchange operation.
70
71 @return The original *Value before exchange.
72
73**/
74UINT16
75EFIAPI
76InternalSyncCompareExchange16 (
77 IN volatile UINT16 *Value,
78 IN UINT16 CompareValue,
79 IN UINT16 ExchangeValue
80 );
81
82
83/**
84 Performs an atomic compare exchange operation on a 32-bit unsigned integer.
85
86 Performs an atomic compare exchange operation on the 32-bit unsigned integer
87 specified by Value. If Value is equal to CompareValue, then Value is set to
88 ExchangeValue and CompareValue is returned. If Value is not equal to CompareValue,
89 then Value is returned. The compare exchange operation must be performed using
90 MP safe mechanisms.
91
92 @param Value A pointer to the 32-bit value for the compare exchange
93 operation.
94 @param CompareValue A 32-bit value used in compare operation.
95 @param ExchangeValue A 32-bit value used in exchange operation.
96
97 @return The original *Value before exchange.
98
99**/
100UINT32
101EFIAPI
102InternalSyncCompareExchange32 (
103 IN volatile UINT32 *Value,
104 IN UINT32 CompareValue,
105 IN UINT32 ExchangeValue
106 );
107
108
109/**
110 Performs an atomic compare exchange operation on a 64-bit unsigned integer.
111
112 Performs an atomic compare exchange operation on the 64-bit unsigned integer specified
113 by Value. If Value is equal to CompareValue, then Value is set to ExchangeValue and
114 CompareValue is returned. If Value is not equal to CompareValue, then Value is returned.
115 The compare exchange operation must be performed using MP safe mechanisms.
116
117 @param Value A pointer to the 64-bit value for the compare exchange
118 operation.
119 @param CompareValue A 64-bit value used in compare operation.
120 @param ExchangeValue A 64-bit value used in exchange operation.
121
122 @return The original *Value before exchange.
123
124**/
125UINT64
126EFIAPI
127InternalSyncCompareExchange64 (
128 IN volatile UINT64 *Value,
129 IN UINT64 CompareValue,
130 IN UINT64 ExchangeValue
131 );
132
133/**
134 Internal function to retrieve the architecture specific spin lock alignment
135 requirements for optimal spin lock performance.
136
137 @return The architecture specific spin lock alignment.
138
139**/
140UINTN
141InternalGetSpinLockProperties (
142 VOID
143 );
144
145#endif
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette