? patch ? qemu-mkcow ? vmdk2raw Index: Makefile.target =================================================================== RCS file: /cvsroot/qemu/qemu/Makefile.target,v retrieving revision 1.39 diff -r1.39 Makefile.target 104a105,107 > ifdef CONFIG_DARWIN > LDFLAGS+=-W$(SRC_PATH)/ppc.ld > else 106a110 > endif Index: bswap.h =================================================================== RCS file: /cvsroot/qemu/qemu/bswap.h,v retrieving revision 1.4 diff -r1.4 bswap.h 9a10,14 > #elif defined(__APPLE__) > #include > #define bswap_16(x) NXSwapShort(x) > #define bswap_32(x) NXSwapInt(x) > #define bswap_64(x) NXSwapLongLong(x) Index: cpu-exec.c =================================================================== RCS file: /cvsroot/qemu/qemu/cpu-exec.c,v retrieving revision 1.38 diff -r1.38 cpu-exec.c 812c812 < int cpu_signal_handler(int host_signum, struct siginfo *info, --- > int cpu_signal_handler(int host_signum, struct __siginfo *info, 906c906 < int cpu_signal_handler(int host_signum, struct siginfo *info, --- > int cpu_signal_handler(int host_signum, struct __siginfo *info, Index: dyngen-exec.h =================================================================== RCS file: /cvsroot/qemu/qemu/dyngen-exec.h,v retrieving revision 1.15 diff -r1.15 dyngen-exec.h 38,40d37 < typedef signed char int8_t; < typedef signed short int16_t; < typedef signed int int32_t; 59a57,60 > #ifdef __APPLE__ > /* stdin, stdout, stderr special declaration */ > #include > #else 60a62 > #endif Index: linux-user/ioctls.h =================================================================== RCS file: /cvsroot/qemu/qemu/linux-user/ioctls.h,v retrieving revision 1.8 diff -r1.8 ioctls.h 2c2,5 < --- > #ifdef __APPLE__ > #define TCGETS 0x5401 > IOCTL_STRANGE(TCGETS, TIOCGETA, IOC_R, MK_PTR(MK_STRUCT(STRUCT_termios))) > #else 6a10 > #endif 9a14,16 > #ifdef __APPLE__ > // IOCTL_STRANGE(TCGETA, TIOCGETA, IOC_R, MK_PTR(TYPE_INT)) > #else 17a25 > #endif 28a37 > #ifndef __APPLE__ 31a41 > #endif 32a43 > #ifndef __APPLE__ 34a46 > #endif 35a48 > #ifndef __APPLE__ 36a50 > #endif 39a54 > #ifndef __APPLE__ 40a56,57 > #endif > #ifndef __APPLE__ 41a59,60 > #endif > #ifndef __APPLE__ 53c72,73 < --- > #endif > #ifndef __APPLE__ 59c79,80 < --- > #endif > #ifndef __APPLE__ 69a91 > #endif /* __APPLE__ */ 76a99 > #ifndef __APPLE__ 117c140,141 < --- > #endif > #ifndef __APPLE__ 152c176 < --- > #endif /* __APPLE__ */ 164a189 > #ifndef __APPLE__ 187a213 > #endif /* __APPLE__ */ 228a255 > #ifndef __APPLE__ 283c310,311 < --- > #endif > #ifndef __APPLE__ 302a331 > #endif /* __APPLE__ */ \ No newline at end of file Index: linux-user/mmap.c =================================================================== RCS file: /cvsroot/qemu/qemu/linux-user/mmap.c,v retrieving revision 1.7 diff -r1.7 mmap.c 30c30,34 < //#define DEBUG_MMAP --- > #define DEBUG_MMAP > > #if defined(__APPLE__) && defined(DEBUG_MMAP) > #define MAP_TYPE 0x0f > #endif // __APPLE__ && DEBUG_MMAP 126a131 > #ifndef __APPLE__ 127a133,135 > #else > if ((flags & MAP_SHARED) && > #endif 243a252 > #ifndef __APPLE__ 244a254,256 > #else > if ((flags & MAP_SHARED) && > #endif 370a383 > #ifndef __APPLE__ 372a386,389 > #else > munmap((void *)old_addr, old_size); > new_addr = mmap((void *)old_addr, new_size, prot, flags, NULL, 0); > #endif Index: linux-user/signal.c =================================================================== RCS file: /cvsroot/qemu/qemu/linux-user/signal.c,v retrieving revision 1.23 diff -r1.23 signal.c 38c38 < //#define DEBUG_SIGNAL --- > #define DEBUG_SIGNAL 95a96 > #ifdef SIGPWR 96a98 > #endif 206a209 > #ifndef __APPLE__ 223a227,229 > #else > printf("host_to_target_siginfo_noswap not supprted\n"); > #endif 256a263 > #ifndef __APPLE__ 263a271,273 > #else > printf("target_to_host_siginfo not supported\n"); > #endif Index: linux-user/syscall.c =================================================================== RCS file: /cvsroot/qemu/qemu/linux-user/syscall.c,v retrieving revision 1.50 diff -r1.50 syscall.c 20d19 < #include 21a21 > #include 24a25 > #ifndef __APPLE__ 25a27 > #endif 36a39 > #ifndef __APPLE__ 37a41 > #endif 40d43 < #include 46c49 < #include --- > //#include 47a51,67 > #include > #include > #include > #include > #include > #include > #include > //#include > #include > #include > > #ifdef __APPLE__ > #include > #endif // __APPLE__ > > #include > #include 57c77,81 < --- > #ifdef __APPLE__ > #include > #include > #endif > #ifndef __APPLE__ 65a90,92 > #else > #include > #endif 69c96,107 < //#define DEBUG --- > // #define DEBUG > > #ifdef __APPLE__ > #define sys_uname uname > #define sys_statfs statfs > #define sys_fstatfs fstatfs > #define sys_getcwd1 getcwd > #define sys_rt_sigqueueinfo rt_sigqueueinfo > #endif > #ifndef CMSG_ALIGN > #define CMSG_ALIGN(n) (((n) + 3) & ~3) > #endif 140a179,182 > #ifdef __APPLE__ > #define __sc_loadargs_0(name, dummy...) \ > __sc_0 = SYS_##name > #elif __linux__ 142a185 > #endif 202a246 > #ifdef __linux__ 221a266,268 > #endif /* __linux__ */ > > #ifdef __linux__ 233a281,284 > #elif defined(__APPLE__) > //_syscall2(int,statfs,const char *,path,struct kernel_statfs *,buf) > //_syscall2(int,fstatfs,int,fd,struct kernel_statfs *,buf) > #endif /* __linux__ */ 242a294 > #ifndef __APPLE__ 243a296 > #endif 272c325,330 < --- > > // PGB > #ifdef DEBUG > gemu_log(" new_brk 0x%x, target_original_brk 0x%x\n", new_brk, target_original_brk); > #endif // DEBUG > 287a346 > #if !defined(__APPLE__) 290a350,354 > #else > mapped_addr = get_errno(target_mmap((unsigned long)brk_page, new_alloc_size, > PROT_READ|PROT_WRITE, > MAP_ANON|MAP_FIXED|MAP_PRIVATE, -1, 0)); > #endif // __APPLE__ 535a600 > #ifndef __APPLE__ 601a667,670 > #else > gemu_log("do_setsockopt not yet supported\n"); > return -ENOSYS; > #endif 614a684 > #ifdef SO_PEERCRED 615a686,687 > #endif > #ifdef SO_PEERNAME 616a689 > #endif 949a1023 > #ifdef SHM_LOCK 950a1025,1026 > #endif > #ifdef SHM_LOCK 951a1028,1029 > #endif > 1000a1079,1080 > #define IOCTL_STRANGE(target_cmd, host_cmd, access, types...) \ > { TARGET_ ## target_cmd, host_cmd, #host_cmd, access, { types } }, 1024c1104 < gemu_log("ioctl: cmd=0x%04lx (%s)\n", cmd, ie->name); --- > gemu_log("ioctl: cmd=0x%04lx (%s) arg_type[0]:0x%x\n", cmd, ie->name, arg_type[0]); 1067a1148 > #ifdef IGNBRK 1068a1150,1151 > #endif > #ifdef BRKINT 1069a1153,1154 > #endif > #ifdef IGNPAR 1070a1156,1157 > #endif > #ifdef PARMRK 1071a1159,1160 > #endif > #ifdef INPCK 1072a1162,1163 > #endif > #ifdef ISTRIP 1073a1165,1166 > #endif > #ifdef INLCR 1074a1168,1169 > #endif > #ifdef IGNCR 1075a1171,1172 > #endif > #ifdef ICRNL 1076a1174,1175 > #endif > #ifdef IUCLC 1077a1177,1178 > #endif > #ifdef IXON 1078a1180,1181 > #endif > #ifdef IXANY 1079a1183,1184 > #endif > #ifdef IXOFF 1080a1186,1187 > #endif > #ifdef IMAXBEL 1081a1189 > #endif 1085a1194 > #ifdef OPOST 1086a1196,1197 > #endif > #ifdef OLCUC 1087a1199,1200 > #endif > #ifdef OLCUC 1088a1202,1203 > #endif > #ifdef OCRNL 1089a1205,1206 > #endif > #ifdef ONOCR 1090a1208,1209 > #endif > #ifdef ONLRET 1091a1211,1212 > #endif > #ifdef OFILL 1092a1214,1215 > #endif > #ifdef OFDEL 1093a1217,1218 > #endif > #ifdef NL0 1094a1220,1221 > #endif > #ifdef NL1 1095a1223,1224 > #endif > #ifdef CR0 1096a1226,1227 > #endif > #ifdef CR1 1097a1229,1230 > #endif > #ifdef CR2 1098a1232,1233 > #endif > #ifdef CR3 1099a1235,1236 > #endif > #ifdef TAB0 1100a1238,1239 > #endif > #ifdef TAB1 1101a1241,1242 > #endif > #ifdef TAB2 1102a1244,1245 > #endif > #ifdef TAB3 1103a1247,1248 > #endif > #ifdef BS0 1104a1250,1251 > #endif > #ifdef BS1 1105a1253,1254 > #endif > #ifdef VT0 1106a1256,1257 > #endif > #ifdef VT1 1107a1259,1260 > #endif > #ifdef FF0 1108a1262,1263 > #endif > #ifdef FF1 1109a1265 > #endif 1113a1270 > #ifdef CBAUD 1133a1291 > #endif 1150a1309 > #ifdef XCASE 1151a1311 > #endif 1179a1340 > #ifndef __APPLE__ 1180a1342 > #endif 1188,1189c1350,1353 < host->c_cc[VMIN] = target->c_cc[TARGET_VMIN]; < host->c_cc[VSWTC] = target->c_cc[TARGET_VSWTC]; --- > host->c_cc[VMIN] = target->c_cc[TARGET_VMIN]; > #ifdef VSWTC > host->c_cc[VSWTC] = target->c_cc[TARGET_VSWTC]; > #endif 1213a1378 > #ifndef __APPLE__ 1215c1380,1381 < --- > #endif > 1222a1389 > #ifdef VSWTC 1223a1391 > #endif 1245a1414 > #ifdef MAP_GROWSDOWN 1246a1416,1417 > #endif > #ifdef MAP_DENYWRITE 1247a1419,1420 > #endif > #ifdef MAP_EXECUTABLE 1248a1422,1423 > #endif > #ifdef MAP_LOCKED 1249a1425 > #endif 1261a1438 > #ifdef O_SYNC 1262a1440 > #endif 1263a1442 > #ifdef O_DIRECTORY 1264a1444 > #endif 1405a1586 > #ifndef __APPLE__ 1458a1640,1643 > #else > printf("do_fork not supported\n"); > return -EINVAL; > #endif 1707a1893 > #ifndef __APPLE__ 1710a1897,1898 > #endif > #ifndef __APPLE__ 1718a1907 > #endif 1815a2005 > #ifndef __APPLE__ 1818a2009 > #endif 1898a2090 > #ifndef __APPLE__ 1910a2103 > #endif 2009a2203 > #ifndef __APPLE__ 2032a2227,2228 > #endif > #ifndef __APPLE__ 2039a2236 > #endif 2127a2325 > #ifndef __APPLE__ 2130a2329 > #endif 2280a2480 > 2283a2484 > 2293c2494,2498 < #if defined(TARGET_PPC) --- > #if defined(__APPLE__) > target_st->st_mode = tswap16(st.st_mode); /* XXX: check this */ > target_st->st_uid = tswap32(st.st_uid); > target_st->st_gid = tswap32(st.st_gid); > #elif defined(TARGET_PPC) 2320a2526 > #ifndef __APPLE__ 2323a2530 > #endif 2347a2555 > #ifndef __APPLE__ 2350a2559,2560 > #endif > #ifndef __APPLE__ 2374a2585 > #endif 2425a2637 > //#ifndef __APPLE__ 2427c2639 < ret = get_errno(personality(arg1)); --- > ret = 0;//get_errno(personality(arg1)); 2428a2641 > //#endif 2430a2644 > //#ifndef __APPLE__ 2433c2647,2651 < #if defined (__x86_64__) --- > #if defined (__APPLE__) > ret = get_errno(lseek(arg1, ((uint64_t)arg2 << 32) | arg3, \ > arg5)); > *(int64_t *)arg4 = tswap64(ret); > #elif defined (__x86_64__) 2435c2653 < *(int64_t *)arg4 = ret; --- > *(int64_t *)arg4 = tswap64(ret); 2442a2661 > //#endif 2444c2663,2703 < #if TARGET_LONG_SIZE != 4 --- > #if defined (__APPLE__) > { > struct target_dirent *target_de = (void *)arg2; > unsigned short target_reclen; > struct dirent *de; > struct dirent *buffer; > long count = arg3; > int ret2 = 0; > long basep = 0; > > buffer = (struct dirent *) malloc(count); > if (!buffer) > return -ENOMEM; > > ret = get_errno(getdirentries(arg1, buffer, count, &basep)); > > if (!is_error(ret)) { > de = (struct dirent *) buffer; > while (ret > 0 && de->d_reclen > 0) { > target_de->d_ino = tswapl(de->d_fileno); > target_de->d_off = 0; > target_reclen = sizeof(target_de->d_ino) + \ > sizeof(target_de->d_off) + \ > sizeof(target_de->d_reclen) + \ > strlen(de->d_name) +1; > target_de->d_reclen = tswap16(target_reclen); > strcpy(target_de->d_name, de->d_name); > > ret -= de->d_reclen; > ret2 += target_reclen; > > ((char *) de) += de->d_reclen; > ((char *) target_de) += target_reclen; > } > > ret = ret2; > } > > free(buffer); > } > #elif TARGET_LONG_SIZE != 4 2510a2770 > #ifndef __APPLE__ 2535a2796 > #endif 2598a2860 > #ifndef __APPLE__ 2601a2864 > #endif 2603a2867 > #ifndef __APPLE__ 2611a2876,2877 > #endif > #ifndef __APPLE__ 2621a2888,2889 > #endif > #ifndef __APPLE__ 2629a2898,2899 > #endif > #ifndef __APPLE__ 2632a2903 > #endif 2641a2913 > #ifndef __APPLE__ 2652a2925 > #endif 2700a2974 > #ifndef __APPLE__ 2703a2978 > #endif 2755a3031 > #ifndef __APPLE__ 2758a3035 > #endif 2807a3085 > #ifndef __APPLE__ 2814a3093,3094 > #endif > #ifndef __APPLE__ 2827a3108,3109 > #endif > #ifndef __APPLE__ 2834a3117,3118 > #endif > #ifndef __APPLE__ 2847a3132 > #endif 2856a3142 > #ifndef __APPLE__ 2859a3146,3147 > #endif > #ifndef __APPLE__ 2862a3151 > #endif 2864c3153 < --- > #ifndef __APPLE__ 2867a3157 > #endif 2892a3183 > #ifndef __APPLE__ 2895a3187,3188 > #endif > #ifndef __APPLE__ 2906a3200,3201 > #endif > #ifndef __APPLE__ 2909a3205,3206 > #endif > #ifndef __APPLE__ 2920a3218 > #endif 2929a3228 > #ifndef __APPLE__ 2932a3232,3233 > #endif > #ifndef __APPLE__ 2935a3237 > #endif 2947a3250 > #ifndef __APPLE__ 2979a3283 > #endif /* APPLE */ 2989a3294 > #ifndef __APPLE__ 2992a3298 > #endif Index: target-i386/cpu.h =================================================================== RCS file: /cvsroot/qemu/qemu/target-i386/cpu.h,v retrieving revision 1.18 diff -r1.18 cpu.h 444,445c444,445 < struct siginfo; < int cpu_x86_signal_handler(int host_signum, struct siginfo *info, --- > struct __siginfo; > int cpu_x86_signal_handler(int host_signum, struct __siginfo *info, 446a447 > Index: target-ppc/helper.c =================================================================== RCS file: /cvsroot/qemu/qemu/target-ppc/helper.c,v retrieving revision 1.15 diff -r1.15 helper.c 29a30 > Index: target-ppc/op_helper.c =================================================================== RCS file: /cvsroot/qemu/qemu/target-ppc/op_helper.c,v retrieving revision 1.8 diff -r1.8 op_helper.c 466a467 >