/[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.14 by bellard, Sat Mar 29 16:45:07 2003 UTC revision 1.15 by bellard, Sat May 10 21:39:12 2003 UTC
# Line 707  uint8_t seg_data2[4096]; Line 707  uint8_t seg_data2[4096];
707    
708  #define MK_SEL(n) (((n) << 3) | 7)  #define MK_SEL(n) (((n) << 3) | 7)
709    
710    #define TEST_LR(op, size, seg, mask)\
711    {\
712        int res, res2;\
713        res = 0x12345678;\
714        asm (op " %" size "2, %" size "0\n" \
715             "movl $0, %1\n"\
716             "jnz 1f\n"\
717             "movl $1, %1\n"\
718             "1:\n"\
719             : "=r" (res), "=r" (res2) : "m" (seg), "0" (res));\
720        printf(op ": Z=%d %08x\n", res2, res & ~(mask));\
721    }
722    
723  /* NOTE: we use Linux modify_ldt syscall */  /* NOTE: we use Linux modify_ldt syscall */
724  void test_segs(void)  void test_segs(void)
725  {  {
# Line 784  void test_segs(void) Line 797  void test_segs(void)
797                   : "=r" (res), "=g" (res2)                   : "=r" (res), "=g" (res2)
798                   : "m" (segoff));                   : "m" (segoff));
799      printf("FS:reg = %04x:%08x\n", res2, res);      printf("FS:reg = %04x:%08x\n", res2, res);
800    
801        TEST_LR("larw", "w", MK_SEL(2), 0x0100);
802        TEST_LR("larl", "", MK_SEL(2), 0x0100);
803        TEST_LR("lslw", "w", MK_SEL(2), 0);
804        TEST_LR("lsll", "", MK_SEL(2), 0);
805    
806        TEST_LR("larw", "w", 0xfff8, 0);
807        TEST_LR("larl", "", 0xfff8, 0);
808        TEST_LR("lslw", "w", 0xfff8, 0);
809        TEST_LR("lsll", "", 0xfff8, 0);
810  }  }
811    
812  /* 16 bit code test */  /* 16 bit code test */

Legend:
Removed from v.1.14  
changed lines
  Added in v.1.15

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