1 #include "ioram.h" 2 #include "vm.h" 3 #include "libcflat.h" 4 #include "desc.h" 5 #include "types.h" 6 #include "processor.h" 7 8 static void test_cmpxchg8b(u32 *mem) 9 { 10 mem[1] = 2; 11 mem[0] = 1; 12 asm("push %%ebx\n" 13 "mov %[ebx_val], %%ebx\n" 14 "lock cmpxchg8b (%0)\n" 15 "pop %%ebx" : : "D" (mem), 16 "d" (2), "a" (1), "c" (4), [ebx_val] "i" (3) : "memory"); 17 report(mem[0] == 3 && mem[1] == 4, "cmpxchg8b"); 18 } 19 20 int main(void) 21 { 22 setup_vm(); 23 setup_idt(); 24 25 test_cmpxchg8b(phys_to_virt(read_cr3()) + 4088); 26 return report_summary(); 27 } 28