label
int64
0
1
func
stringlengths
21
96.3k
0
static inline tcg_target_ulong cpu_tb_exec(CPUState *cpu, TranslationBlock *itb){ CPUArchState *env = cpu->env_ptr; uintptr_t ret; TranslationBlock *last_tb; int tb_exit; uint8_t *tb_ptr = itb->tc_ptr; qemu_log_mask_and_addr(CPU_LOG_EXEC, itb->pc, "Trace %p [" TARGET_FMT_lx "] %s\n", itb->tc_ptr, itb->pc, lookup_symbol...
0
static int get_para_features(CPUState *env){ int i, features = 0; for (i = 0; i < ARRAY_SIZE(para_features) - 1; i++) { if (kvm_check_extension(env->kvm_state, para_features[i].cap)) features |= (1 << para_features[i].feature); } return features;}
0
int msix_init_exclusive_bar(PCIDevice *dev, unsigned short nentries, uint8_t bar_nr){ int ret; char *name; /* * Migration compatibility dictates that this remains a 4k * BAR with the vector table in the lower half and PBA in * the upper half. Do not use these elsewhere! */#define MSIX_EXCLUSIVE_BAR_SIZE 4096#define MSI...
0
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->gic.num_irq = s->num_irq; nc->parent_init(dev); gic_init_irqs_and_distributor...
0
static int get_mmu_address(CPUState * env, target_ulong * physical, int *prot, target_ulong address, int rw, int access_type){ int use_asid, n; tlb_t *matching = NULL; use_asid = (env->mmucr & MMUCR_SV) == 0 || (env->sr & SR_MD) == 0; if (rw == 2) {n = find_itlb_entry(env, address, use_asid, 1);if (n >= 0) { matching =...
0
static void add_codec(FFStream *stream, AVCodecContext *av){ AVStream *st; if(stream->nb_streams >= FF_ARRAY_ELEMS(stream->streams)) return; /* compute default parameters */ switch(av->codec_type) { case AVMEDIA_TYPE_AUDIO: if (av->bit_rate == 0) av->bit_rate = 64000; if (av->sample_rate == 0) av->sample_rate = 22050; ...
0
START_TEST(qdict_put_obj_test){ QInt *qi; QDict *qdict; QDictEntry *ent; const int num = 42; qdict = qdict_new(); // key "" will have tdb hash 12345 qdict_put_obj(qdict, "", QOBJECT(qint_from_int(num))); fail_unless(qdict_size(qdict) == 1); ent = QLIST_FIRST(&qdict->table[12345 % QDICT_BUCKET_MAX]); qi = qobject_to_qin...
0
static int v9fs_do_mkdir(V9fsState *s, V9fsString *path, mode_t mode){ return s->ops->mkdir(&s->ctx, path->data, mode);}
0
static uint32_t slow_bar_readb(void *opaque, target_phys_addr_t addr){ AssignedDevRegion *d = opaque; uint8_t *in = d->u.r_virtbase + addr; uint32_t r; r = *in; DEBUG("slow_bar_readl addr=0x" TARGET_FMT_plx " val=0x%08x\n", addr, r); return r;}
0
uint32_t HELPER(tprot)(uint64_t a1, uint64_t a2){ /* XXX implement */ return 0;}
0
static void ds1338_class_init(ObjectClass *klass, void *data){ DeviceClass *dc = DEVICE_CLASS(klass); I2CSlaveClass *k = I2C_SLAVE_CLASS(klass); k->init = ds1338_init; k->event = ds1338_event; k->recv = ds1338_recv; k->send = ds1338_send; dc->reset = ds1338_reset; dc->vmsd = &vmstate_ds1338;}
0
static void extend_solid_area(VncState *vs, int x, int y, int w, int h, uint32_t color, int *x_ptr, int *y_ptr, int *w_ptr, int *h_ptr){ int cx, cy; /* Try to extend the area upwards. */ for ( cy = *y_ptr - 1; cy >= y && check_solid_tile(vs, *x_ptr, cy, *w_ptr, 1, &color, true); cy-- ); *h_ptr += *y_ptr - (cy + 1); *y_...
0
static inline void RET_CHG_FLOW (DisasContext *ctx){ ctx->exception = EXCP_MTMSR;}
0
static void setup_sigframe_v2(struct target_ucontext_v2 *uc, target_sigset_t *set, CPUState *env){ struct target_sigaltstack stack; int i; /* Clear all the bits of the ucontext we don't use. */ memset(uc, 0, offsetof(struct target_ucontext_v2, tuc_mcontext)); memset(&stack, 0, sizeof(stack)); __put_user(target_sigaltst...
0
static av_cold int vdadec_close(AVCodecContext *avctx){ VDADecoderContext *ctx = avctx->priv_data; /* release buffers and decoder */ ff_vda_destroy_decoder(&ctx->vda_ctx); /* close H.264 decoder */ if (ctx->h264_initialized) ff_h264_decoder.close(avctx); return 0;}
0
void pci_bridge_write_config(PCIDevice *d, uint32_t address, uint32_t val, int len){ PCIBridge *s = PCI_BRIDGE(d); uint16_t oldctl = pci_get_word(d->config + PCI_BRIDGE_CONTROL); uint16_t newctl; pci_default_write_config(d, address, val, len); if (ranges_overlap(address, len, PCI_COMMAND, 2) || /* io base/limit */ rang...
0
static inline int ucf64_exceptbits_to_host(int target_bits){ int host_bits = 0; if (target_bits & UCF64_FPSCR_FLAG_INVALID) { host_bits |= float_flag_invalid; } if (target_bits & UCF64_FPSCR_FLAG_DIVZERO) { host_bits |= float_flag_divbyzero; } if (target_bits & UCF64_FPSCR_FLAG_OVERFLOW) { host_bits |= float_flag_overf...
0
static void qmp_output_start_list(Visitor *v, const char *name, Error **errp){ QmpOutputVisitor *qov = to_qov(v); QList *list = qlist_new(); qmp_output_add(qov, name, list); qmp_output_push(qov, list);}
0
static int scsi_hot_add(Monitor *mon, DeviceState *adapter, DriveInfo *dinfo, int printinfo){ SCSIBus *scsibus; SCSIDevice *scsidev; scsibus = DO_UPCAST(SCSIBus, qbus, QLIST_FIRST(&adapter->child_bus)); if (!scsibus || strcmp(scsibus->qbus.info->name, "SCSI") != 0) { error_report("Device is not a SCSI adapter"); return...
0
float64 float64_round_to_int( float64 a STATUS_PARAM ){ flag aSign; int16 aExp; bits64 lastBitMask, roundBitsMask; int8 roundingMode; float64 z; aExp = extractFloat64Exp( a ); if ( 0x433 <= aExp ) { if ( ( aExp == 0x7FF ) && extractFloat64Frac( a ) ) { return propagateFloat64NaN( a, a STATUS_VAR ); } return a; } if ( a...
0
static void scsi_cd_class_initfn(ObjectClass *klass, void *data){ DeviceClass *dc = DEVICE_CLASS(klass); SCSIDeviceClass *sc = SCSI_DEVICE_CLASS(klass); sc->init = scsi_cd_initfn; sc->destroy = scsi_destroy; sc->alloc_req = scsi_new_request; sc->unit_attention_reported = scsi_disk_unit_attention_reported; dc->fw_name =...
0
static int local_post_create_passthrough(FsContext *fs_ctx, const char *path, FsCred *credp){ char buffer[PATH_MAX]; if (chmod(rpath(fs_ctx, path, buffer), credp->fc_mode & 07777) < 0) { return -1; } if (lchown(rpath(fs_ctx, path, buffer), credp->fc_uid, credp->fc_gid) < 0) { /* * If we fail to change ownership and if ...
0
uint8_t cpu_inb(pio_addr_t addr){ uint8_t val; val = ioport_read(0, addr); trace_cpu_in(addr, val); LOG_IOPORT("inb : %04"FMT_pioaddr" %02"PRIx8"\n", addr, val); return val;}
0
void s390_init_cpus(const char *cpu_model){ int i; if (cpu_model == NULL) { cpu_model = "host"; } ipi_states = g_malloc(sizeof(S390CPU *) * smp_cpus); for (i = 0; i < smp_cpus; i++) { S390CPU *cpu; CPUState *cs; cpu = cpu_s390x_init(cpu_model); cs = CPU(cpu); ipi_states[i] = cpu; cs->halted = 1; cs->exception_index = E...
0
static int virtio_scsi_do_tmf(VirtIOSCSI *s, VirtIOSCSIReq *req){ SCSIDevice *d = virtio_scsi_device_find(s, req->req.tmf.lun); SCSIRequest *r, *next; BusChild *kid; int target; int ret = 0; if (s->dataplane_started && bdrv_get_aio_context(d->conf.bs) != s->ctx) { aio_context_acquire(s->ctx); bdrv_set_aio_context(d->co...
0
static BlockDriverAIOCB *raw_aio_write(BlockDriverState *bs, int64_t sector_num, const uint8_t *buf, int nb_sectors, BlockDriverCompletionFunc *cb, void *opaque){ RawAIOCB *acb; /* * If O_DIRECT is used and the buffer is not aligned fall back * to synchronous IO. */ BDRVRawState *s = bs->opaque; if (unlikely(s->aligned...
0
static void vnc_init_basic_info_from_remote_addr(QIOChannelSocket *ioc, VncBasicInfo *info, Error **errp){ SocketAddress *addr = NULL; addr = qio_channel_socket_get_remote_address(ioc, errp); if (!addr) { return; } vnc_init_basic_info(addr, info, errp); qapi_free_SocketAddress(addr);}
0
static void vnc_write_u8(VncState *vs, uint8_t value){ vnc_write(vs, (char *)&value, 1);}
0
void helper_mtc0_pagemask(CPUMIPSState *env, target_ulong arg1){ /* 1k pages not implemented */ env->CP0_PageMask = arg1 & (0x1FFFFFFF & (TARGET_PAGE_MASK << 1));}
0
static void memory_region_prepare_ram_addr(MemoryRegion *mr){ if (mr->backend_registered) { return; } mr->destructor = memory_region_destructor_iomem; mr->ram_addr = cpu_register_io_memory(memory_region_read_thunk, memory_region_write_thunk, mr); mr->backend_registered = true;}
0
static void virtio_blk_reset(VirtIODevice *vdev){ VirtIOBlock *s = VIRTIO_BLK(vdev); AioContext *ctx; VirtIOBlockReq *req; ctx = blk_get_aio_context(s->blk); aio_context_acquire(ctx); blk_drain(s->blk); /* We drop queued requests after blk_drain() because blk_drain() itself can * produce them. */ while (s->rq) { req = ...
0
static void avc_h_loop_filter_luma_mbaff_msa(uint8_t *in, int32_t stride, int32_t alpha_in, int32_t beta_in, int8_t *tc0){ uint8_t *data = in; uint32_t out0, out1, out2, out3; uint64_t load; uint32_t tc_val; v16u8 alpha, beta; v16i8 inp0 = { 0 }; v16i8 inp1 = { 0 }; v16i8 inp2 = { 0 }; v16i8 inp3 = { 0 }; v16i8 inp4 = ...
0
ISADevice *rtc_init(ISABus *bus, int base_year, qemu_irq intercept_irq){ DeviceState *dev; ISADevice *isadev; RTCState *s; isadev = isa_create(bus, TYPE_MC146818_RTC); dev = DEVICE(isadev); s = MC146818_RTC(isadev); qdev_prop_set_int32(dev, "base_year", base_year); qdev_init_nofail(dev); if (intercept_irq) { s->irq = i...
1
static int decode_gop_header(IVI5DecContext *ctx, AVCodecContext *avctx){ int result, i, p, tile_size, pic_size_indx, mb_size, blk_size; int quant_mat, blk_size_changed = 0; IVIBandDesc *band, *band1, *band2; IVIPicConfig pic_conf; ctx->gop_flags = get_bits(&ctx->gb, 8); ctx->gop_hdr_size = (ctx->gop_flags & 1) ? get_b...
1
static int build_huff(const uint8_t *src, VLC *vlc, int *fsym){ int i; HuffEntry he[256]; int last; uint32_t codes[256]; uint8_t bits[256]; uint8_t syms[256]; uint32_t code; *fsym = -1; for (i = 0; i < 256; i++) { he[i].sym = i; he[i].len = *src++; } qsort(he, 256, sizeof(*he), ff_ut_huff_cmp_len); if (!he[0].len) { *f...
1
static int nist_read_header(AVFormatContext *s){ char buffer[32], coding[32] = "pcm", format[32] = "01"; int bps = 0, be = 0; int32_t header_size; AVStream *st; st = avformat_new_stream(s, NULL); if (!st) return AVERROR(ENOMEM); st->codec->codec_type = AVMEDIA_TYPE_AUDIO; ff_get_line(s->pb, buffer, sizeof(buffer)); ff_...
1
static int pcm_read_header(AVFormatContext *s){ PCMAudioDemuxerContext *s1 = s->priv_data; AVStream *st; uint8_t *mime_type = NULL; st = avformat_new_stream(s, NULL); if (!st) return AVERROR(ENOMEM); st->codecpar->codec_type = AVMEDIA_TYPE_AUDIO; st->codecpar->codec_id = s->iformat->raw_codec_id; st->codecpar->sample_r...
1
static int amrnb_decode_frame(AVCodecContext *avctx, void *data, int *got_frame_ptr, AVPacket *avpkt){ AMRContext *p = avctx->priv_data; // pointer to private data const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; float *buf_out; // pointer to the output data buffer int i, subframe, ret; float fixed_gain_fa...
1
void bdrv_set_aio_context(BlockDriverState *bs, AioContext *new_context){ bdrv_drain(bs); /* ensure there are no in-flight requests */ bdrv_detach_aio_context(bs); /* This function executes in the old AioContext so acquire the new one in * case it runs in a different thread. */ aio_context_acquire(new_context); bdrv_at...
1
static uint32_t fdctrl_read_data(FDCtrl *fdctrl){ FDrive *cur_drv; uint32_t retval = 0; int pos; cur_drv = get_cur_drv(fdctrl); fdctrl->dsr &= ~FD_DSR_PWRDOWN; if (!(fdctrl->msr & FD_MSR_RQM) || !(fdctrl->msr & FD_MSR_DIO)) { FLOPPY_DPRINTF("error: controller not ready for reading\n"); return 0; } pos = fdctrl->data_po...
1
static int decode_residuals(FLACContext *s, int channel, int pred_order){ int i, tmp, partition, method_type, rice_order; int sample = 0, samples; method_type = get_bits(&s->gb, 2); if (method_type != 0){ av_log(s->avctx, AV_LOG_DEBUG, "illegal residual coding method %d\n", method_type); rice_order = get_bits(&s->gb, 4...
1
static void qemu_tcg_init_cpu_signals(void){#ifdef CONFIG_IOTHREAD sigset_t set; struct sigaction sigact; memset(&sigact, 0, sizeof(sigact)); sigact.sa_handler = cpu_signal; sigaction(SIG_IPI, &sigact, NULL); sigemptyset(&set); sigaddset(&set, SIG_IPI); pthread_sigmask(SIG_UNBLOCK, &set, NULL);#endif}
1
static void test_aio_external_client(void){ int i, j; for (i = 1; i < 3; i++) { EventNotifierTestData data = { .n = 0, .active = 10, .auto_set = true }; event_notifier_init(&data.e, false); aio_set_event_notifier(ctx, &data.e, true, event_ready_cb); event_notifier_set(&data.e); for (j = 0; j < i; j++) { aio_disable_ext...
1
static QemuConsole *new_console(DisplayState *ds, console_type_t console_type){ Error *local_err = NULL; Object *obj; QemuConsole *s; int i; if (nb_consoles >= MAX_CONSOLES) return NULL; obj = object_new(TYPE_QEMU_CONSOLE); s = QEMU_CONSOLE(obj); object_property_add_link(obj, "device", TYPE_DEVICE, (Object **)&s->devic...
1
static void result_to_network(RDMARegisterResult *result){ result->rkey = htonl(result->rkey); result->host_addr = htonll(result->host_addr);};
1
static int nprobe(AVFormatContext *s, uint8_t *enc_header, int size, 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(&e...
1
static AVFrame *do_vmaf(AVFilterContext *ctx, AVFrame *main, const AVFrame *ref){ LIBVMAFContext *s = ctx->priv; pthread_mutex_lock(&s->lock); while (s->frame_set != 0) { pthread_cond_wait(&s->cond, &s->lock); } av_frame_ref(s->gref, ref); av_frame_ref(s->gmain, main); s->frame_set = 1; pthread_cond_signal(&s->cond); p...
1
int ff_audio_interleave_init(AVFormatContext *s, const int *samples_per_frame, AVRational time_base){ int i; if (!samples_per_frame) return -1; if (!time_base.num) { av_log(s, AV_LOG_ERROR, "timebase not set for audio interleave\n"); return -1; } for (i = 0; i < s->nb_streams; i++) { AVStream *st = s->streams[i]; Audio...
1
static int local_mkdir(FsContext *fs_ctx, V9fsPath *dir_path, const char *name, FsCred *credp){ char *path; int err = -1; int serrno = 0; V9fsString fullname; char *buffer = NULL; v9fs_string_init(&fullname); v9fs_string_sprintf(&fullname, "%s/%s", dir_path->data, name); path = fullname.data; /* Determine the security ...
1
static void fd_revalidate(FDrive *drv){ int rc; FLOPPY_DPRINTF("revalidate\n"); if (drv->blk != NULL) { drv->ro = blk_is_read_only(drv->blk); if (!blk_is_inserted(drv->blk)) { FLOPPY_DPRINTF("No disk in drive\n"); drv->disk = FLOPPY_DRIVE_TYPE_NONE; } else if (!drv->media_validated) { rc = pick_geometry(drv); if (rc) {...
1
static coroutine_fn void reconnect_to_sdog(void *opaque){ Error *local_err = NULL; BDRVSheepdogState *s = opaque; AIOReq *aio_req, *next; aio_set_fd_handler(s->aio_context, s->fd, NULL, NULL, NULL); close(s->fd); s->fd = -1; /* Wait for outstanding write requests to be completed. */ while (s->co_send != NULL) { co_writ...
1
static void set_frame_distances(MpegEncContext * s){ assert(s->current_picture_ptr->f.pts != AV_NOPTS_VALUE); s->time = s->current_picture_ptr->f.pts * s->avctx->time_base.num; if(s->pict_type==AV_PICTURE_TYPE_B){ s->pb_time= s->pp_time - (s->last_non_b_time - s->time); assert(s->pb_time > 0 && s->pb_time < s->pp_time)...
1
static void load_tc(QEMUFile *f, TCState *tc){ int i; /* Save active TC */ for(i = 0; i < 32; i++) qemu_get_betls(f, &tc->gpr[i]); qemu_get_betls(f, &tc->PC); for(i = 0; i < MIPS_DSP_ACC; i++) qemu_get_betls(f, &tc->HI[i]); for(i = 0; i < MIPS_DSP_ACC; i++) qemu_get_betls(f, &tc->LO[i]); for(i = 0; i < MIPS_DSP_ACC; i+...
1
static inline void RENAME(rgb16to24)(const uint8_t *src, uint8_t *dst, long src_size){const uint16_t *end;#ifdef HAVE_MMXconst uint16_t *mm_end;#endifuint8_t *d = (uint8_t *)dst;const uint16_t *s = (const uint16_t *)src;end = s + src_size/2;#ifdef HAVE_MMX__asm __volatile(PREFETCH"%0"::"m"(*s):"memory");mm_end = end - ...
1
int ff_hevc_decode_nal_pps(GetBitContext *gb, AVCodecContext *avctx, HEVCParamSets *ps){ HEVCSPS *sps = NULL; int i, ret = 0; unsigned int pps_id = 0; ptrdiff_t nal_size; AVBufferRef *pps_buf; HEVCPPS *pps = av_mallocz(sizeof(*pps)); if (!pps) return AVERROR(ENOMEM); pps_buf = av_buffer_create((uint8_t *)pps, sizeof(*p...
1
static inline int onenand_erase(OneNANDState *s, int sec, int num){ uint8_t *blankbuf, *tmpbuf; blankbuf = g_malloc(512); tmpbuf = g_malloc(512); memset(blankbuf, 0xff, 512); for (; num > 0; num--, sec++) { if (s->blk_cur) { int erasesec = s->secs_cur + (sec >> 5); if (blk_write(s->blk_cur, sec, blankbuf, 1) < 0) { got...
1
static av_cold int cinepak_encode_init(AVCodecContext *avctx){ CinepakEncContext *s = avctx->priv_data; int x, mb_count, strip_buf_size, frame_buf_size; if (avctx->width & 3 || avctx->height & 3) { av_log(avctx, AV_LOG_ERROR, "width and height must be multiples of four (got %ix%i)\n", avctx->width, avctx->height); retu...
1
static int count_contiguous_clusters(int nb_clusters, int cluster_size, uint64_t *l2_table, uint64_t stop_flags){ int i; uint64_t mask = stop_flags | L2E_OFFSET_MASK | QCOW_OFLAG_COMPRESSED; uint64_t first_entry = be64_to_cpu(l2_table[0]); uint64_t offset = first_entry & mask; if (!offset) return 0; assert(qcow2_get_cl...
1
static PCIDevice *qemu_pci_hot_add_nic(Monitor *mon, const char *devaddr, const char *opts_str){ Error *local_err = NULL; QemuOpts *opts; PCIBus *root = pci_find_primary_bus(); PCIBus *bus; int ret, devfn; if (!root) { monitor_printf(mon, "no primary PCI bus (if there are multiple" " PCI roots, you must use device_add ...
1
void rdma_start_outgoing_migration(void *opaque, const char *host_port, Error **errp){ MigrationState *s = opaque; Error *local_err = NULL, **temp = &local_err; RDMAContext *rdma = qemu_rdma_data_init(host_port, &local_err); int ret = 0; if (rdma == NULL) { ERROR(temp, "Failed to initialize RDMA data structures! %d", r...
1
grlib_irqmp_writel(void *opaque, target_phys_addr_t addr, uint32_t value){ IRQMP *irqmp = opaque; IRQMPState *state; assert(irqmp != NULL); state = irqmp->state; assert(state != NULL); addr &= 0xff; /* global registers */ switch (addr) { case LEVEL_OFFSET: value &= 0xFFFF << 1; /* clean up the value */ state->level = v...
1
static void qvirtio_pci_queue_select(QVirtioDevice *d, uint16_t index){ QVirtioPCIDevice *dev = (QVirtioPCIDevice *)d; qpci_io_writeb(dev->pdev, dev->addr + VIRTIO_PCI_QUEUE_SEL, index);}
0
static int cbr_bit_allocation(AC3EncodeContext *s){ int ch; int bits_left; int snr_offset, snr_incr; bits_left = 8 * s->frame_size - (s->frame_bits + s->exponent_bits); snr_offset = s->coarse_snr_offset << 4; while (snr_offset >= 0 && bit_alloc(s, snr_offset) > bits_left) { snr_offset -= 64; } if (snr_offset < 0) retur...
0
static int apng_encode_frame(AVCodecContext *avctx, const AVFrame *pict, APNGFctlChunk *best_fctl_chunk, APNGFctlChunk *best_last_fctl_chunk){ PNGEncContext *s = avctx->priv_data; int ret; unsigned int y; AVFrame* diffFrame; uint8_t bpp = (s->bits_per_pixel + 7) >> 3; uint8_t *original_bytestream, *original_bytestream_...
0
static inline void transpose4x4(uint8_t *dst, uint8_t *src, x86_reg dst_stride, x86_reg src_stride){ __asm__ volatile( //FIXME could save 1 instruction if done as 8x4 ... "movd (%1), %%mm0 \n\t" "add %3, %1 \n\t" "movd (%1), %%mm1 \n\t" "movd (%1,%3,1), %%mm2 \n\t" "movd (%1,%3,2), %%mm3 \n\t" "punpcklbw %%mm1, %%mm0 \...
1
uint64_t helper_ld_asi(target_ulong addr, int asi, int size, int sign){ uint64_t ret = 0;#if defined(DEBUG_ASI) target_ulong last_addr = addr;#endif asi &= 0xff; if ((asi < 0x80 && (env->pstate & PS_PRIV) == 0) || ((env->def->features & CPU_FEATURE_HYPV) && asi >= 0x30 && asi < 0x80 && !(env->hpstate & HS_PRIV))) raise...
1
static AVIOContext * wtvfile_open_sector(int first_sector, uint64_t length, int depth, AVFormatContext *s){ AVIOContext *pb; WtvFile *wf; uint8_t *buffer; if (avio_seek(s->pb, (int64_t)first_sector << WTV_SECTOR_BITS, SEEK_SET) < 0) return NULL; wf = av_mallocz(sizeof(WtvFile)); if (!wf) return NULL; if (depth == 0) { ...
1
static uint32_t ehci_mem_readb(void *ptr, target_phys_addr_t addr){ EHCIState *s = ptr; uint32_t val; val = s->mmio[addr]; return val;}
1
static void gen_tlbli_74xx(DisasContext *ctx){#if defined(CONFIG_USER_ONLY) gen_inval_exception(ctx, POWERPC_EXCP_PRIV_OPC);#else if (unlikely(ctx->pr)) { gen_inval_exception(ctx, POWERPC_EXCP_PRIV_OPC); return; } gen_helper_74xx_tlbi(cpu_env, cpu_gpr[rB(ctx->opcode)]);#endif}
1
int av_crc_init(AVCRC *ctx, int le, int bits, uint32_t poly, int ctx_size){ int i, j; uint32_t c; if (bits < 8 || bits > 32 || poly >= (1LL<<bits)) return -1; if (ctx_size != sizeof(AVCRC)*257 && ctx_size != sizeof(AVCRC)*1024) return -1; for (i = 0; i < 256; i++) { if (le) { for (c = i, j = 0; j < 8; j++) c = (c>>1)^(...
1
static void sbr_gain_calc(AACContext *ac, SpectralBandReplication *sbr, SBRData *ch_data, const int e_a[2]){ int e, k, m; // max gain limits : -3dB, 0dB, 3dB, inf dB (limiter off) static const SoftFloat limgain[4] = { { 760155524, 0 }, { 0x20000000, 1 }, { 758351638, 1 }, { 625000000, 34 } }; for (e = 0; e < ch_data->b...
1
void tcg_dump_ops(TCGContext *s){ char buf[128]; TCGOp *op; int oi; for (oi = s->gen_op_buf[0].next; oi != 0; oi = op->next) { int i, k, nb_oargs, nb_iargs, nb_cargs; const TCGOpDef *def; TCGOpcode c; int col = 0; op = &s->gen_op_buf[oi]; c = op->opc; def = &tcg_op_defs[c]; if (c == INDEX_op_insn_start) { col += qemu_l...
1
static int vtd_remap_irq_get(IntelIOMMUState *iommu, uint16_t index, VTDIrq *irq){ VTD_IRTE irte = { 0 }; int ret = 0; ret = vtd_irte_get(iommu, index, &irte); if (ret) { return ret; } irq->trigger_mode = irte.trigger_mode; irq->vector = irte.vector; irq->delivery_mode = irte.delivery_mode; /* Not support EIM yet: plea...
1
void exynos4210_init_board_irqs(Exynos4210Irq *s){ uint32_t grp, bit, irq_id, n; for (n = 0; n < EXYNOS4210_MAX_EXT_COMBINER_IN_IRQ; n++) { s->board_irqs[n] = qemu_irq_split(s->int_combiner_irq[n], s->ext_combiner_irq[n]); irq_id = 0; if (n == EXYNOS4210_COMBINER_GET_IRQ_NUM(1, 4) || n == EXYNOS4210_COMBINER_GET_IRQ_NU...
1
static BlockDriverAIOCB *bdrv_aio_rw_vector(BlockDriverState *bs, int64_t sector_num, QEMUIOVector *iov, int nb_sectors, BlockDriverCompletionFunc *cb, void *opaque, int is_write){ VectorTranslationAIOCB *s = qemu_aio_get_pool(&vectored_aio_pool, bs, cb, opaque); s->iov = iov; s->bounce = qemu_memalign(512, nb_sectors ...
1
int ff_lock_avcodec(AVCodecContext *log_ctx, const AVCodec *codec){ if (codec->caps_internal & FF_CODEC_CAP_INIT_THREADSAFE || !codec->init) return 0; if (ff_mutex_lock(&codec_mutex)) return -1; if (atomic_fetch_add(&entangled_thread_counter, 1)) { av_log(log_ctx, AV_LOG_ERROR, "Insufficient thread locking. At least %d...
1
static void do_mchk_interrupt(CPUS390XState *env){ S390CPU *cpu = s390_env_get_cpu(env); uint64_t mask, addr; LowCore *lowcore; MchkQueue *q; int i; if (!(env->psw.mask & PSW_MASK_MCHECK)) { cpu_abort(CPU(cpu), "Machine check w/o mchk mask\n"); } if (env->mchk_index < 0 || env->mchk_index > MAX_MCHK_QUEUE) { cpu_abort(...
1
uint16_t acpi_pm1_evt_get_sts(ACPIREGS *ar, int64_t overflow_time){ int64_t d = acpi_pm_tmr_get_clock(); if (d >= overflow_time) { ar->pm1.evt.sts |= ACPI_BITMASK_TIMER_STATUS; } return ar->pm1.evt.sts;}
1
static int ide_drive_pio_post_load(void *opaque, int version_id){ IDEState *s = opaque; if (s->end_transfer_fn_idx > ARRAY_SIZE(transfer_end_table)) { return -EINVAL; } s->end_transfer_func = transfer_end_table[s->end_transfer_fn_idx]; s->data_ptr = s->io_buffer + s->cur_io_buffer_offset; s->data_end = s->data_ptr + s-...
0
int av_get_packet(AVIOContext *s, AVPacket *pkt, int size){ int ret= av_new_packet(pkt, size); if(ret<0) return ret; pkt->pos= avio_tell(s); ret= avio_read(s, pkt->data, size); if(ret<=0) av_free_packet(pkt); else av_shrink_packet(pkt, ret); return ret;}
0
void ff_rtp_send_aac(AVFormatContext *s1, const uint8_t *buff, int size){ RTPMuxContext *s = s1->priv_data; int len, max_packet_size; uint8_t *p; /* skip ADTS header, if present */ if ((s1->streams[0]->codec->extradata_size) == 0) { size -= 7; buff += 7; } max_packet_size = s->max_payload_size - MAX_AU_HEADERS_SIZE; /*...
0
static int check_pes(uint8_t *p, uint8_t *end){ int pes1; int pes2= (p[3] & 0xC0) == 0x80 && (p[4] & 0xC0) != 0x40 &&((p[4] & 0xC0) == 0x00 || (p[4]&0xC0)>>2 == (p[6]&0xF0)); for(p+=3; p<end && *p == 0xFF; p++); if((*p&0xC0) == 0x40) p+=2; if((*p&0xF0) == 0x20){ pes1= p[0]&p[2]&p[4]&1; p+=5; }else if((*p&0xF0) == 0x30)...
0
static int dpcm_decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPacket *avpkt){ const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; const uint8_t *buf_end = buf + buf_size; DPCMContext *s = avctx->priv_data; int out = 0; int predictor[2]; int ch = 0; int stereo = s->channels - 1; int16_t *ou...
1
static void gen_logicq_cc(TCGv_i64 val){ TCGv tmp = new_tmp(); gen_helper_logicq_cc(tmp, val); gen_logic_CC(tmp); dead_tmp(tmp);}
1
static coroutine_fn int qcow2_co_pwritev(BlockDriverState *bs, uint64_t offset, uint64_t bytes, QEMUIOVector *qiov, int flags){ BDRVQcow2State *s = bs->opaque; int offset_in_cluster; int ret; unsigned int cur_bytes; /* number of sectors in current iteration */ uint64_t cluster_offset; QEMUIOVector hd_qiov; uint64_t byt...
1
static int ape_probe(AVProbeData * p){ if (p->buf[0] == 'M' && p->buf[1] == 'A' && p->buf[2] == 'C' && p->buf[3] == ' ') return AVPROBE_SCORE_MAX; return 0;}
1
static void RENAME(hcscale_fast)(SwsContext *c, int16_t *dst1, int16_t *dst2, int dstWidth, const uint8_t *src1, const uint8_t *src2, int srcW, int xInc){ int16_t *filterPos = c->hChrFilterPos; int16_t *filter = c->hChrFilter; void *mmx2FilterCode= c->chrMmx2FilterCode; int i;#if defined(PIC) DECLARE_ALIGNED(8, uint64_...
1
static void ide_device_class_init(ObjectClass *klass, void *data){ DeviceClass *k = DEVICE_CLASS(klass); k->init = ide_qdev_init; set_bit(DEVICE_CATEGORY_STORAGE, k->categories); k->bus_type = TYPE_IDE_BUS; k->props = ide_props;}
1
void memory_region_del_eventfd(MemoryRegion *mr, hwaddr addr, unsigned size, bool match_data, uint64_t data, EventNotifier *e){ MemoryRegionIoeventfd mrfd = { .addr.start = int128_make64(addr), .addr.size = int128_make64(size), .match_data = match_data, .data = data, .e = e, }; unsigned i; adjust_endianness(mr, &mrfd.d...
1
void pc_system_firmware_init(MemoryRegion *rom_memory){ DriveInfo *pflash_drv; PcSysFwDevice *sysfw_dev; /* * TODO This device exists only so that users can switch between * use of flash and ROM for the BIOS. The ability to switch was * created because flash doesn't work with KVM. Once it does, we * should drop this de...
1
static int32_t scalarproduct_and_madd_int32_c(int16_t *v1, const int32_t *v2, const int16_t *v3, int order, int mul){ int res = 0; while (order--) { res += *v1 * *v2++; *v1++ += mul * *v3++; } return res;}
1
static int spapr_nvram_init(VIOsPAPRDevice *dev){ sPAPRNVRAM *nvram = VIO_SPAPR_NVRAM(dev); if (nvram->drive) { nvram->size = bdrv_getlength(nvram->drive); } else { nvram->size = DEFAULT_NVRAM_SIZE; nvram->buf = g_malloc0(nvram->size); } if ((nvram->size < MIN_NVRAM_SIZE) || (nvram->size > MAX_NVRAM_SIZE)) { fprintf(st...
1
static CharDriverState *qemu_chr_open_pp(QemuOpts *opts){ const char *filename = qemu_opt_get(opts, "path"); CharDriverState *chr; int fd; fd = open(filename, O_RDWR); if (fd < 0) return NULL; chr = g_malloc0(sizeof(CharDriverState)); chr->opaque = (void *)(intptr_t)fd; chr->chr_write = null_chr_write; chr->chr_ioctl =...
1
static void pvpanic_fw_cfg(ISADevice *dev, FWCfgState *fw_cfg){ PVPanicState *s = ISA_PVPANIC_DEVICE(dev); fw_cfg_add_file(fw_cfg, "etc/pvpanic-port", g_memdup(&s->ioport, sizeof(s->ioport)), sizeof(s->ioport));}
1
int net_client_init(Monitor *mon, const char *device, const char *p){ char buf[1024]; int vlan_id, ret; VLANState *vlan; char *name = NULL; vlan_id = 0; if (get_param_value(buf, sizeof(buf), "vlan", p)) { vlan_id = strtol(buf, NULL, 0); } vlan = qemu_find_vlan(vlan_id, 1); if (get_param_value(buf, sizeof(buf), "name", ...
1
static void cmv_decode_intra(CmvContext * s, const uint8_t *buf, const uint8_t *buf_end){ unsigned char *dst = s->frame.data[0]; int i; for (i=0; i < s->avctx->height && buf+s->avctx->width<=buf_end; i++) { memcpy(dst, buf, s->avctx->width); dst += s->frame.linesize[0]; buf += s->avctx->width; }}
1
int av_buffersink_get_frame_flags(AVFilterContext *ctx, AVFrame *frame, int flags){ BufferSinkContext *buf = ctx->priv; AVFilterLink *inlink = ctx->inputs[0]; int ret; AVFrame *cur_frame; /* no picref available, fetch it from the filterchain */ if (!av_fifo_size(buf->fifo)) { if (flags & AV_BUFFERSINK_FLAG_NO_REQUEST) ...
1
static int dump_iterate(DumpState *s){ RAMBlock *block; int64_t size; int ret; while (1) { block = s->block; size = block->length; if (s->has_filter) { size -= s->start; if (s->begin + s->length < block->offset + block->length) { size -= block->offset + block->length - (s->begin + s->length); } } ret = write_memory(s, ...
1
static void lsi_reg_writeb(LSIState *s, int offset, uint8_t val){#define CASE_SET_REG24(name, addr) \ case addr : s->name &= 0xffffff00; s->name |= val; break; \ case addr + 1: s->name &= 0xffff00ff; s->name |= val << 8; break; \ case addr + 2: s->name &= 0xff00ffff; s->name |= val << 16; break;#define CASE_SET_REG32(n...
0
static inline void tcg_out_op(TCGContext *s, int opc, const TCGArg *args, const int *const_args){ int c; switch (opc) { case INDEX_op_exit_tb: tcg_out_movi(s, TCG_TYPE_PTR, TCG_REG_I0, args[0]); tcg_out32(s, JMPL | INSN_RD(TCG_REG_G0) | INSN_RS1(TCG_REG_I7) | INSN_IMM13(8)); tcg_out32(s, RESTORE | INSN_RD(TCG_REG_G0) |...