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 +6,7 @@
6 #include <math.h> 6 #include <math.h>
7 #include <signal.h> 7 #include <signal.h>
8 #include <setjmp.h> 8 #include <setjmp.h>
  9 +#include <errno.h>
9 #include <sys/ucontext.h> 10 #include <sys/ucontext.h>
10 #include <sys/mman.h> 11 #include <sys/mman.h>
11 #include <asm/vm86.h> 12 #include <asm/vm86.h>
@@ -855,7 +856,6 @@ void test_segs(void) @@ -855,7 +856,6 @@ void test_segs(void)
855 #endif 856 #endif
856 /* do some tests with fs or gs */ 857 /* do some tests with fs or gs */
857 asm volatile ("movl %0, %%fs" : : "r" (MK_SEL(1))); 858 asm volatile ("movl %0, %%fs" : : "r" (MK_SEL(1)));
858 - asm volatile ("movl %0, %%gs" : : "r" (MK_SEL(2)));  
859 859
860 seg_data1[1] = 0xaa; 860 seg_data1[1] = 0xaa;
861 seg_data2[1] = 0x55; 861 seg_data2[1] = 0x55;
@@ -863,7 +863,12 @@ void test_segs(void) @@ -863,7 +863,12 @@ void test_segs(void)
863 asm volatile ("fs movzbl 0x1, %0" : "=r" (res)); 863 asm volatile ("fs movzbl 0x1, %0" : "=r" (res));
864 printf("FS[1] = %02x\n", res); 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 printf("GS[1] = %02x\n", res); 872 printf("GS[1] = %02x\n", res);
868 873
869 /* tests with ds/ss (implicit segment case) */ 874 /* tests with ds/ss (implicit segment case) */