summaryrefslogtreecommitdiff
path: root/darwin-user/syscall.c
diff options
context:
space:
mode:
authorths <ths@c046a42c-6fe2-441c-8c8c-71466251a162>2007-02-22 20:43:09 +0000
committerths <ths@c046a42c-6fe2-441c-8c8c-71466251a162>2007-02-22 20:43:09 +0000
commit7ed40acfae7dc85da367b5b7fba4d56d53426530 (patch)
tree3f5441bead4e1aeac0d1882ac1ec71320dd8e395 /darwin-user/syscall.c
parent96217e315d4ac38daf4a7b8cafa4a9cd13ad4126 (diff)
downloadqemu-7ed40acfae7dc85da367b5b7fba4d56d53426530.tar.gz
qemu-7ed40acfae7dc85da367b5b7fba4d56d53426530.tar.bz2
qemu-7ed40acfae7dc85da367b5b7fba4d56d53426530.zip
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
Diffstat (limited to 'darwin-user/syscall.c')
-rw-r--r--darwin-user/syscall.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/darwin-user/syscall.c b/darwin-user/syscall.c
index f2543aa44d..f69a5aacd9 100644
--- a/darwin-user/syscall.c
+++ b/darwin-user/syscall.c
@@ -367,7 +367,14 @@ static inline uint32_t target_mach_msg_trap(
case 200: /* host_info */
{
mig_reply_error_t *err = (mig_reply_error_t *)hdr;
- struct host_basic_info *data = (void *)(err+1);
+ struct {
+ uint32_t unknow1;
+ uint32_t max_cpus;
+ uint32_t avail_cpus;
+ uint32_t memory_size;
+ uint32_t cpu_type;
+ uint32_t cpu_subtype;
+ } *data = (void *)(err+1);
DPRINTF("maxcpu = 0x%x\n", data->max_cpus);
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
if(name) /* Sometimes sysctl is called with no arg1, ignore */
ret = get_errno(sysctl(name, namelen, oldp, oldlenp, newp, newlen));
+#if defined(TARGET_I386) ^ defined(__i386__) || defined(TARGET_PPC) ^ defined(__ppc__)
if (!is_error(ret) && bswap_syctl(name, namelen, oldp, *oldlenp) != 0) {
return -ENOTDIR;
}
+#endif
+
if(name) {
//bswap_syctl(name, namelen, newp, newlen);
tswap32s((uint32_t*)oldlenp);