Commit be98f1f82290118e176b704fd270f552c3d6a35a

Authored by bellard
1 parent e160c51c

compilation fixes


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3585 c046a42c-6fe2-441c-8c8c-71466251a162
Showing 1 changed file with 20 additions and 17 deletions
tests/test-i386.c
@@ -703,8 +703,8 @@ union float64u { @@ -703,8 +703,8 @@ union float64u {
703 uint64_t l; 703 uint64_t l;
704 }; 704 };
705 705
706 -union float64u q_nan = { .l = 0xFFF8000000000000 };  
707 -union float64u s_nan = { .l = 0xFFF0000000000000 }; 706 +union float64u q_nan = { .l = 0xFFF8000000000000LL };
  707 +union float64u s_nan = { .l = 0xFFF0000000000000LL };
708 708
709 void test_fops(double a, double b) 709 void test_fops(double a, double b)
710 { 710 {
@@ -819,7 +819,9 @@ void test_fcvt(double a) @@ -819,7 +819,9 @@ void test_fcvt(double a)
819 /* test all roundings */ 819 /* test all roundings */
820 asm volatile ("fstcw %0" : "=m" (fpuc)); 820 asm volatile ("fstcw %0" : "=m" (fpuc));
821 for(i=0;i<4;i++) { 821 for(i=0;i<4;i++) {
822 - asm volatile ("fldcw %0" : : "m" ((fpuc & ~0x0c00) | (i << 10))); 822 + uint16_t val16;
  823 + val16 = (fpuc & ~0x0c00) | (i << 10);
  824 + asm volatile ("fldcw %0" : : "m" (val16));
823 asm volatile ("fist %0" : "=m" (wa) : "t" (a)); 825 asm volatile ("fist %0" : "=m" (wa) : "t" (a));
824 asm volatile ("fistl %0" : "=m" (ia) : "t" (a)); 826 asm volatile ("fistl %0" : "=m" (ia) : "t" (a));
825 asm volatile ("fistpll %0" : "=m" (lla) : "t" (a) : "st"); 827 asm volatile ("fistpll %0" : "=m" (lla) : "t" (a) : "st");
@@ -976,8 +978,8 @@ void test_floats(void) @@ -976,8 +978,8 @@ void test_floats(void)
976 test_fcvt(1.0/0.0); 978 test_fcvt(1.0/0.0);
977 test_fcvt(q_nan.d); 979 test_fcvt(q_nan.d);
978 test_fconst(); 980 test_fconst();
979 - test_fbcd(1234567890123456);  
980 - test_fbcd(-123451234567890); 981 + test_fbcd(1234567890123456.0);
  982 + test_fbcd(-123451234567890.0);
981 test_fenv(); 983 test_fenv();
982 if (TEST_CMOV) { 984 if (TEST_CMOV) {
983 test_fcmov(); 985 test_fcmov();
@@ -1151,12 +1153,12 @@ void test_xchg(void) @@ -1151,12 +1153,12 @@ void test_xchg(void)
1151 long i, eflags; 1153 long i, eflags;
1152 1154
1153 for(i = 0; i < 2; i++) { 1155 for(i = 0; i < 2; i++) {
1154 - op0 = 0x123456789abcd; 1156 + op0 = 0x123456789abcdLL;
1155 if (i == 0) 1157 if (i == 0)
1156 - op1 = 0xfbca765423456; 1158 + op1 = 0xfbca765423456LL;
1157 else 1159 else
1158 op1 = op0; 1160 op1 = op0;
1159 - op2 = 0x6532432432434; 1161 + op2 = 0x6532432432434LL;
1160 asm("cmpxchg8b %1\n" 1162 asm("cmpxchg8b %1\n"
1161 "pushf\n" 1163 "pushf\n"
1162 "pop %2\n" 1164 "pop %2\n"
@@ -1172,11 +1174,15 @@ void test_xchg(void) @@ -1172,11 +1174,15 @@ void test_xchg(void)
1172 /**********************************************/ 1174 /**********************************************/
1173 /* segmentation tests */ 1175 /* segmentation tests */
1174 1176
  1177 +#include <sys/syscall.h>
  1178 +#include <unistd.h>
1175 #include <asm/ldt.h> 1179 #include <asm/ldt.h>
1176 -#include <linux/unistd.h>  
1177 #include <linux/version.h> 1180 #include <linux/version.h>
1178 1181
1179 -_syscall3(int, modify_ldt, int, func, void *, ptr, unsigned long, bytecount) 1182 +static inline int modify_ldt(int func, void * ptr, unsigned long bytecount)
  1183 +{
  1184 + return syscall(__NR_modify_ldt, func, ptr, bytecount);
  1185 +}
1180 1186
1181 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 5, 66) 1187 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 5, 66)
1182 #define modify_ldt_ldt_s user_desc 1188 #define modify_ldt_ldt_s user_desc
@@ -1505,13 +1511,10 @@ static inline void pushw(struct vm86_regs *r, int val) @@ -1505,13 +1511,10 @@ static inline void pushw(struct vm86_regs *r, int val)
1505 *(uint16_t *)seg_to_linear(r->ss, r->esp) = val; 1511 *(uint16_t *)seg_to_linear(r->ss, r->esp) = val;
1506 } 1512 }
1507 1513
1508 -#undef __syscall_return  
1509 -#define __syscall_return(type, res) \  
1510 -do { \  
1511 - return (type) (res); \  
1512 -} while (0)  
1513 -  
1514 -_syscall2(int, vm86, int, func, struct vm86plus_struct *, v86) 1514 +static inline int vm86(int func, struct vm86plus_struct *v86)
  1515 +{
  1516 + return syscall(__NR_vm86, func, v86);
  1517 +}
1515 1518
1516 extern char vm86_code_start; 1519 extern char vm86_code_start;
1517 extern char vm86_code_end; 1520 extern char vm86_code_end;