亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? commpage.c

?? QEMU 0.91 source code, supports ARM processor including S3C24xx series
?? C
字號:
 /* *  Commpage syscalls * *  Copyright (c) 2006 Pierre d'Herbemont * *  This program is free software; you can redistribute it and/or modify *  it under the terms of the GNU General Public License as published by *  the Free Software Foundation; either version 2 of the License, or *  (at your option) any later version. * *  This program is distributed in the hope that it will be useful, *  but WITHOUT ANY WARRANTY; without even the implied warranty of *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the *  GNU General Public License for more details. * *  You should have received a copy of the GNU General Public License *  along with this program; if not, write to the Free Software *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */#include <fcntl.h>#include <stdio.h>#include <stdlib.h>#include <errno.h>#include <mach/message.h>#include <mach/mach.h>#include <mach/mach_time.h>#include <sys/time.h>#include <sys/mman.h>#include <libkern/OSAtomic.h>#include "qemu.h"//#define DEBUG_COMMPAGE#ifdef DEBUG_COMMPAGE# define DPRINTF(...) do { if(loglevel) fprintf(logfile, __VA_ARGS__); printf(__VA_ARGS__); } while(0)#else# define DPRINTF(...) do { if(loglevel) fprintf(logfile, __VA_ARGS__); } while(0)#endif/******************************************************************** *   Commpage definitions */#ifdef TARGET_I386/* Reserve space for the commpage see xnu/osfmk/i386/cpu_capabilities.h */# define COMMPAGE_START (-16 * 4096) /* base address is -20 * 4096 */# define COMMPAGE_SIZE  (0x1240) /* _COMM_PAGE_AREA_LENGTH is 19 * 4096 */#elif defined(TARGET_PPC)/* Reserve space for the commpage see xnu/osfmk/ppc/cpu_capabilities.h */# define COMMPAGE_START (-8*4096)# define COMMPAGE_SIZE  (2*4096) /* its _COMM_PAGE_AREA_USED but _COMM_PAGE_AREA_LENGTH is 7*4096 */#endifvoid do_compare_and_swap32(void *cpu_env, int num);void do_compare_and_swap64(void *cpu_env, int num);void do_add_atomic_word32(void *cpu_env, int num);void do_cgettimeofday(void *cpu_env, int num, uint32_t arg1);void do_nanotime(void *cpu_env, int num);void unimpl_commpage(void *cpu_env, int num);typedef void (*commpage_8args_function_t)(uint32_t arg1, uint32_t arg2, uint32_t arg3,                uint32_t arg4, uint32_t arg5, uint32_t arg6, uint32_t arg7,                uint32_t arg8);typedef void (*commpage_indirect_function_t)(void *cpu_env, int num, uint32_t arg1,                uint32_t arg2, uint32_t arg3,  uint32_t arg4, uint32_t arg5,                uint32_t arg6, uint32_t arg7, uint32_t arg8);#define HAS_PTR  0x10#define NO_PTR   0x20#define CALL_DIRECT   0x1#define CALL_INDIRECT 0x2#define COMMPAGE_ENTRY(name, nargs, offset, func, options) \    { #name, offset, nargs, options, (commpage_8args_function_t)func }struct commpage_entry {    char * name;    int offset;    int nargs;    char options;    commpage_8args_function_t function;};static inline int commpage_code_num(struct commpage_entry *entry){    if((entry->options & HAS_PTR))        return entry->offset + 4;    else        return entry->offset;}static inline int commpage_is_indirect(struct commpage_entry *entry){    return !(entry->options & CALL_DIRECT);}/******************************************************************** *   Commpage entry */static struct commpage_entry commpage_entries[] ={    COMMPAGE_ENTRY(compare_and_swap32,    0, 0x080,  do_compare_and_swap32, CALL_INDIRECT | HAS_PTR),    COMMPAGE_ENTRY(compare_and_swap64,    0, 0x0c0,  do_compare_and_swap64, CALL_INDIRECT | HAS_PTR),    COMMPAGE_ENTRY(enqueue,               0, 0x100,  unimpl_commpage,       CALL_INDIRECT),    COMMPAGE_ENTRY(dequeue,               0, 0x140,  unimpl_commpage,       CALL_INDIRECT),    COMMPAGE_ENTRY(memory_barrier,        0, 0x180,  unimpl_commpage,       CALL_INDIRECT),    COMMPAGE_ENTRY(add_atomic_word32,     0, 0x1a0,  do_add_atomic_word32,  CALL_INDIRECT | HAS_PTR),    COMMPAGE_ENTRY(add_atomic_word64,     0, 0x1c0,  unimpl_commpage,       CALL_INDIRECT | HAS_PTR),    COMMPAGE_ENTRY(mach_absolute_time,    0, 0x200,  unimpl_commpage,       CALL_INDIRECT),    COMMPAGE_ENTRY(spinlock_try,          1, 0x220,  unimpl_commpage,       CALL_INDIRECT),    COMMPAGE_ENTRY(spinlock_lock,         1, 0x260,  OSSpinLockLock,        CALL_DIRECT),    COMMPAGE_ENTRY(spinlock_unlock,       1, 0x2a0,  OSSpinLockUnlock,      CALL_DIRECT),    COMMPAGE_ENTRY(pthread_getspecific,   0, 0x2c0,  unimpl_commpage,       CALL_INDIRECT),    COMMPAGE_ENTRY(gettimeofday,          1, 0x2e0,  do_cgettimeofday,      CALL_INDIRECT),    COMMPAGE_ENTRY(sys_dcache_flush,      0, 0x4e0,  unimpl_commpage,       CALL_INDIRECT),    COMMPAGE_ENTRY(sys_icache_invalidate, 0, 0x520,  unimpl_commpage,       CALL_INDIRECT),    COMMPAGE_ENTRY(pthread_self,          0, 0x580,  unimpl_commpage,       CALL_INDIRECT),    COMMPAGE_ENTRY(relinquish,            0, 0x5c0,  unimpl_commpage,       CALL_INDIRECT),#ifdef TARGET_I386    COMMPAGE_ENTRY(bts,                   0, 0x5e0,  unimpl_commpage,       CALL_INDIRECT),    COMMPAGE_ENTRY(btc,                   0, 0x5f0,  unimpl_commpage,       CALL_INDIRECT),#endif    COMMPAGE_ENTRY(bzero,                 2, 0x600,  bzero,                 CALL_DIRECT),    COMMPAGE_ENTRY(bcopy,                 3, 0x780,  bcopy,                 CALL_DIRECT),    COMMPAGE_ENTRY(memcpy,                3, 0x7a0,  memcpy,                CALL_DIRECT),#ifdef TARGET_I386    COMMPAGE_ENTRY(old_nanotime,          0, 0xf80,  do_nanotime,           CALL_INDIRECT),    COMMPAGE_ENTRY(memset_pattern,        0, 0xf80,  unimpl_commpage,       CALL_INDIRECT),    COMMPAGE_ENTRY(long_copy,             0, 0x1200, unimpl_commpage,       CALL_INDIRECT),    COMMPAGE_ENTRY(sysintegrity,          0, 0x1600, unimpl_commpage,       CALL_INDIRECT),    COMMPAGE_ENTRY(nanotime,              0, 0x1700, do_nanotime,           CALL_INDIRECT),#elif TARGET_PPC    COMMPAGE_ENTRY(compare_and_swap32b,   0, 0xf80,  unimpl_commpage,       CALL_INDIRECT),    COMMPAGE_ENTRY(compare_and_swap64b,   0, 0xfc0,  unimpl_commpage,       CALL_INDIRECT),    COMMPAGE_ENTRY(memset_pattern,        0, 0x1000, unimpl_commpage,       CALL_INDIRECT),    COMMPAGE_ENTRY(bigcopy,               0, 0x1140, unimpl_commpage,       CALL_INDIRECT),#endif};/******************************************************************** *   Commpage backdoor */static inline void print_commpage_entry(struct commpage_entry entry){    printf("@0x%x %s\n", entry.offset, entry.name);}static inline void install_commpage_backdoor_for_entry(struct commpage_entry entry){#ifdef TARGET_I386    char * commpage = (char*)(COMMPAGE_START+entry.offset);    int c = 0;    if(entry.options & HAS_PTR)    {        commpage[c++] = (COMMPAGE_START+entry.offset+4) & 0xff;        commpage[c++] = ((COMMPAGE_START+entry.offset+4) >> 8) & 0xff;        commpage[c++] = ((COMMPAGE_START+entry.offset+4) >> 16) & 0xff;        commpage[c++] = ((COMMPAGE_START+entry.offset+4) >> 24) & 0xff;    }    commpage[c++] = 0xcd;    commpage[c++] = 0x79; /* int 0x79 */    commpage[c++] = 0xc3; /* ret */#else    qerror("can't install the commpage on this arch\n");#endif}/******************************************************************** *   Commpage initialization */void commpage_init(void){#if (defined(__i386__) ^ defined(TARGET_I386)) || (defined(__powerpc__) ^ defined(TARGET_PPC))    int i;    void * commpage = (void *)target_mmap( COMMPAGE_START, COMMPAGE_SIZE,                           PROT_WRITE | PROT_READ, MAP_ANONYMOUS | MAP_FIXED, -1, 0);    if((int)commpage != COMMPAGE_START)        qerror("can't allocate the commpage\n");    bzero(commpage, COMMPAGE_SIZE);    /* XXX: commpage data not handled */    for(i = 0; i < sizeof(commpage_entries)/sizeof(commpage_entries[0]); i++)        install_commpage_backdoor_for_entry(commpage_entries[i]);#else    /* simply map our pages so they can be executed       XXX: we don't really want to do that since in the ppc on ppc situation we may       not able to run commpages host optimized instructions (like G5's on a G5),       hence this is sometimes a broken fix. */    page_set_flags(COMMPAGE_START, COMMPAGE_START+COMMPAGE_SIZE, PROT_EXEC | PROT_READ | PAGE_VALID);#endif}/******************************************************************** *   Commpage implementation */void do_compare_and_swap32(void *cpu_env, int num){#ifdef TARGET_I386    uint32_t old = ((CPUX86State*)cpu_env)->regs[R_EAX];    uint32_t *value = (uint32_t*)((CPUX86State*)cpu_env)->regs[R_ECX];    DPRINTF("commpage: compare_and_swap32(%x,new,%p)\n", old, value);    if(value && old == tswap32(*value))    {        uint32_t new = ((CPUX86State*)cpu_env)->regs[R_EDX];        *value = tswap32(new);        /* set zf flag */        ((CPUX86State*)cpu_env)->eflags |= 0x40;    }    else    {        ((CPUX86State*)cpu_env)->regs[R_EAX] = tswap32(*value);        /* unset zf flag */        ((CPUX86State*)cpu_env)->eflags &= ~0x40;    }#else    qerror("do_compare_and_swap32 unimplemented");#endif}void do_compare_and_swap64(void *cpu_env, int num){#ifdef TARGET_I386    /* OSAtomicCompareAndSwap64 is not available on non 64 bits ppc, here is a raw implementation */    uint64_t old, new, swapped_val;    uint64_t *value = (uint64_t*)((CPUX86State*)cpu_env)->regs[R_ESI];    old = (uint64_t)((uint64_t)((CPUX86State*)cpu_env)->regs[R_EDX]) << 32 | (uint64_t)((CPUX86State*)cpu_env)->regs[R_EAX];    DPRINTF("commpage: compare_and_swap64(%llx,new,%p)\n", old, value);    swapped_val = tswap64(*value);    if(old == swapped_val)    {        new = (uint64_t)((uint64_t)((CPUX86State*)cpu_env)->regs[R_ECX]) << 32 | (uint64_t)((CPUX86State*)cpu_env)->regs[R_EBX];        *value = tswap64(new);        /* set zf flag */        ((CPUX86State*)cpu_env)->eflags |= 0x40;    }    else    {        ((CPUX86State*)cpu_env)->regs[R_EAX] = (uint32_t)(swapped_val);        ((CPUX86State*)cpu_env)->regs[R_EDX] = (uint32_t)(swapped_val >> 32);        /* unset zf flag */        ((CPUX86State*)cpu_env)->eflags &= ~0x40;    }#else    qerror("do_compare_and_swap64 unimplemented");#endif}void do_add_atomic_word32(void *cpu_env, int num){#ifdef TARGET_I386    uint32_t amt = ((CPUX86State*)cpu_env)->regs[R_EAX];    uint32_t *value = (uint32_t*)((CPUX86State*)cpu_env)->regs[R_EDX];    uint32_t swapped_value = tswap32(*value);    DPRINTF("commpage: add_atomic_word32(%x,%p)\n", amt, value);    /* old value in EAX */    ((CPUX86State*)cpu_env)->regs[R_EAX] = swapped_value;    *value = tswap32(swapped_value + amt);#else    qerror("do_add_atomic_word32 unimplemented");#endif}void do_cgettimeofday(void *cpu_env, int num, uint32_t arg1){#ifdef TARGET_I386    extern int __commpage_gettimeofday(struct timeval *);    DPRINTF("commpage: gettimeofday(0x%x)\n", arg1);    struct timeval *time = (struct timeval *)arg1;    int ret = __commpage_gettimeofday(time);    tswap32s((uint32_t*)&time->tv_sec);    tswap32s((uint32_t*)&time->tv_usec);    ((CPUX86State*)cpu_env)->regs[R_EAX] = ret; /* Success */#else    qerror("do_gettimeofday unimplemented");#endif}void do_nanotime(void *cpu_env, int num){#ifdef TARGET_I386    uint64_t t = mach_absolute_time();    ((CPUX86State*)cpu_env)->regs[R_EAX] = (int)(t & 0xffffffff);    ((CPUX86State*)cpu_env)->regs[R_EDX] = (int)((t >> 32) & 0xffffffff);#else    qerror("do_nanotime unimplemented");#endif}void unimpl_commpage(void *cpu_env, int num){    qerror("qemu: commpage function 0x%x not implemented\n", num);}/******************************************************************** *   do_commpage - called by the main cpu loop */voiddo_commpage(void *cpu_env, int num, uint32_t arg1, uint32_t arg2, uint32_t arg3,                uint32_t arg4, uint32_t arg5, uint32_t arg6, uint32_t arg7,                uint32_t arg8){    int i, found = 0;    arg1 = tswap32(arg1);    arg2 = tswap32(arg2);    arg3 = tswap32(arg3);    arg4 = tswap32(arg4);    arg5 = tswap32(arg5);    arg6 = tswap32(arg6);    arg7 = tswap32(arg7);    arg8 = tswap32(arg8);    num = num-COMMPAGE_START-2;    for(i = 0; i < sizeof(commpage_entries)/sizeof(commpage_entries[0]); i++) {        if( num == commpage_code_num(&commpage_entries[i]) )        {            DPRINTF("commpage: %s %s\n", commpage_entries[i].name, commpage_is_indirect(&commpage_entries[i]) ? "[indirect]" : "[direct]");            found = 1;            if(commpage_is_indirect(&commpage_entries[i]))            {                commpage_indirect_function_t function = (commpage_indirect_function_t)commpage_entries[i].function;                function(cpu_env, num, arg1, arg2, arg3,                    arg4, arg5, arg6, arg7, arg8);            }            else            {                commpage_entries[i].function(arg1, arg2, arg3,                    arg4, arg5, arg6, arg7, arg8);            }            break;        }    }    if(!found)    {        gemu_log("qemu: commpage function 0x%x not defined\n", num);        gdb_handlesig (cpu_env, SIGTRAP);        exit(-1);    }}

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩中文字幕av电影| 亚洲精品国产高清久久伦理二区| www.一区二区| 男人操女人的视频在线观看欧美| 久久亚洲欧美国产精品乐播| 日韩欧美一级在线播放| 国产裸体歌舞团一区二区| 亚洲国产视频一区| 久久伊99综合婷婷久久伊| 欧美日韩国产小视频| 99精品欧美一区二区三区综合在线| 视频一区欧美精品| 亚洲综合成人在线视频| 国产精品免费观看视频| 久久久久久久久蜜桃| 欧美mv日韩mv亚洲| 欧美成人vps| 日韩欧美一区二区三区在线| 欧美一区二区精品久久911| 欧美日韩亚洲综合一区| 欧美人与z0zoxxxx视频| 欧美性高清videossexo| 欧美三级中文字幕在线观看| 91麻豆视频网站| 色噜噜狠狠成人中文综合| 在线视频一区二区免费| 欧美三级日韩在线| 91精品国产一区二区三区蜜臀| 欧美色综合影院| 日韩一区二区免费在线电影| 日韩午夜电影av| 国产欧美日韩不卡免费| 日韩理论在线观看| 91在线精品秘密一区二区| 91在线云播放| 日韩一区二区三区三四区视频在线观看| 欧美日韩电影在线| 久久只精品国产| 一区二区三区国产| 日本欧美一区二区在线观看| 国产成人精品亚洲777人妖 | 欧美高清视频在线高清观看mv色露露十八| 色综合久久久久综合体| 欧美高清激情brazzers| 国产亚洲精品资源在线26u| 亚洲精品综合在线| 国产自产视频一区二区三区| 91蝌蚪porny| 国产午夜精品久久久久久免费视| 亚洲男同性视频| 国产精品99久久不卡二区| 91成人免费在线视频| 欧美国产成人在线| 免费看欧美女人艹b| 色天使久久综合网天天| 久久亚洲欧美国产精品乐播 | 欧美一区二区三区在线电影| 成人欧美一区二区三区白人| 激情另类小说区图片区视频区| 色婷婷av一区二区三区大白胸| 日韩一区二区三区四区| 亚洲成人午夜电影| 91九色最新地址| 国产精品成人网| 制服视频三区第一页精品| 国产午夜精品在线观看| 亚洲18色成人| 欧美日韩视频在线一区二区| 国产精品久久久久久久裸模| 福利电影一区二区| 国产午夜精品一区二区三区四区| 日韩在线一区二区三区| 欧美精品aⅴ在线视频| 午夜精品福利一区二区蜜股av| 欧美性猛片xxxx免费看久爱| 樱花草国产18久久久久| 欧美久久久久久久久久| 日韩精品国产精品| 欧美一区二区视频免费观看| 久久精品国产成人一区二区三区 | 视频在线观看91| 日韩精品一区二区三区在线| 国产精品99久久久久久久女警 | 色狠狠综合天天综合综合| 国产精品亲子伦对白| 91视频一区二区三区| 偷拍亚洲欧洲综合| 精品国精品自拍自在线| av不卡一区二区三区| 五月天中文字幕一区二区| 精品区一区二区| 色乱码一区二区三区88| 蜜臀a∨国产成人精品| 中文字幕在线免费不卡| 欧美精品一卡两卡| 国产成人在线色| 国产成+人+日韩+欧美+亚洲| 综合久久久久综合| 久久众筹精品私拍模特| 欧洲国内综合视频| 成人爽a毛片一区二区免费| 五月天国产精品| 亚洲欧美日韩中文播放 | 国产精品电影院| 日韩欧美久久久| 欧美男人的天堂一二区| 99r精品视频| 国产精品一级片| 久久精品国产亚洲aⅴ | 国产美女在线精品| 天天综合天天做天天综合| 亚洲精品一区二区三区影院| 色94色欧美sute亚洲13| 99久久99久久综合| 成人黄色a**站在线观看| 国产精品91一区二区| 国模少妇一区二区三区| 久久精品国产**网站演员| 亚洲.国产.中文慕字在线| 亚洲免费观看在线观看| 亚洲男同1069视频| 亚洲国产aⅴ天堂久久| 性久久久久久久久| 午夜精品久久久久久久久久久 | 国产精品羞羞答答xxdd| 国产99久久久国产精品免费看| 精品一区二区三区的国产在线播放| 天天色综合成人网| 亚洲地区一二三色| 国产精品丝袜一区| 欧美激情一区在线观看| 三级久久三级久久| 日本视频一区二区| 国产伦精品一区二区三区视频青涩| 麻豆91精品视频| 国产高清亚洲一区| 99久久免费精品| 91福利国产成人精品照片| 欧美日韩精品免费| 精品国产三级电影在线观看| 国产精品天美传媒| 午夜在线电影亚洲一区| 激情综合网av| 色老综合老女人久久久| 欧美一级在线观看| 亚洲视频免费看| 美国毛片一区二区| 粗大黑人巨茎大战欧美成人| 日本高清无吗v一区| 精品1区2区在线观看| 亚洲免费色视频| 国产精品123| 欧美一区二区三区性视频| 中文字幕一区二区5566日韩| 日韩综合小视频| 91香蕉视频黄| 久久精品免视看| 日韩影视精彩在线| 日本福利一区二区| 中文字幕欧美区| 精品一区二区在线播放| 欧美三级视频在线观看| 亚洲色图视频网站| 国产激情视频一区二区三区欧美 | 亚洲第一电影网| 国产成人亚洲综合色影视| 91精品国产高清一区二区三区蜜臀| 欧美一区二区在线视频| 日本一区免费视频| 欧美欧美午夜aⅴ在线观看| 欧美国产欧美综合| 国产麻豆精品视频| 国产亚洲精品aa午夜观看| 精品亚洲porn| 久久久久久久久免费| 国产一区二区三区电影在线观看| 欧美日本高清视频在线观看| 日韩成人午夜精品| 精品国产人成亚洲区| 久久 天天综合| 国产精品欧美一区喷水| 97久久精品人人做人人爽50路| 亚洲免费av观看| 欧美日本一道本在线视频| 日本欧美一区二区| 久久久www成人免费毛片麻豆 | 欧美在线色视频| 日韩国产一二三区| 久久精品夜色噜噜亚洲aⅴ| 成人午夜视频网站| 亚洲福利视频一区二区| 日韩精品一区二区在线| 成人av资源站| 男男成人高潮片免费网站| 久久久久国产免费免费| 一本色道亚洲精品aⅴ| 免费欧美高清视频| 亚洲欧美欧美一区二区三区| 欧美一级黄色片| 91香蕉视频污在线|