diff options
| author | Bjoern B. Brandenburg <bbb@cs.unc.edu> | 2010-02-03 09:36:29 -0500 |
|---|---|---|
| committer | Bjoern B. Brandenburg <bbb@cs.unc.edu> | 2010-02-03 09:36:29 -0500 |
| commit | 1c21007bbcb62829b12dc7271fdbc183c4ca1aa2 (patch) | |
| tree | 42147175eff5b4bf4ec2b109969d349ccb296b28 | |
| parent | fc001302538dea0e8a67afb732f2daa1f18358dd (diff) | |
Add initial support x86-64 ASM header.
| -rw-r--r-- | include/asm.h | 5 | ||||
| -rw-r--r-- | include/asm_x86.h (renamed from include/asm_i386.h) | 6 |
2 files changed, 8 insertions, 3 deletions
diff --git a/include/asm.h b/include/asm.h index a58622e..bc15fae 100644 --- a/include/asm.h +++ b/include/asm.h | |||
| @@ -3,10 +3,11 @@ | |||
| 3 | #ifndef ASM_H | 3 | #ifndef ASM_H |
| 4 | #define ASM_H | 4 | #define ASM_H |
| 5 | 5 | ||
| 6 | #ifdef __i386__ | 6 | #if defined(__i386__) || defined(__x86_64__) |
| 7 | #include "asm_i386.h" | 7 | #include "asm_x86.h" |
| 8 | #endif | 8 | #endif |
| 9 | 9 | ||
| 10 | |||
| 10 | #ifdef __sparc__ | 11 | #ifdef __sparc__ |
| 11 | #include "asm_sparc.h" | 12 | #include "asm_sparc.h" |
| 12 | #endif | 13 | #endif |
diff --git a/include/asm_i386.h b/include/asm_x86.h index e077ddc..b5bf166 100644 --- a/include/asm_i386.h +++ b/include/asm_x86.h | |||
| @@ -8,7 +8,7 @@ | |||
| 8 | 8 | ||
| 9 | static inline void barrier(void) | 9 | static inline void barrier(void) |
| 10 | { | 10 | { |
| 11 | __asm__ __volatile__("sfence": : :"memory"); | 11 | __asm__ __volatile__("mfence": : :"memory"); |
| 12 | } | 12 | } |
| 13 | 13 | ||
| 14 | static __inline__ void cpu_relax(void) | 14 | static __inline__ void cpu_relax(void) |
| @@ -16,6 +16,9 @@ static __inline__ void cpu_relax(void) | |||
| 16 | __asm__ __volatile("pause"); | 16 | __asm__ __volatile("pause"); |
| 17 | } | 17 | } |
| 18 | 18 | ||
| 19 | |||
| 20 | #ifdef __i386__ | ||
| 21 | |||
| 19 | typedef struct { int counter; } atomic_t; | 22 | typedef struct { int counter; } atomic_t; |
| 20 | 23 | ||
| 21 | #define ATOMIC_INIT(i) { (i) } | 24 | #define ATOMIC_INIT(i) { (i) } |
| @@ -66,3 +69,4 @@ static __inline__ int atomic_add_return(int i, atomic_t *v) | |||
| 66 | #define atomic_inc_return(v) (atomic_add_return(1,v)) | 69 | #define atomic_inc_return(v) (atomic_add_return(1,v)) |
| 67 | 70 | ||
| 68 | 71 | ||
| 72 | #endif | ||
