~jderose/ubuntu/raring/qemu/vde-again

« back to all changes in this revision

Viewing changes to darwin-user/syscall.c

Tags: upstream-0.9.0+20070816
ImportĀ upstreamĀ versionĀ 0.9.0+20070816

Show diffs side-by-side

added added

removed removed

Lines of Context:
53
53
#include <mach/ndr.h>
54
54
#include <mach/mig_errors.h>
55
55
 
 
56
#include <sys/xattr.h>
 
57
 
56
58
#include "qemu.h"
57
59
 
58
60
//#define DEBUG_SYSCALL
367
369
        case 200: /* host_info */
368
370
        {
369
371
            mig_reply_error_t *err = (mig_reply_error_t *)hdr;
370
 
            struct host_basic_info *data = (void *)(err+1);
 
372
            struct {
 
373
                uint32_t unknow1;
 
374
                uint32_t max_cpus;
 
375
                uint32_t avail_cpus;
 
376
                uint32_t memory_size;
 
377
                uint32_t cpu_type;
 
378
                uint32_t cpu_subtype;
 
379
            } *data = (void *)(err+1);
371
380
 
372
381
            DPRINTF("maxcpu = 0x%x\n",   data->max_cpus);
373
382
            DPRINTF("numcpu = 0x%x\n",   data->avail_cpus);
444
453
    case -31:
445
454
        DPRINTF("mach_msg_trap(0x%x, 0x%x, 0x%x, 0x%x, 0x%x, 0x%x, 0x%x)\n",
446
455
                arg1, arg2, arg3, arg4, arg5, arg6, arg7);
447
 
 
448
456
        ret = target_mach_msg_trap((mach_msg_header_t *)arg1, arg2, arg3, arg4, arg5, arg6, arg7);
449
 
 
450
 
        break;
 
457
        break;
 
458
/* may need more translation if target arch is different from host */
 
459
#if (defined(TARGET_I386) && defined(__i386__)) || (defined(TARGET_PPC) && defined(__ppc__))
 
460
    case -33:
 
461
        DPRINTF("semaphore_signal_trap(0x%x)\n", arg1);
 
462
        ret = semaphore_signal_trap(arg1);
 
463
        break;
 
464
    case -34:
 
465
        DPRINTF("semaphore_signal_all_trap(0x%x)\n", arg1);
 
466
        ret = semaphore_signal_all_trap(arg1);
 
467
        break;
 
468
    case -35:
 
469
        DPRINTF("semaphore_signal_thread_trap(0x%x)\n", arg1, arg2);
 
470
        ret = semaphore_signal_thread_trap(arg1,arg2);
 
471
        break;
 
472
#endif
451
473
    case -36:
452
474
        DPRINTF("semaphore_wait_trap(0x%x)\n", arg1);
453
475
        extern int semaphore_wait_trap(int); // XXX: is there any header for that?
454
476
        ret = semaphore_wait_trap(arg1);
455
477
        break;
 
478
/* may need more translation if target arch is different from host */
 
479
#if (defined(TARGET_I386) && defined(__i386__)) || (defined(TARGET_PPC) && defined(__ppc__))
 
480
    case -37:
 
481
        DPRINTF("semaphore_wait_signal_trap(0x%x, 0x%x)\n", arg1, arg2);
 
482
        ret = semaphore_wait_signal_trap(arg1,arg2);
 
483
        break;
 
484
#endif
456
485
    case -43:
457
486
        DPRINTF("map_fd(0x%x, 0x%x, 0x%x, 0x%x, 0x%x)\n",
458
487
                arg1, arg2, arg3, arg4, arg5);
459
488
        ret = map_fd(arg1, arg2, (void*)arg3, arg4, arg5);
460
489
        tswap32s((uint32_t*)arg3);
461
490
        break;
 
491
/* may need more translation if target arch is different from host */
 
492
#if (defined(TARGET_I386) && defined(__i386__)) || (defined(TARGET_PPC) && defined(__ppc__))
 
493
    case -61:
 
494
        DPRINTF("syscall_thread_switch(0x%x, 0x%x, 0x%x)\n",
 
495
                arg1, arg2, arg3);
 
496
        ret = syscall_thread_switch(arg1, arg2, arg3);  // just a hint to the scheduler; can drop?
 
497
        break;
 
498
#endif
462
499
    case -89:
463
500
        DPRINTF("mach_timebase_info(0x%x)\n", arg1);
464
501
        struct mach_timebase_info info;
1342
1379
    if(name) /* Sometimes sysctl is called with no arg1, ignore */
1343
1380
        ret = get_errno(sysctl(name, namelen, oldp, oldlenp, newp, newlen));
1344
1381
 
 
1382
#if defined(TARGET_I386) ^ defined(__i386__) || defined(TARGET_PPC) ^ defined(__ppc__)
1345
1383
    if (!is_error(ret) && bswap_syctl(name, namelen, oldp, *oldlenp) != 0) {
1346
1384
        return -ENOTDIR;
1347
1385
    }
 
1386
#endif
 
1387
 
1348
1388
    if(name) {
1349
1389
        //bswap_syctl(name, namelen, newp, newlen);
1350
1390
        tswap32s((uint32_t*)oldlenp);