Projectname
large_stringclasses
15 values
Filepath
large_stringlengths
4
106
Function
large_stringlengths
11
3.45k
Label
list
qemu
hw/9pfs/9p.c
static size_t send_control_msg(VirtIOSerial *vser, void *buf, size_t len) { VirtQueueElement elem; VirtQueue *vq; vq = vser->c_ivq; if (!virtio_queue_ready(vq)) { return 0; } if (!virtqueue_pop(vq, &elem)) { return 0; } /* TODO: detect a buffer that's too short, set NEEDS_RESET */ io...
[ 0, 1 ]
qemu
target-ppc/mmu-hash32.c
static int pte_check_hash32(struct mmu_ctx_hash32 *ctx, target_ulong pte0, target_ulong pte1, int h, int rwx) { target_ulong mmask; int access, ret, pp; ret = -1; /* Check validity and table match */ if ((pte0 & HPTE32_V_VALID) && (h == !!(pte0 & HPTE32_V_SECONDARY))) { ...
[ 1, 0 ]
qemu
block/block-backend.c
static void ide_sector_write_cb(void *opaque, int ret) { IDEState *s = opaque; int n; if (ret == -ECANCELED) { return; } block_acct_done(bdrv_get_stats(s->bs), &s->acct); s->pio_aiocb = NULL; s->status &= ~BUSY_STAT; if (ret != 0) { if (ide_handle_rw_error(s, -ret, IDE_RETRY_PIO)) { ...
[ 1, 1 ]
qemu
hw/acpi/nvdimm.c
void nvdimm_build_acpi(GArray *table_offsets, GArray *table_data, BIOSLinker *linker, AcpiNVDIMMState *state, uint32_t ram_slots) { nvdimm_build_nfit(state, table_offsets, table_data, linker); /* * NVDIMM device is allowed to be plugged only if there is availab...
[ 0, 0 ]
qemu
qemu-char.c
static gboolean io_watch_poll_prepare(GSource *source, gint *timeout_) { IOWatchPoll *iwp = io_watch_poll_from_source(source); bool now_active = iwp->fd_can_read(iwp->opaque) > 0; bool was_active = g_source_get_context(iwp->src) != NULL; if (was_active == now_active) { return FALSE; } if (now_act...
[ 1, 0 ]
qemu
HACKING
static void uart_write(void *opaque, target_phys_addr_t addr, uint64_t value, unsigned size) { MilkymistUartState *s = opaque; unsigned char ch = value; trace_milkymist_uart_memory_write(addr, value); addr >>= 2; switch (addr) { case R_RXTX: if (s->chr) { qemu_chr_...
[ 1, 0 ]
qemu
hw/intc/arm_gicv3_redist.c
MemTxResult gicv3_redist_write(void *opaque, hwaddr offset, uint64_t data, unsigned size, MemTxAttrs attrs) { GICv3State *s = opaque; GICv3CPUState *cs; MemTxResult r; int cpuidx; /* This region covers all the redistributor pages; there are * (for GICv3) two 64K pages per CPU...
[ 1, 0 ]
FFmpeg
libavcodec/libxvid.c
static int xvid_strip_vol_header(AVCodecContext *avctx, AVPacket *pkt, unsigned int header_len, unsigned int frame_len) { int vo_len = 0, i; for (i = 0; i < header_len - 3; i++) { if (pkt->data[i] == 0x00 && pkt->data[i + 1] == 0x0...
[ 1, 0 ]
qemu
cpu-exec.c
void gicv3_cpuif_update(GICv3CPUState *cs) { /* Tell the CPU about its highest priority pending interrupt */ int irqlevel = 0; int fiqlevel = 0; ARMCPU *cpu = ARM_CPU(cs->cpu); CPUARMState *env = &cpu->env; trace_gicv3_cpuif_update(gicv3_redist_affid(cs), cs->hppi.irq, cs->hppi.grp, ...
[ 1, 0 ]
FFmpeg
libavcodec/arm/h264idct_neon.S
static void FUNCC(pred8x16_horizontal_add)(uint8_t *pix, const int *block_offset, const int16_t *block, ptrdiff_t stride) { int i; for (i = 0; i < 4; i++) FUNCC(pred4x4_horizont...
[ 1, 0 ]
FFmpeg
ffmpeg.c
static int codec_get_buffer(AVCodecContext *s, AVFrame *frame) { InputStream *ist = s->opaque; FrameBuffer *buf; int ret, i; if (av_image_check_size(s->width, s->height, 0, s)) return -1; if (!ist->buffer_pool && (ret = alloc_buffer(s, ist, &ist->buffer_pool)) < 0) return ret; buf = ist->bu...
[ 1, 1 ]
qemu
exec.c
static void sparc_cpu_class_init(ObjectClass *oc, void *data) { SPARCCPUClass *scc = SPARC_CPU_CLASS(oc); CPUClass *cc = CPU_CLASS(oc); DeviceClass *dc = DEVICE_CLASS(oc); scc->parent_realize = dc->realize; dc->realize = sparc_cpu_realizefn; scc->parent_reset = cc->reset; cc->reset = sparc_cpu_res...
[ 1, 0 ]
qemu
qobject/qdict.c
QList *qdict_get_qlist(const QDict *qdict, const char *key) { return qobject_to_qlist(qdict_get_obj(qdict, key, QTYPE_QLIST)); }
[ 1, 0 ]
qemu
hw/virtio/vhost.c
static void vhost_log_stop(MemoryListener *listener, MemoryRegionSection *section) { /* FIXME: implement */ }
[ 0, 1 ]
qemu
include/qemu-common.h
do_send_recv(int sockfd, struct iovec *iov, unsigned iov_cnt, bool do_send) { #if defined CONFIG_IOVEC && defined CONFIG_POSIX ssize_t ret; struct msghdr msg; memset(&msg, 0, sizeof(msg)); msg.msg_iov = iov; msg.msg_iovlen = iov_cnt; do { ret = do_send ? sendmsg(sockfd, &msg, 0) ...
[ 1, 1 ]
qemu
monitor.c
static void monitor_fdset_cleanup(MonFdset *mon_fdset) { MonFdsetFd *mon_fdset_fd; MonFdsetFd *mon_fdset_fd_next; QLIST_FOREACH_SAFE(mon_fdset_fd, &mon_fdset->fds, next, mon_fdset_fd_next) { if (mon_fdset_fd->removed || (QLIST_EMPTY(&mon_fdset->dup_fds) && mon_refcount == 0)) { close(mon_...
[ 0, 0 ]
qemu
hw/mc146818rtc.c
static void rtc_update_timer(void *opaque) { RTCState *s = opaque; int32_t irqs = REG_C_UF; int32_t new_irqs; assert((s->cmos_data[RTC_REG_A] & 0x60) != 0x60); /* UIP might have been latched, update time and clear it. */ rtc_update_time(s); s->cmos_data[RTC_REG_A] &= ~REG_A_UIP; if (check_alar...
[ 1, 0 ]
qemu
hw/acpi/nvdimm.c
void nvdimm_build_acpi(GArray *table_offsets, GArray *table_data, BIOSLinker *linker, GArray *dsm_dma_arrea) { GSList *device_list; /* no NVDIMM device is plugged. */ device_list = nvdimm_get_plugged_device_list(); if (!device_list) { return; } nvdimm_build_nfit(device_lis...
[ 0, 0 ]
qemu
block/curl.c
static int curl_sock_cb(CURL *curl, curl_socket_t fd, int action, void *s, void *sp) { DPRINTF("CURL (AIO): Sock action %d on fd %d\n", action, fd); switch (action) { case CURL_POLL_IN: qemu_aio_set_fd_handler(fd, curl_multi_do, NULL, s); break; case CURL_POLL_OUT: q...
[ 1, 0 ]
FFmpeg
libavcodec/4xm.c
static void init_vlcs(void) { static int done = 0; if (!done) { done = 1; init_vlc(&dc_lum_vlc, DC_VLC_BITS, 12, vlc_dc_lum_bits, 1, 1, vlc_dc_lum_code, 2, 2); init_vlc(&dc_chroma_vlc, DC_VLC_BITS, 12, vlc_dc_chroma_bits, 1, 1, vlc_dc_chroma_...
[ 1, 0 ]
qemu
hw/esp.c
static void scsi_cancel_io(SCSIDevice *d, uint32_t tag) { DPRINTF("scsi_cancel_io 0x%x\n", tag); SCSIGenericState *s = DO_UPCAST(SCSIGenericState, qdev, d); SCSIGenericReq *r; DPRINTF("Cancel tag=0x%x\n", tag); r = scsi_find_request(s, tag); if (r) { if (r->req.aiocb) bdrv_aio_cancel(r->r...
[ 1, 0 ]
qemu
hw/i2c.h
static void set_next_tick(rc4030State *s) { qemu_irq_lower(s->timer_irq); uint32_t hz; hz = 1000 / (s->itr + 1); qemu_mod_timer(s->periodic_timer, qemu_get_clock(vm_clock) + ticks_per_sec / hz); }
[ 1, 0 ]
qemu
tests/fdc-test.c
static void test_media_insert(void) { uint8_t dir; /* Insert media in drive. DSKCHK should not be reset until a step pulse * is sent. */ qmp_discard_response("{'execute':'change', 'arguments':{" " 'device':'floppy0', 'target': '%s' }}", test_image); qmp_d...
[ 1, 1 ]
qemu
block.c
void bdrv_set_dirty_tracking(BlockDriverState *bs, int enable) { int64_t bitmap_size; if (enable) { if (bs->dirty_tracking == 0) { int64_t i; uint8_t test; bitmap_size = (bdrv_getlength(bs) >> BDRV_SECTOR_BITS); bitmap_size /= BDRV_SECTORS_PER_DIRTY_CHUNK; bitmap_size++; ...
[ 1, 0 ]
qemu
block/quorum.c
static void quorum_aio_finalize(QuorumAIOCB *acb) { BDRVQuorumState *s = acb->common.bs->opaque; int i, ret = 0; if (acb->vote_ret) { ret = acb->vote_ret; } acb->common.cb(acb->common.opaque, ret); if (acb->is_read) { for (i = 0; i < s->num_children; i++) { qemu_vfree(acb->qcrs[i].buf...
[ 1, 0 ]
FFmpeg
libavcodec/mlp.c
uint8_t ff_mlp_calculate_parity(const uint8_t *buf, unsigned int buf_size) { uint32_t scratch = 0; const uint8_t *buf_end = buf + buf_size; for (; buf < buf_end - 3; buf += 4) scratch ^= *((const uint32_t *)buf); scratch = xor_32_to_8(scratch); for (; buf < buf_end; buf++) return scratch; }
[ 1, 0 ]
FFmpeg
libavcodec/arm/vp8dsp.h
static av_always_inline void filter_common(uint8_t *p, ptrdiff_t stride, int is4tap) { LOAD_PIXELS int a, f1, f2; const uint8_t *cm = ff_cropTbl + MAX_NEG_CROP; a = 3 * (q0 - p0); if (is4tap) a += clip_int8(p1 - q1); a = clip_int8(a); // We deviate f...
[ 1, 0 ]
FFmpeg
libavcodec/vp3.c
static int theora_decode_init(AVCodecContext *avctx) { Vp3DecodeContext *s = avctx->priv_data; GetBitContext gb; int ptype; uint8_t *p = avctx->extradata; int op_bytes, i; s->theora = 1; if (!avctx->extradata_size) { av_log(avctx, AV_LOG_ERROR, "Missing extradata!\n"); return -1; } ...
[ 0, 1 ]
FFmpeg
libavcodec/a64multienc.c
static av_cold int pcm_encode_init(AVCodecContext *avctx) { avctx->frame_size = 0; switch (avctx->codec->id) { case AV_CODEC_ID_PCM_ALAW: pcm_alaw_tableinit(); break; case AV_CODEC_ID_PCM_MULAW: pcm_ulaw_tableinit(); break; default: break; } avctx->bits_per_coded_sample = a...
[ 1, 0 ]
qemu
hw/device-hotplug.c
VLANClientState *qdev_get_vlan_client(DeviceState *dev, NetCanReceive *can_receive, NetReceive *receive, NetReceiveIOV *receive_iov, NetCleanup *cleanup, ...
[ 1, 0 ]
qemu
hw/ide.c
static int guess_disk_lchs(IDEState *s, int *pcylinders, int *pheads, int *psectors) { uint8_t *buf; int ret, i, heads, sectors, cylinders; struct partition *p; uint32_t nr_sects; buf = qemu_memalign(512, 512); if (buf == NULL) return -1; ret = bdrv_read(s->bs, 0, ...
[ 1, 0 ]
FFmpeg
libavcodec/snowdec.c
static int decode_blocks(SnowContext *s) { int x, y; int w = s->b_width; int h = s->b_height; int res; for (y = 0; y < h; y++) { for (x = 0; x < w; x++) { if ((res = decode_q_branch(s, 0, x, y)) < 0) return res; } } return 0; }
[ 1, 0 ]
qemu
target-sparc/translate.c
static void do_branch(DisasContext *dc, int32_t offset, uint32_t insn, int cc, TCGv r_cond) { unsigned int cond = GET_FIELD(insn, 3, 6), a = (insn & (1 << 29)); target_ulong target = dc->pc + offset; if (cond == 0x0) { /* unconditional not taken */ if (a) { dc->pc = dc-...
[ 1, 1 ]
FFmpeg
libavcodec/ra288.c
static void prodsum(float *tgt, float *src, int len, int n) { unsigned int x; float *p1, *p2; double sum; while (n >= 0) { p1 = (p2 = src) - n; for (sum = 0, x = len; x--; sum += (*p1++) * (*p2++)) ; tgt[n--] = sum; } }
[ 0, 0 ]
qemu
linux-user/qemu.h
long do_rt_sigreturn(CPUMIPSState *env) { struct target_rt_sigframe *frame; abi_ulong frame_addr; sigset_t blocked; #if defined(DEBUG_SIGNAL) fprintf(stderr, "do_rt_sigreturn\n"); #endif frame_addr = env->active_tc.gpr[29]; if (!lock_user_struct(VERIFY_READ, frame, frame_addr, 1)) goto badfram...
[ 1, 0 ]
qemu
hw/net/net_rx_pkt.c
static void net_tx_pkt_do_sw_csum(struct NetTxPkt *pkt) { struct iovec *iov = &pkt->vec[NET_TX_PKT_L2HDR_FRAG]; uint32_t csum_cntr; uint16_t csum = 0; /* num of iovec without vhdr */ uint32_t iov_len = pkt->payload_frags + NET_TX_PKT_PL_START_FRAG - 1; uint16_t csl; struct ip_header *iphdr; siz...
[ 0, 0 ]
qemu
hw/hpet.c
static void hpet_reset(void *opaque) { HPETState *s = opaque; int i; static int count = 0; for (i = 0; i < HPET_NUM_TIMERS; i++) { HPETTimer *timer = &s->timer[i]; hpet_del_timer(timer); timer->tn = i; timer->cmp = ~0ULL; timer->config = HPET_TN_PERIODIC_CAP | HPET_TN_SIZE_CAP; ...
[ 1, 0 ]
qemu
hw/scsi/vhost-scsi.c
static void vhost_scsi_realize(DeviceState *dev, Error **errp) { VirtIOSCSICommon *vs = VIRTIO_SCSI_COMMON(dev); VHostSCSI *s = VHOST_SCSI(dev); Error *err = NULL; int vhostfd = -1; int ret; if (!vs->conf.wwpn) { error_setg(errp, "vhost-scsi: missing wwpn"); return; } if (vs->conf.vhos...
[ 1, 0 ]
FFmpeg
libavcodec/h264pred.c
static void pred4x4_vertical_vp8_c(uint8_t *src, const uint8_t *topright, int stride) { const int lt = src[-1 - 1 * stride]; LOAD_TOP_EDGE LOAD_TOP_RIGHT_EDGE uint32_t v = PACK_4U8((lt + 2 * t0 + t1 + 2) >> 2, (t0 + 2 * t1 + t2 + 2) >> 2, ...
[ 1, 0 ]
qemu
hw/intc/apic_common.c
void apic_reset_irq_delivered(void) { trace_apic_reset_irq_delivered(apic_irq_delivered); apic_irq_delivered = 0; }
[ 1, 0 ]
qemu
hw/misc/vfio.c
static void vfio_listener_release(VFIOContainer *container) { memory_listener_unregister(&container->iommu_data.listener); }
[ 1, 0 ]
qemu
block/nfs.c
static int coroutine_fn nfs_co_writev(BlockDriverState *bs, int64_t sector_num, int nb_sectors, QEMUIOVector *iov) { NFSClient *client = bs->opaque; NFSRPC task; char *buf = NULL; nfs_co_init_task(client, &task); buf = g_mallo...
[ 1, 0 ]
qemu
hw/ppc/spapr.c
static void spapr_memory_plug(HotplugHandler *hotplug_dev, DeviceState *dev, uint32_t node, Error **errp) { Error *local_err = NULL; sPAPRMachineState *ms = SPAPR_MACHINE(hotplug_dev); PCDIMMDevice *dimm = PC_DIMM(dev); PCDIMMDeviceClass *ddc = PC_DIMM_GET_CLASS(dimm); MemoryRegi...
[ 1, 0 ]
qemu
block.c
int bdrv_write(BlockDriverState *bs, int64_t sector_num, const uint8_t *buf, int nb_sectors) { BlockDriver *drv = bs->drv; if (!bs->drv) return -ENOMEDIUM; if (bs->read_only) return -EACCES; if (bdrv_check_request(bs, sector_num, nb_sectors)) return -EIO; return drv->bdrv_...
[ 1, 0 ]
qemu
docs/qapi-code-gen.txt
void visit_type_uint64(Visitor *v, uint64_t *obj, const char *name, Error **errp) { int64_t value; if (!error_is_set(errp)) { if (v->type_uint64) { v->type_uint64(v, obj, name, errp); } else { value = *obj; v->type_int(v, &value, name, errp); *obj = va...
[ 1, 0 ]
qemu
hw/device-hotplug.c
void mipsnet_init(int base, qemu_irq irq, NICInfo *nd) { MIPSnetState *s; qemu_check_nic_model(nd, "mipsnet"); s = qemu_mallocz(sizeof(MIPSnetState)); register_ioport_write(base, 36, 1, mipsnet_ioport_write, s); register_ioport_read(base, 36, 1, mipsnet_ioport_read, s); register_ioport_write(base, 36...
[ 1, 0 ]
FFmpeg
libavcodec/aaccoder.c
static void apply_window_and_mdct(AACEncContext *s, SingleChannelElement *sce, float *audio) { int i; float *output = sce->ret_buf; apply_window[sce->ics.window_sequence[0]](s->fdsp, sce, audio); if (sce->ics.window_sequence[0] != EIGHT_SHORT_SEQUENCE) s->mdct1024.md...
[ 1, 0 ]
qemu
hw/tpm/tpm_tis.c
TPMVersion tpm_tis_get_tpm_version(Object *obj) { TPMState *s = TPM(obj); return tpm_backend_get_tpm_version(s->be_driver);
[ 1, 0 ]
qemu
block/block-backend.c
static void cmd_start_stop_unit(IDEState *s, uint8_t *buf) { int sense; bool start = buf[4] & 1; bool loej = buf[4] & 2; /* load on start, eject on !start */ int pwrcnd = buf[4] & 0xf0; if (pwrcnd) { /* eject/load only happens for power condition == 0 */ return; } if (loej) { if (!st...
[ 1, 0 ]
qemu
hmp-commands.hx
static int qemu_savevm_state(Monitor *mon, QEMUFile *f) { int ret; if (qemu_savevm_state_blocked(mon)) { ret = -EINVAL; goto out; } ret = qemu_savevm_state_begin(f, 0, 0); if (ret < 0) goto out; do { ret = qemu_savevm_state_iterate(f); if (ret < 0) goto out; } while ...
[ 0, 0 ]
FFmpeg
libavcodec/8svx.c
static av_cold int eightsvx_decode_init(AVCodecContext *avctx) { EightSvxContext *esc = avctx->priv_data; if (avctx->channels < 1 || avctx->channels > 2) { av_log(avctx, AV_LOG_ERROR, "8SVX does not support more than 2 channels\n"); return AVERROR_INVALIDDATA; } switch (avctx->codec->id) { case...
[ 1, 0 ]
qemu
hw/usb-ehci.c
static int ehci_state_fetchitd(EHCIState *ehci, int async) { uint32_t entry; EHCIitd itd; assert(!async); entry = ehci_get_fetch_addr(ehci, async); get_dwords(NLPTR_GET(entry), (uint32_t *)&itd, sizeof(EHCIitd) >> 2); ehci_trace_itd(ehci, entry, &itd); if (ehci_process_itd(ehci, &itd...
[ 1, 0 ]
qemu
hw/sd/sd.c
static void sd_reset(SDState *sd, BlockBackend *blk) { uint64_t size; uint64_t sect; if (blk) { blk_get_geometry(blk, &sect); } else { sect = 0; } size = sect << 9; sect = sd_addr_to_wpnum(size) + 1; sd->state = sd_idle_state; sd->rca = 0x0000; sd_set_ocr(sd); sd_set_scr(sd); ...
[ 1, 0 ]
FFmpeg
libavcodec/x86/flacdsp_init.c
av_cold void ff_flacdsp_init_x86(FLACDSPContext *c, enum AVSampleFormat fmt, int bps) { #if HAVE_YASM int cpu_flags = av_get_cpu_flags(); if (EXTERNAL_SSE4(cpu_flags)) { if (bps > 16 && CONFIG_FLAC_DECODER) c->lpc = ff_flac_lpc_32_sse4; } if (EXTERNAL_XOP(cpu_f...
[ 0, 0 ]
FFmpeg
libavcodec/utvideoenc.c
static void up_heap(uint32_t val, uint32_t *heap, uint32_t *weights) { uint32_t initial_val = heap[val]; while (weights[initial_val] < weights[heap[val >> 1]]) { heap[val] = heap[val >> 1]; val >>= 1; } heap[val] = initial_val; }
[ 1, 0 ]
qemu
Makefile.objs
static int vmstate_size(void *opaque, VMStateField *field) { int size = field->size; if (field->flags & VMS_VBUFFER) { size = *(int32_t *)(opaque + field->size_offset); if (field->flags & VMS_MULTIPLY) { size *= field->size; } } return size; }
[ 1, 0 ]
FFmpeg
libavformat/tee.c
static int tee_write_trailer(AVFormatContext *avf) { TeeContext *tee = avf->priv_data; AVFormatContext *avf2; int ret_all = 0, ret; unsigned i; for (i = 0; i < tee->nb_slaves; i++) { avf2 = tee->slaves[i].avf; if ((ret = av_write_trailer(avf2)) < 0) if (!ret_all) ret_all = ret;...
[ 1, 0 ]
qemu
target-cris/translate.c
static unsigned int dec_addi_acr(DisasContext *dc) { TCGv t0; DIS(fprintf(logfile, "addi.%c $r%u, $r%u, $acr\n", memsize_char(memsize_zz(dc)), dc->op2, dc->op1)); cris_cc_mask(dc, 0); t0 = tcg_temp_new(TCG_TYPE_TL); tcg_gen_shl_tl(t0, cpu_R[dc->op2], tcg_const_tl(dc->zzsize)); tcg_gen_...
[ 1, 0 ]
FFmpeg
libavfilter/avfilter.c
int ff_insert_pad(unsigned idx, unsigned *count, size_t padidx_off, AVFilterPad **pads, AVFilterLink ***links, AVFilterPad *newpad) { AVFilterLink **newlinks; AVFilterPad *newpads; unsigned i; idx = FFMIN(idx, *count); newpads = av_realloc_array(*pads, *count + 1, s...
[ 1, 0 ]
qemu
tests/migration-test.c
static void migrate_check_parameter(QTestState *who, const char *parameter, const char *value) { QDict *rsp, *rsp_return; const char *result; rsp = wait_command(who, "{ 'execute': 'query-migrate-parameters' }"); rsp_return = qdict_get_qdict(rsp, "return"); result = g...
[ 1, 0 ]
qemu
accel/tcg/translator.c
static void spr_write_hdecr(DisasContext *ctx, int sprn, int gprn) { if (ctx->tb->cflags & CF_USE_ICOUNT) { gen_io_start(); } gen_helper_store_hdecr(cpu_env, cpu_gpr[gprn]); if (ctx->tb->cflags & CF_USE_ICOUNT) { gen_io_end(); gen_stop_exception(ctx); } }
[ 1, 0 ]
qemu
cutils.c
int qemu_sendv(int sockfd, struct iovec *iov, int len, int iov_offset) { return do_sendv_recvv(sockfd, iov, len, iov_offset, 1); }
[ 1, 0 ]
qemu
block.c
void bdrv_commit_all(void) { BlockDriverState *bs; QTAILQ_FOREACH(bs, &bdrv_states, list) { bdrv_commit(bs); } }
[ 1, 0 ]
qemu
hw/scsi-bus.c
void scsi_req_dequeue(SCSIRequest *req) { trace_scsi_req_dequeue(req->dev->id, req->lun, req->tag); if (req->enqueued) { QTAILQ_REMOVE(&req->dev->requests, req, next); req->enqueued = false; scsi_req_unref(req); } }
[ 1, 0 ]
qemu
tests/libqos/usb.c
static void test_port(int port) { struct qhc uhci; g_assert(port > 0); qusb_pci_init_one(qs->pcibus, &uhci, QPCI_DEVFN(0x1d, 0), 4); uhci_port_test(&uhci, port - 1, UHCI_PORT_CCS); }
[ 1, 0 ]
FFmpeg
libswscale/swscale.c
rgb16_32ToUV_c_template(uint8_t *dstU, uint8_t *dstV, const uint8_t *src, int width, enum PixelFormat origin, int shr, int shg, int shb, int shp, int maskr, int maskg, int maskb, int rsh, int gsh...
[ 1, 0 ]
qemu
block/qapi.c
void hmp_block_set_io_throttle(Monitor *mon, const QDict *qdict) { Error *err = NULL; qmp_block_set_io_throttle(qdict_get_str(qdict, "device"), qdict_get_int(qdict, "bps"), qdict_get_int(qdict, "bps_rd"), qdict_get_int(qdict, ...
[ 1, 0 ]
qemu
hw/scsi/mptconfig.c
size_t mptsas_config_ioc_0(MPTSASState *s, uint8_t **data, int address) { PCIDeviceClass *pcic = PCI_DEVICE_GET_CLASS(s); return MPTSAS_CONFIG_PACK(0, MPI_CONFIG_PAGETYPE_IOC, 0x01, "*l*lwwb*b*b*blww", pcic->vendor_id, pcic->device_id, pcic->revision, ...
[ 1, 0 ]
qemu
hw/net/e1000e_core.c
e1000e_write_ps_rx_descr(E1000ECore *core, uint8_t *desc, struct NetRxPkt *pkt, const E1000E_RSSInfo *rss_info, size_t ps_hdr_len, uint16_t (*written)[MAX_PS_BUFFERS]) { int i; union e1000_rx_desc_packet_split...
[ 1, 0 ]
FFmpeg
tools/ismindex.c
static void print_track_chunks(FILE *out, struct Tracks *tracks, int main, const char *type) { int i, j; struct Track *track = tracks->tracks[main]; for (i = 0; i < track->chunks; i++) { for (j = main + 1; j < tracks->nb_tracks; j++) { if (tracks->tracks[j]->is_audi...
[ 1, 0 ]
FFmpeg
libavcodec/diracdec.c
av_cold void ff_diracdsp_init(DiracDSPContext *c) { c->dirac_hpel_filter = dirac_hpel_filter; c->add_rect_clamped = add_rect_clamped_c; c->put_signed_rect_clamped[0] = put_signed_rect_clamped_8bit_c; c->put_signed_rect_clamped[1] = put_signed_rect_clamped_10bit_c; c->add_dirac_obmc[0] = add_obmc8_c; ...
[ 1, 0 ]
qemu
hw/ppc/spapr_iommu.c
sPAPRTCETable *spapr_tce_new_table(DeviceState *owner, uint32_t liobn) { sPAPRTCETable *tcet; char tmp[32]; if (spapr_tce_find_by_liobn(liobn)) { error_report("Attempted to create TCE table with duplicate" " LIOBN 0x%x", liobn); return NULL; } tcet = SPAPR_TCE...
[ 1, 0 ]
qemu
target-arm/helper.c
bool arm_regime_using_lpae_format(CPUARMState *env, ARMMMUIdx mmu_idx) { return regime_using_lpae_format(env, mmu_idx); }
[ 0, 0 ]
qemu
fpu/softfloat.c
int floatx80_lt(floatx80 a, floatx80 b, float_status *status) { flag aSign, bSign; if (((extractFloatx80Exp(a) == 0x7FFF) && (uint64_t)(extractFloatx80Frac(a) << 1)) || ((extractFloatx80Exp(b) == 0x7FFF) && (uint64_t)(extractFloatx80Frac(b) << 1)) ) { float_raise(float_flag_inva...
[ 0, 0 ]
qemu
block.c
int bdrv_debug_breakpoint(BlockDriverState *bs, const char *event, const char *tag) { while (bs && bs->drv && !bs->drv->bdrv_debug_breakpoint) { bs = bs->file; } if (bs && bs->drv && bs->drv->bdrv_debug_breakpoint) { return bs->drv->bdrv_debug_breakpoint(bs, event, tag); ...
[ 1, 0 ]
qemu
target/ppc/kvm.c
static void kvmppc_host_cpu_class_init(ObjectClass *oc, void *data) { DeviceClass *dc = DEVICE_CLASS(oc); PowerPCCPUClass *pcc = POWERPC_CPU_CLASS(oc); uint32_t vmx = kvmppc_get_vmx(); uint32_t dfp = kvmppc_get_dfp(); uint32_t dcache_size = kvmppc_read_int_cpu_dt("d-cache-size"); uint32_t icache_size...
[ 1, 0 ]
qemu
vl.c
static int sclp_parse(const char *devname) { QemuOptsList *device = qemu_find_opts("device"); static int index = 0; char label[32]; QemuOpts *dev_opts; if (strcmp(devname, "none") == 0) { return 0; } if (index == MAX_SCLP_CONSOLES) { fprintf(stderr, "qemu: too many sclp consoles\n"); ...
[ 1, 0 ]
qemu
hw/intc/xics_kvm.c
static void xics_kvm_cpu_setup(XICSState *xics, PowerPCCPU *cpu) { CPUState *cs; ICPState *ss; KVMXICSState *xicskvm = XICS_SPAPR_KVM(xics); cs = CPU(cpu); ss = &xics->ss[cs->cpu_index]; assert(cs->cpu_index < xics->nr_servers); if (xicskvm->kernel_xics_fd == -1) { abort(); } /* * If...
[ 1, 0 ]
qemu
audio/audio.c
static uint64_t megasas_fw_time(void) { struct tm curtime; uint64_t bcd_time; qemu_get_timedate(&curtime, 0); bcd_time = ((uint64_t)curtime.tm_sec & 0xff) << 48 | ((uint64_t)curtime.tm_min & 0xff) << 40 | ((uint64_t)curtime.tm_hour & 0xff) << 32 | ((uint64_t)curtim...
[ 1, 0 ]
qemu
qemu-thread-win32.c
int qemu_thread_is_self(QemuThread *thread) { QemuThread *this_thread = TlsGetValue(qemu_thread_tls_index); return this_thread->thread == thread->thread; }
[ 1, 0 ]
FFmpeg
libavcodec/mace.c
static int mace3_decode_frame(AVCodecContext *avctx, void *data, int *data_size, const uint8_t *buf, int buf_size) { int16_t *samples = data; MACEContext *ctx = avctx->priv_data; int i, j, k; for (i = 0; i < avctx->channels; i++) { int16_t ...
[ 1, 0 ]
FFmpeg
libavformat/nut.c
static int nut_read_header(AVFormatContext *s, AVFormatParameters *ap) { NUTContext *nut = s->priv_data; ByteIOContext *bc = &s->pb; int64_t pos; int inited_stream_count; nut->avf = s; /* main header */ pos = 0; for (;;) { pos = find_startcode(bc, MAIN_STARTCODE, pos) + 1; if (pos < 0...
[ 1, 0 ]
qemu
tests/acpi-test.c
static void test_acpi_one(const char *params) { char *args; uint8_t signature_low; uint8_t signature_high; uint16_t signature; int i; uint32_t off; args = g_strdup_printf("-net none -display none %s %s", params ? params : "", disk); qtest_start(args); /* Wait at mos...
[ 1, 1 ]
FFmpeg
libavformat/mux.c
int av_interleaved_write_frame(AVFormatContext *s, AVPacket *pkt) { int ret, flush = 0; ret = check_packet(s, pkt); if (ret < 0) goto fail; if (pkt) { AVStream *st = s->streams[pkt->stream_index]; // FIXME/XXX/HACK drop zero sized packets if (st->codec->codec_type == AVMEDIA_TYPE_AUDIO ...
[ 1, 1 ]
FFmpeg
libavcodec/adx.c
static void adx_decode_stereo(short *out, const unsigned char *in, PREV *prev) { short tmp[32 * 2]; int i; adx_decode(tmp, in, prev); adx_decode(tmp + 32, in + 18, prev + 1); for (i = 0; i < 32; i++) { out[i * 2] = tmp[i]; out[i * 2 + 1] = tmp[i + 32]; } }
[ 1, 0 ]
FFmpeg
libavformat/rtpproto.c
static int rtp_open(URLContext *h, const char *uri, int flags) { RTPContext *s; int port, is_output, ttl, local_port; char hostname[256]; char buf[1024]; char path[1024]; const char *p; is_output = (flags & URL_WRONLY); s = av_mallocz(sizeof(RTPContext)); if (!s) return AVERROR(ENOMEM);...
[ 1, 1 ]
FFmpeg
libavcodec/movtextenc.c
static void mov_text_new_line_cb(void *priv, int forced) { MovTextContext *s = priv; av_strlcpy(s->ptr, "\n", FFMIN(s->end - s->ptr, 2)); s->ptr++; }
[ 1, 0 ]
FFmpeg
libavformat/avio.h
static int update_packetheader(NUTContext *nut, ByteIOContext *bc, int additional_size) { int64_t start = nut->packet_start; int64_t cur = url_ftell(bc); int size = cur - start + additional_size; if (size != nut->written_packet_size) { int i; assert(size <= nut->writ...
[ 0, 1 ]
qemu
hw/intc/xics.c
static void icp_class_init(ObjectClass *klass, void *data) { DeviceClass *dc = DEVICE_CLASS(klass); dc->vmsd = &vmstate_icp_server; dc->realize = icp_realize; }
[ 1, 0 ]
qemu
pc-bios/s390-ccw/bootmap.c
void virtio_setup_block(struct subchannel_id schid) { struct vq_info_block info; struct vq_config_block config = {}; blk_cfg.blk_size = 0; /* mark "illegal" - setup started... */ guessed_disk_nature = false; virtio_reset(schid); /* * Skipping CCW_CMD_READ_FEAT. We're not doing anything fancy, and...
[ 1, 0 ]
qemu
hw/piix_pci.c
static void update_pam(PCII440FXState *d, uint32_t start, uint32_t end, int r, PAMMemoryRegion *mem) { if (mem->initialized) { memory_region_del_subregion(d->system_memory, &mem->mem); memory_region_destroy(&mem->mem); } // printf("ISA mapping %08x-0x%08x: %d\n", start, end...
[ 1, 1 ]
FFmpeg
libavutil/eval.c
int av_expr_parse(AVExpr **expr, const char *s, const char *const *const_names, const char *const *func1_names, double (*const *funcs1)(void *, double), const char *const *func2_names, double (*const *funcs2)(void *, double, do...
[ 0, 0 ]
qemu
MAINTAINERS
void kqemu_set_phys_mem(uint64_t start_addr, ram_addr_t size, ram_addr_t phys_offset) { struct kqemu_phys_mem kphys_mem1, *kphys_mem = &kphys_mem1; uint64_t end; int ret, io_index; end = (start_addr + size + TARGET_PAGE_SIZE - 1) & TARGET_PAGE_MASK; start_addr &= TARGET_PAGE_MAS...
[ 1, 0 ]
qemu
hw/mips/cputimer.c
uint32_t cpu_mips_get_random(CPUMIPSState *env) { static uint32_t seed = 1; static uint32_t prev_idx = 0; uint32_t idx; /* Don't return same value twice, so get another value */ do { /* Use a simple algorithm of Linear Congruential Generator * from ISO/IEC 9899 standard. */ seed = 110351...
[ 1, 1 ]
qemu
target/ppc/cpu.h
void ppc_hash64_store_hpte(PowerPCCPU *cpu, target_ulong pte_index, target_ulong pte0, target_ulong pte1) { CPUPPCState *env = &cpu->env; if (env->external_htab == MMU_HASH64_KVM_MANAGED_HPT) { kvmppc_hash64_write_pte(env, pte_index, pte0, pte1); ...
[ 1, 0 ]
qemu
HACKING
static void omap_dpll_write(void *opaque, target_phys_addr_t addr, uint64_t value, unsigned size) { struct dpll_ctl_s *s = (struct dpll_ctl_s *)opaque; uint16_t diff; static const int bypass_div[4] = {1, 2, 4, 4}; int div, mult; if (size != 2) { return omap_badwidth_wri...
[ 1, 0 ]
qemu
HACKING
static uint32_t cuda_readb(void *opaque, target_phys_addr_t addr) { CUDAState *s = opaque; uint32_t val; addr = (addr >> 9) & 0xf; switch (addr) { case 0: val = s->b; break; case 1: val = s->a; break; case 2: val = s->dirb; break; case 3: val = s->dira; b...
[ 1, 1 ]
qemu
docs/qapi-code-gen.txt
static void qmp_input_start_list(Visitor *v, const char *name, Error **errp) { QmpInputVisitor *qiv = to_qiv(v); QObject *qobj = qmp_input_get_object(qiv, name, true); if (!qobj || qobject_type(qobj) != QTYPE_QLIST) { error_setg(errp, QERR_INVALID_PARAMETER_TYPE, name ? name : "null", "li...
[ 1, 0 ]
FFmpeg
libavcodec/ac3dec.c
static inline void upmix_mono_to_stereo(AC3DecodeContext *ctx) { int i; float (*output)[256] = ctx->audio_block.block_output; for (i = 0; i < 256; i++) output[2][i] = output[1][i]; }
[ 0, 0 ]
qemu
hw/i386/pc.c
static void xenfv_machine_options(MachineClass *m) { pc_common_machine_options(m); m->desc = "Xen Fully-virtualized PC"; m->max_cpus = HVM_MAX_VCPUS; m->default_machine_opts = "accel=xen"; m->hot_add_cpu = pc_hot_add_cpu; }
[ 0, 0 ]