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> |
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; |
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) */ |