label
int64
0
1
func
stringlengths
21
96.3k
1
static av_cold int ape_decode_init(AVCodecContext * avctx){ APEContext *s = avctx->priv_data; int i; if (avctx->extradata_size != 6) { av_log(avctx, AV_LOG_ERROR, "Incorrect extradata\n"); return -1; } if (avctx->bits_per_coded_sample != 16) { av_log(avctx, AV_LOG_ERROR, "Only 16-bit samples are supported\n"); return -...
1
void monitor_vprintf(Monitor *mon, const char *fmt, va_list ap){ char buf[4096]; if (!mon) return; if (monitor_ctrl_mode(mon)) { return; } vsnprintf(buf, sizeof(buf), fmt, ap); monitor_puts(mon, buf);}
1
static void hScale16To19_c(SwsContext *c, int16_t *_dst, int dstW, const uint8_t *_src, const int16_t *filter, const int16_t *filterPos, int filterSize){ int i; int32_t *dst = (int32_t *) _dst; const uint16_t *src = (const uint16_t *) _src; int bits = av_pix_fmt_descriptors[c->srcFormat].comp[0].depth_minus1; int sh = ...
1
static int milkymist_softusb_init(SysBusDevice *dev){ MilkymistSoftUsbState *s = MILKYMIST_SOFTUSB(dev); sysbus_init_irq(dev, &s->irq); memory_region_init_io(&s->regs_region, OBJECT(s), &softusb_mmio_ops, s, "milkymist-softusb", R_MAX * 4); sysbus_init_mmio(dev, &s->regs_region); /* register pmem and dmem */ memory_reg...
1
static gnutls_certificate_credentials_t vnc_tls_initialize_x509_cred(VncDisplay *vd){ gnutls_certificate_credentials_t x509_cred; int ret; if (!vd->tls.x509cacert) { VNC_DEBUG("No CA x509 certificate specified\n"); return NULL; } if (!vd->tls.x509cert) { VNC_DEBUG("No server x509 certificate specified\n"); return NULL;...
1
static int client_migrate_info(Monitor *mon, const QDict *qdict, MonitorCompletion cb, void *opaque){ const char *protocol = qdict_get_str(qdict, "protocol"); const char *hostname = qdict_get_str(qdict, "hostname"); const char *subject = qdict_get_try_str(qdict, "cert-subject"); int port = qdict_get_try_int(qdict, "por...
1
static void cmd_inquiry(IDEState *s, uint8_t *buf){ int max_len = buf[4]; buf[0] = 0x05; /* CD-ROM */ buf[1] = 0x80; /* removable */ buf[2] = 0x00; /* ISO */ buf[3] = 0x21; /* ATAPI-2 (XXX: put ATAPI-4 ?) */ buf[4] = 31; /* additional length */ buf[5] = 0; /* reserved */ buf[6] = 0; /* reserved */ buf[7] = 0; /* reserv...
1
uint32 float32_to_uint32( float32 a STATUS_PARAM ){ int64_t v; uint32 res; v = float32_to_int64(a STATUS_VAR); if (v < 0) { res = 0; float_raise( float_flag_invalid STATUS_VAR); } else if (v > 0xffffffff) { res = 0xffffffff; float_raise( float_flag_invalid STATUS_VAR); } else { res = v; } return res;}
1
sowrite(struct socket *so){int n,nn;struct sbuf *sb = &so->so_rcv;int len = sb->sb_cc;struct iovec iov[2];DEBUG_CALL("sowrite");DEBUG_ARG("so = %p", so);if (so->so_urgc) {sosendoob(so);if (sb->sb_cc == 0)return 0;}/* * No need to check if there's something to write, * sowrite wouldn't have been called otherwise */iov[0...
1
static int64_t coroutine_fn raw_co_get_block_status(BlockDriverState *bs, int64_t sector_num, int nb_sectors, int *pnum){ off_t start, data = 0, hole = 0; int64_t total_size; int ret; ret = fd_open(bs); if (ret < 0) { return ret; } start = sector_num * BDRV_SECTOR_SIZE; total_size = bdrv_getlength(bs); if (total_size <...
1
int load_elf_binary(struct linux_binprm * bprm, struct target_pt_regs * regs, struct image_info * info){ struct elfhdr elf_ex; struct elfhdr interp_elf_ex; struct exec interp_ex; int interpreter_fd = -1; /* avoid warning */ abi_ulong load_addr, load_bias; int load_addr_set = 0; unsigned int interpreter_type = INTERPRET...
1
static bool hyperv_enabled(X86CPU *cpu){ CPUState *cs = CPU(cpu); return kvm_check_extension(cs->kvm_state, KVM_CAP_HYPERV) > 0 && (hyperv_hypercall_available(cpu) || cpu->hyperv_time || cpu->hyperv_relaxed_timing);}
0
static void test_butterflies_float(const float *src0, const float *src1){ LOCAL_ALIGNED_16(float, cdst, [LEN]); LOCAL_ALIGNED_16(float, odst, [LEN]); LOCAL_ALIGNED_16(float, cdst1, [LEN]); LOCAL_ALIGNED_16(float, odst1, [LEN]); int i; declare_func(void, float *av_restrict src0, float *av_restrict src1, int len); memcpy...
0
static int wav_read_packet(AVFormatContext *s, AVPacket *pkt){ int ret, size; int64_t left; AVStream *st; WAVDemuxContext *wav = s->priv_data; if (CONFIG_SPDIF_DEMUXER && wav->spdif == 0 && s->streams[0]->codec->codec_tag == 1) { enum AVCodecID codec; ret = ff_spdif_probe(s->pb->buffer, s->pb->buf_end - s->pb->buffer, ...
0
int ff_new_chapter(AVFormatContext *s, int id, int64_t start, int64_t end, const char *title){ AVChapter *chapter = NULL; int i; for(i=0; i<s->num_chapters; i++) if(s->chapters[i]->id == id) chapter = s->chapters[i]; if(!chapter){ chapter= av_mallocz(sizeof(AVChapter)); if(!chapter) return AVERROR(ENOMEM); dynarray_add...
0
static int flic_decode_frame_8BPP(AVCodecContext *avctx, void *data, int *got_frame, const uint8_t *buf, int buf_size){ FlicDecodeContext *s = avctx->priv_data; GetByteContext g2; int pixel_ptr; int palette_ptr; unsigned char palette_idx1; unsigned char palette_idx2; unsigned int frame_size; int num_chunks; unsigned in...
1
static int armv7m_nvic_init(SysBusDevice *dev){ nvic_state *s = NVIC(dev); NVICClass *nc = NVIC_GET_CLASS(s); /* The NVIC always has only one CPU */ s->gic.num_cpu = 1; /* Tell the common code we're an NVIC */ s->gic.revision = 0xffffffff; s->num_irq = s->gic.num_irq; nc->parent_init(dev); gic_init_irqs_and_distributor...
1
static void nfs_co_generic_bh_cb(void *opaque){ NFSRPC *task = opaque; task->complete = 1; qemu_bh_delete(task->bh); qemu_coroutine_enter(task->co, NULL);}
1
static void vnc_resize(VncState *vs){ DisplayState *ds = vs->ds; int size_changed; vs->old_data = qemu_realloc(vs->old_data, ds_get_linesize(ds) * ds_get_height(ds)); if (vs->old_data == NULL) { fprintf(stderr, "vnc: memory allocation failed\n"); exit(1); } if (ds_get_bytes_per_pixel(ds) != vs->serverds.pf.bytes_per_pi...
1
e1000_can_receive(VLANClientState *nc){ E1000State *s = DO_UPCAST(NICState, nc, nc)->opaque; return (s->mac_reg[RCTL] & E1000_RCTL_EN);}
1
static void access_with_adjusted_size(hwaddr addr, uint64_t *value, unsigned size, unsigned access_size_min, unsigned access_size_max, void (*access)(MemoryRegion *mr, hwaddr addr, uint64_t *value, unsigned size, unsigned shift, uint64_t mask), MemoryRegion *mr){ uint64_t access_mask; unsigned access_size; unsigned i; ...
1
static void drive_uninit(DriveInfo *dinfo){ qemu_opts_del(dinfo->opts); bdrv_delete(dinfo->bdrv); QTAILQ_REMOVE(&drives, dinfo, next); qemu_free(dinfo);}
1
static void mpeg_decode_sequence_extension(Mpeg1Context *s1){ MpegEncContext *s = &s1->mpeg_enc_ctx; int horiz_size_ext, vert_size_ext; int bit_rate_ext; skip_bits(&s->gb, 1); /* profile and level esc*/ s->avctx->profile = get_bits(&s->gb, 3); s->avctx->level = get_bits(&s->gb, 4); s->progressive_sequence = get_bits1(&...
1
static void get_pixels_altivec(int16_t *restrict block, const uint8_t *pixels, int line_size){ int i; vector unsigned char perm = vec_lvsl(0, pixels); vector unsigned char bytes; const vector unsigned char zero = (const vector unsigned char)vec_splat_u8(0); vector signed short shorts; for (i = 0; i < 8; i++) { // Read ...
1
static void pc_q35_init_1_5(QEMUMachineInitArgs *args){ has_pci_info = false; pc_q35_init(args);}
1
static int sap_write_close(AVFormatContext *s){ struct SAPState *sap = s->priv_data; int i; for (i = 0; i < s->nb_streams; i++) { AVFormatContext *rtpctx = s->streams[i]->priv_data; if (!rtpctx) continue; av_write_trailer(rtpctx); url_fclose(rtpctx->pb); av_metadata_free(&rtpctx->streams[0]->metadata); av_metadata_free...
1
void ahci_hba_enable(AHCIQState *ahci){ /* Bits of interest in this section: * GHC.AE Global Host Control / AHCI Enable * PxCMD.ST Port Command: Start * PxCMD.SUD "Spin Up Device" * PxCMD.POD "Power On Device" * PxCMD.FRE "FIS Receive Enable" * PxCMD.FR "FIS Receive Running" * PxCMD.CR "Command List Running" */ uint32_...
1
static void ppc6xx_set_irq (void *opaque, int pin, int level){ CPUState *env = opaque; int cur_level;#if defined(PPC_DEBUG_IRQ) if (loglevel & CPU_LOG_INT) { fprintf(logfile, "%s: env %p pin %d level %d\n", __func__, env, pin, level); }#endif cur_level = (env->irq_input_state >> pin) & 1; /* Don't generate spurious eve...
1
static void do_order_test(void){ Coroutine *co; co = qemu_coroutine_create(co_order_test); record_push(1, 1); qemu_coroutine_enter(co, NULL); record_push(1, 2); g_assert(!qemu_in_coroutine()); qemu_coroutine_enter(co, NULL); record_push(1, 3); g_assert(!qemu_in_coroutine());}
1
static int get_cod(Jpeg2000DecoderContext *s, Jpeg2000CodingStyle *c, uint8_t *properties){ Jpeg2000CodingStyle tmp; int compno; if (s->buf_end - s->buf < 5) return AVERROR_INVALIDDATA; tmp.log2_prec_width = tmp.log2_prec_height = 15; tmp.csty = bytestream_get_byte(&s->buf); // get progression order tmp.prog_order = by...
1
static void qtest_process_command(CharDriverState *chr, gchar **words){ const gchar *command; g_assert(words); command = words[0]; if (qtest_log_fp) { qemu_timeval tv; int i; qtest_get_time(&tv); fprintf(qtest_log_fp, "[R +" FMT_timeval "]", (long) tv.tv_sec, (long) tv.tv_usec); for (i = 0; words[i]; i++) { fprintf(qte...
1
static target_long monitor_get_msr (const struct MonitorDef *md, int val){ CPUState *env = mon_get_cpu(); if (!env) return 0; return env->msr;}
1
static inline int RENAME(yuv420_rgb32)(SwsContext *c, uint8_t* src[], int srcStride[], int srcSliceY, int srcSliceH, uint8_t* dst[], int dstStride[]){ int y, h_size; if(c->srcFormat == PIX_FMT_YUV422P){srcStride[1] *= 2;srcStride[2] *= 2; } h_size= (c->dstW+7)&~7; if(h_size*4 > FFABS(dstStride[0])) h_size-=8; __asm__ _...
1
static void gen_ld (CPUState *env, DisasContext *ctx, uint32_t opc, int rt, int base, int16_t offset){ const char *opn = "ld"; TCGv t0, t1; if (rt == 0 && env->insn_flags & (INSN_LOONGSON2E | INSN_LOONGSON2F)) { /* Loongson CPU uses a load to zero register for prefetch. We emulate it as a NOP. On other CPU we must perf...
1
static int latm_decode_audio_specific_config(struct LATMContext *latmctx, GetBitContext *gb, int asclen){ AACContext *ac = &latmctx->aac_ctx; AVCodecContext *avctx = ac->avctx; MPEG4AudioConfig m4ac = {0}; int config_start_bit = get_bits_count(gb); int sync_extension = 0; int bits_consumed, esize; if (asclen) { sync_ex...
1
static void ehci_frame_timer(void *opaque){ EHCIState *ehci = opaque; int need_timer = 0; int64_t expire_time, t_now; uint64_t ns_elapsed; uint64_t uframes, skipped_uframes; int i; t_now = qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL); ns_elapsed = t_now - ehci->last_run_ns; uframes = ns_elapsed / UFRAME_TIMER_NS; if (ehci_per...
1
int bdrv_inactivate_all(void){ BlockDriverState *bs = NULL; BdrvNextIterator it; int ret = 0; int pass; for (bs = bdrv_first(&it); bs; bs = bdrv_next(&it)) { aio_context_acquire(bdrv_get_aio_context(bs)); } /* We do two passes of inactivation. The first pass calls to drivers' * .bdrv_inactivate callbacks recursively so...
0
static void x86_cpu_parse_featurestr(CPUState *cs, char *features, Error **errp){ X86CPU *cpu = X86_CPU(cs); char *featurestr; /* Single 'key=value" string being parsed */ FeatureWord w; /* Features to be added */ FeatureWordArray plus_features = { 0 }; /* Features to be removed */ FeatureWordArray minus_features = { 0...
0
static void do_sendkey(const char *string){ uint8_t keycodes[16]; int nb_keycodes = 0; char keyname_buf[16]; char *separator; int keyname_len, keycode, i; while (1) { separator = strchr(string, '-'); keyname_len = separator ? separator - string : strlen(string); if (keyname_len > 0) { pstrcpy(keyname_buf, sizeof(keynam...
0
static int nbd_co_receive_request(NBDRequestData *req, NBDRequest *request, Error **errp){ NBDClient *client = req->client; g_assert(qemu_in_coroutine()); assert(client->recv_coroutine == qemu_coroutine_self()); if (nbd_receive_request(client->ioc, request, errp) < 0) { return -EIO; } trace_nbd_co_receive_request_decod...
0
int qio_channel_writev_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)); w...
0
static int spapr_vio_busdev_init(DeviceState *qdev){ VIOsPAPRDevice *dev = (VIOsPAPRDevice *)qdev; VIOsPAPRDeviceClass *pc = VIO_SPAPR_DEVICE_GET_CLASS(dev); uint32_t liobn; char *id; if (dev->reg != -1) { /* * Explicitly assigned address, just verify that no-one else * is using it. other mechanism). We have to open co...
0
static unsigned int dec_subs_r(DisasContext *dc){TCGv t0;int size = memsize_z(dc);DIS(fprintf (logfile, "subs.%c $r%u, $r%u\n", memsize_char(size), dc->op1, dc->op2));cris_cc_mask(dc, CC_MASK_NZVC);t0 = tcg_temp_new(TCG_TYPE_TL);/* Size can only be qi or hi. */t_gen_sext(t0, cpu_R[dc->op1], size);cris_alu(dc, CC_OP_SUB...
0
blkdebug_co_preadv(BlockDriverState *bs, uint64_t offset, uint64_t bytes, QEMUIOVector *qiov, int flags){ BDRVBlkdebugState *s = bs->opaque; BlkdebugRule *rule = NULL; /* Sanity check block layer guarantees */ assert(QEMU_IS_ALIGNED(offset, bs->bl.request_alignment)); assert(QEMU_IS_ALIGNED(bytes, bs->bl.request_alignm...
0
static int vmdk_open(BlockDriverState *bs, QDict *options, int flags, Error **errp){ char *buf; int ret; BDRVVmdkState *s = bs->opaque; uint32_t magic; buf = vmdk_read_desc(bs->file, 0, errp); if (!buf) { return -EINVAL; } magic = ldl_be_p(buf); switch (magic) { case VMDK3_MAGIC: case VMDK4_MAGIC: ret = vmdk_open_spars...
0
void visit_type_size(Visitor *v, uint64_t *obj, const char *name, Error **errp){ int64_t value; if (v->type_size) { v->type_size(v, obj, name, errp); } else if (v->type_uint64) { v->type_uint64(v, obj, name, errp); } else { value = *obj; v->type_int64(v, &value, name, errp); *obj = value; }}
0
void *virtqueue_pop(VirtQueue *vq, size_t sz){ unsigned int i, head, max; hwaddr desc_pa = vq->vring.desc; VirtIODevice *vdev = vq->vdev; VirtQueueElement *elem; unsigned out_num, in_num; hwaddr addr[VIRTQUEUE_MAX_SIZE]; struct iovec iov[VIRTQUEUE_MAX_SIZE]; VRingDesc desc; if (!virtqueue_num_heads(vq, vq->last_avail_i...
0
static void tgen_ext8s(TCGContext *s, TCGType type, TCGReg dest, TCGReg src){ if (facilities & FACILITY_EXT_IMM) { tcg_out_insn(s, RRE, LGBR, dest, src); return; } if (type == TCG_TYPE_I32) { if (dest == src) { tcg_out_sh32(s, RS_SLL, dest, TCG_REG_NONE, 24); } else { tcg_out_sh64(s, RSY_SLLG, dest, src, TCG_REG_NONE, ...
0
void mips_cpu_list (FILE *f, int (*cpu_fprintf)(FILE *f, const char *fmt, ...)){ int i; for (i = 0; i < ARRAY_SIZE(mips_defs); i++) { (*cpu_fprintf)(f, "MIPS '%s'\n", mips_defs[i].name); }}
0
static int tpm_passthrough_handle_device_opts(QemuOpts *opts, TPMBackend *tb){ TPMPassthruState *tpm_pt = TPM_PASSTHROUGH(tb); const char *value; value = qemu_opt_get(opts, "cancel-path"); tb->cancel_path = g_strdup(value); value = qemu_opt_get(opts, "path"); if (!value) { value = TPM_PASSTHROUGH_DEFAULT_DEVICE; } tpm_...
0
void ff_put_h264_qpel4_mc02_msa(uint8_t *dst, const uint8_t *src, ptrdiff_t stride){ avc_luma_vt_4w_msa(src - (stride * 2), stride, dst, stride, 4);}
0
static int nbd_co_writev_1(BlockDriverState *bs, int64_t sector_num, int nb_sectors, QEMUIOVector *qiov, int offset){ BDRVNBDState *s = bs->opaque; struct nbd_request request; struct nbd_reply reply; request.type = NBD_CMD_WRITE; if (!bdrv_enable_write_cache(bs) && (s->nbdflags & NBD_FLAG_SEND_FUA)) { request.type |= N...
1
void mtree_info(fprintf_function mon_printf, void *f){ MemoryRegionListHead ml_head; MemoryRegionList *ml, *ml2; QTAILQ_INIT(&ml_head); mon_printf(f, "memory\n"); mtree_print_mr(mon_printf, f, address_space_memory.root, 0, 0, &ml_head); /* print aliased regions */ QTAILQ_FOREACH(ml, &ml_head, queue) { if (!ml->printed)...
1
static int tm2_read_deltas(TM2Context *ctx, int stream_id){ int d, mb; int i, v; d = get_bits(&ctx->gb, 9); mb = get_bits(&ctx->gb, 5); av_assert2(mb < 32); if ((d < 1) || (d > TM2_DELTAS) || (mb < 1)) { av_log(ctx->avctx, AV_LOG_ERROR, "Incorrect delta table: %i deltas x %i bits\n", d, mb); return AVERROR_INVALIDDATA;...
1
static void decode_delta_j(uint8_t *dst, const uint8_t *buf, const uint8_t *buf_end, int w, int h, int bpp, int dst_size){ int32_t pitch; uint8_t *end = dst + dst_size, *ptr; uint32_t type, flag, cols, groups, rows, bytes; uint32_t offset; int planepitch_byte = (w + 7) / 8; int planepitch = ((w + 15) / 16) * 2; int klu...
1
static int libshine_encode_frame(AVCodecContext *avctx, AVPacket *avpkt, const AVFrame *frame, int *got_packet_ptr){ SHINEContext *s = avctx->priv_data; MPADecodeHeader hdr; unsigned char *data; long written; int ret, len; if (frame) data = shine_encode_buffer(s->shine, (int16_t **)frame->data, &written); else data = s...
0
static int flac_write_trailer(struct AVFormatContext *s){ ByteIOContext *pb = s->pb; uint8_t *streaminfo = s->streams[0]->codec->extradata; int len = s->streams[0]->codec->extradata_size; int64_t file_size; if (streaminfo && len > 0 && !url_is_streamed(s->pb)) { file_size = url_ftell(pb); url_fseek(pb, 8, SEEK_SET); pu...
1
int egl_rendernode_init(const char *rendernode){ qemu_egl_rn_fd = -1; qemu_egl_rn_fd = qemu_egl_rendernode_open(rendernode); if (qemu_egl_rn_fd == -1) { error_report("egl: no drm render node available"); goto err; } qemu_egl_rn_gbm_dev = gbm_create_device(qemu_egl_rn_fd); if (!qemu_egl_rn_gbm_dev) { error_report("egl: ...
1
static inline int read_line(AVFormatContext *s, char *rbuf, const int rbufsize, int *rbuflen){ RTSPState *rt = s->priv_data; int idx = 0; int ret = 0; *rbuflen = 0; do { ret = ffurl_read_complete(rt->rtsp_hd, rbuf + idx, 1); if (ret < 0) return ret; if (rbuf[idx] == '\r') { /* Ignore */ } else if (rbuf[idx] == '\n') { ...
1
static void pc_cpu_unplug_request_cb(HotplugHandler *hotplug_dev, DeviceState *dev, Error **errp){ int idx = -1; HotplugHandlerClass *hhc; Error *local_err = NULL; X86CPU *cpu = X86_CPU(dev); PCMachineState *pcms = PC_MACHINE(hotplug_dev); pc_find_cpu_slot(MACHINE(pcms), cpu->apic_id, &idx); assert(idx != -1); if (idx ...
1
static void lm32_evr_init(QEMUMachineInitArgs *args){ const char *cpu_model = args->cpu_model; const char *kernel_filename = args->kernel_filename; LM32CPU *cpu; CPULM32State *env; DriveInfo *dinfo; MemoryRegion *address_space_mem = get_system_memory(); MemoryRegion *phys_ram = g_new(MemoryRegion, 1); qemu_irq *cpu_irq...
0
static void nam_writel (void *opaque, uint32_t addr, uint32_t val){ PCIAC97LinkState *d = opaque; AC97LinkState *s = &d->ac97; dolog ("U nam writel %#x <- %#x\n", addr, val); s->cas = 0;}
0
static void smbios_check_collision(int type, int entry){ if (type < ARRAY_SIZE(first_opt)) { if (first_opt[type].seen) { if (first_opt[type].headertype != entry) { error_report("Can't mix file= and type= for same type"); loc_push_restore(&first_opt[type].loc); error_report("This is the conflicting setting"); loc_pop(&f...
0
static void monitor_read_command(Monitor *mon, int show_prompt){ if (!mon->rs) return; readline_start(mon->rs, "(qemu) ", 0, monitor_command_cb, NULL); if (show_prompt) readline_show_prompt(mon->rs);}
0
DriveInfo *drive_init(QemuOpts *opts, int default_to_scsi){ const char *buf; const char *file = NULL; char devname[128]; const char *serial; const char *mediastr = ""; BlockInterfaceType type; enum { MEDIA_DISK, MEDIA_CDROM } media; int bus_id, unit_id; int cyls, heads, secs, translation; BlockDriver *drv = NULL; int m...
0
static void sx1_init(MachineState *machine, const int version){ struct omap_mpu_state_s *mpu; MemoryRegion *address_space = get_system_memory(); MemoryRegion *flash = g_new(MemoryRegion, 1); MemoryRegion *flash_1 = g_new(MemoryRegion, 1); MemoryRegion *cs = g_new(MemoryRegion, 4); static uint32_t cs0val = 0x00213090; s...
0
qcrypto_block_luks_load_key(QCryptoBlock *block, QCryptoBlockLUKSKeySlot *slot, const char *password, QCryptoCipherAlgorithm cipheralg, QCryptoCipherMode ciphermode, QCryptoHashAlgorithm hash, QCryptoIVGenAlgorithm ivalg, QCryptoCipherAlgorithm ivcipheralg, QCryptoHashAlgorithm ivhash, uint8_t *masterkey, size_t master...
0
static uint64_t gem_read(void *opaque, target_phys_addr_t offset, unsigned size){ GemState *s; uint32_t retval; s = (GemState *)opaque; offset >>= 2; retval = s->regs[offset]; DB_PRINT("offset: 0x%04x read: 0x%08x\n", offset*4, retval); switch (offset) { case GEM_ISR: qemu_set_irq(s->irq, 0); break; case GEM_PHYMNTNC: ...
0
static void musicpal_lcd_init(DisplayState *ds, uint32_t base){ musicpal_lcd_state *s; int iomemtype; s = qemu_mallocz(sizeof(musicpal_lcd_state)); if (!s) return; s->base = base; s->ds = ds; iomemtype = cpu_register_io_memory(0, musicpal_lcd_readfn, musicpal_lcd_writefn, s); cpu_register_physical_memory(base, MP_LCD_S...
0
void virtqueue_get_avail_bytes(VirtQueue *vq, unsigned int *in_bytes, unsigned int *out_bytes){ unsigned int idx; unsigned int total_bufs, in_total, out_total; idx = vq->last_avail_idx; total_bufs = in_total = out_total = 0; while (virtqueue_num_heads(vq, idx)) { unsigned int max, num_bufs, indirect = 0; hwaddr desc_pa...
0
static int xen_pt_cmd_reg_write(XenPCIPassthroughState *s, XenPTReg *cfg_entry, uint16_t *val, uint16_t dev_value, uint16_t valid_mask){ XenPTRegInfo *reg = cfg_entry->reg; uint16_t writable_mask = 0; uint16_t throughable_mask = get_throughable_mask(s, reg, valid_mask); /* modify emulate register */ writable_mask = ~re...
0
static void v9fs_remove(void *opaque){ int32_t fid; int err = 0; size_t offset = 7; V9fsFidState *fidp; V9fsPDU *pdu = opaque; pdu_unmarshal(pdu, offset, "d", &fid); trace_v9fs_remove(pdu->tag, pdu->id, fid); fidp = get_fid(pdu, fid); if (fidp == NULL) { err = -EINVAL; goto out_nofid; } /* if fs driver is not path base...
0
static void mips_qemu_write (void *opaque, target_phys_addr_t addr, uint64_t val, unsigned size){ if ((addr & 0xffff) == 0 && val == 42) qemu_system_reset_request (); else if ((addr & 0xffff) == 4 && val == 42) qemu_system_shutdown_request ();}
0
SocketAddress *socket_remote_address(int fd, Error **errp){ struct sockaddr_storage ss; socklen_t sslen = sizeof(ss); if (getpeername(fd, (struct sockaddr *)&ss, &sslen) < 0) { error_setg_errno(errp, errno, "%s", "Unable to query remote socket address"); return NULL; } return socket_sockaddr_to_address(&ss, sslen, errp...
0
static int mov_read_wave(MOVContext *c, ByteIOContext *pb, MOVAtom atom){ AVStream *st = c->fc->streams[c->fc->nb_streams-1]; if((uint64_t)atom.size > (1<<30)) return -1; if (st->codec->codec_id == CODEC_ID_QDM2) { // pass all frma atom to codec, needed at least for QDM2 av_free(st->codec->extradata); st->codec->extrad...
0
fetchline(void){char*p, *line = malloc(MAXREADLINESZ);if (!line)return NULL;printf("%s", get_prompt());fflush(stdout);if (!fgets(line, MAXREADLINESZ, stdin)) {free(line);return NULL;}p = line + strlen(line);if (p != line && p[-1] == '\n')p[-1] = '\0';return line;}
0
static void kvmclock_vm_state_change(void *opaque, int running, RunState state){ KVMClockState *s = opaque; CPUState *cpu; int cap_clock_ctrl = kvm_check_extension(kvm_state, KVM_CAP_KVMCLOCK_CTRL); int ret; if (running) { struct kvm_clock_data data = {}; uint64_t time_at_migration = kvmclock_current_nsec(s); s->clock_...
0
static void nvenc_setup_rate_control(AVCodecContext *avctx){ NVENCContext *ctx = avctx->priv_data; NV_ENC_RC_PARAMS *rc = &ctx->config.rcParams; if (avctx->bit_rate > 0) rc->averageBitRate = avctx->bit_rate; if (avctx->rc_max_rate > 0) rc->maxBitRate = avctx->rc_max_rate; if (ctx->rc > 0) { nvenc_override_rate_control(...
0
static int filter_frame(AVFilterLink *inlink, AVFilterBufferRef *insamples){ AVFilterContext *ctx = inlink->dst; AVFilterLink *outlink = ctx->outputs[0]; ShowWavesContext *showwaves = ctx->priv; const int nb_samples = insamples->audio->nb_samples; AVFilterBufferRef *outpicref = showwaves->outpicref; int linesize = outp...
0
static void filter_mb_edgev( H264Context *h, uint8_t *pix, int stride, int bS[4], int qp ) { int i, d; const int index_a = clip( qp + h->slice_alpha_c0_offset, 0, 51 ); const int alpha = alpha_table[index_a]; const int beta = beta_table[clip( qp + h->slice_beta_offset, 0, 51 )]; for( i = 0; i < 4; i++ ) { if( bS[i] == ...
0
static void report_config_error(const char *filename, int line_num, int log_level, int *errors, const char *fmt, ...){ va_list vl; va_start(vl, fmt); av_log(NULL, log_level, "%s:%d: ", filename, line_num); av_vlog(NULL, log_level, fmt, vl); va_end(vl); (*errors)++;}
0
static int test_vector_fmul_add(AVFloatDSPContext *fdsp, AVFloatDSPContext *cdsp, const float *v1, const float *v2, const float *v3){ LOCAL_ALIGNED(32, float, cdst, [LEN]); LOCAL_ALIGNED(32, float, odst, [LEN]); int ret; cdsp->vector_fmul_add(cdst, v1, v2, v3, LEN); fdsp->vector_fmul_add(odst, v1, v2, v3, LEN); if (ret...
0
static inline int bidir_refine(MpegEncContext * s, int mb_x, int mb_y){ MotionEstContext * const c= &s->me; const int mot_stride = s->mb_stride; const int xy = mb_y *mot_stride + mb_x; int fbmin; int pred_fx= s->b_bidir_forw_mv_table[xy-1][0]; int pred_fy= s->b_bidir_forw_mv_table[xy-1][1]; int pred_bx= s->b_bidir_back...
0
int ff_h264_execute_decode_slices(H264Context *h, unsigned context_count){ AVCodecContext *const avctx = h->avctx; H264Context *hx; int i; if (h->mb_y >= h->mb_height) { av_log(h->avctx, AV_LOG_ERROR, "Input contains more MB rows than the frame height.\n"); return AVERROR_INVALIDDATA; } if (h->avctx->hwaccel) return 0;...
0
static int open_next_file(AVFormatContext *avf){ ConcatContext *cat = avf->priv_data; unsigned fileno = cat->cur_file - cat->files; if (cat->cur_file->duration == AV_NOPTS_VALUE) cat->cur_file->duration = cat->avf->duration - (cat->cur_file->file_inpoint - cat->cur_file->file_start_time); if (++fileno >= cat->nb_files)...
0
static void set_signalled(sPAPRDRConnector *drc){ drc->signalled = true;}
0
static int mig_save_device_dirty(Monitor *mon, QEMUFile *f, BlkMigDevState *bmds, int is_async){ BlkMigBlock *blk; int64_t total_sectors = bmds->total_sectors; int64_t sector; int nr_sectors; int ret = -EIO; for (sector = bmds->cur_dirty; sector < bmds->total_sectors;) { if (bmds_aio_inflight(bmds, sector)) { qemu_aio_...
0
static void pm_reset(void *opaque){ ICH9LPCPMRegs *pm = opaque; ich9_pm_iospace_update(pm, 0); acpi_pm1_evt_reset(&pm->acpi_regs); acpi_pm1_cnt_reset(&pm->acpi_regs); acpi_pm_tmr_reset(&pm->acpi_regs); acpi_gpe_reset(&pm->acpi_regs); if (kvm_enabled()) { /* Mark SMM as already inited to prevent SMM from running. KVM do...
0
int bdrv_read_unthrottled(BlockDriverState *bs, int64_t sector_num, uint8_t *buf, int nb_sectors){ bool enabled; int ret; enabled = bs->io_limits_enabled; bs->io_limits_enabled = false; ret = bdrv_read(bs, sector_num, buf, nb_sectors); bs->io_limits_enabled = enabled; return ret;}
0
static void bdrv_aio_bh_cb(void *opaque){ BlockAIOCBSync *acb = opaque; if (!acb->is_write && acb->ret >= 0) { qemu_iovec_from_buf(acb->qiov, 0, acb->bounce, acb->qiov->size); } qemu_vfree(acb->bounce); acb->common.cb(acb->common.opaque, acb->ret); qemu_bh_delete(acb->bh); acb->bh = NULL; qemu_aio_unref(acb);}
0
int ff_h263_decode_frame(AVCodecContext *avctx, void *data, int *data_size, UINT8 *buf, int buf_size){ MpegEncContext *s = avctx->priv_data; int ret,i; AVFrame *pict = data; float new_aspect; #ifdef PRINT_FRAME_TIMEuint64_t time= rdtsc();#endif#ifdef DEBUG printf("*****frame %d size=%d\n", avctx->frame_number, buf_size...
0
static int do_cont(Monitor *mon, const QDict *qdict, QObject **ret_data){ struct bdrv_iterate_context context = { mon, 0 }; if (incoming_expected) { qerror_report(QERR_MIGRATION_EXPECTED); return -1; } bdrv_iterate(encrypted_bdrv_it, &context); /* only resume the vm if all keys are set and valid */ if (!context.err) { ...
0
void qmp_x_blockdev_del(bool has_id, const char *id, bool has_node_name, const char *node_name, Error **errp){ AioContext *aio_context; BlockBackend *blk; BlockDriverState *bs; if (has_id && has_node_name) { error_setg(errp, "Only one of id and node-name must be specified"); return; } else if (!has_id && !has_node_name...
0
static void channel_store_c(struct fs_dma_ctrl *ctrl, int c){target_phys_addr_t addr = channel_reg(ctrl, c, RW_GROUP_DOWN);/* Encode and store. FIXME: handle endianness. */D(printf("%s ch=%d addr=" TARGET_FMT_plx "\n", __func__, c, addr));D(dump_d(c, &ctrl->channels[c].current_d));cpu_physical_memory_write (addr, (void...
0
void sd_set_cb(SDState *sd, qemu_irq readonly, qemu_irq insert){ sd->readonly_cb = readonly; sd->inserted_cb = insert; qemu_set_irq(readonly, sd->bdrv ? bdrv_is_read_only(sd->bdrv) : 0); qemu_set_irq(insert, sd->bdrv ? bdrv_is_inserted(sd->bdrv) : 0);}
0
static int ppc_hash32_check_prot(int prot, int rw, int access_type){ int ret; if (access_type == ACCESS_CODE) { if (prot & PAGE_EXEC) { ret = 0; } else { ret = -2; } } else if (rw) { if (prot & PAGE_WRITE) { ret = 0; } else { ret = -2; } } else { if (prot & PAGE_READ) { ret = 0; } else { ret = -2; } } return ret;}
0
static void spr_write_40x_dbcr0 (void *opaque, int sprn){ DisasContext *ctx = opaque; gen_op_store_40x_dbcr0(); /* We must stop translation as we may have rebooted */ RET_STOP(ctx);}
0
static void eth_receive(void *opaque, const uint8_t *buf, size_t size){ mv88w8618_eth_state *s = opaque; uint32_t desc_addr; mv88w8618_rx_desc desc; int i; for (i = 0; i < 4; i++) { desc_addr = s->cur_rx[i]; if (!desc_addr) continue; do { eth_rx_desc_get(desc_addr, &desc); if ((desc.cmdstat & MP_ETH_RX_OWN) && desc.buf...
0
static bool version_is_5(void *opaque, int version_id){ return version_id == 5;}
0
static int parse_ifo_palette(DVDSubContext *ctx, char *p){ FILE *ifo; char ifostr[12]; uint32_t sp_pgci, pgci, off_pgc, pgc; uint8_t r, g, b, yuv[65], *buf; int i, y, cb, cr, r_add, g_add, b_add; int ret = 0; const uint8_t *cm = ff_crop_tab + MAX_NEG_CROP; ctx->has_palette = 0; if ((ifo = fopen(p, "r")) == NULL) { av_l...