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

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

?? piix_pci.c

?? QEMU 0.91 source code, supports ARM processor including S3C24xx series
?? C
字號:
/* * QEMU i440FX/PIIX3 PCI Bridge Emulation * * Copyright (c) 2006 Fabrice Bellard * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */#include "hw.h"#include "pc.h"#include "pci.h"typedef uint32_t pci_addr_t;#include "pci_host.h"typedef PCIHostState I440FXState;static void i440fx_addr_writel(void* opaque, uint32_t addr, uint32_t val){    I440FXState *s = opaque;    s->config_reg = val;}static uint32_t i440fx_addr_readl(void* opaque, uint32_t addr){    I440FXState *s = opaque;    return s->config_reg;}static void piix3_set_irq(qemu_irq *pic, int irq_num, int level);/* return the global irq number corresponding to a given device irq   pin. We could also use the bus number to have a more precise   mapping. */static int pci_slot_get_pirq(PCIDevice *pci_dev, int irq_num){    int slot_addend;    slot_addend = (pci_dev->devfn >> 3) - 1;    return (irq_num + slot_addend) & 3;}static uint32_t isa_page_descs[384 / 4];static uint8_t smm_enabled;static int pci_irq_levels[4];static void update_pam(PCIDevice *d, uint32_t start, uint32_t end, int r){    uint32_t addr;    //    printf("ISA mapping %08x-0x%08x: %d\n", start, end, r);    switch(r) {    case 3:        /* RAM */        cpu_register_physical_memory(start, end - start,                                     start);        break;    case 1:        /* ROM (XXX: not quite correct) */        cpu_register_physical_memory(start, end - start,                                     start | IO_MEM_ROM);        break;    case 2:    case 0:        /* XXX: should distinguish read/write cases */        for(addr = start; addr < end; addr += 4096) {            cpu_register_physical_memory(addr, 4096,                                         isa_page_descs[(addr - 0xa0000) >> 12]);        }        break;    }}static void i440fx_update_memory_mappings(PCIDevice *d){    int i, r;    uint32_t smram, addr;    update_pam(d, 0xf0000, 0x100000, (d->config[0x59] >> 4) & 3);    for(i = 0; i < 12; i++) {        r = (d->config[(i >> 1) + 0x5a] >> ((i & 1) * 4)) & 3;        update_pam(d, 0xc0000 + 0x4000 * i, 0xc0000 + 0x4000 * (i + 1), r);    }    smram = d->config[0x72];    if ((smm_enabled && (smram & 0x08)) || (smram & 0x40)) {        cpu_register_physical_memory(0xa0000, 0x20000, 0xa0000);    } else {        for(addr = 0xa0000; addr < 0xc0000; addr += 4096) {            cpu_register_physical_memory(addr, 4096,                                         isa_page_descs[(addr - 0xa0000) >> 12]);        }    }}void i440fx_set_smm(PCIDevice *d, int val){    val = (val != 0);    if (smm_enabled != val) {        smm_enabled = val;        i440fx_update_memory_mappings(d);    }}/* XXX: suppress when better memory API. We make the assumption that   no device (in particular the VGA) changes the memory mappings in   the 0xa0000-0x100000 range */void i440fx_init_memory_mappings(PCIDevice *d){    int i;    for(i = 0; i < 96; i++) {        isa_page_descs[i] = cpu_get_physical_page_desc(0xa0000 + i * 0x1000);    }}static void i440fx_write_config(PCIDevice *d,                                uint32_t address, uint32_t val, int len){    /* XXX: implement SMRAM.D_LOCK */    pci_default_write_config(d, address, val, len);    if ((address >= 0x59 && address <= 0x5f) || address == 0x72)        i440fx_update_memory_mappings(d);}static void i440fx_save(QEMUFile* f, void *opaque){    PCIDevice *d = opaque;    int i;    pci_device_save(d, f);    qemu_put_8s(f, &smm_enabled);    for (i = 0; i < 4; i++)        qemu_put_be32(f, pci_irq_levels[i]);}static int i440fx_load(QEMUFile* f, void *opaque, int version_id){    PCIDevice *d = opaque;    int ret, i;    if (version_id > 2)        return -EINVAL;    ret = pci_device_load(d, f);    if (ret < 0)        return ret;    i440fx_update_memory_mappings(d);    qemu_get_8s(f, &smm_enabled);    if (version_id >= 2)        for (i = 0; i < 4; i++)            pci_irq_levels[i] = qemu_get_be32(f);    return 0;}PCIBus *i440fx_init(PCIDevice **pi440fx_state, qemu_irq *pic){    PCIBus *b;    PCIDevice *d;    I440FXState *s;    s = qemu_mallocz(sizeof(I440FXState));    b = pci_register_bus(piix3_set_irq, pci_slot_get_pirq, pic, 0, 4);    s->bus = b;    register_ioport_write(0xcf8, 4, 4, i440fx_addr_writel, s);    register_ioport_read(0xcf8, 4, 4, i440fx_addr_readl, s);    register_ioport_write(0xcfc, 4, 1, pci_host_data_writeb, s);    register_ioport_write(0xcfc, 4, 2, pci_host_data_writew, s);    register_ioport_write(0xcfc, 4, 4, pci_host_data_writel, s);    register_ioport_read(0xcfc, 4, 1, pci_host_data_readb, s);    register_ioport_read(0xcfc, 4, 2, pci_host_data_readw, s);    register_ioport_read(0xcfc, 4, 4, pci_host_data_readl, s);    d = pci_register_device(b, "i440FX", sizeof(PCIDevice), 0,                            NULL, i440fx_write_config);    d->config[0x00] = 0x86; // vendor_id    d->config[0x01] = 0x80;    d->config[0x02] = 0x37; // device_id    d->config[0x03] = 0x12;    d->config[0x08] = 0x02; // revision    d->config[0x0a] = 0x00; // class_sub = host2pci    d->config[0x0b] = 0x06; // class_base = PCI_bridge    d->config[0x0e] = 0x00; // header_type    d->config[0x72] = 0x02; /* SMRAM */    register_savevm("I440FX", 0, 2, i440fx_save, i440fx_load, d);    *pi440fx_state = d;    return b;}/* PIIX3 PCI to ISA bridge */PCIDevice *piix3_dev;PCIDevice *piix4_dev;/* just used for simpler irq handling. */#define PCI_IRQ_WORDS   ((PCI_DEVICES_MAX + 31) / 32)static void piix3_set_irq(qemu_irq *pic, int irq_num, int level){    int i, pic_irq, pic_level;    piix3_dev->config[0x60 + irq_num] &= ~0x80;   // enable bit    pci_irq_levels[irq_num] = level;    /* now we change the pic irq level according to the piix irq mappings */    /* XXX: optimize */    pic_irq = piix3_dev->config[0x60 + irq_num];    if (pic_irq < 16) {        /* The pic level is the logical OR of all the PCI irqs mapped           to it */        pic_level = 0;        for (i = 0; i < 4; i++) {            if (pic_irq == piix3_dev->config[0x60 + i])                pic_level |= pci_irq_levels[i];        }        qemu_set_irq(pic[pic_irq], pic_level);    }}static void piix3_reset(PCIDevice *d){    uint8_t *pci_conf = d->config;    pci_conf[0x04] = 0x07; // master, memory and I/O    pci_conf[0x05] = 0x00;    pci_conf[0x06] = 0x00;    pci_conf[0x07] = 0x02; // PCI_status_devsel_medium    pci_conf[0x4c] = 0x4d;    pci_conf[0x4e] = 0x03;    pci_conf[0x4f] = 0x00;    pci_conf[0x60] = 0x80;    pci_conf[0x69] = 0x02;    pci_conf[0x70] = 0x80;    pci_conf[0x76] = 0x0c;    pci_conf[0x77] = 0x0c;    pci_conf[0x78] = 0x02;    pci_conf[0x79] = 0x00;    pci_conf[0x80] = 0x00;    pci_conf[0x82] = 0x00;    pci_conf[0xa0] = 0x08;    pci_conf[0xa2] = 0x00;    pci_conf[0xa3] = 0x00;    pci_conf[0xa4] = 0x00;    pci_conf[0xa5] = 0x00;    pci_conf[0xa6] = 0x00;    pci_conf[0xa7] = 0x00;    pci_conf[0xa8] = 0x0f;    pci_conf[0xaa] = 0x00;    pci_conf[0xab] = 0x00;    pci_conf[0xac] = 0x00;    pci_conf[0xae] = 0x00;}static void piix4_reset(PCIDevice *d){    uint8_t *pci_conf = d->config;    pci_conf[0x04] = 0x07; // master, memory and I/O    pci_conf[0x05] = 0x00;    pci_conf[0x06] = 0x00;    pci_conf[0x07] = 0x02; // PCI_status_devsel_medium    pci_conf[0x4c] = 0x4d;    pci_conf[0x4e] = 0x03;    pci_conf[0x4f] = 0x00;    pci_conf[0x60] = 0x0a; // PCI A -> IRQ 10    pci_conf[0x61] = 0x0a; // PCI B -> IRQ 10    pci_conf[0x62] = 0x0b; // PCI C -> IRQ 11    pci_conf[0x63] = 0x0b; // PCI D -> IRQ 11    pci_conf[0x69] = 0x02;    pci_conf[0x70] = 0x80;    pci_conf[0x76] = 0x0c;    pci_conf[0x77] = 0x0c;    pci_conf[0x78] = 0x02;    pci_conf[0x79] = 0x00;    pci_conf[0x80] = 0x00;    pci_conf[0x82] = 0x00;    pci_conf[0xa0] = 0x08;    pci_conf[0xa2] = 0x00;    pci_conf[0xa3] = 0x00;    pci_conf[0xa4] = 0x00;    pci_conf[0xa5] = 0x00;    pci_conf[0xa6] = 0x00;    pci_conf[0xa7] = 0x00;    pci_conf[0xa8] = 0x0f;    pci_conf[0xaa] = 0x00;    pci_conf[0xab] = 0x00;    pci_conf[0xac] = 0x00;    pci_conf[0xae] = 0x00;}static void piix_save(QEMUFile* f, void *opaque){    PCIDevice *d = opaque;    pci_device_save(d, f);}static int piix_load(QEMUFile* f, void *opaque, int version_id){    PCIDevice *d = opaque;    if (version_id != 2)        return -EINVAL;    return pci_device_load(d, f);}int piix3_init(PCIBus *bus, int devfn){    PCIDevice *d;    uint8_t *pci_conf;    d = pci_register_device(bus, "PIIX3", sizeof(PCIDevice),                                    devfn, NULL, NULL);    register_savevm("PIIX3", 0, 2, piix_save, piix_load, d);    piix3_dev = d;    pci_conf = d->config;    pci_conf[0x00] = 0x86; // Intel    pci_conf[0x01] = 0x80;    pci_conf[0x02] = 0x00; // 82371SB PIIX3 PCI-to-ISA bridge (Step A1)    pci_conf[0x03] = 0x70;    pci_conf[0x0a] = 0x01; // class_sub = PCI_ISA    pci_conf[0x0b] = 0x06; // class_base = PCI_bridge    pci_conf[0x0e] = 0x80; // header_type = PCI_multifunction, generic    piix3_reset(d);    return d->devfn;}int piix4_init(PCIBus *bus, int devfn){    PCIDevice *d;    uint8_t *pci_conf;    d = pci_register_device(bus, "PIIX4", sizeof(PCIDevice),                                    devfn, NULL, NULL);    register_savevm("PIIX4", 0, 2, piix_save, piix_load, d);    piix4_dev = d;    pci_conf = d->config;    pci_conf[0x00] = 0x86; // Intel    pci_conf[0x01] = 0x80;    pci_conf[0x02] = 0x10; // 82371AB/EB/MB PIIX4 PCI-to-ISA bridge    pci_conf[0x03] = 0x71;    pci_conf[0x0a] = 0x01; // class_sub = PCI_ISA    pci_conf[0x0b] = 0x06; // class_base = PCI_bridge    pci_conf[0x0e] = 0x80; // header_type = PCI_multifunction, generic    piix4_reset(d);    return d->devfn;}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
91国偷自产一区二区三区成为亚洲经典 | 久久99久久久欧美国产| 亚洲综合丁香婷婷六月香| 最新不卡av在线| 亚洲日本va午夜在线影院| 1区2区3区欧美| 亚洲日本电影在线| 亚洲最大成人综合| 三级亚洲高清视频| 奇米精品一区二区三区四区| 欧美a级一区二区| 激情综合亚洲精品| 国产一二精品视频| 成人午夜视频免费看| 成a人片亚洲日本久久| 91一区二区三区在线观看| 色综合中文综合网| 麻豆精品久久久| 国产精品影音先锋| 成人午夜伦理影院| 91久久精品日日躁夜夜躁欧美| 欧美亚洲愉拍一区二区| 91精品国产乱| 久久影音资源网| 亚洲视频一二三区| 亚洲chinese男男1069| 理论电影国产精品| 国产不卡视频在线观看| 色婷婷香蕉在线一区二区| 欧美网站大全在线观看| 日韩欧美综合一区| 国产精品网站在线播放| 亚洲主播在线观看| 久久精品国产一区二区三| 日韩欧美高清dvd碟片| 亚洲国产精品成人综合色在线婷婷 | 欧美人牲a欧美精品| 精品久久久久久久久久久久包黑料 | 国产在线精品国自产拍免费| 国产电影一区二区三区| 91麻豆.com| 日韩一区二区三区电影在线观看| 国产香蕉久久精品综合网| 亚洲丝袜精品丝袜在线| 青青草精品视频| a在线欧美一区| 日韩一级大片在线| 亚洲欧美视频一区| 久久成人久久爱| 99精品桃花视频在线观看| 欧美一卡2卡3卡4卡| 中文字幕一区二区三区在线观看 | 日本成人中文字幕| 成人激情免费网站| 日韩欧美资源站| 国产精品传媒入口麻豆| 日韩**一区毛片| 91在线你懂得| 欧美tickling挠脚心丨vk| 亚洲精品欧美二区三区中文字幕| 精品一区二区久久| 69av一区二区三区| 亚洲欧美日本韩国| 国产精品中文有码| 欧美一区二区二区| 伊人婷婷欧美激情| 成人午夜大片免费观看| 欧美一区二区啪啪| 亚洲综合一二区| 成人白浆超碰人人人人| www成人在线观看| 爽好久久久欧美精品| 一本一道综合狠狠老| 国产欧美日韩亚州综合| 美女网站一区二区| 7777精品伊人久久久大香线蕉超级流畅 | 中文字幕一区二区三区乱码在线| 久久99蜜桃精品| 5858s免费视频成人| 一区二区在线看| 99精品视频在线观看免费| 久久精品男人天堂av| 免费成人在线观看| 欧美精品乱码久久久久久按摩 | 精品久久久久久久久久久久包黑料 | 丝袜诱惑亚洲看片| 在线观看日韩高清av| 中文字幕一区在线| 国产成人精品三级| 久久精品一区二区三区不卡| 精品一区二区三区在线观看国产 | 欧美挠脚心视频网站| 亚洲综合无码一区二区| 色综合久久综合中文综合网| 中文字幕久久午夜不卡| 国产成人啪午夜精品网站男同| 26uuu另类欧美| 国产一区二区剧情av在线| 日韩欧美高清一区| 精品在线观看免费| 欧美成人video| 精品一区二区三区在线观看| 日韩欧美亚洲另类制服综合在线| 日本不卡1234视频| 日韩欧美黄色影院| 韩国三级电影一区二区| 久久蜜桃av一区精品变态类天堂 | 暴力调教一区二区三区| 国产精品成人一区二区三区夜夜夜 | 成人激情综合网站| 亚洲图片另类小说| 色噜噜久久综合| 亚洲一线二线三线视频| 欧美日韩一区二区三区四区| 亚洲在线一区二区三区| 欧美在线观看一二区| 午夜伦理一区二区| 日韩一级高清毛片| 国产成人午夜视频| 亚洲视频图片小说| 欧美日韩一二区| 日韩电影在线一区二区三区| 精品国产免费人成在线观看| 国产高清不卡一区| 亚洲欧洲日韩综合一区二区| 欧洲激情一区二区| 日日夜夜精品视频天天综合网| 欧美一二三四区在线| 韩国女主播成人在线| 欧美极品美女视频| 欧美视频中文字幕| 久久国产乱子精品免费女| 国产人成亚洲第一网站在线播放| 成人激情av网| 视频一区二区国产| 国产日韩三级在线| 在线精品视频免费播放| 免费成人在线观看| 国产精品久久久久一区| 欧美视频日韩视频| 韩国精品一区二区| 亚洲美女区一区| 欧美一级在线免费| 成人av电影在线| 欧美亚洲动漫另类| 蜜桃av噜噜一区| 亚洲国产精华液网站w| 91网站最新网址| 秋霞午夜av一区二区三区| 久久欧美中文字幕| 一本久久a久久精品亚洲| 另类调教123区| 亚洲综合一二区| 久久久久国产精品麻豆ai换脸| 91免费看片在线观看| 视频一区视频二区中文| 国产精品人成在线观看免费| 欧美日韩久久不卡| 国产成人综合自拍| 婷婷一区二区三区| 亚洲天堂网中文字| 久久网这里都是精品| 欧美手机在线视频| 成人高清在线视频| 久久成人18免费观看| 一区二区三区四区蜜桃| 国产亚洲女人久久久久毛片| 在线播放国产精品二区一二区四区| 丁香另类激情小说| 奇米色一区二区| 一区二区三区精品| 国产精品麻豆久久久| 日韩欧美不卡一区| 欧美日韩中文国产| 99v久久综合狠狠综合久久| 激情五月激情综合网| 亚洲成av人片在www色猫咪| 亚洲欧洲日本在线| 欧美国产精品v| 日韩免费成人网| 欧美日韩电影在线播放| 91色乱码一区二区三区| 高清成人免费视频| 韩国成人在线视频| 久久国产精品99久久人人澡| 五月激情综合网| 一区二区三区在线免费视频| 中文字幕不卡在线观看| 国产偷国产偷精品高清尤物| 9191成人精品久久| 欧美日韩国产另类一区| 欧美亚洲高清一区二区三区不卡| 91小视频在线| 成人v精品蜜桃久久一区| 精品成人免费观看| 91精品国产色综合久久不卡电影| 欧美午夜不卡在线观看免费| 91国产免费观看| 91国模大尺度私拍在线视频| 成人午夜又粗又硬又大|