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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? ofh.c

?? xen 3.2.2 源碼
?? C
字號:
/* * 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, 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA. * * Copyright (C) IBM Corp. 2005 * * Authors: Jimi Xenidis <jimix@watson.ibm.com> */#include "ofh.h"#include <stdarg.h>#include <xen/lib.h>/* * 6.3.1 Access to the client interface functions * This is the spec'd maximum */#define PFW_MAXSRVCLEN 31static u32 ofh_maxsrvclen;extern s32 debug(const char *fmt, ...);s32 debug(const char *fmt, ...){    s32 sz;    va_list ap;    char buf[512];    va_start(ap, fmt);    sz = vsnprintf(buf, 512, fmt, ap);    va_end(ap);    ofh_cons_write(buf, sz, &sz);    return sz;}voidassprint(const char *expr, const char *file, int line, const char *fmt, ...){    char a[15] = {       '\n', '\n', 'O', 'F', 'H', ':', 'A', 'S', 'S', 'E', 'R', 'T', '!',       '\n', '\n',    };    s32 actual;    u32 t = 1;    volatile u32 *tp = &t;    ofh_cons_write(a, sizeof (a), &actual);    /* maybe I can break out of this loop manually (like with a     * debugger) */    while (*tp) {        continue;    }}/* * we use elf hash since it is pretty standard */static u32of_hash(const char *s){    u32 hash = 0;    u32 hnib;    if (s != NULL) {        while (*s != '\0') {            hash = (hash << 4) + *s++;            hnib = hash & 0xf0000000UL;            if (hnib != 0) {                hash ^= hnib >> 24;            }            hash &= ~hnib;        }    }    return hash;}static voidofh_service_init(ulong b){    ulong sz;    int i;    int j = 0;    struct ofh_srvc *o;    struct ofh_srvc *ofs[] = {        DRELA(&ofh_srvc[0], b),        DRELA(&ofh_isa_srvc[0], b),        NULL    };    j = 0;    while (ofs[j] != NULL) {        /* find the maximum string length for services */        o = &ofs[j][0];        while (o->ofs_name != NULL) {            const char *n;            n = DRELA(&o->ofs_name[0], b);            /* fix it up so we don't have to fix it anymore */            o->ofs_name = n;            sz = strlen(n);            if (sz > *DRELA(&ofh_maxsrvclen, b)) {                *DRELA(&ofh_maxsrvclen, b) = sz;            }            o->ofs_hash =                of_hash(n);            ++i;            ++o;        }        ++j;    }}static voidofh_cpu_init(ofdn_t chosen, ulong b){    static struct ofh_ihandle _ih_cpu_0;    void *mem = ofd_mem(b);    u32 ih = DRELA((ulong)&_ih_cpu_0, b);    struct ofh_ihandle *ihp = (struct ofh_ihandle *)((ulong)ih);    const char *cpu_type = DRELA((const char*)"cpu",b);    ofdn_t cpu = ofd_node_find_by_prop(mem, OFD_ROOT,                                       DRELA((const char*)"device_type",b),                                       cpu_type, 4);    ihp->ofi_node = cpu;    ofd_prop_add(mem, chosen, DRELA((const char *)"cpu", b),                 &ih, sizeof (ih));}static s32mmu_translate(u32 nargs, u32 nrets, s32 argp[], s32 retp[], ulong b){    /* FIXME: need a little more here */    nargs = nargs;    nrets = nrets;    argp = argp;    retp = retp;    b = b;    return OF_SUCCESS;}static voidofh_mmu_init(ofdn_t chosen, ulong b){    static struct ofh_methods _mmu_methods[] = {        { "translate", mmu_translate },        { NULL, NULL},    };    static struct ofh_ihandle _ih_mmu = {        .ofi_methods = _mmu_methods,    };    void *mem = ofd_mem(b);    u32 ih = DRELA((ulong)&_ih_mmu, b);    ofd_prop_add(mem, chosen, DRELA((const char *)"mmu", b),                 &ih, sizeof (ih));}static voidofh_chosen_init(ulong b){    ofdn_t ph;    void *mem = ofd_mem(b);    ph = ofd_node_find(mem, DRELA((const char *)"/chosen", b));    ofh_vty_init(ph, b);    ofh_cpu_init(ph, b);    ofh_mmu_init(ph, b);}static voidofh_options_init(ulong b){    void *mem = ofd_mem(b);    ofdn_t options;    u32 size = 1 << 20;    u32 base = b;    char buf[20];    int i;    /* fixup the ihandle */    options = ofd_node_find(mem,                            DRELA((const char *)"options", b));    i = snprintf(buf, sizeof (buf), "0x%x", base);    ofd_prop_add(mem, options, DRELA((const char *)"real-base", b),                 buf, i);    i = snprintf(buf,sizeof (buf), "0x%x", size);    ofd_prop_add(mem, options, DRELA((const char *)"real-size", b),                 buf, i);}static voidofh_init(ulong b){    ulong sz = (ulong)_end - (ulong)__bss_start;    /* clear bss */    memset(__bss_start + b, 0, sz);    ofh_service_init(b);    ofh_chosen_init(b);	ofh_rtas_init(b);    ofh_options_init(b);}static ofh_func_t *ofh_lookup(const char *service, ulong b){    int j;    u32 hash;    struct ofh_srvc *o;    struct ofh_srvc *ofs[] = {        DRELA(&ofh_srvc[0], b),        DRELA(&ofh_isa_srvc[0], b),        NULL    };    u32 sz;    sz = *DRELA(&ofh_maxsrvclen, b);    if (strnlen(service, sz + 1) > sz) {        return NULL;    }    hash = of_hash(service);    j = 0;    while (ofs[j] != NULL) {        /* yes this could be quicker */        o = &ofs[j][0];        while (o->ofs_name != NULL) {            if (o->ofs_hash == hash) {                const char *n = o->ofs_name;                if (strcmp(service, n) == 0) {                    return o->ofs_func;                }            }            ++o;        }        ++j;    }    return NULL;}s32ofh_nosup(u32 nargs __attribute__ ((unused)),        u32 nrets __attribute__ ((unused)),        s32 argp[] __attribute__ ((unused)),        s32 retp[] __attribute__ ((unused)),        ulong b __attribute__ ((unused))){    return OF_FAILURE;}s32ofh_test_method(u32 nargs, u32 nrets, s32 argp[], s32 retp[], ulong b){    if (nargs == 2) {        if (nrets == 1) {            s32 *ap = DRELA(&ofh_active_package, b);            u32 service = (s32)argp[0];            const char *method = (const char *)(ulong)argp[1];            s32 *stat = &retp[0];            (void)ap; (void)service; (void)method;            *stat = 0;            /* we do not do this yet */            return OF_FAILURE;        }    }    return OF_FAILURE;}extern u32 _ofh_inited[0];extern u32 _ofh_lastarg[0];s32ofh_handler(struct ofh_args *args, ulong b){    u32 *inited = (u32 *)DRELA(&_ofh_inited[0],b);    u32 *lastarg = (u32 *)DRELA(&_ofh_lastarg[0],b);    ofh_func_t *f;    if (*inited == 0) {        ofh_init(b);        if ((ulong)ofd_mem(b) < (ulong)_end + b) {            static const char msg[] = "PANIC: OFD and BSS collide\n";            s32 dummy;            ofh_cons_write(DRELA(&msg[0], b), sizeof (msg), &dummy);            for (;;);        }        *inited = 1;    }    *lastarg = (ulong)args;    f = ofh_lookup((char *)((ulong)args->ofa_service), b);    if (f == ((ofh_func_t *)~0UL)) {        /* do test */        if (args->ofa_nargs == 1) {            if (args->ofa_nreturns == 1) {                char *name = (char *)(ulong)args->ofa_args[0];                if (ofh_lookup(name, b) != NULL) {                    args->ofa_args[args->ofa_nargs] =                        OF_SUCCESS;                    return OF_SUCCESS;                }            }        }        return OF_FAILURE;    } else if (f != NULL) {        return leap(args->ofa_nargs,                    args->ofa_nreturns,                    args->ofa_args,                    &args->ofa_args[args->ofa_nargs],                    b, f);    }    return OF_FAILURE;}/* * The following code exists solely to run the handler code standalone */void__ofh_start(void){    s32 ret;    u32 of_stdout;    u32 ihandle;    char buf[1024];    u32 args_buf[sizeof (struct ofh_args) + (sizeof (u32) * 10)];    struct ofh_args *args;    args = (struct ofh_args *)args_buf;    args->ofa_service = (u32)"finddevice";    args->ofa_nargs     = 1;    args->ofa_nreturns  = 1;    args->ofa_args[0]   = (u32)"/";    args->ofa_args[1]   = -1;    ret = ofh_start(args);    if (ret == OF_SUCCESS) {        args->ofa_service   = (u32)"finddevice";        args->ofa_nargs     = 1;        args->ofa_nreturns  = 1;        args->ofa_args[0]   = (u32)"/chosen";        args->ofa_args[1]   = -1;        ret = ofh_start(args);    }    if (ret == OF_SUCCESS) {        u32 phandle = args->ofa_args[1];        args->ofa_service   = (u32)"getprop";        args->ofa_nargs     = 4;        args->ofa_nreturns  = 1;        args->ofa_args[0]   = phandle;        args->ofa_args[1]   = (ulong)"stdout";        args->ofa_args[2]   = (ulong)&of_stdout;        args->ofa_args[3]   = sizeof(of_stdout);        args->ofa_args[4]   = -1;        ret = ofh_start(args);    }    ihandle = *(u32 *)((ulong)args->ofa_args[2]);    if (ret == OF_SUCCESS) {        /* instance to path */        args->ofa_service   = (u32)"instance-to-path";        args->ofa_nargs     = 3;        args->ofa_nreturns  = 1;        args->ofa_args[0]   = ihandle;        args->ofa_args[1]   = (ulong)buf;        args->ofa_args[2]   = sizeof (buf);        args->ofa_args[3]   = -1;        ret = ofh_start(args);    }    if (ret == OF_SUCCESS) {        /* open rtas */        args->ofa_service   = (u32)"open";        args->ofa_nargs     = 1;        args->ofa_nreturns  = 1;        args->ofa_args[0]   = (u32)"/rtas";        ret = ofh_start(args);        if (ret == OF_SUCCESS) {            u32 ir = args->ofa_args[1];            args->ofa_service   = (u32)"call-method";            args->ofa_nargs     = 3;            args->ofa_nreturns  = 2;            args->ofa_args[0]   = (ulong)"instantiate-rtas";            args->ofa_args[1]   = ir;            args->ofa_args[2]   = (ulong)buf;            ret = ofh_start(args);        }    }    if (ret == OF_SUCCESS) {        const char msg[] = "This is a test";        u32 msgsz = sizeof(msg) - 1; /* Includes \0 */        args->ofa_service   = (u32)"write";        args->ofa_nargs     = 3;        args->ofa_nreturns  = 1;        args->ofa_args[0]   = ihandle;        args->ofa_args[1]   = (ulong)msg;        args->ofa_args[2]   = msgsz;        args->ofa_args[3]   = -1;        ret = ofh_start(args);    }}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久精品国产一区二区三| 亚洲欧美在线另类| 日韩成人av影视| 日韩欧美一区二区视频| 裸体一区二区三区| 精品久久久三级丝袜| 国产一区二区三区精品视频| 久久久99免费| 风流少妇一区二区| 亚洲男人天堂av网| 欧美日韩国产免费| 国产一区二区三区免费在线观看| 国产精品你懂的在线欣赏| 色综合天天综合| 亚洲一区二区三区四区在线免费观看| 欧美色中文字幕| 日本欧美一区二区三区| 国产日韩欧美一区二区三区乱码| 国产精品亚洲а∨天堂免在线| 亚洲视频在线一区二区| 欧美精品视频www在线观看| 理论电影国产精品| 亚洲欧美自拍偷拍| 日韩视频123| 成人黄色av电影| 亚洲不卡一区二区三区| 久久综合久色欧美综合狠狠| 97se亚洲国产综合在线| 日韩精品免费专区| 国产精品亲子乱子伦xxxx裸| 欧美日韩情趣电影| 国产成人精品午夜视频免费| 亚洲一区在线免费观看| 久久蜜桃av一区二区天堂| 欧美午夜精品免费| 黄色精品一二区| 亚洲一区在线看| 国产欧美日韩三级| 日韩一区二区在线观看视频 | 国产精品欧美久久久久无广告 | 7777精品伊人久久久大香线蕉的| 韩国v欧美v日本v亚洲v| 亚洲国产精品久久人人爱蜜臀 | 欧美色爱综合网| 狠狠色丁香久久婷婷综合_中| 亚洲欧美视频在线观看| 久久女同精品一区二区| 在线观看91精品国产麻豆| 一本色道久久综合狠狠躁的推荐| 久久国产福利国产秒拍| 亚洲国产欧美在线| 中文字幕一区二区不卡 | 4438x亚洲最大成人网| 99国产精品视频免费观看| 久久99精品久久久久久久久久久久| 自拍偷拍国产亚洲| 国产精品污www在线观看| 日韩视频在线你懂得| 欧美亚洲国产bt| 99精品久久99久久久久| 国产成a人亚洲| 精品一区二区三区免费| 三级成人在线视频| 洋洋av久久久久久久一区| 国产精品成人网| www久久精品| 欧美www视频| 91麻豆精品国产91| 欧美日韩不卡视频| 欧美日韩午夜在线| 欧美日韩综合色| 欧美伊人久久大香线蕉综合69 | 亚洲国产婷婷综合在线精品| 中文字幕亚洲在| 国产精品乱码人人做人人爱 | 96av麻豆蜜桃一区二区| 不卡欧美aaaaa| 成人听书哪个软件好| 国产69精品久久99不卡| 国产99精品视频| 国产91精品久久久久久久网曝门| 国产精品亚洲人在线观看| 国产·精品毛片| kk眼镜猥琐国模调教系列一区二区| 成人晚上爱看视频| 91在线国产福利| 在线亚洲欧美专区二区| 欧美午夜一区二区三区免费大片| 欧美日韩免费不卡视频一区二区三区| 欧美亚洲另类激情小说| 在线综合视频播放| 欧美va亚洲va香蕉在线| 久久先锋影音av鲁色资源| 国产清纯白嫩初高生在线观看91 | 亚洲乱码精品一二三四区日韩在线| 亚洲欧洲日产国产综合网| 亚洲免费电影在线| 婷婷激情综合网| 久久精品国产网站| 国产成人精品影视| 色成人在线视频| 91精品国产综合久久婷婷香蕉 | 三级成人在线视频| 国产主播一区二区三区| 成年人午夜久久久| 欧美日韩国产综合一区二区三区| 3d动漫精品啪啪1区2区免费| 国产亚洲综合在线| 亚洲精品伦理在线| 日韩成人精品视频| 成人黄色777网| 欧美日韩久久久| 国产亚洲欧美日韩俺去了| 亚洲三级理论片| 日韩av电影免费观看高清完整版| 国产一二精品视频| 日本精品视频一区二区三区| 欧美一区二区美女| 中文字幕一区二区三区精华液| 午夜视频久久久久久| 国产精品88av| 欧美日韩一二三区| 国产精品网站在线播放| 午夜免费欧美电影| 国产99久久精品| 91精品国产综合久久久久久久久久 | 亚洲电影第三页| 盗摄精品av一区二区三区| 欧美三级中文字幕在线观看| 国产亚洲欧美激情| 青青草成人在线观看| 91网站最新网址| 2021中文字幕一区亚洲| 亚洲一区自拍偷拍| www.欧美亚洲| 精品国产污网站| 亚洲成在线观看| 成人久久视频在线观看| 日韩区在线观看| 亚洲无人区一区| 成人高清视频免费观看| 精品日韩99亚洲| 亚洲成av人影院在线观看网| 99视频在线精品| 狠狠久久亚洲欧美| 亚洲日本一区二区| 国产综合色精品一区二区三区| 欧美色手机在线观看| 国产精品久久久久一区二区三区共| 麻豆高清免费国产一区| 欧美日韩一区二区在线观看视频| 中文字幕一区二区三区四区| 国产精品一二二区| 欧美videos中文字幕| 美女爽到高潮91| 91精品国产品国语在线不卡| 一区二区三区加勒比av| 色婷婷香蕉在线一区二区| 国产精品国产三级国产aⅴ无密码| 精品无码三级在线观看视频 | 精品成人一区二区三区四区| 日韩av中文字幕一区二区三区| 色又黄又爽网站www久久| 中文字幕在线免费不卡| 高清免费成人av| 国产精品网曝门| jlzzjlzz亚洲日本少妇| 国产精品青草久久| 99久久夜色精品国产网站| 国产精品家庭影院| 99久久伊人网影院| 亚洲欧美日韩小说| 欧美性猛片xxxx免费看久爱| 一区二区不卡在线视频 午夜欧美不卡在| 99久久综合精品| 亚洲日本在线视频观看| 欧美亚洲动漫精品| 五月天激情小说综合| 777a∨成人精品桃花网| 日本成人在线不卡视频| 欧美草草影院在线视频| 黄色小说综合网站| 国产精品久久久久四虎| 色综合网色综合| 日日噜噜夜夜狠狠视频欧美人| 91精品综合久久久久久| 在线播放91灌醉迷j高跟美女 | 激情欧美一区二区| 久久久久国产一区二区三区四区 | 2欧美一区二区三区在线观看视频| 久久99久久久欧美国产| 久久久久亚洲蜜桃| 99re成人精品视频| 性做久久久久久久久| 欧美成人一区二区三区片免费| 国产一区二区h| 亚洲欧美日韩久久| 欧美一区二区视频免费观看| 国产高清不卡一区| 亚洲老妇xxxxxx|