label
int64
0
1
func
stringlengths
21
96.3k
1
static void select_vgahw (const char *p){ const char *opts; vga_interface_type = VGA_NONE; if (strstart(p, "std", &opts)) { if (vga_available()) { vga_interface_type = VGA_STD; fprintf(stderr, "Error: standard VGA not available\n"); exit(0); } else if (strstart(p, "cirrus", &opts)) { if (cirrus_vga_available()) { vga_i...
1
void kvm_irqchip_commit_routes(KVMState *s){ int ret; s->irq_routes->flags = 0; trace_kvm_irqchip_commit_routes(); ret = kvm_vm_ioctl(s, KVM_SET_GSI_ROUTING, s->irq_routes); assert(ret == 0);
1
void cpu_exit(CPUState *cpu){ cpu->exit_request = 1; /* Ensure cpu_exec will see the exit request after TCG has exited. */ smp_wmb(); cpu->tcg_exit_req = 1;}
1
void FUNCC(ff_h264_idct8_add)(uint8_t *_dst, DCTELEM *_block, int stride){ int i; INIT_CLIP pixel *dst = (pixel*)_dst; dctcoef *block = (dctcoef*)_block; stride /= sizeof(pixel); block[0] += 32; for( i = 0; i < 8; i++ ) { const int a0 = block[i+0*8] + block[i+4*8]; const int a2 = block[i+0*8] - block[i+4*8]; const int ...
1
static int huf_decode(const uint64_t *hcode, const HufDec *hdecod, GetByteContext *gb, int nbits, int rlc, int no, uint16_t *out){ uint64_t c = 0; uint16_t *outb = out; uint16_t *oe = out + no; const uint8_t *ie = gb->buffer + (nbits + 7) / 8; // input byte size uint8_t cs, s; int i, lc = 0; while (gb->buffer < ie) { g...
0
static void gen_mfc0(DisasContext *ctx, TCGv arg, int reg, int sel){ const char *rn = "invalid"; if (sel != 0) check_insn(ctx, ISA_MIPS32); switch (reg) { case 0: switch (sel) { case 0: gen_mfc0_load32(arg, offsetof(CPUMIPSState, CP0_Index)); rn = "Index"; break; case 1: check_insn(ctx, ASE_MT); gen_helper_mfc0_mvpcont...
0
static int64_t cvtnum(const char *s){ char *end; return qemu_strtosz_suffix(s, &end, QEMU_STRTOSZ_DEFSUFFIX_B);}
0
static void qpci_spapr_io_writeb(QPCIBus *bus, void *addr, uint8_t value){ QPCIBusSPAPR *s = container_of(bus, QPCIBusSPAPR, bus); uint64_t port = (uintptr_t)addr; if (port < s->pio.size) { writeb(s->pio_cpu_base + port, value); } else { writeb(s->mmio_cpu_base + port, value); }}
0
static void *rcu_q_updater(void *arg){ int j, target_el; long long n_updates_local = 0; long long n_removed_local = 0; struct list_element *el, *prev_el; *(struct rcu_reader_data **)arg = &rcu_reader; atomic_inc(&nthreadsrunning); while (goflag == GOFLAG_INIT) { g_usleep(1000); } while (goflag == GOFLAG_RUN) { target_e...
0
int Configure(void **ctxp, int argc, char *argv[]){ ContextInfo *ci; int c; *ctxp = av_mallocz(sizeof(ContextInfo)); ci = (ContextInfo *) *ctxp; optind = 1; ci->dir = "/tmp"; ci->threshold = 100; ci->file_limit = 100; ci->min_interval = 1000000; ci->inset = 10; /* Percent */ while ((c = getopt(argc, argv, "w:i:dh:s:v:z...
0
static int local_chown(FsContext *ctx, const char *path, uid_t uid, gid_t gid){ return chown(rpath(ctx, path), uid, gid);}
0
static void disas_arm_insn(DisasContext *s, unsigned int insn){ unsigned int cond, val, op1, i, shift, rm, rs, rn, rd, sh; TCGv_i32 tmp; TCGv_i32 tmp2; TCGv_i32 tmp3; TCGv_i32 addr; TCGv_i64 tmp64; /* M variants do not implement ARM mode. */ if (arm_dc_feature(s, ARM_FEATURE_M)) { goto illegal_op; } cond = insn >> 28; ...
0
int64_t bdrv_getlength(BlockDriverState *bs){ BlockDriver *drv = bs->drv; if (!drv) return -ENOMEDIUM; if (bs->growable || bs->removable) { if (drv->bdrv_getlength) { return drv->bdrv_getlength(bs); } } return bs->total_sectors * BDRV_SECTOR_SIZE;}
0
static void test_after_failed_device_add(void){ QDict *response; QDict *error; qtest_start("-drive if=none,id=drive0"); /* Make device_add fail. If this leaks the virtio-blk-pci device then a * reference to drive0 will also be held (via qdev properties). */ response = qmp("{'execute': 'device_add'," " 'arguments': {" "...
0
static void xen_io_del(MemoryListener *listener, MemoryRegionSection *section){ XenIOState *state = container_of(listener, XenIOState, io_listener); xen_unmap_io_section(xen_xc, xen_domid, state->ioservid, section); memory_region_unref(section->mr);}
0
static void mipsnet_receive(void *opaque, const uint8_t *buf, size_t size){ MIPSnetState *s = opaque;#ifdef DEBUG_MIPSNET_RECEIVE printf("mipsnet: receiving len=%d\n", size);#endif if (!mipsnet_can_receive(opaque)) return; s->busy = 1; /* Just accept everything. */ /* Write packet data. */ memcpy(s->rx_buffer, buf, siz...
0
int kvm_s390_set_mem_limit(KVMState *s, uint64_t new_limit, uint64_t *hw_limit){ int rc; struct kvm_device_attr attr = { .group = KVM_S390_VM_MEM_CTRL, .attr = KVM_S390_VM_MEM_LIMIT_SIZE, .addr = (uint64_t) &new_limit, }; if (!kvm_s390_supports_mem_limit(s)) { return 0; } rc = kvm_s390_query_mem_limit(s, hw_limit); if ...
0
static int ra144_decode_frame(AVCodecContext * avctx, void *vdata, int *data_size, const uint8_t *buf, int buf_size){ static const uint8_t sizes[10] = {6, 5, 5, 4, 4, 3, 3, 3, 3, 2}; unsigned int refl_rms[4]; // RMS of the reflection coefficients uint16_t block_coefs[4][30]; // LPC coefficients of each sub-block unsign...
0
static void read_vec_element(DisasContext *s, TCGv_i64 tcg_dest, int srcidx, int element, TCGMemOp memop){ int vect_off = vec_reg_offset(srcidx, element, memop & MO_SIZE); switch (memop) { case MO_8: tcg_gen_ld8u_i64(tcg_dest, cpu_env, vect_off); break; case MO_16: tcg_gen_ld16u_i64(tcg_dest, cpu_env, vect_off); break;...
0
int qemu_boot_set(const char *boot_order){ if (!boot_set_handler) { return -EINVAL; } return boot_set_handler(boot_set_opaque, boot_order);}
0
static ssize_t local_readlink(FsContext *ctx, const char *path, char *buf, size_t bufsz){ return readlink(rpath(ctx, path), buf, bufsz);}
0
void unix_start_incoming_migration(const char *path, Error **errp){ SocketAddressLegacy *saddr = unix_build_address(path); socket_start_incoming_migration(saddr, errp);}
0
void tcg_gen_atomic_cmpxchg_i32(TCGv_i32 retv, TCGv addr, TCGv_i32 cmpv, TCGv_i32 newv, TCGArg idx, TCGMemOp memop){ memop = tcg_canonicalize_memop(memop, 0, 0); if (!parallel_cpus) { TCGv_i32 t1 = tcg_temp_new_i32(); TCGv_i32 t2 = tcg_temp_new_i32(); tcg_gen_ext_i32(t2, cmpv, memop & MO_SIZE); tcg_gen_qemu_ld_i32(t1, ...
0
static void rtce_init(VIOsPAPRDevice *dev){ size_t size = (dev->rtce_window_size >> SPAPR_VIO_TCE_PAGE_SHIFT) * sizeof(VIOsPAPR_RTCE); if (size) { dev->rtce_table = g_malloc0(size); }}
0
BlockAIOCB *ide_issue_trim(BlockDriverState *bs, int64_t sector_num, QEMUIOVector *qiov, int nb_sectors, BlockCompletionFunc *cb, void *opaque){ TrimAIOCB *iocb; iocb = qemu_aio_get(&trim_aiocb_info, bs, cb, opaque); iocb->bh = qemu_bh_new(ide_trim_bh_cb, iocb); iocb->ret = 0; iocb->qiov = qiov; iocb->i = -1; iocb->j =...
0
uint32_t lduw_phys(target_phys_addr_t addr){ return lduw_phys_internal(addr, DEVICE_NATIVE_ENDIAN);}
0
static int dirac_decode_data_unit(AVCodecContext *avctx, const uint8_t *buf, int size){ DiracContext *s = avctx->priv_data; DiracFrame *pic = NULL; int ret, i, parse_code = buf[4]; unsigned tmp; if (size < DATA_UNIT_HEADER_SIZE) return -1; init_get_bits(&s->gb, &buf[13], 8*(size - DATA_UNIT_HEADER_SIZE)); if (parse_cod...
0
static int h264_parse(AVCodecParserContext *s, AVCodecContext *avctx, uint8_t **poutbuf, int *poutbuf_size, const uint8_t *buf, int buf_size){ H264Context *h = s->priv_data; ParseContext *pc = &h->s.parse_context; int next; if(s->flags & PARSER_FLAG_COMPLETE_FRAMES){ next= buf_size; }else{ next= find_frame_end(h, buf, ...
0
av_cold void ff_idctdsp_init(IDCTDSPContext *c, AVCodecContext *avctx){ const unsigned high_bit_depth = avctx->bits_per_raw_sample > 8; if (avctx->lowres==1) { c->idct_put = ff_jref_idct4_put; c->idct_add = ff_jref_idct4_add; c->idct = ff_j_rev_dct4; c->perm_type = FF_IDCT_PERM_NONE; } else if (avctx->lowres==2) { c->i...
1
do_command(GIOChannel *source, GIOCondition condition, gpointer data){ char *string; VCardEmulError error; static unsigned int default_reader_id; unsigned int reader_id; VReader *reader = NULL; GError *err = NULL; g_assert(condition & G_IO_IN); reader_id = default_reader_id; g_io_channel_read_line(source, &string, NULL...
1
envlist_unsetenv(envlist_t *envlist, const char *env){struct envlist_entry *entry;size_t envname_len;if ((envlist == NULL) || (env == NULL))return (EINVAL);/* env is not allowed to contain '=' */if (strchr(env, '=') != NULL)return (EINVAL);/* * Find out the requested entry and remove * it from the list. */envname_len =...
1
static av_cold int mpc8_decode_init(AVCodecContext * avctx){ int i; MPCContext *c = avctx->priv_data; GetBitContext gb; static int vlc_initialized = 0; int channels; static VLC_TYPE band_table[542][2]; static VLC_TYPE q1_table[520][2]; static VLC_TYPE q9up_table[524][2]; static VLC_TYPE scfi0_table[1 << MPC8_SCFI0_BITS...
1
static int decode_pivot(MSS1Context *ctx, ArithCoder *acoder, int base){ int val, inv; inv = arith_get_model_sym(acoder, &ctx->edge_mode); val = arith_get_model_sym(acoder, &ctx->pivot) + 1; if (val > 2) { if ((base + 1) / 2 - 2 <= 0) { ctx->corrupted = 1; return 0; } val = arith_get_number(acoder, (base + 1) / 2 - 2) ...
1
static void ccw_init(MachineState *machine){ int ret; VirtualCssBus *css_bus; s390_sclp_init(); s390_memory_init(machine->ram_size); /* init CPUs (incl. CPU model) early so s390_has_feature() works */ s390_init_cpus(machine); s390_flic_init(); /* get a BUS */ css_bus = virtual_css_bus_init(); s390_init_ipl_dev(machine-...
1
int kvm_uncoalesce_mmio_region(target_phys_addr_t start, ram_addr_t size){ int ret = -ENOSYS; KVMState *s = kvm_state; if (s->coalesced_mmio) { struct kvm_coalesced_mmio_zone zone; zone.addr = start; zone.size = size; ret = kvm_vm_ioctl(s, KVM_UNREGISTER_COALESCED_MMIO, &zone); } return ret;}
1
static int wma_decode_init(AVCodecContext * avctx){ WMADecodeContext *s = avctx->priv_data; int i, flags1, flags2; float *window; uint8_t *extradata; float bps1, high_freq; volatile float bps; int sample_rate1; int coef_vlc_table; s->sample_rate = avctx->sample_rate; s->nb_channels = avctx->channels; s->bit_rate = avct...
1
void virtio_net_exit(VirtIODevice *vdev){ VirtIONet *n = DO_UPCAST(VirtIONet, vdev, vdev); qemu_del_vm_change_state_handler(n->vmstate); if (n->vhost_started) { vhost_net_stop(tap_get_vhost_net(n->nic->nc.peer), vdev); } qemu_purge_queued_packets(&n->nic->nc); unregister_savevm(n->qdev, "virtio-net", n); qemu_free(n->m...
1
static void v7m_exception_taken(ARMCPU *cpu, uint32_t lr){ /* Do the "take the exception" parts of exception entry, * but not the pushing of state to the stack. This is * similar to the pseudocode ExceptionTaken() function. */ CPUARMState *env = &cpu->env; uint32_t addr; armv7m_nvic_acknowledge_irq(env->nvic); write_v7...
1
static int omap_intc_init(SysBusDevice *sbd){ DeviceState *dev = DEVICE(sbd); struct omap_intr_handler_s *s = OMAP_INTC(dev); if (!s->iclk) { hw_error("omap-intc: clk not connected\n"); } s->nbanks = 1; sysbus_init_irq(sbd, &s->parent_intr[0]); sysbus_init_irq(sbd, &s->parent_intr[1]); qdev_init_gpio_in(dev, omap_set_i...
1
static void mov_read_chapters(AVFormatContext *s){ MOVContext *mov = s->priv_data; AVStream *st = NULL; MOVStreamContext *sc; int64_t cur_pos; int i; for (i = 0; i < s->nb_streams; i++) if (s->streams[i]->id == mov->chapter_track) { st = s->streams[i]; break; } if (!st) { av_log(s, AV_LOG_ERROR, "Referenced QT chapter ...
1
int ff_cmap_read_palette(AVCodecContext *avctx, uint32_t *pal){ int count, i; if (avctx->bits_per_coded_sample > 8) { av_log(avctx, AV_LOG_ERROR, "bit_per_coded_sample > 8 not supported\n"); return AVERROR_INVALIDDATA; } count = 1 << avctx->bits_per_coded_sample; if (avctx->extradata_size < count * 3) { av_log(avctx, A...
1
static void isabus_bridge_class_init(ObjectClass *klass, void *data){ DeviceClass *dc = DEVICE_CLASS(klass); set_bit(DEVICE_CATEGORY_BRIDGE, dc->categories); dc->fw_name = "isa";}
1
static void disable_device(PIIX4PMState *s, int slot){ s->ar.gpe.sts[0] |= PIIX4_PCI_HOTPLUG_STATUS; s->pci0_status.down |= (1 << slot);}
1
void page_set_flags(target_ulong start, target_ulong end, int flags){ target_ulong addr, len; /* This function should never be called with addresses outside the guest address space. If this assert fires, it probably indicates a missing call to h2g_valid. */#if TARGET_ABI_BITS > L1_MAP_ADDR_SPACE_BITS assert(end < ((tar...
1
static int print_block_option_help(const char *filename, const char *fmt){ BlockDriver *drv, *proto_drv; QEMUOptionParameter *create_options = NULL; /* Find driver and parse its options */ drv = bdrv_find_format(fmt); if (!drv) { error_report("Unknown file format '%s'", fmt); return 1; } create_options = append_option_...
1
av_cold int ffv1_init_slice_contexts(FFV1Context *f){ int i; f->slice_count = f->num_h_slices * f->num_v_slices; av_assert0(f->slice_count > 0); for (i = 0; i < f->slice_count; i++) { FFV1Context *fs = av_mallocz(sizeof(*fs)); int sx = i % f->num_h_slices; int sy = i / f->num_h_slices; int sxs = f->avctx->width * sx / ...
1
void ff_rtp_send_aac(AVFormatContext *s1, const uint8_t *buff, int size){ RTPMuxContext *s = s1->priv_data; int len, max_packet_size; uint8_t *p; const int max_frames_per_packet = s->max_frames_per_packet ? s->max_frames_per_packet : 5; const int max_au_headers_size = 2 + 2 * max_frames_per_packet; /* skip ADTS header,...
1
static int vqf_read_packet(AVFormatContext *s, AVPacket *pkt){ VqfContext *c = s->priv_data; int ret; int size = (c->frame_bit_len - c->remaining_bits + 7)>>3; if (av_new_packet(pkt, size+2) < 0) return AVERROR(EIO); pkt->pos = avio_tell(s->pb); pkt->stream_index = 0; pkt->duration = 1; pkt->data[0] = 8 - c->remaining_...
1
static int vhost_user_cleanup(struct vhost_dev *dev){ struct vhost_user *u; assert(dev->vhost_ops->backend_type == VHOST_BACKEND_TYPE_USER); u = dev->opaque; if (u->slave_fd >= 0) { close(u->slave_fd); u->slave_fd = -1; } g_free(u); dev->opaque = 0; return 0;}
1
av_cold void ff_fmt_convert_init_arm(FmtConvertContext *c, AVCodecContext *avctx){ int cpu_flags = av_get_cpu_flags(); if (have_vfp(cpu_flags)) { if (!have_vfpv3(cpu_flags)) { c->int32_to_float_fmul_scalar = ff_int32_to_float_fmul_scalar_vfp; c->int32_to_float_fmul_array8 = ff_int32_to_float_fmul_array8_vfp; } } if (ha...
0
static inline void RENAME(hyscale)(SwsContext *c, uint16_t *dst, long dstWidth, const uint8_t *src, int srcW, int xInc, const int16_t *hLumFilter, const int16_t *hLumFilterPos, int hLumFilterSize, uint8_t *formatConvBuffer, uint32_t *pal, int isAlpha){ void (*toYV12)(uint8_t *, const uint8_t *, long, uint32_t *) = isAl...
0
static void dv_decode_ac(GetBitContext *gb, BlockInfo *mb, DCTELEM *block){ int last_index = get_bits_size(gb); const uint8_t *scan_table = mb->scan_table; const uint8_t *shift_table = mb->shift_table; int pos = mb->pos; int partial_bit_count = mb->partial_bit_count; int level, pos1, run, vlc_len, index; OPEN_READER(re...
0
int opt_default(const char *opt, const char *arg){ int type; const AVOption *o= NULL; int opt_types[]={AV_OPT_FLAG_VIDEO_PARAM, AV_OPT_FLAG_AUDIO_PARAM, 0, AV_OPT_FLAG_SUBTITLE_PARAM, 0}; for(type=0; type<CODEC_TYPE_NB; type++){ const AVOption *o2 = av_find_opt(avctx_opts[0], opt, NULL, opt_types[type], opt_types[type]...
0
static float quantize_band_cost(struct AACEncContext *s, const float *in, const float *scaled, int size, int scale_idx, int cb, const float lambda, const float uplim, int *bits){ const float IQ = ff_aac_pow2sf_tab[200 + scale_idx - SCALE_ONE_POS + SCALE_DIV_512]; const float Q = ff_aac_pow2sf_tab[200 - scale_idx + SCAL...
0
static int encode_subband_c0run(SnowContext *s, SubBand *b, DWTELEM *src, DWTELEM *parent, int stride, int orientation){ const int w= b->width; const int h= b->height; int x, y; if(1){ int run=0; int runs[w*h]; int run_index=0; for(y=0; y<h; y++){ for(x=0; x<w; x++){ int v, p=0; int /*ll=0, */l=0, lt=0, t=0, rt=0; v= s...
0
static int g722_decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPacket *avpkt){ G722Context *c = avctx->priv_data; int16_t *out_buf = data; int j, out_len = 0; const int skip = 8 - avctx->bits_per_coded_sample; const int16_t *quantizer_table = low_inv_quants[skip]; GetBitContext gb; init_get_bits(&gb,...
1
int qemu_create_pidfile(const char *filename){ char buffer[128]; int len; int fd; fd = qemu_open(filename, O_RDWR | O_CREAT, 0600); if (fd == -1) { return -1; } if (lockf(fd, F_TLOCK, 0) == -1) { close(fd); return -1; } len = snprintf(buffer, sizeof(buffer), FMT_pid "\n", getpid()); if (write(fd, buffer, len) != len) {...
1
static av_cold int v410_decode_init(AVCodecContext *avctx){ avctx->pix_fmt = PIX_FMT_YUV444P10; avctx->bits_per_raw_sample = 10; if (avctx->width & 1) { av_log(avctx, AV_LOG_ERROR, "v410 requires width to be even.\n"); return AVERROR_INVALIDDATA; } avctx->coded_frame = avcodec_alloc_frame(); if (!avctx->coded_frame) { ...
1
static int alloc_picture(H264Context *h, Picture *pic){ int i, ret = 0; av_assert0(!pic->f.data[0]); if (h->avctx->hwaccel) { const AVHWAccel *hwaccel = h->avctx->hwaccel; av_assert0(!pic->hwaccel_picture_private); if (hwaccel->priv_data_size) { pic->hwaccel_priv_buf = av_buffer_allocz(hwaccel->priv_data_size); if (!pi...
1
static void rc4030_dma_tt_update(rc4030State *s, uint32_t new_tl_base, uint32_t new_tl_limit){ int entries, i; dma_pagetable_entry *dma_tl_contents; if (s->dma_tl_limit) { /* write old dma tl table to physical memory */ memory_region_del_subregion(get_system_memory(), &s->dma_tt_alias); cpu_physical_memory_write(s->dma...
1
static int mov_read_dvc1(MOVContext *c, AVIOContext *pb, MOVAtom atom){ AVStream *st; uint8_t profile_level; if (c->fc->nb_streams < 1) return 0; st = c->fc->streams[c->fc->nb_streams-1]; if (atom.size >= (1<<28) || atom.size < 7) return AVERROR_INVALIDDATA; profile_level = avio_r8(pb); if ((profile_level & 0xf0) != 0x...
0
static void zero_remaining(unsigned int b, unsigned int b_max, const unsigned int *div_blocks, int32_t *buf){ unsigned int count = 0; while (b < b_max) count += div_blocks[b]; if (count) memset(buf, 0, sizeof(*buf) * count);}
1
static int push_samples(AVFilterContext *ctx, int nb_samples){ AVFilterLink *outlink = ctx->outputs[0]; LoopContext *s = ctx->priv; AVFrame *out; int ret, i = 0; while (s->loop != 0 && i < nb_samples) { out = ff_get_audio_buffer(outlink, FFMIN(nb_samples, s->nb_samples - s->current_sample)); if (!out) return AVERROR(EN...
1
void *qemu_realloc(void *ptr, size_t size){ if (!size && !allow_zero_malloc()) { abort(); } return oom_check(realloc(ptr, size ? size : 1));}
1
static int coreaudio_init_out (HWVoiceOut *hw, struct audsettings *as){ OSStatus status; coreaudioVoiceOut *core = (coreaudioVoiceOut *) hw; UInt32 propertySize; int err; const char *typ = "playback"; AudioValueRange frameRange; /* create mutex */ err = pthread_mutex_init(&core->mutex, NULL); if (err) { dolog("Could no...
1
static void xilinx_spips_flush_txfifo(XilinxSPIPS *s){ int debug_level = 0; XilinxQSPIPS *q = (XilinxQSPIPS *) object_dynamic_cast(OBJECT(s), TYPE_XILINX_QSPIPS); for (;;) { int i; uint8_t tx = 0; uint8_t tx_rx[num_effective_busses(s)]; uint8_t dummy_cycles = 0; uint8_t addr_length; if (fifo8_is_empty(&s->tx_fifo)) { i...
0
static int img_set_parameters(AVFormatContext *s, AVFormatParameters *ap){ VideoData *img = s->priv_data; AVStream *st; AVImageFormat *img_fmt; int i; /* find output image format */ if (ap && ap->image_format) { img_fmt = ap->image_format; } else { img_fmt = guess_image_format(s->filename); } if (!img_fmt) return -1; i...
1
void qemu_coroutine_enter(Coroutine *co){ Coroutine *self = qemu_coroutine_self(); CoroutineAction ret; trace_qemu_coroutine_enter(self, co, co->entry_arg); if (co->caller) { fprintf(stderr, "Co-routine re-entered recursively\n"); abort(); } co->caller = self; co->ctx = qemu_get_current_aio_context(); /* Store co->ctx ...
1
static void aarch64_cpu_set_pc(CPUState *cs, vaddr value){ ARMCPU *cpu = ARM_CPU(cs); /* * TODO: this will need updating for system emulation, * when the core may be in AArch32 mode. */ cpu->env.pc = value;}
1
static struct iovec *cap_sg(struct iovec *sg, int cap, int *cnt){ int i; int total = 0; for (i = 0; i < *cnt; i++) { if ((total + sg[i].iov_len) > cap) { sg[i].iov_len -= ((total + sg[i].iov_len) - cap); i++; break; } total += sg[i].iov_len; } *cnt = i; return sg;}
1
void mcf_fec_init(NICInfo *nd, target_phys_addr_t base, qemu_irq *irq){ mcf_fec_state *s; qemu_check_nic_model(nd, "mcf_fec"); s = (mcf_fec_state *)qemu_mallocz(sizeof(mcf_fec_state)); s->irq = irq; s->mmio_index = cpu_register_io_memory(mcf_fec_readfn, mcf_fec_writefn, s); cpu_register_physical_memory(base, 0x400, s->...
1
static int opt_sameq(void *optctx, const char *opt, const char *arg){ av_log(NULL, AV_LOG_WARNING, "Ignoring option '%s'\n", opt); return 0;}
1
static inline void yuv2nv12XinC(int16_t *lumFilter, int16_t **lumSrc, int lumFilterSize,int16_t *chrFilter, int16_t **chrSrc, int chrFilterSize,uint8_t *dest, uint8_t *uDest, int dstW, int chrDstW, int dstFormat){//FIXME Optimize (just quickly writen not opti..)int i;for(i=0; i<dstW; i++){int val=1<<18;int j;for(j=0; j...
0
static void lowpass_line_complex_c(uint8_t *dstp, ptrdiff_t width, const uint8_t *srcp, ptrdiff_t mref, ptrdiff_t pref){ const uint8_t *srcp_above = srcp + mref; const uint8_t *srcp_below = srcp + pref; const uint8_t *srcp_above2 = srcp + mref * 2; const uint8_t *srcp_below2 = srcp + pref * 2; int i; for (i = 0; i < wi...
0
static void pic_write(void *opaque, target_phys_addr_t addr, uint64_t value, unsigned size){ HeathrowPICS *s = opaque; HeathrowPIC *pic; unsigned int n; n = ((addr & 0xfff) - 0x10) >> 4; PIC_DPRINTF("writel: " TARGET_FMT_plx " %u: %08x\n", addr, n, value); if (n >= 2) return; pic = &s->pics[n]; switch(addr & 0xf) { cas...
0
static void tcg_out_jxx(TCGContext *s, int opc, int label_index, int small){ int32_t val, val1; TCGLabel *l = &s->labels[label_index]; if (l->has_value) { val = tcg_pcrel_diff(s, l->u.value_ptr); val1 = val - 2; if ((int8_t)val1 == val1) { if (opc == -1) { tcg_out8(s, OPC_JMP_short); } else { tcg_out8(s, OPC_JCC_short ...
0
hwaddr ppc_hash32_get_phys_page_debug(CPUPPCState *env, target_ulong addr){ struct mmu_ctx_hash32 ctx; if (unlikely(ppc_hash32_get_physical_address(env, &ctx, addr, 0, ACCESS_INT) != 0)) { return -1; } return ctx.raddr & TARGET_PAGE_MASK;}
0
static int vhdx_log_write(BlockDriverState *bs, BDRVVHDXState *s, void *data, uint32_t length, uint64_t offset){ int ret = 0; void *buffer = NULL; void *merged_sector = NULL; void *data_tmp, *sector_write; unsigned int i; int sector_offset; uint32_t desc_sectors, sectors, total_length; uint32_t sectors_written = 0; uin...
0
Aml *aml_index(Aml *arg1, Aml *idx){ Aml *var = aml_opcode(0x88 /* IndexOp */); aml_append(var, arg1); aml_append(var, idx); build_append_byte(var->buf, 0x00 /* NullNameOp */); return var;}
0
static void timer_write(void *opaque, target_phys_addr_t addr, uint64_t value, unsigned size){ LM32TimerState *s = opaque; trace_lm32_timer_memory_write(addr, value); addr >>= 2; switch (addr) { case R_SR: s->regs[R_SR] &= ~SR_TO; break; case R_CR: s->regs[R_CR] = value; if (s->regs[R_CR] & CR_START) { ptimer_run(s->pt...
0
static inline void menelaus_rtc_start(MenelausState *s){ s->rtc.next += qemu_get_clock(rt_clock); qemu_mod_timer(s->rtc.hz_tm, s->rtc.next);}
0
static void test_visitor_in_alternate_number(TestInputVisitorData *data, const void *unused){ Visitor *v; Error *err = NULL; AltStrBool *asb; AltStrNum *asn; AltNumStr *ans; AltStrInt *asi; AltIntNum *ain; AltNumInt *ani; /* Parsing an int */ v = visitor_input_test_init(data, "42"); visit_type_AltStrBool(v, &asb, NULL,...
0
static int zipl_run(struct scsi_blockptr *pte){ struct component_header *header; struct component_entry *entry; uint8_t tmp_sec[SECTOR_SIZE]; virtio_read(pte->blockno, tmp_sec); header = (struct component_header *)tmp_sec; if (!zipl_magic(tmp_sec)) { goto fail; } if (header->type != ZIPL_COMP_HEADER_IPL) { goto fail; }...
0
static int udp_write(URLContext *h, const uint8_t *buf, int size){ UDPContext *s = h->priv_data; int ret; for(;;) { if (!s->is_connected) { ret = sendto (s->udp_fd, buf, size, 0, (struct sockaddr *) &s->dest_addr, s->dest_addr_len); } else ret = send(s->udp_fd, buf, size, 0); if (ret < 0) { if (ff_neterrno() != AVERROR...
0
static int megasas_cache_flush(MegasasState *s, MegasasCmd *cmd){ bdrv_drain_all(); return MFI_STAT_OK;}
0
static void test_visitor_in_fail_list_nested(TestInputVisitorData *data, const void *unused){ int64_t i64 = -1; Visitor *v; /* Unvisited nested list tail */ v = visitor_input_test_init(data, "[ 0, [ 1, 2, 3 ] ]"); visit_start_list(v, NULL, NULL, 0, &error_abort); visit_type_int(v, NULL, &i64, &error_abort); g_assert_cm...
0
static void mptsas_scsi_uninit(PCIDevice *dev){ MPTSASState *s = MPT_SAS(dev); qemu_bh_delete(s->request_bh); if (s->msi_in_use) { msi_uninit(dev); }}
0
static unsigned int dec_swap_r(DisasContext *dc){TCGv t0;#if DISAS_CRISchar modename[4];#endifDIS(fprintf (logfile, "swap%s $r%u\n", swapmode_name(dc->op2, modename), dc->op1));cris_cc_mask(dc, CC_MASK_NZ);t0 = tcg_temp_new(TCG_TYPE_TL);t_gen_mov_TN_reg(t0, dc->op1);if (dc->op2 & 8)tcg_gen_not_tl(t0, t0);if (dc->op2 & ...
0
static void test_visitor_in_number(TestInputVisitorData *data, const void *unused){ double res = 0, value = 3.14; Visitor *v; v = visitor_input_test_init(data, "%f", value); visit_type_number(v, NULL, &res, &error_abort); g_assert_cmpfloat(res, ==, value);}
0
static int protocol_client_auth(VncState *vs, uint8_t *data, size_t len){ /* We only advertise 1 auth scheme at a time, so client * must pick the one we sent. Verify this */ if (data[0] != vs->vd->auth) { /* Reject auth */ VNC_DEBUG("Reject auth %d\n", (int)data[0]); vnc_write_u32(vs, 1); if (vs->minor >= 8) { static c...
0
BlockAIOCB *bdrv_aio_readv(BlockDriverState *bs, int64_t sector_num, QEMUIOVector *qiov, int nb_sectors, BlockCompletionFunc *cb, void *opaque){ trace_bdrv_aio_readv(bs, sector_num, nb_sectors, opaque); return bdrv_co_aio_rw_vector(bs, sector_num, qiov, nb_sectors, 0, cb, opaque, false);}
0
static int do_qmp_capabilities(Monitor *mon, const QDict *params, QObject **ret_data){ /* Will setup QMP capabilities in the future */ if (monitor_ctrl_mode(mon)) { mon->qmp.command_mode = 1; } return 0;}
0
int vhdx_log_write_and_flush(BlockDriverState *bs, BDRVVHDXState *s, void *data, uint32_t length, uint64_t offset){ int ret = 0; VHDXLogSequence logs = { .valid = true, .count = 1, .hdr = { 0 } }; /* Make sure data written (new and/or changed blocks) is stable * on disk, before creating log entry */ bdrv_flush(bs); ret...
0
static bool release_pending(sPAPRDRConnector *drc){ return drc->awaiting_release;}
0
void dp83932_init(NICInfo *nd, target_phys_addr_t base, int it_shift, MemoryRegion *address_space, qemu_irq irq, void* mem_opaque, void (*memory_rw)(void *opaque, target_phys_addr_t addr, uint8_t *buf, int len, int is_write)){ dp8393xState *s; qemu_check_nic_model(nd, "dp83932"); s = g_malloc0(sizeof(dp8393xState)); s-...
0
int net_init_l2tpv3(const NetClientOptions *opts, const char *name, NetClientState *peer, Error **errp){ /* FIXME error_setg(errp, ...) on failure */ const NetdevL2TPv3Options *l2tpv3; NetL2TPV3State *s; NetClientState *nc; int fd = -1, gairet; struct addrinfo hints; struct addrinfo *result = NULL; char *srcport, *dstp...
0
CPUDebugExcpHandler *cpu_set_debug_excp_handler(CPUDebugExcpHandler *handler){ CPUDebugExcpHandler *old_handler = debug_excp_handler; debug_excp_handler = handler; return old_handler;}
0
av_cold int ff_vp56_init_context(AVCodecContext *avctx, VP56Context *s, int flip, int has_alpha){ int i; s->avctx = avctx; avctx->pix_fmt = has_alpha ? AV_PIX_FMT_YUVA420P : AV_PIX_FMT_YUV420P; if (avctx->skip_alpha) avctx->pix_fmt = AV_PIX_FMT_YUV420P; ff_h264chroma_init(&s->h264chroma, 8); ff_hpeldsp_init(&s->hdsp, a...
0
static av_always_inline void dist_scale(HEVCContext *s, Mv *mv, int min_pu_width, int x, int y, int elist, int ref_idx_curr, int ref_idx){ RefPicList *refPicList = s->ref->refPicList; MvField *tab_mvf = s->ref->tab_mvf; int ref_pic_elist = refPicList[elist].list[TAB_MVF(x, y).ref_idx[elist]]; int ref_pic_curr = refPicL...
0
static int rm_write_video(AVFormatContext *s, const uint8_t *buf, int size){ RMContext *rm = s->priv_data; ByteIOContext *pb = &s->pb; StreamInfo *stream = rm->video_stream; int key_frame = stream->enc->coded_frame->key_frame; /* XXX: this is incorrect: should be a parameter */ /* Well, I spent some time finding the me...