summaryrefslogtreecommitdiff
path: root/MdePkg/Library/BaseLib/X64
diff options
context:
space:
mode:
Diffstat (limited to 'MdePkg/Library/BaseLib/X64')
-rw-r--r--MdePkg/Library/BaseLib/X64/CpuBreakpoint.c13
-rw-r--r--MdePkg/Library/BaseLib/X64/InterlockedCompareExchange32.c23
-rw-r--r--MdePkg/Library/BaseLib/X64/InterlockedCompareExchange64.c22
-rw-r--r--MdePkg/Library/BaseLib/X64/InterlockedDecrement.c19
-rw-r--r--MdePkg/Library/BaseLib/X64/InterlockedIncrement.c19
-rw-r--r--MdePkg/Library/BaseLib/X64/ReadMsr64.c14
-rw-r--r--MdePkg/Library/BaseLib/X64/WriteMsr64.c15
7 files changed, 104 insertions, 21 deletions
diff --git a/MdePkg/Library/BaseLib/X64/CpuBreakpoint.c b/MdePkg/Library/BaseLib/X64/CpuBreakpoint.c
index 01939e9128..049e34eaae 100644
--- a/MdePkg/Library/BaseLib/X64/CpuBreakpoint.c
+++ b/MdePkg/Library/BaseLib/X64/CpuBreakpoint.c
@@ -13,13 +13,20 @@
**/
-//
-// Microsoft Visual Studio 7.1 Function Prototypes for I/O Intrinsics
-//
+/**
+ Microsoft Visual Studio 7.1 Function Prototypes for I/O Intrinsics.
+**/
void __debugbreak ();
#pragma intrinsic(__debugbreak)
+/**
+ Generates a breakpoint on the CPU.
+
+ Generates a breakpoint on the CPU. The breakpoint must be implemented such
+ that code can resume normal execution after the breakpoint.
+
+**/
VOID
EFIAPI
CpuBreakpoint (
diff --git a/MdePkg/Library/BaseLib/X64/InterlockedCompareExchange32.c b/MdePkg/Library/BaseLib/X64/InterlockedCompareExchange32.c
index 4a9fe6aca6..de1aac7e6a 100644
--- a/MdePkg/Library/BaseLib/X64/InterlockedCompareExchange32.c
+++ b/MdePkg/Library/BaseLib/X64/InterlockedCompareExchange32.c
@@ -12,9 +12,9 @@
**/
-//
-// Microsoft Visual Studio 7.1 Function Prototypes for I/O Intrinsics
-//
+/**
+ Microsoft Visual Studio 7.1 Function Prototypes for I/O Intrinsics.
+**/
long _InterlockedCompareExchange(
long volatile * Destination,
long Exchange,
@@ -23,6 +23,23 @@ long _InterlockedCompareExchange(
#pragma intrinsic(_InterlockedCompareExchange)
+/**
+ Performs an atomic compare exchange operation on a 32-bit unsigned integer.
+
+ Performs an atomic compare exchange operation on the 32-bit unsigned integer
+ specified by Value. If Value is equal to CompareValue, then Value is set to
+ ExchangeValue and CompareValue is returned. If Value is not equal to CompareValue,
+ then Value is returned. The compare exchange operation must be performed using
+ MP safe mechanisms.
+
+ @param Value A pointer to the 32-bit value for the compare exchange
+ operation.
+ @param CompareValue 32-bit value used in compare operation.
+ @param ExchangeValue 32-bit value used in exchange operation.
+
+ @return The original *Value before exchange.
+
+**/
UINT32
EFIAPI
InternalSyncCompareExchange32 (
diff --git a/MdePkg/Library/BaseLib/X64/InterlockedCompareExchange64.c b/MdePkg/Library/BaseLib/X64/InterlockedCompareExchange64.c
index bed1dc8972..1206a1732c 100644
--- a/MdePkg/Library/BaseLib/X64/InterlockedCompareExchange64.c
+++ b/MdePkg/Library/BaseLib/X64/InterlockedCompareExchange64.c
@@ -12,9 +12,9 @@
**/
-//
-// Microsoft Visual Studio 7.1 Function Prototypes for I/O Intrinsics
-//
+/**
+ Microsoft Visual Studio 7.1 Function Prototypes for I/O Intrinsics.
+**/
__int64 _InterlockedCompareExchange64(
__int64 volatile * Destination,
__int64 Exchange,
@@ -23,6 +23,22 @@ __int64 _InterlockedCompareExchange64(
#pragma intrinsic(_InterlockedCompareExchange64)
+/**
+ Performs an atomic compare exchange operation on a 64-bit unsigned integer.
+
+ Performs an atomic compare exchange operation on the 64-bit unsigned integer specified
+ by Value. If Value is equal to CompareValue, then Value is set to ExchangeValue and
+ CompareValue is returned. If Value is not equal to CompareValue, then Value is returned.
+ The compare exchange operation must be performed using MP safe mechanisms.
+
+ @param Value A pointer to the 64-bit value for the compare exchange
+ operation.
+ @param CompareValue 64-bit value used in compare operation.
+ @param ExchangeValue 64-bit value used in exchange operation.
+
+ @return The original *Value before exchange.
+
+**/
UINT64
EFIAPI
InternalSyncCompareExchange64 (
diff --git a/MdePkg/Library/BaseLib/X64/InterlockedDecrement.c b/MdePkg/Library/BaseLib/X64/InterlockedDecrement.c
index 19e6a5dc49..0f321f8f18 100644
--- a/MdePkg/Library/BaseLib/X64/InterlockedDecrement.c
+++ b/MdePkg/Library/BaseLib/X64/InterlockedDecrement.c
@@ -12,15 +12,28 @@
**/
-//
-// Microsoft Visual Studio 7.1 Function Prototypes for I/O Intrinsics
-//
+/**
+ Microsoft Visual Studio 7.1 Function Prototypes for I/O Intrinsics.
+**/
long _InterlockedDecrement(
long * lpAddend
);
#pragma intrinsic(_InterlockedDecrement)
+/**
+ Performs an atomic decrement of an 32-bit unsigned integer.
+
+ Performs an atomic decrement of the 32-bit unsigned integer specified by
+ Value and returns the decrement value. The decrement operation must be
+ performed using MP safe mechanisms. The state of the return value is not
+ guaranteed to be MP safe.
+
+ @param Value A pointer to the 32-bit value to decrement.
+
+ @return The decrement value.
+
+**/
UINT32
EFIAPI
InternalSyncDecrement (
diff --git a/MdePkg/Library/BaseLib/X64/InterlockedIncrement.c b/MdePkg/Library/BaseLib/X64/InterlockedIncrement.c
index eda9f79a5b..80921c82df 100644
--- a/MdePkg/Library/BaseLib/X64/InterlockedIncrement.c
+++ b/MdePkg/Library/BaseLib/X64/InterlockedIncrement.c
@@ -12,15 +12,28 @@
**/
-//
-// Microsoft Visual Studio 7.1 Function Prototypes for I/O Intrinsics
-//
+/**
+ Microsoft Visual Studio 7.1 Function Prototypes for I/O Intrinsics.
+**/
long _InterlockedIncrement(
long * lpAddend
);
#pragma intrinsic(_InterlockedIncrement)
+/**
+ Performs an atomic increment of an 32-bit unsigned integer.
+
+ Performs an atomic increment of the 32-bit unsigned integer specified by
+ Value and returns the incremented value. The increment operation must be
+ performed using MP safe mechanisms. The state of the return value is not
+ guaranteed to be MP safe.
+
+ @param Value A pointer to the 32-bit value to increment.
+
+ @return The incremented value.
+
+**/
UINT32
EFIAPI
InternalSyncIncrement (
diff --git a/MdePkg/Library/BaseLib/X64/ReadMsr64.c b/MdePkg/Library/BaseLib/X64/ReadMsr64.c
index 15a573fc09..19f7939654 100644
--- a/MdePkg/Library/BaseLib/X64/ReadMsr64.c
+++ b/MdePkg/Library/BaseLib/X64/ReadMsr64.c
@@ -12,13 +12,21 @@
**/
-//
-// Microsoft Visual Studio 7.1 Function Prototypes for I/O Intrinsics
-//
+/**
+ Microsoft Visual Studio 7.1 Function Prototypes for I/O Intrinsics.
+**/
unsigned __int64 __readmsr (int register);
#pragma intrinsic(__readmsr)
+/**
+ Read data to MSR.
+
+ @param Index Register index of MSR.
+
+ @return Value read from MSR.
+
+**/
UINT64
EFIAPI
diff --git a/MdePkg/Library/BaseLib/X64/WriteMsr64.c b/MdePkg/Library/BaseLib/X64/WriteMsr64.c
index 1d1e0bc332..77d8c59724 100644
--- a/MdePkg/Library/BaseLib/X64/WriteMsr64.c
+++ b/MdePkg/Library/BaseLib/X64/WriteMsr64.c
@@ -12,13 +12,22 @@
**/
-//
-// Microsoft Visual Studio 7.1 Function Prototypes for I/O Intrinsics
-//
+/**
+ Microsoft Visual Studio 7.1 Function Prototypes for I/O Intrinsics.
+**/
void __writemsr (unsigned long Register, unsigned __int64 Value);
#pragma intrinsic(__writemsr)
+/**
+ Write data to MSR.
+
+ @param Index Register index of MSR.
+ @param Value Data wants to be written.
+
+ @return Value written to MSR.
+
+**/
UINT64
EFIAPI
AsmWriteMsr64 (