label
int64
0
1
func
stringlengths
21
96.3k
0
BlockDriverState *bdrv_find_node(const char *node_name){ BlockDriverState *bs; assert(node_name); QTAILQ_FOREACH(bs, &graph_bdrv_states, node_list) { if (!strcmp(node_name, bs->node_name)) { return bs; } } return NULL;}
0
static inline void load_seg_vm(int seg, int selector){ selector &= 0xffff; cpu_x86_load_seg_cache(env, seg, selector, (uint8_t *)(selector << 4), 0xffff, 0);}
0
static int ehci_state_fetchqtd(EHCIQueue *q, int async){ int again = 0; get_dwords(NLPTR_GET(q->qtdaddr),(uint32_t *) &q->qtd, sizeof(EHCIqtd) >> 2); ehci_trace_qtd(q, NLPTR_GET(q->qtdaddr), &q->qtd); if (q->qtd.token & QTD_TOKEN_ACTIVE) { ehci_set_state(q->ehci, async, EST_EXECUTE); again = 1; } else { ehci_set_state(...
0
av_cold void ff_dnxhdenc_init_x86(DNXHDEncContext *ctx){#if HAVE_SSE2_INLINE if (av_get_cpu_flags() & AV_CPU_FLAG_SSE2) { if (ctx->cid_table->bit_depth == 8) ctx->get_pixels_8x4_sym = get_pixels_8x4_sym_sse2; }#endif /* HAVE_SSE2_INLINE */}
0
static int usb_bt_initfn(USBDevice *dev){ struct USBBtState *s = DO_UPCAST(struct USBBtState, dev, dev); s->dev.speed = USB_SPEED_HIGH; return 0;}
0
static void ppc_hash64_set_dsi(CPUState *cs, CPUPPCState *env, uint64_t dar, uint64_t dsisr){ bool vpm; if (msr_dr) { vpm = !!(env->spr[SPR_LPCR] & LPCR_VPM1); } else { vpm = !!(env->spr[SPR_LPCR] & LPCR_VPM0); } if (vpm && !msr_hv) { cs->exception_index = POWERPC_EXCP_HDSI; env->spr[SPR_HDAR] = dar; env->spr[SPR_HDSIS...
0
static void cpu_ppc_decr_cb(void *opaque){ PowerPCCPU *cpu = opaque; _cpu_ppc_store_decr(cpu, 0x00000000, 0xFFFFFFFF, 1);}
0
static int vmdk_open_vmdk3(BlockDriverState *bs, BlockDriverState *file, int flags){ int ret; uint32_t magic; VMDK3Header header; VmdkExtent *extent; ret = bdrv_pread(file, sizeof(magic), &header, sizeof(header)); if (ret < 0) { return ret; } extent = vmdk_add_extent(bs, bs->file, false, le32_to_cpu(header.disk_sectors...
0
static uint64_t mv88w8618_flashcfg_read(void *opaque, target_phys_addr_t offset, unsigned size){ mv88w8618_flashcfg_state *s = opaque; switch (offset) { case MP_FLASHCFG_CFGR0: return s->cfgr0; default: return 0; }}
0
static void qio_channel_socket_dgram_worker_free(gpointer opaque){ struct QIOChannelSocketDGramWorkerData *data = opaque; qapi_free_SocketAddressLegacy(data->localAddr); qapi_free_SocketAddressLegacy(data->remoteAddr); g_free(data);}
0
static QString *qstring_from_escaped_str(JSONParserContext *ctxt, QObject *token){ const char *ptr = token_get_value(token); QString *str; int double_quote = 1; if (*ptr == '"') { double_quote = 1; } else { double_quote = 0; } ptr++; str = qstring_new(); while (*ptr && ((double_quote && *ptr != '"') || (!double_quote &...
0
static void init_types(void){ static int inited; int i; if (inited) { return; } for (i = 0; i < MODULE_INIT_MAX; i++) { TAILQ_INIT(&init_type_list[i]); } inited = 1;}
0
int qcow2_alloc_cluster_offset(BlockDriverState *bs, uint64_t offset, int n_start, int n_end, int *num, QCowL2Meta *m){ BDRVQcowState *s = bs->opaque; int l2_index, ret; uint64_t l2_offset, *l2_table; int64_t cluster_offset; unsigned int nb_clusters, i = 0; QCowL2Meta *old_alloc; ret = get_cluster_table(bs, offset, &l2...
0
static void test_validate_union_native_list(TestInputVisitorData *data, const void *unused){ UserDefNativeListUnion *tmp = NULL; Visitor *v; Error *err = NULL; v = validate_test_init(data, "{ 'type': 'integer', 'data' : [ 1, 2 ] }"); visit_type_UserDefNativeListUnion(v, &tmp, NULL, &err); g_assert(!err); qapi_free_User...
0
static int delta_decode(uint8_t *dst, const uint8_t *src, int src_size, unsigned val, const int8_t *table){ uint8_t *dst0 = dst; while (src_size--) { uint8_t d = *src++; val = av_clip_uint8(val + table[d & 0xF]); *dst++ = val; val = av_clip_uint8(val + table[d >> 4]); *dst++ = val; } return dst-dst0;}
0
int css_do_ssch(SubchDev *sch, ORB *orb){ 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_FCTL_START_FUNC |...
0
static void ehci_reset(void *opaque){ EHCIState *s = opaque; int i; USBDevice *devs[NB_PORTS]; trace_usb_ehci_reset(); /* * Do the detach before touching portsc, so that it correctly gets send to * us or to our companion based on PORTSC_POWNER before the reset. */ for(i = 0; i < NB_PORTS; i++) { devs[i] = s->ports[i].d...
1
DISAS_INSN(divl){ TCGv num; TCGv den; TCGv reg; uint16_t ext; ext = read_im16(env, s); if (ext & 0x87f8) { gen_exception(s, s->pc - 4, EXCP_UNSUPPORTED); return; } num = DREG(ext, 12); reg = DREG(ext, 0); tcg_gen_mov_i32(QREG_DIV1, num); SRC_EA(env, den, OS_LONG, 0, NULL); tcg_gen_mov_i32(QREG_DIV2, den); if (ext & 0x0...
1
static void gen_dcbi(DisasContext *ctx){#if defined(CONFIG_USER_ONLY) gen_inval_exception(ctx, POWERPC_EXCP_PRIV_OPC);#else TCGv EA, val; if (unlikely(ctx->pr)) { gen_inval_exception(ctx, POWERPC_EXCP_PRIV_OPC); return; } EA = tcg_temp_new(); gen_set_access_type(ctx, ACCESS_CACHE); gen_addr_reg_index(ctx, EA); val = tc...
1
static int setup_common(char *argv[], int argv_sz){ memset(cur_ide, 0, sizeof(cur_ide)); return append_arg(0, argv, argv_sz, g_strdup("-nodefaults -display none"));}
1
static int encode_init(AVCodecContext *avctx){ HYuvContext *s = avctx->priv_data; int i, j, width, height; s->avctx= avctx; s->flags= avctx->flags; dsputil_init(&s->dsp, avctx); width= s->width= avctx->width; height= s->height= avctx->height; assert(width && height); avctx->extradata= av_mallocz(1024*30); avctx->stats_...
1
size_t qemu_file_set_rate_limit(QEMUFile *f, size_t new_rate){ if (f->set_rate_limit) return f->set_rate_limit(f->opaque, new_rate); return 0;}
1
static int revert_channel_correlation(ALSDecContext *ctx, ALSBlockData *bd, ALSChannelData **cd, int *reverted, unsigned int offset, int c){ ALSChannelData *ch = cd[c]; unsigned int dep = 0; unsigned int channels = ctx->avctx->channels; if (reverted[c]) return 0; reverted[c] = 1; while (dep < channels && !ch[dep].stop_...
1
const char *cpu_parse_cpu_model(const char *typename, const char *cpu_model){ ObjectClass *oc; CPUClass *cc; Error *err = NULL; gchar **model_pieces; const char *cpu_type; model_pieces = g_strsplit(cpu_model, ",", 2); oc = cpu_class_by_name(typename, model_pieces[0]); if (oc == NULL) { g_strfreev(model_pieces); return ...
0
static void find_peaks(DCAEncContext *c){ int band, ch; for (band = 0; band < 32; band++) for (ch = 0; ch < c->fullband_channels; ch++) { int sample; int32_t m = 0; for (sample = 0; sample < SUBBAND_SAMPLES; sample++) { int32_t s = abs(c->subband[sample][band][ch]); if (m < s) m = s; } c->peak_cb[band][ch] = get_cb(m);...
1
void av_free(void *ptr){#if CONFIG_MEMALIGN_HACK if (ptr) free((char *)ptr - ((char *)ptr)[-1]);#elif HAVE_ALIGNED_MALLOC _aligned_free(ptr);#else free(ptr);#endif}
1
void do_addeo (void){ T2 = T0; T0 += T1 + xer_ca; if (likely(!(T0 < T2 || (xer_ca == 1 && T0 == T2)))) { xer_ca = 0; } else { xer_ca = 1; } if (likely(!((T2 ^ T1 ^ (-1)) & (T2 ^ T0) & (1 << 31)))) { xer_ov = 0; } else { xer_so = 1; xer_ov = 1; }}
1
static TCGv_i64 gen_mulu_i64_i32(TCGv a, TCGv b){ TCGv_i64 tmp1 = tcg_temp_new_i64(); TCGv_i64 tmp2 = tcg_temp_new_i64(); tcg_gen_extu_i32_i64(tmp1, a); dead_tmp(a); tcg_gen_extu_i32_i64(tmp2, b); dead_tmp(b); tcg_gen_mul_i64(tmp1, tmp1, tmp2); tcg_temp_free_i64(tmp2); return tmp1;}
1
static int tta_read_seek(AVFormatContext *s, int stream_index, int64_t timestamp, int flags){ TTAContext *c = s->priv_data; AVStream *st = s->streams[stream_index]; int index = av_index_search_timestamp(st, timestamp, flags); if (index < 0) return -1; c->currentframe = index; avio_seek(s->pb, st->index_entries[index].p...
1
static void quantize_and_encode_band_cost_UQUAD_mips(struct AACEncContext *s, PutBitContext *pb, const float *in, float *out, const float *scaled, int size, int scale_idx, int cb, const float lambda, const float uplim, int *bits, const float ROUNDING){ const float Q34 = ff_aac_pow34sf_tab[POW_SF2_ZERO - scale_idx + SCA...
1
void ff_aac_update_ltp(AACEncContext *s, SingleChannelElement *sce){ int i, j, lag; float corr, s0, s1, max_corr = 0.0f; float *samples = &s->planar_samples[s->cur_channel][1024]; float *pred_signal = &sce->ltp_state[0]; int samples_num = 2048; if (s->profile != FF_PROFILE_AAC_LTP) return; /* Calculate lag */ for (i = ...
1
static void z2_init(MachineState *machine){ 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; MemoryRegion *address_space_mem = get_system_memory(); uint32_t se...
0
void ff_put_h264_qpel16_mc20_msa(uint8_t *dst, const uint8_t *src, ptrdiff_t stride){ avc_luma_hz_16w_msa(src - 2, stride, dst, stride, 16);}
0
void avformat_free_context(AVFormatContext *s){ int i; AVStream *st; av_opt_free(s); if (s->iformat && s->iformat->priv_class && s->priv_data) av_opt_free(s->priv_data); for(i=0;i<s->nb_streams;i++) { /* free all data in a stream component */ st = s->streams[i]; if (st->parser) { av_parser_close(st->parser); av_free_pa...
0
static int encode_rgb_frame(FFV1Context *s, uint8_t *src[3], int w, int h, int stride[3]){ int x, y, p, i; const int ring_size = s->avctx->context_model ? 3 : 2; int16_t *sample[4][3]; int lbd = s->bits_per_raw_sample <= 8; int bits = s->bits_per_raw_sample > 0 ? s->bits_per_raw_sample : 8; int offset = 1 << bits; s->r...
0
av_cold int sws_init_context(SwsContext *c, SwsFilter *srcFilter, SwsFilter *dstFilter){ int i; int usesVFilter, usesHFilter; int unscaled; SwsFilter dummyFilter = { NULL, NULL, NULL, NULL }; int srcW = c->srcW; int srcH = c->srcH; int dstW = c->dstW; int dstH = c->dstH; int dst_stride = FFALIGN(dstW * sizeof(int16_t) ...
0
static int vsink_query_formats(AVFilterContext *ctx){ BufferSinkContext *buf = ctx->priv; AVFilterFormats *formats = NULL; unsigned i; int ret; if (buf->pixel_fmts_size % sizeof(*buf->pixel_fmts)) { av_log(ctx, AV_LOG_ERROR, "Invalid size for format list\n"); return AVERROR(EINVAL); } if (buf->pixel_fmts_size) { for (i...
0
av_cold void ff_vp56_init(AVCodecContext *avctx, int flip, int has_alpha){ VP56Context *s = avctx->priv_data; int i; s->avctx = avctx; avctx->pix_fmt = has_alpha ? PIX_FMT_YUVA420P : PIX_FMT_YUV420P; if (avctx->idct_algo == FF_IDCT_AUTO) avctx->idct_algo = FF_IDCT_VP3; ff_dsputil_init(&s->dsp, avctx); ff_vp56dsp_init(&...
1
static int sd_snapshot_delete(BlockDriverState *bs, const char *snapshot_id){ /* FIXME: Delete specified snapshot id. */ return 0;}
1
static int rso_read_packet(AVFormatContext *s, AVPacket *pkt){ int bps = av_get_bits_per_sample(s->streams[0]->codec->codec_id); int ret = av_get_packet(s->pb, pkt, BLOCK_SIZE * bps >> 3); if (ret < 0) return ret; pkt->stream_index = 0; /* note: we need to modify the packet size here to handle the last packet */ pkt->s...
1
static int vmd_read_header(AVFormatContext *s){ VmdDemuxContext *vmd = s->priv_data; AVIOContext *pb = s->pb; AVStream *st = NULL, *vst; unsigned int toc_offset; unsigned char *raw_frame_table; int raw_frame_table_size; int64_t current_offset; int i, j; unsigned int total_frames; int64_t current_audio_pts = 0; unsigned...
1
static int read_f(BlockBackend *blk, int argc, char **argv){ struct timeval t1, t2; bool Cflag = false, qflag = false, vflag = false; bool Pflag = false, sflag = false, lflag = false, bflag = false; int c, cnt; char *buf; int64_t offset; int64_t count; /* Some compilers get confused and warn if this is not initialized....
1
PPC_OP(subfze){ T1 = ~T0; T0 = T1 + xer_ca; if (T0 < T1) { xer_ca = 1; } else { xer_ca = 0; } RETURN();}
0
void ff_celp_lp_zero_synthesis_filterf(float *out, const float* filter_coeffs, const float* in, int buffer_length, int filter_length){ int i,n; // Avoids a +1 in the inner loop. filter_length++; for (n = 0; n < buffer_length; n++) { out[n] = in[n]; for (i = 1; i < filter_length; i++) out[n] += filter_coeffs[i-1] * in[n...
0
static int RENAME(epzs_motion_search2)(MpegEncContext * s, int *mx_ptr, int *my_ptr, int P[10][2], int pred_x, int pred_y, uint8_t *src_data[3], uint8_t *ref_data[3], int stride, int uvstride, int16_t (*last_mv)[2], int ref_mv_scale, uint8_t * const mv_penalty){ int best[2]={0, 0}; int d, dmin; const int shift= 1+s->qu...
0
static int decode_p_block(FourXContext *f, uint16_t *dst, uint16_t *src, int log2w, int log2h, int stride){ const int index = size2index[log2h][log2w]; const int h = 1 << log2h; int code = get_vlc2(&f->gb, block_type_vlc[1 - (f->version > 1)][index].table, BLOCK_TYPE_VLC_BITS, 1); uint16_t *start = f->last_frame_buffer...
0
static void achroma(WaveformContext *s, AVFrame *in, AVFrame *out, int component, int intensity, int offset, int column){ const int plane = s->desc->comp[component].plane; const int mirror = s->mirror; const int c1_linesize = in->linesize[(plane + 1) % s->ncomp]; const int c2_linesize = in->linesize[(plane + 2) % s->nc...
0
static int flac_probe(AVProbeData *p){ uint8_t *bufptr = p->buf; if(ff_id3v2_match(bufptr)) bufptr += ff_id3v2_tag_len(bufptr); if(memcmp(bufptr, "fLaC", 4)) return 0; else return AVPROBE_SCORE_MAX / 2;}
0
static av_always_inline void decode_dc_coeffs(GetBitContext *gb, DCTELEM *out, int blocks_per_slice){ DCTELEM prev_dc; int code, i, sign; OPEN_READER(re, gb); DECODE_CODEWORD(code, FIRST_DC_CB); prev_dc = TOSIGNED(code); out[0] = prev_dc; out += 64; // dc coeff for the next block code = 5; sign = 0; for (i = 1; i < blo...
1
int av_vdpau_bind_context(AVCodecContext *avctx, VdpDevice device, VdpGetProcAddress *get_proc, unsigned flags){ VDPAUHWContext *hwctx; if (flags != 0) return AVERROR(EINVAL); if (av_reallocp(&avctx->hwaccel_context, sizeof(*hwctx))) return AVERROR(ENOMEM); hwctx = avctx->hwaccel_context; memset(hwctx, 0, sizeof(*hwctx...
1
static int decode_ref_pic_marking(H264Context *h){ MpegEncContext * const s = &h->s; int i; if(h->nal_unit_type == NAL_IDR_SLICE){ //FIXME fields s->broken_link= get_bits1(&s->gb) -1; h->mmco[0].long_index= get_bits1(&s->gb) - 1; // current_long_term_idx if(h->mmco[0].long_index == -1) h->mmco_index= 0; else{ h->mmco[0...
1
static DeviceState *sbi_init(target_phys_addr_t addr, qemu_irq **parent_irq){ DeviceState *dev; SysBusDevice *s; unsigned int i; dev = qdev_create(NULL, "sbi"); qdev_init(dev); s = sysbus_from_qdev(dev); for (i = 0; i < MAX_CPUS; i++) { sysbus_connect_irq(s, i, *parent_irq[i]); } sysbus_mmio_map(s, 0, addr); return dev...
1
void qdist_add(struct qdist *dist, double x, long count){ struct qdist_entry *entry = NULL; if (dist->n) { struct qdist_entry e; e.x = x; entry = bsearch(&e, dist->entries, dist->n, sizeof(e), qdist_cmp); } if (entry) { entry->count += count; return; } if (unlikely(dist->n == dist->size)) { dist->size *= 2; dist->entri...
0
static void av_always_inline filter_mb_edgeh( uint8_t *pix, int stride, const int16_t bS[4], unsigned int qp, H264Context *h ) { const int qp_bd_offset = 6 * (h->sps.bit_depth_luma - 8); const unsigned int index_a = qp - qp_bd_offset + h->slice_alpha_c0_offset; const int alpha = alpha_table[index_a]; const int beta = b...
0
static int decode_residual(H264Context *h, GetBitContext *gb, DCTELEM *block, int n, const uint8_t *scantable, int qp, int max_coeff){ MpegEncContext * const s = &h->s; const uint16_t *qmul= dequant_coeff[qp]; static const int coeff_token_table_index[17]= {0, 0, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3}; int level[1...
1
static void spapr_phb_vfio_finish_realize(sPAPRPHBState *sphb, Error **errp){ sPAPRPHBVFIOState *svphb = SPAPR_PCI_VFIO_HOST_BRIDGE(sphb); struct vfio_iommu_spapr_tce_info info = { .argsz = sizeof(info) }; int ret; sPAPRTCETable *tcet; uint32_t liobn = svphb->phb.dma_liobn; if (svphb->iommugroupid == -1) { error_setg(e...
1
static int coroutine_fn bdrv_mirror_top_flush(BlockDriverState *bs){ return bdrv_co_flush(bs->backing->bs);
1
static int mov_read_stss(MOVContext *c, ByteIOContext *pb, MOV_atom_t atom){ AVStream *st = c->fc->streams[c->fc->nb_streams-1]; MOVStreamContext *sc = (MOVStreamContext *)st->priv_data; int entries, i; print_atom("stss", atom); get_byte(pb); /* version */ get_byte(pb); get_byte(pb); get_byte(pb); /* flags */ entries =...
1
static int concat_read_packet(AVFormatContext *avf, AVPacket *pkt){ ConcatContext *cat = avf->priv_data; int ret; int64_t delta; while (1) { if ((ret = av_read_frame(cat->avf, pkt)) != AVERROR_EOF || (ret = open_next_file(avf)) < 0) break; } delta = av_rescale_q(cat->cur_file->start_time - cat->avf->start_time, AV_TIME...
1
static coroutine_fn int qcow2_co_flush_to_os(BlockDriverState *bs){ BDRVQcowState *s = bs->opaque; int ret; qemu_co_mutex_lock(&s->lock); ret = qcow2_cache_flush(bs, s->l2_table_cache); if (ret < 0) { qemu_co_mutex_unlock(&s->lock); return ret; } ret = qcow2_cache_flush(bs, s->refcount_block_cache); if (ret < 0) { qemu...
1
static inline void RENAME(rgb24ToY)(uint8_t *dst, const uint8_t *src, int width, uint32_t *unused){#if COMPILE_TEMPLATE_MMX RENAME(bgr24ToY_mmx)(dst, src, width, PIX_FMT_RGB24);#else int i; for (i=0; i<width; i++) { int r= src[i*3+0]; int g= src[i*3+1]; int b= src[i*3+2]; dst[i]= ((RY*r + GY*g + BY*b + (33<<(RGB2YUV_SH...
1
static inline void RENAME(rgb16to32)(const uint8_t *src, uint8_t *dst, int src_size){ const uint16_t *end; const uint16_t *mm_end; uint8_t *d = dst; const uint16_t *s = (const uint16_t*)src; end = s + src_size/2; __asm__ volatile(PREFETCH" %0"::"m"(*s):"memory"); __asm__ volatile("pxor %%mm7,%%mm7 \n\t":::"memory"); __...
1
void helper_sysret(CPUX86State *env, int dflag){ int cpl, selector; if (!(env->efer & MSR_EFER_SCE)) { raise_exception_err(env, EXCP06_ILLOP, 0); } cpl = env->hflags & HF_CPL_MASK; if (!(env->cr[0] & CR0_PE_MASK) || cpl != 0) { raise_exception_err(env, EXCP0D_GPF, 0); } selector = (env->star >> 48) & 0xffff; if (env->h...
0
static av_cold int adx_encode_init(AVCodecContext *avctx){ ADXContext *c = avctx->priv_data; if (avctx->channels > 2) return -1; avctx->frame_size = 32; avctx->coded_frame = avcodec_alloc_frame(); avctx->coded_frame->key_frame = 1; /* the cutoff can be adjusted, but this seems to work pretty well */ c->cutoff = 500; ff...
0
static int mpegps_read_header(AVFormatContext *s, AVFormatParameters *ap){ MpegDemuxContext *m = s->priv_data; uint8_t buffer[8192]; char *p; m->header_state = 0xff; s->ctx_flags |= AVFMTCTX_NOHEADER; get_buffer(&s->pb, buffer, sizeof(buffer)); if ((p=memchr(buffer, 'S', sizeof(buffer)))) if (!memcmp(p, "Sofdec", 6)) m...
0
int get_frame_filename(char *buf, int buf_size, const char *path, int number){ const char *p; char *q, buf1[20]; int nd, len, c, percentd_found; q = buf; p = path; percentd_found = 0; for(;;) { c = *p++; if (c == '\0') break; if (c == '%') { do { nd = 0; while (isdigit(*p)) { nd = nd * 10 + *p++ - '0'; } c = *p++; if (...
1
static int ivi_decode_blocks(GetBitContext *gb, IVIBandDesc *band, IVITile *tile, AVCodecContext *avctx){ int mbn, blk, num_blocks, num_coeffs, blk_size, scan_pos, run, val, pos, is_intra, mc_type = 0, mv_x, mv_y, col_mask; uint8_t col_flags[8]; int32_t prev_dc, trvec[64]; uint32_t cbp, sym, lo, hi, quant, buf_offs, q;...
1
static inline int handle_cpu_signal(uintptr_t pc, unsigned long address, int is_write, sigset_t *old_set){ CPUState *cpu; CPUClass *cc; int ret;#if defined(DEBUG_SIGNAL) printf("qemu: SIGSEGV pc=0x%08lx address=%08lx w=%d oldset=0x%08lx\n", pc, address, is_write, *(unsigned long *)old_set);#endif /* XXX: locking issue ...
1
static void put_bool(QEMUFile *f, void *pv, size_t size){ bool *v = pv; qemu_put_byte(f, *v);}
1
static void uhci_frame_timer(void *opaque){ UHCIState *s = opaque; /* prepare the timer for the next frame */ s->expire_time += (get_ticks_per_sec() / FRAME_TIMER_FREQ); s->frame_bytes = 0; s->completions_only = false; qemu_bh_cancel(s->bh); if (!(s->cmd & UHCI_CMD_RS)) { /* Full stop */ trace_usb_uhci_schedule_stop();...
1
static TCGv gen_vfp_mrs(void){ TCGv tmp = new_tmp(); tcg_gen_mov_i32(tmp, cpu_F0s); return tmp;}
1
static int epzs_motion_search(MpegEncContext * s, int *mx_ptr, int *my_ptr, int P[5][2], int pred_x, int pred_y, int xmin, int ymin, int xmax, int ymax){ int best[2]={0, 0}; int d, dmin; UINT8 *new_pic, *old_pic; const int pic_stride= s->linesize; const int pic_xy= (s->mb_y*pic_stride + s->mb_x)*16; UINT16 *mv_penalty=...
1
void acpi_build(AcpiBuildTables *tables, MachineState *machine){ PCMachineState *pcms = PC_MACHINE(machine); PCMachineClass *pcmc = PC_MACHINE_GET_CLASS(pcms); GArray *table_offsets; unsigned facs, dsdt, rsdt, fadt; AcpiPmInfo pm; AcpiMiscInfo misc; AcpiMcfgInfo mcfg; Range pci_hole, pci_hole64; uint8_t *u; size_t aml_...
1
void ff_snow_horizontal_compose97i_sse2(DWTELEM *b, int width){ const int w2= (width+1)>>1; // SSE2 code runs faster with pointers aligned on a 32-byte boundary. DWTELEM temp_buf[(width>>1) + 4]; DWTELEM * const temp = temp_buf + 4 - (((int)temp_buf & 0xF) >> 2); const int w_l= (width>>1); const int w_r= w2 - 1; int i;...
1
PPC_OP(btest_T1) { if (T0) { regs->nip = T1 & ~3; } else { regs->nip = PARAM1; } RETURN();}
1
static BlockDriverState *bdrv_open_inherit(const char *filename, const char *reference, QDict *options, int flags, BlockDriverState *parent, const BdrvChildRole *child_role, Error **errp){ int ret; BlockBackend *file = NULL; BlockDriverState *bs; BlockDriver *drv = NULL; const char *drvname; const char *backing; Error ...
0
static void decode(Real288_internal *glob, float gain, int cb_coef){ unsigned int x, y; float f; double sum, sumsum; float *p1, *p2; float buffer[5]; for (x=36; x--; glob->sb[x+5] = glob->sb[x]); for (x=5; x--;) { p1 = glob->sb+x; p2 = glob->pr1; for (sum=0, y=36; y--; sum -= (*(++p1))*(*(p2++))); glob->sb[x] = sum; } ...
0
int url_open_dyn_packet_buf(AVIOContext **s, int max_packet_size){ if (max_packet_size <= 0) return -1; return url_open_dyn_buf_internal(s, max_packet_size);}
0
static int ffmal_update_format(AVCodecContext *avctx){ MMALDecodeContext *ctx = avctx->priv_data; MMAL_STATUS_T status; int ret = 0; MMAL_COMPONENT_T *decoder = ctx->decoder; MMAL_ES_FORMAT_T *format_out = decoder->output[0]->format; ffmmal_poolref_unref(ctx->pool_out); if (!(ctx->pool_out = av_mallocz(sizeof(*ctx->poo...
1
static void gen_stswx(DisasContext *ctx){ TCGv t0; TCGv_i32 t1, t2; gen_set_access_type(ctx, ACCESS_INT); /* NIP cannot be restored if the memory exception comes from an helper */ gen_update_nip(ctx, ctx->nip - 4); t0 = tcg_temp_new(); gen_addr_reg_index(ctx, t0); t1 = tcg_temp_new_i32(); tcg_gen_trunc_tl_i32(t1, cpu_x...
1
uint64_t HELPER(neon_abdl_s64)(uint32_t a, uint32_t b){ uint64_t result; DO_ABD(result, a, b, int32_t); return result;}
1
static int stdio_fclose(void *opaque){ QEMUFileStdio *s = opaque; int ret = 0; if (qemu_file_is_writable(s->file)) { int fd = fileno(s->stdio_file); struct stat st; ret = fstat(fd, &st); if (ret == 0 && S_ISREG(st.st_mode)) { /* * If the file handle is a regular file make sure the * data is flushed to disk before signa...
1
static hwaddr ppc_hash64_htab_lookup(CPUPPCState *env, ppc_slb_t *slb, target_ulong eaddr, ppc_hash_pte64_t *pte){ hwaddr pteg_off, pte_offset; hwaddr hash; uint64_t vsid, epnshift, epnmask, epn, ptem; /* Page size according to the SLB, which we use to generate the * EPN for hash table lookup.. When we implement more r...
0
static int dnxhd_init_qmat(DNXHDEncContext *ctx, int lbias, int cbias){ // init first elem to 1 to avoid div by 0 in convert_matrix uint16_t weight_matrix[64] = {1,}; // convert_matrix needs uint16_t* int qscale, i; CHECKED_ALLOCZ(ctx->qmatrix_l, (ctx->m.avctx->qmax+1) * 64 * sizeof(int)); CHECKED_ALLOCZ(ctx->qmatrix_c...
0
static av_cold int a64multi_close_encoder(AVCodecContext *avctx){ A64Context *c = avctx->priv_data; av_frame_free(&avctx->coded_frame); av_free(c->mc_meta_charset); av_free(c->mc_best_cb); av_free(c->mc_charset); av_free(c->mc_charmap); av_free(c->mc_colram); return 0;}
1
void helper_stf_asi(target_ulong addr, int asi, int size, int rd){ unsigned int i; target_ulong val = 0; helper_check_align(addr, 3); addr = asi_address_mask(env, asi, addr); switch (asi) { case 0xe0: // UA2007 Block commit store primary (cache flush) case 0xe1: // UA2007 Block commit store secondary (cache flush) case...
1
static int drive_add(const char *file, const char *fmt, ...){ va_list ap; int index = drive_opt_get_free_idx(); if (nb_drives_opt >= MAX_DRIVES || index == -1) { fprintf(stderr, "qemu: too many drives\n"); exit(1); } drives_opt[index].file = file; va_start(ap, fmt); vsnprintf(drives_opt[index].opt, sizeof(drives_opt[0]...
1
int avcodec_close(AVCodecContext *avctx){ entangled_thread_counter++; if(entangled_thread_counter != 1){ av_log(avctx, AV_LOG_ERROR, "insufficient thread locking around avcodec_open/close()\n"); entangled_thread_counter--; return -1; } if (ENABLE_THREADS && avctx->thread_opaque) avcodec_thread_free(avctx); if (avctx->c...
1
void av_dump_format(AVFormatContext *ic, int index, const char *url, int is_output){ int i; uint8_t *printed = ic->nb_streams ? av_mallocz(ic->nb_streams) : NULL; if (ic->nb_streams && !printed) return; av_log(NULL, AV_LOG_INFO, "%s #%d, %s, %s '%s':\n", is_output ? "Output" : "Input", index, is_output ? ic->oformat->n...
1
static void vp8_idct_add_c(uint8_t *dst, DCTELEM block[16], ptrdiff_t stride){ int i, t0, t1, t2, t3; uint8_t *cm = ff_cropTbl + MAX_NEG_CROP; DCTELEM tmp[16]; for (i = 0; i < 4; i++) { t0 = block[0*4+i] + block[2*4+i]; t1 = block[0*4+i] - block[2*4+i]; t2 = MUL_35468(block[1*4+i]) - MUL_20091(block[3*4+i]); t3 = MUL_2...
1
static int get_next_block(DumpState *s, RAMBlock *block){ while (1) { block = QTAILQ_NEXT(block, next); if (!block) { /* no more block */ return 1; } s->start = 0; s->block = block; if (s->has_filter) { if (block->offset >= s->begin + s->length || block->offset + block->length <= s->begin) { /* This block is out of the...
1
static void scsi_req_xfer_mode(SCSIRequest *req){ switch (req->cmd.buf[0]) { case WRITE_6: case WRITE_10: case WRITE_VERIFY: case WRITE_12: case WRITE_VERIFY_12: case WRITE_16: case WRITE_VERIFY_16: case COPY: case COPY_VERIFY: case COMPARE: case CHANGE_DEFINITION: case LOG_SELECT: case MODE_SELECT: case MODE_SELECT_10...
1
static int decode_hextile(VmncContext *c, uint8_t *dst, const uint8_t *src, int ssize, int w, int h, int stride){ int i, j, k; int bg = 0, fg = 0, rects, color, flags, xy, wh; const int bpp = c->bpp2; uint8_t *dst2; int bw = 16, bh = 16; const uint8_t *ssrc = src; for (j = 0; j < h; j += 16) { dst2 = dst; bw = 16; if (...
1
void do_interrupt(CPUState *env){ int intno = env->exception_index;#ifdef DEBUG_PCALL if (qemu_loglevel_mask(CPU_LOG_INT)) { static int count; const char *name; if (intno < 0 || intno >= 0x180) name = "Unknown"; else if (intno >= 0x100) name = "Trap Instruction"; else if (intno >= 0xc0) name = "Window Fill"; else if (i...
1
int bdrv_open2(BlockDriverState *bs, const char *filename, int flags, BlockDriver *drv){ int ret, open_flags; char tmp_filename[PATH_MAX]; char backing_filename[PATH_MAX]; bs->read_only = 0; bs->is_temporary = 0; bs->encrypted = 0; bs->autogrow = 0; if (flags & BDRV_O_AUTOGROW) bs->autogrow = 1; if (flags & BDRV_O_SNAP...
1
int ff_pre_estimate_p_frame_motion(MpegEncContext * s, int mb_x, int mb_y){ MotionEstContext * const c= &s->me; int mx, my, dmin; int P[10][2]; const int shift= 1+s->quarter_sample; const int xy= mb_x + mb_y*s->mb_stride; init_ref(c, s->new_picture.f.data, s->last_picture.f.data, NULL, 16*mb_x, 16*mb_y, 0); assert(s->q...
1
static inline int gsm_mult(int a, int b){ return (a * b + (1 << 14)) >> 15;}
0
int ff_xvid_rate_control_init(MpegEncContext *s){ char *tmp_name; int fd, i; xvid_plg_create_t xvid_plg_create; xvid_plugin_2pass2_t xvid_2pass2;//xvid_debug=-1; fd=av_tempfile("xvidrc.", &tmp_name, 0, s->avctx); if (fd == -1) { av_log(NULL, AV_LOG_ERROR, "Can't create temporary pass2 file.\n"); return -1; } for(i=0; i...
1
static int dct_quantize_c(MpegEncContext *s, DCTELEM *block, int n, int qscale){ int i, j, level, last_non_zero, q; const int *qmat; int minLevel, maxLevel; if(s->avctx!=NULL && s->avctx->codec->id==CODEC_ID_MPEG4){/* mpeg4 */ minLevel= -2048;maxLevel= 2047; }else if(s->out_format==FMT_MPEG1){/* mpeg1 */ minLevel= -255...
1
static void drive_backup_abort(BlkActionState *common){ DriveBackupState *state = DO_UPCAST(DriveBackupState, common, common); BlockDriverState *bs = state->bs; /* Only cancel if it's the job we started */ if (bs && bs->job && bs->job == state->job) { block_job_cancel_sync(bs->job); }}