Commit 7ed40acfae7dc85da367b5b7fba4d56d53426530

Authored by ths
1 parent 96217e31

Revert host_info changes, and don't fail if sysctl is unknown when we

are on the same host/target, by Pierre d'Herbemont.


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2450 c046a42c-6fe2-441c-8c8c-71466251a162
Showing 1 changed file with 11 additions and 1 deletions
darwin-user/syscall.c
... ... @@ -367,7 +367,14 @@ static inline uint32_t target_mach_msg_trap(
367 367 case 200: /* host_info */
368 368 {
369 369 mig_reply_error_t *err = (mig_reply_error_t *)hdr;
370   - struct host_basic_info *data = (void *)(err+1);
  370 + struct {
  371 + uint32_t unknow1;
  372 + uint32_t max_cpus;
  373 + uint32_t avail_cpus;
  374 + uint32_t memory_size;
  375 + uint32_t cpu_type;
  376 + uint32_t cpu_subtype;
  377 + } *data = (void *)(err+1);
371 378  
372 379 DPRINTF("maxcpu = 0x%x\n", data->max_cpus);
373 380 DPRINTF("numcpu = 0x%x\n", data->avail_cpus);
... ... @@ -1342,9 +1349,12 @@ long do___sysctl(int * name, uint32_t namelen, void * oldp, size_t * oldlenp, vo
1342 1349 if(name) /* Sometimes sysctl is called with no arg1, ignore */
1343 1350 ret = get_errno(sysctl(name, namelen, oldp, oldlenp, newp, newlen));
1344 1351  
  1352 +#if defined(TARGET_I386) ^ defined(__i386__) || defined(TARGET_PPC) ^ defined(__ppc__)
1345 1353 if (!is_error(ret) && bswap_syctl(name, namelen, oldp, *oldlenp) != 0) {
1346 1354 return -ENOTDIR;
1347 1355 }
  1356 +#endif
  1357 +
1348 1358 if(name) {
1349 1359 //bswap_syctl(name, namelen, newp, newlen);
1350 1360 tswap32s((uint32_t*)oldlenp);
... ...