instruction
stringclasses
1 value
output
stringclasses
2 values
input
stringlengths
21
96.3k
negative
void net_tx_pkt_build_vheader(struct NetTxPkt *pkt, bool tso_enable, bool csum_enable, uint32_t gso_size){ struct tcp_hdr l4hdr; assert(pkt); /* csum has to be enabled if tso is. */ assert(csum_enable || !tso_enable); pkt->virt_hdr.gso_type = net_tx_pkt_get_gso_type(pkt, tso_enable); switch (pkt->virt_hdr.gso_type & ~V...
negative
static void gen_mipsdsp_add_cmp_pick(DisasContext *ctx, uint32_t op1, uint32_t op2, int ret, int v1, int v2, int check_ret){ const char *opn = "mipsdsp add compare pick"; TCGv_i32 t0; TCGv t1; TCGv v1_t; TCGv v2_t; if ((ret == 0) && (check_ret == 1)) { /* Treat as NOP. */ MIPS_DEBUG("NOP"); return; } t0 = tcg_temp_new_...
negative
static inline int IRQ_testbit(IRQQueue *q, int n_IRQ){ return test_bit(q->queue, n_IRQ);}
negative
static int pic_arrays_init(HEVCContext *s){ int log2_min_cb_size = s->sps->log2_min_cb_size; int width = s->sps->width; int height = s->sps->height; int pic_size = width * height; int pic_size_in_ctb = ((width >> log2_min_cb_size) + 1) * ((height >> log2_min_cb_size) + 1); int ctb_count = s->sps->ctb_width * s->sps->ct...
negative
static void ioreq_finish(struct ioreq *ioreq){ struct XenBlkDev *blkdev = ioreq->blkdev; LIST_REMOVE(ioreq, list); LIST_INSERT_HEAD(&blkdev->finished, ioreq, list); blkdev->requests_inflight--; blkdev->requests_finished++;}
negative
static void test_qemu_strtosz_invalid(void){ const char *str; char *endptr = NULL; int64_t res; str = ""; res = qemu_strtosz(str, &endptr); g_assert_cmpint(res, ==, -EINVAL); g_assert(endptr == str); str = " \t "; res = qemu_strtosz(str, &endptr); g_assert_cmpint(res, ==, -EINVAL); g_assert(endptr == str); str = "crap"...
negative
static void virtio_gpu_handle_ctrl(VirtIODevice *vdev, VirtQueue *vq){ VirtIOGPU *g = VIRTIO_GPU(vdev); struct virtio_gpu_ctrl_command *cmd; if (!virtio_queue_ready(vq)) { return; }#ifdef CONFIG_VIRGL if (!g->renderer_inited && g->use_virgl_renderer) { virtio_gpu_virgl_init(g); g->renderer_inited = true; }#endif cmd = ...
negative
static void handle_mousemotion(DisplayState *ds, SDL_Event *ev){ int max_x, max_y; if (is_graphic_console() && (kbd_mouse_is_absolute() || absolute_enabled)) { max_x = real_screen->w - 1; max_y = real_screen->h - 1; if (gui_grab && (ev->motion.x == 0 || ev->motion.y == 0 || ev->motion.x == max_x || ev->motion.y == max_...
negative
void helper_mwait(CPUX86State *env, int next_eip_addend){ CPUState *cs; X86CPU *cpu; if ((uint32_t)env->regs[R_ECX] != 0) { raise_exception(env, EXCP0D_GPF); } cpu_svm_check_intercept_param(env, SVM_EXIT_MWAIT, 0); env->eip += next_eip_addend; cpu = x86_env_get_cpu(env); cs = CPU(cpu); /* XXX: not complete but not comp...
positive
QemuConsole *graphic_console_init(DeviceState *dev, uint32_t head, const GraphicHwOps *hw_ops, void *opaque){ Error *local_err = NULL; int width = 640; int height = 480; QemuConsole *s; DisplayState *ds; ds = get_alloc_displaystate(); trace_console_gfx_new(); s = new_console(ds, GRAPHIC_CONSOLE); s->hw_ops = hw_ops; s-...
positive
static int ram_save_setup(QEMUFile *f, void *opaque){ RAMBlock *block; int64_t ram_pages = last_ram_offset() >> TARGET_PAGE_BITS; migration_bitmap = bitmap_new(ram_pages); bitmap_set(migration_bitmap, 0, ram_pages); migration_dirty_pages = ram_pages; mig_throttle_on = false; dirty_rate_high_cnt = 0; if (migrate_use_xbz...
positive
static int xan_decode_chroma(AVCodecContext *avctx, AVPacket *avpkt){ const uint8_t *buf = avpkt->data; XanContext *s = avctx->priv_data; uint8_t *U, *V; unsigned chroma_off; int val, uval, vval; int i, j; const uint8_t *src, *src_end; const uint8_t *table; int mode, offset, dec_size; chroma_off = AV_RL32(buf + 4); if ...
positive
static int av_thread_message_queue_send_locked(AVThreadMessageQueue *mq, void *msg, unsigned flags){ while (!mq->err_send && av_fifo_space(mq->fifo) < mq->elsize) { if ((flags & AV_THREAD_MESSAGE_NONBLOCK)) return AVERROR(EAGAIN); pthread_cond_wait(&mq->cond, &mq->lock); } if (mq->err_send) return mq->err_send; av_fifo...
positive
static int rsd_probe(AVProbeData *p){ if (!memcmp(p->buf, "RSD", 3) && p->buf[3] - '0' >= 2 && p->buf[3] - '0' <= 6) return AVPROBE_SCORE_EXTENSION; return 0;}
positive
static uint64_t ntohll(uint64_t v) { union { uint32_t lv[2]; uint64_t llv; } u; u.llv = v; return ((uint64_t)ntohl(u.lv[0]) << 32) | (uint64_t) ntohl(u.lv[1]);}
positive
static av_always_inline int simple_limit(uint8_t *p, ptrdiff_t stride, int flim){ LOAD_PIXELS return 2 * FFABS(p0 - q0) + (FFABS(p1 - q1) >> 1) <= flim;}
positive
void sample_dump(int fnum, INT32 *tab, int n){ static FILE *files[16], *f; char buf[512]; f = files[fnum]; if (!f) { sprintf(buf, "/tmp/out%d.pcm", fnum); f = fopen(buf, "w"); if (!f) return; files[fnum] = f; } if (fnum == 0) { int i; static int pos = 0; printf("pos=%d\n", pos); for(i=0;i<n;i++) { printf(" %f", (double...
positive
static void mb_cpu_realizefn(DeviceState *dev, Error **errp){ MicroBlazeCPU *cpu = MICROBLAZE_CPU(dev); MicroBlazeCPUClass *mcc = MICROBLAZE_CPU_GET_CLASS(dev); cpu_reset(CPU(cpu)); mcc->parent_realize(dev, errp);}
negative
static int dxva2_create_decoder(AVCodecContext *s){ InputStream *ist = s->opaque; int loglevel = (ist->hwaccel_id == HWACCEL_AUTO) ? AV_LOG_VERBOSE : AV_LOG_ERROR; DXVA2Context *ctx = ist->hwaccel_ctx; struct dxva_context *dxva_ctx = s->hwaccel_context; GUID *guid_list = NULL; unsigned guid_count = 0, i, j; GUID device...
negative
const uint8_t *ff_h263_find_resync_marker(MpegEncContext *s, const uint8_t *av_restrict p, const uint8_t *av_restrict end){ av_assert2(p < end); end-=2; p++; if(s->resync_marker){ for(;p<end; p+=2){ if(!*p){ if (!p[-1] && p[1]) return p - 1; else if(!p[ 1] && p[2]) return p; } } } return end+2;}
negative
static int start_ebml_master_crc32(AVIOContext *pb, AVIOContext **dyn_cp, ebml_master *master, unsigned int elementid, uint64_t expectedsize){ int ret; if ((ret = avio_open_dyn_buf(dyn_cp)) < 0) return ret; if (pb->seekable) *master = start_ebml_master(pb, elementid, expectedsize); else *master = start_ebml_master(*dyn...
negative
static int decode_pic_hdr(IVI45DecContext *ctx, AVCodecContext *avctx){ int pic_size_indx, i, p; IVIPicConfig pic_conf; if (get_bits(&ctx->gb, 18) != 0x3FFF8) { av_log(avctx, AV_LOG_ERROR, "Invalid picture start code!\n"); return AVERROR_INVALIDDATA; } ctx->prev_frame_type = ctx->frame_type; ctx->frame_type = get_bits(...
negative
static void decode_finish_row(H264Context *h, H264SliceContext *sl){ int top = 16 * (h->mb_y >> FIELD_PICTURE(h)); int pic_height = 16 * h->mb_height >> FIELD_PICTURE(h); int height = 16 << FRAME_MBAFF(h); int deblock_border = (16 + 4) << FRAME_MBAFF(h); if (h->deblocking_filter) { if ((top + height) >= pic_height) hei...
negative
static inline void show_tags(WriterContext *wctx, AVDictionary *tags, int section_id){ AVDictionaryEntry *tag = NULL; if (!tags) return; writer_print_section_header(wctx, section_id); while ((tag = av_dict_get(tags, "", tag, AV_DICT_IGNORE_SUFFIX))) writer_print_string(wctx, tag->key, tag->value, 0); writer_print_secti...
negative
void qemu_spice_display_update(SimpleSpiceDisplay *ssd, int x, int y, int w, int h){ QXLRect update_area; dprint(2, "%s: x %d y %d w %d h %d\n", __FUNCTION__, x, y, w, h); update_area.left = x, update_area.right = x + w; update_area.top = y; update_area.bottom = y + h; pthread_mutex_lock(&ssd->lock); if (qemu_spice_rec...
negative
static void blk_alloc(struct XenDevice *xendev){ struct XenBlkDev *blkdev = container_of(xendev, struct XenBlkDev, xendev); LIST_INIT(&blkdev->inflight); LIST_INIT(&blkdev->finished); LIST_INIT(&blkdev->freelist); blkdev->bh = qemu_bh_new(blk_bh, blkdev); if (xen_mode != XEN_EMULATE) batch_maps = 1;}
negative
static Suite *qstring_suite(void){ Suite *s; TCase *qstring_public_tcase; s = suite_create("QString test-suite"); qstring_public_tcase = tcase_create("Public Interface"); suite_add_tcase(s, qstring_public_tcase); tcase_add_test(qstring_public_tcase, qstring_from_str_test); tcase_add_test(qstring_public_tcase, qstring_d...
negative
static inline TranslationBlock *tb_find(CPUState *cpu, TranslationBlock *last_tb, int tb_exit){ TranslationBlock *tb; target_ulong cs_base, pc; uint32_t flags; bool acquired_tb_lock = false; uint32_t cf_mask = curr_cflags(); tb = tb_lookup__cpu_state(cpu, &pc, &cs_base, &flags, cf_mask); if (tb == NULL) { /* mmap_lock ...
negative
static VncServerInfo2List *qmp_query_server_entry(QIOChannelSocket *ioc, bool websocket, int auth, int subauth, VncServerInfo2List *prev){ VncServerInfo2List *list; VncServerInfo2 *info; Error *err = NULL; SocketAddress *addr; addr = qio_channel_socket_get_local_address(ioc, &err); if (!addr) { error_free(err); return ...
negative
static void tcx_invalidate_cursor_position(TCXState *s){ int ymin, ymax, start, end; /* invalidate only near the cursor */ ymin = s->cursy; if (ymin >= s->height) { return; } ymax = MIN(s->height, ymin + 32); start = ymin * 1024; end = ymax * 1024; memory_region_set_dirty(&s->vram_mem, start, end-start);}
negative
static int pxa2xx_timer_init(SysBusDevice *dev){ int i; int iomemtype; PXA2xxTimerInfo *s; qemu_irq irq4; s = FROM_SYSBUS(PXA2xxTimerInfo, dev); s->irq_enabled = 0; s->oldclock = 0; s->clock = 0; s->lastload = qemu_get_clock(vm_clock); s->reset3 = 0; for (i = 0; i < 4; i ++) { s->timer[i].value = 0; sysbus_init_irq(dev...
negative
static void xenfb_mouse_event(void *opaque, int dx, int dy, int dz, int button_state){ struct XenInput *xenfb = opaque; DisplaySurface *surface = qemu_console_surface(xenfb->c.con); int dw = surface_width(surface); int dh = surface_height(surface); int i; trace_xenfb_mouse_event(opaque, dx, dy, dz, button_state, xenfb-...
negative
BdrvChild *bdrv_root_attach_child(BlockDriverState *child_bs, const char *child_name, const BdrvChildRole *child_role, void *opaque){ BdrvChild *child = g_new(BdrvChild, 1); *child = (BdrvChild) { .bs = NULL, .name = g_strdup(child_name), .role = child_role, .opaque = opaque, }; bdrv_replace_child(child, child_bs); ret...
negative
static av_cold int movie_common_init(AVFilterContext *ctx){ MovieContext *movie = ctx->priv; AVInputFormat *iformat = NULL; int64_t timestamp; int nb_streams, ret, i; char default_streams[16], *stream_specs, *spec, *cursor; char name[16]; AVStream *st; if (!*movie->file_name) { av_log(ctx, AV_LOG_ERROR, "No filename pr...
negative
static ssize_t proxy_llistxattr(FsContext *ctx, V9fsPath *fs_path, void *value, size_t size){ int retval; retval = v9fs_request(ctx->private, T_LLISTXATTR, value, "ds", size, fs_path); if (retval < 0) { errno = -retval; } return retval;}
negative
int qemu_paio_read(struct qemu_paiocb *aiocb){ return qemu_paio_submit(aiocb, QEMU_PAIO_READ);}
negative
static void do_io_interrupt(CPUS390XState *env){ LowCore *lowcore; IOIntQueue *q; uint8_t isc; int disable = 1; int found = 0; if (!(env->psw.mask & PSW_MASK_IO)) { cpu_abort(env, "I/O int w/o I/O mask\n"); } for (isc = 0; isc < ARRAY_SIZE(env->io_index); isc++) { if (env->io_index[isc] < 0) { continue; } if (env->io_i...
negative
static int piix3_initfn(PCIDevice *dev){ PIIX3State *d = DO_UPCAST(PIIX3State, dev, dev); uint8_t *pci_conf; isa_bus_new(&d->dev.qdev); pci_conf = d->dev.config; pci_config_set_vendor_id(pci_conf, PCI_VENDOR_ID_INTEL); pci_config_set_device_id(pci_conf, PCI_DEVICE_ID_INTEL_82371SB_0); // 82371SB PIIX3 PCI-to-ISA bridge...
negative
static bool event_notifier_poll(void *opaque){ EventNotifier *e = opaque; AioContext *ctx = container_of(e, AioContext, notifier); return atomic_read(&ctx->notified);}
negative
coroutine_fn iscsi_co_write_zeroes(BlockDriverState *bs, int64_t sector_num, int nb_sectors, BdrvRequestFlags flags){ IscsiLun *iscsilun = bs->opaque; struct IscsiTask iTask; uint64_t lba; uint32_t nb_blocks; if (!is_request_lun_aligned(sector_num, nb_sectors, iscsilun)) { return -EINVAL; } if (!(flags & BDRV_REQ_MAY_U...
negative
static size_t fd_getpagesize(int fd){#ifdef CONFIG_LINUX struct statfs fs; int ret; if (fd != -1) { do { ret = fstatfs(fd, &fs); } while (ret != 0 && errno == EINTR); if (ret == 0 && fs.f_type == HUGETLBFS_MAGIC) { return fs.f_bsize; } }#endif return getpagesize();}
negative
static void m5206_mbar_writel(void *opaque, target_phys_addr_t offset, uint32_t value){ m5206_mbar_state *s = (m5206_mbar_state *)opaque; int width; offset &= 0x3ff; if (offset >= 0x200) { hw_error("Bad MBAR write offset 0x%x", (int)offset); } width = m5206_mbar_width[offset >> 2]; if (width < 4) { m5206_mbar_writew(op...
negative
static QVirtIO9P *qvirtio_9p_pci_init(void){ QVirtIO9P *v9p; QVirtioPCIDevice *dev; v9p = g_new0(QVirtIO9P, 1); v9p->alloc = pc_alloc_init(); v9p->bus = qpci_init_pc(NULL); dev = qvirtio_pci_device_find(v9p->bus, VIRTIO_ID_9P); g_assert_nonnull(dev); g_assert_cmphex(dev->vdev.device_type, ==, VIRTIO_ID_9P); v9p->dev = ...
negative
void drive_uninit(BlockDriverState *bdrv){ DriveInfo *dinfo; TAILQ_FOREACH(dinfo, &drives, next) { if (dinfo->bdrv != bdrv) continue; qemu_opts_del(dinfo->opts); TAILQ_REMOVE(&drives, dinfo, next); qemu_free(dinfo); break; }}
negative
static void qio_dns_resolver_lookup_data_free(gpointer opaque){ struct QIODNSResolverLookupData *data = opaque; size_t i; qapi_free_SocketAddressLegacy(data->addr); for (i = 0; i < data->naddrs; i++) { qapi_free_SocketAddressLegacy(data->addrs[i]); } g_free(data->addrs); g_free(data);}
negative
static void vnc_write(VncState *vs, const void *data, size_t len){ buffer_reserve(&vs->output, len); if (buffer_empty(&vs->output)) {qemu_set_fd_handler2(vs->csock, NULL, vnc_client_read, vnc_client_write, vs); } buffer_append(&vs->output, data, len);}
negative
static void tcx_stip_writel(void *opaque, hwaddr addr, uint64_t val, unsigned size){ TCXState *s = opaque; int i; uint32_t col; if (!(addr & 4)) { s->tmpblit = val; } else { addr = (addr >> 3) & 0xfffff; col = cpu_to_be32(s->tmpblit); if (s->depth == 24) { for (i = 0; i < 32; i++) { if (val & 0x80000000) { s->vram[addr...
negative
int main(int argc, char *argv[]){ const char *sparc_machines[] = { "SPARCbook", "Voyager", "SS-20", NULL }; const char *sparc64_machines[] = { "sun4u", "sun4v", NULL }; const char *mac_machines[] = { "mac99", "g3beige", NULL }; const char *arch = qtest_get_arch(); g_test_init(&argc, &argv, NULL); if (!strcmp(arch, "ppc...
negative
ram_addr_t qemu_ram_alloc(ram_addr_t size){ RAMBlock *new_block;#ifdef CONFIG_KQEMU if (kqemu_phys_ram_base) { return kqemu_ram_alloc(size); }#endif size = TARGET_PAGE_ALIGN(size); new_block = qemu_malloc(sizeof(*new_block)); new_block->host = qemu_vmalloc(size); new_block->offset = last_ram_offset; new_block->length =...
negative
static void imx_gpt_write(void *opaque, hwaddr offset, uint64_t value, unsigned size){ IMXGPTState *s = IMX_GPT(opaque); uint32_t oldreg; uint32_t reg = offset >> 2; DPRINTF("(%s, value = 0x%08x)\n", imx_gpt_reg_name(reg), (uint32_t)value); switch (reg) { case 0: oldreg = s->cr; s->cr = value & ~0x7c14; if (s->cr & GPT...
negative
void virtio_blk_data_plane_destroy(VirtIOBlockDataPlane *s){ if (!s) { return; } virtio_blk_data_plane_stop(s); g_free(s->batch_notify_vqs); qemu_bh_delete(s->bh); object_unref(OBJECT(s->iothread)); g_free(s);}
negative
int qemu_poll_ns(GPollFD *fds, guint nfds, int64_t timeout){#ifdef CONFIG_PPOLL if (timeout < 0) { return ppoll((struct pollfd *)fds, nfds, NULL, NULL); } else { struct timespec ts; int64_t tvsec = timeout / 1000000000LL; /* Avoid possibly overflowing and specifying a negative number of * seconds, which would turn a ve...
negative
vreader_get_reader_by_name(const char *name){ VReader *reader = NULL; VReaderListEntry *current_entry = NULL; vreader_list_lock(); for (current_entry = vreader_list_get_first(vreader_list); current_entry; current_entry = vreader_list_get_next(current_entry)) { VReader *creader = vreader_list_get_reader(current_entry); ...
negative
static BlockDriverState *get_bs_snapshots(void){ BlockDriverState *bs; DriveInfo *dinfo; if (bs_snapshots) return bs_snapshots; TAILQ_FOREACH(dinfo, &drives, next) { bs = dinfo->bdrv; if (bdrv_can_snapshot(bs)) goto ok; } return NULL; ok: bs_snapshots = bs; return bs;}
negative
static void print_report(const char *op, struct timeval *t, int64_t offset, int64_t count, int64_t total, int cnt, int Cflag){ char s1[64], s2[64], ts[64]; timestr(t, ts, sizeof(ts), Cflag ? VERBOSE_FIXED_TIME : 0); if (!Cflag) { cvtstr((double)total, s1, sizeof(s1)); cvtstr(tdiv((double)total, *t), s2, sizeof(s2)); pr...
negative
static int tcp_set_msgfds(CharDriverState *chr, int *fds, int num){ TCPCharDriver *s = chr->opaque; /* clear old pending fd array */ if (s->write_msgfds) { g_free(s->write_msgfds); } if (num) { s->write_msgfds = g_malloc(num * sizeof(int)); memcpy(s->write_msgfds, fds, num * sizeof(int)); } s->write_msgfds_num = num; r...
negative
static av_always_inline int normal_limit(uint8_t *p, ptrdiff_t stride, int E, int I){ LOAD_PIXELS return simple_limit(p, stride, E) && FFABS(p3-p2) <= I && FFABS(p2-p1) <= I && FFABS(p1-p0) <= I && FFABS(q3-q2) <= I && FFABS(q2-q1) <= I && FFABS(q1-q0) <= I;}
negative
static void nvdimm_build_nfit(GSList *device_list, GArray *table_offsets, GArray *table_data, GArray *linker){ GArray *structures = nvdimm_build_device_structure(device_list); unsigned int header; acpi_add_table(table_offsets, table_data); /* NFIT header. */ header = table_data->len; acpi_data_push(table_data, sizeof(N...
negative
long disas_insn(DisasContext *s, uint8_t *pc_start){ int b, prefixes, aflag, dflag; int shift, ot; int modrm, reg, rm, mod, reg_addr, op, opreg, offset_addr, val; unsigned int next_eip; s->pc = pc_start; prefixes = 0; aflag = s->code32; dflag = s->code32; // cur_pc = s->pc; /* for insn generation */ next_byte: b = ldub...
negative
static void pci_mmio_map(PCIDevice * pci_dev, int region_num, uint32_t addr, uint32_t size, int type){ PCIEEPRO100State *d = DO_UPCAST(PCIEEPRO100State, dev, pci_dev); logout("region %d, addr=0x%08x, size=0x%08x, type=%d\n", region_num, addr, size, type); if (region_num == 0) { /* Map control / status registers. */ cpu...
negative
uint32_t ldl_le_phys(target_phys_addr_t addr){ return ldl_phys_internal(addr, DEVICE_LITTLE_ENDIAN);}
negative
static void ivshmem_check_memdev_is_busy(const Object *obj, const char *name, Object *val, Error **errp){ if (host_memory_backend_is_mapped(MEMORY_BACKEND(val))) { char *path = object_get_canonical_path_component(val); error_setg(errp, "can't use already busy memdev: %s", path); g_free(path); } else { qdev_prop_allow_s...
negative
static int connect_to_ssh(BDRVSSHState *s, QDict *options, int ssh_flags, int creat_mode){ int r, ret; Error *err = NULL; const char *host, *user, *path, *host_key_check; int port; host = qdict_get_str(options, "host"); if (qdict_haskey(options, "port")) { port = qdict_get_int(options, "port"); } else { port = 22; } pa...
negative
int kvm_irqchip_add_irq_notifier(KVMState *s, EventNotifier *n, int virq){ return -ENOSYS;}
negative
static void gen_st_asi(DisasContext *dc, TCGv src, TCGv addr, int insn, int size){ TCGv_i32 r_asi, r_size; r_asi = gen_get_asi(dc, insn); r_size = tcg_const_i32(size);#ifdef TARGET_SPARC64 gen_helper_st_asi(cpu_env, addr, src, r_asi, r_size);#else { TCGv_i64 t64 = tcg_temp_new_i64(); tcg_gen_extu_tl_i64(t64, src); gen_...
negative
static double tget_double(const uint8_t **p, int le){ av_alias64 i = { .u64 = le ? AV_RL64(*p) : AV_RB64(*p)}; *p += 8; return i.f64;}
negative
void empty_slot_init(target_phys_addr_t addr, uint64_t slot_size){ if (slot_size > 0) { /* Only empty slots larger than 0 byte need handling. */ DeviceState *dev; SysBusDevice *s; EmptySlot *e; dev = qdev_create(NULL, "empty_slot"); s = sysbus_from_qdev(dev); e = FROM_SYSBUS(EmptySlot, s); e->size = slot_size; qdev_ini...
negative
build_fadt(GArray *table_data, BIOSLinker *linker, unsigned dsdt){ AcpiFadtDescriptorRev5_1 *fadt = acpi_data_push(table_data, sizeof(*fadt)); /* Hardware Reduced = 1 and use PSCI 0.2+ and with HVC */ fadt->flags = cpu_to_le32(1 << ACPI_FADT_F_HW_REDUCED_ACPI); fadt->arm_boot_flags = cpu_to_le16((1 << ACPI_FADT_ARM_USE...
negative
void apic_enable_vapic(DeviceState *d, target_phys_addr_t paddr){ APICCommonState *s = DO_UPCAST(APICCommonState, busdev.qdev, d); APICCommonClass *info = APIC_COMMON_GET_CLASS(s); s->vapic_paddr = paddr; info->vapic_base_update(s);}
negative
void qmp_blockdev_snapshot_internal_sync(const char *device, const char *name, Error **errp){ BlockdevSnapshotInternal snapshot = { .device = (char *) device, .name = (char *) name }; TransactionAction action = { .type = TRANSACTION_ACTION_KIND_BLOCKDEV_SNAPSHOT_INTERNAL_SYNC, .u.blockdev_snapshot_internal_sync = &snap...
negative
void nvdimm_acpi_hotplug(AcpiNVDIMMState *state){ nvdimm_build_fit_buffer(&state->fit_buf);}
negative
int ppc_radix64_handle_mmu_fault(PowerPCCPU *cpu, vaddr eaddr, int rwx, int mmu_idx){ CPUState *cs = CPU(cpu); CPUPPCState *env = &cpu->env; PPCVirtualHypervisorClass *vhc = PPC_VIRTUAL_HYPERVISOR_GET_CLASS(cpu->vhyp); hwaddr raddr, pte_addr; uint64_t lpid = 0, pid = 0, offset, size, patbe, prtbe0, pte; int page_size, ...
positive
static inline void dxt1_decode_pixels(const uint8_t *s, uint32_t *d, unsigned int qstride, unsigned int flag, uint64_t alpha) { unsigned int x, y, c0, c1, a = (!flag * 255u) << 24; unsigned int rb0, rb1, rb2, rb3, g0, g1, g2, g3; uint32_t colors[4], pixels; c0 = AV_RL16(s); c1 = AV_RL16(s+2); rb0 = (c0<<3 | c0<<8) & 0x...
positive
int cpu_restore_state(TranslationBlock *tb, CPUState *env, unsigned long searched_pc, void *puc){ TCGContext *s = &tcg_ctx; int j; unsigned long tc_ptr;#ifdef CONFIG_PROFILER int64_t ti;#endif#ifdef CONFIG_PROFILER ti = profile_getclock();#endif tcg_func_start(s); if (gen_intermediate_code_pc(env, tb) < 0) return -1; /...
positive
void h263_encode_picture_header(MpegEncContext * s, int picture_number){ int format; align_put_bits(&s->pb); put_bits(&s->pb, 22, 0x20); put_bits(&s->pb, 8, ((s->picture_number * 30 * FRAME_RATE_BASE) / s->frame_rate) & 0xff); put_bits(&s->pb, 1, 1);/* marker */ put_bits(&s->pb, 1, 0);/* h263 id */ put_bits(&s->pb, 1, ...
positive
_net_rx_pkt_calc_l4_csum(struct NetRxPkt *pkt){ uint32_t cntr; uint16_t csum; uint16_t csl; uint32_t cso; trace_net_rx_pkt_l4_csum_calc_entry(); if (pkt->isip4) { if (pkt->isudp) { csl = be16_to_cpu(pkt->l4hdr_info.hdr.udp.uh_ulen); trace_net_rx_pkt_l4_csum_calc_ip4_udp(); } else { csl = be16_to_cpu(pkt->ip4hdr_info.ip...
positive
int xen_hvm_init(ram_addr_t *below_4g_mem_size, ram_addr_t *above_4g_mem_size, MemoryRegion **ram_memory){ int i, rc; unsigned long ioreq_pfn; unsigned long bufioreq_evtchn; XenIOState *state; state = g_malloc0(sizeof (XenIOState)); state->xce_handle = xen_xc_evtchn_open(NULL, 0); if (state->xce_handle == XC_HANDLER_IN...
positive
static void yop_paint_block(YopDecContext *s, int tag){ s->dstptr[0] = s->srcptr[0]; s->dstptr[1] = s->srcptr[paint_lut[tag][0]]; s->dstptr[s->frame.linesize[0]] = s->srcptr[paint_lut[tag][1]]; s->dstptr[s->frame.linesize[0] + 1] = s->srcptr[paint_lut[tag][2]]; // The number of src bytes consumed is in the last part of...
positive
av_cold int ff_rv34_decode_init(AVCodecContext *avctx){ RV34DecContext *r = avctx->priv_data; MpegEncContext *s = &r->s; int ret; ff_MPV_decode_defaults(s); s->avctx = avctx; s->out_format = FMT_H263; s->codec_id = avctx->codec_id; s->width = avctx->width; s->height = avctx->height; r->s.avctx = avctx; avctx->flags |= ...
positive
static int flic_decode_frame_24BPP(AVCodecContext *avctx, void *data, int *got_frame, const uint8_t *buf, int buf_size){ FlicDecodeContext *s = avctx->priv_data; GetByteContext g2; int pixel_ptr; unsigned char palette_idx1; unsigned int frame_size; int num_chunks; unsigned int chunk_size; int chunk_type; int i, j, ret;...
positive
static int h264_mp4toannexb_filter(AVBitStreamFilterContext *bsfc, AVCodecContext *avctx, const char *args, uint8_t **poutbuf, int *poutbuf_size, const uint8_t *buf, int buf_size, int keyframe) { H264BSFContext *ctx = bsfc->priv_data; uint8_t unit_type; int32_t nal_size; uint32_t cumul_size = 0; const uint8_t *buf_end ...
negative
static void dchip_write(void *opaque, target_phys_addr_t addr, uint64_t val, unsigned size){ /* Skip this. It's all related to DRAM timing and setup. */}
negative
qemu_irq get_cps_irq(MIPSCPSState *s, int pin_number){ MIPSCPU *cpu = MIPS_CPU(first_cpu); CPUMIPSState *env = &cpu->env; assert(pin_number < s->num_irq); /* TODO: return GIC pins once implemented */ return env->irq[pin_number];}
negative
static int tcp_chr_write(CharDriverState *chr, const uint8_t *buf, int len){ TCPCharDriver *s = chr->opaque; if (s->connected) { return send_all(s->fd, buf, len); } else { /* (Re-)connect for unconnected writing */ tcp_chr_connect(chr); return 0; }}
negative
static int img_create(int argc, char **argv){ int c, ret, flags; const char *fmt = "raw"; const char *base_fmt = NULL; const char *filename; const char *base_filename = NULL; BlockDriver *drv; QEMUOptionParameter *param = NULL; char *options = NULL; flags = 0; for(;;) { c = getopt(argc, argv, "F:b:f:he6o:"); if (c == -...
negative
static int fill_filter_caches(H264Context *h, int mb_type){ MpegEncContext * const s = &h->s; const int mb_xy= h->mb_xy; int top_xy, left_xy[2]; int top_type, left_type[2]; top_xy = mb_xy - (s->mb_stride << MB_FIELD); //FIXME deblocking could skip the intra and nnz parts. /* Wow, what a mess, why didn't they simplify t...
negative
static void test_visitor_in_list(TestInputVisitorData *data, const void *unused){ UserDefOneList *item, *head = NULL; Error *err = NULL; Visitor *v; int i; v = visitor_input_test_init(data, "[ { 'string': 'string0', 'integer': 42 }, { 'string': 'string1', 'integer': 43 }, { 'string': 'string2', 'integer': 44 } ]"); vis...
negative
static inline void tcg_out_ext8u(TCGContext *s, int dest, int src){ /* movzbl */ assert(src < 4 || TCG_TARGET_REG_BITS == 64); tcg_out_modrm(s, OPC_MOVZBL + P_REXB_RM, dest, src);}
negative
static int cpu_post_load(void *opaque, int version_id){ ARMCPU *cpu = opaque; int i, v; /* Update the values list from the incoming migration data. * Anything in the incoming data which we don't know about is * a migration failure; anything we know about but the incoming * data doesn't specify retains its current (rese...
negative
static void vhost_virtqueue_stop(struct vhost_dev *dev, struct VirtIODevice *vdev, struct vhost_virtqueue *vq, unsigned idx){ int vhost_vq_index = dev->vhost_ops->vhost_get_vq_index(dev, idx); struct vhost_vring_state state = { .index = vhost_vq_index, }; int r; r = dev->vhost_ops->vhost_get_vring_base(dev, &state); if...
negative
static void pci_map(PCIDevice * pci_dev, int region_num, uint32_t addr, uint32_t size, int type){ PCIEEPRO100State *d = DO_UPCAST(PCIEEPRO100State, dev, pci_dev); EEPRO100State *s = &d->eepro100; logout("region %d, addr=0x%08x, size=0x%08x, type=%d\n", region_num, addr, size, type); assert(region_num == 1); register_io...
negative
static void host_signal_handler(int host_signum, siginfo_t *info, void *puc){ int sig; target_siginfo_t tinfo; /* the CPU emulator uses some host signals to detect exceptions, we forward to it some signals */ if ((host_signum == SIGSEGV || host_signum == SIGBUS) && info->si_code > 0) { if (cpu_signal_handler(host_signu...
negative
static char *scsibus_get_fw_dev_path(DeviceState *dev){ SCSIDevice *d = SCSI_DEVICE(dev); char path[100]; snprintf(path, sizeof(path), "channel@%x/%s@%x,%x", d->channel, qdev_fw_name(dev), d->id, d->lun); return strdup(path);}
negative
static void lsi_do_command(LSIState *s){ SCSIDevice *dev; uint8_t buf[16]; uint32_t id; int n; DPRINTF("Send command len=%d\n", s->dbc); if (s->dbc > 16) s->dbc = 16; cpu_physical_memory_read(s->dnad, buf, s->dbc); s->sfbr = buf[0]; s->command_complete = 0; id = (s->select_tag >> 8) & 0xf; dev = s->bus.devs[id]; if (!d...
negative
void ioinst_handle_chsc(S390CPU *cpu, uint32_t ipb){ ChscReq *req; ChscResp *res; uint64_t addr; int reg; uint16_t len; uint16_t command; CPUS390XState *env = &cpu->env; uint8_t buf[TARGET_PAGE_SIZE]; trace_ioinst("chsc"); reg = (ipb >> 20) & 0x00f; addr = env->regs[reg]; /* Page boundary? */ if (addr & 0xfff) { progra...
negative
static int ff_estimate_motion_b(MpegEncContext * s, int mb_x, int mb_y, int16_t (*mv_table)[2], Picture *picture, int f_code){ int mx, my, range, dmin; int xmin, ymin, xmax, ymax; int rel_xmin, rel_ymin, rel_xmax, rel_ymax; int pred_x=0, pred_y=0; int P[10][2]; const int shift= 1+s->quarter_sample; const int mot_stride...
negative
int inet_connect_opts(QemuOpts *opts, Error **errp, NonBlockingConnectHandler *callback, void *opaque){ struct addrinfo *res, *e; int sock = -1; bool in_progress; ConnectState *connect_state = NULL; res = inet_parse_connect_opts(opts, errp); if (!res) { return -1; } if (callback != NULL) { connect_state = g_malloc0(siz...
negative
static void channel_run(DBDMA_channel *ch){ dbdma_cmd *current = &ch->current; uint16_t cmd, key; uint16_t req_count; uint32_t phy_addr; DBDMA_DPRINTF("channel_run\n"); dump_dbdma_cmd(current); /* clear WAKE flag at command fetch */ ch->regs[DBDMA_STATUS] &= cpu_to_be32(~WAKE); cmd = le16_to_cpu(current->command) & COM...
negative
static void error(const char *fmt, ...){ va_list ap; va_start(ap, fmt); fprintf(stderr, "qemu-img: "); vfprintf(stderr, fmt, ap); fprintf(stderr, "\n"); va_end(ap);}
negative
void aio_set_fd_handler(AioContext *ctx, int fd, IOHandler *io_read, IOHandler *io_write, void *opaque){ /* fd is a SOCKET in our case */ AioHandler *node; QLIST_FOREACH(node, &ctx->aio_handlers, node) { if (node->pfd.fd == fd && !node->deleted) { break; } } /* Are we deleting the fd handler? */ if (!io_read && !io_wri...