Skip to content

Commit 6426089

Browse files
authored
Merge pull request #75 from harisokanovic/dev/harisokn/ticket-spinlock-hang-al2-x86
Fix x86 clobber lists
2 parents 510103a + 110260c commit 6426089

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

benchmarks/lockhammer/include/perf_timer.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,8 @@ rdtscp_start(void)
138138
"mov %%edx, %0\n\t"
139139
"mov %%eax, %1\n\t":
140140
"=r" (tsc.hi_32),
141-
"=r" (tsc.lo_32)::"%rax", "%rbx", "%rcx", "%rdx");
141+
"=r" (tsc.lo_32)
142+
::"eax", "ebx", "ecx", "edx");
142143

143144
return tsc.tsc_64;
144145
}
@@ -164,7 +165,8 @@ rdtscp_end(void)
164165
"mov %%eax, %1\n\t"
165166
"CPUID\n\t":
166167
"=r" (tsc.hi_32),
167-
"=r" (tsc.lo_32)::"%rax", "%rbx", "%rcx", "%rdx");
168+
"=r" (tsc.lo_32)
169+
::"eax", "ebx", "ecx", "edx");
168170

169171
return tsc.tsc_64;
170172

ext/linux/ticket_spinlock.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ asm volatile (
4646
"4:\n"
4747
: [lock] "+m" (*lock), [depth] "=m" (depth)
4848
:
49-
: "cc" );
49+
: "cc", "eax", "ecx", "edx", "ax", "cx", "dx" );
5050
depth = (((depth >> 16) - (depth & 0xFFFF)) & 0xFFFF) >> 2;
5151
#elif defined(__aarch64__)
5252
unsigned tmp, tmp2, tmp3;

0 commit comments

Comments
 (0)