label
int64
0
1
func
stringlengths
21
96.3k
1
MemoryRegionSection memory_region_find(MemoryRegion *mr, hwaddr addr, uint64_t size){ MemoryRegionSection ret = { .mr = NULL }; MemoryRegion *root; AddressSpace *as; AddrRange range; FlatView *view; FlatRange *fr; addr += mr->addr; for (root = mr; root->container; ) { root = root->container; addr += root->addr; } as = ...
1
static void vnc_colordepth(DisplayState *ds){ int host_big_endian_flag; struct VncState *vs = ds->opaque;#ifdef WORDS_BIGENDIAN host_big_endian_flag = 1;#else host_big_endian_flag = 0;#endif switch (ds_get_bits_per_pixel(ds)) { case 8: vs->depth = 1; vs->server_red_max = 7; vs->server_green_max = 7; vs->server_blue_max...
1
int ff_rv34_decode_update_thread_context(AVCodecContext *dst, const AVCodecContext *src){ RV34DecContext *r = dst->priv_data, *r1 = src->priv_data; MpegEncContext * const s = &r->s, * const s1 = &r1->s; int err; if (dst == src || !s1->context_initialized) return 0; if (s->height != s1->height || s->width != s1->width) ...
1
static av_cold int flac_encode_init(AVCodecContext *avctx){ int freq = avctx->sample_rate; int channels = avctx->channels; FlacEncodeContext *s = avctx->priv_data; int i, level; uint8_t *streaminfo; s->avctx = avctx; dsputil_init(&s->dsp, avctx); if (avctx->sample_fmt != SAMPLE_FMT_S16) return -1; if (channels < 1 || c...
1
static void init_mbr(BDRVVVFATState* s){ /* TODO: if the files mbr.img and bootsect.img exist, use them */ mbr_t* real_mbr=(mbr_t*)s->first_sectors; partition_t* partition = &(real_mbr->partition[0]); int lba; memset(s->first_sectors,0,512); /* Win NT Disk Signature */ real_mbr->nt_id= cpu_to_le32(0xbe1afdfa); partitio...
1
static void set_year_20xx(void){ /* Set BCD mode */ cmos_write(RTC_REG_B, cmos_read(RTC_REG_B) & ~REG_B_DM); cmos_write(RTC_REG_A, 0x76); cmos_write(RTC_YEAR, 0x11); cmos_write(RTC_CENTURY, 0x20); cmos_write(RTC_MONTH, 0x02); cmos_write(RTC_DAY_OF_MONTH, 0x02); cmos_write(RTC_HOURS, 0x02); cmos_write(RTC_MINUTES, 0x04)...
1
void avfilter_destroy(AVFilterContext *filter){ int i; if(filter->filter->uninit) filter->filter->uninit(filter); for(i = 0; i < filter->input_count; i ++) { if(filter->inputs[i]) { filter->inputs[i]->src->outputs[filter->inputs[i]->srcpad] = NULL; avfilter_formats_unref(&filter->inputs[i]->in_formats); avfilter_format...
1
void usb_desc_create_serial(USBDevice *dev){ DeviceState *hcd = dev->qdev.parent_bus->parent; const USBDesc *desc = usb_device_get_usb_desc(dev); int index = desc->id.iSerialNumber; char serial[64]; char *path; int dst; if (dev->serial) { /* 'serial' usb bus property has priority if present */ usb_desc_set_string(dev, ...
1
const char *qdict_get_str(const QDict *qdict, const char *key){ QObject *obj = qdict_get_obj(qdict, key, QTYPE_QSTRING); return qstring_get_str(qobject_to_qstring(obj));}
1
static int get_coc(J2kDecoderContext *s, J2kCodingStyle *c, uint8_t *properties){ int compno; if (s->buf_end - s->buf < 2) return AVERROR(EINVAL); compno = bytestream_get_byte(&s->buf); c += compno; c->csty = bytestream_get_byte(&s->buf); get_cox(s, c); properties[compno] |= HAD_COC; return 0;}
1
static void FUNC(put_hevc_qpel_bi_w_hv)(uint8_t *_dst, ptrdiff_t _dststride, uint8_t *_src, ptrdiff_t _srcstride, int16_t *src2, int height, int denom, int wx0, int wx1, int ox0, int ox1, intptr_t mx, intptr_t my, int width){ int x, y; const int8_t *filter; pixel *src = (pixel*)_src; ptrdiff_t srcstride = _srcstride / ...
1
int bdrv_flush(BlockDriverState *bs){ Coroutine *co; FlushCo flush_co = { .bs = bs, .ret = NOT_DONE, }; if (qemu_in_coroutine()) { /* Fast-path if already in coroutine context */ bdrv_flush_co_entry(&flush_co); } else { co = qemu_coroutine_create(bdrv_flush_co_entry, &flush_co); qemu_coroutine_enter(co); BDRV_POLL_WHIL...
1
void scsi_req_complete(SCSIRequest *req){ assert(req->status != -1); scsi_req_ref(req); scsi_req_dequeue(req); req->bus->ops->complete(req->bus, SCSI_REASON_DONE, req->tag, req->status); scsi_req_unref(req);}
1
static void iv_Decode_Chunk(Indeo3DecodeContext *s, uint8_t *cur, uint8_t *ref, int width, int height, const uint8_t *buf1, long cb_offset, const uint8_t *hdr, const uint8_t *buf2, int min_width_160){ uint8_t bit_buf; unsigned long bit_pos, lv, lv1, lv2; long *width_tbl, width_tbl_arr[10]; const signed char *ref_vector...
1
static av_always_inline void get_mvdata_interlaced(VC1Context *v, int *dmv_x, int *dmv_y, int *pred_flag){ int index, index1; int extend_x = 0, extend_y = 0; GetBitContext *gb = &v->s.gb; int bits, esc; int val, sign; const int* offs_tab; if (v->numref) { bits = VC1_2REF_MVDATA_VLC_BITS; esc = 125; } else { bits = VC1_...
1
static int alloc_buffers(AVCodecContext *avctx){ CFHDContext *s = avctx->priv_data; int i, j, k, ret, planes; if ((ret = ff_set_dimensions(avctx, s->coded_width, s->coded_height)) < 0) return ret; avctx->pix_fmt = s->coded_format; avcodec_get_chroma_sub_sample(avctx->pix_fmt, &s->chroma_x_shift, &s->chroma_y_shift); pl...
1
static int frame_start(MpegEncContext *s){ int ret; /* mark & release old frames */ if (s->pict_type != AV_PICTURE_TYPE_B && s->last_picture_ptr && s->last_picture_ptr != s->next_picture_ptr && s->last_picture_ptr->f.buf[0]) { ff_mpeg_unref_picture(s, s->last_picture_ptr); } s->current_picture_ptr->f.pict_type = s->pic...
1
static always_inline void mpeg_motion(MpegEncContext *s, uint8_t *dest_y, uint8_t *dest_cb, uint8_t *dest_cr, int field_based, int bottom_field, int field_select, uint8_t **ref_picture, op_pixels_func (*pix_op)[4], int motion_x, int motion_y, int h){ uint8_t *ptr_y, *ptr_cb, *ptr_cr; int dxy, uvdxy, mx, my, src_x, src_...
1
static int decode_user_data(MpegEncContext *s, GetBitContext *gb){ char buf[256]; int i; int e; int ver, build, ver2, ver3; char last; for(i=0; i<255; i++){ if(show_bits(gb, 23) == 0) break; buf[i]= get_bits(gb, 8); } buf[i]=0; /* divx detection */ e=sscanf(buf, "DivX%dBuild%d%c", &ver, &build, &last); if(e<2) e=sscanf...
1
static void do_adaptive_prediction(struct G722Band *band, const int cur_diff){ int sg[2], limit, cur_qtzd_reconst; const int cur_part_reconst = band->s_zero + cur_diff < 0; sg[0] = sign_lookup[cur_part_reconst != band->part_reconst_mem[0]]; sg[1] = sign_lookup[cur_part_reconst == band->part_reconst_mem[1]]; band->part_...
1
void helper_done(void){ env->pc = env->tsptr->tpc; env->npc = env->tsptr->tnpc + 4; PUT_CCR(env, env->tsptr->tstate >> 32); env->asi = (env->tsptr->tstate >> 24) & 0xff; change_pstate((env->tsptr->tstate >> 8) & 0xf3f); PUT_CWP64(env, env->tsptr->tstate & 0xff); env->tl--; env->tsptr = &env->ts[env->tl & MAXTL_MASK];}
1
static const AVClass *ff_avio_child_class_next(const AVClass *prev){ return prev ? NULL : &ffurl_context_class;}
1
static int decode_band(IVI5DecContext *ctx, int plane_num, IVIBandDesc *band, AVCodecContext *avctx){ int result, i, t, idx1, idx2; IVITile *tile; uint16_t chksum; band->buf = band->bufs[ctx->dst_buf]; band->ref_buf = band->bufs[ctx->ref_buf]; band->data_ptr = ctx->frame_data + (get_bits_count(&ctx->gb) >> 3); result =...
1
static void test_interface_impl(const char *type){ Object *obj = object_new(type); TestIf *iobj = TEST_IF(obj); TestIfClass *ioc = TEST_IF_GET_CLASS(iobj); g_assert(iobj); g_assert(ioc->test == PATTERN);}
1
uint32_t HELPER(shl_cc)(CPUM68KState *env, uint32_t val, uint32_t shift){ uint64_t result; shift &= 63; result = (uint64_t)val << shift; env->cc_c = (result >> 32) & 1; env->cc_n = result; env->cc_z = result; env->cc_v = 0; env->cc_x = shift ? env->cc_c : env->cc_x; return result;}
1
static int inc_refcounts(BlockDriverState *bs, BdrvCheckResult *res, uint16_t **refcount_table, int64_t *refcount_table_size, int64_t offset, int64_t size){ BDRVQcowState *s = bs->opaque; uint64_t start, last, cluster_offset, k; int ret; if (size <= 0) { return 0; } start = start_of_cluster(s, offset); last = start_of_...
1
static void test_server_free(TestServer *server){ int i; qemu_chr_delete(server->chr); for (i = 0; i < server->fds_num; i++) { close(server->fds[i]); } if (server->log_fd != -1) { close(server->log_fd); } unlink(server->socket_path); g_free(server->socket_path); g_free(server->chr_name); g_free(server);}
1
int qcow2_discard_clusters(BlockDriverState *bs, uint64_t offset, int nb_sectors, enum qcow2_discard_type type, bool full_discard){ BDRVQcow2State *s = bs->opaque; uint64_t end_offset; uint64_t nb_clusters; int ret; end_offset = offset + (nb_sectors << BDRV_SECTOR_BITS); /* Round start up and end down */ offset = align...
1
static void audio_init(qemu_irq *pic){ struct soundhw *c; int audio_enabled = 0; for (c = soundhw; !audio_enabled && c->name; ++c) { audio_enabled = c->enabled; } if (audio_enabled) { AudioState *s; s = AUD_init(); if (s) { for (c = soundhw; c->name; ++c) { if (c->enabled) { if (c->isa) { c->init.init_isa(s, pic); } } ...
1
static int gif_image_write_image(ByteIOContext *pb, int x1, int y1, int width, int height, const uint8_t *buf, int linesize, int pix_fmt){ PutBitContext p; uint8_t buffer[200]; /* 100 * 9 / 8 = 113 */ int i, left, w, v; const uint8_t *ptr; /* image block */ put_byte(pb, 0x2c); put_le16(pb, x1); put_le16(pb, y1); put_le...
1
int64_t qmp_guest_file_open(const char *path, bool has_mode, const char *mode, Error **err){ FILE *fh; int fd; int64_t ret = -1, handle; if (!has_mode) { mode = "r"; } slog("guest-file-open called, filepath: %s, mode: %s", path, mode); fh = fopen(path, mode); if (!fh) { error_setg_errno(err, errno, "failed to open file...
0
static void vp5_parse_coeff_models(VP56Context *s){ VP56RangeCoder *c = &s->c; VP56Model *model = s->modelp; uint8_t def_prob[11]; int node, cg, ctx; int ct; /* code type */ int pt; /* plane type (0 for Y, 1 for U or V) */ memset(def_prob, 0x80, sizeof(def_prob)); for (pt=0; pt<2; pt++) for (node=0; node<11; node++) if...
1
static void qmp_input_get_next_type(Visitor *v, int *kind, const int *qobjects, const char *name, Error **errp){ QmpInputVisitor *qiv = to_qiv(v); QObject *qobj = qmp_input_get_object(qiv, name, false); if (!qobj) { error_setg(errp, QERR_MISSING_PARAMETER, name ? name : "null"); return; } *kind = qobjects[qobject_type(...
1
static void breakpoint_invalidate(CPUArchState *env, target_ulong pc){ tb_invalidate_phys_addr(cpu_get_phys_page_debug(env, pc));}
1
static void dump_data(const uint8_t *data, int len) {}
1
static void vc1_inv_trans_8x4_c(uint8_t *dest, int linesize, DCTELEM *block){ int i; register int t1,t2,t3,t4,t5,t6,t7,t8; DCTELEM *src, *dst; const uint8_t *cm = ff_cropTbl + MAX_NEG_CROP; src = block; dst = block; for(i = 0; i < 4; i++){ t1 = 12 * (src[0] + src[4]) + 4; t2 = 12 * (src[0] - src[4]) + 4; t3 = 16 * src[...
1
void kvm_arch_update_guest_debug(CPUState *env, struct kvm_guest_debug *dbg){ const uint8_t type_code[] = { [GDB_BREAKPOINT_HW] = 0x0, [GDB_WATCHPOINT_WRITE] = 0x1, [GDB_WATCHPOINT_ACCESS] = 0x3 }; const uint8_t len_code[] = { [1] = 0x0, [2] = 0x1, [4] = 0x3, [8] = 0x2 }; int n; if (kvm_sw_breakpoints_active(env)) dbg-...
1
static inline int cris_swap(const int mode, int x){switch (mode){case N: asm ("swapn\t%0\n" : "+r" (x) : "0" (x)); break;case W: asm ("swapw\t%0\n" : "+r" (x) : "0" (x)); break;case B: asm ("swapb\t%0\n" : "+r" (x) : "0" (x)); break;case R: asm ("swapr\t%0\n" : "+r" (x) : "0" (x)); break;case B|R: asm ("swapbr\t%0\n" :...
1
static av_cold int initFilter(int16_t **outFilter, int32_t **filterPos, int *outFilterSize, int xInc, int srcW, int dstW, int filterAlign, int one, int flags, int cpu_flags, SwsVector *srcFilter, SwsVector *dstFilter, double param[2], int srcPos, int dstPos){ int i; int filterSize; int filter2Size; int minFilterSize; i...
1
static uint64_t hb_count_between(HBitmap *hb, uint64_t start, uint64_t last){ HBitmapIter hbi; uint64_t count = 0; uint64_t end = last + 1; unsigned long cur; size_t pos; hbitmap_iter_init(&hbi, hb, start << hb->granularity); for (;;) { pos = hbitmap_iter_next_word(&hbi, &cur); if (pos >= (end >> BITS_PER_LEVEL)) { bre...
1
static int img_convert(int argc, char **argv){ int c, ret = 0, n, n1, bs_n, bs_i, compress, cluster_size, cluster_sectors; int progress = 0, flags; const char *fmt, *out_fmt, *cache, *out_baseimg, *out_filename; BlockDriver *drv, *proto_drv; BlockDriverState **bs = NULL, *out_bs = NULL; int64_t total_sectors, nb_sector...
1
static int avi_read_header(AVFormatContext *s, AVFormatParameters *ap){ AVIContext *avi = s->priv_data; ByteIOContext *pb = &s->pb; uint32_t tag, tag1, handler; int codec_type, stream_index, frame_period, bit_rate, scale, rate; unsigned int size, nb_frames; int i, n; AVStream *st; AVIStream *ast; int xan_video = 0; /* ...
1
static void test_io(void){#ifndef _WIN32/* socketpair(PF_UNIX) which does not exist on windows */ int sv[2]; int r; unsigned i, j, k, s, t; fd_set fds; unsigned niov; struct iovec *iov, *siov; unsigned char *buf; size_t sz; iov_random(&iov, &niov); sz = iov_size(iov, niov); buf = g_malloc(sz); for (i = 0; i < sz; ++i) ...
1
static int jpeg2000_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt){ Jpeg2000DecoderContext *s = avctx->priv_data; ThreadFrame frame = { .f = data }; AVFrame *picture = data; int tileno, ret; s->avctx = avctx; s->buf = s->buf_start = avpkt->data; s->buf_end = s->buf_start + avpkt->size;...
1
static HotpluggableCPUList *spapr_query_hotpluggable_cpus(MachineState *machine){ int i; HotpluggableCPUList *head = NULL; sPAPRMachineState *spapr = SPAPR_MACHINE(machine); sPAPRMachineClass *smc = SPAPR_MACHINE_GET_CLASS(machine); int spapr_max_cores = max_cpus / smp_threads; g_assert(smc->dr_cpu_enabled); for (i = 0...
1
static int matroska_ebmlnum_uint(MatroskaDemuxContext *matroska, uint8_t *data, uint32_t size, uint64_t *num){ ByteIOContext pb; init_put_byte(&pb, data, size, 0, NULL, NULL, NULL, NULL); return ebml_read_num(matroska, &pb, 8, num);}
0
static int check(AVIOContext *pb, int64_t pos){ int64_t ret = avio_seek(pb, pos, SEEK_SET); unsigned header; MPADecodeHeader sd; if (ret < 0) return ret; header = avio_rb32(pb); if (ff_mpa_check_header(header) < 0) return -1; if (avpriv_mpegaudio_decode_header(&sd, header) == 1) return -1; return sd.frame_size;}
0
static void slavio_timer_get_out(SLAVIO_TIMERState *s){ uint64_t count; count = s->limit - PERIODS_TO_LIMIT(ptimer_get_count(s->timer)); DPRINTF("get_out: limit %" PRIx64 " count %x%08x\n", s->limit, s->counthigh, s->count); s->count = count & TIMER_COUNT_MASK32; s->counthigh = count >> 32;}
0
void acpi_pm1_cnt_reset(ACPIREGS *ar){ ar->pm1.cnt.cnt = 0; if (ar->pm1.cnt.cmos_s3) { qemu_irq_lower(ar->pm1.cnt.cmos_s3); }}
0
static uint16_t pci_req_id_cache_extract(PCIReqIDCache *cache){ uint8_t bus_n; uint16_t result; switch (cache->type) { case PCI_REQ_ID_BDF: result = pci_get_bdf(cache->dev); break; case PCI_REQ_ID_SECONDARY_BUS: bus_n = pci_bus_num(cache->dev->bus); result = PCI_BUILD_BDF(bus_n, 0); break; default: error_printf("Invali...
0
int qio_channel_readv_all(QIOChannel *ioc, const struct iovec *iov, size_t niov, Error **errp){ int ret = -1; struct iovec *local_iov = g_new(struct iovec, niov); struct iovec *local_iov_head = local_iov; unsigned int nlocal_iov = niov; nlocal_iov = iov_copy(local_iov, nlocal_iov, iov, niov, 0, iov_size(iov, niov)); wh...
0
static void ioreq_unmap(struct ioreq *ioreq){ int gnt = ioreq->blkdev->xendev.gnttabdev; int i; if (ioreq->v.niov == 0) { return; } if (batch_maps) { if (!ioreq->pages) { return; } if (xc_gnttab_munmap(gnt, ioreq->pages, ioreq->v.niov) != 0) { xen_be_printf(&ioreq->blkdev->xendev, 0, "xc_gnttab_munmap failed: %s\n", st...
0
static struct omap_mpuio_s *omap_mpuio_init(MemoryRegion *memory, target_phys_addr_t base, qemu_irq kbd_int, qemu_irq gpio_int, qemu_irq wakeup, omap_clk clk){ struct omap_mpuio_s *s = (struct omap_mpuio_s *) g_malloc0(sizeof(struct omap_mpuio_s)); s->irq = gpio_int; s->kbd_irq = kbd_int; s->wakeup = wakeup; s->in = qe...
0
static target_ulong h_read(PowerPCCPU *cpu, sPAPRMachineState *spapr, target_ulong opcode, target_ulong *args){ CPUPPCState *env = &cpu->env; target_ulong flags = args[0]; target_ulong ptex = args[1]; uint8_t *hpte; int i, ridx, n_entries = 1; if (!valid_ptex(cpu, ptex)) { return H_PARAMETER; } if (flags & H_READ_4) { ...
0
static void dec_pattern(DisasContext *dc){ unsigned int mode; int l1; if ((dc->tb_flags & MSR_EE_FLAG) && !(dc->env->pvr.regs[2] & PVR2_ILL_OPCODE_EXC_MASK) && !((dc->env->pvr.regs[2] & PVR2_USE_PCMP_INSTR))) { tcg_gen_movi_tl(cpu_SR[SR_ESR], ESR_EC_ILLEGAL_OP); t_gen_raise_exception(dc, EXCP_HW_EXCP); } mode = dc->opc...
0
static MemoryRegionSection phys_page_find(target_phys_addr_t index){ uint16_t *p = phys_page_find_alloc(index, 0); uint16_t s_index = phys_section_unassigned; MemoryRegionSection section; target_phys_addr_t delta; if (p) { s_index = *p; } section = phys_sections[s_index]; index <<= TARGET_PAGE_BITS; assert(section.offs...
0
static void qmp_output_end_struct(Visitor *v, Error **errp){ QmpOutputVisitor *qov = to_qov(v); qmp_output_pop(qov);}
0
static av_cold int MP3lame_encode_init(AVCodecContext *avctx){ Mp3AudioContext *s = avctx->priv_data; if (avctx->channels > 2) return -1; s->stereo = avctx->channels > 1 ? 1 : 0; if ((s->gfp = lame_init()) == NULL) goto err; lame_set_in_samplerate(s->gfp, avctx->sample_rate); lame_set_out_samplerate(s->gfp, avctx->samp...
0
static void string_cleanup(void *datap){ StringSerializeData *d = datap; visit_free(string_output_get_visitor(d->sov)); visit_free(d->siv); g_free(d->string); g_free(d);}
0
static int n8x0_atag_setup(void *p, int model){ uint8_t *b; uint16_t *w; uint32_t *l; struct omap_gpiosw_info_s *gpiosw; struct omap_partition_info_s *partition; const char *tag; w = p; stw_p(w++, OMAP_TAG_UART);/* u16 tag */ stw_p(w++, 4);/* u16 len */ stw_p(w++, (1 << 2) | (1 << 1) | (1 << 0)); /* uint enabled_uarts ...
0
vdi_co_preadv(BlockDriverState *bs, uint64_t offset, uint64_t bytes, QEMUIOVector *qiov, int flags){ BDRVVdiState *s = bs->opaque; QEMUIOVector local_qiov; uint32_t bmap_entry; uint32_t block_index; uint32_t offset_in_block; uint32_t n_bytes; uint64_t bytes_done = 0; int ret = 0; logout("\n"); qemu_iovec_init(&local_qi...
0
static void spapr_core_plug(HotplugHandler *hotplug_dev, DeviceState *dev, Error **errp){ sPAPRMachineState *spapr = SPAPR_MACHINE(OBJECT(hotplug_dev)); MachineClass *mc = MACHINE_GET_CLASS(spapr); sPAPRMachineClass *smc = SPAPR_MACHINE_CLASS(mc); sPAPRCPUCore *core = SPAPR_CPU_CORE(OBJECT(dev)); CPUCore *cc = CPU_CORE...
0
static void bt_dummy_lmp_acl_resp(struct bt_link_s *link, const uint8_t *data, int start, int len){ fprintf(stderr, "%s: stray ACL response PDU, fixme\n", __FUNCTION__); exit(-1);}
0
static bool msix_vector_masked(PCIDevice *dev, int vector, bool fmask){ unsigned offset = vector * PCI_MSIX_ENTRY_SIZE + PCI_MSIX_ENTRY_VECTOR_CTRL; return fmask || dev->msix_table[offset] & PCI_MSIX_ENTRY_CTRL_MASKBIT;}
0
static void virtio_blk_dma_restart_bh(void *opaque){ VirtIOBlock *s = opaque; VirtIOBlockReq *req = s->rq; MultiReqBuffer mrb = { .num_writes = 0, }; qemu_bh_delete(s->bh); s->bh = NULL; s->rq = NULL; while (req) { virtio_blk_handle_request(req, &mrb); req = req->next; } if (mrb.num_writes > 0) { do_multiwrite(s->bs, m...
1
iscsi_aio_readv(BlockDriverState *bs, int64_t sector_num, QEMUIOVector *qiov, int nb_sectors, BlockDriverCompletionFunc *cb, void *opaque){ IscsiLun *iscsilun = bs->opaque; struct iscsi_context *iscsi = iscsilun->iscsi; IscsiAIOCB *acb; size_t qemu_read_size; int i; uint64_t lba; uint32_t num_sectors; qemu_read_size = ...
1
static void vmsvga_reset(struct vmsvga_state_s *s){ s->index = 0; s->enable = 0; s->config = 0; s->width = -1; s->height = -1; s->svgaid = SVGA_ID; s->depth = 24; s->bypp = (s->depth + 7) >> 3; s->cursor.on = 0; s->redraw_fifo_first = 0; s->redraw_fifo_last = 0; switch (s->depth) { case 8: s->wred = 0x00000007; s->wgre...
1
static MpegTSService *mpegts_add_service(MpegTSWrite *ts, int sid, const char *provider_name, const char *name){ MpegTSService *service; service = av_mallocz(sizeof(MpegTSService)); if (!service) return NULL; service->pmt.pid = ts->pmt_start_pid + ts->nb_services; service->sid = sid; service->provider_name = av_strdup(...
1
static const uint8_t *read_huffman_tables(FourXContext *f, const uint8_t * const buf, int buf_size){ int frequency[512] = { 0 }; uint8_t flag[512]; int up[512]; uint8_t len_tab[257]; int bits_tab[257]; int start, end; const uint8_t *ptr = buf; const uint8_t *ptr_end = buf + buf_size; int j; memset(up, -1, sizeof(up)); ...
1
static const uint8_t *parse_opus_ts_header(const uint8_t *start, int *payload_len, int buf_len){ const uint8_t *buf = start + 1; int start_trim_flag, end_trim_flag, control_extension_flag, control_extension_length; uint8_t flags; GetByteContext gb; bytestream2_init(&gb, buf, buf_len); flags = bytestream2_get_byte(&gb);...
1
void qemu_cpu_kick(void *env){}
1
int qemu_file_rate_limit(QEMUFile *f){ if (qemu_file_get_error(f)) { return 1; } if (f->xfer_limit > 0 && f->bytes_xfer > f->xfer_limit) { return 1; } return 0;}
1
GenericList *visit_next_list(Visitor *v, GenericList **list, Error **errp){ if (!error_is_set(errp)) { return v->next_list(v, list, errp); } return 0;}
1
static int handle_ping(URLContext *s, RTMPPacket *pkt){ RTMPContext *rt = s->priv_data; int t, ret; if (pkt->data_size < 2) { av_log(s, AV_LOG_ERROR, "Too short ping packet (%d)\n", pkt->data_size); return AVERROR_INVALIDDATA; t = AV_RB16(pkt->data); if (t == 6) { if ((ret = gen_pong(s, rt, pkt)) < 0) return 0;
1
static void draw_slice(AVFilterLink *inlink, int y, int h, int slice_dir){ AVFilterContext *ctx = inlink->dst; AVFilterLink *outlink = ctx->outputs[0]; AVFilterBufferRef *outpicref = outlink->out_buf; OverlayContext *over = ctx->priv; if (over->overpicref && !(over->x >= outpicref->video->w || over->y >= outpicref->vid...
1
static void handle_sys(DisasContext *s, uint32_t insn, bool isread, unsigned int op0, unsigned int op1, unsigned int op2, unsigned int crn, unsigned int crm, unsigned int rt){ const ARMCPRegInfo *ri; TCGv_i64 tcg_rt; ri = get_arm_cp_reginfo(s->cp_regs, ENCODE_AA64_CP_REG(CP_REG_ARM64_SYSREG_CP, crn, crm, op0, op1, op2)...
1
static void gic_cpu_write(gic_state *s, int cpu, int offset, uint32_t value){ switch (offset) { case 0x00: /* Control */ s->cpu_enabled[cpu] = (value & 1); DPRINTF("CPU %d %sabled\n", cpu, s->cpu_enabled ? "En" : "Dis"); break; case 0x04: /* Priority mask */ s->priority_mask[cpu] = (value & 0xff); break; case 0x08: /* ...
1
int avpicture_get_size(enum PixelFormat pix_fmt, int width, int height){ AVPicture dummy_pict; if(av_image_check_size(width, height, 0, NULL)) return -1; switch (pix_fmt) { case PIX_FMT_RGB8: case PIX_FMT_BGR8: case PIX_FMT_RGB4_BYTE: case PIX_FMT_BGR4_BYTE: case PIX_FMT_GRAY8: // do not include palette for these pseud...
1
static void qemu_rdma_cleanup(RDMAContext *rdma){ struct rdma_cm_event *cm_event; int ret, idx; if (rdma->cm_id && rdma->connected) { if (rdma->error_state) { RDMAControlHeader head = { .len = 0, .type = RDMA_CONTROL_ERROR, .repeat = 1, }; error_report("Early error. Sending error."); qemu_rdma_post_send_control(rdma, N...
1
static void write_picture(AVFormatContext *s, int index, AVPicture *picture, int pix_fmt, int w, int h){ UINT8 *buf, *src, *dest; int size, j, i; size = avpicture_get_size(pix_fmt, w, h); buf = malloc(size); if (!buf) return; /* XXX: not efficient, should add test if we can take directly the AVPicture */ switch(pix_fmt...
1
static int drawgrid_filter_frame(AVFilterLink *inlink, AVFrame *frame){ DrawBoxContext *drawgrid = inlink->dst->priv; int plane, x, y; uint8_t *row[4]; if (drawgrid->have_alpha) { for (y = 0; y < frame->height; y++) { row[0] = frame->data[0] + y * frame->linesize[0]; row[3] = frame->data[3] + y * frame->linesize[3]; fo...
1
void backup_start(const char *job_id, BlockDriverState *bs, BlockDriverState *target, int64_t speed, MirrorSyncMode sync_mode, BdrvDirtyBitmap *sync_bitmap, BlockdevOnError on_source_error, BlockdevOnError on_target_error, BlockCompletionFunc *cb, void *opaque, BlockJobTxn *txn, Error **errp){ int64_t len; BlockDriverI...
1
void OPPROTO op_POWER_srea (void){ T1 &= 0x1FUL; env->spr[SPR_MQ] = T0 >> T1; T0 = Ts0 >> T1; RETURN();}
1
void qmp_memchar_write(const char *device, const char *data, bool has_format, enum DataFormat format, Error **errp){ CharDriverState *chr; const uint8_t *write_data; int ret; size_t write_count; chr = qemu_chr_find(device); if (!chr) { error_setg(errp, "Device '%s' not found", device); return; if (qemu_is_chr(chr, "mem...
0
static void avc_biwgt_16width_msa(uint8_t *src, int32_t src_stride, uint8_t *dst, int32_t dst_stride, int32_t height, int32_t log2_denom, int32_t src_weight, int32_t dst_weight, int32_t offset_in){ uint8_t cnt; v16i8 src_wgt, dst_wgt, wgt; v16i8 src0, src1, src2, src3; v16i8 dst0, dst1, dst2, dst3; v16i8 vec0, vec1, ve...
1
int net_init_dump(const NetClientOptions *opts, const char *name, NetClientState *peer, Error **errp){ /* FIXME error_setg(errp, ...) on failure */ int len; const char *file; char def_file[128]; const NetdevDumpOptions *dump; assert(opts->kind == NET_CLIENT_OPTIONS_KIND_DUMP); dump = opts->dump; assert(peer); if (dump-...
1
int check_stream_specifier(AVFormatContext *s, AVStream *st, const char *spec){ if (*spec <= '9' && *spec >= '0') /* opt:index */ return strtol(spec, NULL, 0) == st->index; else if (*spec == 'v' || *spec == 'a' || *spec == 's' || *spec == 'd' || *spec == 't') { /* opt:[vasdt] */ enum AVMediaType type; switch (*spec++) ...
1
static void rm_read_metadata(AVFormatContext *s, int wide){ char buf[1024]; int i; for (i=0; i<FF_ARRAY_ELEMS(ff_rm_metadata); i++) { int len = wide ? avio_rb16(s->pb) : avio_r8(s->pb); get_strl(s->pb, buf, sizeof(buf), len); av_dict_set(&s->metadata, ff_rm_metadata[i], buf, 0); }}
1
void qmp_migrate(const char *uri, bool has_blk, bool blk, bool has_inc, bool inc, bool has_detach, bool detach, Error **errp){ Error *local_err = NULL; MigrationState *s = migrate_get_current(); MigrationParams params; const char *p; params.blk = has_blk && blk; params.shared = has_inc && inc; if (s->state == MIG_STATE...
1
static void stm32f2xx_timer_write(void *opaque, hwaddr offset, uint64_t val64, unsigned size){ STM32F2XXTimerState *s = opaque; uint32_t value = val64; int64_t now = qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL); uint32_t timer_val = 0; DB_PRINT("Write 0x%x, 0x%"HWADDR_PRIx"\n", value, offset); switch (offset) { case TIM_CR1: ...
1
av_cold void ff_vp8dsp_init(VP8DSPContext *dsp){ dsp->vp8_luma_dc_wht = vp8_luma_dc_wht_c; dsp->vp8_luma_dc_wht_dc = vp8_luma_dc_wht_dc_c; dsp->vp8_idct_add = vp8_idct_add_c; dsp->vp8_idct_dc_add = vp8_idct_dc_add_c; dsp->vp8_idct_dc_add4y = vp8_idct_dc_add4y_c; dsp->vp8_idct_dc_add4uv = vp8_idct_dc_add4uv_c; dsp->vp8_...
1
static void test_qga_file_ops(gconstpointer fix){ const TestFixture *fixture = fix; const unsigned char helloworld[] = "Hello World!\n"; const char *b64; gchar *cmd, *path, *enc; unsigned char *dec; QDict *ret, *val; int64_t id, eof; gsize count; FILE *f; char tmp[100]; /* open */ ret = qmp_fd(fixture->fd, "{'execute':...
1
static bool vexpress_cfgctrl_write(arm_sysctl_state *s, unsigned int dcc, unsigned int function, unsigned int site, unsigned int position, unsigned int device, uint32_t val){ /* We don't support anything other than DCC 0, board stack position 0 * or sites other than motherboard/daughterboard: */ if (dcc != 0 || positio...
1
pci_ebus_init1(PCIDevice *s){ isa_bus_new(&s->qdev); s->config[0x04] = 0x06; // command = bus master, pci mem s->config[0x05] = 0x00; s->config[0x06] = 0xa0; // status = fast back-to-back, 66MHz, no error s->config[0x07] = 0x03; // status = medium devsel s->config[0x09] = 0x00; // programming i/f s->config[0x0D] = 0x0a...
0
void ff_jpeg2000_set_significance(Jpeg2000T1Context *t1, int x, int y, int negative){ x++; y++; t1->flags[y][x] |= JPEG2000_T1_SIG; if (negative) { t1->flags[y][x + 1] |= JPEG2000_T1_SIG_W | JPEG2000_T1_SGN_W; t1->flags[y][x - 1] |= JPEG2000_T1_SIG_E | JPEG2000_T1_SGN_E; t1->flags[y + 1][x] |= JPEG2000_T1_SIG_N | JPEG2...
1
static int print_uint32(DeviceState *dev, Property *prop, char *dest, size_t len){ uint32_t *ptr = qdev_get_prop_ptr(dev, prop); return snprintf(dest, len, "%" PRIu32, *ptr);}
0
static inline int pic_is_unused(H264Context *h, Picture *pic){ if (pic->f.data[0] == NULL) return 1; if (pic->needs_realloc && !(pic->reference & DELAYED_PIC_REF)) return 1; return 0;}
0
static int vdpau_alloc(AVCodecContext *s){ InputStream *ist = s->opaque; int loglevel = (ist->hwaccel_id == HWACCEL_AUTO) ? AV_LOG_VERBOSE : AV_LOG_ERROR; AVVDPAUContext *vdpau_ctx; VDPAUContext *ctx; const char *display, *vendor; VdpStatus err; int i; ctx = av_mallocz(sizeof(*ctx)); if (!ctx) return AVERROR(ENOMEM); i...
0
void ff_h263_encode_mb(MpegEncContext * s, int16_t block[6][64], int motion_x, int motion_y){ int cbpc, cbpy, i, cbp, pred_x, pred_y; int16_t pred_dc; int16_t rec_intradc[6]; int16_t *dc_ptr[6]; const int interleaved_stats= (s->flags&CODEC_FLAG_PASS1); if (!s->mb_intra) { /* compute cbp */ cbp= get_p_cbp(s, block, moti...
0
static int hls_mux_init(AVFormatContext *s){ HLSContext *hls = s->priv_data; AVFormatContext *oc; AVFormatContext *vtt_oc; int i, ret; ret = avformat_alloc_output_context2(&hls->avf, hls->oformat, NULL, NULL); if (ret < 0) return ret; oc = hls->avf; oc->oformat = hls->oformat; oc->interrupt_callback = s->interrupt_call...