label
int64
0
1
func1
stringlengths
23
97k
id
int64
0
27.3k
0
static int coroutine_fn nfs_co_readv(BlockDriverState *bs, int64_t sector_num, int nb_sectors, QEMUIOVector *iov) { NFSClient *client = bs->opaque; NFSRPC task; nfs_co_init_task(client, &task); task.iov = iov; if (nfs_pread_async(client->context, client->fh, sector_num * BDRV_SECTOR_SIZE, nb_sectors * BDRV_SECTOR_SIZE,...
11,950
0
int scsi_req_parse(SCSIRequest *req, uint8_t *buf) { int rc; if (req->dev->type == TYPE_TAPE) { rc = scsi_req_stream_length(&req->cmd, req->dev, buf); } else { rc = scsi_req_length(&req->cmd, req->dev, buf); } if (rc != 0) return rc; assert(buf == req->cmd.buf); scsi_cmd_xfer_mode(&req->cmd); req->cmd.lba = scsi_cmd_lb...
11,951
0
void virtqueue_map_sg(struct iovec *sg, hwaddr *addr, size_t num_sg, int is_write) { unsigned int i; hwaddr len; if (num_sg >= VIRTQUEUE_MAX_SIZE) { error_report("virtio: map attempt out of bounds: %zd > %d", num_sg, VIRTQUEUE_MAX_SIZE); exit(1); } for (i = 0; i < num_sg; i++) { len = sg[i].iov_len; sg[i].iov_base = cp...
11,952
0
static inline void gen_op_fcmpeq(int fccno) { switch (fccno) { case 0: gen_helper_fcmpeq(cpu_env); break; case 1: gen_helper_fcmpeq_fcc1(cpu_env); break; case 2: gen_helper_fcmpeq_fcc2(cpu_env); break; case 3: gen_helper_fcmpeq_fcc3(cpu_env); break; } }
11,953
0
static bool pc_machine_get_vmport(Object *obj, Error **errp) { PCMachineState *pcms = PC_MACHINE(obj); return pcms->vmport; }
11,954
0
pvscsi_convert_sglist(PVSCSIRequest *r) { int chunk_size; uint64_t data_length = r->req.dataLen; PVSCSISGState sg = r->sg; while (data_length) { while (!sg.resid) { pvscsi_get_next_sg_elem(&sg); trace_pvscsi_convert_sglist(r->req.context, r->sg.dataAddr, r->sg.resid); } assert(data_length > 0); chunk_size = MIN((unsign...
11,956
0
static void av_estimate_timings_from_pts(AVFormatContext *ic) { AVPacket pkt1, *pkt = &pkt1; AVStream *st; int read_size, i, ret; int64_t start_time, end_time, end_time1; int64_t filesize, offset, duration; /* we read the first packets to get the first PTS (not fully accurate, but it is enough now) */ url_fseek(&ic->pb...
11,959
0
bool qemu_clock_run_all_timers(void) { bool progress = false; QEMUClockType type; for (type = 0; type < QEMU_CLOCK_MAX; type++) { progress |= qemu_clock_run_timers(type); } return progress; }
11,960
0
static int put_uint64_as_uint32(QEMUFile *f, void *pv, size_t size, VMStateField *field, QJSON *vmdesc) { uint64_t *v = pv; qemu_put_be32(f, *v); return 0; }
11,961
0
static void scsi_dma_restart_bh(void *opaque) { SCSIDevice *s = opaque; SCSIRequest *req, *next; qemu_bh_delete(s->bh); s->bh = NULL; QTAILQ_FOREACH_SAFE(req, &s->requests, next, next) { scsi_req_ref(req); if (req->retry) { req->retry = false; switch (req->cmd.mode) { case SCSI_XFER_FROM_DEV: case SCSI_XFER_TO_DEV: scs...
11,962
0
static uint64_t get_guest_rtc_ns(RTCState *s) { uint64_t guest_rtc; uint64_t guest_clock = qemu_clock_get_ns(rtc_clock); guest_rtc = s->base_rtc * NANOSECONDS_PER_SECOND + guest_clock - s->last_update + s->offset; return guest_rtc; }
11,964
0
static void openpic_reset(DeviceState *d) { OpenPICState *opp = FROM_SYSBUS(typeof (*opp), sysbus_from_qdev(d)); int i; opp->glbc = GLBC_RESET; /* Initialise controller registers */ opp->frep = ((opp->nb_irqs -1) << FREP_NIRQ_SHIFT) | ((opp->nb_cpus -1) << FREP_NCPU_SHIFT) | (opp->vid << FREP_VID_SHIFT); opp->pint = 0;...
11,966
0
static inline int handle_cpu_signal(unsigned long pc, unsigned long address, int is_write, sigset_t *old_set, void *puc) { TranslationBlock *tb; int ret; if (cpu_single_env) env = cpu_single_env; /* XXX: find a correct solution for multithread */ #if defined(DEBUG_SIGNAL) printf("qemu: SIGSEGV pc=0x%08lx address=%08lx ...
11,967
0
static int scan_mmco_reset(AVCodecParserContext *s, GetBitContext *gb) { H264PredWeightTable pwt; int slice_type_nos = s->pict_type & 3; H264ParseContext *p = s->priv_data; H264Context *h = &p->h; int list_count, ref_count[2]; if (h->pps.redundant_pic_cnt_present) get_ue_golomb(gb); // redundant_pic_count if (slice_typ...
11,970
0
void helper_memalign(uint32_t addr, uint32_t dr, uint32_t wr, uint32_t size) { uint32_t mask; switch (size) { case 4: mask = 3; break; case 2: mask = 1; break; default: case 1: mask = 0; break; } if (addr & mask) { qemu_log("unaligned access addr=%x size=%d, wr=%d\n", addr, size, wr); if (!(env->sregs[SR_MSR] & MSR_EE)...
11,971
0
static inline bool bdrv_req_is_aligned(BlockDriverState *bs, int64_t offset, size_t bytes) { int64_t align = bdrv_get_align(bs); return !(offset & (align - 1) || (bytes & (align - 1))); }
11,972
0
static inline int tcg_gen_code_common(TCGContext *s, uint8_t *gen_code_buf, long search_pc) { int opc, op_index, macro_op_index; const TCGOpDef *def; unsigned int dead_iargs; const TCGArg *args; #ifdef DEBUG_DISAS if (unlikely(loglevel & CPU_LOG_TB_OP)) { fprintf(logfile, "OP:\n"); tcg_dump_ops(s, logfile); fprintf(log...
11,973
0
static uint32_t set_isolation_state(sPAPRDRConnector *drc, sPAPRDRIsolationState state) { trace_spapr_drc_set_isolation_state(spapr_drc_index(drc), state); /* if the guest is configuring a device attached to this DRC, we * should reset the configuration state at this point since it may * no longer be reliable (guest re...
11,974
1
static void vnc_listen_read(void *opaque) { VncDisplay *vs = opaque; struct sockaddr_in addr; socklen_t addrlen = sizeof(addr); /* Catch-up */ vga_hw_update(); int csock = accept(vs->lsock, (struct sockaddr *)&addr, &addrlen); if (csock != -1) { vnc_connect(vs, csock); } }
11,976
0
static av_cold int qdm2_decode_init(AVCodecContext *avctx) { QDM2Context *s = avctx->priv_data; uint8_t *extradata; int extradata_size; int tmp_val, tmp, size; /* extradata parsing Structure: wave { frma (QDM2) QDCA QDCP } 32 size (including this field) 32 tag (=frma) 32 type (=QDM2 or QDMC) 32 size (including this fie...
11,977
0
void MPV_frame_end(MpegEncContext *s) { /* draw edge for correct motion prediction if outside */ if (s->pict_type != B_TYPE && !s->intra_only) { if(s->avctx==NULL || s->avctx->codec->id!=CODEC_ID_MPEG4 || s->divx_version==500){ draw_edges(s->current_picture[0], s->linesize, s->mb_width*16, s->mb_height*16, EDGE_WIDTH);...
11,982
1
void qmp_memchar_write(const char *device, int64_t size, const char *data, bool has_format, enum DataFormat format, Error **errp) { CharDriverState *chr; guchar *write_data; int ret; gsize write_count; chr = qemu_chr_find(device); if (!chr) { error_set(errp, QERR_DEVICE_NOT_FOUND, device); return; } if (qemu_is_chr(chr...
11,986
1
kern_return_t GetBSDPath( io_iterator_t mediaIterator, char *bsdPath, CFIndex maxPathSize ) { io_object_t nextMedia; kern_return_t kernResult = KERN_FAILURE; *bsdPath = '\0'; nextMedia = IOIteratorNext( mediaIterator ); if ( nextMedia ) { CFTypeRef bsdPathAsCFString; bsdPathAsCFString = IORegistryEntryCreateCFProperty(...
11,987
1
static void host_x86_cpu_class_init(ObjectClass *oc, void *data) { DeviceClass *dc = DEVICE_CLASS(oc); X86CPUClass *xcc = X86_CPU_CLASS(oc); uint32_t eax = 0, ebx = 0, ecx = 0, edx = 0; xcc->kvm_required = true; host_cpuid(0x0, 0, &eax, &ebx, &ecx, &edx); x86_cpu_vendor_words2str(host_cpudef.vendor, ebx, edx, ecx); hos...
11,989
1
int ff_http_do_new_request(URLContext *h, const char *uri) { HTTPContext *s = h->priv_data; AVDictionary *options = NULL; int ret; ret = http_shutdown(h, h->flags); if (ret < 0) return ret; s->end_chunked_post = 0; s->chunkend = 0; s->off = 0; s->icy_data_read = 0; av_free(s->location); s->location = av_strdup(uri); if...
11,990
1
uint_fast16_t float32_to_uint16_round_to_zero(float32 a STATUS_PARAM) { int64_t v; uint_fast16_t res; v = float32_to_int64_round_to_zero(a STATUS_VAR); if (v < 0) { res = 0; float_raise( float_flag_invalid STATUS_VAR); } else if (v > 0xffff) { res = 0xffff; float_raise( float_flag_invalid STATUS_VAR); } else { res = v;...
11,991
1
static int hda_codec_dev_init(DeviceState *qdev, DeviceInfo *base) { HDACodecBus *bus = DO_UPCAST(HDACodecBus, qbus, qdev->parent_bus); HDACodecDevice *dev = DO_UPCAST(HDACodecDevice, qdev, qdev); HDACodecDeviceInfo *info = DO_UPCAST(HDACodecDeviceInfo, qdev, base); dev->info = info; if (dev->cad == -1) { dev->cad = bu...
11,992
1
static void setup_frame_v1(int usig, struct target_sigaction *ka, target_sigset_t *set, CPUARMState *regs) { struct sigframe_v1 *frame; abi_ulong frame_addr = get_sigframe(ka, regs, sizeof(*frame)); int i; if (!lock_user_struct(VERIFY_WRITE, frame, frame_addr, 0)) return; setup_sigcontext(&frame->sc, regs, set->sig[0])...
11,993
1
qcrypto_tls_creds_x509_init(Object *obj) { object_property_add_bool(obj, "loaded", qcrypto_tls_creds_x509_prop_get_loaded, qcrypto_tls_creds_x509_prop_set_loaded, }
11,994
1
int qcow2_alloc_cluster_offset(BlockDriverState *bs, uint64_t offset, int n_start, int n_end, int *num, uint64_t *host_offset, QCowL2Meta **m) { BDRVQcowState *s = bs->opaque; uint64_t start, remaining; uint64_t cluster_offset; uint64_t cur_bytes; int ret; trace_qcow2_alloc_clusters_offset(qemu_coroutine_self(), offset...
11,995
0
static int thread_get_buffer_internal(AVCodecContext *avctx, ThreadFrame *f, int flags) { PerThreadContext *p = avctx->thread_opaque; int err; f->owner = avctx; ff_init_buffer_info(avctx, f->f); if (!(avctx->active_thread_type & FF_THREAD_FRAME)) return ff_get_buffer(avctx, f->f, flags); if (p->state != STATE_SETTING_U...
11,996
1
static void xio3130_downstream_realize(PCIDevice *d, Error **errp) { PCIEPort *p = PCIE_PORT(d); PCIESlot *s = PCIE_SLOT(d); int rc; pci_bridge_initfn(d, TYPE_PCIE_BUS); pcie_port_init_reg(d); rc = msi_init(d, XIO3130_MSI_OFFSET, XIO3130_MSI_NR_VECTOR, XIO3130_MSI_SUPPORTED_FLAGS & PCI_MSI_FLAGS_64BIT, XIO3130_MSI_SUPP...
11,997
1
static int qcow_write(BlockDriverState *bs, int64_t sector_num, const uint8_t *buf, int nb_sectors) { BDRVQcowState *s = bs->opaque; int ret, index_in_cluster, n; uint64_t cluster_offset; int n_end; while (nb_sectors > 0) { index_in_cluster = sector_num & (s->cluster_sectors - 1); n_end = index_in_cluster + nb_sectors;...
11,999
1
static void vnc_dpy_resize(DisplayState *ds) { int size_changed; VncState *vs = ds->opaque; vs->old_data = qemu_realloc(vs->old_data, ds_get_linesize(ds) * ds_get_height(ds)); if (vs->old_data == NULL) { fprintf(stderr, "vnc: memory allocation failed\n"); exit(1); } if (ds_get_bytes_per_pixel(ds) != vs->depth) console_...
12,000
1
static inline int cris_bound_b(int v, int b) { int r = v; asm ("bound.b\t%1, %0\n" : "+r" (r) : "ri" (b)); return r; }
12,001
1
static int virtio_ccw_hcall_notify(const uint64_t *args) { uint64_t subch_id = args[0]; uint64_t queue = args[1]; SubchDev *sch; int cssid, ssid, schid, m; if (ioinst_disassemble_sch_ident(subch_id, &m, &cssid, &ssid, &schid)) { sch = css_find_subch(m, cssid, ssid, schid); if (!sch || !css_subch_visible(sch)) { virtio_...
12,002
1
static int dirac_decode_frame_internal(DiracContext *s) { DWTContext d; int y, i, comp, dsty; int ret; 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 (...
12,003
0
static int mov_read_seek(AVFormatContext *s, int stream_index, int64_t sample_time, int flags) { MOVContext* mov = (MOVContext *) s->priv_data; MOVStreamContext* sc; int32_t i, a, b, m; int64_t start_time; int32_t seek_sample, sample; int32_t duration; int32_t count; int32_t chunk; int32_t left_in_chunk; int64_t chunk_...
12,005
0
static always_inline int dv_rl2vlc_size(int run, int l) { int level = (l ^ (l >> 8)) - (l >> 8); int size; if (run < DV_VLC_MAP_RUN_SIZE && level < DV_VLC_MAP_LEV_SIZE) { size = dv_vlc_map[run][level].size; } else { size = (level < DV_VLC_MAP_LEV_SIZE) ? dv_vlc_map[0][level].size : 16; if (run) { size += (run < 16) ? d...
12,007
0
static int dxtory_decode_v2_444(AVCodecContext *avctx, AVFrame *pic, const uint8_t *src, int src_size) { GetByteContext gb; GetBitContext gb2; int nslices, slice, slice_height; uint32_t off, slice_size; uint8_t *Y, *U, *V; int ret; bytestream2_init(&gb, src, src_size); nslices = bytestream2_get_le16(&gb); off = FFALIGN...
12,008
0
int ff_nvenc_encode_frame(AVCodecContext *avctx, AVPacket *pkt, const AVFrame *frame, int *got_packet) { NVENCSTATUS nv_status; CUresult cu_res; CUcontext dummy; NvencSurface *tmpoutsurf, *inSurf; int res; NvencContext *ctx = avctx->priv_data; NvencDynLoadFunctions *dl_fn = &ctx->nvenc_dload_funcs; NV_ENCODE_API_FUNCTI...
12,009
0
static int get_cox(Jpeg2000DecoderContext *s, Jpeg2000CodingStyle *c) { uint8_t byte; if (s->buf_end - s->buf < 5) return AVERROR(EINVAL); c->nreslevels = bytestream_get_byte(&s->buf) + 1; // num of resolution levels - 1 /* compute number of resolution levels to decode */ if (c->nreslevels < s->reduction_factor) c->nre...
12,010
0
static void start_frame(AVFilterLink *inlink, AVFilterBufferRef *picref) { AVFilterContext *ctx = inlink->dst; TInterlaceContext *tinterlace = ctx->priv; if (tinterlace->cur) avfilter_unref_buffer(tinterlace->cur); tinterlace->cur = tinterlace->next; tinterlace->next = picref; }
12,011
0
static int mov_read_trun(MOVContext *c, ByteIOContext *pb, MOVAtom atom) { MOVFragment *frag = &c->fragment; AVStream *st = NULL; MOVStreamContext *sc; uint64_t offset; int64_t dts; int data_offset = 0; unsigned entries, first_sample_flags = frag->flags; int flags, distance, i; for (i = 0; i < c->fc->nb_streams; i++) {...
12,012
0
void dsputil_init_ppc(DSPContext* c, AVCodecContext *avctx) { // Common optimizations whether Altivec is available or not switch (check_dcbzl_effect()) { case 32: c->clear_blocks = clear_blocks_dcbz32_ppc; break; case 128: c->clear_blocks = clear_blocks_dcbz128_ppc; break; default: break; } #if HAVE_ALTIVEC if (has_alt...
12,013
0
static inline void RENAME(rgb24tobgr15)(const uint8_t *src, uint8_t *dst, long src_size) { const uint8_t *s = src; const uint8_t *end; #if COMPILE_TEMPLATE_MMX const uint8_t *mm_end; #endif uint16_t *d = (uint16_t *)dst; end = s + src_size; #if COMPILE_TEMPLATE_MMX __asm__ volatile(PREFETCH" %0"::"m"(*src):"memory"); _...
12,014
0
static double compute_target_delay(double delay, VideoState *is) { double sync_threshold, diff; /* update delay to follow master synchronisation source */ if (get_master_sync_type(is) != AV_SYNC_VIDEO_MASTER) { /* if video is slave, we try to correct big delays by duplicating or deleting a frame */ diff = get_video_clo...
12,015
0
static OutputStream *new_output_stream(OptionsContext *o, AVFormatContext *oc, enum AVMediaType type) { OutputStream *ost; AVStream *st = avformat_new_stream(oc, NULL); int idx = oc->nb_streams - 1, ret = 0; int64_t max_frames = INT64_MAX; char *bsf = NULL, *next, *codec_tag = NULL; AVBitStreamFilterContext *bsfc, *bsf...
12,016
0
static unsigned int dec_lz_r(DisasContext *dc) { TCGv t0; DIS(fprintf (logfile, "lz $r%u, $r%u\n", dc->op1, dc->op2)); cris_cc_mask(dc, CC_MASK_NZ); t0 = tcg_temp_new(TCG_TYPE_TL); dec_prep_alu_r(dc, dc->op1, dc->op2, 4, 0, cpu_R[dc->op2], t0); cris_alu(dc, CC_OP_LZ, cpu_R[dc->op2], cpu_R[dc->op2], t0, 4); tcg_temp_fre...
12,017
0
int av_picture_pad(AVPicture *dst, const AVPicture *src, int height, int width, enum PixelFormat pix_fmt, int padtop, int padbottom, int padleft, int padright, int *color) { uint8_t *optr; int y_shift; int x_shift; int yheight; int i, y; if (pix_fmt < 0 || pix_fmt >= PIX_FMT_NB || !is_yuv_planar(&pix_fmt_info[pix_fmt])...
12,018
0
void ppc_hash64_stop_access(uint64_t token) { if (kvmppc_kern_htab) { kvmppc_hash64_free_pteg(token); } }
12,019
0
void helper_sysret(CPUX86State *env, int dflag) { int cpl, selector; if (!(env->efer & MSR_EFER_SCE)) { raise_exception_err(env, EXCP06_ILLOP, 0); } cpl = env->hflags & HF_CPL_MASK; if (!(env->cr[0] & CR0_PE_MASK) || cpl != 0) { raise_exception_err(env, EXCP0D_GPF, 0); } selector = (env->star >> 48) & 0xffff; if (env->...
12,020
0
static int handle_sigp(S390CPU *cpu, struct kvm_run *run, uint8_t ipa1) { CPUS390XState *env = &cpu->env; uint8_t order_code; uint16_t cpu_addr; int r = -1; S390CPU *target_cpu; cpu_synchronize_state(CPU(cpu)); /* get order code */ order_code = decode_basedisp_rs(env, run->s390_sieic.ipb) & SIGP_ORDER_MASK; cpu_addr = ...
12,021
0
static void dump_ops(const uint16_t *opc_buf) { const uint16_t *opc_ptr; int c; opc_ptr = opc_buf; for(;;) { c = *opc_ptr++; fprintf(logfile, "0x%04x: %s\n", opc_ptr - opc_buf - 1, op_str[c]); if (c == INDEX_op_end) break; } }
12,022
0
static int tap_set_sndbuf(TAPState *s, const char *sndbuf_str) { int sndbuf = TAP_DEFAULT_SNDBUF; if (sndbuf_str) { sndbuf = atoi(sndbuf_str); } if (!sndbuf) { sndbuf = INT_MAX; } if (ioctl(s->fd, TUNSETSNDBUF, &sndbuf) == -1 && sndbuf_str) { qemu_error("TUNSETSNDBUF ioctl failed: %s\n", strerror(errno)); return -1; } ...
12,024
0
static void virtex_init(MachineState *machine) { ram_addr_t ram_size = machine->ram_size; const char *cpu_model = machine->cpu_model; const char *kernel_filename = machine->kernel_filename; const char *kernel_cmdline = machine->kernel_cmdline; hwaddr initrd_base = 0; int initrd_size = 0; MemoryRegion *address_space_mem...
12,025
0
static void pxa2xx_i2c_write(void *opaque, hwaddr addr, uint64_t value64, unsigned size) { PXA2xxI2CState *s = (PXA2xxI2CState *) opaque; uint32_t value = value64; int ack; addr -= s->offset; switch (addr) { case ICR: s->control = value & 0xfff7; if ((value & (1 << 3)) && (value & (1 << 6))) { /* TB and IUE */ /* TODO:...
12,027
0
static void ptimer_trigger(ptimer_state *s) { if (s->bh) { qemu_bh_schedule(s->bh); } }
12,028
0
static int prepare_input_packet(AVFormatContext *s, AVPacket *pkt) { int ret; ret = check_packet(s, pkt); if (ret < 0) return ret; #if !FF_API_COMPUTE_PKT_FIELDS2 /* sanitize the timestamps */ if (!(s->oformat->flags & AVFMT_NOTIMESTAMPS)) { AVStream *st = s->streams[pkt->stream_index]; /* when there is no reordering (...
12,029
0
build_tpm2(GArray *table_data, GArray *linker) { Acpi20TPM2 *tpm2_ptr; tpm2_ptr = acpi_data_push(table_data, sizeof *tpm2_ptr); tpm2_ptr->platform_class = cpu_to_le16(TPM2_ACPI_CLASS_CLIENT); tpm2_ptr->control_area_address = cpu_to_le64(0); tpm2_ptr->start_method = cpu_to_le32(TPM2_START_METHOD_MMIO); build_header(link...
12,031
0
static int proxy_statfs(FsContext *s, V9fsPath *fs_path, struct statfs *stbuf) { int retval; retval = v9fs_request(s->private, T_STATFS, stbuf, "s", fs_path); if (retval < 0) { errno = -retval; return -1; } return retval; }
12,032
0
BusState *qbus_create(BusType type, size_t size, DeviceState *parent, const char *name) { BusState *bus; bus = qemu_mallocz(size); bus->type = type; bus->parent = parent; bus->name = qemu_strdup(name); LIST_INIT(&bus->children); if (parent) { LIST_INSERT_HEAD(&parent->child_bus, bus, sibling); } return bus; }
12,033
0
static void update_sr (AC97LinkState *s, AC97BusMasterRegs *r, uint32_t new_sr) { int event = 0; int level = 0; uint32_t new_mask = new_sr & SR_INT_MASK; uint32_t old_mask = r->sr & SR_INT_MASK; uint32_t masks[] = {GS_PIINT, GS_POINT, GS_MINT}; if (new_mask ^ old_mask) { /** @todo is IRQ deasserted when only one of sta...
12,034
0
static unsigned int dec_subu_r(DisasContext *dc) { TCGv t0; int size = memsize_z(dc); DIS(fprintf (logfile, "subu.%c $r%u, $r%u\n", memsize_char(size), dc->op1, dc->op2)); cris_cc_mask(dc, CC_MASK_NZVC); t0 = tcg_temp_new(TCG_TYPE_TL); /* Size can only be qi or hi. */ t_gen_zext(t0, cpu_R[dc->op1], size); cris_alu(dc, ...
12,035
0
bool cpu_physical_memory_is_io(hwaddr phys_addr) { MemoryRegionSection *section; section = phys_page_find(address_space_memory.dispatch, phys_addr >> TARGET_PAGE_BITS); return !(memory_region_is_ram(section->mr) || memory_region_is_romd(section->mr)); }
12,037
0
int kvm_cpu_exec(CPUState *env) { struct kvm_run *run = env->kvm_run; int ret; DPRINTF("kvm_cpu_exec()\n"); if (kvm_arch_process_irqchip_events(env)) { env->exit_request = 0; env->exception_index = EXCP_HLT; return 0; } do { if (env->kvm_vcpu_dirty) { kvm_arch_put_registers(env, KVM_PUT_RUNTIME_STATE); env->kvm_vcpu_di...
12,039
0
static void rtsp_send_cmd(AVFormatContext *s, const char *cmd, RTSPHeader *reply, unsigned char **content_ptr) { RTSPState *rt = s->priv_data; char buf[4096], buf1[1024], *q; unsigned char ch; const char *p; int content_length, line_count; unsigned char *content = NULL; memset(reply, 0, sizeof(RTSPHeader)); rt->seq++; ...
12,040
0
static void hb_regs_write(void *opaque, target_phys_addr_t offset, uint64_t value, unsigned size) { uint32_t *regs = opaque; if (offset == 0xf00) { if (value == 1 || value == 2) { qemu_system_reset_request(); } else if (value == 3) { qemu_system_shutdown_request(); } } regs[offset/4] = value; }
12,042
0
static int print_size(DeviceState *dev, Property *prop, char *dest, size_t len) { uint64_t *ptr = qdev_get_prop_ptr(dev, prop); char suffixes[] = {'T', 'G', 'M', 'K', 'B'}; int i = 0; uint64_t div; for (div = 1ULL << 40; !(*ptr / div) ; div >>= 10) { i++; } return snprintf(dest, len, "%0.03f%c", (double)*ptr/div, suffi...
12,043
0
float64 HELPER(sub_cmp_f64)(CPUState *env, float64 a, float64 b) { /* ??? This may incorrectly raise exceptions. */ /* ??? Should flush denormals to zero. */ float64 res; res = float64_sub(a, b, &env->fp_status); if (float64_is_nan(res)) { /* +/-inf compares equal against itself, but sub returns nan. */ if (!float64_is...
12,044
0
static void trim_aio_cancel(BlockAIOCB *acb) { TrimAIOCB *iocb = container_of(acb, TrimAIOCB, common); /* Exit the loop so ide_issue_trim_cb will not continue */ iocb->j = iocb->qiov->niov - 1; iocb->i = (iocb->qiov->iov[iocb->j].iov_len / 8) - 1; iocb->ret = -ECANCELED; if (iocb->aiocb) { bdrv_aio_cancel_async(iocb->a...
12,045
0
static uint64_t cadence_ttc_read(void *opaque, target_phys_addr_t offset, unsigned size) { uint32_t ret = cadence_ttc_read_imp(opaque, offset); DB_PRINT("addr: %08x data: %08x\n", offset, ret); return ret; }
12,046
0
static void scsi_do_read(void *opaque, int ret) { SCSIDiskReq *r = opaque; SCSIDiskState *s = DO_UPCAST(SCSIDiskState, qdev, r->req.dev); uint32_t n; if (r->req.aiocb != NULL) { r->req.aiocb = NULL; bdrv_acct_done(s->qdev.conf.bs, &r->acct); } if (ret < 0) { if (scsi_handle_rw_error(r, -ret)) { goto done; } } if (r->re...
12,047
0
void *etraxfs_dmac_init(CPUState *env, target_phys_addr_t base, int nr_channels) { struct fs_dma_ctrl *ctrl = NULL; int i; ctrl = qemu_mallocz(sizeof *ctrl); if (!ctrl) return NULL; ctrl->base = base; ctrl->env = env; ctrl->nr_channels = nr_channels; ctrl->channels = qemu_mallocz(sizeof ctrl->channels[0] * nr_channels)...
12,048
0
void lm4549_write(lm4549_state *s, target_phys_addr_t offset, uint32_t value) { uint16_t *regfile = s->regfile; assert(offset < 128); DPRINTF("write [0x%02x] = 0x%04x\n", offset, value); switch (offset) { case LM4549_Reset: lm4549_reset(s); break; case LM4549_PCM_Front_DAC_Rate: regfile[LM4549_PCM_Front_DAC_Rate] = val...
12,050
0
static void gmc1_motion(MpegEncContext *s, uint8_t *dest_y, uint8_t *dest_cb, uint8_t *dest_cr, uint8_t **ref_picture) { uint8_t *ptr; int offset, src_x, src_y, linesize, uvlinesize; int motion_x, motion_y; int emu=0; motion_x= s->sprite_offset[0][0]; motion_y= s->sprite_offset[0][1]; src_x = s->mb_x * 16 + (motion_x >...
12,051
0
static void mpcore_scu_write(void *opaque, target_phys_addr_t offset, uint64_t value, unsigned size) { mpcore_priv_state *s = (mpcore_priv_state *)opaque; /* SCU */ switch (offset) { case 0: /* Control register. */ s->scu_control = value & 1; break; case 0x0c: /* Invalidate all. */ /* This is a no-op as cache is not em...
12,052
0
static void gen_imull(TCGv a, TCGv b) { TCGv tmp1 = tcg_temp_new(TCG_TYPE_I64); TCGv tmp2 = tcg_temp_new(TCG_TYPE_I64); tcg_gen_ext_i32_i64(tmp1, a); tcg_gen_ext_i32_i64(tmp2, b); tcg_gen_mul_i64(tmp1, tmp1, tmp2); tcg_gen_trunc_i64_i32(a, tmp1); tcg_gen_shri_i64(tmp1, tmp1, 32); tcg_gen_trunc_i64_i32(b, tmp1); }
12,054
1
void ppc40x_chip_reset (CPUState *env) { target_ulong dbsr; printf("Reset PowerPC chip\n"); cpu_ppc_reset(env); /* XXX: TODO reset all internal peripherals */ dbsr = env->spr[SPR_40x_DBSR]; dbsr &= ~0x00000300; dbsr |= 0x00000200; env->spr[SPR_40x_DBSR] = dbsr; cpu_loop_exit(); }
12,057
1
static int thread_get_buffer_internal(AVCodecContext *avctx, ThreadFrame *f, int flags) { PerThreadContext *p = avctx->internal->thread_ctx; int err; f->owner = avctx; ff_init_buffer_info(avctx, f->f); if (!(avctx->active_thread_type & FF_THREAD_FRAME)) return ff_get_buffer(avctx, f->f, flags); if (atomic_load(&p->stat...
12,058
1
static void gen_spr_power5p_lpar(CPUPPCState *env) { #if !defined(CONFIG_USER_ONLY) /* Logical partitionning */ spr_register_kvm(env, SPR_LPCR, "LPCR", &spr_read_generic, &spr_write_lpcr, KVM_REG_PPC_LPCR, LPCR_LPES0 | LPCR_LPES1); #endif }
12,059
1
int inet_connect_opts(QemuOpts *opts, bool block, bool *in_progress, Error **errp) { struct addrinfo *res, *e; int sock = -1; res = inet_parse_connect_opts(opts, errp); if (!res) { return -1; } if (in_progress) { *in_progress = false; } for (e = res; e != NULL; e = e->ai_next) { sock = inet_connect_addr(e, block, in_pr...
12,060
1
static void via_class_init(ObjectClass *klass, void *data) { DeviceClass *dc = DEVICE_CLASS(klass); PCIDeviceClass *k = PCI_DEVICE_CLASS(klass); k->init = vt82c686b_initfn; k->config_write = vt82c686b_write_config; k->vendor_id = PCI_VENDOR_ID_VIA; k->device_id = PCI_DEVICE_ID_VIA_ISA_BRIDGE; k->class_id = PCI_CLASS_BR...
12,061
1
static int vhost_user_reset_device(struct vhost_dev *dev) { VhostUserMsg msg = { .request = VHOST_USER_RESET_OWNER, .flags = VHOST_USER_VERSION, }; vhost_user_write(dev, &msg, NULL, 0); return 0; }
12,062
1
static int vp5_parse_header(VP56Context *s, const uint8_t *buf, int buf_size, int *golden_frame) { VP56RangeCoder *c = &s->c; int rows, cols; ff_vp56_init_range_decoder(&s->c, buf, buf_size); s->framep[VP56_FRAME_CURRENT]->key_frame = !vp56_rac_get(c); vp56_rac_get(c); ff_vp56_init_dequant(s, vp56_rac_gets(c, 6)); if (...
12,063
1
static void spapr_finalize_fdt(sPAPRMachineState *spapr, hwaddr fdt_addr, hwaddr rtas_addr, hwaddr rtas_size) { MachineState *machine = MACHINE(qdev_get_machine()); sPAPRMachineClass *smc = SPAPR_MACHINE_GET_CLASS(machine); const char *boot_device = machine->boot_order; int ret, i; size_t cb = 0; char *bootlist; void *...
12,064
1
static av_cold int avs_decode_init(AVCodecContext * avctx) { avctx->pix_fmt = PIX_FMT_PAL8; return 0; }
12,065
1
CharDriverState *qemu_chr_alloc(ChardevCommon *backend, Error **errp) { CharDriverState *chr = g_malloc0(sizeof(CharDriverState)); qemu_mutex_init(&chr->chr_write_lock); chr->mux_idx = -1; if (backend->has_logfile) { int flags = O_WRONLY | O_CREAT; if (backend->has_logappend && backend->logappend) { flags |= O_APPEND; ...
12,066
1
static int read_block(ALSDecContext *ctx, ALSBlockData *bd) { GetBitContext *gb = &ctx->gb; *bd->shift_lsbs = 0; // read block type flag and read the samples accordingly if (get_bits1(gb)) { if (read_var_block_data(ctx, bd)) return -1; } else { read_const_block_data(ctx, bd); } return 0; }
12,067
1
static bool get_phys_addr(CPUARMState *env, target_ulong address, int 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 to do the...
12,069
1
bool qpci_msix_masked(QPCIDevice *dev, uint16_t entry) { uint8_t addr; uint16_t val; void *vector_addr = dev->msix_table + (entry * PCI_MSIX_ENTRY_SIZE); g_assert(dev->msix_enabled); addr = qpci_find_capability(dev, PCI_CAP_ID_MSIX); g_assert_cmphex(addr, !=, 0); val = qpci_config_readw(dev, addr + PCI_MSIX_FLAGS); if ...
12,070
1
static MegasasCmd *megasas_enqueue_frame(MegasasState *s, hwaddr frame, uint64_t context, int count) { PCIDevice *pcid = PCI_DEVICE(s); MegasasCmd *cmd = NULL; int frame_size = MFI_FRAME_SIZE * 16; hwaddr frame_size_p = frame_size; cmd = megasas_next_frame(s, frame); /* All frames busy */ if (!cmd) { return NULL; } if ...
12,071
1
static int img_commit(int argc, char **argv) { int c, ret, flags; const char *filename, *fmt, *cache, *base; BlockBackend *blk; BlockDriverState *bs, *base_bs; BlockJob *job; bool progress = false, quiet = false, drop = false; bool writethrough; Error *local_err = NULL; CommonBlockJobCBInfo cbi; bool image_opts = false...
12,072
1
static int encode_superframe(AVCodecContext *avctx, AVPacket *avpkt, const AVFrame *frame, int *got_packet_ptr) { WMACodecContext *s = avctx->priv_data; int i, total_gain, ret, error; s->block_len_bits= s->frame_len_bits; //required by non variable block len s->block_len = 1 << s->block_len_bits; apply_window_and_mdct(...
12,073
1
static int ftp_passive_mode(FTPContext *s) { char *res = NULL, *start, *end; int i; const char *command = "PASV\r\n"; const int pasv_codes[] = {227, 501, 0}; /* 501 is incorrect code */ if (ftp_send_command(s, command, pasv_codes, &res) != 227 || !res) goto fail; start = NULL; for (i = 0; i < strlen(res); ++i) { if (re...
12,074
1
static int wavpack_decode_block(AVCodecContext *avctx, int block_no, void *data, int *data_size, const uint8_t *buf, int buf_size) { WavpackContext *wc = avctx->priv_data; WavpackFrameContext *s; void *samples = data; int samplecount; int got_terms = 0, got_weights = 0, got_samples = 0, got_entropy = 0, got_bs = 0, got...
12,076
1
void qemu_send_packet(VLANClientState *vc, const uint8_t *buf, int size) { VLANState *vlan = vc->vlan; VLANPacket *packet; if (vc->link_down) return; #ifdef DEBUG_NET printf("vlan %d send:\n", vlan->id); hex_dump(stdout, buf, size); #endif if (vlan->delivering) { packet = qemu_malloc(sizeof(VLANPacket) + size); packet-...
12,077
1
static void test_bmdma_one_sector_short_prdt(void) { QPCIDevice *dev; void *bmdma_base, *ide_base; uint8_t status; /* Read 2 sectors but only give 1 sector in PRDT */ PrdtEntry prdt[] = { { .addr = 0, .size = cpu_to_le32(0x200 | PRDT_EOT), }, }; dev = get_pci_device(&bmdma_base, &ide_base); /* Normal request */ status ...
12,078
1
static uint32_t regtype_to_ss(uint8_t type) { if (type & PCI_BASE_ADDRESS_MEM_TYPE_64) { return 3; } if (type == PCI_BASE_ADDRESS_SPACE_IO) { return 1; } return 2; }
12,080
1
static int swf_read_header(AVFormatContext *s, AVFormatParameters *ap) { ByteIOContext *pb = &s->pb; int nbits, len, frame_rate, tag, v; AVStream *st; if ((get_be32(pb) & 0xffffff00) != MKBETAG('F', 'W', 'S', 0)) return -EIO; get_le32(pb); /* skip rectangle size */ nbits = get_byte(pb) >> 3; len = (4 * nbits - 3 + 7) /...
12,081