projects
/
urcu.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
define sync_core for x86 PIC
[urcu.git]
/
urcu
/
arch_x86.h
diff --git
a/urcu/arch_x86.h
b/urcu/arch_x86.h
index c4674de0d35adfbe3eaa19560ba3a4750583fecb..64cc026f9cd46343cb977dc7b076bf9a7d70a317 100644
(file)
--- a/
urcu/arch_x86.h
+++ b/
urcu/arch_x86.h
@@
-49,9
+49,13
@@
extern "C" {
/*
* Serialize core instruction execution. Also acts as a compiler barrier.
/*
* Serialize core instruction execution. Also acts as a compiler barrier.
- * Cannot use cpuid on PIC because it clobbers the ebx register;
- * error: PIC register 'ebx' clobbered in 'asm'
+ * On PIC ebx cannot be clobbered
*/
*/
+#ifdef __PIC__
+#define sync_core() \
+ asm volatile("push %%ebx; cpuid; pop %%ebx" \
+ : : : "memory", "eax", "ecx", "edx");
+#endif
#ifndef __PIC__
#define sync_core() \
asm volatile("cpuid" : : : "memory", "eax", "ebx", "ecx", "edx");
#ifndef __PIC__
#define sync_core() \
asm volatile("cpuid" : : : "memory", "eax", "ebx", "ecx", "edx");
This page took
0.022553 seconds
and
4
git commands to generate.