Skip to content

Commit bbd4bb0

Browse files
authored
Zero ecx with a mov instruction
PGI assembler does not like the initialization in the constraints.
1 parent 6d3efb2 commit bbd4bb0

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

common_x86_64.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,12 +129,13 @@ static __inline void cpuid(int op, int *eax, int *ebx, int *ecx, int *edx){
129129
*ecx=cpuinfo[2];
130130
*edx=cpuinfo[3];
131131
#else
132-
__asm__ __volatile__("cpuid"
132+
__asm__ __volatile__("mov %%ecx, 0;"
133+
"cpuid"
133134
: "=a" (*eax),
134135
"=b" (*ebx),
135136
"=c" (*ecx),
136137
"=d" (*edx)
137-
: "0" (op), "c"(0));
138+
: "0" (op));
138139
#endif
139140
}
140141

0 commit comments

Comments
 (0)