label
int64
0
1
func1
stringlengths
23
97k
id
int64
0
27.3k
0
static bool get_phys_addr(CPUARMState *env, target_ulong address, MMUAccessType access_type, ARMMMUIdx mmu_idx, hwaddr *phys_ptr, MemTxAttrs *attrs, int *prot, target_ulong *page_size, uint32_t *fsr, ARMMMUFaultInfo *fi) { if (mmu_idx == ARMMMUIdx_S12NSE0 || mmu_idx == ARMMMUIdx_S12NSE1) { /* Call ourselves recursively...
21,615
0
void bdrv_error_action(BlockDriverState *bs, BlockErrorAction action, bool is_read, int error) { assert(error >= 0); if (action == BLOCK_ERROR_ACTION_STOP) { /* First set the iostatus, so that "info block" returns an iostatus * that matches the events raised so far (an additional error iostatus * is fine, but not a los...
21,616
0
static void ide_atapi_cmd_reply(IDEState *s, int size, int max_size) { if (size > max_size) size = max_size; s->lba = -1; /* no sector read */ s->packet_transfer_size = size; s->io_buffer_size = size; /* dma: send the reply data as one chunk */ s->elementary_transfer_size = 0; s->io_buffer_index = 0; if (s->atapi_dma) ...
21,617
0
static int stream_component_open(VideoState *is, int stream_index) { AVFormatContext *ic = is->ic; AVCodecContext *enc; AVCodec *codec; SDL_AudioSpec wanted_spec, spec; if (stream_index < 0 || stream_index >= ic->nb_streams) return -1; enc = ic->streams[stream_index]->codec; /* prepare audio output */ if (enc->codec_ty...
21,618
0
void qemu_set_version(const char *version) { qemu_version = version; }
21,620
0
tcg_target_ulong tcg_qemu_tb_exec(CPUArchState *env, uint8_t *tb_ptr) { tcg_target_ulong next_tb = 0; tci_reg[TCG_AREG0] = (tcg_target_ulong)env; assert(tb_ptr); for (;;) { #if defined(GETPC) tci_tb_ptr = (uintptr_t)tb_ptr; #endif TCGOpcode opc = tb_ptr[0]; #if !defined(NDEBUG) uint8_t op_size = tb_ptr[1]; uint8_t *old...
21,623
0
static void do_commit(void) { int i; for (i = 0; i < MAX_DISKS; i++) { if (bs_table[i]) bdrv_commit(bs_table[i]); } }
21,624
0
static int v9fs_do_mknod(V9fsState *s, V9fsString *path, mode_t mode, dev_t dev) { return s->ops->mknod(&s->ctx, path->data, mode, dev); }
21,625
0
static uint64_t g364fb_ctrl_read(void *opaque, target_phys_addr_t addr, unsigned int size) { G364State *s = opaque; uint32_t val; if (addr >= REG_CURS_PAT && addr < REG_CURS_PAT + 0x1000) { /* cursor pattern */ int idx = (addr - REG_CURS_PAT) >> 3; val = s->cursor[idx]; } else if (addr >= REG_CURS_PAL && addr < REG_CUR...
21,626
0
static void vncws_send_handshake_response(VncState *vs, const char* key) { char combined_key[WS_CLIENT_KEY_LEN + WS_GUID_LEN + 1]; unsigned char hash[SHA1_DIGEST_LEN]; size_t hash_size = sizeof(hash); char *accept = NULL, *response = NULL; gnutls_datum_t in; int ret; g_strlcpy(combined_key, key, WS_CLIENT_KEY_LEN + 1);...
21,628
0
av_cold int ff_ffv1_init_slice_state(FFV1Context *f, FFV1Context *fs) { int j; fs->plane_count = f->plane_count; fs->transparency = f->transparency; for (j = 0; j < f->plane_count; j++) { PlaneContext *const p = &fs->plane[j]; if (fs->ac) { if (!p->state) p->state = av_malloc_array(p->context_count, CONTEXT_SIZE * size...
21,629
0
static void spitz_init(int ram_size, int vga_ram_size, int boot_device, DisplayState *ds, const char **fd_filename, int snapshot, const char *kernel_filename, const char *kernel_cmdline, const char *initrd_filename, const char *cpu_model) { spitz_common_init(ram_size, vga_ram_size, ds, kernel_filename, kernel_cmdline, ...
21,630
1
static int vcr1_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; VCR1Context *const a = avctx->priv_data; AVFrame *const p = data; const uint8_t *bytestream = buf; int i, x, y, ret; if ((ret = ff_get_buffer(avctx, p, 0)) < 0...
21,631
1
long disas_insn(DisasContext *s, uint8_t *pc_start) { int b, prefixes, aflag, dflag; int shift, ot; int modrm, reg, rm, mod, reg_addr, op, opreg, offset_addr, val; unsigned int next_eip; s->pc = pc_start; prefixes = 0; aflag = s->code32; dflag = s->code32; s->override = -1; next_byte: b = ldub(s->pc); s->pc++; /* check...
21,632
1
static void xhci_process_commands(XHCIState *xhci) { XHCITRB trb; TRBType type; XHCIEvent event = {ER_COMMAND_COMPLETE, CC_SUCCESS}; dma_addr_t addr; unsigned int i, slotid = 0; DPRINTF("xhci_process_commands()\n"); if (!xhci_running(xhci)) { DPRINTF("xhci_process_commands() called while xHC stopped or paused\n"); retu...
21,634
1
void cpu_loop(CPUTLGState *env) { CPUState *cs = CPU(tilegx_env_get_cpu(env)); int trapnr; while (1) { cpu_exec_start(cs); trapnr = cpu_tilegx_exec(cs); cpu_exec_end(cs); switch (trapnr) { case TILEGX_EXCP_SYSCALL: env->regs[TILEGX_R_RE] = do_syscall(env, env->regs[TILEGX_R_NR], env->regs[0], env->regs[1], env->regs[2]...
21,635
1
sofree(struct socket *so) { Slirp *slirp = so->slirp; struct mbuf *ifm; for (ifm = (struct mbuf *) slirp->if_fastq.qh_link; (struct quehead *) ifm != &slirp->if_fastq; ifm = ifm->ifq_next) { if (ifm->ifq_so == so) { ifm->ifq_so = NULL; for (ifm = (struct mbuf *) slirp->if_batchq.qh_link; (struct quehead *) ifm != &slir...
21,636
1
static void close_slave(TeeSlave *tee_slave) { AVFormatContext *avf; unsigned i; avf = tee_slave->avf; for (i = 0; i < avf->nb_streams; ++i) { AVBitStreamFilterContext *bsf_next, *bsf = tee_slave->bsfs[i]; while (bsf) { bsf_next = bsf->next; av_bitstream_filter_close(bsf); bsf = bsf_next; } } av_freep(&tee_slave->strea...
21,637
1
static int ac3_decode_frame(AVCodecContext * avctx, void *data, int *got_frame_ptr, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; AC3DecodeContext *s = avctx->priv_data; int blk, ch, err, ret; const uint8_t *channel_map; const float *output[AC3_MAX_CHANNELS]; /* copy input buffer to d...
21,638
0
static int ffserver_parse_config_global(FFServerConfig *config, const char *cmd, const char **p, int line_num) { int val; char arg[1024]; if (!av_strcasecmp(cmd, "Port") || !av_strcasecmp(cmd, "HTTPPort")) { if (!av_strcasecmp(cmd, "Port")) WARNING("Port option is deprecated, use HTTPPort instead\n"); ffserver_get_arg(...
21,639
0
int ff_h264_fill_default_ref_list(H264Context *h) { int i, len; if (h->slice_type_nos == AV_PICTURE_TYPE_B) { Picture *sorted[32]; int cur_poc, list; int lens[2]; if (FIELD_PICTURE(h)) cur_poc = h->cur_pic_ptr->field_poc[h->picture_structure == PICT_BOTTOM_FIELD]; else cur_poc = h->cur_pic_ptr->poc; for (list = 0; list...
21,640
1
static int check_strtox_error(const char *p, char *endptr, const char **next, int err) { /* If no conversion was performed, prefer BSD behavior over glibc * behavior. */ if (err == 0 && endptr == p) { err = EINVAL; } if (!next && *endptr) { return -EINVAL; } if (next) { *next = endptr; } return -err; }
21,642
1
static void ram_decompress_close(RamDecompressState *s) { inflateEnd(&s->zstream); }
21,643
1
static void ahci_hba_enable(AHCIQState *ahci) { /* Bits of interest in this section: * GHC.AE Global Host Control / AHCI Enable * PxCMD.ST Port Command: Start * PxCMD.SUD "Spin Up Device" * PxCMD.POD "Power On Device" * PxCMD.FRE "FIS Receive Enable" * PxCMD.FR "FIS Receive Running" * PxCMD.CR "Command List Running" */...
21,644
1
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] >>...
21,645
1
void *kqemu_vmalloc(size_t size) { static int phys_ram_fd = -1; static int phys_ram_size = 0; const char *tmpdir; char phys_ram_file[1024]; void *ptr; struct statfs stfs; if (phys_ram_fd < 0) { tmpdir = getenv("QEMU_TMPDIR"); if (!tmpdir) tmpdir = "/dev/shm"; if (statfs(tmpdir, &stfs) == 0) { int64_t free_space; int ra...
21,646
1
static uint64_t qvirtio_pci_config_readq(QVirtioDevice *d, uint64_t off) { QVirtioPCIDevice *dev = (QVirtioPCIDevice *)d; uint64_t val; val = qpci_io_readq(dev->pdev, CONFIG_BASE(dev) + off); if (qvirtio_is_big_endian(d)) { val = bswap64(val); } return val; }
21,647
1
void video_decode_example(const char *outfilename, const char *filename) { AVCodec *codec; AVCodecContext *c= NULL; int frame, size, got_picture, len; FILE *f; AVFrame *picture; uint8_t inbuf[INBUF_SIZE + FF_INPUT_BUFFER_PADDING_SIZE], *inbuf_ptr; char buf[1024]; /* set end of buffer to 0 (this ensures that no overread...
21,648
1
static int rebuild_refcount_structure(BlockDriverState *bs, BdrvCheckResult *res, uint16_t **refcount_table, int64_t *nb_clusters) { BDRVQcowState *s = bs->opaque; int64_t first_free_cluster = 0, reftable_offset = -1, cluster = 0; int64_t refblock_offset, refblock_start, refblock_index; uint32_t reftable_size = 0; uint...
21,649
1
static void vp8_idct_dc_add4uv_c(uint8_t *dst, int16_t block[4][16], ptrdiff_t stride) { vp8_idct_dc_add_c(dst + stride * 0 + 0, block[0], stride); vp8_idct_dc_add_c(dst + stride * 0 + 4, block[1], stride); vp8_idct_dc_add_c(dst + stride * 4 + 0, block[2], stride); vp8_idct_dc_add_c(dst + stride * 4 + 4, block[3], stri...
21,650
1
static void fw_cfg_mem_class_init(ObjectClass *klass, void *data) { DeviceClass *dc = DEVICE_CLASS(klass); dc->realize = fw_cfg_mem_realize; dc->props = fw_cfg_mem_properties; }
21,651
1
int xen_pt_msix_init(XenPCIPassthroughState *s, uint32_t base) { uint8_t id = 0; uint16_t control = 0; uint32_t table_off = 0; int i, total_entries, bar_index; XenHostPCIDevice *hd = &s->real_device; PCIDevice *d = &s->dev; int fd = -1; XenPTMSIX *msix = NULL; int rc = 0; rc = xen_host_pci_get_byte(hd, base + PCI_CAP_L...
21,652
1
static int64_t archipelago_volume_info(BDRVArchipelagoState *s) { uint64_t size; int ret, targetlen; struct xseg_request *req; struct xseg_reply_info *xinfo; AIORequestData *reqdata = g_malloc(sizeof(AIORequestData)); const char *volname = s->volname; targetlen = strlen(volname); req = xseg_get_request(s->xseg, s->srcp...
21,653
1
static void openpic_set_irq(void *opaque, int n_IRQ, int level) { OpenPICState *opp = opaque; IRQSource *src; src = &opp->src[n_IRQ]; DPRINTF("openpic: set irq %d = %d ipvp=%08x\n", n_IRQ, level, src->ipvp); if (src->ipvp & IPVP_SENSE_MASK) { /* level-sensitive irq */ src->pending = level; if (!level) { src->ipvp &= ~I...
21,654
1
static int libschroedinger_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; int64_t pts = avpkt->pts; SchroTag *tag; SchroDecoderParams *p_schro_params = avctx->priv_data; SchroDecoder *decoder = p_schro_params->decoder; Sch...
21,655
1
static void qemu_tcg_wait_io_event(CPUState *cpu) { while (all_cpu_threads_idle()) { stop_tcg_kick_timer(); qemu_cond_wait(cpu->halt_cond, &qemu_global_mutex); } start_tcg_kick_timer(); CPU_FOREACH(cpu) { qemu_wait_io_event_common(cpu); } }
21,656
1
TCGOp *tcg_op_insert_after(TCGContext *s, TCGOp *old_op, TCGOpcode opc, int nargs) { int oi = s->gen_next_op_idx; int prev = old_op - s->gen_op_buf; int next = old_op->next; TCGOp *new_op; tcg_debug_assert(oi < OPC_BUF_SIZE); s->gen_next_op_idx = oi + 1; new_op = &s->gen_op_buf[oi]; *new_op = (TCGOp){ .opc = opc, .prev...
21,657
1
static inline bool check_lba_range(SCSIDiskState *s, uint64_t sector_num, uint32_t nb_sectors) { /* * The first line tests that no overflow happens when computing the last * sector. The second line tests that the last accessed sector is in * range. */ return (sector_num <= sector_num + nb_sectors && sector_num + nb_sec...
21,658
0
static av_cold int rv30_decode_init(AVCodecContext *avctx) { RV34DecContext *r = avctx->priv_data; int ret; r->rv30 = 1; if ((ret = ff_rv34_decode_init(avctx)) < 0) return ret; if(avctx->extradata_size < 2){ av_log(avctx, AV_LOG_ERROR, "Extradata is too small.\n"); return -1; } r->rpr = (avctx->extradata[1] & 7) >> 1; ...
21,659
0
static int jpeg2000_decode_packets_po_iteration(Jpeg2000DecoderContext *s, Jpeg2000Tile *tile, int RSpoc, int CSpoc, int LYEpoc, int REpoc, int CEpoc, int Ppoc) { int ret = 0; int layno, reslevelno, compno, precno, ok_reslevel; int x, y; int tp_index = 0; int step_x, step_y; switch (Ppoc) { case JPEG2000_PGOD_RLCP: av_...
21,660
0
static av_cold int vmdaudio_decode_init(AVCodecContext *avctx) { VmdAudioContext *s = avctx->priv_data; if (avctx->channels < 1 || avctx->channels > 2) { av_log(avctx, AV_LOG_ERROR, "invalid number of channels\n"); return AVERROR(EINVAL); } if (avctx->block_align < 1) { av_log(avctx, AV_LOG_ERROR, "invalid block align\...
21,661
0
static int sunrast_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; const uint8_t *buf_end = avpkt->data + avpkt->size; AVFrame * const p = data; unsigned int w, h, depth, type, maptype, maplength, stride, x, y, len, alen; uint8_t *ptr, *ptr2 = NULL; c...
21,662
0
static int xan_decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; int ret, buf_size = avpkt->size; XanContext *s = avctx->priv_data; if (avctx->codec->id == CODEC_ID_XAN_WC3) { const uint8_t *buf_end = buf + buf_size; int tag = 0; while (buf_end - buf > ...
21,663
0
av_cold int MPV_encode_init(AVCodecContext *avctx) { MpegEncContext *s = avctx->priv_data; int i; int chroma_h_shift, chroma_v_shift; MPV_encode_defaults(s); switch (avctx->codec_id) { case CODEC_ID_MPEG2VIDEO: if(avctx->pix_fmt != PIX_FMT_YUV420P && avctx->pix_fmt != PIX_FMT_YUV422P){ av_log(avctx, AV_LOG_ERROR, "only...
21,666
0
static void read_sbr_envelope(SpectralBandReplication *sbr, GetBitContext *gb, SBRData *ch_data, int ch) { int bits; int i, j, k; VLC_TYPE (*t_huff)[2], (*f_huff)[2]; int t_lav, f_lav; const int delta = (ch == 1 && sbr->bs_coupling == 1) + 1; const int odd = sbr->n[1] & 1; if (sbr->bs_coupling && ch) { if (ch_data->bs_...
21,667
0
static int pva_read_packet(AVFormatContext *s, AVPacket *pkt) { ByteIOContext *pb = s->pb; PVAContext *pvactx = s->priv_data; int ret, syncword, streamid, reserved, flags, length, pts_flag; int64_t pva_pts = AV_NOPTS_VALUE; recover: syncword = get_be16(pb); streamid = get_byte(pb); get_byte(pb); /* counter not used */ ...
21,668
1
static int decode_blck(uint8_t *frame, int width, int height, const uint8_t *src, const uint8_t *src_end) { memset(frame, 0, width * height); return 0; }
21,669
1
static CharDriverState *qmp_chardev_open_socket(const char *id, ChardevBackend *backend, ChardevReturn *ret, Error **errp) { CharDriverState *chr; TCPCharDriver *s; ChardevSocket *sock = backend->u.socket; SocketAddress *addr = sock->addr; bool do_nodelay = sock->has_nodelay ? sock->nodelay : false; bool is_listen = so...
21,671
1
static void pci_vpb_class_init(ObjectClass *klass, void *data) { DeviceClass *dc = DEVICE_CLASS(klass); dc->realize = pci_vpb_realize; dc->reset = pci_vpb_reset; dc->vmsd = &pci_vpb_vmstate; dc->props = pci_vpb_properties; }
21,672
1
static void gt64120_pci_mapping(GT64120State *s) { /* Update IO mapping */ if ((s->regs[GT_PCI0IOLD] & 0x7f) <= s->regs[GT_PCI0IOHD]) { /* Unmap old IO address */ if (s->PCI0IO_length) { memory_region_del_subregion(get_system_memory(), &s->PCI0IO_mem); memory_region_destroy(&s->PCI0IO_mem); } /* Map new IO address */ s...
21,673
1
static void *qemu_dummy_cpu_thread_fn(void *arg) { #ifdef _WIN32 fprintf(stderr, "qtest is not supported under Windows\n"); exit(1); #else CPUState *cpu = arg; sigset_t waitset; int r; rcu_register_thread(); qemu_mutex_lock_iothread(); qemu_thread_get_self(cpu->thread); cpu->thread_id = qemu_get_thread_id(); cpu->can_d...
21,674
1
void target_disas(FILE *out, CPUState *cpu, target_ulong code, target_ulong size, int flags) { CPUClass *cc = CPU_GET_CLASS(cpu); target_ulong pc; int count; CPUDebug s; INIT_DISASSEMBLE_INFO(s.info, out, fprintf); s.cpu = cpu; s.info.read_memory_func = target_read_memory; s.info.read_memory_inner_func = NULL; s.info.b...
21,675
1
static inline int decode_bytes(const uint8_t *inbuffer, uint8_t *out, int bytes) { static const uint32_t tab[4] = { AV_BE2NE32C(0x37c511f2), AV_BE2NE32C(0xf237c511), AV_BE2NE32C(0x11f237c5), AV_BE2NE32C(0xc511f237), }; int i, off; uint32_t c; const uint32_t *buf; uint32_t *obuf = (uint32_t *) out; /* FIXME: 64 bit plat...
21,676
1
static void coroutine_fn v9fs_fix_fid_paths(V9fsPDU *pdu, V9fsPath *olddir, V9fsString *old_name, V9fsPath *newdir, V9fsString *new_name) { V9fsFidState *tfidp; V9fsPath oldpath, newpath; V9fsState *s = pdu->s; v9fs_path_init(&oldpath); v9fs_path_init(&newpath); v9fs_co_name_to_path(pdu, olddir, old_name->data, &oldpat...
21,677
0
static inline void rv40_weak_loop_filter(uint8_t *src, const int step, const int filter_p1, const int filter_q1, const int alpha, const int beta, const int lim_p0q0, const int lim_q1, const int lim_p1, const int diff_p1p0, const int diff_q1q0, const int diff_p1p2, const int diff_q1q2) { uint8_t *cm = ff_cropTbl + MAX_N...
21,678
0
static int fileTest(uint8_t *ref[4], int refStride[4], int w, int h, FILE *fp, enum AVPixelFormat srcFormat_in, enum AVPixelFormat dstFormat_in) { char buf[256]; while (fgets(buf, sizeof(buf), fp)) { struct Results r; enum AVPixelFormat srcFormat; char srcStr[12]; int srcW, srcH; enum AVPixelFormat dstFormat; char dstS...
21,679
0
static int dirac_decode_frame_internal(DiracContext *s) { DWTContext d; int y, i, comp, dsty; if (s->low_delay) { /* [DIRAC_STD] 13.5.1 low_delay_transform_data() */ for (comp = 0; comp < 3; comp++) { Plane *p = &s->plane[comp]; memset(p->idwt_buf, 0, p->idwt_stride * p->idwt_height * sizeof(IDWTELEM)); } if (!s->zero_...
21,680
1
void updateMMXDitherTables(SwsContext *c, int dstY, int lumBufIndex, int chrBufIndex, int lastInLumBuf, int lastInChrBuf) { const int dstH= c->dstH; const int flags= c->flags; int16_t **lumPixBuf= c->lumPixBuf; int16_t **chrUPixBuf= c->chrUPixBuf; int16_t **alpPixBuf= c->alpPixBuf; const int vLumBufSize= c->vLumBufSize...
21,681
1
static inline void gen_outs(DisasContext *s, TCGMemOp ot) { if (s->base.tb->cflags & CF_USE_ICOUNT) { gen_io_start(); } gen_string_movl_A0_ESI(s); gen_op_ld_v(s, ot, cpu_T0, cpu_A0); tcg_gen_trunc_tl_i32(cpu_tmp2_i32, cpu_regs[R_EDX]); tcg_gen_andi_i32(cpu_tmp2_i32, cpu_tmp2_i32, 0xffff); tcg_gen_trunc_tl_i32(cpu_tmp3_...
21,682
0
static av_cold int alloc_buffers(AVCodecContext *avctx, AACEncContext *s) { FF_ALLOCZ_OR_GOTO(avctx, s->buffer.samples, 3 * 1024 * s->channels * sizeof(s->buffer.samples[0]), alloc_fail); FF_ALLOCZ_OR_GOTO(avctx, s->cpe, sizeof(ChannelElement) * s->chan_map[0], alloc_fail); FF_ALLOCZ_OR_GOTO(avctx, avctx->extradata, 5 ...
21,684
0
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 =...
21,686
0
void ff_biweight_h264_pixels4_8_msa(uint8_t *dst, uint8_t *src, int stride, int height, int log2_denom, int weight_dst, int weight_src, int offset) { avc_biwgt_4width_msa(src, stride, dst, stride, height, log2_denom, weight_src, weight_dst, offset); }
21,687
0
void clear_blocks_dcbz128_ppc(DCTELEM *blocks) { POWERPC_TBL_DECLARE(powerpc_clear_blocks_dcbz128, 1); register int misal = ((unsigned long)blocks & 0x0000007f); register int i = 0; POWERPC_TBL_START_COUNT(powerpc_clear_blocks_dcbz128, 1); #if 1 if (misal) { // we could probably also optimize this case, // but there's ...
21,688
1
static void ppc_cpu_class_init(ObjectClass *oc, void *data) { PowerPCCPUClass *pcc = POWERPC_CPU_CLASS(oc); CPUClass *cc = CPU_CLASS(oc); DeviceClass *dc = DEVICE_CLASS(oc); pcc->parent_realize = dc->realize; dc->realize = ppc_cpu_realizefn; dc->unrealize = ppc_cpu_unrealizefn; pcc->parent_reset = cc->reset; cc->reset ...
21,689
1
static CharDriverState *qmp_chardev_open_socket(ChardevSocket *sock, Error **errp) { SocketAddress *addr = sock->addr; bool do_nodelay = sock->has_nodelay ? sock->nodelay : false; bool is_listen = sock->has_server ? sock->server : true; bool is_telnet = sock->has_telnet ? sock->telnet : false; bool is_waitconnect = soc...
21,690
1
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->cu...
21,692
1
static inline void yuv2rgbXinC(int16_t *lumFilter, int16_t **lumSrc, int lumFilterSize, int16_t *chrFilter, int16_t **chrSrc, int chrFilterSize, uint8_t *dest, int dstW, int dstbpp) { if(dstbpp==32) { int i; for(i=0; i<(dstW>>1); i++){ int j; int Y1=0; int Y2=0; int U=0; int V=0; int Cb, Cr, Cg; for(j=0; j<lumFilterSiz...
21,693
1
static int halfpel_interpol(SnowContext *s, uint8_t *halfpel[4][4], AVFrame *frame){ int p,x,y; for(p=0; p < s->nb_planes; p++){ int is_chroma= !!p; int w= is_chroma ? s->avctx->width >>s->chroma_h_shift : s->avctx->width; int h= is_chroma ? s->avctx->height>>s->chroma_v_shift : s->avctx->height; int ls= frame->linesiz...
21,695
1
static void *qpa_thread_in (void *arg) { PAVoiceIn *pa = arg; HWVoiceIn *hw = &pa->hw; 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 > 0) { break; } if (audio_pt_wait (&pa->pt, AUDIO_FUNC)) { goto exit; } } incr = to_gr...
21,696
1
void ff_h261_encode_init(MpegEncContext *s){ static int done = 0; if (!done) { done = 1; init_rl(&h261_rl_tcoeff); } s->min_qcoeff= -127; s->max_qcoeff= 127; s->y_dc_scale_table= s->c_dc_scale_table= ff_mpeg1_dc_scale_table; }
21,697
1
static int mmu_translate_region(CPUS390XState *env, target_ulong vaddr, uint64_t asc, uint64_t entry, int level, target_ulong *raddr, int *flags, int rw, bool exc) { CPUState *cs = CPU(s390_env_get_cpu(env)); uint64_t origin, offs, new_entry; const int pchks[4] = { PGM_SEGMENT_TRANS, PGM_REG_THIRD_TRANS, PGM_REG_SEC_TR...
21,698
1
static int pcx_encode_frame(AVCodecContext *avctx, unsigned char *buf, int buf_size, void *data) { PCXContext *s = avctx->priv_data; AVFrame *const pict = &s->picture; const uint8_t *buf_start = buf; const uint8_t *buf_end = buf + buf_size; int bpp, nplanes, i, y, line_bytes, written; const uint32_t *pal = NULL; const ...
21,699
1
static void GCC_FMT_ATTR(2, 3) qtest_send(CharDriverState *chr, const char *fmt, ...) { va_list ap; char buffer[1024]; size_t len; va_start(ap, fmt); len = vsnprintf(buffer, sizeof(buffer), fmt, ap); va_end(ap); qemu_chr_fe_write_all(chr, (uint8_t *)buffer, len); if (qtest_log_fp && qtest_opened) { fprintf(qtest_log_fp...
21,700
1
static int dxtory_decode_v1_rgb(AVCodecContext *avctx, AVFrame *pic, const uint8_t *src, int src_size, int id, int bpp) { int h; uint8_t *dst; int ret; if (src_size < avctx->width * avctx->height * bpp) { av_log(avctx, AV_LOG_ERROR, "packet too small\n"); return AVERROR_INVALIDDATA; } avctx->pix_fmt = id; if ((ret = ff...
21,701
1
void vbe_ioport_write_data(void *opaque, uint32_t addr, uint32_t val) { VGACommonState *s = opaque; if (s->vbe_index <= VBE_DISPI_INDEX_NB) { #ifdef DEBUG_BOCHS_VBE printf("VBE: write index=0x%x val=0x%x\n", s->vbe_index, val); #endif switch(s->vbe_index) { case VBE_DISPI_INDEX_ID: if (val == VBE_DISPI_ID0 || val == VB...
21,702
1
static void vexpress_common_init(MachineState *machine) { VexpressMachineState *vms = VEXPRESS_MACHINE(machine); VexpressMachineClass *vmc = VEXPRESS_MACHINE_GET_CLASS(machine); VEDBoardInfo *daughterboard = vmc->daughterboard; DeviceState *dev, *sysctl, *pl041; qemu_irq pic[64]; uint32_t sys_id; DriveInfo *dinfo; pfla...
21,703
1
static int vnc_set_gnutls_priority(gnutls_session_t s, int x509) { const char *priority = x509 ? "NORMAL" : "NORMAL:+ANON-DH"; int rc; rc = gnutls_priority_set_direct(s, priority, NULL); if (rc != GNUTLS_E_SUCCESS) { return -1; } return 0; }
21,705
1
static void vfio_platform_eoi(VFIODevice *vbasedev) { VFIOINTp *intp; VFIOPlatformDevice *vdev = container_of(vbasedev, VFIOPlatformDevice, vbasedev); qemu_mutex_lock(&vdev->intp_mutex); QLIST_FOREACH(intp, &vdev->intp_list, next) { if (intp->state == VFIO_IRQ_ACTIVE) { trace_vfio_platform_eoi(intp->pin, event_notifier...
21,706
1
static void qxl_enter_vga_mode(PCIQXLDevice *d) { if (d->mode == QXL_MODE_VGA) { return; } trace_qxl_enter_vga_mode(d->id); #if SPICE_SERVER_VERSION >= 0x000c03 /* release 0.12.3 */ spice_qxl_driver_unload(&d->ssd.qxl); #endif graphic_console_set_hwops(d->ssd.dcl.con, d->vga.hw_ops, &d->vga); update_displaychangelisten...
21,707
1
static int mov_read_smi(MOVContext *c, AVIOContext *pb, MOVAtom atom) { AVStream *st; if (c->fc->nb_streams < 1) return 0; st = c->fc->streams[c->fc->nb_streams-1]; if ((uint64_t)atom.size > (1<<30)) return AVERROR_INVALIDDATA; // currently SVQ3 decoder expect full STSD header - so let's fake it // this should be fixed...
21,709
0
AVFilterFormats *avfilter_merge_formats(AVFilterFormats *a, AVFilterFormats *b) { AVFilterFormats *ret; unsigned i, j, k = 0; ret = av_mallocz(sizeof(AVFilterFormats)); /* merge list of formats */ ret->formats = av_malloc(sizeof(*ret->formats) * FFMIN(a->format_count, b->format_count)); for(i = 0; i < a->format_count; ...
21,710
0
static void rv40_v_loop_filter(uint8_t *src, int stride, int dmode, int lim_q1, int lim_p1, int alpha, int beta, int beta2, int chroma, int edge){ rv40_adaptive_loop_filter(src, 1, stride, dmode, lim_q1, lim_p1, alpha, beta, beta2, chroma, edge); }
21,711
0
static void lfe_downsample(DCAEncContext *c, const int32_t *input) { /* FIXME: make 128x LFE downsampling possible */ const int lfech = lfe_index[c->channel_config]; int i, j, lfes; int32_t hist[512]; int32_t accum; int hist_start = 0; for (i = 0; i < 512; i++) hist[i] = c->history[i][c->channels - 1]; for (lfes = 0; l...
21,712
0
static int indeo3_decode_frame(AVCodecContext *avctx, void *data, int *data_size, const uint8_t *buf, int buf_size) { Indeo3DecodeContext *s=avctx->priv_data; uint8_t *src, *dest; int y; iv_decode_frame(s, buf, buf_size); if(s->frame.data[0]) avctx->release_buffer(avctx, &s->frame); s->frame.reference = 0; if(avctx->ge...
21,713
0
static void filter_mb_edgech( H264Context *h, uint8_t *pix, int stride, int bS[4], int qp ) { int i, d; const int index_a = clip( qp + h->slice_alpha_c0_offset, 0, 51 ); const int alpha = alpha_table[index_a]; const int beta = beta_table[clip( qp + h->slice_beta_offset, 0, 51 )]; const int pix_next = stride; for( i = 0...
21,714
0
void aio_context_unref(AioContext *ctx) { g_source_unref(&ctx->source); }
21,715
0
static void handle_hint(DisasContext *s, uint32_t insn, unsigned int op1, unsigned int op2, unsigned int crm) { unsigned int selector = crm << 3 | op2; if (op1 != 3) { unallocated_encoding(s); return; } switch (selector) { case 0: /* NOP */ return; case 3: /* WFI */ s->base.is_jmp = DISAS_WFI; return; case 1: /* YIELD ...
21,716
0
static int msrle_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; MsrleContext *s = avctx->priv_data; int istride = FFALIGN(avctx->width*avctx->bits_per_coded_sample, 32) / 8; int ret; s->buf = buf; s->size = buf_size; if ((...
21,717
0
static void tcx_update_display(void *opaque) { TCXState *ts = opaque; ram_addr_t page, page_min, page_max; int y, y_start, dd, ds; uint8_t *d, *s; void (*f)(TCXState *s1, uint8_t *d, const uint8_t *s, int width); if (ts->ds->depth == 0) return; page = ts->vram_offset; y_start = -1; page_min = 0xffffffff; page_max = 0; ...
21,718
0
int vnc_zlib_send_framebuffer_update(VncState *vs, int x, int y, int w, int h) { int old_offset, new_offset, bytes_written; vnc_framebuffer_update(vs, x, y, w, h, VNC_ENCODING_ZLIB); // remember where we put in the follow-up size old_offset = vs->output.offset; vnc_write_s32(vs, 0); // compress the stream vnc_zlib_star...
21,719
0
static TCGv_i64 read_fp_dreg(DisasContext *s, int reg) { TCGv_i64 v = tcg_temp_new_i64(); tcg_gen_ld_i64(v, cpu_env, fp_reg_offset(reg, MO_64)); return v; }
21,720
0
static int vfio_connect_container(VFIOGroup *group, AddressSpace *as) { VFIOContainer *container; int ret, fd; VFIOAddressSpace *space; space = vfio_get_address_space(as); QLIST_FOREACH(container, &space->containers, next) { if (!ioctl(group->fd, VFIO_GROUP_SET_CONTAINER, &container->fd)) { group->container = container...
21,721
0
static void pci_piix_init_ports(PCIIDEState *d) { int i; struct { int iobase; int iobase2; int isairq; } port_info[] = { {0x1f0, 0x3f6, 14}, {0x170, 0x376, 15}, }; for (i = 0; i < 2; i++) { ide_bus_new(&d->bus[i], &d->dev.qdev, i); ide_init_ioport(&d->bus[i], port_info[i].iobase, port_info[i].iobase2); ide_init2(&d->bu...
21,722
0
void load_seg(int seg_reg, int selector) { SegmentCache *sc; SegmentDescriptorTable *dt; int index; uint32_t e1, e2; uint8_t *ptr; env->segs[seg_reg] = selector; sc = &env->seg_cache[seg_reg]; if (env->eflags & VM_MASK) { sc->base = (void *)(selector << 4); sc->limit = 0xffff; sc->seg_32bit = 0; } else { if (selector &...
21,724
0
static BlockBackend *blockdev_init(const char *file, QDict *bs_opts, Error **errp) { const char *buf; int bdrv_flags = 0; int on_read_error, on_write_error; bool account_invalid, account_failed; const char *stats_intervals; BlockBackend *blk; BlockDriverState *bs; ThrottleConfig cfg; int snapshot = 0; Error *error = NU...
21,725
0
av_cold void ff_dsputil_init_armv5te(DSPContext *c, AVCodecContext *avctx) { if (avctx->bits_per_raw_sample <= 8 && (avctx->idct_algo == FF_IDCT_AUTO || avctx->idct_algo == FF_IDCT_SIMPLEARMV5TE)) { c->idct_put = ff_simple_idct_put_armv5te; c->idct_add = ff_simple_idct_add_armv5te; c->idct = ff_simple_idct_armv5te; c->...
21,727
0
static QObject *qmp_input_get_object(QmpInputVisitor *qiv, const char *name, bool consume, Error **errp) { StackObject *tos; QObject *qobj; QObject *ret; if (QSLIST_EMPTY(&qiv->stack)) { /* Starting at root, name is ignored. */ assert(qiv->root); return qiv->root; } /* We are in a container; find the next element. */ t...
21,728
0
static void rtas_ibm_set_slot_reset(PowerPCCPU *cpu, sPAPREnvironment *spapr, uint32_t token, uint32_t nargs, target_ulong args, uint32_t nret, target_ulong rets) { sPAPRPHBState *sphb; sPAPRPHBClass *spc; uint32_t option; uint64_t buid; int ret; if ((nargs != 4) || (nret != 1)) { goto param_error_exit; } buid = ((uint...
21,729
0
int pp_check(int key, int pp, int nx) { int access; /* Compute access rights */ /* When pp is 3/7, the result is undefined. Set it to noaccess */ access = 0; if (key == 0) { switch (pp) { case 0x0: case 0x1: case 0x2: access |= PAGE_WRITE; /* No break here */ case 0x3: case 0x6: access |= PAGE_READ; break; } } else { s...
21,730
0
static bool check_section_footer(QEMUFile *f, SaveStateEntry *se) { uint8_t read_mark; uint32_t read_section_id; if (skip_section_footers) { /* No footer to check */ return true; } read_mark = qemu_get_byte(f); if (read_mark != QEMU_VM_SECTION_FOOTER) { error_report("Missing section footer for %s", se->idstr); return f...
21,732