aboutsummaryrefslogtreecommitdiff
path: root/tests/test-i386.c
diff options
context:
space:
mode:
authorbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>2003-07-13 17:27:19 +0000
committerbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>2003-07-13 17:27:19 +0000
commit070893f4252a9f3bb9aaf919780a104eb020605e (patch)
tree52895d7ddf3b19d626f329c46ac7e8bb5ee14d63 /tests/test-i386.c
parent9621339dcacc148a86d312d1e71623202c9df7db (diff)
RedHat 9 fix
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@323 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'tests/test-i386.c')
-rw-r--r--tests/test-i386.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/tests/test-i386.c b/tests/test-i386.c
index 30923238ab..2411869569 100644
--- a/tests/test-i386.c
+++ b/tests/test-i386.c
@@ -6,6 +6,7 @@
#include <math.h>
#include <signal.h>
#include <setjmp.h>
+#include <errno.h>
#include <sys/ucontext.h>
#include <sys/mman.h>
#include <asm/vm86.h>
@@ -855,7 +856,6 @@ void test_segs(void)
#endif
/* do some tests with fs or gs */
asm volatile ("movl %0, %%fs" : : "r" (MK_SEL(1)));
- asm volatile ("movl %0, %%gs" : : "r" (MK_SEL(2)));
seg_data1[1] = 0xaa;
seg_data2[1] = 0x55;
@@ -863,7 +863,12 @@ void test_segs(void)
asm volatile ("fs movzbl 0x1, %0" : "=r" (res));
printf("FS[1] = %02x\n", res);
- asm volatile ("gs movzbl 0x1, %0" : "=r" (res));
+ asm volatile ("pushl %%gs\n"
+ "movl %1, %%gs\n"
+ "gs movzbl 0x1, %0\n"
+ "popl %%gs\n"
+ : "=r" (res)
+ : "r" (MK_SEL(2)));
printf("GS[1] = %02x\n", res);
/* tests with ds/ss (implicit segment case) */