label
int64
0
1
func
stringlengths
21
96.3k
1
bool qvirtio_wait_config_isr(const QVirtioBus *bus, QVirtioDevice *d, uint64_t timeout){ do { clock_step(100); if (bus->get_config_isr_status(d)) { break; /* It has ended */ } } while (--timeout); return timeout != 0;}
1
void serial_exit_core(SerialState *s){ qemu_chr_fe_deinit(&s->chr); qemu_unregister_reset(serial_reset, s);}
0
int ff_nvdec_frame_params(AVCodecContext *avctx, AVBufferRef *hw_frames_ctx, int dpb_size){ AVHWFramesContext *frames_ctx = (AVHWFramesContext*)hw_frames_ctx->data; const AVPixFmtDescriptor *sw_desc; int cuvid_codec_type, cuvid_chroma_format; sw_desc = av_pix_fmt_desc_get(avctx->sw_pix_fmt); if (!sw_desc) return AVERRO...
0
static const char *ass_split_section(ASSSplitContext *ctx, const char *buf){ const ASSSection *section = &ass_sections[ctx->current_section]; int *number = &ctx->field_number[ctx->current_section]; int *order = ctx->field_order[ctx->current_section]; int *tmp, i, len; while (buf && *buf) { if (buf[0] == '[') { ctx->cur...
0
void ff_put_h264_qpel16_mc10_msa(uint8_t *dst, const uint8_t *src, ptrdiff_t stride){ avc_luma_hz_qrt_16w_msa(src - 2, stride, dst, stride, 16, 0);}
1
static void do_memory_save(Monitor *mon, const QDict *qdict, QObject **ret_data){ FILE *f; uint32_t size = qdict_get_int(qdict, "size"); const char *filename = qdict_get_str(qdict, "filename"); target_long addr = qdict_get_int(qdict, "val"); uint32_t l; CPUState *env; uint8_t buf[1024]; env = mon_get_cpu(); if (!env) r...
1
static uint32_t virtio_read_config(PCIDevice *pci_dev, uint32_t address, int len){ VirtIOPCIProxy *proxy = DO_UPCAST(VirtIOPCIProxy, pci_dev, pci_dev); struct virtio_pci_cfg_cap *cfg; if (proxy->config_cap && ranges_overlap(address, len, proxy->config_cap + offsetof(struct virtio_pci_cfg_cap, pci_cfg_data), sizeof cfg-...
1
static struct omap_mcbsp_s *omap_mcbsp_init(MemoryRegion *system_memory, hwaddr base, qemu_irq txirq, qemu_irq rxirq, qemu_irq *dma, omap_clk clk){ struct omap_mcbsp_s *s = (struct omap_mcbsp_s *) g_malloc0(sizeof(struct omap_mcbsp_s)); s->txirq = txirq; s->rxirq = rxirq; s->txdrq = dma[0]; s->rxdrq = dma[1]; s->sink_t...
1
FWCfgState *pc_memory_init(MachineState *machine, MemoryRegion *system_memory, ram_addr_t below_4g_mem_size, ram_addr_t above_4g_mem_size, MemoryRegion *rom_memory, MemoryRegion **ram_memory, PcGuestInfo *guest_info){ int linux_boot, i; MemoryRegion *ram, *option_rom_mr; MemoryRegion *ram_below_4g, *ram_above_4g; FWCfg...
1
static MegasasCmd *megasas_next_frame(MegasasState *s, hwaddr frame){ MegasasCmd *cmd = NULL; int num = 0, index; cmd = megasas_lookup_frame(s, frame); if (cmd) { trace_megasas_qf_found(cmd->index, cmd->pa); return cmd; } index = s->reply_queue_head; num = 0; while (num < s->fw_cmds) { if (!s->frames[index].pa) { cmd =...
1
static int mpegts_audio_write(void *opaque, uint8_t *buf, int size){ MpegTSWriteStream *ts_st = (MpegTSWriteStream *)opaque; if (ts_st->adata_pos + size > ts_st->adata_size) return AVERROR(EIO); memcpy(ts_st->adata + ts_st->adata_pos, buf, size); ts_st->adata_pos += size; return 0;}
1
AVFormatContext *avformat_alloc_context(void){ AVFormatContext *ic; ic = av_malloc(sizeof(AVFormatContext)); if (!ic) return ic; avformat_get_context_defaults(ic); ic->internal = av_mallocz(sizeof(*ic->internal)); if (!ic->internal) { avformat_free_context(ic); return NULL; } return ic;}
1
void gen_intermediate_code(CPUState *cs, struct TranslationBlock *tb){ CPUSH4State *env = cs->env_ptr; DisasContext ctx; target_ulong pc_start; int num_insns; int max_insns; pc_start = tb->pc; ctx.pc = pc_start; ctx.tbflags = (uint32_t)tb->flags; ctx.envflags = tb->flags & TB_FLAG_ENVFLAGS_MASK; ctx.bstate = BS_NONE; c...
1
static void sh_serial_ioport_write(void *opaque, uint32_t offs, uint32_t val){ sh_serial_state *s = opaque; unsigned char ch;#ifdef DEBUG_SERIAL printf("sh_serial: write offs=0x%02x val=0x%02x\n", offs, val);#endif switch(offs) { case 0x00: /* SMR */ s->smr = val & ((s->feat & SH_SERIAL_FEAT_SCIF) ? 0x7b : 0xff); retur...
0
int attribute_align_arg avcodec_encode_audio(AVCodecContext *avctx, uint8_t *buf, int buf_size, const short *samples){ AVPacket pkt; AVFrame frame0 = { 0 }; AVFrame *frame; int ret, samples_size, got_packet; av_init_packet(&pkt); pkt.data = buf; pkt.size = buf_size; if (samples) { frame = &frame0; avcodec_get_frame_def...
1
static int matroska_parse_block(MatroskaDemuxContext *matroska, uint8_t *data, int size, int64_t pos, uint64_t cluster_time, uint64_t block_duration, int is_keyframe, uint8_t *additional, uint64_t additional_id, int additional_size, int64_t cluster_pos){ uint64_t timecode = AV_NOPTS_VALUE; MatroskaTrack *track; int res...
1
static void test_hbitmap_iter_past(TestHBitmapData *data, const void *unused){ hbitmap_test_init(data, L3, 0); hbitmap_test_set(data, 0, L3); hbitmap_test_check(data, L3);}
1
int do_balloon(Monitor *mon, const QDict *params, MonitorCompletion cb, void *opaque){ int ret; if (kvm_enabled() && !kvm_has_sync_mmu()) { qerror_report(QERR_KVM_MISSING_CAP, "synchronous MMU", "balloon"); return -1; } ret = qemu_balloon(qdict_get_int(params, "value"), cb, opaque); if (ret == 0) { qerror_report(QERR_D...
1
static void gif_put_bits_rev(PutBitContext *s, int n, unsigned int value){ unsigned int bit_buf; int bit_cnt; // printf("put_bits=%d %x\n", n, value); assert(n == 32 || value < (1U << n)); bit_buf = s->bit_buf; bit_cnt = 32 - s->bit_left; /* XXX:lazyness... was = s->bit_cnt; */ // printf("n=%d value=%x cnt=%d buf=%x\n"...
1
uint64_t qemu_get_be64(QEMUFile *f){ uint64_t v; v = (uint64_t)qemu_get_be32(f) << 32; v |= qemu_get_be32(f); return v;}
1
static int decode_b_mbs(VC9Context *v){ MpegEncContext *s = &v->s; GetBitContext *gb = &v->s.gb; int current_mb = 0, i /* MB / B postion information */; int b_mv_type = BMV_TYPE_BACKWARD; int mquant, mqdiff; /* MB quant stuff */ int ttmb; /* MacroBlock transform type */ static const int size_table[6] = { 0, 2, 3, 4, 5,...
1
static int ehci_execute(EHCIQueue *q){ USBPort *port; USBDevice *dev; int ret; int i; int endp; int devadr; if ( !(q->qh.token & QTD_TOKEN_ACTIVE)) { fprintf(stderr, "Attempting to execute inactive QH\n"); return USB_RET_PROCERR; } q->tbytes = (q->qh.token & QTD_TOKEN_TBYTES_MASK) >> QTD_TOKEN_TBYTES_SH; if (q->tbytes ...
1
static void powerpc_set_compat(Object *obj, Visitor *v, const char *name, void *opaque, Error **errp){ Error *error = NULL; char *value = NULL; Property *prop = opaque; uint32_t *max_compat = qdev_get_prop_ptr(DEVICE(obj), prop); visit_type_str(v, name, &value, &error); if (error) { error_propagate(errp, error); return...
1
static bool write_header(FILE *fp){ static const TraceRecord header = { .event = HEADER_EVENT_ID, .timestamp_ns = HEADER_MAGIC, .x1 = HEADER_VERSION, }; return fwrite(&header, sizeof header, 1, fp) == 1;}
1
static int encode_mode(CinepakEncContext *s, int h, AVPicture *scratch_pict, AVPicture *last_pict, strip_info *info, unsigned char *buf){ int x, y, z, flags, bits, temp_size, header_ofs, ret = 0, mb_count = s->w * h / MB_AREA; int needs_extra_bit, should_write_temp; unsigned char temp[64]; //32/2 = 16 V4 blocks at 4 B ...
1
void mips_malta_init(MachineState *machine){ ram_addr_t ram_size = machine->ram_size; ram_addr_t ram_low_size; const char *cpu_model = machine->cpu_model; const char *kernel_filename = machine->kernel_filename; const char *kernel_cmdline = machine->kernel_cmdline; const char *initrd_filename = machine->initrd_filename;...
0
static void video_refresh(void *opaque, double *remaining_time){ VideoState *is = opaque; VideoPicture *vp; double time; SubPicture *sp, *sp2; if (!is->paused && get_master_sync_type(is) == AV_SYNC_EXTERNAL_CLOCK && is->realtime) check_external_clock_speed(is); if (!display_disable && is->show_mode != SHOW_MODE_VIDEO &...
0
static void extrapolate_isf(float out[LP_ORDER_16k], float isf[LP_ORDER]){ float diff_isf[LP_ORDER - 2], diff_mean; float *diff_hi = diff_isf - LP_ORDER + 1; // diff array for extrapolated indexes float corr_lag[3]; float est, scale; int i, i_max_corr; memcpy(out, isf, (LP_ORDER - 1) * sizeof(float)); out[LP_ORDER_16k ...
0
static int get_video_private_data(struct VideoFile *vf, AVCodecContext *codec){ AVIOContext *io = NULL; uint16_t sps_size, pps_size; int err = AVERROR(EINVAL); if (codec->codec_id == AV_CODEC_ID_VC1) return get_private_data(vf, codec); avio_open_dyn_buf(&io); if (codec->extradata_size < 11 || codec->extradata[0] != 1) ...
0
static void FUNCC(pred8x8l_horizontal)(uint8_t *p_src, int has_topleft, int has_topright, int p_stride){ pixel *src = (pixel*)p_src; int stride = p_stride>>(sizeof(pixel)-1); PREDICT_8x8_LOAD_LEFT;#define ROW(y) ((pixel4*)(src+y*stride))[0] =\ ((pixel4*)(src+y*stride))[1] = PIXEL_SPLAT_X4(l##y) ROW(0); ROW(1); ROW(2); ...
0
static int dca_parse_params(DCAParseContext *pc1, const uint8_t *buf, int buf_size, int *duration, int *sample_rate, int *profile){ DCAExssAsset *asset = &pc1->exss.assets[0]; GetBitContext gb; DCACoreFrameHeader h; uint8_t hdr[DCA_CORE_FRAME_HEADER_SIZE + AV_INPUT_BUFFER_PADDING_SIZE] = { 0 }; int ret, frame_size; if ...
1
static int ffmmal_fill_input_port(AVCodecContext *avctx){ MMALDecodeContext *ctx = avctx->priv_data; while (ctx->waiting_buffers) { MMAL_BUFFER_HEADER_T *mbuffer; FFBufferEntry *buffer; MMAL_STATUS_T status; mbuffer = mmal_queue_get(ctx->pool_in->queue); if (!mbuffer) return 0; buffer = ctx->waiting_buffers; mmal_buffe...
1
static av_always_inline int decode_mb_row_no_filter(AVCodecContext *avctx, void *tdata, int jobnr, int threadnr, int is_vp7){ VP8Context *s = avctx->priv_data; VP8ThreadData *prev_td, *next_td, *td = &s->thread_data[threadnr]; int mb_y = td->thread_mb_pos >> 16; int mb_x, mb_xy = mb_y * s->mb_width; int num_jobs = s->n...
1
static test_speed(int step){ const struct pix_func* pix = pix_func; const int linesize = 720; char empty[32768]; char* bu =(char*)(((long)empty + 32) & ~0xf); int sum = 0; while (pix->name) {int i; uint64_t te, ts; op_pixels_func func = pix->func;char* im = bu;if (!(pix->mm_flags & mm_flags)) continue;printf("%30s... "...
0
static void writer_print_ts(WriterContext *wctx, const char *key, int64_t ts, int is_duration){ if ((!is_duration && ts == AV_NOPTS_VALUE) || (is_duration && ts == 0)) { writer_print_string(wctx, key, "N/A", 1); } else { writer_print_integer(wctx, key, ts); }}
0
static void ff_h264_idct8_add4_sse2(uint8_t *dst, const int *block_offset, DCTELEM *block, int stride, const uint8_t nnzc[6*8]){ int i; for(i=0; i<16; i+=4){ int nnz = nnzc[ scan8[i] ]; if(nnz){ if(nnz==1 && block[i*16]) ff_h264_idct8_dc_add_mmx2(dst + block_offset[i], block + i*16, stride); else ff_h264_idct8_add_sse2...
0
void ff_avg_h264_qpel16_mc31_msa(uint8_t *dst, const uint8_t *src, ptrdiff_t stride){ avc_luma_hv_qrt_and_aver_dst_16x16_msa(src - 2, src - (stride * 2) + sizeof(uint8_t), stride, dst, stride);}
0
int av_tempfile(char *prefix, char **filename) { int fd=-1;#ifdef __MINGW32__ *filename = tempnam(".", prefix);#else size_t len = strlen(prefix) + 12; /* room for "/tmp/" and "XXXXXX\0" */ *filename = av_malloc(len);#endif /* -----common section-----*/ if (*filename == NULL) { av_log(NULL, AV_LOG_ERROR, "ff_tempfile: C...
0
static av_always_inline void xchg_mb_border(H264Context *h, H264SliceContext *sl, uint8_t *src_y, uint8_t *src_cb, uint8_t *src_cr, int linesize, int uvlinesize, int xchg, int chroma444, int simple, int pixel_shift){ int deblock_topleft; int deblock_top; int top_idx = 1; uint8_t *top_border_m1; uint8_t *top_border; if ...
0
unsigned int codec_get_tag(const CodecTag *tags, int id){ while (tags->id != 0) { if (tags->id == id) return tags->tag; tags++; } return 0;}
1
static int rv34_decode_slice(RV34DecContext *r, int end, const uint8_t* buf, int buf_size){ MpegEncContext *s = &r->s; GetBitContext *gb = &s->gb; int mb_pos; int res; init_get_bits(&r->s.gb, buf, buf_size*8); res = r->parse_slice_header(r, gb, &r->si); if(res < 0){ av_log(s->avctx, AV_LOG_ERROR, "Incorrect or unknown ...
1
static inline void RENAME(bgr24ToUV)(uint8_t *dstU, uint8_t *dstV, uint8_t *src1, uint8_t *src2, int width){#ifdef HAVE_MMXasm volatile("mov %4, %%"REG_a"\n\t""movq "MANGLE(w1111)", %%mm5\n\t""movq "MANGLE(bgr2UCoeff)", %%mm6\n\t""pxor %%mm7, %%mm7\n\t""lea (%%"REG_a", %%"REG_a", 2), %%"REG_b"\n\t""add %%"REG_b", %%"RE...
1
static size_t pdu_marshal(V9fsPDU *pdu, size_t offset, const char *fmt, ...){ size_t old_offset = offset; va_list ap; int i; va_start(ap, fmt); for (i = 0; fmt[i]; i++) { switch (fmt[i]) { case 'b': { uint8_t val = va_arg(ap, int); offset += pdu_pack(pdu, offset, &val, sizeof(val)); break; } case 'w': { uint16_t val; c...
1
static inline uint32_t celt_icwrsi(uint32_t N, uint32_t K, const int *y){ int i, idx = 0, sum = 0; for (i = N - 1; i >= 0; i--) { const uint32_t i_s = CELT_PVQ_U(N - i, sum + FFABS(y[i]) + 1); idx += CELT_PVQ_U(N - i, sum) + (y[i] < 0)*i_s; sum += FFABS(y[i]); } av_assert0(sum == K); return idx;}
1
static int matroska_read_header(AVFormatContext *s, AVFormatParameters *ap){ MatroskaDemuxContext *matroska = s->priv_data; EbmlList *attachements_list = &matroska->attachments; MatroskaAttachement *attachements; EbmlList *chapters_list = &matroska->chapters; MatroskaChapter *chapters; MatroskaTrack *tracks; EbmlList *...
1
static int vp8_decode_frame_header(VP8Context *s, const uint8_t *buf, int buf_size){ VP56RangeCoder *c = &s->c; int header_size, hscale, vscale, ret; int width = s->avctx->width; int height = s->avctx->height; s->keyframe = !(buf[0] & 1); s->profile = (buf[0]>>1) & 7; s->invisible = !(buf[0] & 0x10); header_size = AV_R...
1
static float voice_factor(float *p_vector, float p_gain, float *f_vector, float f_gain, CELPMContext *ctx){ double p_ener = (double) ctx->dot_productf(p_vector, p_vector, AMRWB_SFR_SIZE) * p_gain * p_gain; double f_ener = (double) ctx->dot_productf(f_vector, f_vector, AMRWB_SFR_SIZE) * f_gain * f_gain; return (p_ener -...
1
static int qcrypto_cipher_setiv_aes(QCryptoCipher *cipher, const uint8_t *iv, size_t niv, Error **errp){ QCryptoCipherBuiltin *ctxt = cipher->opaque; if (niv != 16) { error_setg(errp, "IV must be 16 bytes not %zu", niv); return -1; } g_free(ctxt->state.aes.iv); ctxt->state.aes.iv = g_new0(uint8_t, niv); memcpy(ctxt->st...
1
int ff_jpegls_decode_picture(MJpegDecodeContext *s, int near, int point_transform, int ilv){ int i, t = 0; uint8_t *zero, *last, *cur; JLSState *state; int off = 0, stride = 1, width, shift, ret = 0; zero = av_mallocz(s->picture_ptr->linesize[0]); if (!zero) return AVERROR(ENOMEM); last = zero; cur = s->picture_ptr->da...
1
static void create_gic(const VirtBoardInfo *vbi, qemu_irq *pic){ /* We create a standalone GIC v2 */ DeviceState *gicdev; SysBusDevice *gicbusdev; const char *gictype = "arm_gic"; int i; if (kvm_irqchip_in_kernel()) { gictype = "kvm-arm-gic"; } gicdev = qdev_create(NULL, gictype); qdev_prop_set_uint32(gicdev, "revision...
1
virtio_crypto_sym_op_helper(VirtIODevice *vdev, struct virtio_crypto_cipher_para *cipher_para, struct virtio_crypto_alg_chain_data_para *alg_chain_para, struct iovec *iov, unsigned int out_num){ VirtIOCrypto *vcrypto = VIRTIO_CRYPTO(vdev); CryptoDevBackendSymOpInfo *op_info; uint32_t src_len = 0, dst_len = 0; uint32_t ...
1
int net_slirp_parse_legacy(QemuOptsList *opts_list, const char *optarg, int *ret){ if (strcmp(opts_list->name, "net") != 0 || strncmp(optarg, "channel,", strlen("channel,")) != 0) { return 0; } error_report("The '-net channel' option is deprecated. " "Please use '-netdev user,guestfwd=...' instead."); /* handle legacy ...
1
static int shall_we_drop(AVFormatContext *s){ struct dshow_ctx *ctx = s->priv_data; static const uint8_t dropscore[] = {62, 75, 87, 100}; const int ndropscores = FF_ARRAY_ELEMS(dropscore); unsigned int buffer_fullness = (ctx->curbufsize*100)/s->max_picture_buffer; if(dropscore[++ctx->video_frame_num%ndropscores] <= buf...
1
static int disas_dsp_insn(CPUState *env, DisasContext *s, uint32_t insn){ int acc, rd0, rd1, rdhi, rdlo; TCGv tmp, tmp2; if ((insn & 0x0ff00f10) == 0x0e200010) { /* Multiply with Internal Accumulate Format */ rd0 = (insn >> 12) & 0xf; rd1 = insn & 0xf; acc = (insn >> 5) & 7; if (acc != 0) return 1; tmp = load_reg(s, rd...
1
static void decode_profile_tier_level(HEVCContext *s, PTLCommon *ptl){ int i; HEVCLocalContext *lc = s->HEVClc; GetBitContext *gb = &lc->gb; ptl->profile_space = get_bits(gb, 2); ptl->tier_flag = get_bits1(gb); ptl->profile_idc = get_bits(gb, 5); if (ptl->profile_idc == FF_PROFILE_HEVC_MAIN) av_log(s->avctx, AV_LOG_DEB...
1
qemu_irq *mpic_init (target_phys_addr_t base, int nb_cpus, qemu_irq **irqs, qemu_irq irq_out){ openpic_t *mpp; int i; struct { CPUReadMemoryFunc * const *read; CPUWriteMemoryFunc * const *write; target_phys_addr_t start_addr; ram_addr_t size; } const list[] = { {mpic_glb_read, mpic_glb_write, MPIC_GLB_REG_START, MPIC_G...
1
static void float_to_int16_stride_altivec(int16_t *dst, const float *src, long len, int stride){ int i, j; vector signed short d, s; for (i = 0; i < len - 7; i += 8) { d = float_to_int16_one_altivec(src + i); for (j = 0; j < 8; j++) { s = vec_splat(d, j); vec_ste(s, 0, dst); dst += stride; } }}
1
ssize_t iov_send_recv(int sockfd, struct iovec *iov, size_t offset, size_t bytes, bool do_sendv){ int iovlen; ssize_t ret; size_t diff; struct iovec *last_iov; /* last_iov is inclusive, so count from one. */ iovlen = 1; last_iov = iov; bytes += offset; while (last_iov->iov_len < bytes) { bytes -= last_iov->iov_len; las...
1
static long do_rt_sigreturn_v2(CPUARMState *env){ abi_ulong frame_addr; struct rt_sigframe_v2 *frame = NULL; /* * Since we stacked the signal on a 64-bit boundary, * then 'sp' should be word aligned here. If it's * not, then the user is trying to mess with us. */ frame_addr = env->regs[13]; trace_user_do_rt_sigreturn(e...
1
static void vp8_h_loop_filter_simple_c(uint8_t *dst, ptrdiff_t stride, int flim){ int i; for (i = 0; i < 16; i++) if (simple_limit(dst + i * stride, 1, flim)) filter_common(dst + i * stride, 1, 1);}
1
static void gain_scale(G723_1_Context *p, int16_t * buf, int energy){ int num, denom, gain, bits1, bits2; int i; num = energy; denom = 0; for (i = 0; i < SUBFRAME_LEN; i++) { int64_t temp = buf[i] >> 2; temp = av_clipl_int32(MUL64(temp, temp) << 1); denom = av_clipl_int32(denom + temp); } if (num && denom) { bits1 = no...
1
void OPPROTO op_store_msr_32 (void){ ppc_store_msr_32(env, T0); RETURN();}
1
int s390_cpu_handle_mmu_fault(CPUState *cs, vaddr orig_vaddr, int rw, int mmu_idx){ S390CPU *cpu = S390_CPU(cs); CPUS390XState *env = &cpu->env; uint64_t asc = cpu_mmu_idx_to_asc(mmu_idx); target_ulong vaddr, raddr; int prot; DPRINTF("%s: address 0x%" VADDR_PRIx " rw %d mmu_idx %d\n", __func__, orig_vaddr, rw, mmu_idx)...
1
static int ffm_seek(AVFormatContext *s, int stream_index, int64_t wanted_pts, int flags){ FFMContext *ffm = s->priv_data; int64_t pos_min, pos_max, pos; int64_t pts_min, pts_max, pts; double pos1; av_dlog(s, "wanted_pts=%0.6f\n", wanted_pts / 1000000.0); /* find the position using linear interpolation (better than dich...
1
static void openpic_load_IRQ_queue(QEMUFile* f, IRQ_queue_t *q){ unsigned int i; for (i = 0; i < BF_WIDTH(MAX_IRQ); i++) qemu_get_be32s(f, &q->queue[i]); qemu_get_sbe32s(f, &q->next); qemu_get_sbe32s(f, &q->priority);}
0
static void rtas_set_time_of_day(sPAPREnvironment *spapr, uint32_t token, uint32_t nargs, target_ulong args, uint32_t nret, target_ulong rets){ struct tm tm; tm.tm_year = rtas_ld(args, 0) - 1900; tm.tm_mon = rtas_ld(args, 1) - 1; tm.tm_mday = rtas_ld(args, 2); tm.tm_hour = rtas_ld(args, 3); tm.tm_min = rtas_ld(args, 4)...
0
void virtqueue_map(VirtIODevice *vdev, VirtQueueElement *elem){ virtqueue_map_iovec(vdev, elem->in_sg, elem->in_addr, &elem->in_num, MIN(ARRAY_SIZE(elem->in_sg), ARRAY_SIZE(elem->in_addr)), 1); virtqueue_map_iovec(vdev, elem->out_sg, elem->out_addr, &elem->out_num, MIN(ARRAY_SIZE(elem->out_sg), ARRAY_SIZE(elem->out_add...
0
static int qed_write_header_sync(BDRVQEDState *s){ QEDHeader le; int ret; qed_header_cpu_to_le(&s->header, &le); ret = bdrv_pwrite(s->bs->file, 0, &le, sizeof(le)); if (ret != sizeof(le)) { return ret; } return 0;}
0
int v9fs_device_realize_common(V9fsState *s, Error **errp){ V9fsVirtioState *v = container_of(s, V9fsVirtioState, state); int i, len; struct stat stat; FsDriverEntry *fse; V9fsPath path; int rc = 1; /* initialize pdu allocator */ QLIST_INIT(&s->free_list); QLIST_INIT(&s->active_list); for (i = 0; i < (MAX_REQ - 1); i++...
0
static void pc_compat_1_6(MachineState *machine){ pc_compat_1_7(machine); rom_file_has_mr = false; has_acpi_build = false;}
0
static void __attribute__((destructor)) coroutine_cleanup(void){ Coroutine *co; Coroutine *tmp; QSLIST_FOREACH_SAFE(co, &pool, pool_next, tmp) { QSLIST_REMOVE_HEAD(&pool, pool_next); qemu_coroutine_delete(co); }}
0
int qemu_acl_party_is_allowed(qemu_acl *acl, const char *party){ qemu_acl_entry *entry; TAILQ_FOREACH(entry, &acl->entries, next) {#ifdef CONFIG_FNMATCH if (fnmatch(entry->match, party, 0) == 0) return entry->deny ? 0 : 1;#else /* No fnmatch, so fallback to exact string matching * instead of allowing wildcards */ if (s...
0
static void tcg_out_ld_abs(TCGContext *s, TCGType type, TCGReg dest, void *abs){ intptr_t addr = (intptr_t)abs; if ((facilities & FACILITY_GEN_INST_EXT) && !(addr & 1)) { ptrdiff_t disp = tcg_pcrel_diff(s, abs) >> 1; if (disp == (int32_t)disp) { if (type == TCG_TYPE_I32) { tcg_out_insn(s, RIL, LRL, dest, disp); } else ...
0
static void v9fs_wstat(void *opaque){ int32_t fid; int err = 0; int16_t unused; V9fsStat v9stat; size_t offset = 7; struct stat stbuf; V9fsFidState *fidp; V9fsPDU *pdu = opaque; V9fsState *s = pdu->s; pdu_unmarshal(pdu, offset, "dwS", &fid, &unused, &v9stat); trace_v9fs_wstat(pdu->tag, pdu->id, fid, v9stat.mode, v9stat...
0
static void drive_backup_prepare(BlkTransactionState *common, Error **errp){ DriveBackupState *state = DO_UPCAST(DriveBackupState, common, common); BlockBackend *blk; DriveBackup *backup; Error *local_err = NULL; assert(common->action->kind == TRANSACTION_ACTION_KIND_DRIVE_BACKUP); backup = common->action->drive_backup...
0
void helper_ltr_T0(void){ int selector; SegmentCache *dt; uint32_t e1, e2; int index, type, entry_limit; target_ulong ptr; selector = T0 & 0xffff; if ((selector & 0xfffc) == 0) { /* NULL selector case: invalid TR */ env->tr.base = 0; env->tr.limit = 0; env->tr.flags = 0; } else { if (selector & 0x4) raise_exception_err...
0
static void uhci_async_cancel_device(UHCIState *s, USBDevice *dev){ UHCIQueue *queue; UHCIAsync *curr, *n; QTAILQ_FOREACH(queue, &s->queues, next) { QTAILQ_FOREACH_SAFE(curr, &queue->asyncs, next, n) { if (!usb_packet_is_inflight(&curr->packet) || curr->packet.ep->dev != dev) { continue; } uhci_async_cancel(curr); } }}
0
static int dnxhd_decode_macroblock(DNXHDContext *ctx, AVFrame *frame, int x, int y){ int shift1 = ctx->bit_depth == 10; int dct_linesize_luma = frame->linesize[0]; int dct_linesize_chroma = frame->linesize[1]; uint8_t *dest_y, *dest_u, *dest_v; int dct_y_offset, dct_x_offset; int qscale, i; qscale = get_bits(&ctx->gb, ...
0
static void apply_loop_filter(Vp3DecodeContext *s){ int x, y, plane; int width, height; int fragment; int stride; unsigned char *plane_data; int bounding_values_array[256]; int *bounding_values= bounding_values_array+127; int filter_limit; /* find the right loop limit value */ for (x = 63; x >= 0; x--) { if (vp31_ac_sc...
0
static int vt82c686b_ide_initfn(PCIDevice *dev){ PCIIDEState *d = DO_UPCAST(PCIIDEState, dev, dev);; uint8_t *pci_conf = d->dev.config; pci_config_set_vendor_id(pci_conf, PCI_VENDOR_ID_VIA); pci_config_set_device_id(pci_conf, PCI_DEVICE_ID_VIA_IDE); pci_config_set_class(pci_conf, PCI_CLASS_STORAGE_IDE); pci_config_set_...
0
void set_numa_modes(void){ CPUArchState *env; int i; for (env = first_cpu; env != NULL; env = env->next_cpu) { for (i = 0; i < nb_numa_nodes; i++) { if (node_cpumask[i] & (1 << env->cpu_index)) { env->numa_node = i; } } }}
0
static void omap_mcbsp_writew(void *opaque, hwaddr addr, uint32_t value){ struct omap_mcbsp_s *s = (struct omap_mcbsp_s *) opaque; int offset = addr & OMAP_MPUI_REG_MASK; if (offset == 0x04) {/* DXR */ if (((s->xcr[0] >> 5) & 7) < 3)/* XWDLEN1 */ return; if (s->tx_req > 3) { s->tx_req -= 4; if (s->codec && s->codec->ct...
0
static void fcse_write(CPUARMState *env, const ARMCPRegInfo *ri, uint64_t value){ ARMCPU *cpu = arm_env_get_cpu(env); if (env->cp15.c13_fcse != value) { /* Unlike real hardware the qemu TLB uses virtual addresses, * not modified virtual addresses, so this causes a TLB flush. */ tlb_flush(CPU(cpu), 1); env->cp15.c13_fcs...
0
static void bw_io_write(void *opaque, target_phys_addr_t addr, uint64_t val, unsigned size){ switch (size) { case 1: cpu_outb(addr, val); break; case 2: cpu_outw(addr, val); break; case 4: cpu_outl(addr, val); break; default: abort(); }}
0
static void check_watchpoint(int offset, int len, int flags){ CPUState *cpu = current_cpu; CPUArchState *env = cpu->env_ptr; target_ulong pc, cs_base; target_ulong vaddr; CPUWatchpoint *wp; int cpu_flags; if (cpu->watchpoint_hit) { /* We re-entered the check after replacing the TB. Now raise * the debug interrupt so th...
0
static void *qpa_thread_in (void *arg){ PAVoiceIn *pa = arg; HWVoiceIn *hw = &pa->hw; int threshold; threshold = conf.divisor ? hw->samples / conf.divisor : 0; if (audio_pt_lock (&pa->pt, AUDIO_FUNC)) { return NULL; } for (;;) { int incr, to_grab, wpos; for (;;) { if (pa->done) { goto exit; } if (pa->dead > threshold) ...
0
void check_file_unfixed_eof_mmaps(void){char *cp;unsigned int *p1;uintptr_t p;int i;fprintf (stderr, "%s", __func__);for (i = 0; i < 0x10; i++){p1 = mmap(NULL, pagesize, PROT_READ, MAP_PRIVATE, test_fd, (test_fsize - sizeof *p1) & ~pagemask);fail_unless (p1 != MAP_FAILED);/* Make sure we get pages aligned with the page...
0
static int64_t update_scr(AVFormatContext *ctx,int stream_index,int64_t pts){ MpegMuxContext *s = ctx->priv_data; int64_t scr; if (s->is_vcd) /* Since the data delivery rate is constant, SCR is computed using the formula C + i * 1200 where C is the start constant and i is the pack index. It is recommended that SCR 0 is...
0
static int decode_micromips_opc (CPUMIPSState *env, DisasContext *ctx){ uint32_t op; /* make sure instructions are on a halfword boundary */ if (ctx->pc & 0x1) { env->CP0_BadVAddr = ctx->pc; generate_exception(ctx, EXCP_AdEL); ctx->bstate = BS_STOP; return 2; } op = (ctx->opcode >> 10) & 0x3f; /* Enforce properly-sized...
0
static void ratelimit_set_speed(RateLimit *limit, uint64_t speed){ limit->slice_quota = speed / (1000000000ULL / SLICE_TIME);}
0
static void tap_update_fd_handler(TAPState *s){ qemu_set_fd_handler2(s->fd, s->read_poll && s->enabled ? tap_can_send : NULL, s->read_poll && s->enabled ? tap_send : NULL, s->write_poll && s->enabled ? tap_writable : NULL, s);}
0
static void pc_init1(ram_addr_t ram_size, const char *boot_device, const char *kernel_filename, const char *kernel_cmdline, const char *initrd_filename, const char *cpu_model, int pci_enabled){ char *filename; int ret, linux_boot, i; ram_addr_t ram_addr, bios_offset, option_rom_offset; ram_addr_t below_4g_mem_size, abo...
0
static void dec_mul(DisasContext *dc){ TCGv d[2]; unsigned int subcode; if ((dc->tb_flags & MSR_EE_FLAG) && !(dc->env->pvr.regs[2] & PVR2_ILL_OPCODE_EXC_MASK) && !(dc->env->pvr.regs[0] & PVR0_USE_HW_MUL_MASK)) { tcg_gen_movi_tl(cpu_SR[SR_ESR], ESR_EC_ILLEGAL_OP); t_gen_raise_exception(dc, EXCP_HW_EXCP); return; } subco...
0
static void fimd_update_memory_section(Exynos4210fimdState *s, unsigned win){ Exynos4210fimdWindow *w = &s->window[win]; target_phys_addr_t fb_start_addr, fb_mapped_len; if (!s->enabled || !(w->wincon & FIMD_WINCON_ENWIN) || FIMD_WINDOW_PROTECTED(s->shadowcon, win)) { return; } if (w->host_fb_addr) { cpu_physical_memor...
0
PCIDevice *pci_try_create_multifunction(PCIBus *bus, int devfn, bool multifunction, const char *name){ DeviceState *dev; dev = qdev_try_create(&bus->qbus, name); if (!dev) { return NULL; } qdev_prop_set_uint32(dev, "addr", devfn); qdev_prop_set_bit(dev, "multifunction", multifunction); return DO_UPCAST(PCIDevice, qdev,...
0
void OPPROTO op_addq_ESI_T0(void){ ESI = (ESI + T0);}
0
static int mov_write_trailer(AVFormatContext *s){ MOVMuxContext *mov = s->priv_data; AVIOContext *pb = s->pb; int res = 0; int i; int64_t moov_pos; /* * Before actually writing the trailer, make sure that there are no * dangling subtitles, that need a terminating sample. */ for (i = 0; i < mov->nb_streams; i++) { MOVTr...
0
static void acquire_privilege(const char *name, Error **errp){ HANDLE token = NULL; TOKEN_PRIVILEGES priv; Error *local_err = NULL; if (OpenProcessToken(GetCurrentProcess(), TOKEN_ADJUST_PRIVILEGES|TOKEN_QUERY, &token)) { if (!LookupPrivilegeValue(NULL, name, &priv.Privileges[0].Luid)) { error_setg(&local_err, QERR_QGA...
0
static int aio_write_f(int argc, char **argv){ int nr_iov, c; int pattern = 0xcd; struct aio_ctx *ctx = calloc(1, sizeof(struct aio_ctx)); while ((c = getopt(argc, argv, "CqP:")) != EOF) { switch (c) { case 'C': ctx->Cflag = 1; break; case 'q': ctx->qflag = 1; break; case 'P': pattern = parse_pattern(optarg); if (patte...
0
void tlb_set_page(CPUState *cpu, target_ulong vaddr, hwaddr paddr, int prot, int mmu_idx, target_ulong size){ CPUArchState *env = cpu->env_ptr; MemoryRegionSection *section; unsigned int index; target_ulong address; target_ulong code_address; uintptr_t addend; CPUTLBEntry *te; hwaddr iotlb, xlat, sz; assert(size >= TAR...