project
stringclasses
2 values
commit_id
stringlengths
40
40
target
int64
0
1
func
stringlengths
26
142k
idx
int64
0
27.3k
qemu
aa92d6c4609e174fc6884e4b7b87367fac33cbe9
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 (...
11,950
qemu
afa46c468acc18914c2773538f1b088c507766ee
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.b...
11,951
qemu
937251408051e0489f78e4db3c92e045b147b38b
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); } ...
11,952
qemu
7385aed20db5d83979f683b9d0048674411e963c
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_fcc...
11,953
qemu
d1048bef9df0aacde9a54bf9b5b97a6e10950d8c
0
static bool pc_machine_get_vmport(Object *obj, Error **errp) { PCMachineState *pcms = PC_MACHINE(obj); return pcms->vmport; }
11,954
qemu
49adc5d3f8c6bb75e55ebfeab109c5c37dea65e8
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, ...
11,956
FFmpeg
22b37f5d3200cfe4c15eded883663cf0612093c1
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 accurat...
11,959
qemu
c2b38b277a7882a592f4f2ec955084b2b756daaa
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
qemu
08b277ac46da8b02e50cec455eca7cb2d12ffcf0
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
qemu
d581eb7ca4b58649ade5fb7570ecf6b4b9a41879
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; sw...
11,962
qemu
9be385980d37e8f4fd33f605f5fb1c3d144170a8
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
qemu
c975330ec4f5674f2899331f914c04ecba6edf26
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) |...
11,966
qemu
0b5c1ce8467384327b80a55218d3e57f48985990
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 ...
11,967
FFmpeg
3176217c60ca7828712985092d9102d331ea4f3d
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...
11,970
qemu
3aa80988430f41847e1b78d165440ac03503b6d0
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...
11,971
qemu
61007b316cd71ee7333ff7a0a749a8949527575f
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
qemu
bf6247fb7639bc3492e769791f6569d65860029b
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)...
11,973
qemu
0dfabd39d523fc3f6f0f8c441f41c013cc429b52
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 t...
11,974
qemu
40ff6d7e8dceca227e7f8a3e8e0d58b2c66d19b4
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
FFmpeg
f5be7958e313f3f62505ea7f90007800e8e1dcb5
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 (includin...
11,977
FFmpeg
7f2fe444a39bca733d390b6608801c5f002bfd31
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-...
11,982
qemu
82e59a676c01b3df3b53998d428d0a64a55f2439
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_fin...
11,986
qemu
98caa5bc0083ed4fe4833addd3078b56ce2f6cfa
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; ...
11,987
qemu
4c315c27661502a0813b129e41c0bf640c34a8d6
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...
11,989
FFmpeg
28358e466d4f4bc54f8137e0597057f33100b236
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 ...
11,990
qemu
34e1c27bc3094ffe484d9855e07ad104bddf579f
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; ...
11,991
qemu
acc086837e49b44f15eff6007bb1726844df7aec
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...
11,992
qemu
0188fadb7fe460d8c4c743372b1f7b25773e183e
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; s...
11,993
qemu
9a2fd4347c40321f5cbb4ab4220e759fcbf87d03
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
qemu
ecdd5333ab9ed3f2b848066aaaef02c027b25e36
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_cluster...
11,995
FFmpeg
97f8c6e14753b94c1f6a96fe354a125bbfdea2cb
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...
11,996
qemu
8b3d26342c4aa171e759e6392fe3b742759d4963
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_S...
11,997
qemu
e976c6a1e40ad74d616a186d3b48b0ad8f5eb970
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->c...
11,999
qemu
6cec5487990bf3f1f22b3fcb871978255e92ae0d
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_b...
12,000
qemu
21ce148c7ec71ee32834061355a5ecfd1a11f90f
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
qemu
b57ed9bf075e33cdd2f9eb545ff555301dd57221
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 (!s...
12,002
FFmpeg
1c5b712c0a643a039d6f34269b4102de313a050a
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_...
12,003
FFmpeg
c7e63546dc38616eb04a2d463170b3c247556149
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 chu...
12,005
FFmpeg
c619ff6daf93a8f3c03decf2d3345d2474c3db91
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 :...
12,007
FFmpeg
a7e6fbd90e62d3320b1e26d8209fc0f55ee5b0be
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...
12,008
FFmpeg
8de3458a07376b0a96772e586b6dba5e93432f52
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; NvencDynLoa...
12,009
FFmpeg
5650e331a733711b809bc27f968500f0f5530126
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->n...
12,010
FFmpeg
18c6bd098baba1ace8fea946e4bc0c60098f49d4
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
FFmpeg
f0f2218dce194ff50d1fe7ed39011595660143ad
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; ...
12,012
FFmpeg
e45a2872fafe631c14aee9f79d0963d68c4fc1fd
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; defaul...
12,013
FFmpeg
d1adad3cca407f493c3637e20ecd4f7124e69212
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(PRE...
12,014
FFmpeg
26c208cf0ff59efd7786528884a64d35fc42e9bf
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 d...
12,015
FFmpeg
1b648c7cdbee335c642bd2c05fe624fc195b85e6
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; ...
12,016
qemu
a7812ae412311d7d47f8aa85656faadac9d64b56
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], ...
12,017
FFmpeg
d7e14c0d103a2c9cca6c50568e09b40d6f48ea19
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 ...
12,018
qemu
c18ad9a54b75495ce61e8b28d353f8eec51768fc
0
void ppc_hash64_stop_access(uint64_t token) { if (kvmppc_kern_htab) { kvmppc_hash64_free_pteg(token); } }
12,019
qemu
7848c8d19f8556666df25044bbd5d8b29439c368
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); ...
12,020
qemu
3796f0e1cda41eacf4fc915e7edaf54f2279466c
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->s...
12,021
qemu
9c605cb13547a5faa5cb1092e3e44ac8b0d0b841
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
qemu
8a1c5235510da01a200693fe3cfd87acd2dc1fca
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("T...
12,024
qemu
4be746345f13e99e468c60acbd3a355e8183e3ce
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; ...
12,025
qemu
a89f364ae8740dfc31b321eed9ee454e996dc3c1
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; ...
12,027
qemu
8a354bd935a800dd2d98ac8f30707e2912c80ae6
0
static void ptimer_trigger(ptimer_state *s) { if (s->bh) { qemu_bh_schedule(s->bh); } }
12,028
FFmpeg
11de006babf735aafa3462d43dd2c02bb6ac6e2f
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...
12,029
qemu
37ad223c515da2fe9f1c679768cb5ccaa42e57e1
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_M...
12,031
qemu
494a8ebe713055d3946183f4b395f85a18b43e9e
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
qemu
10c4c98ab7dc18169b37b76f6ea5e60ebe65222b
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_IN...
12,033
qemu
10ee2aaa417d8d8978cdb2bbed55ebb152df5f6b
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) { /** @t...
12,034
qemu
a7812ae412311d7d47f8aa85656faadac9d64b56
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_...
12,035
qemu
149f54b53b7666a3facd45e86eece60ce7d3b114
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
qemu
cdea50ede1b8a2efe989fafc57260053b180219f
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_dirt...
12,039
FFmpeg
b7b8fc340632d15cb3b26a57915ebea84f37d03e
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...
12,040
qemu
a8170e5e97ad17ca169c64ba87ae2f53850dab4c
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) { qe...
12,042
qemu
1197cbb9eda1dc82e2fa1815ca62bc3de158353e
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...
12,043
qemu
185698715dfb18c82ad2a5dbc169908602d43e81
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, bu...
12,044
qemu
4be746345f13e99e468c60acbd3a355e8183e3ce
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->...
12,045
qemu
a8170e5e97ad17ca169c64ba87ae2f53850dab4c
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
qemu
0c92e0e6b64c9061f7365a2712b9055ea35b52f9
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) { ...
12,047
qemu
492c30af2567a59413c064f88eb81e1691865195
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 ctr...
12,048
qemu
a8170e5e97ad17ca169c64ba87ae2f53850dab4c
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; ...
12,050
FFmpeg
3969b4b861ce8152e3195e8f8c3437abd273b90a
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_offs...
12,051
qemu
a8170e5e97ad17ca169c64ba87ae2f53850dab4c
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; ...
12,052
qemu
a7812ae412311d7d47f8aa85656faadac9d64b56
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); ...
12,054
qemu
ef397e88e96d4a798bd190bcd0c43865c3725ae2
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_e...
12,057
FFmpeg
083300bea935d125b83f60d7030f78a7ffb0f3df
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(avct...
12,058
qemu
4b236b621bf090509c4a0be372edfd31d13b289a
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
qemu
233aa5c2d1cf4655ffe335025a68cf5454f87dad
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; } ...
12,060
qemu
efec3dd631d94160288392721a5f9c39e50fb2bc
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_B...
12,061
qemu
c4843a45e3d4f3698b214275ab5e78cdb6a3d212
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
FFmpeg
8bc396fc0e8769a056375c1c211f389ce0e3ecc5
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_g...
12,063
qemu
3c0c47e3464f3c54bd3f1cc6d4da2cbf7465e295
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...
12,064
FFmpeg
85f477935cd6b34e6ec2716b20e15ce748277a89
1
static av_cold int avs_decode_init(AVCodecContext * avctx) { avctx->pix_fmt = PIX_FMT_PAL8; return 0; }
12,065
qemu
692d88b4085559f1254d0e04d64a849ce8ab5932
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 && ...
12,066
FFmpeg
ca488ad480360dfafcb5766f7bfbb567a0638979
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_cons...
12,067
qemu
709e4407add7acacc593cb6cdac026558c9a8fb6
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) ...
12,069
qemu
b4ba67d9a702507793c2724e56f98e9b0f7be02b
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_...
12,070
qemu
6df5718bd3ec56225c44cf96440c723c1b611b87
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 ...
12,071
qemu
c919297379e9980c2bcc4d2053addbc1fd6d762b
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; Com...
12,072
FFmpeg
dccaad3bcdc5762141527cb7db7c87f34517f097
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...
12,073
FFmpeg
7faafe606fb25e3c8b3091ea0565b01622c87dd2
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...
12,074
FFmpeg
0aedab03405849962b469277afe047aa2c61a87f
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...
12,076
qemu
c27ff60871aff588a35e51d1a90faed410993e55
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) { p...
12,077
qemu
b4ba67d9a702507793c2724e56f98e9b0f7be02b
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), }, ...
12,078
qemu
4d8d5467cd6e324fb49ae97b9d5dcee3973d9a19
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
FFmpeg
747a0554ea8ad09404c1f5b80239ebd8d71b291e
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 =...
12,081