label
int64
0
1
func
stringlengths
21
96.3k
0
static int open_url(AVFormatContext *s, AVIOContext **pb, const char *url, AVDictionary *opts, AVDictionary *opts2){ HLSContext *c = s->priv_data; AVDictionary *tmp = NULL; const char *proto_name = avio_find_protocol_name(url); int ret; av_dict_copy(&tmp, opts, 0); av_dict_copy(&tmp, opts2, 0); if (!proto_name) return ...
0
static int nvdec_mpeg12_end_frame(AVCodecContext *avctx){ NVDECContext *ctx = avctx->internal->hwaccel_priv_data; int ret = ff_nvdec_end_frame(avctx); ctx->bitstream = NULL; return ret;}
0
static void setup_rt_frame(int sig, struct target_sigaction *ka, target_siginfo_t *info, target_sigset_t *set, CPUX86State *env){ abi_ulong frame_addr, addr;struct rt_sigframe *frame;int i, err = 0;frame_addr = get_sigframe(ka, env, sizeof(*frame));if (!lock_user_struct(VERIFY_WRITE, frame, frame_addr, 0))goto give_sig...
0
static void pci_qdev_realize(DeviceState *qdev, Error **errp){ PCIDevice *pci_dev = (PCIDevice *)qdev; PCIDeviceClass *pc = PCI_DEVICE_GET_CLASS(pci_dev); Error *local_err = NULL; PCIBus *bus; bool is_default_rom; /* initialize cap_present for pci_is_express() and pci_config_size() */ if (pc->is_express) { pci_dev->cap...
0
int check_migratable(Object *obj, Error **err){ return 0;}
0
static av_cold int vp8_free(AVCodecContext *avctx){ VP8Context *ctx = avctx->priv_data; vpx_codec_destroy(&ctx->encoder); av_freep(&ctx->twopass_stats.buf); av_freep(&avctx->coded_frame); av_freep(&avctx->stats_out); free_frame_list(ctx->coded_frame_list); return 0;}
0
static void exynos4210_fimd_write(void *opaque, target_phys_addr_t offset, uint64_t val, unsigned size){ Exynos4210fimdState *s = (Exynos4210fimdState *)opaque; unsigned w, i; uint32_t old_value; DPRINT_L2("write offset 0x%08x, value=%llu(0x%08llx)\n", offset, (long long unsigned int)val, (long long unsigned int)val); ...
0
static int usb_wacom_initfn(USBDevice *dev){ USBWacomState *s = DO_UPCAST(USBWacomState, dev, dev); s->dev.speed = USB_SPEED_FULL; s->changed = 1; return 0;}
0
void bdrv_register(BlockDriver *bdrv){ /* Block drivers without coroutine functions need emulation */ if (!bdrv->bdrv_co_readv) { bdrv->bdrv_co_readv = bdrv_co_readv_em; bdrv->bdrv_co_writev = bdrv_co_writev_em; if (!bdrv->bdrv_aio_readv) { /* add AIO emulation layer */ bdrv->bdrv_aio_readv = bdrv_aio_readv_em; bdrv->b...
0
void socket_listen_cleanup(int fd, Error **errp){ SocketAddress *addr; addr = socket_local_address(fd, errp); if (addr->type == SOCKET_ADDRESS_KIND_UNIX && addr->u.q_unix.data->path) { if (unlink(addr->u.q_unix.data->path) < 0 && errno != ENOENT) { error_setg_errno(errp, errno, "Failed to unlink socket %s", addr->u.q_u...
0
static void test_nested_struct(gconstpointer opaque){ TestArgs *args = (TestArgs *) opaque; const SerializeOps *ops = args->ops; UserDefNested *udnp = nested_struct_create(); UserDefNested *udnp_copy = NULL; Error *err = NULL; void *serialize_data; ops->serialize(udnp, &serialize_data, visit_nested_struct, &err); ops->...
0
static int usb_net_initfn(USBDevice *dev){ USBNetState *s = DO_UPCAST(USBNetState, dev, dev); s->dev.speed = USB_SPEED_FULL; s->rndis = 1; s->rndis_state = RNDIS_UNINITIALIZED; QTAILQ_INIT(&s->rndis_resp); s->medium = 0;/* NDIS_MEDIUM_802_3 */ s->speed = 1000000; /* 100MBps, in 100Bps units */ s->media_state = 0;/* NDI...
0
static void curses_setup(void){ int i, colour_default[8] = { COLOR_BLACK, COLOR_BLUE, COLOR_GREEN, COLOR_CYAN, COLOR_RED, COLOR_MAGENTA, COLOR_YELLOW, COLOR_WHITE, }; /* input as raw as possible, let everything be interpreted * by the guest system */ initscr(); noecho(); intrflush(stdscr, FALSE); nodelay(stdscr, TRUE);...
0
static bool send_gradient_rect(VncState *vs, int w, int h){ int stream = 3; int level = tight_conf[vs->tight_compression].gradient_zlib_level; size_t bytes; if (vs->clientds.pf.bytes_per_pixel == 1) return send_full_color_rect(vs, w, h); vnc_write_u8(vs, (stream | VNC_TIGHT_EXPLICIT_FILTER) << 4); vnc_write_u8(vs, VNC_...
0
int bdrv_get_flags(BlockDriverState *bs){ return bs->open_flags;}
0
static int filter_frame(AVFilterLink *inlink, AVFrame *insamples){ AVFilterContext *ctx = inlink->dst; ASNSContext *asns = ctx->priv; AVFilterLink *outlink = ctx->outputs[0]; int ret; int nb_samples = insamples->nb_samples; if (av_audio_fifo_space(asns->fifo) < nb_samples) { av_log(ctx, AV_LOG_DEBUG, "No space for %d s...
0
long do_rt_sigreturn(CPUState *env){struct rt_sigframe *frame; sigset_t host_set;/* * Since we stacked the signal on a 64-bit boundary, * then 'sp' should be word aligned here. If it's * not, then the user is trying to mess with us. */if (env->regs[13] & 7)goto badframe;frame = (struct rt_sigframe *)env->regs[13];#if 0...
0
static PCIDevice *find_dev(sPAPREnvironment *spapr, uint64_t buid, uint32_t config_addr){ sPAPRPHBState *sphb = find_phb(spapr, buid); PCIHostState *phb = PCI_HOST_BRIDGE(sphb); int bus_num = (config_addr >> 16) & 0xFF; int devfn = (config_addr >> 8) & 0xFF; if (!phb) { return NULL; } return pci_find_device(phb->bus, b...
0
void *pci_assign_dev_load_option_rom(PCIDevice *dev, struct Object *owner, int *size, unsigned int domain, unsigned int bus, unsigned int slot, unsigned int function){ char name[32], rom_file[64]; FILE *fp; uint8_t val; struct stat st; void *ptr = NULL; /* If loading ROM from file, pci handles it */ if (dev->romfile ||...
0
void cpu_unregister_map_client(void *_client){ MapClient *client = (MapClient *)_client; LIST_REMOVE(client, link); qemu_free(client);}
0
static inline void gen_intermediate_code_internal(PowerPCCPU *cpu, TranslationBlock *tb, bool search_pc){ CPUState *cs = CPU(cpu); CPUPPCState *env = &cpu->env; DisasContext ctx, *ctxp = &ctx; opc_handler_t **table, *handler; target_ulong pc_start; uint16_t *gen_opc_end; CPUBreakpoint *bp; int j, lj = -1; int num_insns...
1
static void dma_aio_cancel(BlockDriverAIOCB *acb){ DMAAIOCB *dbs = container_of(acb, DMAAIOCB, common); if (dbs->acb) { bdrv_aio_cancel(dbs->acb); }}
1
int32_t idiv32(int32_t *q_ptr, int64_t num, int32_t den){ *q_ptr = num / den; return num % den;}
1
void qmp_nbd_server_add(const char *device, bool has_writable, bool writable, Error **errp){ BlockDriverState *bs; NBDExport *exp; NBDCloseNotifier *n; if (server_fd == -1) { error_setg(errp, "NBD server not running"); return; } if (nbd_export_find(device)) { error_setg(errp, "NBD server already exporting device '%s'",...
1
static void xbr3x(AVFrame *input, AVFrame *output, const uint32_t *r2y){ const int nl = output->linesize[0]>>2; const int nl1 = nl + nl; uint32_t pprev; uint32_t pprev2; int x,y; for (y = 0; y < input->height; y++) { uint32_t * E = (uint32_t *)(output->data[0] + y * output->linesize[0] * 3); /* middle. Offset of -8 is ...
1
qio_channel_websock_source_prepare(GSource *source, gint *timeout){ QIOChannelWebsockSource *wsource = (QIOChannelWebsockSource *)source; GIOCondition cond = 0; *timeout = -1; if (wsource->wioc->rawinput.offset) { cond |= G_IO_IN; } if (wsource->wioc->rawoutput.offset < QIO_CHANNEL_WEBSOCK_MAX_BUFFER) { cond |= G_IO_OU...
1
static uint_fast8_t vorbis_floor1_decode(vorbis_context *vc, vorbis_floor_data *vfu, float *vec){ vorbis_floor1 *vf = &vfu->t1; GetBitContext *gb = &vc->gb; uint_fast16_t range_v[4] = { 256, 128, 86, 64 }; uint_fast16_t range = range_v[vf->multiplier-1]; uint_fast16_t floor1_Y[258]; uint_fast16_t floor1_Y_final[258]; i...
1
static void qemu_add_data_dir(const char *path){ int i; if (path == NULL) { return; } if (data_dir_idx == ARRAY_SIZE(data_dir)) { return; } for (i = 0; i < data_dir_idx; i++) { if (strcmp(data_dir[i], path) == 0) { return; /* duplicate */ } } data_dir[data_dir_idx++] = path;}
1
void *ff_schro_queue_pop(FFSchroQueue *queue){ FFSchroQueueElement *top = queue->p_head; if (top) { void *data = top->data; queue->p_head = queue->p_head->next; --queue->size; av_freep(&top); return data; } return NULL;}
1
static void virtio_net_vhost_status(VirtIONet *n, uint8_t status){ VirtIODevice *vdev = VIRTIO_DEVICE(n); NetClientState *nc = qemu_get_queue(n->nic); int queues = n->multiqueue ? n->max_queues : 1; if (!get_vhost_net(nc->peer)) { return; } if ((virtio_net_started(n, status) && !nc->peer->link_down) == !!n->vhost_start...
0
static int evrc_decode_frame(AVCodecContext *avctx, void *data, int *got_frame_ptr, AVPacket *avpkt){ const uint8_t *buf = avpkt->data; AVFrame *frame = data; EVRCContext *e = avctx->priv_data; int buf_size = avpkt->size; float ilspf[FILTER_ORDER], ilpc[FILTER_ORDER], idelay[NB_SUBFRAMES]; float *samples; int i, j, ret...
0
static int _do_rematrixing(AC3DecodeContext *ctx, int start, int end){ float tmp0, tmp1; while (start < end) { tmp0 = ctx->samples[start]; tmp1 = (ctx->samples + 256)[start]; ctx->samples[start] = tmp0 + tmp1; (ctx->samples + 256)[start] = tmp0 - tmp1; start++; } return 0;}
0
const DVprofile* avpriv_dv_frame_profile(const DVprofile *sys, const uint8_t* frame, unsigned buf_size){ int i; int dsf = (frame[3] & 0x80) >> 7; int stype = frame[80*5 + 48 + 3] & 0x1f; /* 576i50 25Mbps 4:1:1 is a special case */ if (dsf == 1 && stype == 0 && frame[4] & 0x07 /* the APT field */) { return &dv_profiles[...
1
static int do_fork(CPUState *env, unsigned int flags, abi_ulong newsp, abi_ulong parent_tidptr, target_ulong newtls, abi_ulong child_tidptr){ int ret; TaskState *ts; uint8_t *new_stack; CPUState *new_env;#if defined(CONFIG_USE_NPTL) unsigned int nptl_flags; sigset_t sigmask;#endif /* Emulate vfork() with fork() */ if (...
1
static inline void decode(DisasContext *dc, uint32_t ir){ if (unlikely(qemu_loglevel_mask(CPU_LOG_TB_OP | CPU_LOG_TB_OP_OPT))) { tcg_gen_debug_insn_start(dc->pc); } dc->ir = ir; LOG_DIS("%8.8x\t", dc->ir); /* try guessing 'empty' instruction memory, although it may be a valid * instruction sequence (eg. srui r0, r0, 0)...
1
static int decode_zbuf(AVBPrint *bp, const uint8_t *data, const uint8_t *data_end){ z_stream zstream; unsigned char *buf; unsigned buf_size; int ret; zstream.zalloc = ff_png_zalloc; zstream.zfree = ff_png_zfree; zstream.opaque = NULL; if (inflateInit(&zstream) != Z_OK) return AVERROR_EXTERNAL; zstream.next_in = (unsign...
1
static int write_extradata(FFV1Context *f){ RangeCoder *const c = &f->c; uint8_t state[CONTEXT_SIZE]; int i, j, k; uint8_t state2[32][CONTEXT_SIZE]; unsigned v; memset(state2, 128, sizeof(state2)); memset(state, 128, sizeof(state)); f->avctx->extradata_size = 10000 + 4 + (11 * 11 * 5 * 5 * 5 + 11 * 11 * 11) * 32; f->av...
1
int qemu_strtol(const char *nptr, const char **endptr, int base, long *result){ char *p; int err = 0; if (!nptr) { if (endptr) { *endptr = nptr; } err = -EINVAL; } else { errno = 0; *result = strtol(nptr, &p, base); err = check_strtox_error(endptr, p, errno); } return err;}
1
static void spapr_set_vsmt_mode(sPAPRMachineState *spapr, Error **errp){ Error *local_err = NULL; bool vsmt_user = !!spapr->vsmt; int kvm_smt = kvmppc_smt_threads(); int ret; if (!kvm_enabled() && (smp_threads > 1)) { error_setg(&local_err, "TCG cannot support more than 1 thread/core " "on a pseries machine"); goto out...
1
static void pci_bridge_update_mappings(PCIBridge *br){ /* Make updates atomic to: handle the case of one VCPU updating the bridge * while another accesses an unaffected region. */ memory_region_transaction_begin(); pci_bridge_region_cleanup(br); pci_bridge_region_init(br); memory_region_transaction_commit();}
1
static struct omap_sysctl_s *omap_sysctl_init(struct omap_target_agent_s *ta, omap_clk iclk, struct omap_mpu_state_s *mpu){ struct omap_sysctl_s *s = (struct omap_sysctl_s *) g_malloc0(sizeof(struct omap_sysctl_s)); s->mpu = mpu; omap_sysctl_reset(s); memory_region_init_io(&s->iomem, NULL, &omap_sysctl_ops, s, "omap.sy...
1
static int mpegts_write_packet_internal(AVFormatContext *s, AVPacket *pkt){ AVStream *st = s->streams[pkt->stream_index]; int size = pkt->size; uint8_t *buf = pkt->data; uint8_t *data = NULL; MpegTSWrite *ts = s->priv_data; MpegTSWriteStream *ts_st = st->priv_data; const int64_t delay = av_rescale(s->max_delay, 90000, ...
1
static int mp3_write_packet(AVFormatContext *s, AVPacket *pkt){ MP3Context *mp3 = s->priv_data; if (pkt->stream_index == mp3->audio_stream_idx) { if (mp3->pics_to_write) { /* buffer audio packets until we get all the pictures */ AVPacketList *pktl = av_mallocz(sizeof(*pktl)); if (!pktl) return AVERROR(ENOMEM); pktl->pk...
1
static void ioport_write(void *opaque, target_phys_addr_t addr, uint64_t val, unsigned size){ PCIQXLDevice *d = opaque; uint32_t io_port = addr; qxl_async_io async = QXL_SYNC; uint32_t orig_io_port = io_port; if (d->guest_bug && !io_port == QXL_IO_RESET) { return; if (d->revision <= QXL_REVISION_STABLE_V10 && io_port >...
0
static int decode_frame_byterun1(AVCodecContext *avctx, void *data, int *data_size, AVPacket *avpkt){ IffContext *s = avctx->priv_data; const uint8_t *buf = avpkt->data; unsigned buf_size = avpkt->size; const uint8_t *buf_end = buf+buf_size; unsigned y, plane, x; if (avctx->reget_buffer(avctx, &s->frame) < 0){ av_log(a...
0
static void avc_loopfilter_luma_inter_edge_ver_msa(uint8_t *data, uint8_t bs0, uint8_t bs1, uint8_t bs2, uint8_t bs3, uint8_t tc0, uint8_t tc1, uint8_t tc2, uint8_t tc3, uint8_t alpha_in, uint8_t beta_in, uint32_t img_width){ uint8_t *src; v16u8 beta, tmp_vec, bs = { 0 }; v16u8 tc = { 0 }; v16u8 is_less_than, is_less_t...
0
static void dvbsub_parse_region_segment(AVCodecContext *avctx, const uint8_t *buf, int buf_size){ DVBSubContext *ctx = avctx->priv_data; const uint8_t *buf_end = buf + buf_size; int region_id, object_id; DVBSubRegion *region; DVBSubObject *object; DVBSubObjectDisplay *display; int fill; if (buf_size < 10) return; regio...
0
static void sdhci_initfn(Object *obj){ SDHCIState *s = SDHCI(obj); DriveInfo *di; di = drive_get_next(IF_SD); s->card = sd_init(di ? blk_bs(blk_by_legacy_dinfo(di)) : NULL, false); if (s->card == NULL) { exit(1); } s->eject_cb = qemu_allocate_irq(sdhci_insert_eject_cb, s, 0); s->ro_cb = qemu_allocate_irq(sdhci_card_rea...
0
static int print_ptr(DeviceState *dev, Property *prop, char *dest, size_t len){ void **ptr = qdev_get_prop_ptr(dev, prop); return snprintf(dest, len, "<%p>", *ptr);}
0
static ssize_t drop_sync(int fd, size_t size){ ssize_t ret, dropped = size; uint8_t *buffer = g_malloc(MIN(65536, size)); while (size > 0) { ret = read_sync(fd, buffer, MIN(65536, size)); if (ret < 0) { g_free(buffer); return ret; } assert(ret <= size); size -= ret; } g_free(buffer); return dropped;}
0
static int coroutine_fn iscsi_co_flush(BlockDriverState *bs){ IscsiLun *iscsilun = bs->opaque; struct IscsiTask iTask; if (bs->sg) { return 0; } if (!iscsilun->force_next_flush) { return 0; } iscsilun->force_next_flush = false; iscsi_co_init_iscsitask(iscsilun, &iTask);retry: if (iscsi_synchronizecache10_task(iscsilun-...
0
static void mmio_ide_write(void *opaque, target_phys_addr_t addr, uint64_t val, unsigned size){ MMIOState *s = opaque; addr >>= s->shift; if (addr & 7) ide_ioport_write(&s->bus, addr, val); else ide_data_writew(&s->bus, 0, val);}
0
static int vmdaudio_decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPacket *avpkt){ const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; VmdAudioContext *s = avctx->priv_data; int block_type; unsigned char *output_samples = (unsigned char *)data; if (buf_size < 16) { av_log(avctx, AV_LOG_WARN...
0
static int usb_parse(const char *cmdline){ int r; r = usb_device_add(cmdline); if (r < 0) { fprintf(stderr, "qemu: could not add USB device '%s'\n", cmdline); } return r;}
0
static int count_contiguous_free_clusters(uint64_t nb_clusters, uint64_t *l2_table){ int i; for (i = 0; i < nb_clusters; i++) { int type = qcow2_get_cluster_type(be64_to_cpu(l2_table[i])); if (type != QCOW2_CLUSTER_UNALLOCATED) { break; } } return i;}
0
void bdrv_set_geometry_hint(BlockDriverState *bs, int cyls, int heads, int secs){ bs->cyls = cyls; bs->heads = heads; bs->secs = secs;}
0
static BlockDriverState *bdrv_new_open(const char *filename, const char *fmt, int flags){ BlockDriverState *bs; BlockDriver *drv; char password[256]; bs = bdrv_new(""); if (!bs) { error_report("Not enough memory"); goto fail; } if (fmt) { drv = bdrv_find_format(fmt); if (!drv) { error_report("Unknown file format '%s'",...
0
static uint32_t bitband_readl(void *opaque, target_phys_addr_t offset){ uint32_t addr; uint32_t mask; uint32_t v; addr = bitband_addr(opaque, offset) & ~3; mask = (1 << ((offset >> 2) & 31)); mask = tswap32(mask); cpu_physical_memory_read(addr, (uint8_t *)&v, 4); return (v & mask) != 0;}
0
int64_t qemu_strtosz_MiB(const char *nptr, char **end){ return do_strtosz(nptr, end, 'M', 1024);}
0
static void to_json(const QObject *obj, QString *str, int pretty, int indent){ switch (qobject_type(obj)) { case QTYPE_QINT: { QInt *val = qobject_to_qint(obj); char buffer[1024]; snprintf(buffer, sizeof(buffer), "%" PRId64, qint_get_int(val)); qstring_append(str, buffer); break; } case QTYPE_QSTRING: { QString *val = ...
0
static int rm_assemble_video_frame(AVFormatContext *s, RMContext *rm, AVPacket *pkt, int len){ ByteIOContext *pb = &s->pb; int hdr, seq, pic_num, len2, pos; int type; int ssize; hdr = get_byte(pb); len--; type = hdr >> 6; switch(type){ case 0: // slice case 2: // last slice seq = get_byte(pb); len--; len2 = get_num(pb,...
0
static int mux_proc_byte(CharDriverState *chr, MuxDriver *d, int ch){ if (d->term_got_escape) { d->term_got_escape = 0; if (ch == term_escape_char) goto send_char; switch(ch) { case '?': case 'h': mux_print_help(chr); break; case 'x': { const char *term = "QEMU: Terminated\n\r"; qemu_chr_fe_write(chr, (uint8_t *)term, ...
0
static void win_chr_readfile(CharDriverState *chr){ WinCharState *s = chr->opaque; int ret, err; uint8_t buf[1024]; DWORD size; ZeroMemory(&s->orecv, sizeof(s->orecv)); s->orecv.hEvent = s->hrecv; ret = ReadFile(s->hcom, buf, s->len, &size, &s->orecv); if (!ret) { err = GetLastError(); if (err == ERROR_IO_PENDING) { re...
0
void mips_r4k_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; char *filename; MemoryRegi...
0
static int write_note(struct memelfnote *men, int fd){ struct elf_note en; en.n_namesz = men->namesz; en.n_type = men->type; en.n_descsz = men->datasz; bswap_note(&en); if (dump_write(fd, &en, sizeof(en)) != 0) return (-1); if (dump_write(fd, men->name, men->namesz_rounded) != 0) return (-1); if (dump_write(fd, men->da...
0
static int vhost_virtqueue_start(struct vhost_dev *dev, struct VirtIODevice *vdev, struct vhost_virtqueue *vq, unsigned idx){ hwaddr s, l, a; int r; int vhost_vq_index = idx - dev->vq_index; struct vhost_vring_file file = { .index = vhost_vq_index }; struct vhost_vring_state state = { .index = vhost_vq_index }; struct ...
0
void vnc_client_read(void *opaque){ VncState *vs = opaque; long ret;#ifdef CONFIG_VNC_SASL if (vs->sasl.conn && vs->sasl.runSSF) ret = vnc_client_read_sasl(vs); else#endif /* CONFIG_VNC_SASL */#ifdef CONFIG_VNC_WS if (vs->encode_ws) { ret = vnc_client_read_ws(vs); if (ret == -1) { vnc_disconnect_start(vs); return; } el...
0
static void update_sono_yuv(AVFrame *sono, const ColorFloat *c, int idx){ int x, fmt = sono->format, w = sono->width; uint8_t *lpy = sono->data[0] + idx * sono->linesize[0]; uint8_t *lpu = sono->data[1] + idx * sono->linesize[1]; uint8_t *lpv = sono->data[2] + idx * sono->linesize[2]; for (x = 0; x < w; x += 2) { *lpy+...
0
static int find_pte32(CPUPPCState *env, struct mmu_ctx_hash32 *ctx, target_ulong sr, target_ulong eaddr, int rwx){ hwaddr pteg_off, pte_offset; ppc_hash_pte32_t pte; hwaddr hash; uint32_t vsid, pgidx, ptem; int ret; ret = -1; /* No entry found */ vsid = sr & SR32_VSID; ctx->key = (((sr & SR32_KP) && (msr_pr != 0)) || (...
0
static void csrhci_in_packet_vendor(struct csrhci_s *s, int ocf, uint8_t *data, int len){ int offset; uint8_t *rpkt; switch (ocf) { case OCF_CSR_SEND_FIRMWARE: /* Check if this is the bd_address packet */ if (len >= 18 + 8 && data[12] == 0x01 && data[13] == 0x00) { offset = 18; s->bd_addr.b[0] = data[offset + 7];/* Bey...
0
static void spapr_cpu_core_class_init(ObjectClass *oc, void *data){ DeviceClass *dc = DEVICE_CLASS(oc); dc->realize = spapr_cpu_core_realize;}
0
static int vnc_display_listen(VncDisplay *vd, SocketAddressLegacy **saddr, size_t nsaddr, SocketAddressLegacy **wsaddr, size_t nwsaddr, Error **errp){ size_t i; for (i = 0; i < nsaddr; i++) { if (vnc_display_listen_addr(vd, saddr[i], "vnc-listen", &vd->lsock, &vd->lsock_tag, &vd->nlsock, errp) < 0) { return -1; } } for...
0
static int do_create_others(int type, struct iovec *iovec){ dev_t rdev; int retval = 0; int offset = PROXY_HDR_SZ; V9fsString oldpath, path; int mode, uid, gid, cur_uid, cur_gid; v9fs_string_init(&path); v9fs_string_init(&oldpath); cur_uid = geteuid(); cur_gid = getegid(); retval = proxy_unmarshal(iovec, offset, "dd", ...
0
void blockdev_auto_del(BlockDriverState *bs){ DriveInfo *dinfo = drive_get_by_blockdev(bs); if (dinfo->auto_del) { drive_uninit(dinfo); }}
0
void helper_lcall_protected_T0_T1(int shift, int next_eip){ int new_cs, new_eip; uint32_t e1, e2, cpl, dpl, rpl, selector, offset, param_count; uint32_t ss, ss_e1, ss_e2, push_size, sp, type, ss_dpl; uint32_t old_ss, old_esp, val, i, limit; uint8_t *ssp, *old_ssp; new_cs = T0; new_eip = T1; if ((new_cs & 0xfffc) == 0) ...
0
static void armv7m_nvic_realize(DeviceState *dev, Error **errp){ NVICState *s = NVIC(dev); SysBusDevice *systick_sbd; Error *err = NULL; s->cpu = ARM_CPU(qemu_get_cpu(0)); assert(s->cpu); if (s->num_irq > NVIC_MAX_IRQ) { error_setg(errp, "num-irq %d exceeds NVIC maximum", s->num_irq); return; } qdev_init_gpio_in(dev, s...
1
static int nprobe(AVFormatContext *s, uint8_t *enc_header, const uint8_t *n_val){ OMAContext *oc = s->priv_data; uint32_t pos, taglen, datalen; struct AVDES av_des; if (!enc_header || !n_val) return -1; pos = OMA_ENC_HEADER_SIZE + oc->k_size; if (!memcmp(&enc_header[pos], "EKB ", 4)) pos += 32; if (AV_RB32(&enc_header[...
1
static gboolean nbd_negotiate_continue(QIOChannel *ioc, GIOCondition condition, void *opaque){ qemu_coroutine_enter(opaque, NULL); return TRUE;}
1
void object_add(const char *type, const char *id, const QDict *qdict, Visitor *v, Error **errp){ Object *obj; const QDictEntry *e; Error *local_err = NULL; if (!object_class_by_name(type)) { error_setg(errp, "invalid class name"); return; } obj = object_new(type); if (qdict) { for (e = qdict_first(qdict); e; e = qdict_...
1
static int create_filtergraph(AVFilterContext *ctx, const AVFrame *in, const AVFrame *out){ ColorSpaceContext *s = ctx->priv; const AVPixFmtDescriptor *in_desc = av_pix_fmt_desc_get(in->format); const AVPixFmtDescriptor *out_desc = av_pix_fmt_desc_get(out->format); int emms = 0, m, n, o, res, fmt_identical, redo_yuv2rg...
1
AVResampleContext *av_resample_init(int out_rate, int in_rate, int filter_size, int phase_shift, int linear, double cutoff){ AVResampleContext *c= av_mallocz(sizeof(AVResampleContext)); double factor= FFMIN(out_rate * cutoff / in_rate, 1.0); int phase_count= 1<<phase_shift; if (!c) return NULL; c->phase_shift= phase_sh...
1
static int bdrv_open_common(BlockDriverState *bs, BlockDriverState *file, QDict *options, int flags, BlockDriver *drv, Error **errp){ int ret, open_flags; const char *filename; Error *local_err = NULL; assert(drv != NULL); assert(bs->file == NULL); assert(options != NULL && bs->options != options); if (file != NULL) { ...
1
static void usage(void){ printf("qemu-" TARGET_ARCH " version " QEMU_VERSION QEMU_PKGVERSION ", Copyright (c) 2003-2008 Fabrice Bellard\n" "usage: qemu-" TARGET_ARCH " [options] program [arguments...]\n" "Linux CPU emulator (compiled for %s emulation)\n" "\n" "Standard options:\n" "-h print this help\n" "-g port wait g...
1
void visit_end_struct(Visitor *v, Error **errp){ assert(!error_is_set(errp)); v->end_struct(v, errp);}
1
static int udp_read_packet(AVFormatContext *s, RTSPStream **prtsp_st, uint8_t *buf, int buf_size){ RTSPState *rt = s->priv_data; RTSPStream *rtsp_st; fd_set rfds; int fd, fd_max, n, i, ret, tcp_fd; struct timeval tv; for(;;) { if (url_interrupt_cb()) return AVERROR(EINTR); FD_ZERO(&rfds); tcp_fd = fd_max = url_get_file...
1
static float **alloc_audio_arrays(int channels, int frame_size){ float **audio = av_mallocz_array(channels, sizeof(float *)); if (!audio) return NULL; for (int ch = 0; ch < channels; ch++) { audio[ch] = av_mallocz_array(frame_size, sizeof(float)); if (!audio[ch]) { // alloc has failed, free everything allocated thus fa...
1
static void unterminated_sq_string(void){ QObject *obj = qobject_from_json("'abc", NULL); g_assert(obj == NULL);}
1
static inline bool use_goto_tb(DisasContext *s, int n, uint64_t dest){ /* No direct tb linking with singlestep (either QEMU's or the ARM * debug architecture kind) or deterministic io */ if (s->base.singlestep_enabled || s->ss_active || (s->base.tb->cflags & CF_LAST_IO)) { return false; }#ifndef CONFIG_USER_ONLY /* Onl...
1
static int common_end(AVCodecContext *avctx){ FFV1Context *s = avctx->priv_data; int i; for(i=0; i<s->plane_count; i++){ PlaneContext *p= &s->plane[i]; av_freep(&p->state); } return 0;}
1
av_cold void ff_sws_init_input_funcs(SwsContext *c){ enum PixelFormat srcFormat = c->srcFormat; c->chrToYV12 = NULL; switch(srcFormat) { case PIX_FMT_YUYV422 : c->chrToYV12 = yuy2ToUV_c; break; case PIX_FMT_UYVY422 : c->chrToYV12 = uyvyToUV_c; break; case PIX_FMT_NV12 : c->chrToYV12 = nv12ToUV_c; break; case PIX_FMT_NV...
1
static uint32_t pcie_mmcfg_data_read(PCIBus *s, uint32_t addr, int len){ PCIDevice *pci_dev = pcie_dev_find_by_mmcfg_addr(s, addr); if (!pci_dev) { return ~0x0; } return pci_host_config_read_common(pci_dev, PCIE_MMCFG_CONFOFFSET(addr), pci_config_size(pci_dev), len);}
1
int av_stream_add_side_data(AVStream *st, enum AVPacketSideDataType type, uint8_t *data, size_t size){ AVPacketSideData *sd, *tmp; int i; for (i = 0; i < st->nb_side_data; i++) { sd = &st->side_data[i]; if (sd->type == type) { av_freep(&sd->data); sd->data = data; sd->size = size; return 0; } } tmp = av_realloc_array(s...
1
static void qemu_announce_self_once(void *opaque){ int i, len; VLANState *vlan; VLANClientState *vc; uint8_t buf[256]; static int count = SELF_ANNOUNCE_ROUNDS; QEMUTimer *timer = *(QEMUTimer **)opaque; for (i = 0; i < MAX_NICS; i++) { if (!nd_table[i].used) continue; len = announce_self_create(buf, nd_table[i].macaddr)...
1
static PCIDevice *do_pci_register_device(PCIDevice *pci_dev, PCIBus *bus, const char *name, int devfn){ PCIDeviceClass *pc = PCI_DEVICE_GET_CLASS(pci_dev); PCIConfigReadFunc *config_read = pc->config_read; PCIConfigWriteFunc *config_write = pc->config_write; AddressSpace *dma_as; if (devfn < 0) { for(devfn = bus->devfn...
0
static void avc_luma_vt_8w_msa(const uint8_t *src, int32_t src_stride, uint8_t *dst, int32_t dst_stride, int32_t height){ int32_t loop_cnt; int16_t filt_const0 = 0xfb01; int16_t filt_const1 = 0x1414; int16_t filt_const2 = 0x1fb; v16i8 src0, src1, src2, src3, src4, src7, src8, src9, src10; v16i8 src10_r, src32_r, src76_...
1
static bool xhci_er_full(void *opaque, int version_id){ struct XHCIInterrupter *intr = opaque; return intr->er_full;}
1
bool st_change_trace_event_state(const char *tname, bool tstate){ TraceEvent *tp; tp = find_trace_event_by_name(tname); if (tp) { tp->state = tstate; return true; } return false;}
1
aio_read_f(int argc, char **argv){int nr_iov, c;struct aio_ctx *ctx = calloc(1, sizeof(struct aio_ctx));BlockDriverAIOCB *acb;while ((c = getopt(argc, argv, "CP:qv")) != EOF) {switch (c) {case 'C':ctx->Cflag = 1;break;case 'P':ctx->Pflag = 1;ctx->pattern = parse_pattern(optarg);if (ctx->pattern < 0)return 0;break;case ...
1
int ff_eval_refl(int *refl, const int16_t *coefs, AVCodecContext *avctx){ int b, i, j; int buffer1[LPC_ORDER]; int buffer2[LPC_ORDER]; int *bp1 = buffer1; int *bp2 = buffer2; for (i=0; i < LPC_ORDER; i++) buffer2[i] = coefs[i]; refl[LPC_ORDER-1] = bp2[LPC_ORDER-1]; if ((unsigned) bp2[LPC_ORDER-1] + 0x1000 > 0x1fff) { a...
1
void cpu_loop(CPUAlphaState *env){ int trapnr; target_siginfo_t info; abi_long sysret; while (1) { trapnr = cpu_alpha_exec (env); /* All of the traps imply a transition through PALcode, which implies an REI instruction has been executed. Which means that the intr_flag should be cleared. */ env->intr_flag = 0; switch (t...