Commit e026db5893aeff66bbc1153002b5285bc361c0a2
1 parent
43f04c23
alpha support
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@111 c046a42c-6fe2-441c-8c8c-71466251a162
Showing
1 changed file
with
19 additions
and
0 deletions
exec-i386.c
| @@ -102,6 +102,25 @@ static inline int testandset (int *p) | @@ -102,6 +102,25 @@ static inline int testandset (int *p) | ||
| 102 | } | 102 | } |
| 103 | #endif | 103 | #endif |
| 104 | 104 | ||
| 105 | +#ifdef __alpha__ | ||
| 106 | +int testandset (int *p) | ||
| 107 | +{ | ||
| 108 | + int ret; | ||
| 109 | + unsigned long one; | ||
| 110 | + | ||
| 111 | + __asm__ __volatile__ ("0: mov 1,%2\n" | ||
| 112 | + " ldl_l %0,%1\n" | ||
| 113 | + " stl_c %2,%1\n" | ||
| 114 | + " beq %2,1f\n" | ||
| 115 | + ".subsection 2\n" | ||
| 116 | + "1: br 0b\n" | ||
| 117 | + ".previous" | ||
| 118 | + : "=r" (ret), "=m" (*p), "=r" (one) | ||
| 119 | + : "m" (*p)); | ||
| 120 | + return ret; | ||
| 121 | +} | ||
| 122 | +#endif | ||
| 123 | + | ||
| 105 | int global_cpu_lock = 0; | 124 | int global_cpu_lock = 0; |
| 106 | 125 | ||
| 107 | void cpu_lock(void) | 126 | void cpu_lock(void) |