instruction stringclasses 1
value | output stringclasses 2
values | input stringlengths 21 96.3k |
|---|---|---|
positive | static void do_dcbz(CPUPPCState *env, target_ulong addr, int dcache_line_size, uintptr_t raddr){ int i; addr &= ~(dcache_line_size - 1); for (i = 0; i < dcache_line_size; i += 4) { cpu_stl_data_ra(env, addr + i, 0, raddr); } if (env->reserve_addr == addr) { env->reserve_addr = (target_ulong)-1ULL; }} | |
positive | static int32_t ide_nop_int32(IDEDMA *dma, int x){ return 0;} | |
positive | static int read_password(char *buf, int buf_size){ int c, i; printf("Password: "); fflush(stdout); i = 0; for(;;) { c = getchar(); if (c == '\n') break; if (i < (buf_size - 1)) buf[i++] = c; } buf[i] = '\0'; return 0;} | |
positive | long do_rt_sigreturn(CPUARMState *env){ struct target_rt_sigframe *frame; abi_ulong frame_addr = env->xregs[31]; if (frame_addr & 15) { goto badframe; } if (!lock_user_struct(VERIFY_READ, frame, frame_addr, 1)) { goto badframe; } if (target_restore_sigframe(env, frame)) { goto badframe; } if (do_sigaltstack(frame_addr ... | |
positive | tcp_sockclosed(struct tcpcb *tp){DEBUG_CALL("tcp_sockclosed");DEBUG_ARG("tp = %p", tp);switch (tp->t_state) {case TCPS_CLOSED:case TCPS_LISTEN:case TCPS_SYN_SENT:tp->t_state = TCPS_CLOSED;tp = tcp_close(tp);break;case TCPS_SYN_RECEIVED:case TCPS_ESTABLISHED:tp->t_state = TCPS_FIN_WAIT_1;break;case TCPS_CLOSE_WAIT:tp->t... | |
positive | static void icp_pit_write(void *opaque, target_phys_addr_t offset, uint64_t value, unsigned size){ icp_pit_state *s = (icp_pit_state *)opaque; int n; n = offset >> 8; if (n > 3) { hw_error("sp804_write: Bad timer %d\n", n); } arm_timer_write(s->timer[n], offset & 0xff, value);} | |
positive | static int exynos4210_combiner_init(SysBusDevice *sbd){ DeviceState *dev = DEVICE(sbd); Exynos4210CombinerState *s = EXYNOS4210_COMBINER(dev); unsigned int i; /* Allocate general purpose input signals and connect a handler to each of * them */ qdev_init_gpio_in(dev, exynos4210_combiner_handler, IIC_NIRQ); /* Connect Sy... | |
negative | static uint32_t calc_optimal_rice_params(RiceContext *rc, int porder, uint32_t *sums, int n, int pred_order){ int i; int k, cnt, part; uint32_t all_bits; part = (1 << porder); all_bits = 0; cnt = (n >> porder) - pred_order; for(i=0; i<part; i++) { if(i == 1) cnt = (n >> porder); k = find_optimal_param(sums[i], cnt); rc... | |
negative | static void raw_decode(uint8_t *dst, const int8_t *src, int src_size){ while (src_size--) *dst++ = *src++ + 128;} | |
negative | static int dxtory_decode_v1_410(AVCodecContext *avctx, AVFrame *pic, const uint8_t *src, int src_size){ int h, w; uint8_t *Y1, *Y2, *Y3, *Y4, *U, *V; int ret; if (src_size < avctx->width * avctx->height * 9LL / 8) { av_log(avctx, AV_LOG_ERROR, "packet too small\n"); return AVERROR_INVALIDDATA; } avctx->pix_fmt = AV_PIX... | |
positive | static int ff_filter_frame_framed(AVFilterLink *link, AVFilterBufferRef *frame){ int (*filter_frame)(AVFilterLink *, AVFilterBufferRef *); AVFilterPad *src = link->srcpad; AVFilterPad *dst = link->dstpad; AVFilterBufferRef *out; int perms, ret; AVFilterCommand *cmd= link->dst->command_queue; int64_t pts; if (link->clos... | |
positive | void bdrv_get_backing_filename(BlockDriverState *bs, char *filename, int filename_size){ if (!bs->backing_hd) { pstrcpy(filename, filename_size, ""); } else { pstrcpy(filename, filename_size, bs->backing_file); }} | |
positive | static uint32_t e1000e_macreg_read(e1000e_device *d, uint32_t reg){ return qpci_io_readl(d->pci_dev, d->mac_regs + reg);} | |
positive | static inline void direct_ref_list_init(H264Context * const h){ MpegEncContext * const s = &h->s; Picture * const ref1 = &h->ref_list[1][0]; Picture * const cur = s->current_picture_ptr; int list, i, j; if(cur->pict_type == I_TYPE) cur->ref_count[0] = 0; if(cur->pict_type != B_TYPE) cur->ref_count[1] = 0; for(list=0; l... | |
positive | static void encode_rgb48_10bit(AVCodecContext *avctx, const AVPicture *pic, uint8_t *dst){ DPXContext *s = avctx->priv_data; const uint8_t *src = pic->data[0]; int x, y; for (y = 0; y < avctx->height; y++) { for (x = 0; x < avctx->width; x++) { int value; if (s->big_endian) { value = ((AV_RB16(src + 6*x + 4) & 0xFFC0) ... | |
positive | static int tgv_decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPacket *avpkt){ const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; TgvContext *s = avctx->priv_data; const uint8_t *buf_end = buf + buf_size; int chunk_type; if (buf_end - buf < EA_PREAMBLE_SIZE) return AVERROR_INVALIDDATA; chun... | |
positive | static void adjust_frame_information(ChannelElement *cpe, int chans){ int i, w, w2, g, ch; int start, maxsfb, cmaxsfb; for (ch = 0; ch < chans; ch++) { IndividualChannelStream *ics = &cpe->ch[ch].ics; start = 0; maxsfb = 0; cpe->ch[ch].pulse.num_pulse = 0; for (w = 0; w < ics->num_windows*16; w += 16) { for (g = 0; g <... | |
positive | int ff_img_read_header(AVFormatContext *s1){ VideoDemuxData *s = s1->priv_data; int first_index, last_index; AVStream *st; enum AVPixelFormat pix_fmt = AV_PIX_FMT_NONE; s1->ctx_flags |= AVFMTCTX_NOHEADER; st = avformat_new_stream(s1, NULL); if (!st) { return AVERROR(ENOMEM); } if (s->pixel_format && (pix_fmt = av_get_p... | |
positive | static void hpet_ram_write(void *opaque, hwaddr addr, uint64_t value, unsigned size){ int i; HPETState *s = opaque; uint64_t old_val, new_val, val, index; DPRINTF("qemu: Enter hpet_ram_writel at %" PRIx64 " = %#x\n", addr, value); index = addr; old_val = hpet_ram_read(opaque, addr, 4); new_val = value; /*address range ... | |
positive | static abi_ulong copy_elf_strings(int argc,char ** argv, void **page, abi_ulong p){ char *tmp, *tmp1, *pag = NULL; int len, offset = 0; if (!p) { return 0; /* bullet-proofing */ } while (argc-- > 0) { tmp = argv[argc]; if (!tmp) { fprintf(stderr, "VFS: argc is wrong"); exit(-1); } tmp1 = tmp; while (*tmp++); len = tmp ... | |
positive | static int mov_text_decode_close(AVCodecContext *avctx){ MovTextContext *m = avctx->priv_data; mov_text_cleanup_ftab(m); return 0;} | |
positive | static void xhci_intr_raise(XHCIState *xhci, int v){ PCIDevice *pci_dev = PCI_DEVICE(xhci); xhci->intr[v].erdp_low |= ERDP_EHB; xhci->intr[v].iman |= IMAN_IP; xhci->usbsts |= USBSTS_EINT; if (!(xhci->intr[v].iman & IMAN_IE)) { if (!(xhci->usbcmd & USBCMD_INTE)) { if (msix_enabled(pci_dev)) { trace_usb_xhci_irq_msix(v);... | |
positive | int qemu_chr_fe_get_msgfd(CharDriverState *s){ int fd; return (qemu_chr_fe_get_msgfds(s, &fd, 1) >= 0) ? fd : -1;} | |
positive | void qemu_set_dfilter_ranges(const char *filter_spec){ gchar **ranges = g_strsplit(filter_spec, ",", 0); if (ranges) { gchar **next = ranges; gchar *r = *next++; debug_regions = g_array_sized_new(FALSE, FALSE, sizeof(Range), g_strv_length(ranges)); while (r) { char *range_op = strstr(r, "-"); char *r2 = range_op ? rang... | |
positive | static void flush(AVCodecContext *avctx){ WmallDecodeCtx *s = avctx->priv_data; s->packet_loss = 1; s->packet_done = 0; s->num_saved_bits = 0; s->frame_offset = 0; s->next_packet_start = 0; s->cdlms[0][0].order = 0; s->frame.nb_samples = 0; init_put_bits(&s->pb, s->frame_data, MAX_FRAMESIZE);} | |
positive | avs_decode_frame(AVCodecContext * avctx, void *data, int *data_size, AVPacket *avpkt){ const uint8_t *buf = avpkt->data; const uint8_t *buf_end = avpkt->data + avpkt->size; int buf_size = avpkt->size; AvsContext *const avs = avctx->priv_data; AVFrame *picture = data; AVFrame *const p = &avs->picture; const uint8_t *tab... | |
positive | static void uc32_cpu_realizefn(DeviceState *dev, Error **errp){ UniCore32CPUClass *ucc = UNICORE32_CPU_GET_CLASS(dev); ucc->parent_realize(dev, errp);} | |
positive | void parse_option_size(const char *name, const char *value, uint64_t *ret, Error **errp){ char *postfix; double sizef; sizef = strtod(value, &postfix); if (sizef < 0 || sizef > UINT64_MAX) { error_setg(errp, QERR_INVALID_PARAMETER_VALUE, name, "a non-negative number below 2^64"); return; } switch (*postfix) { case 'T':... | |
positive | static void gen_ove_cy(DisasContext *dc, TCGv cy){ if (dc->tb_flags & SR_OVE) { gen_helper_ove(cpu_env, cy); }} | |
positive | static void limits_nesting(void){ enum { max_nesting = 1024 }; /* see qobject/json-streamer.c */ char buf[2 * (max_nesting + 1) + 1]; QObject *obj; obj = qobject_from_json(make_nest(buf, max_nesting), NULL); g_assert(obj != NULL); qobject_decref(obj); obj = qobject_from_json(make_nest(buf, max_nesting + 1), NULL); g_as... | |
positive | static int decode_end(AVCodecContext *avctx){ H264Context *h = avctx->priv_data; MpegEncContext *s = &h->s; free_tables(h); //FIXME cleanup init stuff perhaps MPV_common_end(s);// memset(h, 0, sizeof(H264Context)); return 0;} | |
negative | static av_cold int validate_options(AVCodecContext *avctx, AC3EncodeContext *s){ int i, j; if (!avctx->channel_layout) { av_log(avctx, AV_LOG_WARNING, "No channel layout specified. The " "encoder will guess the layout, but it " "might be incorrect.\n"); } if (set_channel_info(s, avctx->channels, &avctx->channel_layout)... | |
negative | static NvencSurface *get_free_frame(NvencContext *ctx){ int i; for (i = 0; i < ctx->nb_surfaces; i++) { if (!ctx->surfaces[i].lockCount) { ctx->surfaces[i].lockCount = 1; return &ctx->surfaces[i]; } } return NULL;} | |
negative | int ff_ccitt_unpack(AVCodecContext *avctx, const uint8_t *src, int srcsize, uint8_t *dst, int height, int stride, enum TiffCompr compr, int opts){ int j; GetBitContext gb; int *runs, *ref, *runend; int ret; int runsize= avctx->width + 2; runs = av_malloc(runsize * sizeof(runs[0])); ref = av_malloc(runsize * sizeof(ref[... | |
negative | static int exif_decode_tag(void *logctx, GetByteContext *gbytes, int le, int depth, AVDictionary **metadata){ int ret, cur_pos; unsigned id, count; enum TiffTypes type; if (depth > 2) { return 0; } ff_tread_tag(gbytes, le, &id, &type, &count, &cur_pos); if (!bytestream2_tell(gbytes)) { bytestream2_seek(gbytes, cur_pos,... | |
positive | static int pci_bridge_dev_initfn(PCIDevice *dev){ PCIBridge *br = DO_UPCAST(PCIBridge, dev, dev); PCIBridgeDev *bridge_dev = DO_UPCAST(PCIBridgeDev, bridge, br); int err; pci_bridge_map_irq(br, NULL, pci_bridge_dev_map_irq_fn); err = pci_bridge_initfn(dev); if (err) { goto bridge_error; } memory_region_init(&bridge_dev... | |
negative | static const AVClass *urlcontext_child_class_next(const AVClass *prev){ URLProtocol *p = NULL; /* find the protocol that corresponds to prev */ while (prev && (p = ffurl_protocol_next(p))) if (p->priv_data_class == prev) break; /* find next protocol with priv options */ while (p = ffurl_protocol_next(p)) if (p->priv_da... | |
positive | static void do_change_vnc(const char *target){ if (strcmp(target, "passwd") == 0 ||strcmp(target, "password") == 0) {char password[9];monitor_readline("Password: ", 1, password, sizeof(password)-1);password[sizeof(password)-1] = '\0';if (vnc_display_password(NULL, password) < 0) term_printf("could not set VNC server pa... | |
positive | int ff_get_cpu_flags_x86(void){ int rval = 0; int eax, ebx, ecx, edx; int max_std_level, max_ext_level, std_caps=0, ext_caps=0; int family=0, model=0; union { int i[3]; char c[12]; } vendor;#if ARCH_X86_32 x86_reg a, c; __asm__ volatile ( /* See if CPUID instruction is supported ... */ /* ... Get copies of EFLAGS into ... | |
positive | static inline void cvtyuvtoRGB (SwsContext *c, vector signed short Y, vector signed short U, vector signed short V, vector signed short *R, vector signed short *G, vector signed short *B){ vector signed short vx,ux,uvx; Y = vec_mradds (Y, c->CY, c->OY); U = vec_sub (U,(vector signed short) vec_splat((vector signed shor... | |
positive | void usb_generic_async_ctrl_complete(USBDevice *s, USBPacket *p){ if (p->len < 0) { s->setup_state = SETUP_STATE_IDLE; } switch (s->setup_state) { case SETUP_STATE_SETUP: if (p->len < s->setup_len) { s->setup_len = p->len; } s->setup_state = SETUP_STATE_DATA; p->len = 8; break; case SETUP_STATE_ACK: s->setup_state = SE... | |
positive | static int encode_audio_frame(AVFormatContext *s, OutputStream *ost, const uint8_t *buf, int buf_size){ AVCodecContext *enc = ost->st->codec; AVFrame *frame = NULL; AVPacket pkt; int ret, got_packet; av_init_packet(&pkt); pkt.data = NULL; pkt.size = 0; if (buf && buf_size) { if (!ost->output_frame) { ost->output_frame ... | |
positive | static void rng_egd_opened(RngBackend *b, Error **errp){ RngEgd *s = RNG_EGD(b); if (s->chr_name == NULL) { error_set(errp, QERR_INVALID_PARAMETER_VALUE, "chardev", "a valid character device"); s->chr = qemu_chr_find(s->chr_name); if (s->chr == NULL) { error_set(errp, QERR_DEVICE_NOT_FOUND, s->chr_name); /* FIXME we sh... | |
negative | static int64_t mpegts_get_pcr(AVFormatContext *s, int stream_index, int64_t *ppos, int64_t pos_limit){ MpegTSContext *ts = s->priv_data; int64_t pos, timestamp; uint8_t buf[TS_PACKET_SIZE]; int pcr_l, pcr_pid = ((PESContext*)s->streams[stream_index]->priv_data)->pcr_pid; pos = ((*ppos + ts->raw_packet_size - 1 - ts->po... | |
negative | static enum AVPixelFormat get_pixel_format(H264Context *h){#define HWACCEL_MAX (CONFIG_H264_DXVA2_HWACCEL + \ CONFIG_H264_D3D11VA_HWACCEL + \ CONFIG_H264_VAAPI_HWACCEL + \ (CONFIG_H264_VDA_HWACCEL * 2) + \ CONFIG_H264_VDPAU_HWACCEL) enum AVPixelFormat pix_fmts[HWACCEL_MAX + 2], *fmt = pix_fmts; const enum AVPixelFormat... | |
positive | static void mv88w8618_eth_init(NICInfo *nd, uint32_t base, qemu_irq irq){ mv88w8618_eth_state *s; int iomemtype; qemu_check_nic_model(nd, "mv88w8618"); s = qemu_mallocz(sizeof(mv88w8618_eth_state)); s->irq = irq; s->vc = qemu_new_vlan_client(nd->vlan, nd->model, nd->name, eth_receive, eth_can_receive, s); iomemtype = c... | |
positive | static int vnc_update_client_sync(VncState *vs, int has_dirty){ int ret = vnc_update_client(vs, has_dirty); vnc_jobs_join(vs); return ret;} | |
positive | static struct omap_tipb_bridge_s *omap_tipb_bridge_init( MemoryRegion *memory, hwaddr base, qemu_irq abort_irq, omap_clk clk){ struct omap_tipb_bridge_s *s = (struct omap_tipb_bridge_s *) g_malloc0(sizeof(struct omap_tipb_bridge_s)); s->abort = abort_irq; omap_tipb_bridge_reset(s); memory_region_init_io(&s->iomem, NULL... | |
positive | static void seqvideo_decode(SeqVideoContext *seq, const unsigned char *data, int data_size){ GetBitContext gb; int flags, i, j, x, y, op; unsigned char c[3]; unsigned char *dst; uint32_t *palette; flags = *data++; if (flags & 1) { palette = (uint32_t *)seq->frame.data[1]; for (i = 0; i < 256; i++) { for (j = 0; j < 3; ... | |
positive | static int get_video_buffer(AVFrame *frame, int align){ const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(frame->format); int ret, i; if (!desc) return AVERROR(EINVAL); if ((ret = av_image_check_size(frame->width, frame->height, 0, NULL)) < 0) return ret; if (!frame->linesize[0]) { ret = av_image_fill_linesizes(fram... | |
negative | static int build_table(VLC *vlc, int table_nb_bits, int nb_codes, VLCcode *codes, int flags){ int table_size, table_index, index, code_prefix, symbol, subtable_bits; int i, j, k, n, nb, inc; uint32_t code; VLC_TYPE (*table)[2]; table_size = 1 << table_nb_bits; if (table_nb_bits > 30) return -1; table_index = alloc_tabl... | |
negative | static void h264_h_loop_filter_luma_intra_c(uint8_t *pix, int stride, int alpha, int beta){ h264_loop_filter_luma_intra_c(pix, 1, stride, alpha, beta);} | |
negative | static inline void do_imdct(AC3DecodeContext *s, int channels){ int ch; for (ch=1; ch<=channels; ch++) { if (s->block_switch[ch]) { int i; float *x = s->tmp_output+128; for(i=0; i<128; i++) x[i] = s->transform_coeffs[ch][2*i]; ff_imdct_half(&s->imdct_256, s->tmp_output, x); s->dsp.vector_fmul_window(s->output[ch-1], s-... | |
positive | static void parse_header_digest(struct iscsi_context *iscsi, const char *target){ QemuOptsList *list; QemuOpts *opts; const char *digest = NULL; list = qemu_find_opts("iscsi"); if (!list) { return; } opts = qemu_opts_find(list, target); if (opts == NULL) { opts = QTAILQ_FIRST(&list->head); if (!opts) { return; } } dige... | |
positive | void visit_type_str(Visitor *v, char **obj, const char *name, Error **errp){ if (!error_is_set(errp)) { v->type_str(v, obj, name, errp); }} | |
positive | static int http_send_data(HTTPContext *c){ int len, ret; while (c->buffer_ptr >= c->buffer_end) { ret = http_prepare_data(c); if (ret < 0) return -1; else if (ret == 0) { break; } else { /* state change requested */ return 0; } } if (c->buffer_end > c->buffer_ptr) { len = write(c->fd, c->buffer_ptr, c->buffer_end - c->... | |
positive | static void m68060_cpu_initfn(Object *obj){ M68kCPU *cpu = M68K_CPU(obj); CPUM68KState *env = &cpu->env; m68k_set_feature(env, M68K_FEATURE_M68000); m68k_set_feature(env, M68K_FEATURE_USP); m68k_set_feature(env, M68K_FEATURE_WORD_INDEX); m68k_set_feature(env, M68K_FEATURE_BRAL); m68k_set_feature(env, M68K_FEATURE_BCCL)... | |
positive | void mips_r4k_init (ram_addr_t ram_size, int vga_ram_size, const char *boot_device, const char *kernel_filename, const char *kernel_cmdline, const char *initrd_filename, const char *cpu_model){ char buf[1024]; unsigned long bios_offset; int bios_size; CPUState *env; RTCState *rtc_state; int i; qemu_irq *i8259; int inde... | |
positive | static void windowing_and_mdct_ltp(AACContext *ac, float *out, float *in, IndividualChannelStream *ics){ const float *lwindow = ics->use_kb_window[0] ? ff_aac_kbd_long_1024 : ff_sine_1024; const float *swindow = ics->use_kb_window[0] ? ff_aac_kbd_short_128 : ff_sine_128; const float *lwindow_prev = ics->use_kb_window[1... | |
negative | static int mov_read_trak(MOVContext *c, AVIOContext *pb, MOVAtom atom){ AVStream *st; MOVStreamContext *sc; int ret; st = avformat_new_stream(c->fc, NULL); if (!st) return AVERROR(ENOMEM); st->id = c->fc->nb_streams; sc = av_mallocz(sizeof(MOVStreamContext)); if (!sc) return AVERROR(ENOMEM); st->priv_data = sc; st->cod... | |
positive | static int mxg_read_packet(AVFormatContext *s, AVPacket *pkt){ int ret; unsigned int size; uint8_t *startmarker_ptr, *end, *search_end, marker; MXGContext *mxg = s->priv_data; while (!avio_feof(s->pb) && !s->pb->error){ if (mxg->cache_size <= OVERREAD_SIZE) { /* update internal buffer */ ret = mxg_update_cache(s, DEFAU... | |
positive | static uint32_t pci_unin_config_readl (void *opaque, target_phys_addr_t addr){ UNINState *s = opaque; return s->config_reg;} | |
positive | static int amf_parse_object(AVFormatContext *s, AVStream *astream, AVStream *vstream, const char *key, int64_t max_pos, int depth){ AVCodecContext *acodec, *vcodec; FLVContext *flv = s->priv_data; AVIOContext *ioc; AMFDataType amf_type; char str_val[256]; double num_val; num_val = 0; ioc = s->pb; amf_type = avio_r8(ioc... | |
positive | static TCGv_i64 gen_subq_msw(TCGv_i64 a, TCGv b){ TCGv_i64 tmp64 = tcg_temp_new_i64(); tcg_gen_extu_i32_i64(tmp64, b); dead_tmp(b); tcg_gen_shli_i64(tmp64, tmp64, 32); tcg_gen_sub_i64(a, tmp64, a); tcg_temp_free_i64(tmp64); return a;} | |
positive | static void decode_component(DiracContext *s, int comp){ AVCodecContext *avctx = s->avctx; SubBand *bands[3*MAX_DWT_LEVELS+1]; enum dirac_subband orientation; int level, num_bands = 0; /* Unpack all subbands at all levels. */ for (level = 0; level < s->wavelet_depth; level++) { for (orientation = !!level; orientation <... | |
positive | static void ppc_heathrow_init(MachineState *machine){ ram_addr_t ram_size = machine->ram_size; const char *cpu_model = machine->cpu_model; const char *kernel_filename = machine->kernel_filename; const char *kernel_cmdline = machine->kernel_cmdline; const char *initrd_filename = machine->initrd_filename; const char *boo... | |
positive | static int unpack_dct_coeffs(Vp3DecodeContext *s, GetBitContext *gb){ int i; int dc_y_table; int dc_c_table; int ac_y_table; int ac_c_table; int residual_eob_run = 0; VLC *y_tables[64]; VLC *c_tables[64]; s->dct_tokens[0][0] = s->dct_tokens_base; if (get_bits_left(gb) < 16) /* fetch the DC table indexes */ dc_y_table =... | |
positive | static void free_device_list(AVOpenCLDeviceList *device_list){ int i, j; if (!device_list) return; for (i = 0; i < device_list->platform_num; i++) { if (!device_list->platform_node[i]) continue; for (j = 0; j < device_list->platform_node[i]->device_num; j++) { av_freep(&(device_list->platform_node[i]->device_node[j]->d... | |
positive | void qemu_cond_init(QemuCond *cond){ memset(cond, 0, sizeof(*cond)); cond->sema = CreateSemaphore(NULL, 0, LONG_MAX, NULL); if (!cond->sema) { error_exit(GetLastError(), __func__); } cond->continue_event = CreateEvent(NULL, /* security */ FALSE, /* auto-reset */ FALSE, /* not signaled */ NULL); /* name */ if (!cond->co... | |
positive | void helper_rfdi(CPUPPCState *env){ do_rfi(env, env->spr[SPR_BOOKE_DSRR0], SPR_BOOKE_DSRR1, ~((target_ulong)0x3FFF0000), 0);} | |
positive | static void choose_sample_rate(AVStream *st, AVCodec *codec){ if(codec && codec->supported_samplerates){ const int *p= codec->supported_samplerates; int best; int best_dist=INT_MAX; for(; *p; p++){ int dist= abs(st->codec->sample_rate - *p); if(dist < best_dist){ best_dist= dist; best= *p; } } if(best_dist){ av_log(st-... | |
positive | unsigned iov_copy(struct iovec *dst_iov, unsigned int dst_iov_cnt, const struct iovec *iov, unsigned int iov_cnt, size_t offset, size_t bytes){ size_t len; unsigned int i, j; for (i = 0, j = 0; i < iov_cnt && j < dst_iov_cnt && bytes; i++) { if (offset >= iov[i].iov_len) { offset -= iov[i].iov_len; continue; } len = MI... | |
positive | static int tty_serial_ioctl(CharDriverState *chr, int cmd, void *arg) FDCharDriver *s = chr->opaque; switch(cmd) { case CHR_IOCTL_SERIAL_SET_PARAMS: QEMUSerialSetParams *ssp = arg; tty_serial_init(s->fd_in, ssp->speed, ssp->parity, ssp->data_bits, ssp->stop_bits); case CHR_IOCTL_SERIAL_SET_BREAK: int enable = *(int *)a... | |
positive | static int spapr_populate_drconf_memory(sPAPRMachineState *spapr, void *fdt){ MachineState *machine = MACHINE(spapr); int ret, i, offset; uint64_t lmb_size = SPAPR_MEMORY_BLOCK_SIZE; uint32_t prop_lmb_size[] = {0, cpu_to_be32(lmb_size)}; uint32_t nr_lmbs = (machine->maxram_size - machine->ram_size)/lmb_size; uint32_t *... | |
positive | static int http_server(struct sockaddr_in my_addr){ int server_fd, tmp, ret; struct sockaddr_in from_addr; struct pollfd poll_table[HTTP_MAX_CONNECTIONS + 1], *poll_entry; HTTPContext *c, **cp; long cur_time; server_fd = socket(AF_INET,SOCK_STREAM,0); if (server_fd < 0) { perror ("socket"); return -1; } tmp = 1; setsoc... | |
positive | int kvm_arch_remove_sw_breakpoint(CPUState *cs, struct kvm_sw_breakpoint *bp){ uint8_t t[sizeof(diag_501)]; if (cpu_memory_rw_debug(cs, bp->pc, t, sizeof(diag_501), 0)) { return -EINVAL; } else if (memcmp(t, diag_501, sizeof(diag_501))) { return -EINVAL; } else if (cpu_memory_rw_debug(cs, bp->pc, (uint8_t *)&bp->saved_... | |
positive | static int kvm_get_dirty_pages_log_range(MemoryRegionSection *section, unsigned long *bitmap){ unsigned int i, j; unsigned long page_number, addr, addr1, c; unsigned int len = ((section->size / TARGET_PAGE_SIZE) + HOST_LONG_BITS - 1) / HOST_LONG_BITS; /* * bitmap-traveling is faster than memory-traveling (for addr...) ... | |
positive | static int ppc_hash64_pte_prot(PowerPCCPU *cpu, ppc_slb_t *slb, ppc_hash_pte64_t pte){ CPUPPCState *env = &cpu->env; unsigned pp, key; /* Some pp bit combinations have undefined behaviour, so default * to no access in those cases */ int prot = 0; key = !!(msr_pr ? (slb->vsid & SLB_VSID_KP) : (slb->vsid & SLB_VSID_KS));... | |
positive | static int rd_frame(CinepakEncContext *s, AVFrame *frame, unsigned char *buf, int buf_size){ int num_strips, strip, h, i, y, size, temp_size, best_size; AVPicture last_pict, pict, scratch_pict; int64_t best_score = 0, score, score_temp; //TODO: support encoding zero strips (meaning skip the whole frame) for(num_strips ... | |
positive | void ff_hevc_set_qPy(HEVCContext *s, int xC, int yC, int xBase, int yBase, int log2_cb_size){ int qp_y = get_qPy_pred(s, xC, yC, xBase, yBase, log2_cb_size); if (s->HEVClc->tu.cu_qp_delta != 0) { int off = s->sps->qp_bd_offset; s->HEVClc->qp_y = ((qp_y + s->HEVClc->tu.cu_qp_delta + 52 + 2 * off) % (52 + off)) - off; } ... | |
positive | static void sdhci_sysbus_class_init(ObjectClass *klass, void *data){ DeviceClass *dc = DEVICE_CLASS(klass); dc->vmsd = &sdhci_vmstate; dc->props = sdhci_sysbus_properties; dc->realize = sdhci_sysbus_realize; dc->reset = sdhci_poweron_reset;} | |
positive | grlib_gptimer_writel(void *opaque, target_phys_addr_t addr, uint32_t value){ GPTimerUnit *unit = opaque; target_phys_addr_t timer_addr; int id; addr &= 0xff; /* Unit registers */ switch (addr) { case SCALER_OFFSET: value &= 0xFFFF; /* clean up the value */ unit->scaler = value; trace_grlib_gptimer_writel(-1, "scaler:",... | |
positive | static void check_watchpoint(int offset, int len, MemTxAttrs attrs, int flags){ CPUState *cpu = current_cpu; CPUClass *cc = CPU_GET_CLASS(cpu); CPUArchState *env = cpu->env_ptr; target_ulong pc, cs_base; target_ulong vaddr; CPUWatchpoint *wp; uint32_t cpu_flags; if (cpu->watchpoint_hit) { /* We re-entered the check aft... | |
positive | DISAS_INSN(shift_im){ TCGv reg; int tmp; TCGv shift; set_cc_op(s, CC_OP_FLAGS); reg = DREG(insn, 0); tmp = (insn >> 9) & 7; if (tmp == 0) tmp = 8; shift = tcg_const_i32(tmp); /* No need to flush flags becuse we know we will set C flag. */ if (insn & 0x100) { gen_helper_shl_cc(reg, cpu_env, reg, shift); } else { if (ins... | |
positive | static target_ulong h_protect(PowerPCCPU *cpu, sPAPRMachineState *spapr, target_ulong opcode, target_ulong *args){ CPUPPCState *env = &cpu->env; target_ulong flags = args[0]; target_ulong pte_index = args[1]; target_ulong avpn = args[2]; uint64_t token; target_ulong v, r, rb; if (!valid_pte_index(env, pte_index)) { ret... | |
positive | static int kvm_get_msrs(X86CPU *cpu){ CPUX86State *env = &cpu->env; struct kvm_msr_entry *msrs = cpu->kvm_msr_buf->entries; int ret, i; uint64_t mtrr_top_bits; kvm_msr_buf_reset(cpu); kvm_msr_entry_add(cpu, MSR_IA32_SYSENTER_CS, 0); kvm_msr_entry_add(cpu, MSR_IA32_SYSENTER_ESP, 0); kvm_msr_entry_add(cpu, MSR_IA32_SYSEN... | |
positive | static void blk_mig_unlock(void){ qemu_mutex_unlock(&block_mig_state.lock);} | |
positive | static void do_tb_flush(CPUState *cpu, void *data){ unsigned tb_flush_req = (unsigned) (uintptr_t) data; tb_lock(); /* If it's already been done on request of another CPU, * just retry. */ if (tcg_ctx.tb_ctx.tb_flush_count != tb_flush_req) { goto done; }#if defined(DEBUG_FLUSH) printf("qemu: flush code_size=%ld nb_tbs=... | |
positive | static int decode_gusa(DisasContext *ctx, CPUSH4State *env, int *pmax_insns){ uint16_t insns[5]; int ld_adr, ld_dst, ld_mop; int op_dst, op_src, op_opc; int mv_src, mt_dst, st_src, st_mop; TCGv op_arg; uint32_t pc = ctx->pc; uint32_t pc_end = ctx->tb->cs_base; int backup = sextract32(ctx->tbflags, GUSA_SHIFT, 8); int m... | |
positive | static int yop_read_header(AVFormatContext *s){ YopDecContext *yop = s->priv_data; AVIOContext *pb = s->pb; AVCodecContext *audio_dec, *video_dec; AVStream *audio_stream, *video_stream; int frame_rate, ret; audio_stream = avformat_new_stream(s, NULL); video_stream = avformat_new_stream(s, NULL); // Extra data that will... | |
positive | int64_t bdrv_get_block_status_above(BlockDriverState *bs, BlockDriverState *base, int64_t sector_num, int nb_sectors, int *pnum, BlockDriverState **file){ Coroutine *co; BdrvCoGetBlockStatusData data = { .bs = bs, .base = base, .file = file, .sector_num = sector_num, .nb_sectors = nb_sectors, .pnum = pnum, .done = fals... | |
positive | static int add_string_metadata(int count, const char *name, TiffContext *s){ char *value; if (bytestream2_get_bytes_left(&s->gb) < count || count < 0) return AVERROR_INVALIDDATA; value = av_malloc(count + 1); if (!value) return AVERROR(ENOMEM); bytestream2_get_bufferu(&s->gb, value, count); value[count] = 0; av_dict_se... | |
positive | static void pc_q35_init_1_6(QEMUMachineInitArgs *args){ has_pci_info = false; pc_q35_init(args);} | |
negative | static void dvbsub_parse_clut_segment(AVCodecContext *avctx, const uint8_t *buf, int buf_size){ DVBSubContext *ctx = avctx->priv_data; const uint8_t *buf_end = buf + buf_size; int i, clut_id; DVBSubCLUT *clut; int entry_id, depth , full_range; int y, cr, cb, alpha; int r, g, b, r_add, g_add, b_add; av_dlog(avctx, "DVB ... | |
negative | static void intra_predict_mad_cow_dc_l0t_8x8_msa(uint8_t *src, int32_t stride){ uint8_t lp_cnt; uint32_t src0, src1, src2 = 0; uint32_t out0, out1, out2; v16u8 src_top; v8u16 add; v4u32 sum; src_top = LD_UB(src - stride); add = __msa_hadd_u_h(src_top, src_top); sum = __msa_hadd_u_w(add, add); src0 = __msa_copy_u_w((v4i... | |
negative | static int write_streamheader(AVFormatContext *avctx, AVIOContext *bc, AVStream *st, int i){ NUTContext *nut = avctx->priv_data; AVCodecContext *codec = st->codec; unsigned codec_tag = av_codec_get_tag(ff_nut_codec_tags, codec->codec_id); ff_put_v(bc, i); switch(codec->codec_type){ case AVMEDIA_TYPE_VIDEO: ff_put_v(bc,... | |
negative | SYNTH_FILTER_FUNC(sse2)SYNTH_FILTER_FUNC(avx)SYNTH_FILTER_FUNC(fma3)#endif /* HAVE_YASM */av_cold void ff_synth_filter_init_x86(SynthFilterContext *s){#if HAVE_YASM int cpu_flags = av_get_cpu_flags();#if ARCH_X86_32 if (EXTERNAL_SSE(cpu_flags)) { s->synth_filter_float = synth_filter_sse; }#endif if (EXTERNAL_SSE2(cpu_f... | |
positive | static BlockDriverAIOCB *iscsi_aio_ioctl(BlockDriverState *bs, unsigned long int req, void *buf, BlockDriverCompletionFunc *cb, void *opaque){ IscsiLun *iscsilun = bs->opaque; struct iscsi_context *iscsi = iscsilun->iscsi; struct iscsi_data data; IscsiAIOCB *acb; assert(req == SG_IO); acb = qemu_aio_get(&iscsi_aiocb_in... | |
positive | static void esp_pci_dma_memory_rw(PCIESPState *pci, uint8_t *buf, int len, DMADirection dir){ dma_addr_t addr; DMADirection expected_dir; if (pci->dma_regs[DMA_CMD] & DMA_CMD_DIR) { expected_dir = DMA_DIRECTION_FROM_DEVICE; } else { expected_dir = DMA_DIRECTION_TO_DEVICE; } if (dir != expected_dir) { trace_esp_pci_erro... | |
positive | void qemu_fflush(QEMUFile *f){ ssize_t ret = 0; if (!qemu_file_is_writable(f)) { return; } if (f->ops->writev_buffer) { if (f->iovcnt > 0) { ret = f->ops->writev_buffer(f->opaque, f->iov, f->iovcnt, f->pos); } } else { if (f->buf_index > 0) { ret = f->ops->put_buffer(f->opaque, f->buf, f->pos, f->buf_index); } } if (re... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.