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

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

?? tpm-tis-device

?? xen虛擬機源代碼安裝包
??
?? 第 1 頁 / 共 3 頁
字號:
+ */+static uint32_t tpm_data_read(tpmState *s, uint8_t locty)+{+    uint32_t ret, len;++    /* try to receive data, if none are there it is ok */+    tis_attempt_receive(s, locty);++    if (s->loc[locty].state != STATE_COMPLETION) {+        return 0xff;+    }++    len = tpm_get_size_from_buffer(s->buffer.buf);+    ret = s->buffer.buf[s->offset++];+    if (s->offset >= len) {+        s->loc[locty].sts = STS_VALID ;+        s->offset = 0;+    }+#ifdef DEBUG_TPM+    fprintf(logfile,"tpm_data_read byte x%02x   [%d]\n",ret,s->offset-1);+#endif+    return ret;+}++++/* raise an interrupt if allowed */+static void tis_raise_irq(tpmState *s, uint8_t locty, uint32_t irqmask)+{+    if (!s->irq_pending &&+        (s->loc[locty].inte & INT_ENABLED) &&+        (s->loc[locty].inte & irqmask)) {+        if ((irqmask & s->loc[locty].ints) == 0) {+#ifdef DEBUG_TPM+            fprintf(logfile,"Raising IRQ for flag %08x\n",irqmask);+#endif+            s->set_irq(s->irq_opaque, s->irq, 1);+            s->irq_pending = 1;+            s->loc[locty].ints |= irqmask;+        }+    }+}++/* abort execution of command */+static void tis_abort(tpmState *s)+{+    s->offset = 0;+    s->active_loc = s->next_locty;++    /*+     * Need to react differently depending on who's aborting now and+     * which locality will become active afterwards.+     */+    if (s->aborting_locty == s->next_locty) {+        s->loc[s->aborting_locty].state = STATE_READY;+        s->loc[s->aborting_locty].sts   = STS_COMMAND_READY;+        tis_raise_irq(s, s->aborting_locty, INT_COMMAND_READY);+    }++    /* locality after abort is another one than the current one */+    if (s->aborting_locty != s->next_locty && s->next_locty != NO_LOCALITY) {+        s->loc[s->aborting_locty].access &= ~ACCESS_ACTIVE_LOCALITY;+        s->loc[s->next_locty].access     |=  ACCESS_ACTIVE_LOCALITY;+        tis_raise_irq(s, s->next_locty, INT_LOCALITY_CHANGED);+    }++    s->aborting_locty = NO_LOCALITY; /* nobody's aborting a command anymore */++    qemu_del_timer(s->poll_timer);+}++/* abort current command */+static void tis_prep_abort(tpmState *s, uint8_t locty, uint8_t newlocty)+{+    s->aborting_locty = locty; /* current locality */+    s->next_locty = newlocty;  /* locality after successful abort */++    /*+     * only abort a command using an interrupt if currently executing+     * a command AND if there's a valid connection to the vTPM.+     */+    if (s->loc[locty].state == STATE_EXECUTION &&+        IS_COMM_WITH_VTPM(s)) {+        /* start timer and inside the timer wait for the result */+        s->poll_attempts = 0;+        tis_prep_next_interrupt(s);+    } else {+        tis_abort(s);+    }+}+++/*+ * Try to receive a response from the vTPM+ */+static void tis_attempt_receive(tpmState *s, uint8_t locty)+{+    /*+     * Attempt to read from the vTPM here if+     * - not aborting a command+     * - command has been sent and state is 'EXECUTION' now+     * - no data are already available (data have already been read)+     * - there's a communication path to the vTPM established+     */+    if (!IS_VALID_LOC(s->aborting_locty)) {+        if (s->loc[locty].state == STATE_EXECUTION) {+            if (0 == (s->loc[locty].sts & STS_DATA_AVAILABLE)){+                if (IS_COMM_WITH_VTPM(s)) {+                    int n = TPM_Receive(s, &s->buffer);+                    if (n > 0) {+                        s->loc[locty].sts = STS_VALID | STS_DATA_AVAILABLE;+                        s->loc[locty].state = STATE_COMPLETION;+                        close_vtpm_channel(s, FORCE_CLOSE);+                        tis_raise_irq(s, locty, INT_DATA_AVAILABLE);+                    }+                }+            }+        }+    }+}++/*+ * Read a register of the TIS interface+ * See specs pages 33-63 for description of the registers+ */+static uint32_t tis_mem_readl(void *opaque, target_phys_addr_t addr)+{+    tpmState *s = (tpmState *)opaque;+    uint16_t offset = addr & 0xffc;+    uint8_t shift = (addr & 0x3) * 8;+    uint32_t val = 0;+    uint8_t locty = locality_from_addr(addr);++    if (offset == TPM_REG_ACCESS) {+        if (s->active_loc == locty) {+            s->loc[locty].access |= (1 << 5);+         } else {+            s->loc[locty].access &= ~(1 << 5);+        }+        val = s->loc[locty].access;+    } else+    if (offset == TPM_REG_INT_ENABLE) {+        val = s->loc[locty].inte;+    } else+    if (offset == TPM_REG_INT_VECTOR) {+        val = s->irq;+    } else+    if (offset == TPM_REG_INT_STATUS) {+        tis_attempt_receive(s, locty);+        val = s->loc[locty].ints;+    } else+    if (offset == TPM_REG_INTF_CAPABILITY) {+        val = CAPABILITIES_SUPPORTED;+    } else+    if (offset == TPM_REG_STS) { /* status register */+        tis_attempt_receive(s, locty);+        val = (sizeof(s->buffer.buf) - s->offset) << 8 | s->loc[locty].sts;+    } else+    if (offset == TPM_REG_DATA_FIFO) {+      val = tpm_data_read(s, locty);+    } else+    if (offset == TPM_REG_DID_VID) {+        val = (TPM_DID << 16) | TPM_VID;+    } else+    if (offset == TPM_REG_RID) {+         val = TPM_RID;+    }++    if (shift)+        val >>= shift;++#ifdef DEBUG_TPM+    fprintf(logfile," read(%08x) = %08x\n",+            (int)addr,+            val);+#endif++    return val;+}++/*+ * Write a value to a register of the TIS interface+ * See specs pages 33-63 for description of the registers+ */+static void tis_mem_writel(void *opaque, target_phys_addr_t addr, uint32_t val)+{+    tpmState* s=(tpmState*)opaque;+    uint16_t off = addr & 0xfff;+    uint8_t locty = locality_from_addr(addr);+    int n, c;+    uint32_t len;++#ifdef DEBUG_TPM+    fprintf(logfile,"write(%08x) = %08x\n",+            (int)addr,+            val);+#endif++    if (off == TPM_REG_ACCESS) {+        if (val & ACCESS_ACTIVE_LOCALITY) {+            /* give up locality if currently owned */+            if (s->active_loc == locty) {+                uint8_t newlocty = NO_LOCALITY;+                s->loc[locty].access &= ~(ACCESS_PENDING_REQUEST);+                /* anybody wants the locality ? */+                for (c = NUM_LOCALITIES - 1; c >= 0; c--) {+                    if (s->loc[c].access & ACCESS_REQUEST_USE) {+                        s->loc[c].access |= ACCESS_TPM_REG_VALID_STS;+                        s->loc[c].access &= ~ACCESS_REQUEST_USE;+                        newlocty = c;+                        break;+                    }+                }+                tis_prep_abort(s, locty, newlocty);+            }+        }+        if (val & ACCESS_BEEN_SEIZED) {+            /* clear the flag */+            s->loc[locty].access &= ~ACCESS_BEEN_SEIZED;+        }+        if (val & ACCESS_SEIZE) {+            if (locty > s->active_loc && IS_VALID_LOC(s->active_loc)) {+                s->loc[s->active_loc].access |= ACCESS_BEEN_SEIZED;+                s->loc[locty].access = ACCESS_TPM_REG_VALID_STS;+                tis_prep_abort(s, s->active_loc, locty);+            }+        }+        if (val & ACCESS_REQUEST_USE) {+            if (IS_VALID_LOC(s->active_loc)) {+                /* locality election */+                s->loc[s->active_loc].access |= ACCESS_PENDING_REQUEST;+            } else {+                /* no locality active -> make this one active now */+                s->loc[locty].access |= ACCESS_ACTIVE_LOCALITY;+                s->active_loc = locty;+                tis_raise_irq(s, locty, INT_LOCALITY_CHANGED);+            }+        }+    } else+    if (off == TPM_REG_INT_ENABLE) {+        s->loc[locty].inte = (val & (INT_ENABLED | (0x3 << 3) |+                                     INTERRUPTS_SUPPORTED));+    } else+    if (off == TPM_REG_INT_STATUS) {+        /* clearing of interrupt flags */+        if ((val & INTERRUPTS_SUPPORTED) &&+            (s->loc[locty].ints & INTERRUPTS_SUPPORTED)) {+            s->set_irq(s->irq_opaque, s->irq, 0);+            s->irq_pending = 0;+        }+        s->loc[locty].ints &= ~(val & INTERRUPTS_SUPPORTED);+    } else+    if (off == TPM_REG_STS) {+        if (val & STS_COMMAND_READY) {+            if (s->loc[locty].state == STATE_IDLE) {+                s->loc[locty].sts   = STS_COMMAND_READY;+                s->loc[locty].state = STATE_READY;+                tis_raise_irq(s, locty, INT_COMMAND_READY);+            } else if (s->loc[locty].state == STATE_COMPLETION ||+                       s->loc[locty].state == STATE_EXECUTION  ||+                       s->loc[locty].state == STATE_RECEPTION) {+                /* abort currently running command */+                tis_prep_abort(s, locty, locty);+            }+        }+        if (val & STS_TPM_GO) {+            n = TPM_Send(s, &s->buffer, locty, "tpm_data_write");+            if (n > 0) {+                /* sending of data was successful */+                s->offset = 0;+                s->loc[locty].state = STATE_EXECUTION;+                if (s->loc[locty].inte & (INT_ENABLED | INT_DATA_AVAILABLE)) {+                    s->poll_attempts = 0;+                    tis_prep_next_interrupt(s);+                }+            }+        }+        if (val & STS_RESPONSE_RETRY) {+            s->offset = 0;+        }+    } else if (off == TPM_REG_DATA_FIFO) {+        /* data fifo */+        if (s->loc[locty].state == STATE_IDLE ||+            s->loc[locty].state == STATE_EXECUTION ||+            s->loc[locty].state == STATE_COMPLETION) {+            /* drop the byte */+        } else {+#ifdef TPM_DEBUG+        fprintf(logfile,"Byte to send to TPM: %02x\n", val);+#endif+            s->loc[locty].state = STATE_RECEPTION;++            if (s->offset < sizeof(s->buffer.buf))+                s->buffer.buf[s->offset++] = (uint8_t)val;++            if (s->offset > 5) {+                /* we have a packet length - see if we have all of it */+                len = tpm_get_size_from_buffer(s->buffer.buf);+                if (len > s->offset) {+                    s->loc[locty].sts = STS_EXPECT | STS_VALID;+                } else {+                    s->loc[locty].sts = STS_VALID;+                }+            }+        }+    }+}++/*+ * Prepare the next interrupt for example after a command has+ * been sent out for the purpose of receiving the response.+ * Depending on how many interrupts (used for polling on the fd) have+ * already been schedule, this function determines the delta in time+ * to the next interrupt. This accomodates for commands that finish+ * quickly.+ */+static void tis_prep_next_interrupt(tpmState *s)+{+    int64_t expiration;+    int rate = 5; /* 5 times per second */++    /*+       poll often at the beginning for quickly finished commands,+       then back off+     */+    if (s->poll_attempts < 5) {+        rate = 20;+    } else if (s->poll_attempts < 10) {+        rate = 10;+    }++    expiration = qemu_get_clock(vm_clock) + (ticks_per_sec / rate);+    qemu_mod_timer(s->poll_timer, expiration);+    s->poll_attempts++;+}+++/*+ * The polling routine called when the 'timer interrupt' fires.+ * Tries to receive a command from the vTPM.+ */+static void tis_poll_timer(void *opaque)+{+    tpmState* s=(tpmState*)opaque;+    uint8_t locty = s->active_loc;++    if (!IS_VALID_LOC(locty) ||+        (!(s->loc[locty].inte & INT_ENABLED) &&+          (s->aborting_locty != NO_LOCALITY)) ||+        !IS_COMM_WITH_VTPM(s)) {+        /* no more interrupts requested, so no more polling needed */+        qemu_del_timer(s->poll_timer);+    }++    if (!IS_COMM_WITH_VTPM(s)) {+        if (s->aborting_locty != NO_LOCALITY) {+            tis_abort(s);+        }+        return;+    }++    if (s->aborting_locty != NO_LOCALITY) {+        int n = TPM_Receive(s, &s->buffer);+#ifdef DEBUG_TPM+        fprintf(logfile,"Receiving for abort.\n");+#endif+        if (n > 0) {+            close_vtpm_channel(s, FORCE_CLOSE);+            tis_abort(s);+#ifdef DEBUG_TPM+            fprintf(logfile,"Abort is complete.\n");+#endif+        } else {+            tis_prep_next_interrupt(s);+        }+    } else if (IS_VALID_LOC(locty)) {+        if (s->loc[locty].state == STATE_EXECUTION) {+           /* poll for result */+            int n = TPM_Receive(s, &s->buffer);+            if (n > 0) {+                s->loc[locty].sts = STS_VALID | STS_DATA_AVAILABLE;+                s->loc[locty].state = STATE_COMPLETION;+                close_vtpm_channel(s, FORCE_CLOSE);+                tis_raise_irq(s, locty, INT_DATA_AVAILABLE);+            } else {+                /* nothing received */+                tis_prep_next_interrupt(s);+            }+        }+    }+}+++static CPUReadMemoryFunc *tis_readfn[3]={+    tis_mem_readl,+    tis_mem_readl,+    tis_mem_readl+};+

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
精品国产乱子伦一区| 免费在线观看视频一区| 五月激情六月综合| kk眼镜猥琐国模调教系列一区二区| 欧美日韩亚洲综合一区二区三区| 欧美国产乱子伦| 精品一区二区影视| 欧美精品一二三四| 亚洲蜜臀av乱码久久精品| 国产乱码精品一区二区三| 欧美日韩国产123区| 亚洲色图视频网| 国产成人日日夜夜| 久久综合久久综合亚洲| 日韩激情一二三区| 欧美男女性生活在线直播观看| 国产精品福利影院| 丁香激情综合五月| 久久先锋影音av鲁色资源| 久久成人久久爱| 91超碰这里只有精品国产| 亚洲一区二区三区四区在线观看| jiyouzz国产精品久久| 国产欧美日韩在线| 国产福利精品一区| 国产清纯白嫩初高生在线观看91| 国产伦精品一区二区三区视频青涩 | 欧美一区二区网站| 日韩精品电影在线| 制服丝袜亚洲网站| 免费在线观看日韩欧美| 欧美成人aa大片| 韩国三级在线一区| 久久综合九色综合97婷婷女人| 国产自产高清不卡| 欧美sm极限捆绑bd| 国产乱淫av一区二区三区| 久久精品夜夜夜夜久久| 国产91综合网| 亚洲精品乱码久久久久久黑人| 日本道在线观看一区二区| 亚洲综合图片区| 欧美日韩电影一区| 激情五月播播久久久精品| 国产亚洲短视频| 在线观看成人小视频| 午夜精品免费在线| 精品欧美一区二区久久| 丰满放荡岳乱妇91ww| 亚洲人成网站在线| 欧美美女bb生活片| 国产精品一二三在| 樱花影视一区二区| 91精品国产入口| 懂色av噜噜一区二区三区av| 亚洲精品中文在线影院| 欧美麻豆精品久久久久久| 国产一区二区三区久久悠悠色av| 国产精品久久久久久久久免费桃花 | 欧美日韩小视频| 久久99精品久久久久久动态图| 国产丝袜欧美中文另类| 在线免费观看视频一区| 国内外成人在线视频| 亚洲欧美日韩中文播放| 精品日产卡一卡二卡麻豆| 91小视频免费观看| 日韩精品91亚洲二区在线观看| 国产三级一区二区三区| 欧美性大战久久| 粉嫩蜜臀av国产精品网站| 午夜视频一区二区| 国产精品麻豆久久久| 欧美亚洲动漫精品| 国产成人自拍高清视频在线免费播放| 一区二区高清在线| 久久久精品国产免大香伊| 欧美在线不卡一区| 成人一区二区三区在线观看 | 一区二区不卡在线视频 午夜欧美不卡在| 欧美日韩国产综合久久| 波多野结衣的一区二区三区| 日韩1区2区3区| 美腿丝袜在线亚洲一区| 夜夜嗨av一区二区三区中文字幕| 精品国产一区二区三区久久影院 | 久久久久高清精品| 91精品国产综合久久精品app | 一区二区三区丝袜| 国产亚洲一二三区| 久久你懂得1024| 日韩免费观看高清完整版在线观看| 一本到不卡精品视频在线观看| 国产美女精品一区二区三区| 蜜桃视频在线观看一区| 偷窥少妇高潮呻吟av久久免费| 国产精品美女一区二区在线观看| 久久品道一品道久久精品| 日韩欧美国产系列| 欧美一区二区三区白人| 欧美日韩激情在线| 欧美精品乱码久久久久久| 日本二三区不卡| 91香蕉视频在线| 91免费版pro下载短视频| 成人aaaa免费全部观看| 粉嫩13p一区二区三区| 国产成人在线视频免费播放| 欧美日韩国产高清一区| 欧美亚洲一区二区在线观看| 在线观看日产精品| 91美女蜜桃在线| 色婷婷av一区二区三区大白胸| 不卡视频一二三四| 99久久99久久精品国产片果冻| 粉嫩aⅴ一区二区三区四区五区| 国产盗摄视频一区二区三区| 国产成人免费在线视频| 不卡高清视频专区| 99精品热视频| 在线视频国内一区二区| 欧美系列在线观看| 91麻豆精品国产无毒不卡在线观看| 欧美日韩不卡一区| 日韩欧美一二区| 久久精品男人的天堂| 国产精品久久久久久户外露出| 亚洲视频免费在线| 亚洲一区二区三区四区的| 日日摸夜夜添夜夜添亚洲女人| 日韩 欧美一区二区三区| 国产乱子轮精品视频| 99精品久久久久久| 欧美日韩www| 国产亚洲一区二区三区在线观看| 欧美激情艳妇裸体舞| 亚洲毛片av在线| 免费欧美在线视频| 成人免费看黄yyy456| 在线观看91视频| 久久综合视频网| 亚洲自拍另类综合| 久久99久久99精品免视看婷婷 | 大尺度一区二区| 色狠狠综合天天综合综合| 欧美高清dvd| 国产精品三级视频| 首页国产欧美日韩丝袜| 国产成人精品午夜视频免费| 在线观看av一区| 久久久久久久久久久黄色 | 国产精品免费久久| 午夜精品久久久久久久久久久 | 亚洲国产综合91精品麻豆| 蜜臀久久99精品久久久画质超高清| 丁香激情综合国产| 制服丝袜日韩国产| 综合久久久久久久| 国产精品一区二区三区99| 欧美日韩一本到| 亚洲日本va午夜在线影院| 韩国成人精品a∨在线观看| 欧美午夜在线一二页| 中文字幕+乱码+中文字幕一区| 日韩不卡手机在线v区| 北岛玲一区二区三区四区| 欧美一区二区精品在线| 亚洲综合一区在线| av在线这里只有精品| 久久午夜羞羞影院免费观看| 日韩精品亚洲一区二区三区免费| heyzo一本久久综合| 国产日产精品1区| 精品一区二区在线播放| 欧美精品一卡两卡| 亚洲一区精品在线| 99热这里都是精品| 中文字幕第一区二区| 国产精品99久久久久久有的能看| 欧美日韩高清一区二区不卡| 亚洲精品欧美激情| 91视频观看视频| 国产精品久久久久影院色老大| 国产成人综合网站| 国产清纯在线一区二区www| 国内精品在线播放| 久久综合色一综合色88| 精品一区二区三区影院在线午夜| 欧美日韩高清一区| 午夜精品久久久久久久久久久 | 欧美天堂亚洲电影院在线播放| 国产精品美女久久久久久久久久久 | 日韩久久久久久| 日本aⅴ亚洲精品中文乱码| 欧美日韩精品一区二区在线播放 | 国产精品久久三区| 成人h动漫精品一区二| 国产精品久久久久婷婷二区次 | 国产一区二区视频在线播放| 91精品国产色综合久久不卡蜜臀 |