summaryrefslogtreecommitdiffstats
path: root/MdePkg/Library/BaseSynchronizationLib/Ia32/GccInline.c
diff options
context:
space:
mode:
Diffstat (limited to 'MdePkg/Library/BaseSynchronizationLib/Ia32/GccInline.c')
-rw-r--r--MdePkg/Library/BaseSynchronizationLib/Ia32/GccInline.c35
1 files changed, 16 insertions, 19 deletions
diff --git a/MdePkg/Library/BaseSynchronizationLib/Ia32/GccInline.c b/MdePkg/Library/BaseSynchronizationLib/Ia32/GccInline.c
index fa2be7f4b3..1976720ac6 100644
--- a/MdePkg/Library/BaseSynchronizationLib/Ia32/GccInline.c
+++ b/MdePkg/Library/BaseSynchronizationLib/Ia32/GccInline.c
@@ -39,7 +39,7 @@ InternalSyncIncrement (
"movl $1, %%eax \n\t"
"lock \n\t"
"xadd %%eax, %1 \n\t"
- "inc %%eax "
+ "inc %%eax \n\t"
: "=a" (Result), // %0
"+m" (*Value) // %1
: // no inputs that aren't also outputs
@@ -48,7 +48,6 @@ InternalSyncIncrement (
);
return Result;
-
}
@@ -76,10 +75,10 @@ InternalSyncDecrement (
"movl $-1, %%eax \n\t"
"lock \n\t"
"xadd %%eax, %1 \n\t"
- "dec %%eax "
- : "=a" (Result), // %0
- "+m" (*Value) // %1
- : // no inputs that aren't also outputs
+ "dec %%eax \n\t"
+ : "=a" (Result), // %0
+ "+m" (*Value) // %1
+ : // no inputs that aren't also outputs
: "memory",
"cc"
);
@@ -87,6 +86,7 @@ InternalSyncDecrement (
return Result;
}
+
/**
Performs an atomic compare exchange operation on a 16-bit unsigned integer.
@@ -113,15 +113,13 @@ InternalSyncCompareExchange16 (
IN UINT16 ExchangeValue
)
{
-
__asm__ __volatile__ (
- " \n\t"
"lock \n\t"
"cmpxchgw %1, %2 \n\t"
- : "=a" (CompareValue)
- : "q" (ExchangeValue),
- "m" (*Value),
- "0" (CompareValue)
+ : "=a" (CompareValue) // %0
+ : "q" (ExchangeValue), // %1
+ "m" (*Value), // %2
+ "0" (CompareValue) // %3
: "memory",
"cc"
);
@@ -129,6 +127,7 @@ InternalSyncCompareExchange16 (
return CompareValue;
}
+
/**
Performs an atomic compare exchange operation on a 32-bit unsigned integer.
@@ -155,15 +154,13 @@ InternalSyncCompareExchange32 (
IN UINT32 ExchangeValue
)
{
-
__asm__ __volatile__ (
- " \n\t"
"lock \n\t"
"cmpxchgl %1, %2 \n\t"
- : "=a" (CompareValue) // %0
- : "q" (ExchangeValue), // %1
- "m" (*Value), // %2
- "0" (CompareValue) // %4
+ : "=a" (CompareValue) // %0
+ : "q" (ExchangeValue), // %1
+ "m" (*Value), // %2
+ "0" (CompareValue) // %3
: "memory",
"cc"
);
@@ -171,6 +168,7 @@ InternalSyncCompareExchange32 (
return CompareValue;
}
+
/**
Performs an atomic compare exchange operation on a 64-bit unsigned integer.
@@ -197,7 +195,6 @@ InternalSyncCompareExchange64 (
)
{
__asm__ __volatile__ (
- " \n\t"
"push %%ebx \n\t"
"movl %2,%%ebx \n\t"
"lock \n\t"