Re: Bus Errors!

Gabriel Paubert (paubert@iram.es)
Sun, 8 Feb 1998 01:09:38 +0100 (MET)


On Sat, 7 Feb 1998, Alan Cox wrote:

> Its always true for CMPXCHG8

No. there isn't a single instruction which enforces alignment in the whole
Intel instruction set (except if you artificially force it with the AC
check feature). Or explain me why this program runs without problems on my
P5-133 (even if I put a lock before the cmpxchg8b).

Gabriel.

#include <unistd.h>
int main()
{
char string[16]="aaaaaaaaaaaaaaa";
int i, j=0, k;
for(i=0; i<=8; i++) {
asm volatile("cmpxchg8b (%1); setz %%al; movzbl %%al,%%eax":
"=a" (k): "S" (string+i),"0" (0x61616161),
"d" (0x61616161), "c" (0x61616161), "b" (0x61616161));
j+=k;
}
printf("%d exchanges performed\n", j);
exit(0);
}

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu