Commit 070893f4252a9f3bb9aaf919780a104eb020605e

Authored by bellard
1 parent 9621339d

RedHat 9 fix


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@323 c046a42c-6fe2-441c-8c8c-71466251a162
Showing 1 changed file with 7 additions and 2 deletions
tests/test-i386.c
... ... @@ -6,6 +6,7 @@
6 6 #include <math.h>
7 7 #include <signal.h>
8 8 #include <setjmp.h>
  9 +#include <errno.h>
9 10 #include <sys/ucontext.h>
10 11 #include <sys/mman.h>
11 12 #include <asm/vm86.h>
... ... @@ -855,7 +856,6 @@ void test_segs(void)
855 856 #endif
856 857 /* do some tests with fs or gs */
857 858 asm volatile ("movl %0, %%fs" : : "r" (MK_SEL(1)));
858   - asm volatile ("movl %0, %%gs" : : "r" (MK_SEL(2)));
859 859  
860 860 seg_data1[1] = 0xaa;
861 861 seg_data2[1] = 0x55;
... ... @@ -863,7 +863,12 @@ void test_segs(void)
863 863 asm volatile ("fs movzbl 0x1, %0" : "=r" (res));
864 864 printf("FS[1] = %02x\n", res);
865 865  
866   - asm volatile ("gs movzbl 0x1, %0" : "=r" (res));
  866 + asm volatile ("pushl %%gs\n"
  867 + "movl %1, %%gs\n"
  868 + "gs movzbl 0x1, %0\n"
  869 + "popl %%gs\n"
  870 + : "=r" (res)
  871 + : "r" (MK_SEL(2)));
867 872 printf("GS[1] = %02x\n", res);
868 873  
869 874 /* tests with ds/ss (implicit segment case) */
... ...