label
int64
0
1
func
stringlengths
21
96.3k
0
static void isa_mmio_writeb (void *opaque, target_phys_addr_t addr, uint32_t val){ cpu_outb(addr & IOPORTS_MASK, val);}
0
static void kill_channel(DBDMA_channel *ch){ DBDMA_DPRINTF("kill_channel\n"); ch->regs[DBDMA_STATUS] |= cpu_to_be32(DEAD); ch->regs[DBDMA_STATUS] &= cpu_to_be32(~ACTIVE); qemu_irq_raise(ch->irq);}
0
static void scsi_do_read(SCSIDiskReq *r, int ret){ SCSIDiskState *s = DO_UPCAST(SCSIDiskState, qdev, r->req.dev); SCSIDiskClass *sdc = (SCSIDiskClass *) object_get_class(OBJECT(s)); assert (r->req.aiocb == NULL); if (r->req.io_canceled) { scsi_req_cancel_complete(&r->req); goto done; } if (ret < 0) { if (scsi_handle_rw...
0
static inline void _cpu_ppc_store_hdecr(PowerPCCPU *cpu, uint32_t hdecr, uint32_t value, int is_excp){ ppc_tb_t *tb_env = cpu->env.tb_env; if (tb_env->hdecr_timer != NULL) { __cpu_ppc_store_decr(cpu, &tb_env->hdecr_next, tb_env->hdecr_timer, &cpu_ppc_hdecr_excp, hdecr, value, is_excp); }}
0
static void readline_printf_func(void *opaque, const char *fmt, ...){ va_list ap; va_start(ap, fmt); vprintf(fmt, ap); va_end(ap);}
0
static ssize_t virtio_net_receive(VLANClientState *vc, const uint8_t *buf, size_t size){ VirtIONet *n = vc->opaque; struct virtio_net_hdr_mrg_rxbuf *mhdr = NULL; size_t hdr_len, offset, i; if (!do_virtio_net_can_receive(n, size)) return 0; if (!receive_filter(n, buf, size)) return size; /* hdr_len refers to the header ...
0
static CharDriverState *text_console_init(ChardevVC *vc, Error **errp){ CharDriverState *chr; QemuConsole *s; unsigned width = 0; unsigned height = 0; chr = qemu_chr_alloc(); if (vc->has_width) { width = vc->width; } else if (vc->has_cols) { width = vc->cols * FONT_WIDTH; } if (vc->has_height) { height = vc->height; } ...
0
static int vhdx_log_flush(BlockDriverState *bs, BDRVVHDXState *s, VHDXLogSequence *logs){ int ret = 0; int i; uint32_t cnt, sectors_read; uint64_t new_file_size; void *data = NULL; int64_t file_length; VHDXLogDescEntries *desc_entries = NULL; VHDXLogEntryHeader hdr_tmp = { 0 }; cnt = logs->count; data = qemu_blockalign...
0
int ff_intel_h263_decode_picture_header(MpegEncContext *s){ int format; /* picture header */ if (get_bits_long(&s->gb, 22) != 0x20) { av_log(s->avctx, AV_LOG_ERROR, "Bad picture start code\n"); return -1; } s->picture_number = get_bits(&s->gb, 8); /* picture timestamp */ if (get_bits1(&s->gb) != 1) { av_log(s->avctx, A...
0
static ssize_t nbd_co_send_reply(NBDRequest *req, struct nbd_reply *reply, int len){ NBDClient *client = req->client; int csock = client->sock; ssize_t rc, ret; qemu_co_mutex_lock(&client->send_lock); qemu_set_fd_handler2(csock, nbd_can_read, nbd_read, nbd_restart_write, client); client->send_coroutine = qemu_coroutine...
0
int64_t qemu_file_set_rate_limit(QEMUFile *f, int64_t new_rate){ /* any failed or completed migration keeps its state to allow probing of * migration data, but has no associated file anymore */ if (f && f->ops->set_rate_limit) return f->ops->set_rate_limit(f->opaque, new_rate); return 0;}
0
static uint64_t lance_mem_read(void *opaque, target_phys_addr_t addr, unsigned size){ SysBusPCNetState *d = opaque; uint32_t val; val = pcnet_ioport_readw(&d->state, addr); trace_lance_mem_readw(addr, val & 0xffff); return val & 0xffff;}
0
int tcp_socket_outgoing_opts(QemuOpts *opts){ Error *local_err = NULL; int fd = inet_connect_opts(opts, &local_err, NULL, NULL); if (local_err != NULL) { qerror_report_err(local_err); error_free(local_err); } return fd;}
0
static inline int onenand_prog_spare(OneNANDState *s, int sec, int secn, void *src){ int result = 0; if (secn > 0) { const uint8_t *sp = (const uint8_t *)src; uint8_t *dp = 0, *dpp = 0; if (s->bdrv_cur) { dp = g_malloc(512); if (!dp || bdrv_read(s->bdrv_cur, s->secs_cur + (sec >> 5), dp, 1) < 0) { result = 1; } else { ...
0
static void setup_rt_frame(int sig, struct target_sigaction *ka, target_siginfo_t *info, target_sigset_t *set, CPUM68KState *env){ struct target_rt_sigframe *frame; abi_ulong frame_addr; abi_ulong retcode_addr; abi_ulong info_addr; abi_ulong uc_addr; int err = 0; int i; frame_addr = get_sigframe(ka, env, sizeof *frame)...
0
static int mov_read_stsz(MOVContext *c, AVIOContext *pb, MOVAtom atom){ AVStream *st; MOVStreamContext *sc; unsigned int i, entries, sample_size, field_size, num_bytes; GetBitContext gb; unsigned char* buf; if (c->fc->nb_streams < 1) return 0; st = c->fc->streams[c->fc->nb_streams-1]; sc = st->priv_data; avio_r8(pb); /...
0
static QEMUFile *qemu_fopen_bdrv(BlockDriverState *bs, int64_t offset, int is_writable){ QEMUFile *f; f = qemu_mallocz(sizeof(QEMUFile)); if (!f) return NULL; f->is_file = 0; f->bs = bs; f->is_writable = is_writable; f->base_offset = offset; return f;}
0
static void virtio_setup(void){ struct irb irb; int i; int r; bool found = false; blk_schid.one = 1; for (i = 0; i < 0x10000; i++) { blk_schid.sch_no = i; r = tsch(blk_schid, &irb); if (r != 3) { if (virtio_is_blk(blk_schid)) { found = true; break; } } } if (!found) { virtio_panic("No virtio-blk device found!\n"); } vi...
0
int if_encap(Slirp *slirp, struct mbuf *ifm){ uint8_t buf[1600]; struct ethhdr *eh = (struct ethhdr *)buf; uint8_t ethaddr[ETH_ALEN]; const struct ip *iph = (const struct ip *)ifm->m_data; int ret; if (ifm->m_len + ETH_HLEN > sizeof(buf)) { return 1; } switch (iph->ip_v) { case IPVERSION: ret = if_encap4(slirp, ifm, eh...
0
static void fill_thread_info(struct elf_note_info *info, const CPUState *env){ TaskState *ts = (TaskState *)env->opaque; struct elf_thread_status *ets; ets = qemu_mallocz(sizeof (*ets)); ets->num_notes = 1; /* only prstatus is dumped */ fill_prstatus(&ets->prstatus, ts, 0); elf_core_copy_regs(&ets->prstatus.pr_reg, env...
0
static void omap_screen_dump(void *opaque, const char *filename, bool cswitch, Error **errp){ struct omap_lcd_panel_s *omap_lcd = opaque; DisplaySurface *surface = qemu_console_surface(omap_lcd->con); omap_update_display(opaque); if (omap_lcd && surface_data(surface)) omap_ppm_save(filename, surface_data(surface), omap...
0
static void con_disconnect(struct XenDevice *xendev){ struct XenConsole *con = container_of(xendev, struct XenConsole, xendev); if (!xendev->dev) { return; } if (con->chr) { qemu_chr_add_handlers(con->chr, NULL, NULL, NULL, NULL); qemu_chr_fe_release(con->chr); } xen_be_unbind_evtchn(&con->xendev); if (con->sring) { if...
0
static int configure_input_video_filter(FilterGraph *fg, InputFilter *ifilter, AVFilterInOut *in){ AVFilterContext *last_filter; const AVFilter *buffer_filt = avfilter_get_by_name("buffer"); InputStream *ist = ifilter->ist; InputFile *f = input_files[ist->file_index]; AVRational tb = ist->framerate.num ? av_inv_q(ist->...
0
void ff_put_h264_qpel16_mc33_msa(uint8_t *dst, const uint8_t *src, ptrdiff_t stride){ avc_luma_hv_qrt_16w_msa(src + stride - 2, src - (stride * 2) + sizeof(uint8_t), stride, dst, stride, 16);}
1
int qcow2_backing_read1(BlockDriverState *bs, QEMUIOVector *qiov, int64_t offset, int bytes){ uint64_t bs_size = bs->total_sectors * BDRV_SECTOR_SIZE; int n1; if ((offset + bytes) <= bs_size) { return bytes; } if (offset >= bs_size) { n1 = 0; } else { n1 = bs_size - offset; } qemu_iovec_memset(qiov, n1, 0, bytes - n1);...
1
static void property_get_bool(Object *obj, Visitor *v, void *opaque, const char *name, Error **errp){ BoolProperty *prop = opaque; bool value; value = prop->get(obj, errp); visit_type_bool(v, &value, name, errp);}
1
static int read_header(ShortenContext *s){ int i, ret; int maxnlpc = 0; /* shorten signature */ if (get_bits_long(&s->gb, 32) != AV_RB32("ajkg")) { av_log(s->avctx, AV_LOG_ERROR, "missing shorten magic 'ajkg'\n"); s->lpcqoffset = 0; s->blocksize = DEFAULT_BLOCK_SIZE; s->nmean = -1; s->version = get_bits(&s->gb, 8); s->...
0
int avcodec_get_pix_fmt_loss(enum PixelFormat dst_pix_fmt, enum PixelFormat src_pix_fmt, int has_alpha){ const PixFmtInfo *pf, *ps; const AVPixFmtDescriptor *src_desc = &av_pix_fmt_descriptors[src_pix_fmt]; const AVPixFmtDescriptor *dst_desc = &av_pix_fmt_descriptors[dst_pix_fmt]; int loss; ps = &pix_fmt_info[src_pix_f...
0
static void svq1_parse_string(GetBitContext *bitbuf, uint8_t *out){ uint8_t seed; int i; out[0] = get_bits(bitbuf, 8); seed = string_table[out[0]]; for (i = 1; i <= out[0]; i++) { out[i] = get_bits(bitbuf, 8) ^ seed; seed = string_table[out[i] ^ seed]; }}
0
static int vda_h264_end_frame(AVCodecContext *avctx){ H264Context *h = avctx->priv_data; VDAContext *vda = avctx->internal->hwaccel_priv_data; AVVDAContext *vda_ctx = avctx->hwaccel_context; AVFrame *frame = h->cur_pic_ptr->f; uint32_t flush_flags = 1 << 0; ///< kVDADecoderFlush_emitFrames CFDataRef coded_frame; OSStat...
0
int img_pad(AVPicture *dst, const AVPicture *src, int height, int width, int pix_fmt, int padtop, int padbottom, int padleft, int padright, int *color){ uint8_t *optr, *iptr; int y_shift; int x_shift; int yheight; int i, y; if (pix_fmt < 0 || pix_fmt >= PIX_FMT_NB || !is_yuv_planar(&pix_fmt_info[pix_fmt])) return -1; f...
0
void avfilter_draw_slice(AVFilterLink *link, int y, int h){ uint8_t *src[4], *dst[4]; int i, j, hsub, vsub; /* copy the slice if needed for permission reasons */ if(link->srcpic) { avcodec_get_chroma_sub_sample(link->format, &hsub, &vsub); src[0] = link->srcpic-> data[0] + y * link->srcpic-> linesize[0]; dst[0] = link-...
0
static int ff_sctp_send(int s, const void *msg, size_t len, const struct sctp_sndrcvinfo *sinfo, int flags){ struct msghdr outmsg; struct iovec iov; outmsg.msg_name = NULL; outmsg.msg_namelen = 0; outmsg.msg_iov = &iov; iov.iov_base = msg; iov.iov_len = len; outmsg.msg_iovlen = 1; outmsg.msg_controllen = 0; if (sinfo) ...
0
static int dxtory_decode_v1_420(AVCodecContext *avctx, AVFrame *pic, const uint8_t *src, int src_size){ int h, w; uint8_t *Y1, *Y2, *U, *V; int ret; if (src_size < avctx->width * avctx->height * 3LL / 2) { av_log(avctx, AV_LOG_ERROR, "packet too small\n"); return AVERROR_INVALIDDATA; } avctx->pix_fmt = AV_PIX_FMT_YUV42...
0
void ff_avg_h264_qpel16_mc13_msa(uint8_t *dst, const uint8_t *src, ptrdiff_t stride){ avc_luma_hv_qrt_and_aver_dst_16x16_msa(src + stride - 2, src - (stride * 2), stride, dst, stride);}
0
void ff_hevc_hls_residual_coding(HEVCContext *s, int x0, int y0, int log2_trafo_size, enum ScanType scan_idx, int c_idx){#define GET_COORD(offset, n) \ do { \ x_c = (x_cg << 2) + scan_x_off[n]; \ y_c = (y_cg << 2) + scan_y_off[n]; \ } while (0) HEVCLocalContext *lc = s->HEVClc; int transform_skip_flag = 0; int last_sig...
1
static int mov_write_sidx_tag(AVIOContext *pb, MOVTrack *track, int ref_size, int total_sidx_size){ int64_t pos = avio_tell(pb), offset_pos, end_pos; int64_t presentation_time, duration, offset; int starts_with_SAP, i, entries; if (track->entry) { entries = 1; presentation_time = track->start_dts + track->frag_start + ...
1
static uint64_t vfio_rtl8168_window_quirk_read(void *opaque, hwaddr addr, unsigned size){ VFIOQuirk *quirk = opaque; VFIOPCIDevice *vdev = quirk->vdev; switch (addr) { case 4: /* address */ if (quirk->data.flags) { trace_vfio_rtl8168_window_quirk_read_fake( memory_region_name(&quirk->mem), vdev->vbasedev.name); return ...
1
static int teletext_decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPacket *pkt){ TeletextContext *ctx = avctx->priv_data; AVSubtitle *sub = data; const uint8_t *buf = pkt->data; int left = pkt->size; uint8_t pesheader[45] = {0x00, 0x00, 0x01, 0xbd, 0x00, 0x00, 0x85, 0x80, 0x24, 0x21, 0x00, 0x01, 0x00...
1
static int enable_write_target(BlockDriverState *bs, Error **errp){ BDRVVVFATState *s = bs->opaque; BlockDriver *bdrv_qcow = NULL; BlockDriverState *backing; QemuOpts *opts = NULL; int ret; int size = sector2cluster(s, s->sector_count); QDict *options; s->used_clusters = calloc(size, 1); array_init(&(s->commits), sizeo...
1
static int apng_read_header(AVFormatContext *s){ APNGDemuxContext *ctx = s->priv_data; AVIOContext *pb = s->pb; uint32_t len, tag; AVStream *st; int acTL_found = 0; int64_t ret = AVERROR_INVALIDDATA; /* verify PNGSIG */ if (avio_rb64(pb) != PNGSIG) return ret; /* parse IHDR (must be first chunk) */ len = avio_rb32(pb);...
1
static int local_statfs(FsContext *s, V9fsPath *fs_path, struct statfs *stbuf){ char *buffer; int ret; char *path = fs_path->data; buffer = rpath(s, path); ret = statfs(buffer, stbuf); g_free(buffer); return ret;}
1
int av_image_fill_black(uint8_t *dst_data[4], const ptrdiff_t dst_linesize[4], enum AVPixelFormat pix_fmt, enum AVColorRange range, int width, int height){ const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt); int nb_planes = av_pix_fmt_count_planes(pix_fmt); // A pixel or a group of pixels on each plane, with...
1
bool cache_is_cached(const PageCache *cache, uint64_t addr){ size_t pos; g_assert(cache); g_assert(cache->page_cache); pos = cache_get_cache_pos(cache, addr); return (cache->page_cache[pos].it_addr == addr);}
1
static void superio_ioport_writeb(void *opaque, hwaddr addr, uint64_t data, unsigned size){ int can_write; SuperIOConfig *superio_conf = opaque; DPRINTF("superio_ioport_writeb address 0x%x val 0x%x\n", addr, data); if (addr == 0x3f0) { superio_conf->index = data & 0xff; } else { /* 0x3f1 */ switch (superio_conf->index)...
0
static int default_fdset_get_fd(int64_t fdset_id, int flags){ return -1;}
0
static void virtio_scsi_fail_cmd_req(VirtIOSCSIReq *req){ req->resp.cmd->response = VIRTIO_SCSI_S_FAILURE; virtio_scsi_complete_cmd_req(req);}
0
static int iscsi_open(BlockDriverState *bs, QDict *options, int flags, Error **errp){ IscsiLun *iscsilun = bs->opaque; struct iscsi_context *iscsi = NULL; struct iscsi_url *iscsi_url = NULL; struct scsi_task *task = NULL; struct scsi_inquiry_standard *inq = NULL; struct scsi_inquiry_supported_pages *inq_vpd; char *init...
0
static void string_output_append_range(StringOutputVisitor *sov, int64_t s, int64_t e){ Range *r = g_malloc0(sizeof(*r)); r->begin = s; r->end = e + 1; sov->ranges = range_list_insert(sov->ranges, r);}
0
static int coroutine_fn iscsi_co_readv(BlockDriverState *bs, int64_t sector_num, int nb_sectors, QEMUIOVector *iov){ IscsiLun *iscsilun = bs->opaque; struct IscsiTask iTask; uint64_t lba; uint32_t num_sectors; if (!is_sector_request_lun_aligned(sector_num, nb_sectors, iscsilun)) { return -EINVAL; } if (bs->bl.max_trans...
0
static DeviceClass *qdev_get_device_class(const char **driver, Error **errp){ ObjectClass *oc; DeviceClass *dc; oc = object_class_by_name(*driver); if (!oc) { const char *typename = find_typename_by_alias(*driver); if (typename) { *driver = typename; oc = object_class_by_name(*driver); } } if (!object_class_dynamic_cas...
0
static int usb_net_handle_control(USBDevice *dev, int request, int value, int index, int length, uint8_t *data){ USBNetState *s = (USBNetState *) dev; int ret = 0; switch(request) { case DeviceRequest | USB_REQ_GET_STATUS: data[0] = (1 << USB_DEVICE_SELF_POWERED) | (dev->remote_wakeup << USB_DEVICE_REMOTE_WAKEUP); data...
0
static void v9fs_synth_rewinddir(FsContext *ctx, V9fsFidOpenState *fs){ v9fs_synth_seekdir(ctx, fs, 0);}
0
void ff_vp3_h_loop_filter_c(uint8_t *first_pixel, int stride, int *bounding_values){ unsigned char *end; int filter_value; for (end= first_pixel + 8*stride; first_pixel != end; first_pixel += stride) { filter_value = (first_pixel[-2] - first_pixel[ 1]) +3*(first_pixel[ 0] - first_pixel[-1]); filter_value = bounding_val...
0
static int huffman_decode(MPADecodeContext *s, GranuleDef *g, int16_t *exponents, int end_pos2){ int s_index; int i; int last_pos, bits_left; VLC *vlc; int end_pos = FFMIN(end_pos2, s->gb.size_in_bits); /* low frequencies (called big values) */ s_index = 0; for (i = 0; i < 3; i++) { int j, k, l, linbits; j = g->region_...
0
static void memory_region_write_thunk_n(void *_mr, target_phys_addr_t addr, unsigned size, uint64_t data){ MemoryRegion *mr = _mr; if (!memory_region_access_valid(mr, addr, size)) { return; /* FIXME: better signalling */ } if (!mr->ops->write) { mr->ops->old_mmio.write[bitops_ffsl(size)](mr->opaque, addr, data); return...
0
static int zipl_load_segment(struct component_entry *entry){ const int max_entries = (SECTOR_SIZE / sizeof(struct scsi_blockptr)); struct scsi_blockptr *bprs = (void*)sec; const int bprs_size = sizeof(sec); uint64_t blockno; long address; int i; blockno = entry->data.blockno; address = entry->load_address; debug_print_...
0
int event_notifier_set(EventNotifier *e){ uint64_t value = 1; int r = write(e->fd, &value, sizeof(value)); return r == sizeof(value);}
0
long do_sigreturn(CPUSPARCState *env){ abi_ulong sf_addr; struct target_signal_frame *sf; uint32_t up_psr, pc, npc; target_sigset_t set; sigset_t host_set; int err=0, i; sf_addr = env->regwptr[UREG_FP]; trace_user_do_sigreturn(env, sf_addr); if (!lock_user_struct(VERIFY_READ, sf, sf_addr, 1)) { goto segv_and_exit; } /*...
0
void qcow2_free_any_clusters(BlockDriverState *bs, uint64_t l2_entry, int nb_clusters, enum qcow2_discard_type type){ BDRVQcow2State *s = bs->opaque; switch (qcow2_get_cluster_type(l2_entry)) { case QCOW2_CLUSTER_COMPRESSED: { int nb_csectors; nb_csectors = ((l2_entry >> s->csize_shift) & s->csize_mask) + 1; qcow2_free...
0
void qemu_put_byte(QEMUFile *f, int v){ if (!f->last_error && f->is_write == 0 && f->buf_index > 0) { fprintf(stderr, "Attempted to write to buffer while read buffer is not empty\n"); abort(); } f->buf[f->buf_index++] = v; f->is_write = 1; if (f->buf_index >= IO_BUF_SIZE) { int ret = qemu_fflush(f); qemu_file_set_if_er...
0
static void n8x0_i2c_setup(struct n800_s *s){ DeviceState *dev; qemu_irq tmp_irq = qdev_get_gpio_in(s->cpu->gpio, N8X0_TMP105_GPIO); /* Attach the CPU on one end of our I2C bus. */ s->i2c = omap_i2c_bus(s->cpu->i2c[0]); /* Attach a menelaus PM chip */ dev = i2c_create_slave(s->i2c, "twl92230", N8X0_MENELAUS_ADDR); qdev...
0
void destroy_bdrvs(dev_match_fn *match_fn, void *arg){ DriveInfo *dinfo; struct BlockDriverState *bs; TAILQ_FOREACH(dinfo, &drives, next) { bs = dinfo->bdrv; if (bs) { if (bs->private && match_fn(bs->private, arg)) { drive_uninit(bs); bdrv_delete(bs); } } }}
0
TranslationBlock *tb_gen_code(CPUState *cpu, target_ulong pc, target_ulong cs_base, int flags, int cflags){ CPUArchState *env = cpu->env_ptr; TranslationBlock *tb; tb_page_addr_t phys_pc, phys_page2; target_ulong virt_page2; tcg_insn_unit *gen_code_buf; int gen_code_size, search_size;#ifdef CONFIG_PROFILER int64_t ti;#...
0
static void virtio_blk_handle_write(VirtIOBlockReq *req, MultiReqBuffer *mrb){ BlockRequest *blkreq; uint64_t sector; sector = virtio_ldq_p(VIRTIO_DEVICE(req->dev), &req->out.sector); trace_virtio_blk_handle_write(req, sector, req->qiov.size / 512); if (!virtio_blk_sect_range_ok(req->dev, sector, req->qiov.size)) { vir...
0
static int vc1_parse(AVCodecParserContext *s, AVCodecContext *avctx, const uint8_t **poutbuf, int *poutbuf_size, const uint8_t *buf, int buf_size){ /* Here we do the searching for frame boundaries and headers at * the same time. Only a minimal amount at the start of each * header is unescaped. */ VC1ParseContext *vpc =...
0
static void bdrv_co_complete(BlockAIOCBCoroutine *acb){ if (!acb->need_bh) { acb->common.cb(acb->common.opaque, acb->req.error); qemu_aio_unref(acb); }}
0
QObject *qmp_output_get_qobject(QmpOutputVisitor *qov){ /* FIXME: we should require that a visit occurred, and that it is * complete (no starts without a matching end) */ QObject *obj = qov->root; if (obj) { qobject_incref(obj); } else { obj = qnull(); } return obj;}
0
eeprom_t *eeprom93xx_new(DeviceState *dev, uint16_t nwords){ /* Add a new EEPROM (with 16, 64 or 256 words). */ eeprom_t *eeprom; uint8_t addrbits; switch (nwords) { case 16: case 64: addrbits = 6; break; case 128: case 256: addrbits = 8; break; default: assert(!"Unsupported EEPROM size, fallback to 64 words!"); nwords...
0
static void cdrom_change_cb(void *opaque){ IDEState *s = opaque; uint64_t nb_sectors; /* XXX: send interrupt too */ bdrv_get_geometry(s->bs, &nb_sectors); s->nb_sectors = nb_sectors;}
1
void *qpci_legacy_iomap(QPCIDevice *dev, uint16_t addr){ return (void *)(uintptr_t)addr;}
1
static void trace(TraceEventID event, uint64_t x1, uint64_t x2, uint64_t x3, uint64_t x4, uint64_t x5, uint64_t x6){ TraceRecord *rec = &trace_buf[trace_idx]; if (!trace_list[event].state) { return; } rec->event = event; rec->timestamp_ns = get_clock(); rec->x1 = x1; rec->x2 = x2; rec->x3 = x3; rec->x4 = x4; rec->x5 = ...
1
static void gen_intermediate_code_internal(CPULM32State *env, TranslationBlock *tb, int search_pc){ struct DisasContext ctx, *dc = &ctx; uint16_t *gen_opc_end; uint32_t pc_start; int j, lj; uint32_t next_page_start; int num_insns; int max_insns; qemu_log_try_set_file(stderr); pc_start = tb->pc; dc->env = env; dc->tb = ...
1
void acpi_gpe_init(ACPIREGS *ar, uint8_t len){ ar->gpe.len = len; ar->gpe.sts = g_malloc0(len / 2); ar->gpe.en = g_malloc0(len / 2);}
1
static void xtensa_cpu_initfn(Object *obj){ CPUState *cs = CPU(obj); XtensaCPU *cpu = XTENSA_CPU(obj); XtensaCPUClass *xcc = XTENSA_CPU_GET_CLASS(obj); CPUXtensaState *env = &cpu->env; static bool tcg_inited; cs->env_ptr = env; env->config = xcc->config; cpu_exec_init(cs, &error_abort); if (tcg_enabled() && !tcg_inited...
1
static void dp8393x_class_init(ObjectClass *klass, void *data){ DeviceClass *dc = DEVICE_CLASS(klass); set_bit(DEVICE_CATEGORY_NETWORK, dc->categories); dc->realize = dp8393x_realize; dc->reset = dp8393x_reset; dc->vmsd = &vmstate_dp8393x; dc->props = dp8393x_properties;}
1
static int mjpeg_decode_sof0(MJpegDecodeContext *s, UINT8 *buf, int buf_size){ int len, nb_components, i, width, height; init_get_bits(&s->gb, buf, buf_size); /* XXX: verify len field validity */ len = get_bits(&s->gb, 16); /* only 8 bits/component accepted */ if (get_bits(&s->gb, 8) != 8) return -1; height = get_bits(...
0
int ff_avfilter_graph_config_formats(AVFilterGraph *graph, AVClass *log_ctx){ int ret; /* find supported formats from sub-filters, and merge along links */ if ((ret = query_formats(graph, log_ctx)) < 0) return ret; /* Once everything is merged, it's possible that we'll still have * multiple valid media format choices. ...
0
static void avc_luma_midh_qrt_8w_msa(const uint8_t *src, int32_t src_stride, uint8_t *dst, int32_t dst_stride, int32_t height, uint8_t horiz_offset){ uint32_t multiple8_cnt; for (multiple8_cnt = 2; multiple8_cnt--;) { avc_luma_midh_qrt_4w_msa(src, src_stride, dst, dst_stride, height, horiz_offset); src += 4; dst += 4; ...
1
target_ulong helper_msub32_suov(CPUTriCoreState *env, target_ulong r1, target_ulong r2, target_ulong r3){ int64_t t1 = extract64(r1, 0, 32); int64_t t2 = extract64(r2, 0, 32); int64_t t3 = extract64(r3, 0, 32); int64_t result; result = t2 - (t1 * t3); return suov32_neg(env, result);}
1
static CharDriverState *qemu_chr_open_fd(int fd_in, int fd_out){ CharDriverState *chr; FDCharDriver *s; chr = qemu_chr_alloc(); s = g_malloc0(sizeof(FDCharDriver)); s->fd_in = io_channel_from_fd(fd_in); s->fd_out = io_channel_from_fd(fd_out); qemu_set_nonblock(fd_out); s->chr = chr; chr->opaque = s; chr->chr_add_watch ...
1
static void mpeg_er_decode_mb(void *opaque, int ref, int mv_dir, int mv_type, int (*mv)[2][4][2], int mb_x, int mb_y, int mb_intra, int mb_skipped){ MpegEncContext *s = opaque; s->mv_dir = mv_dir; s->mv_type = mv_type; s->mb_intra = mb_intra; s->mb_skipped = mb_skipped; s->mb_x = mb_x; s->mb_y = mb_y; memcpy(s->mv, mv,...
1
static int field_end(H264Context *h, int in_setup){ MpegEncContext *const s = &h->s; AVCodecContext *const avctx = s->avctx; int err = 0; s->mb_y = 0; if (!in_setup && !s->dropable) ff_thread_report_progress(&s->current_picture_ptr->f, (16 * s->mb_height >> FIELD_PICTURE) - 1, s->picture_structure == PICT_BOTTOM_FIELD)...
1
static void coroutine_fn backup_run(void *opaque){ BackupBlockJob *job = opaque; BackupCompleteData *data; BlockDriverState *bs = job->common.bs; BlockDriverState *target = job->target; BlockdevOnError on_target_error = job->on_target_error; NotifierWithReturn before_write = { .notify = backup_before_write_notify, }; i...
1
static void force_sigsegv(int oldsig){ CPUState *cpu = thread_cpu; CPUArchState *env = cpu->env_ptr; target_siginfo_t info; if (oldsig == SIGSEGV) { /* Make sure we don't try to deliver the signal again; this will * end up with handle_pending_signal() calling force_sig(). */ sigact_table[oldsig - 1]._sa_handler = TARGE...
1
static void vnc_update_client(void *opaque){ VncState *vs = opaque; if (vs->need_update && vs->csock != -1) { int y; uint8_t *row; char *old_row; uint32_t width_mask[VNC_DIRTY_WORDS]; int n_rectangles; int saved_offset; int has_dirty = 0; vga_hw_update(); vnc_set_bits(width_mask, (ds_get_width(vs->ds) / 16), VNC_DIRTY_...
1
static int video_open(VideoState *is){ int w,h; if (screen_width) { w = screen_width; h = screen_height; } else { w = default_width; h = default_height; } if (!window) { int flags = SDL_WINDOW_SHOWN | SDL_WINDOW_RESIZABLE; if (!window_title) window_title = input_filename; if (is_full_screen) flags |= SDL_WINDOW_FULLSCR...
1
static void FUNCC(pred4x4_129_dc)(uint8_t *_src, const uint8_t *topright, int _stride){ pixel *src = (pixel*)_src; int stride = _stride/sizeof(pixel); ((pixel4*)(src+0*stride))[0]= ((pixel4*)(src+1*stride))[0]= ((pixel4*)(src+2*stride))[0]= ((pixel4*)(src+3*stride))[0]= PIXEL_SPLAT_X4((1<<(BIT_DEPTH-1))+1);}
1
static int ehci_reset_queue(EHCIQueue *q){ int packets; trace_usb_ehci_queue_action(q, "reset"); packets = ehci_cancel_queue(q); q->dev = NULL; q->qtdaddr = 0; return packets;}
1
static void fill_caches(H264Context *h, int mb_type, int for_deblock){ MpegEncContext * const s = &h->s; const int mb_xy= h->mb_xy; int topleft_xy, top_xy, topright_xy, left_xy[2]; int topleft_type, top_type, topright_type, left_type[2]; int * left_block; int topleft_partition= -1; int i; top_xy = mb_xy - (s->mb_stride...
1
static void lsi_scsi_init(PCIDevice *dev){ LSIState *s = (LSIState *)dev; uint8_t *pci_conf; pci_conf = s->pci_dev.config; /* PCI Vendor ID (word) */ pci_config_set_vendor_id(pci_conf, PCI_VENDOR_ID_LSI_LOGIC); /* PCI device ID (word) */ pci_config_set_device_id(pci_conf, PCI_DEVICE_ID_LSI_53C895A); /* PCI base class c...
1
int ff_j2k_init_component(J2kComponent *comp, J2kCodingStyle *codsty, J2kQuantStyle *qntsty, int cbps, int dx, int dy){ int reslevelno, bandno, gbandno = 0, ret, i, j, csize = 1; if (ret=ff_j2k_dwt_init(&comp->dwt, comp->coord, codsty->nreslevels-1, codsty->transform)) return ret; for (i = 0; i < 2; i++) csize *= comp-...
1
void vncws_tls_handshake_io(void *opaque){ VncState *vs = (VncState *)opaque; if (!vs->tls.session) { VNC_DEBUG("TLS Websocket setup\n"); if (vnc_tls_client_setup(vs, vs->vd->tls.x509cert != NULL) < 0) { return; } } VNC_DEBUG("Handshake IO continue\n"); vncws_start_tls_handshake(vs);}
1
int css_do_rsch(SubchDev *sch){ SCSW *s = &sch->curr_status.scsw; PMCW *p = &sch->curr_status.pmcw; int ret; if (~(p->flags) & (PMCW_FLAGS_MASK_DNV | PMCW_FLAGS_MASK_ENA)) { ret = -ENODEV; goto out; } if (s->ctrl & SCSW_STCTL_STATUS_PEND) { ret = -EINPROGRESS; goto out; } if (((s->ctrl & SCSW_CTRL_MASK_FCTL) != SCSW_FC...
1
ram_addr_t ppc4xx_sdram_adjust(ram_addr_t ram_size, int nr_banks, MemoryRegion ram_memories[], hwaddr ram_bases[], hwaddr ram_sizes[], const unsigned int sdram_bank_sizes[]){ ram_addr_t size_left = ram_size; ram_addr_t base = 0; int i; int j; for (i = 0; i < nr_banks; i++) { for (j = 0; sdram_bank_sizes[j] != 0; j++) {...
1
static int mxf_read_cryptographic_context(void *arg, AVIOContext *pb, int tag, int size, UID uid){ MXFCryptoContext *cryptocontext = arg; if (size != 16) return -1; if (IS_KLV_KEY(uid, mxf_crypto_source_container_ul)) avio_read(pb, cryptocontext->source_container_ul, 16); return 0;}
1
void ff_eac3_decode_transform_coeffs_aht_ch(AC3DecodeContext *s, int ch){ int bin, blk, gs; int end_bap, gaq_mode; GetBitContext *gbc = &s->gbc; int gaq_gain[AC3_MAX_COEFS]; gaq_mode = get_bits(gbc, 2); end_bap = (gaq_mode < 2) ? 12 : 17; /* if GAQ gain is used, decode gain codes for bins with hebap between 8 and end_b...
1
void unregister_displaychangelistener(DisplayChangeListener *dcl){ DisplayState *ds = dcl->ds; trace_displaychangelistener_unregister(dcl, dcl->ops->dpy_name); if (dcl->con) { dcl->con->dcls--; } QLIST_REMOVE(dcl, next); gui_setup_refresh(ds);}
0
int avpicture_layout(const AVPicture* src, enum AVPixelFormat pix_fmt, int width, int height, unsigned char *dest, int dest_size){ int i, j, nb_planes = 0, linesizes[4]; const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt); int size = avpicture_get_size(pix_fmt, width, height); if (size > dest_size || size < 0...
0
static int pipe_open(URLContext *h, const char *filename, int flags){ int fd; if (flags & URL_WRONLY) { fd = 1; } else { fd = 0; }#if defined(__MINGW32__) || defined(CONFIG_OS2) || defined(__CYGWIN__) setmode(fd, O_BINARY);#endif h->priv_data = (void *)(size_t)fd; h->is_streamed = 1; return 0;}