/[qemu]/qemu/tests/test-i386.c
ViewVC logotype

Diff of /qemu/tests/test-i386.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.23 by bellard, Fri Jul 11 14:49:58 2003 UTC revision 1.24 by bellard, Sun Jul 13 17:27:19 2003 UTC
# Line 6  Line 6 
6  #include <math.h>  #include <math.h>
7  #include <signal.h>  #include <signal.h>
8  #include <setjmp.h>  #include <setjmp.h>
9    #include <errno.h>
10  #include <sys/ucontext.h>  #include <sys/ucontext.h>
11  #include <sys/mman.h>  #include <sys/mman.h>
12  #include <asm/vm86.h>  #include <asm/vm86.h>
# Line 855  void test_segs(void) Line 856  void test_segs(void)
856  #endif  #endif
857      /* do some tests with fs or gs */      /* do some tests with fs or gs */
858      asm volatile ("movl %0, %%fs" : : "r" (MK_SEL(1)));      asm volatile ("movl %0, %%fs" : : "r" (MK_SEL(1)));
     asm volatile ("movl %0, %%gs" : : "r" (MK_SEL(2)));  
859    
860      seg_data1[1] = 0xaa;      seg_data1[1] = 0xaa;
861      seg_data2[1] = 0x55;      seg_data2[1] = 0x55;
# Line 863  void test_segs(void) Line 863  void test_segs(void)
863      asm volatile ("fs movzbl 0x1, %0" : "=r" (res));      asm volatile ("fs movzbl 0x1, %0" : "=r" (res));
864      printf("FS[1] = %02x\n", res);      printf("FS[1] = %02x\n", res);
865    
866      asm volatile ("gs movzbl 0x1, %0" : "=r" (res));      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)));
872      printf("GS[1] = %02x\n", res);      printf("GS[1] = %02x\n", res);
873    
874      /* tests with ds/ss (implicit segment case) */      /* tests with ds/ss (implicit segment case) */

Legend:
Removed from v.1.23  
changed lines
  Added in v.1.24

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26