Revision 070893f4 tests/test-i386.c

b/tests/test-i386.c
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 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 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) */

Also available in: Unified diff