label
int64
0
1
func1
stringlengths
23
97k
id
int64
0
27.3k
0
static void av_noinline filter_mb_edgecv( uint8_t *pix, int stride, int16_t bS[4], unsigned int qp, H264Context *h ) { const unsigned int index_a = 52 + qp + h->slice_alpha_c0_offset; const int alpha = alpha_table[index_a]; const int beta = (beta_table+52)[qp + h->slice_beta_offset]; if (alpha ==0 || beta == 0) return;...
12,341
1
int qemu_recvv(int sockfd, struct iovec *iov, int len, int iov_offset) { return do_sendv_recvv(sockfd, iov, len, iov_offset, 0); }
12,342
1
static void vmxnet3_complete_packet(VMXNET3State *s, int qidx, uint32_t tx_ridx) { struct Vmxnet3_TxCompDesc txcq_descr; PCIDevice *d = PCI_DEVICE(s); VMXNET3_RING_DUMP(VMW_RIPRN, "TXC", qidx, &s->txq_descr[qidx].comp_ring); txcq_descr.txdIdx = tx_ridx; txcq_descr.gen = vmxnet3_ring_curr_gen(&s->txq_descr[qidx].comp_ri...
12,343
1
static void gen_mtc0(DisasContext *ctx, TCGv arg, int reg, int sel) { const char *rn = "invalid"; if (sel != 0) check_insn(ctx, ISA_MIPS32); if (ctx->tb->cflags & CF_USE_ICOUNT) { gen_io_start(); } switch (reg) { case 0: switch (sel) { case 0: gen_helper_mtc0_index(cpu_env, arg); rn = "Index"; case 1: CP0_CHECK(ctx->in...
12,344
1
void cpu_loop(CPUARMState *env) { int trapnr; unsigned int n, insn; target_siginfo_t info; uint32_t addr; for(;;) { cpu_exec_start(env); trapnr = cpu_arm_exec(env); cpu_exec_end(env); switch(trapnr) { case EXCP_UDEF: { TaskState *ts = env->opaque; uint32_t opcode; int rc; /* we handle the FPU emulation here, as Linux *...
12,345
1
static uint32_t cc_calc_abs_32(int32_t dst) { if ((uint32_t)dst == 0x80000000UL) { return 3; } else if (dst) { return 1; } else { return 0; } }
12,346
1
static int qemu_chr_open_pipe(QemuOpts *opts, CharDriverState **_chr) { int fd_in, fd_out; char filename_in[256], filename_out[256]; const char *filename = qemu_opt_get(opts, "path"); if (filename == NULL) { fprintf(stderr, "chardev: pipe: no filename given\n"); return -EINVAL; } snprintf(filename_in, 256, "%s.in", fil...
12,348
1
static void vp5_parse_coeff(VP56Context *s) { VP56RangeCoder *c = &s->c; VP56Model *model = s->modelp; uint8_t *permute = s->idct_scantable; uint8_t *model1, *model2; int coeff, sign, coeff_idx; int b, i, cg, idx, ctx, ctx_last; int pt = 0; /* plane type (0 for Y, 1 for U or V) */ for (b=0; b<6; b++) { int ct = 1; /* c...
12,349
0
static int nvdec_vc1_end_frame(AVCodecContext *avctx) { NVDECContext *ctx = avctx->internal->hwaccel_priv_data; int ret = ff_nvdec_end_frame(avctx); ctx->bitstream = NULL; return ret; }
12,350
0
static inline void RENAME(yuy2toyv12)(const uint8_t *src, uint8_t *ydst, uint8_t *udst, uint8_t *vdst, long width, long height, long lumStride, long chromStride, long srcStride) { long y; const long chromWidth= width>>1; for(y=0; y<height; y+=2) { #ifdef HAVE_MMX asm volatile( "xor %%"REG_a", %%"REG_a" \n\t" "pcmpeqw %...
12,352
0
static int qtrle_decode_init(AVCodecContext *avctx) { QtrleContext *s = avctx->priv_data; s->avctx = avctx; switch (avctx->bits_per_sample) { case 1: case 2: case 4: case 8: case 33: case 34: case 36: case 40: avctx->pix_fmt = PIX_FMT_PAL8; break; case 16: avctx->pix_fmt = PIX_FMT_RGB555; break; case 24: avctx->pix_fmt...
12,354
0
void vp8_mc_part(VP8Context *s, uint8_t *dst[3], AVFrame *ref_frame, int x_off, int y_off, int bx_off, int by_off, int block_w, int block_h, int width, int height, VP56mv *mv) { VP56mv uvmv = *mv; /* Y */ vp8_mc(s, 1, dst[0] + by_off * s->linesize + bx_off, ref_frame->data[0], mv, x_off + bx_off, y_off + by_off, block_...
12,355
0
static int decode_p_frame(FourXContext *f, const uint8_t *buf, int length){ int x, y; const int width= f->avctx->width; const int height= f->avctx->height; uint16_t *src= (uint16_t*)f->last_picture.data[0]; uint16_t *dst= (uint16_t*)f->current_picture.data[0]; const int stride= f->current_picture.linesize[0]>>1; unsign...
12,356
0
static inline int halfpel_motion_search(MpegEncContext * s, int *mx_ptr, int *my_ptr, int dmin, int xmin, int ymin, int xmax, int ymax, int pred_x, int pred_y, uint8_t *ref_picture) { UINT16 *mv_penalty= s->mv_penalty[s->f_code] + MAX_MV; // f_code of the prev frame const int quant= s->qscale; int pen_x, pen_y; int mx,...
12,358
0
void ff_avg_h264_qpel16_mc02_msa(uint8_t *dst, const uint8_t *src, ptrdiff_t stride) { avc_luma_vt_and_aver_dst_16x16_msa(src - (stride * 2), stride, dst, stride); }
12,359
0
static inline int check_input_motion(MpegEncContext * s, int mb_x, int mb_y, int p_type){ MotionEstContext * const c= &s->me; Picture *p= s->current_picture_ptr; int mb_xy= mb_x + mb_y*s->mb_stride; int xy= 2*mb_x + 2*mb_y*s->b8_stride; int mb_type= s->current_picture.mb_type[mb_xy]; int flags= c->flags; int shift= (fl...
12,360
0
void *checkasm_check_func(void *func, const char *name, ...) { char name_buf[256]; void *ref = func; CheckasmFuncVersion *v; int name_length; va_list arg; va_start(arg, name); name_length = vsnprintf(name_buf, sizeof(name_buf), name, arg); va_end(arg); if (!func || name_length <= 0 || name_length >= sizeof(name_buf)) r...
12,361
0
void ff_dsputil_init_mmx(DSPContext *c, AVCodecContext *avctx) { int mm_flags = av_get_cpu_flags(); if (mm_flags & AV_CPU_FLAG_MMX) { #if HAVE_INLINE_ASM const int idct_algo = avctx->idct_algo; if (avctx->bits_per_raw_sample <= 8) { if (idct_algo == FF_IDCT_AUTO || idct_algo == FF_IDCT_SIMPLEMMX) { c->idct_put = ff_sim...
12,363
0
QemuOpts *qemu_chr_parse_compat(const char *label, const char *filename) { char host[65], port[33], width[8], height[8]; int pos; const char *p; QemuOpts *opts; Error *local_err = NULL; opts = qemu_opts_create(qemu_find_opts("chardev"), label, 1, &local_err); if (local_err) { error_report_err(local_err); return NULL; }...
12,366
0
static int check_refcounts_l1(BlockDriverState *bs, BdrvCheckResult *res, uint16_t *refcount_table, int refcount_table_size, int64_t l1_table_offset, int l1_size, int check_copied) { BDRVQcowState *s = bs->opaque; uint64_t *l1_table, l2_offset, l1_size2; int i, refcount, ret; l1_size2 = l1_size * sizeof(uint64_t); /* M...
12,368
0
static always_inline void gen_qemu_lds (TCGv t0, TCGv t1, int flags) { TCGv tmp = tcg_temp_new(TCG_TYPE_I32); tcg_gen_qemu_ld32u(tmp, t1, flags); tcg_gen_helper_1_1(helper_memory_to_s, t0, tmp); tcg_temp_free(tmp); }
12,369
0
static void pmac_ide_flush(DBDMA_io *io) { MACIOIDEState *m = io->opaque; if (m->aiocb) { bdrv_drain_all(); } }
12,370
0
static void socket_start_outgoing_migration(MigrationState *s, SocketAddress *saddr, Error **errp) { QIOChannelSocket *sioc = qio_channel_socket_new(); struct SocketConnectData *data = g_new0(struct SocketConnectData, 1); data->s = s; if (saddr->type == SOCKET_ADDRESS_KIND_INET) { data->hostname = g_strdup(saddr->u.ine...
12,371
0
void qio_dns_resolver_lookup_async(QIODNSResolver *resolver, SocketAddressLegacy *addr, QIOTaskFunc func, gpointer opaque, GDestroyNotify notify) { QIOTask *task; struct QIODNSResolverLookupData *data = g_new0(struct QIODNSResolverLookupData, 1); data->addr = QAPI_CLONE(SocketAddressLegacy, addr); task = qio_task_new(O...
12,372
0
int ff_mjpeg_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt) { AVFrame *frame = data; const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; MJpegDecodeContext *s = avctx->priv_data; const uint8_t *buf_end, *buf_ptr; const uint8_t *unescaped_buf_ptr; int hshift, vshift; int unesc...
12,374
0
void hpet_init(qemu_irq *irq) { int i, iomemtype; HPETState *s; dprintf ("hpet_init\n"); s = qemu_mallocz(sizeof(HPETState)); hpet_statep = s; s->irqs = irq; for (i=0; i<HPET_NUM_TIMERS; i++) { HPETTimer *timer = &s->timer[i]; timer->qemu_timer = qemu_new_timer(vm_clock, hpet_timer, timer); } hpet_reset(s); vmstate_reg...
12,380
0
static void x86_cpu_initfn(Object *obj) { CPUState *cs = CPU(obj); X86CPU *cpu = X86_CPU(obj); X86CPUClass *xcc = X86_CPU_GET_CLASS(obj); CPUX86State *env = &cpu->env; FeatureWord w; cs->env_ptr = env; cpu_exec_init(cs, &error_abort); object_property_add(obj, "family", "int", x86_cpuid_version_get_family, x86_cpuid_ver...
12,381
0
build_dsdt(GArray *table_data, GArray *linker, VirtGuestInfo *guest_info) { Aml *scope, *dsdt; const MemMapEntry *memmap = guest_info->memmap; const int *irqmap = guest_info->irqmap; dsdt = init_aml_allocator(); /* Reserve space for header */ acpi_data_push(dsdt->buf, sizeof(AcpiTableHeader)); /* When booting the VM wi...
12,382
0
static int lag_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; unsigned int buf_size = avpkt->size; LagarithContext *l = avctx->priv_data; ThreadFrame frame = { .f = data }; AVFrame *const p = data; uint8_t frametype = 0; uint32_t offset_gu = 0, offse...
12,385
1
static int line_in_init (HWVoiceIn *hw, struct audsettings *as) { SpiceVoiceIn *in = container_of (hw, SpiceVoiceIn, hw); struct audsettings settings; #if SPICE_INTERFACE_RECORD_MAJOR > 2 || SPICE_INTERFACE_RECORD_MINOR >= 3 settings.freq = spice_server_get_best_record_rate(NULL); #else settings.freq = SPICE_INTERFACE_...
12,387
1
static void virtio_queue_guest_notifier_read(EventNotifier *n) { VirtQueue *vq = container_of(n, VirtQueue, guest_notifier); if (event_notifier_test_and_clear(n)) { virtio_irq(vq); } }
12,388
1
int spapr_tce_dma_zero(VIOsPAPRDevice *dev, uint64_t taddr, uint32_t size) { /* FIXME: allocating a temp buffer is nasty, but just stepping * through writing zeroes is awkward. This will do for now. */ uint8_t zeroes[size]; #ifdef DEBUG_TCE fprintf(stderr, "spapr_tce_dma_zero taddr=0x%llx size=0x%x\n", (unsigned long l...
12,389
1
static void do_video_out(AVFormatContext *s, AVOutputStream *ost, AVInputStream *ist, AVPicture *picture1) { int n1, n2, nb, i, ret, frame_number; AVPicture *picture, *picture2, *pict; AVPicture picture_tmp1, picture_tmp2; UINT8 video_buffer[128*1024]; UINT8 *buf = NULL, *buf1 = NULL; AVCodecContext *enc, *dec; enc = &...
12,390
1
static void test_visitor_in_fuzz(TestInputVisitorData *data, const void *unused) { int64_t ires; bool bres; double nres; char *sres; EnumOne eres; Error *errp = NULL; Visitor *v; unsigned int i; char buf[10000]; for (i = 0; i < 100; i++) { unsigned int j; j = g_test_rand_int_range(0, sizeof(buf) - 1); buf[j] = '\0'; if...
12,391
1
static inline int _find_pte(CPUState *env, mmu_ctx_t *ctx, int is_64b, int h, int rw, int type, int target_page_bits) { target_phys_addr_t pteg_off; target_ulong pte0, pte1; int i, good = -1; int ret, r; ret = -1; /* No entry found */ pteg_off = get_pteg_offset(env, ctx->hash[h], is_64b ? HASH_PTE_SIZE_64 : HASH_PTE_SI...
12,392
0
static int decode_sequence_header(AVCodecContext *avctx, GetBitContext *gb) { VC9Context *v = avctx->priv_data; v->profile = get_bits(gb, 2); av_log(avctx, AV_LOG_DEBUG, "Profile: %i\n", v->profile); #if HAS_ADVANCED_PROFILE if (v->profile > PROFILE_MAIN) { v->level = get_bits(gb, 3); v->chromaformat = get_bits(gb, 2);...
12,393
0
static int mov_probe(AVProbeData *p) { int64_t offset; uint32_t tag; int score = 0; /* check file header */ offset = 0; for (;;) { /* ignore invalid offset */ if ((offset + 8) > (unsigned int)p->buf_size) return score; tag = AV_RL32(p->buf + offset + 4); switch(tag) { /* check for obvious tags */ case MKTAG('j','P',' '...
12,394
0
static inline void RENAME(rgb32to15)(const uint8_t *src, uint8_t *dst, long src_size) { const uint8_t *s = src; const uint8_t *end; #ifdef HAVE_MMX const uint8_t *mm_end; #endif uint16_t *d = (uint16_t *)dst; end = s + src_size; #ifdef HAVE_MMX mm_end = end - 15; #if 1 //is faster only if multiplies are reasonable fast...
12,398
0
static int source_request_frame(AVFilterLink *outlink) { Frei0rContext *frei0r = outlink->src->priv; AVFilterBufferRef *picref = ff_get_video_buffer(outlink, AV_PERM_WRITE, outlink->w, outlink->h); int ret; picref->video->pixel_aspect = (AVRational) {1, 1}; picref->pts = frei0r->pts++; picref->pos = -1; ret = ff_start_...
12,400
1
static int vmdk_is_allocated(BlockDriverState *bs, int64_t sector_num, int nb_sectors, int *pnum) { BDRVVmdkState *s = bs->opaque; int index_in_cluster, n; uint64_t cluster_offset; cluster_offset = get_cluster_offset(bs, sector_num << 9, 0); index_in_cluster = sector_num % s->cluster_sectors; n = s->cluster_sectors - i...
12,401
1
void put_vp8_epel_h_altivec_core(uint8_t *dst, int dst_stride, uint8_t *src, int src_stride, int h, int mx, int w, int is6tap) { LOAD_H_SUBPEL_FILTER(mx-1); vec_u8 align_vec0, align_vec8, permh0, permh8, filt; vec_u8 perm_6tap0, perm_6tap8, perml0, perml8; vec_u8 a, b, pixh, pixl, outer; vec_s16 f16h, f16l; vec_s32 fil...
12,403
1
static int mpidr_read(CPUARMState *env, const ARMCPRegInfo *ri, uint64_t *value) { CPUState *cs = CPU(arm_env_get_cpu(env)); uint32_t mpidr = cs->cpu_index; /* We don't support setting cluster ID ([8..11]) * so these bits always RAZ. */ if (arm_feature(env, ARM_FEATURE_V7MP)) { mpidr |= (1 << 31); /* Cores which are un...
12,404
1
void cpu_loop (CPUSPARCState *env) { int trapnr, ret; target_siginfo_t info; while (1) { trapnr = cpu_sparc_exec (env); switch (trapnr) { #ifndef TARGET_SPARC64 case 0x88: case 0x90: #else case 0x110: case 0x16d: #endif ret = do_syscall (env, env->gregs[1], env->regwptr[0], env->regwptr[1], env->regwptr[2], env->regwpt...
12,405
1
static av_cold int init(AVFilterContext *ctx, const char *args0) { PanContext *const pan = ctx->priv; char *arg, *arg0, *tokenizer, *args = av_strdup(args0); int out_ch_id, in_ch_id, len, named, ret; int nb_in_channels[2] = { 0, 0 }; // number of unnamed and named input channels double gain; if (!args0) { av_log(ctx, A...
12,406
1
static void pvpanic_isa_realizefn(DeviceState *dev, Error **errp) { ISADevice *d = ISA_DEVICE(dev); PVPanicState *s = ISA_PVPANIC_DEVICE(dev); static bool port_configured; FWCfgState *fw_cfg; isa_register_ioport(d, &s->io, s->ioport); if (!port_configured) { fw_cfg = fw_cfg_find(); if (fw_cfg) { fw_cfg_add_file(fw_cfg,...
12,407
1
static TRBCCode xhci_address_slot(XHCIState *xhci, unsigned int slotid, uint64_t pictx, bool bsr) { XHCISlot *slot; USBPort *uport; USBDevice *dev; dma_addr_t ictx, octx, dcbaap; uint64_t poctx; uint32_t ictl_ctx[2]; uint32_t slot_ctx[4]; uint32_t ep0_ctx[5]; int i; TRBCCode res; trace_usb_xhci_slot_address(slotid); as...
12,408
1
static int compare_ocl_device_desc(const void *a, const void *b) { return ((const OpenCLDeviceBenchmark*)a)->runtime - ((const OpenCLDeviceBenchmark*)b)->runtime; }
12,410
0
void ff_vc1dsp_init_mmx(VC1DSPContext *dsp) { int mm_flags = av_get_cpu_flags(); #if HAVE_INLINE_ASM if (mm_flags & AV_CPU_FLAG_MMX) { dsp->put_vc1_mspel_pixels_tab[ 0] = ff_put_vc1_mspel_mc00_mmx; dsp->put_vc1_mspel_pixels_tab[ 4] = put_vc1_mspel_mc01_mmx; dsp->put_vc1_mspel_pixels_tab[ 8] = put_vc1_mspel_mc02_mmx; ds...
12,411
0
static av_cold int ffv1_encode_close(AVCodecContext *avctx) { av_frame_free(&avctx->coded_frame); ffv1_close(avctx); return 0; }
12,413
0
static inline void conv_to_float(float *arr, int32_t *cof, int num) { int i; for (i = 0; i < num; i++) arr[i] = (float)cof[i]/INT32_MAX; }
12,414
0
static int process_input(int file_index) { InputFile *ifile = input_files[file_index]; AVFormatContext *is; InputStream *ist; AVPacket pkt; int ret, i, j; int64_t duration; int64_t pkt_dts; is = ifile->ctx; ret = get_input_packet(ifile, &pkt); if (ret == AVERROR(EAGAIN)) { ifile->eagain = 1; return ret; } if (ret < 0 &...
12,415
0
void ff_put_h264_qpel4_mc23_msa(uint8_t *dst, const uint8_t *src, ptrdiff_t stride) { avc_luma_midv_qrt_4w_msa(src - (2 * stride) - 2, stride, dst, stride, 4, 1); }
12,416
0
static int start_frame(AVFilterLink *inlink, AVFilterBufferRef *inpicref) { AVFilterLink *outlink = inlink->dst->outputs[0]; AVFilterBufferRef *outpicref = NULL; int ret = 0; if (inpicref->perms & AV_PERM_PRESERVE) { outpicref = ff_get_video_buffer(outlink, AV_PERM_WRITE, outlink->w, outlink->h); if (!outpicref) return...
12,417
1
host_memory_backend_memory_complete(UserCreatable *uc, Error **errp) { HostMemoryBackend *backend = MEMORY_BACKEND(uc); HostMemoryBackendClass *bc = MEMORY_BACKEND_GET_CLASS(uc); Error *local_err = NULL; void *ptr; uint64_t sz; if (bc->alloc) { bc->alloc(backend, &local_err); if (local_err) { goto out; } ptr = memory_r...
12,420
1
static void fill_gv_table(int table[256 + 2*YUVRGB_TABLE_HEADROOM], const int elemsize, const int inc) { int i; int off = -(inc >> 9); for (i = 0; i < 256 + 2*YUVRGB_TABLE_HEADROOM; i++) { int64_t cb = av_clip(i-YUVRGB_TABLE_HEADROOM, 0, 255)*inc; table[i] = elemsize * (off + (cb >> 16)); } }
12,421
1
static ssize_t write_console_data(SCLPEvent *event, const uint8_t *buf, size_t len) { SCLPConsole *scon = SCLP_CONSOLE(event); if (!scon->chr) { /* If there's no backend, we can just say we consumed all data. */ return len; } return qemu_chr_fe_write_all(scon->chr, buf, len); }
12,422
1
static int rewrite_footer(BlockDriverState* bs) { int ret; BDRVVPCState *s = bs->opaque; int64_t offset = s->free_data_block_offset; ret = bdrv_pwrite(bs->file, offset, s->footer_buf, HEADER_SIZE); if (ret < 0) return ret; return 0; }
12,423
1
static uint32_t sdhci_read_dataport(SDHCIState *s, unsigned size) { uint32_t value = 0; int i; /* first check that a valid data exists in host controller input buffer */ if ((s->prnsts & SDHC_DATA_AVAILABLE) == 0) { ERRPRINT("Trying to read from empty buffer\n"); return 0; } for (i = 0; i < size; i++) { value |= s->fif...
12,424
1
static int archipelago_aio_segmented_rw(BDRVArchipelagoState *s, size_t count, off_t offset, ArchipelagoAIOCB *aio_cb, int op) { int i, ret, segments_nr, last_segment_size; ArchipelagoSegmentedRequest *segreq; segreq = g_malloc(sizeof(ArchipelagoSegmentedRequest)); if (op == ARCHIP_OP_FLUSH) { segments_nr = 1; segreq->...
12,425
1
static int ram_load_dead(QEMUFile *f, void *opaque) { RamDecompressState s1, *s = &s1; uint8_t buf[10]; ram_addr_t i; if (ram_decompress_open(s, f) < 0) return -EINVAL; for(i = 0; i < last_ram_offset; i+= BDRV_HASH_BLOCK_SIZE) { if (ram_decompress_buf(s, buf, 1) < 0) { fprintf(stderr, "Error while reading ram block hea...
12,427
1
static void v9fs_attach(void *opaque) { V9fsPDU *pdu = opaque; V9fsState *s = pdu->s; int32_t fid, afid, n_uname; V9fsString uname, aname; V9fsFidState *fidp; size_t offset = 7; V9fsQID qid; ssize_t err; pdu_unmarshal(pdu, offset, "ddssd", &fid, &afid, &uname, &aname, &n_uname); trace_v9fs_attach(pdu->tag, pdu->id, fid...
12,428
1
static void virtio_blk_free_request(VirtIOBlockReq *req) { if (req) { g_slice_free(VirtQueueElement, req->elem); g_slice_free(VirtIOBlockReq, req); } }
12,430
1
static int vmd_decode(VmdVideoContext *s, AVFrame *frame) { int i; unsigned int *palette32; unsigned char r, g, b; GetByteContext gb; unsigned char meth; unsigned char *dp; /* pointer to current frame */ unsigned char *pp; /* pointer to previous frame */ unsigned char len; int ofs; int frame_x, frame_y; int frame_width...
12,431
0
static void show_program(WriterContext *w, AVFormatContext *fmt_ctx, AVProgram *program) { int i; writer_print_section_header(w, SECTION_ID_PROGRAM); print_int("program_id", program->id); print_int("program_num", program->program_num); print_int("nb_streams", program->nb_stream_indexes); print_int("pmt_pid", program->p...
12,432
0
static int vaapi_encode_h264_write_extra_header(AVCodecContext *avctx, VAAPIEncodePicture *pic, int index, int *type, char *data, size_t *data_len) { VAAPIEncodeContext *ctx = avctx->priv_data; VAAPIEncodeH264Context *priv = ctx->priv_data; VAAPIEncodeH264Options *opt = ctx->codec_options; CodedBitstreamFragment *au = ...
12,433
0
unsigned int DoubleCPDO(const unsigned int opcode) { FPA11 *fpa11 = GET_FPA11(); float64 rFm, rFn = 0; unsigned int Fd, Fm, Fn, nRc = 1; //printk("DoubleCPDO(0x%08x)\n",opcode); Fm = getFm(opcode); if (CONSTANT_FM(opcode)) { rFm = getDoubleConstant(Fm); } else { switch (fpa11->fType[Fm]) { case typeSingle: rFm = float3...
12,435
0
static void pci_nop(void) { qvirtio_scsi_start(NULL); qvirtio_scsi_stop(); }
12,436
0
long do_sigreturn(CPUS390XState *env) { sigframe *frame; abi_ulong frame_addr = env->regs[15]; qemu_log("%s: frame_addr 0x%llx\n", __FUNCTION__, (unsigned long long)frame_addr); target_sigset_t target_set; sigset_t set; if (!lock_user_struct(VERIFY_READ, frame, frame_addr, 1)) { goto badframe; } if (__get_user(target_s...
12,437
0
void helper_check_iow(CPUX86State *env, uint32_t t0) { check_io(env, t0, 2); }
12,438
0
AVStream *av_new_stream(AVFormatContext *s, int id) { AVStream *st; int i; #if LIBAVFORMAT_VERSION_MAJOR >= 53 AVStream **streams; if (s->nb_streams >= INT_MAX/sizeof(*streams)) return NULL; streams = av_realloc(s->streams, (s->nb_streams + 1) * sizeof(*streams)); if (!streams) return NULL; s->streams = streams; #else ...
12,439
0
void tcg_prologue_init(TCGContext *s) { size_t prologue_size, total_size; void *buf0, *buf1; /* Put the prologue at the beginning of code_gen_buffer. */ buf0 = s->code_gen_buffer; s->code_ptr = buf0; s->code_buf = buf0; s->code_gen_prologue = buf0; /* Generate the prologue. */ tcg_target_qemu_prologue(s); buf1 = s->cod...
12,441
0
void qemu_clock_warp(QEMUClockType type) { int64_t clock; int64_t deadline; /* * There are too many global variables to make the "warp" behavior * applicable to other clocks. But a clock argument removes the * need for if statements all over the place. */ if (type != QEMU_CLOCK_VIRTUAL || !use_icount) { return; } if (i...
12,442
0
static void report_unavailable_features(FeatureWord w, uint32_t mask) { FeatureWordInfo *f = &feature_word_info[w]; int i; for (i = 0; i < 32; ++i) { if ((1UL << i) & mask) { const char *reg = get_register_name_32(f->cpuid_reg); assert(reg); fprintf(stderr, "warning: %s doesn't support requested feature: " "CPUID.%02XH...
12,443
0
static int nbd_receive_option_reply(QIOChannel *ioc, uint32_t opt, nbd_opt_reply *reply, Error **errp) { QEMU_BUILD_BUG_ON(sizeof(*reply) != 20); if (nbd_read(ioc, reply, sizeof(*reply), errp) < 0) { error_prepend(errp, "failed to read option reply"); nbd_send_opt_abort(ioc); return -1; } be64_to_cpus(&reply->magic); b...
12,444
0
void omap_badwidth_write8(void *opaque, target_phys_addr_t addr, uint32_t value) { uint8_t val8 = value; OMAP_8B_REG(addr); cpu_physical_memory_write(addr, (void *) &val8, 1); }
12,445
0
static PCIDevice *qemu_pci_hot_add_storage(Monitor *mon, const char *devaddr, const char *opts) { PCIDevice *dev; DriveInfo *dinfo = NULL; int type = -1; char buf[128]; if (get_param_value(buf, sizeof(buf), "if", opts)) { if (!strcmp(buf, "scsi")) type = IF_SCSI; else if (!strcmp(buf, "virtio")) { type = IF_VIRTIO; } e...
12,447
0
static inline void clear_float_exceptions(CPUSPARCState *env) { set_float_exception_flags(0, &env->fp_status); }
12,448
0
void helper_ldxfsr(CPUSPARCState *env, uint64_t new_fsr) { env->fsr = (new_fsr & FSR_LDXFSR_MASK) | (env->fsr & FSR_LDXFSR_OLDMASK); set_fsr(env); }
12,449
0
static void apply_motion_4x4(RoqContext *ri, int x, int y, unsigned char mv, signed char mean_x, signed char mean_y) { int i, hw, mx, my; unsigned char *pa, *pb; mx = x + 8 - (mv >> 4) - mean_x; my = y + 8 - (mv & 0xf) - mean_y; pa = ri->current_frame.data[0] + (y * ri->y_stride) + x; pb = ri->last_frame.data[0] + (my ...
12,450
0
static void pty_chr_update_read_handler(CharDriverState *chr) { PtyCharDriver *s = chr->opaque; GPollFD pfd; pfd.fd = g_io_channel_unix_get_fd(s->fd); pfd.events = G_IO_OUT; pfd.revents = 0; g_poll(&pfd, 1, 0); if (pfd.revents & G_IO_HUP) { pty_chr_state(chr, 0); } else { pty_chr_state(chr, 1); } }
12,453
1
static int protocol_client_vencrypt_auth(VncState *vs, uint8_t *data, size_t len) { int auth = read_u32(data, 0); if (auth != vs->vd->subauth) { VNC_DEBUG("Rejecting auth %d\n", auth); vnc_write_u8(vs, 0); /* Reject auth */ vnc_flush(vs); vnc_client_error(vs); } else { VNC_DEBUG("Accepting auth %d, starting handshake\n...
12,454
1
static int ata_passthrough_16_xfer_size(SCSIDevice *dev, uint8_t *buf) { int extend = buf[1] & 0x1; int length = buf[2] & 0x3; int xfer; int unit = ata_passthrough_xfer_unit(dev, buf); switch (length) { case 0: case 3: /* USB-specific. */ xfer = 0; break; case 1: xfer = buf[4]; xfer |= (extend ? buf[3] << 8 : 0); break...
12,455
0
void dsputil_init(DSPContext* c, AVCodecContext *avctx) { int i; ff_check_alignment(); #if CONFIG_ENCODERS if(avctx->dct_algo==FF_DCT_FASTINT) { c->fdct = fdct_ifast; c->fdct248 = fdct_ifast248; } else if(avctx->dct_algo==FF_DCT_FAAN) { c->fdct = ff_faandct; c->fdct248 = ff_faandct248; } else { c->fdct = ff_jpeg_fdct_i...
12,456
1
static void qio_channel_websock_handshake_send_res_ok(QIOChannelWebsock *ioc, const char *key, Error **errp) { char combined_key[QIO_CHANNEL_WEBSOCK_CLIENT_KEY_LEN + QIO_CHANNEL_WEBSOCK_GUID_LEN + 1]; char *accept = NULL; char *date = qio_channel_websock_date_str(); g_strlcpy(combined_key, key, QIO_CHANNEL_WEBSOCK_CLIE...
12,457
1
static int a64_write_trailer(struct AVFormatContext *s) { A64MuxerContext *c = s->priv_data; AVPacket pkt; /* need to flush last packet? */ if(c->interleaved) a64_write_packet(s, &pkt); return 0; }
12,458
1
void vnc_display_open(const char *id, Error **errp) { VncDisplay *vs = vnc_display_find(id); QemuOpts *opts = qemu_opts_find(&qemu_vnc_opts, id); QemuOpts *sopts, *wsopts; const char *share, *device_id; QemuConsole *con; bool password = false; bool reverse = false; const char *vnc; const char *has_to; char *h; bool has...
12,459
1
static int rm_read_header(AVFormatContext *s) { RMDemuxContext *rm = s->priv_data; AVStream *st; AVIOContext *pb = s->pb; unsigned int tag; int tag_size; unsigned int start_time, duration; unsigned int data_off = 0, indx_off = 0; char buf[128], mime[128]; int flags = 0; tag = avio_rl32(pb); if (tag == MKTAG('.', 'r', '...
12,460
0
int av_write_frame(AVFormatContext *s, int stream_index, const uint8_t *buf, int size) { AVStream *st; int64_t pts_mask; int ret, frame_size; st = s->streams[stream_index]; pts_mask = (1LL << s->pts_wrap_bits) - 1; ret = s->oformat->write_packet(s, stream_index, buf, size, st->pts.val & pts_mask); if (ret < 0) return r...
12,461
0
static int decode(AVCodecContext *avctx, void *data, int *got_sub, AVPacket *avpkt) { CCaptionSubContext *ctx = avctx->priv_data; AVSubtitle *sub = data; const int64_t start_time = sub->pts; uint8_t *bptr = NULL; int len = avpkt->size; int ret = 0; int i; if (ctx->pktbuf->size < len) { ret = av_buffer_realloc(&ctx->pkt...
12,462
0
static int config(struct vf_instance *vf, int width, int height, int d_width, int d_height, unsigned int flags, unsigned int outfmt) { switch (vf->priv->mode) { case 0: case 3: return ff_vf_next_config(vf,width,height*2,d_width,d_height*2,flags,outfmt); case 1: /* odd frames */ case 2: /* even frames */ case 4: /* alte...
12,463
0
static av_cold int vqa_decode_init(AVCodecContext *avctx) { VqaContext *s = avctx->priv_data; unsigned char *vqa_header; int i, j, codebook_index; s->avctx = avctx; avctx->pix_fmt = PIX_FMT_PAL8; /* make sure the extradata made it */ if (s->avctx->extradata_size != VQA_HEADER_SIZE) { av_log(s->avctx, AV_LOG_ERROR, " VQ...
12,464
0
static int coroutine_fn mirror_dirty_init(MirrorBlockJob *s) { int64_t sector_num, end; BlockDriverState *base = s->base; BlockDriverState *bs = blk_bs(s->common.blk); BlockDriverState *target_bs = blk_bs(s->target); int ret, n; end = s->bdev_length / BDRV_SECTOR_SIZE; if (base == NULL && !bdrv_has_zero_init(target_bs)...
12,465
0
int xen_domain_build_pv(const char *kernel, const char *ramdisk, const char *cmdline) { uint32_t ssidref = 0; uint32_t flags = 0; xen_domain_handle_t uuid; unsigned int xenstore_port = 0, console_port = 0; unsigned long xenstore_mfn = 0, console_mfn = 0; int rc; memcpy(uuid, qemu_uuid, sizeof(uuid)); rc = xc_domain_cre...
12,466
0
static int kvm_physical_sync_dirty_bitmap(target_phys_addr_t start_addr, target_phys_addr_t end_addr) { KVMState *s = kvm_state; unsigned long size, allocated_size = 0; KVMDirtyLog d; KVMSlot *mem; int ret = 0; d.dirty_bitmap = NULL; while (start_addr < end_addr) { mem = kvm_lookup_overlapping_slot(s, start_addr, end_a...
12,467
0
static void gic_dist_writew(void *opaque, target_phys_addr_t offset, uint32_t value) { gic_dist_writeb(opaque, offset, value & 0xff); gic_dist_writeb(opaque, offset + 1, value >> 8); }
12,468
0
static float64 roundAndPackFloat64( flag zSign, int16 zExp, bits64 zSig STATUS_PARAM) { int8 roundingMode; flag roundNearestEven; int16 roundIncrement, roundBits; flag isTiny; roundingMode = STATUS(float_rounding_mode); roundNearestEven = ( roundingMode == float_round_nearest_even ); roundIncrement = 0x200; if ( ! roun...
12,469
0
static void intel_hda_parse_bdl(IntelHDAState *d, IntelHDAStream *st) { target_phys_addr_t addr; uint8_t buf[16]; uint32_t i; addr = intel_hda_addr(st->bdlp_lbase, st->bdlp_ubase); st->bentries = st->lvi +1; g_free(st->bpl); st->bpl = g_malloc(sizeof(bpl) * st->bentries); for (i = 0; i < st->bentries; i++, addr += 16) ...
12,471
0
static void mptsas_fetch_request(MPTSASState *s) { PCIDevice *pci = (PCIDevice *) s; char req[MPTSAS_MAX_REQUEST_SIZE]; MPIRequestHeader *hdr = (MPIRequestHeader *)req; hwaddr addr; int size; if (s->state != MPI_IOC_STATE_OPERATIONAL) { mptsas_set_fault(s, MPI_IOCSTATUS_INVALID_STATE); return; } /* Read the message hea...
12,472
0
static void test_qemu_strtoull_full_max(void) { char *str = g_strdup_printf("%lld", ULLONG_MAX); uint64_t res = 999; int err; err = qemu_strtoull(str, NULL, 0, &res); g_assert_cmpint(err, ==, 0); g_assert_cmpint(res, ==, ULLONG_MAX); g_free(str); }
12,473
0
static void mem_add(MemoryListener *listener, MemoryRegionSection *section) { AddressSpaceDispatch *d = container_of(listener, AddressSpaceDispatch, listener); MemoryRegionSection now = limit(*section), remain = limit(*section); if ((now.offset_within_address_space & ~TARGET_PAGE_MASK) || (now.size < TARGET_PAGE_SIZE))...
12,474