label
int64
0
1
func
stringlengths
21
96.3k
1
static void handle_port_status_write(EHCIState *s, int port, uint32_t val){ uint32_t *portsc = &s->portsc[port]; USBDevice *dev = s->ports[port].dev; /* Clear rwc bits */ *portsc &= ~(val & PORTSC_RWC_MASK); /* The guest may clear, but not set the PED bit */ *portsc &= val | ~PORTSC_PED; /* POWNER is masked out by RO_M...
1
static void vp6_build_huff_tree(VP56Context *s, uint8_t coeff_model[], const uint8_t *map, unsigned size, VLC *vlc){ Node nodes[2*size], *tmp = &nodes[size]; int a, b, i; /* first compute probabilities from model */ tmp[0].count = 256; for (i=0; i<size-1; i++) { a = tmp[i].count * coeff_model[i] >> 8; b = tmp[i].count ...
1
static void vga_putcharxy(DisplayState *ds, int x, int y, int ch, TextAttributes *t_attrib){ uint8_t *d; const uint8_t *font_ptr; unsigned int font_data, linesize, xorcol, bpp; int i; unsigned int fgcol, bgcol;#ifdef DEBUG_CONSOLE printf("x: %2i y: %2i", x, y); console_print_text_attributes(t_attrib, ch);#endif if (t_a...
1
static int iscsi_create(const char *filename, QemuOpts *opts, Error **errp){ int ret = 0; int64_t total_size = 0; BlockDriverState *bs; IscsiLun *iscsilun = NULL; QDict *bs_options; bs = bdrv_new("", &error_abort); /* Read out options */ total_size = qemu_opt_get_size_del(opts, BLOCK_OPT_SIZE, 0) / BDRV_SECTOR_SIZE; bs...
1
static int 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; int version; 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(...
1
static void scsi_write_request(SCSIDiskReq *r){ SCSIDiskState *s = DO_UPCAST(SCSIDiskState, qdev, r->req.dev); uint32_t n; /* No data transfer may already be in progress */ assert(r->req.aiocb == NULL); n = r->iov.iov_len / 512; if (n) { qemu_iovec_init_external(&r->qiov, &r->iov, 1); r->req.aiocb = bdrv_aio_writev(s->...
1
static int dxa_read_packet(AVFormatContext *s, AVPacket *pkt){ DXAContext *c = s->priv_data; int ret; uint32_t size; uint8_t buf[DXA_EXTRA_SIZE], pal[768+4]; int pal_size = 0; if(!c->readvid && c->has_sound && c->bytes_left){ c->readvid = 1; avio_seek(s->pb, c->wavpos, SEEK_SET); size = FFMIN(c->bytes_left, c->bpc); re...
1
static int qemu_rdma_post_recv_control(RDMAContext *rdma, int idx){ struct ibv_recv_wr *bad_wr; struct ibv_sge sge = { .addr = (uint64_t)(rdma->wr_data[idx].control), .length = RDMA_CONTROL_MAX_BUFFER, .lkey = rdma->wr_data[idx].control_mr->lkey, }; struct ibv_recv_wr recv_wr = { .wr_id = RDMA_WRID_RECV_CONTROL + idx, ...
1
static void adx_encode(unsigned char *adx,const short *wav,PREV *prev){int scale;int i;int s0,s1,s2,d;int max=0;int min=0;int data[32];s1 = prev->s1;s2 = prev->s2;for(i=0;i<32;i++) {s0 = wav[i];d = ((s0<<14) - SCALE1*s1 + SCALE2*s2)/BASEVOL;data[i]=d;if (max<d) max=d;if (min>d) min=d;s2 = s1;s1 = s0;}prev->s1 = s1;prev...
1
void virtqueue_fill(VirtQueue *vq, const VirtQueueElement *elem, unsigned int len, unsigned int idx){ VRingUsedElem uelem; trace_virtqueue_fill(vq, elem, len, idx); virtqueue_unmap_sg(vq, elem, len); idx = (idx + vq->used_idx) % vq->vring.num; uelem.id = elem->index; uelem.len = len; vring_used_write(vq, &uelem, idx);
1
void rtsp_close_streams(AVFormatContext *s){ RTSPState *rt = s->priv_data; int i; RTSPStream *rtsp_st; for (i = 0; i < rt->nb_rtsp_streams; i++) { rtsp_st = rt->rtsp_streams[i]; if (rtsp_st) { if (rtsp_st->transport_priv) { if (s->oformat) { AVFormatContext *rtpctx = rtsp_st->transport_priv; av_write_trailer(rtpctx); u...
1
void replay_save_instructions(void){ if (replay_file && replay_mode == REPLAY_MODE_RECORD) { replay_mutex_lock(); int diff = (int)(replay_get_current_step() - replay_state.current_step); if (diff > 0) { replay_put_event(EVENT_INSTRUCTION); replay_put_dword(diff); replay_state.current_step += diff; } replay_mutex_unlock...
1
int load_vmstate(const char *name){ BlockDriverState *bs, *bs1; QEMUSnapshotInfo sn; QEMUFile *f; int ret; /* Verify if there is a device that doesn't support snapshots and is writable */ bs = NULL; while ((bs = bdrv_next(bs))) { if (bdrv_is_removable(bs) || bdrv_is_read_only(bs)) { continue; } if (!bdrv_can_snapshot(b...
1
static int flv_write_header(AVFormatContext *s){ AVIOContext *pb = s->pb; FLVContext *flv = s->priv_data; AVCodecContext *audio_enc = NULL, *video_enc = NULL, *data_enc = NULL; int i, metadata_count = 0; double framerate = 0.0; int64_t metadata_size_pos, data_size, metadata_count_pos; AVDictionaryEntry *tag = NULL; for...
1
void ff_htmlmarkup_to_ass(void *log_ctx, AVBPrint *dst, const char *in){ char *param, buffer[128], tmp[128]; int len, tag_close, sptr = 1, line_start = 1, an = 0, end = 0; SrtStack stack[16]; stack[0].tag[0] = 0; strcpy(stack[0].param[PARAM_SIZE], "{\\fs}"); strcpy(stack[0].param[PARAM_COLOR], "{\\c}"); strcpy(stack[0]...
1
static void qpa_fini_in (HWVoiceIn *hw){ void *ret; PAVoiceIn *pa = (PAVoiceIn *) hw; audio_pt_lock (&pa->pt, AUDIO_FUNC); pa->done = 1; audio_pt_unlock_and_signal (&pa->pt, AUDIO_FUNC); audio_pt_join (&pa->pt, &ret, AUDIO_FUNC); if (pa->s) { pa_simple_free (pa->s); pa->s = NULL; } audio_pt_fini (&pa->pt, AUDIO_FUNC); ...
1
static void onenand_reset(OneNANDState *s, int cold){ memset(&s->addr, 0, sizeof(s->addr)); s->command = 0; s->count = 1; s->bufaddr = 0; s->config[0] = 0x40c0; s->config[1] = 0x0000; onenand_intr_update(s); qemu_irq_raise(s->rdy); s->status = 0x0000; s->intstatus = cold ? 0x8080 : 0x8010; s->unladdr[0] = 0; s->unladdr...
1
static void flush_packet(AVFormatContext *ctx, int stream_index, int64_t pts, int64_t dts, int64_t scr){ MpegMuxContext *s = ctx->priv_data; StreamInfo *stream = ctx->streams[stream_index]->priv_data; uint8_t *buf_ptr; int size, payload_size, startcode, id, len, stuffing_size, i, header_len; uint8_t buffer[128]; id = s...
1
static QPCIDevice *get_pci_device(void **bmdma_base, void **ide_base){ QPCIDevice *dev; uint16_t vendor_id, device_id; if (!pcibus) { pcibus = qpci_init_pc(NULL); } /* Find PCI device and verify it's the right one */ dev = qpci_device_find(pcibus, QPCI_DEVFN(IDE_PCI_DEV, IDE_PCI_FUNC)); g_assert(dev != NULL); vendor_id...
1
static av_always_inline void rgb16_32ToUV_half_c_template(int16_t *dstU, int16_t *dstV, const uint8_t *src, int width, enum AVPixelFormat origin, int shr, int shg, int shb, int shp, int maskr, int maskg, int maskb, int rsh, int gsh, int bsh, int S, int32_t *rgb2yuv){ const int ru = rgb2yuv[RU_IDX] << rsh, gu = rgb2yuv[...
0
static int read_header(AVFormatContext *s1){ VideoDemuxData *s = s1->priv_data; int first_index, last_index, ret = 0; int width = 0, height = 0; AVStream *st; enum PixelFormat pix_fmt = PIX_FMT_NONE; AVRational framerate; s1->ctx_flags |= AVFMTCTX_NOHEADER; st = avformat_new_stream(s1, NULL); if (!st) { return AVERROR(...
0
static int qdraw_probe(AVProbeData *p){ const uint8_t *b = p->buf; if (!b[10] && AV_RB32(b+11) == 0x1102ff0c && !b[15] || p->buf_size >= 528 && !b[522] && AV_RB32(b+523) == 0x1102ff0c && !b[527]) return AVPROBE_SCORE_EXTENSION + 1; return 0;}
0
static int decode_format80(VqaContext *s, int src_size, unsigned char *dest, int dest_size, int check_size) { int dest_index = 0; int count, opcode, start; int src_pos; unsigned char color; int i; start = bytestream2_tell(&s->gb); while (bytestream2_tell(&s->gb) - start < src_size) { opcode = bytestream2_get_byte(&s->g...
0
static int open_input_file(OptionsContext *o, const char *filename){ InputFile *f; AVFormatContext *ic; AVInputFormat *file_iformat = NULL; int err, i, ret; int64_t timestamp; uint8_t buf[128]; AVDictionary **opts; AVDictionary *unused_opts = NULL; AVDictionaryEntry *e = NULL; int orig_nb_streams; // number of streams ...
0
static int theora_packet(AVFormatContext *s, int idx){ struct ogg *ogg = s->priv_data; struct ogg_stream *os = ogg->streams + idx; int duration; /* first packet handling here we parse the duration of each packet in the first page and compare the total duration to the page granule to find the encoder delay and set the f...
0
static int mov_write_wfex_tag(AVIOContext *pb, MOVTrack *track){ int64_t pos = avio_tell(pb); avio_wb32(pb, 0); ffio_wfourcc(pb, "wfex"); ff_put_wav_header(pb, track->enc, FF_PUT_WAV_HEADER_FORCE_WAVEFORMATEX); return update_size(pb, pos);}
0
static void denoise_depth(HQDN3DContext *s, uint8_t *src, uint8_t *dst, uint16_t *line_ant, uint16_t **frame_ant_ptr, int w, int h, int sstride, int dstride, int16_t *spatial, int16_t *temporal, int depth){ // FIXME: For 16bit depth, frame_ant could be a pointer to the previous // filtered frame rather than a separate ...
0
static void FUNC(transquant_bypass8x8)(uint8_t *_dst, int16_t *coeffs, ptrdiff_t stride){ int x, y; pixel *dst = (pixel *)_dst; stride /= sizeof(pixel); for (y = 0; y < 8; y++) { for (x = 0; x < 8; x++) { dst[x] += *coeffs; coeffs++; } dst += stride; }}
0
static void tcg_out_qemu_st (TCGContext *s, const TCGArg *args, int opc){ int addr_reg, r0, r1, rbase, data_reg, mem_index, bswap;#ifdef CONFIG_SOFTMMU int r2; void *label1_ptr, *label2_ptr;#endif data_reg = *args++; addr_reg = *args++; mem_index = *args;#ifdef CONFIG_SOFTMMU r0 = 3; r1 = 4; r2 = 0; rbase = 0; tcg_out_...
0
int omap_validate_imif_addr(struct omap_mpu_state_s *s, target_phys_addr_t addr){ return addr >= OMAP_IMIF_BASE && addr < OMAP_IMIF_BASE + s->sram_size;}
0
static sPAPRCapabilities default_caps_with_cpu(sPAPRMachineState *spapr, CPUState *cs){ sPAPRMachineClass *smc = SPAPR_MACHINE_GET_CLASS(spapr); sPAPRCapabilities caps; caps = smc->default_caps; /* TODO: clamp according to cpu model */ return caps;}
0
int qio_channel_socket_listen_sync(QIOChannelSocket *ioc, SocketAddressLegacy *addr, Error **errp){ int fd; trace_qio_channel_socket_listen_sync(ioc, addr); fd = socket_listen(addr, errp); if (fd < 0) { trace_qio_channel_socket_listen_fail(ioc); return -1; } trace_qio_channel_socket_listen_complete(ioc, fd); if (qio_ch...
0
uint64_t ptimer_get_count(ptimer_state *s){ int64_t now; uint64_t counter; if (s->enabled) { now = qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL); /* Figure out the current counter value. */ if (now - s->next_event > 0 || s->period == 0) { /* Prevent timer underflowing if it should already have triggered. */ counter = 0; } else...
0
int cpu_x86_handle_mmu_fault(CPUX86State *env, target_ulong addr, int is_write1, int is_user, int is_softmmu){ uint64_t ptep, pte; uint32_t pdpe_addr, pde_addr, pte_addr; int error_code, is_dirty, prot, page_size, ret, is_write; unsigned long paddr, page_offset; target_ulong vaddr, virt_addr; #if defined(DEBUG_MMU) pri...
0
static int protocol_client_auth_vnc(VncState *vs, uint8_t *data, size_t len){ unsigned char response[VNC_AUTH_CHALLENGE_SIZE]; int i, j, pwlen; unsigned char key[8]; time_t now = time(NULL); if (!vs->vd->password || !vs->vd->password[0]) { VNC_DEBUG("No password configured on server"); goto reject; } if (vs->vd->expire...
0
static void img_copy(uint8_t *dst, int dst_wrap, uint8_t *src, int src_wrap, int width, int height){ for(;height > 0; height--) { memcpy(dst, src, width); dst += dst_wrap; src += src_wrap; }}
0
static void patch_instruction(VAPICROMState *s, X86CPU *cpu, target_ulong ip){ CPUState *cs = CPU(cpu); CPUX86State *env = &cpu->env; VAPICHandlers *handlers; uint8_t opcode[2]; uint32_t imm32 = 0; target_ulong current_pc = 0; target_ulong current_cs_base = 0; uint32_t current_flags = 0; if (smp_cpus == 1) { handlers =...
0
static void qcow_close(BlockDriverState *bs){ BDRVQcowState *s = bs->opaque; qcrypto_cipher_free(s->cipher); s->cipher = NULL; g_free(s->l1_table); qemu_vfree(s->l2_cache); g_free(s->cluster_cache); g_free(s->cluster_data); migrate_del_blocker(s->migration_blocker); error_free(s->migration_blocker);}
0
static void qmp_input_free(Visitor *v){ QmpInputVisitor *qiv = to_qiv(v); while (!QSLIST_EMPTY(&qiv->stack)) { StackObject *tos = QSLIST_FIRST(&qiv->stack); QSLIST_REMOVE_HEAD(&qiv->stack, node); qmp_input_stack_object_free(tos); } qobject_decref(qiv->root); g_free(qiv);}
0
static void qcow_aio_write_cb(void *opaque, int ret){ QCowAIOCB *acb = opaque; BlockDriverState *bs = acb->common.bs; BDRVQcowState *s = bs->opaque; int index_in_cluster; const uint8_t *src_buf; int n_end; acb->hd_aiocb = NULL; if (ret >= 0) { ret = qcow2_alloc_cluster_link_l2(bs, acb->cluster_offset, &acb->l2meta); } ...
0
int coroutine_fn blk_co_preadv(BlockBackend *blk, int64_t offset, unsigned int bytes, QEMUIOVector *qiov, BdrvRequestFlags flags){ int ret; trace_blk_co_preadv(blk, blk_bs(blk), offset, bytes, flags); ret = blk_check_byte_request(blk, offset, bytes); if (ret < 0) { return ret; } /* throttling disk I/O */ if (blk->publi...
0
bool virtio_disk_is_scsi(void){ if (guessed_disk_nature) { return (blk_cfg.blk_size == 512); } return (blk_cfg.geometry.heads == 255) && (blk_cfg.geometry.sectors == 63) && (blk_cfg.blk_size == 512);}
0
iscsi_aio_discard(BlockDriverState *bs, int64_t sector_num, int nb_sectors, BlockDriverCompletionFunc *cb, void *opaque){ IscsiLun *iscsilun = bs->opaque; struct iscsi_context *iscsi = iscsilun->iscsi; IscsiAIOCB *acb; struct unmap_list list[1]; acb = qemu_aio_get(&iscsi_aiocb_info, bs, cb, opaque); acb->iscsilun = isc...
0
static void stream_desc_store(struct Stream *s, hwaddr addr){ struct SDesc *d = &s->desc; int i; /* Convert from host endianness into LE. */ d->buffer_address = cpu_to_le64(d->buffer_address); d->nxtdesc = cpu_to_le64(d->nxtdesc); d->control = cpu_to_le32(d->control); d->status = cpu_to_le32(d->status); for (i = 0; i <...
0
static void cs_mem_write(void *opaque, target_phys_addr_t addr, uint64_t val, unsigned size){ CSState *s = opaque; uint32_t saddr; saddr = addr >> 2; trace_cs4231_mem_writel_reg(saddr, s->regs[saddr], val); switch (saddr) { case 1: trace_cs4231_mem_writel_dreg(CS_RAP(s), s->dregs[CS_RAP(s)], val); switch(CS_RAP(s)) { c...
0
static int mxf_parse_structural_metadata(MXFContext *mxf){ MXFPackage *material_package = NULL; MXFPackage *source_package = NULL; MXFPackage *temp_package = NULL; int i, j, k; dprintf("metadata sets count %d\n", mxf->metadata_sets_count); /* TODO: handle multiple material packages (OP3x) */ for (i = 0; i < mxf->packag...
0
void virtqueue_map(VirtQueueElement *elem){ virtqueue_map_iovec(elem->in_sg, elem->in_addr, &elem->in_num, VIRTQUEUE_MAX_SIZE, 1); virtqueue_map_iovec(elem->out_sg, elem->out_addr, &elem->out_num, VIRTQUEUE_MAX_SIZE, 0);}
1
static SCSIDiskReq *scsi_new_request(SCSIDiskState *s, uint32_t tag, uint32_t lun){ SCSIRequest *req; SCSIDiskReq *r; req = scsi_req_alloc(sizeof(SCSIDiskReq), &s->qdev, tag, lun); r = DO_UPCAST(SCSIDiskReq, req, req); r->iov.iov_base = qemu_blockalign(s->bs, SCSI_DMA_BUF_SIZE); return r;}
1
static int disas_vfp_insn(CPUARMState * env, DisasContext *s, uint32_t insn){ uint32_t rd, rn, rm, op, i, n, offset, delta_d, delta_m, bank_mask; int dp, veclen; TCGv addr; TCGv tmp; TCGv tmp2; if (!arm_feature(env, ARM_FEATURE_VFP)) return 1; if (!s->vfp_enabled) { /* VFP disabled. Only allow fmxr/fmrx to/from some co...
1
static void do_address_space_destroy(AddressSpace *as){ MemoryListener *listener; address_space_destroy_dispatch(as); QTAILQ_FOREACH(listener, &memory_listeners, link) { assert(listener->address_space_filter != as); } flatview_unref(as->current_map); g_free(as->name); g_free(as->ioeventfds);}
1
static int tm2_read_stream(TM2Context *ctx, const uint8_t *buf, int stream_id) { int i; int cur = 0; int skip = 0; int len, toks; TM2Codes codes; /* get stream length in dwords */ len = AV_RB32(buf); buf += 4; cur += 4; skip = len * 4 + 4; if(len == 0) return 4; toks = AV_RB32(buf); buf += 4; cur += 4; if(toks & 1) { l...
1
static void do_dma_memory_set(dma_addr_t addr, uint8_t c, dma_addr_t len){#define FILLBUF_SIZE 512 uint8_t fillbuf[FILLBUF_SIZE]; int l; memset(fillbuf, c, FILLBUF_SIZE); while (len > 0) { l = len < FILLBUF_SIZE ? len : FILLBUF_SIZE; cpu_physical_memory_rw(addr, fillbuf, l, true); len -= len; addr += len; }}
1
static void mm_rearm_timer(struct qemu_alarm_timer *t, int64_t delta){ int nearest_delta_ms = (delta + 999999) / 1000000; if (nearest_delta_ms < 1) { nearest_delta_ms = 1; } timeKillEvent(mm_timer); mm_timer = timeSetEvent(nearest_delta_ms, mm_period, mm_alarm_handler, (DWORD_PTR)t, TIME_ONESHOT | TIME_CALLBACK_FUNCTIO...
0
static void DEF(avg, pixels16_x2)(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h){ MOVQ_BFE(mm6); JUMPALIGN(); do { __asm__ volatile( "movq %1, %%mm0 \n\t" "movq 1%1, %%mm1 \n\t" "movq %0, %%mm3 \n\t" PAVGB(%%mm0, %%mm1, %%mm2, %%mm6) PAVGB_MMX(%%mm3, %%mm2, %%mm0, %%mm6) "movq %%mm0, %0 \n\t" "movq ...
0
static int config_output(AVFilterLink *outlink) { static const char hdcd_baduse[] = "The HDCD filter is unlikely to produce a desirable result in this context."; AVFilterContext *ctx = outlink->src; HDCDContext *s = ctx->priv; AVFilterLink *lk = outlink; while(lk != NULL) { AVFilterContext *nextf = lk->dst; if (lk->typ...
0
static inline int copy_siginfo_to_user(target_siginfo_t *tinfo, const target_siginfo_t *info){ tswap_siginfo(tinfo, info); return 0;}
0
iscsi_aio_writev(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 size; uint32_t num_sectors; uint64_t lba;#if !defined(LIBISCSI_FEATURE_IOVE...
0
static void mtree_print_flatview(fprintf_function p, void *f, AddressSpace *as){ FlatView *view = address_space_get_flatview(as); FlatRange *range = &view->ranges[0]; MemoryRegion *mr; int n = view->nr; if (n <= 0) { p(f, MTREE_INDENT "No rendered FlatView for " "address space '%s'\n", as->name); flatview_unref(view); ...
0
static inline uint32_t efsctuf(uint32_t val){ CPU_FloatU u; float32 tmp; u.l = val; /* NaN are not treated the same way IEEE 754 does */ if (unlikely(float32_is_nan(u.f))) return 0; tmp = uint64_to_float32(1ULL << 32, &env->vec_status); u.f = float32_mul(u.f, tmp, &env->vec_status); return float32_to_uint32(u.f, &env->...
0
void ppce500_init(PPCE500Params *params){ MemoryRegion *address_space_mem = get_system_memory(); MemoryRegion *ram = g_new(MemoryRegion, 1); PCIBus *pci_bus; CPUPPCState *env = NULL; uint64_t elf_entry; uint64_t elf_lowaddr; hwaddr entry=0; hwaddr loadaddr=UIMAGE_LOAD_BASE; target_long kernel_size=0; target_ulong dt_ba...
0
int nbd_trip(BlockDriverState *bs, int csock, off_t size, uint64_t dev_offset, uint32_t nbdflags, uint8_t *data){ struct nbd_request request; struct nbd_reply reply; int ret; TRACE("Reading request."); if (nbd_receive_request(csock, &request) == -1) return -1; if (request.len + NBD_REPLY_SIZE > NBD_BUFFER_SIZE) { LOG("...
0
test_opts_range_unvisited(void){ intList *list = NULL; intList *tail; QemuOpts *opts; Visitor *v; opts = qemu_opts_parse(qemu_find_opts("userdef"), "ilist=0-2", false, &error_abort); v = opts_visitor_new(opts); visit_start_struct(v, NULL, NULL, 0, &error_abort); /* Would be simpler if the visitor genuinely supported vi...
0
static int mpeg_decode_mb(MpegEncContext *s, DCTELEM block[12][64]){ int i, j, k, cbp, val, mb_type, motion_type; dprintf("decode_mb: x=%d y=%d\n", s->mb_x, s->mb_y); assert(s->mb_skiped==0); if (s->mb_skip_run-- != 0) { if(s->pict_type == I_TYPE){ av_log(s->avctx, AV_LOG_ERROR, "skiped MB in I frame at %d %d\n", s->mb...
0
static av_cold int rv10_decode_init(AVCodecContext *avctx){ RVDecContext *rv = avctx->priv_data; MpegEncContext *s = &rv->m; static int done=0; int major_ver, minor_ver, micro_ver; if (avctx->extradata_size < 8) { av_log(avctx, AV_LOG_ERROR, "Extradata is too small.\n"); return -1; } ff_MPV_decode_defaults(s); s->avctx...
0
static inline float32 ucf64_itos(uint32_t i){ union { uint32_t i; float32 s; } v; v.i = i; return v.s;}
0
static int get_whole_cluster(BlockDriverState *bs, VmdkExtent *extent, uint64_t cluster_offset, uint64_t offset, bool allocate){ /* 128 sectors * 512 bytes each = grain size 64KB */ uint8_t whole_grain[extent->cluster_sectors * 512]; /* we will be here if it's first write on non-exist grain(cluster). * try to read from...
0
static void virtio_pci_reset(DeviceState *qdev){ VirtIOPCIProxy *proxy = VIRTIO_PCI(qdev); VirtioBusState *bus = VIRTIO_BUS(&proxy->bus); virtio_pci_stop_ioeventfd(proxy); virtio_bus_reset(bus); msix_unuse_all_vectors(&proxy->pci_dev); proxy->flags &= ~VIRTIO_PCI_FLAG_BUS_MASTER_BUG;}
0
void nbd_client_session_attach_aio_context(NbdClientSession *client, AioContext *new_context){ aio_set_fd_handler(new_context, client->sock, nbd_reply_ready, NULL, client);}
0
int ram_save_live(Monitor *mon, QEMUFile *f, int stage, void *opaque){ ram_addr_t addr; uint64_t bytes_transferred_last; double bwidth = 0; uint64_t expected_time = 0; if (stage < 0) { cpu_physical_memory_set_dirty_tracking(0); return 0; } if (cpu_physical_sync_dirty_bitmap(0, TARGET_PHYS_ADDR_MAX) != 0) { qemu_file_se...
0
static void test_submit(void){ WorkerTestData data = { .n = 0 }; thread_pool_submit(worker_cb, &data); qemu_aio_flush(); g_assert_cmpint(data.n, ==, 1);}
0
int bdrv_commit(BlockDriverState *bs){ BlockDriver *drv = bs->drv; int64_t sector, total_sectors, length, backing_length; int n, ro, open_flags; int ret = 0; uint8_t *buf = NULL; char filename[PATH_MAX]; if (!drv) return -ENOMEDIUM; if (!bs->backing_hd) { return -ENOTSUP; } if (bdrv_in_use(bs) || bdrv_in_use(bs->backin...
0
static inline uint32_t search_chunk(BDRVDMGState* s,int sector_num){ /* binary search */ uint32_t chunk1=0,chunk2=s->n_chunks,chunk3; while(chunk1!=chunk2) {chunk3 = (chunk1+chunk2)/2;if(s->sectors[chunk3]>sector_num) chunk2 = chunk3;else if(s->sectors[chunk3]+s->sectorcounts[chunk3]>sector_num) return chunk3;else chun...
1
static inline void RENAME(rgb32tobgr16)(const uint8_t *src, uint8_t *dst, long src_size){const uint8_t *s = src;const uint8_t *end;#ifdef HAVE_MMXconst uint8_t *mm_end;#endifuint16_t *d = (uint16_t *)dst;end = s + src_size;#ifdef HAVE_MMX__asm __volatile(PREFETCH"%0"::"m"(*src):"memory");__asm __volatile( "movq%0, %%mm...
1
static void conv411(uint8_t *dst, int dst_wrap, uint8_t *src, int src_wrap, int width, int height){ int w, c; uint8_t *s1, *s2, *d; for(;height > 0; height--) { s1 = src; s2 = src + src_wrap; d = dst; for(w = width;w > 0; w--) { c = (s1[0] + s2[0]) >> 1; d[0] = c; d[1] = c; s1++; s2++; d += 2; } src += src_wrap * 2; ds...
1
static void *acpi_set_bsel(PCIBus *bus, void *opaque){ unsigned *bsel_alloc = opaque; unsigned *bus_bsel; if (qbus_is_hotpluggable(BUS(bus))) { bus_bsel = g_malloc(sizeof *bus_bsel); *bus_bsel = (*bsel_alloc)++; object_property_add_uint32_ptr(OBJECT(bus), ACPI_PCIHP_PROP_BSEL, bus_bsel, NULL); } return bsel_alloc;}
1
static void vncws_send_handshake_response(VncState *vs, const char* key){ char combined_key[WS_CLIENT_KEY_LEN + WS_GUID_LEN + 1]; char hash[SHA1_DIGEST_LEN]; size_t hash_size = SHA1_DIGEST_LEN; char *accept = NULL, *response = NULL; gnutls_datum_t in; g_strlcpy(combined_key, key, WS_CLIENT_KEY_LEN + 1); g_strlcat(combi...
1
int ff_audio_mix_set_matrix(AudioMix *am, const double *matrix, int stride){ int i, o, i0, o0, ret; char in_layout_name[128]; char out_layout_name[128]; if ( am->in_channels <= 0 || am->in_channels > AVRESAMPLE_MAX_CHANNELS || am->out_channels <= 0 || am->out_channels > AVRESAMPLE_MAX_CHANNELS) { av_log(am->avr, AV_LOG...
1
BlockBackend *blk_new_open(const char *filename, const char *reference, QDict *options, int flags, Error **errp){ BlockBackend *blk; BlockDriverState *bs; uint64_t perm; /* blk_new_open() is mainly used in .bdrv_create implementations and the * tools where sharing isn't a concern because the BDS stays private, so we * ...
0
static int pci_dec_21154_init_device(SysBusDevice *dev){ UNINState *s; int pci_mem_config, pci_mem_data; /* Uninorth bridge */ s = FROM_SYSBUS(UNINState, dev); // XXX: s = &pci_bridge[2]; pci_mem_config = cpu_register_io_memory(pci_unin_config_read, pci_unin_config_write, s); pci_mem_data = cpu_register_io_memory(pci_u...
0
static uint32_t rtas_set_isolation_state(uint32_t idx, uint32_t state){ sPAPRDRConnector *drc = spapr_drc_by_index(idx); sPAPRDRConnectorClass *drck; if (!drc) { return RTAS_OUT_PARAM_ERROR; } drck = SPAPR_DR_CONNECTOR_GET_CLASS(drc); return drck->set_isolation_state(drc, state);}
0
static int64_t nfs_get_allocated_file_size(BlockDriverState *bs){ NFSClient *client = bs->opaque; NFSRPC task = {0}; struct stat st; if (bdrv_is_read_only(bs) && !(bs->open_flags & BDRV_O_NOCACHE)) { return client->st_blocks * 512; } task.st = &st; if (nfs_fstat_async(client->context, client->fh, nfs_co_generic_cb, &ta...
0
static CadenceTimerState *cadence_timer_from_addr(void *opaque, target_phys_addr_t offset){ unsigned int index; CadenceTTCState *s = (CadenceTTCState *)opaque; index = (offset >> 2) % 3; return &s->timer[index];}
0
static ssize_t net_rx_packet(NetClientState *nc, const uint8_t *buf, size_t size){ struct XenNetDev *netdev = qemu_get_nic_opaque(nc); netif_rx_request_t rxreq; RING_IDX rc, rp; void *page; if (netdev->xendev.be_state != XenbusStateConnected) { return -1; } rc = netdev->rx_ring.req_cons; rp = netdev->rx_ring.sring->req...
0
static void mb_add_mod(MultibootState *s, target_phys_addr_t start, target_phys_addr_t end, target_phys_addr_t cmdline_phys){ char *p; assert(s->mb_mods_count < s->mb_mods_avail); p = (char *)s->mb_buf + s->offset_mbinfo + MB_MOD_SIZE * s->mb_mods_count; stl_p(p + MB_MOD_START, start); stl_p(p + MB_MOD_END, end); stl_p...
0
static void vnc_init_basic_info_from_server_addr(QIOChannelSocket *ioc, VncBasicInfo *info, Error **errp){ SocketAddress *addr = NULL; if (!ioc) { error_setg(errp, "No listener socket available"); return; } addr = qio_channel_socket_get_local_address(ioc, errp); if (!addr) { return; } vnc_init_basic_info(addr, info, er...
0
static void nbd_teardown_connection(NbdClientSession *client){ /* finish any pending coroutines */ shutdown(client->sock, 2); nbd_recv_coroutines_enter_all(client); nbd_client_session_detach_aio_context(client); closesocket(client->sock); client->sock = -1;}
0
static int usb_uhci_common_initfn(UHCIState *s){ uint8_t *pci_conf = s->dev.config; int i; pci_conf[PCI_REVISION_ID] = 0x01; // revision number pci_conf[PCI_CLASS_PROG] = 0x00; pci_config_set_class(pci_conf, PCI_CLASS_SERIAL_USB); /* TODO: reset value should be 0. */ pci_conf[PCI_INTERRUPT_PIN] = 4; // interrupt pin 3 ...
0
Object *user_creatable_add_opts(QemuOpts *opts, Error **errp){ Visitor *v; QDict *pdict; Object *obj; const char *id = qemu_opts_id(opts); const char *type = qemu_opt_get(opts, "qom-type"); if (!type) { error_setg(errp, QERR_MISSING_PARAMETER, "qom-type"); return NULL; } if (!id) { error_setg(errp, QERR_MISSING_PARAMET...
0
int ff_generate_sliding_window_mmcos(H264Context *h, int first_slice){ MMCO mmco_temp[MAX_MMCO_COUNT], *mmco = first_slice ? h->mmco : mmco_temp; int mmco_index = 0, i = 0; assert(h->long_ref_count + h->short_ref_count <= h->sps.ref_frame_count); if (h->short_ref_count && h->long_ref_count + h->short_ref_count == h->sp...
0
static int do_alloc_cluster_offset(BlockDriverState *bs, uint64_t guest_offset, uint64_t *host_offset, unsigned int *nb_clusters){ BDRVQcowState *s = bs->opaque; int ret; trace_qcow2_do_alloc_clusters_offset(qemu_coroutine_self(), guest_offset, *host_offset, *nb_clusters); ret = handle_dependencies(bs, guest_offset, nb...
0
static int pit_initfn(ISADevice *dev){ PITState *pit = DO_UPCAST(PITState, dev, dev); PITChannelState *s; s = &pit->channels[0]; /* the timer 0 is connected to an IRQ */ s->irq_timer = qemu_new_timer(vm_clock, pit_irq_timer, s); s->irq = isa_reserve_irq(pit->irq); register_ioport_write(pit->iobase, 4, 1, pit_ioport_wri...
0
int64_t bdrv_get_block_status_above(BlockDriverState *bs, BlockDriverState *base, int64_t sector_num, int nb_sectors, int *pnum){ Coroutine *co; BdrvCoGetBlockStatusData data = { .bs = bs, .base = base, .sector_num = sector_num, .nb_sectors = nb_sectors, .pnum = pnum, .done = false, }; if (qemu_in_coroutine()) { /* Fas...
0
static int usb_linux_update_endp_table(USBHostDevice *s){ uint8_t *descriptors; uint8_t devep, type, alt_interface; int interface, length, i, ep, pid; struct endp_data *epd; for (i = 0; i < MAX_ENDPOINTS; i++) { s->ep_in[i].type = INVALID_EP_TYPE; s->ep_out[i].type = INVALID_EP_TYPE; } if (s->configuration == 0) { /* n...
0
pvscsi_ring_init_msg(PVSCSIRingInfo *m, PVSCSICmdDescSetupMsgRing *ri){ int i; uint32_t len_log2; uint32_t ring_size; if (ri->numPages > PVSCSI_SETUP_MSG_RING_MAX_NUM_PAGES) { return -1; } ring_size = ri->numPages * PVSCSI_MAX_NUM_MSG_ENTRIES_PER_PAGE; len_log2 = pvscsi_log2(ring_size - 1); m->msg_len_mask = MASK(len_l...
0
void ppc_hash64_stop_access(PowerPCCPU *cpu, uint64_t token){ if (cpu->env.external_htab == MMU_HASH64_KVM_MANAGED_HPT) { kvmppc_hash64_free_pteg(token); }}
0
static void puv3_load_kernel(const char *kernel_filename){ int size; assert(kernel_filename != NULL); /* only zImage format supported */ size = load_image_targphys(kernel_filename, KERNEL_LOAD_ADDR, KERNEL_MAX_SIZE); if (size < 0) { hw_error("Load kernel error: '%s'\n", kernel_filename); } /* cheat curses that we have ...
0
static int qemu_rdma_write_one(QEMUFile *f, RDMAContext *rdma, int current_index, uint64_t current_addr, uint64_t length){ struct ibv_sge sge; struct ibv_send_wr send_wr = { 0 }; struct ibv_send_wr *bad_wr; int reg_result_idx, ret, count = 0; uint64_t chunk, chunks; uint8_t *chunk_start, *chunk_end; RDMALocalBlock *blo...
0
void qmp_block_commit(bool has_job_id, const char *job_id, const char *device, bool has_base, const char *base, bool has_top, const char *top, bool has_backing_file, const char *backing_file, bool has_speed, int64_t speed, Error **errp){ BlockDriverState *bs; BlockDriverState *base_bs, *top_bs; AioContext *aio_context;...
0
static void ffmpeg_cleanup(int ret){ int i, j; if (do_benchmark) { int maxrss = getmaxrss() / 1024; printf("bench: maxrss=%ikB\n", maxrss); } for (i = 0; i < nb_filtergraphs; i++) { FilterGraph *fg = filtergraphs[i]; avfilter_graph_free(&fg->graph); for (j = 0; j < fg->nb_inputs; j++) { av_freep(&fg->inputs[j]->name); ...
0
Aml *aml_local(int num){ Aml *var; uint8_t op = 0x60 /* Local0Op */ + num; assert(num <= 7); var = aml_opcode(op); return var;}