Projectname
large_stringclasses
15 values
Filepath
large_stringlengths
4
106
Function
large_stringlengths
11
3.45k
Label
list
qemu
block/vpc.c
vpc_co_preadv(BlockDriverState *bs, uint64_t offset, uint64_t bytes, QEMUIOVector *qiov, int flags) { BDRVVPCState *s = bs->opaque; int ret; int64_t image_offset; int64_t n_bytes; int64_t bytes_done = 0; VHDFooter *footer = (VHDFooter *)s->footer_buf; QEMUIOVector local_qiov; if ...
[ 1, 0 ]
qemu
block.c
static int coroutine_fn raw_co_writev(BlockDriverState *bs, int64_t sector_num, int nb_sectors, QEMUIOVector *qiov) { BLKDBG_EVENT(bs->file, BLKDBG_WRITE_AIO); return bdrv_co_writev(bs->file, sector_num, nb_sectors, qiov); }
[ 1, 0 ]
qemu
bsd-user/mmap.c
void g_free(void *ptr) { /* FIXME: We should unmark the reserved pages here. However this gets complicated when one target page spans multiple host pages, so we don't bother. */ size_t *p; p = (size_t *)((char *)ptr - 16); munmap(p, *p); }
[ 1, 1 ]
qemu
qapi/qmp-input-visitor.c
int64_t qdict_get_try_int(const QDict *qdict, const char *key, int64_t def_value) { QObject *obj; obj = qdict_get(qdict, key); if (!obj || qobject_type(obj) != QTYPE_QINT) return def_value; return qint_get_int(qobject_to_qint(obj)); }
[ 1, 0 ]
qemu
Makefile.objs
static void usbredir_control_packet(void *priv, uint32_t id, struct usb_redir_control_packet_header *control_packet, uint8_t *data, int data_len) { USBRedirDevice *dev = priv; int len = control_packet->length; AsyncURB *aurb; DPRINTF("ctrl-in status %d len ...
[ 1, 0 ]
FFmpeg
libavfilter/avfilter.c
AVFilterContext *avfilter_open(AVFilter *filter, char *inst_name) { AVFilterContext *ret = av_malloc(sizeof(AVFilterContext)); ret->av_class = av_mallocz(sizeof(AVClass)); ret->av_class->item_name = filter_name; ret->filter = filter; ret->name = inst_name ? av_strdup(inst_name) : NULL; ret->priv = av...
[ 1, 0 ]
qemu
include/exec/gen-icount.h
TCGOp *tcg_op_insert_before(TCGContext *s, TCGOp *old_op, TCGOpcode opc, int nargs) { int oi = s->gen_next_op_idx; int prev = old_op->prev; int next = old_op - s->gen_op_buf; TCGOp *new_op; tcg_debug_assert(oi < OPC_BUF_SIZE); s->gen_next_op_idx = oi + 1; new_op = &s->...
[ 1, 0 ]
qemu
exec.c
static void alpha_cpu_initfn(Object *obj) { CPUState *cs = CPU(obj); AlphaCPU *cpu = ALPHA_CPU(obj); CPUAlphaState *env = &cpu->env; cs->env_ptr = env; cpu_exec_init(cs, &error_abort); tlb_flush(cs, 1); alpha_translate_init(); #if defined(CONFIG_USER_ONLY) env->ps = PS_USER_MODE; cpu_alpha_...
[ 1, 0 ]
FFmpeg
libavcodec/vorbis.c
static void render_line(int x0, int y0, int x1, int y1, float *buf) { int dy = y1 - y0; int adx = x1 - x0; int ady = FFABS(dy); int sy = dy < 0 ? -1 : 1; buf[x0] = ff_vorbis_floor1_inverse_db_table[y0]; if (ady * 2 <= adx) { // optimized common case render_line_unrolled(x0, y0, x1, sy, ady, adx,...
[ 1, 0 ]
FFmpeg
libavcodec/exif.c
int avpriv_exif_decode_ifd(AVCodecContext *avctx, GetByteContext *gbytes, int le, int depth, AVDictionary **metadata) { int i, ret; int entries; entries = ff_tget_short(gbytes, le); if (bytestream2_get_bytes_left(gbytes) < entries * 12) { return A...
[ 0, 0 ]
qemu
block/cloop.c
static int cloop_read(BlockDriverState *bs, int64_t sector_num, uint8_t *buf, int nb_sectors) { BDRVCloopState *s = bs->opaque; int i; for (i = 0; i < nb_sectors; i++) { uint32_t sector_offset_in_block = ((sector_num + i) % s->sectors_per_block), blo...
[ 1, 0 ]
qemu
hw/s390x/s390-virtio-ccw.c
static void s390x_cpu_set_id(Object *obj, Visitor *v, const char *name, void *opaque, Error **errp) { S390CPU *cpu = S390_CPU(obj); DeviceState *dev = DEVICE(obj); const int64_t min = 0; const int64_t max = UINT32_MAX; Error *err = NULL; int64_t value; if (dev->realiz...
[ 1, 0 ]
qemu
block/nbd-client.c
int nbd_init(int fd, QIOChannelSocket *sioc, NBDExportInfo *info, Error **errp) { unsigned long sectors = info->size / BDRV_SECTOR_SIZE; if (info->size / BDRV_SECTOR_SIZE != sectors) { error_setg(errp, "Export size %" PRIu64 " too large for 32-bit kernel", info->size); ret...
[ 1, 0 ]
qemu
osdep.c
void *qemu_memalign(size_t alignment, size_t size) { return VirtualAlloc(NULL, size, MEM_COMMIT, PAGE_READWRITE); }
[ 0, 0 ]
qemu
hw/xen/xen_backend.c
static void xen_exit_notifier(Notifier *n, void *data) { XenIOState *state = container_of(n, XenIOState, exit); xc_evtchn_close(state->xce_handle); xs_daemon_close(state->xenstore); }
[ 0, 0 ]
qemu
hw/fdc.c
FDCtrl *fdctrl_init_isa(DriveInfo **fds) { ISADevice *dev; dev = isa_create("isa-fdc"); if (fds[0]) { qdev_prop_set_drive_nofail(&dev->qdev, "driveA", fds[0]->bdrv); } if (fds[1]) { qdev_prop_set_drive_nofail(&dev->qdev, "driveB", fds[1]->bdrv); } if (qdev_init(&dev->qdev) < 0) return...
[ 1, 0 ]
qemu
target-arm/cpu.c
void HELPER(access_check_cp_reg)(CPUARMState *env, void *rip, uint32_t syndrome) { const ARMCPRegInfo *ri = rip; switch (ri->accessfn(env, ri)) { case CP_ACCESS_OK: case CP_ACCESS_TRAP: break; case CP_ACCESS_TRAP_UNCATEGORIZED: env->exception.syndrome = syn_uncategoriz...
[ 1, 0 ]
qemu
hw/virtio/virtio.c
void virtio_save(VirtIODevice *vdev, QEMUFile *f) { BusState *qbus = qdev_get_parent_bus(DEVICE(vdev)); VirtioBusClass *k = VIRTIO_BUS_GET_CLASS(qbus); VirtioDeviceClass *vdc = VIRTIO_DEVICE_GET_CLASS(vdev); uint32_t guest_features_lo = (vdev->guest_features & 0xffffffff); int i; if (k->save_config) ...
[ 1, 1 ]
qemu
hw/virtio-blk.c
static void virtio_blk_dma_restart_cb(void *opaque, int running, RunState state) { VirtIOBlock *s = opaque; if (!running) return; if (!s->bh) { s->bh = qemu_bh_new(virtio_blk_dma_restart_bh, s); qemu_bh_schedule(s->bh); } }
[ 1, 0 ]
FFmpeg
libavformat/mpegvideodec.c
static int mpegvideo_probe(AVProbeData *p) { uint32_t code = -1; int pic = 0, seq = 0, slice = 0, pspack = 0, vpes = 0, apes = 0, res = 0; int i; for (i = 0; i < p->buf_size; i++) { code = (code << 8) + p->buf[i]; if ((code & 0xffffff00) == 0x100) { switch (code) { case SEQ_START_CO...
[ 1, 0 ]
FFmpeg
libavutil/frame.c
void av_frame_unref(AVFrame *frame) { int i; wipe_side_data(frame); for (i = 0; i < FF_ARRAY_ELEMS(frame->buf); i++) av_buffer_unref(&frame->buf[i]); for (i = 0; i < frame->nb_extended_buf; i++) av_buffer_unref(&frame->extended_buf[i]); av_freep(&frame->extended_buf); av_dict_free(&frame->metadata);...
[ 1, 0 ]
qemu
hw/block/onenand.c
static inline int onenand_load_spare(OneNANDState *s, int sec, int secn, void *dest) { uint8_t buf[512]; if (s->blk_cur) { if (blk_read(s->blk_cur, s->secs_cur + (sec >> 5), buf, 1) < 0) { return 1; } memcpy(dest, buf + ((sec & 31) << 4), secn << 4); ...
[ 1, 0 ]
FFmpeg
avconv_filter.c
int configure_filtergraph(FilterGraph *fg) { AVFilterInOut *inputs, *outputs, *cur; int ret, i, simple = !fg->graph_desc; const char *graph_desc = simple ? fg->outputs[0]->ost->avfilter : fg->graph_desc; avfilter_graph_free(&fg->graph); if (!(fg->graph = avfilter_graph...
[ 1, 0 ]
qemu
linux-user/main.c
static void gen_tlbiva(DisasContext *ctx) { #if defined(CONFIG_USER_ONLY) gen_inval_exception(ctx, POWERPC_EXCP_PRIV_OPC); #else TCGv t0; if (unlikely(ctx->pr)) { gen_inval_exception(ctx, POWERPC_EXCP_PRIV_OPC); return; } t0 = tcg_temp_new(); gen_addr_reg_index(ctx, t0); gen_helper_tlbi...
[ 1, 0 ]
qemu
tests/tco-test.c
static void test_tco_second_timeout_reset(void) { TestData td; const uint16_t ticks = TCO_SECS_TO_TICKS(16); QDict *ad; td.args = "-watchdog-action reset"; td.noreboot = false; test_init(&td); stop_tco(&td); clear_tco_status(&td); reset_on_second_timeout(true); set_tco_timeout(&td, TCO_SE...
[ 1, 0 ]
qemu
target-alpha/helper.h
uint64_t helper_addqv(CPUAlphaState *env, uint64_t op1, uint64_t op2) { uint64_t tmp = op1; op1 += op2; if (unlikely((tmp ^ op2 ^ (-1ULL)) & (tmp ^ op1) & (1ULL << 63))) { arith_excp(env, GETPC(), EXC_M_IOV, 0); } return op1; }
[ 1, 0 ]
qemu
hw/scsi/vmw_pvscsi.c
pvscsi_on_cmd_setup_msg_ring(PVSCSIState *s) { PVSCSICmdDescSetupMsgRing *rc = (PVSCSICmdDescSetupMsgRing *)s->curr_cmd_data; trace_pvscsi_on_cmd_arrived("PVSCSI_CMD_SETUP_MSG_RING"); if (!s->use_msg) { return PVSCSI_COMMAND_PROCESSING_FAILED; } if (s->rings_info_valid) { pvscsi_ring_ini...
[ 1, 0 ]
qemu
tests/vhost-user-bridge.c
dispatcher_wait(Dispatcher *dispr, uint32_t timeout) { struct timeval tv; tv.tv_sec = timeout / 1000000; tv.tv_usec = timeout % 1000000; fd_set fdset = dispr->fdset; /* wait until some of sockets become readable. */ int rc = select(dispr->max_sock + 1, &fdset, 0, 0, &tv); if (rc == -1) { vubr...
[ 1, 0 ]
qemu
backends/rng-egd.c
uart_write(void *opaque, hwaddr addr, uint64_t val64, unsigned int size) { XilinxUARTLite *s = opaque; uint32_t value = val64; unsigned char ch = value; addr >>= 2; switch (addr) { case R_STATUS: hw_error("write to UART STATUS?\n"); break; case R_CTRL: if (value & CON...
[ 1, 0 ]
qemu
hw/i386/pc.c
void pc_hot_add_cpu(const int64_t id, Error **errp) { DeviceState *icc_bridge; int64_t apic_id = x86_cpu_apic_id_from_index(id); if (cpu_exists(apic_id)) { error_setg(errp, "Unable to add CPU: %" PRIi64 ", it already exists", id); if (id >= max_cpus) { error_setg(errp, "Unable to add CPU: %" PRIi64 ...
[ 1, 0 ]
FFmpeg
libavformat/matroskaenc.c
static int mkv_write_trailer(AVFormatContext *s) { MatroskaMuxContext *mkv = s->priv_data; AVIOContext *pb = s->pb; int64_t currentpos, cuespos; int ret; // check if we have an audio packet cached if (mkv->cur_audio_pkt.size > 0) { ret = mkv_write_packet_internal(s, &mkv->cur_audio_pkt); mk...
[ 0, 0 ]
qemu
block/backup.c
static void backup_set_speed(BlockJob *job, int64_t speed, Error **errp) { BackupBlockJob *s = container_of(job, BackupBlockJob, common); if (speed < 0) { error_setg(errp, QERR_INVALID_PARAMETER, "speed"); return; } ratelimit_set_speed(&s->limit, speed / BDRV_SECTOR_SIZE, SLICE_TIME); }
[ 1, 0 ]
qemu
hw/virtio-net.c
static void virtio_net_save(QEMUFile *f, void *opaque) { VirtIONet *n = opaque; virtio_save(&n->vdev, f); qemu_put_buffer(f, n->mac, ETH_ALEN); qemu_put_be32(f, n->tx_timer_active); qemu_put_be32(f, n->mergeable_rx_bufs); qemu_put_be16(f, n->status); qemu_put_byte(f, n->promisc); qemu_put_byte(...
[ 1, 0 ]
FFmpeg
libavcodec/bethsoftvideo.c
static int set_palette(AVFrame *frame, const uint8_t *palette_buffer, int buf_size) { uint32_t *palette = (uint32_t *)frame->data[1]; int a; if (buf_size < 256 * 3) return AVERROR_INVALIDDATA; for (a = 0; a < 256; a++) { palette[a] = AV_RB24(&palette_buffer[a * 3]) * 4; }...
[ 1, 0 ]
FFmpeg
libavcodec/h264_refs.c
static int build_def_list(Picture *def, Picture **in, int len, int is_long, int sel) { int i[2] = {0}; int index = 0; while (i[0] < len || i[1] < len) { while (i[0] < len && !(in[i[0]] && (in[i[0]]->reference & sel))) i[0]++; while (i[1] < len && !(in[i[1]] && (in[i[...
[ 1, 0 ]
FFmpeg
libavfilter/graphparser.c
static int parse_inputs(const char **buf, AVFilterInOut **curr_inputs, AVFilterInOut **open_outputs, AVClass *log_ctx) { int pad = 0; while (**buf == '[') { char *name = parse_link_name(buf, log_ctx); AVFilterInOut *match; if (!name) return AVERROR(EINVAL); /* ...
[ 1, 0 ]
FFmpeg
libavcodec/hevc_sei.c
static int decode_nal_sei_prefix(GetBitContext *gb, HEVCSEIContext *s, const HEVCParamSets *ps, int type, int size, void *logctx) { switch (type) { case 256: // Mismatched value from HM 8.1 return decode_nal_sei_decoded_picture_hash(&s->pict...
[ 1, 0 ]
FFmpeg
libavformat/movenc.c
static int mov_write_minf_tag(AVIOContext *pb, MOVTrack *track) { int64_t pos = avio_tell(pb); avio_wb32(pb, 0); /* size */ ffio_wfourcc(pb, "minf"); if (track->enc->codec_type == AVMEDIA_TYPE_VIDEO) mov_write_vmhd_tag(pb); else if (track->enc->codec_type == AVMEDIA_TYPE_AUDIO) mov_write_smhd_...
[ 1, 1 ]
qemu
target/arm/arm-powerctl.c
int kvm_arm_sync_mpstate_to_kvm(ARMCPU *cpu) { if (cap_has_mp_state) { struct kvm_mp_state mp_state = { .mp_state = cpu->powered_off ? KVM_MP_STATE_STOPPED : KVM_MP_STATE_RUNNABLE }; int ret = kvm_vcpu_ioctl(CPU(cpu), KVM_SET_MP_STATE, &mp_state); if (ret) { fprintf(...
[ 1, 0 ]
FFmpeg
libavcodec/arm/h264idct_neon.S
static void FUNCC(pred4x4_vertical_add)(uint8_t *_pix, const int16_t *_block, ptrdiff_t stride) { int i; pixel *pix = (pixel *)_pix; const dctcoef *block = (const dctcoef *)_block; stride >>= sizeof(pixel) - 1; pix -= stride; for (i = 0; i < 4; i++) { pix...
[ 1, 0 ]
FFmpeg
libavcodec/decode.c
static int get_buffer_internal(AVCodecContext *avctx, AVFrame *frame, int flags) { const AVHWAccel *hwaccel = avctx->hwaccel; int override_dimensions = 1; int ret; if (avctx->codec_type == AVMEDIA_TYPE_VIDEO) { if ((ret = av_image_check_size2(avctx->width, avctx->height, ...
[ 1, 0 ]
qemu
hw/pci/pcie_host.c
void pcie_host_mmcfg_init(PCIExpressHost *e, uint32_t size) { assert(!(size & (size - 1))); /* power of 2 */ assert(size >= PCIE_MMCFG_SIZE_MIN); assert(size <= PCIE_MMCFG_SIZE_MAX); e->size = size; memory_region_init_io(&e->mmio, OBJECT(e), &pcie_mmcfg_ops, e, "pcie-mmcfg", e->...
[ 1, 0 ]
qemu
target-i386/cpu.h
static void update_sse_status(CPUX86State *env) { int rnd_type; /* set rounding mode */ switch (env->mxcsr & SSE_RC_MASK) { default: case SSE_RC_NEAR: rnd_type = float_round_nearest_even; break; case SSE_RC_DOWN: rnd_type = float_round_down; break; case SSE_RC_UP: rnd_type...
[ 1, 0 ]
FFmpeg
libavdevice/xcbgrab.c
static av_cold int xcbgrab_read_header(AVFormatContext *s) { XCBGrabContext *c = s->priv_data; int screen_num, ret; const xcb_setup_t *setup; char *display_name = av_strdup(s->filename); if (s->filename) { if (!display_name) return AVERROR(ENOMEM); if (!sscanf(s->filename, "%[^+]+%d,%d"...
[ 1, 0 ]
FFmpeg
ffplay.c
static VideoState *stream_open(const char *filename, AVInputFormat *iformat) { VideoState *is; is = av_mallocz(sizeof(VideoState)); if (!is) return NULL; av_strlcpy(is->filename, filename, sizeof(is->filename)); is->iformat = iformat; is->ytop = 0; is->xleft = 0; /* start video display */ ...
[ 1, 1 ]
FFmpeg
libavcodec/mjpegenc.c
int ff_mjpeg_encode_stuffing(MpegEncContext *s) { int i; PutBitContext *pbc = &s->pb; int mb_y = s->mb_y - !s->mb_x; int ret; MJpegContext *m; m = s->mjpeg_ctx; if (s->huffman == HUFFMAN_TABLE_OPTIMAL) { ff_mjpeg_build_optimal_huffman(m); // Replace the VLCs with the optimal ones. /...
[ 0, 0 ]
qemu
block.c
static ssize_t handle_aiocb_discard(RawPosixAIOData *aiocb) { int ret = -EOPNOTSUPP; BDRVRawState *s = aiocb->bs->opaque; if (s->has_discard == 0) { return 0; } if (aiocb->aio_type & QEMU_AIO_BLKDEV) { #ifdef BLKDISCARD do { uint64_t range[2] = {aiocb->aio_offset, aiocb->aio_nbytes}; ...
[ 1, 0 ]
qemu
osdep.c
int qemu_accept(int s, struct sockaddr *addr, socklen_t *addrlen) { int ret; #ifdef CONFIG_ACCEPT4 ret = accept4(s, addr, addrlen, SOCK_CLOEXEC); if (ret != -1 || errno != EINVAL) { return ret; } #endif ret = accept(s, addr, addrlen); if (ret >= 0) { qemu_set_cloexec(ret); } return re...
[ 1, 0 ]
qemu
hw/acpi/pcihp.c
static void ich9_lpc_config_write(PCIDevice *d, uint32_t addr, uint32_t val, int len) { ICH9LPCState *lpc = ICH9_LPC_DEVICE(d); uint32_t rcba_old = pci_get_long(d->config + ICH9_LPC_RCBA); pci_default_write_config(d, addr, val, len); if (ranges_overlap(addr, len, ICH9_LPC...
[ 0, 0 ]
qemu
HACKING
void stl_le_phys(target_phys_addr_t addr, uint32_t val) { stl_phys_internal(addr, val, DEVICE_LITTLE_ENDIAN); }
[ 0, 0 ]
FFmpeg
libavcodec/dirac.c
static int rv30_decode_intra_types(RV34DecContext *r, GetBitContext *gb, int8_t *dst) { int i, j, k; for (i = 0; i < 4; i++, dst += r->intra_types_stride - 4) { for (j = 0; j < 4; j += 2) { int code = svq3_get_ue_golomb(gb) << 1; if (code >= 81 * 2) { ...
[ 1, 0 ]
FFmpeg
libavformat/wv.c
static int wv_read_header(AVFormatContext *s, AVFormatParameters *ap) { ByteIOContext *pb = s->pb; WVContext *wc = s->priv_data; AVStream *st; if (wv_read_block_header(s, pb) < 0) return -1; wc->block_parsed = 0; /* now we are ready: build format streams */ st = av_...
[ 1, 0 ]
qemu
configure
void qemu_cpu_kick_self(void) { #ifndef _WIN32 assert(cpu_single_env); raise(SIG_IPI); #else abort(); #endif }
[ 1, 0 ]
qemu
Makefile.objs
bool migration_has_finished(MigrationState *s) { return s->state == MIG_STATE_COMPLETED; }
[ 1, 0 ]
qemu
Makefile.objs
static int qemu_rdma_drain_cq(QEMUFile *f, RDMAContext *rdma) { int ret; if (qemu_rdma_write_flush(f, rdma) < 0) { return -EIO; } while (rdma->nb_sent) { ret = qemu_rdma_block_for_wrid(rdma, RDMA_WRID_RDMA_WRITE, NULL); if (ret < 0) { fprintf(stderr, "rdma migration: complete polling e...
[ 1, 0 ]
qemu
hw/s390x/s390-virtio-ccw.c
bool gs_allowed(void) { /* for "none" machine this results in true */ return get_machine_class()->gs_allowed; }
[ 1, 0 ]
qemu
hw/s390x/s390-virtio-ccw.c
static void s390_cpu_plug(HotplugHandler *hotplug_dev, DeviceState *dev, Error **errp) { MachineState *ms = MACHINE(hotplug_dev); S390CPU *cpu = S390_CPU(dev); g_assert(!ms->possible_cpus->cpus[cpu->env.core_id].cpu); ms->possible_cpus->cpus[cpu->env.core_id].cpu = OBJECT(dev);
[ 1, 0 ]
qemu
audio/alsaaudio.c
static int sdl_init_out(HWVoiceOut *hw, struct audsettings *as) { SDLVoiceOut *sdl = (SDLVoiceOut *)hw; SDLAudioState *s = &glob_sdl; SDL_AudioSpec req, obt; int endianness; int err; audfmt_e effective_fmt; struct audsettings obt_as; req.freq = as->freq; req.format = aud_to_sdlfmt(as->fmt); ...
[ 1, 0 ]
FFmpeg
libavformat/diracdec.c
static int dirac_probe(AVProbeData *p) { if (AV_RL32(p->buf) == MKTAG('B', 'B', 'C', 'D')) return AVPROBE_SCORE_MAX; else return 0; }
[ 1, 0 ]
FFmpeg
libavformat/ftp.c
static int ftp_current_dir(FTPContext *s) { char *res = NULL, *start = NULL, *end = NULL; int i; const char *command = "PWD\r\n"; const int pwd_codes[] = {257, 0}; if (!ftp_send_command(s, command, pwd_codes, &res)) goto fail; for (i = 0; res[i]; ++i) { if (res[i] == '"') { if (!star...
[ 1, 0 ]
FFmpeg
libavcodec/x86/diracdsp_mmx.c
void ff_put_dirac_pixels32_sse2(uint8_t *dst, const uint8_t *src[5], int stride, int h) { if (h & 3) { ff_put_dirac_pixels32_c(dst, src, stride, h); } else { ff_put_pixels16_sse2(dst, src[0], stride, h); ff_put_pixels16_sse2(dst + 16, src[0] + 16, stride, h); } }
[ 0, 0 ]
qemu
util/uuid.c
int qemu_uuid_parse(const char *str, QemuUUID *uuid) { unsigned char *uu = &uuid->data[0]; int ret; if (strlen(str) != 36) { return -1; } ret = sscanf(str, UUID_FMT, &uu[0], &uu[1], &uu[2], &uu[3], &uu[4], &uu[5], &uu[6], &uu[7], &uu[8], &uu[9], &uu[10], &uu[11], &uu[...
[ 1, 0 ]
FFmpeg
libavcodec/dsputil.c
static void vp8_idct_dc_add_c(uint8_t *dst, DCTELEM block[16], ptrdiff_t stride) { int i, dc = (block[0] + 4) >> 3; uint8_t *cm = ff_cropTbl + MAX_NEG_CROP + dc; block[0] = 0; for (i = 0; i < 4; i++) { dst[0] = cm[dst[0]]; dst[1] = cm[dst[1]]; dst[2] = cm[dst[2]]; dst[3] = cm[dst[3]]; ...
[ 1, 0 ]
qemu
tests/tco-test.c
static void test_tco_defaults(void) { TestData d; d.args = NULL; d.noreboot = true; test_init(&d); g_assert_cmpint(qpci_io_readw(d.dev, d.tco_io_bar, TCO_RLD), ==, TCO_RLD_DEFAULT); /* TCO_DAT_IN & TCO_DAT_OUT */ g_assert_cmpint(qpci_io_readw(d.dev, d.tco_io_bar, TCO_DAT_IN), ==...
[ 1, 0 ]
qemu
Makefile.objs
BlockAIOCB *thread_pool_submit_aio(ThreadPool *pool, ThreadPoolFunc *func, void *arg, BlockCompletionFunc *cb, void *opaque) { ThreadPoolElement *req; req = qemu_aio_get(&thread_pool_aiocb_info, NULL, cb, opaque); req->func = func; req...
[ 1, 0 ]
qemu
hw/scsi-bus.c
static int32_t scsi_unit_attention(SCSIRequest *req, uint8_t *buf) { if (req->dev && req->dev->unit_attention.key == UNIT_ATTENTION) { scsi_req_build_sense(req, req->dev->unit_attention); } else if (req->bus->unit_attention.key == UNIT_ATTENTION) { scsi_req_build_sense(req, req->bus->unit_attention); ...
[ 1, 0 ]
FFmpeg
libavcodec/vc1dec.c
static void vc1_decode_skip_blocks(VC1Context *v) { MpegEncContext *s = &v->s; ff_er_add_slice(s, 0, s->start_mb_y, s->mb_width - 1, s->end_mb_y - 1, ER_MB_END); s->first_slice_line = 1; for (s->mb_y = s->start_mb_y; s->mb_y < s->end_mb_y; s->mb_y++) { s->mb_x = 0; ff_init_block...
[ 1, 0 ]
qemu
target-alpha/translate.c
static ExitStatus gen_mfpr(TCGv va, int regno) { int data = cpu_pr_data(regno); /* Special help for VMTIME and WALLTIME. */ if (regno == 250 || regno == 249) { void (*helper)(TCGv) = gen_helper_get_walltime; if (regno == 249) { helper = gen_helper_get_vmtime; } if (use_icount) { ...
[ 0, 0 ]
qemu
backends/baum.c
static char *SocketAddress_to_str(const char *prefix, SocketAddress *addr, bool is_listen, bool is_telnet) { switch (addr->type) { case SOCKET_ADDRESS_KIND_INET: return g_strdup_printf("%s%s:%s:%s%s", prefix, is_telnet ? "telnet" : "tcp", addr->...
[ 1, 0 ]
qemu
block.c
static void blkdebug_refresh_limits(BlockDriverState *bs, Error **errp) { BDRVBlkdebugState *s = bs->opaque; if (s->align) { bs->request_alignment = s->align; } }
[ 0, 0 ]
qemu
hw/i386/pc.c
static int cmos_get_fd_drive_type(FloppyDriveType fd0) { int val; switch (fd0) { case FLOPPY_DRIVE_TYPE_144: /* 1.44 Mb 3"5 drive */ val = 4; break; case FLOPPY_DRIVE_TYPE_288: /* 2.88 Mb 3"5 drive */ val = 5; break; case FLOPPY_DRIVE_TYPE_120: /* 1.2 Mb 5"5 drive */ ...
[ 0, 0 ]
qemu
hw/ppc/spapr_events.c
static void rtas_event_log_queue(int log_type, void *data, bool exception) { sPAPRMachineState *spapr = SPAPR_MACHINE(qdev_get_machine()); sPAPREventLogEntry *entry = g_new(sPAPREventLogEntry, 1); g_assert(data); entry->log_type = log_type; entry->exception = exception; entry->data = data; QTAILQ_...
[ 0, 0 ]
qemu
hw/pci.c
static int pci_set_default_subsystem_id(PCIDevice *pci_dev) { uint16_t *id; id = (void *)(&pci_dev->config[PCI_SUBSYSTEM_VENDOR_ID]); id[0] = cpu_to_le16(pci_default_sub_vendor_id); id[1] = cpu_to_le16(pci_default_sub_device_id); return 0; }
[ 0, 0 ]
qemu
main-loop.c
static void glib_pollfds_fill(uint32_t *cur_timeout) { GMainContext *context = g_main_context_default(); int timeout = 0; int n; g_main_context_prepare(context, &max_priority); glib_pollfds_idx = gpollfds->len; n = glib_n_poll_fds; do { GPollFD *pfds; glib_n_poll_fds = n; g_array_se...
[ 0, 0 ]
qemu
MAINTAINERS
static int do_syscall(CPUState *env, struct kqemu_cpu_state *kenv) { int selector; selector = (env->star >> 32) & 0xffff; #ifdef TARGET_X86_64 if (env->hflags & HF_LMA_MASK) { int code64; env->regs[R_ECX] = kenv->next_eip; env->regs[11] = env->eflags; code64 = env->...
[ 1, 0 ]
qemu
gdbstub.c
gdb_handlesig(CPUState *cpu, int sig) { GDBState *s; char buf[256]; int n; s = gdbserver_state; if (gdbserver_fd < 0 || s->fd < 0) { return sig; } /* disable single step if it was enabled */ cpu_single_step(cpu, 0); tb_flush(cpu); if (sig != 0) { snprintf(buf, sizeof(buf), "S%02x...
[ 1, 1 ]
qemu
include/qapi/qmp/json-lexer.h
static void json_message_process_token(JSONLexer *lexer, QString *token, JSONTokenType type, int x, int y) { JSONMessageParser *parser = container_of(lexer, JSONMessageParser, lexer); QDict *dict; if (type == JSON_OPERATOR) { switch (qstring_get_str(token)[0]) { ...
[ 0, 0 ]
qemu
linux-user/qemu.h
long do_sigreturn(CPUMBState *env) { struct target_signal_frame *frame; abi_ulong frame_addr; target_sigset_t target_set; sigset_t set; int i; frame_addr = env->regs[R_SP]; /* Make sure the guest isn't playing games. */ if (!lock_user_struct(VERIFY_WRITE, frame, frame_addr, 1)) goto badfr...
[ 0, 0 ]
qemu
fpu/softfloat-native.c
static inline uint32_t efsctui(uint32_t val) { CPU_FloatU u; u.l = val; /* NaN are not treated the same way IEEE 754 does */ if (unlikely(float32_is_nan(u.f))) return 0; return float32_to_uint32(u.f, &env->vec_status); }
[ 0, 0 ]
qemu
hw/lsi53c895a.c
static int lsi_scsi_init(PCIDevice *dev) { LSIState *s = DO_UPCAST(LSIState, dev, dev); uint8_t *pci_conf; pci_conf = s->dev.config; /* PCI Vendor ID (word) */ pci_config_set_vendor_id(pci_conf, PCI_VENDOR_ID_LSI_LOGIC); /* PCI device ID (word) */ pci_config_set_device_id(pci_conf, PCI_DEVICE_ID_L...
[ 1, 1 ]
qemu
HACKING
void stq_le_phys(target_phys_addr_t addr, uint64_t val) { val = cpu_to_le64(val); cpu_physical_memory_write(addr, &val, 8); }
[ 0, 0 ]
qemu
qemu-timer.h
static int64_t get_clock(void) { #if defined(__linux__) || (defined(__FreeBSD__) && __FreeBSD_version >= 500000) || defined(__DragonFly__) if (use_rt_clock) { struct timespec ts; clock_gettime(CLOCK_MONOTONIC, &ts); return ts.tv_sec * 1000000000LL + ts.tv_nsec; } else #endif { ...
[ 0, 1 ]
qemu
target-unicore32/Makefile.objs
float64 HELPER(ucf64_addd)(float64 a, float64 b, CPUUniCore32State *env) { return float64_add(a, b, &env->ucf64.fp_status); }
[ 0, 0 ]
qemu
include/qemu/osdep.h
static void term_exit(void) { tcsetattr(0, TCSANOW, &oldtty); }
[ 0, 0 ]
qemu
block/qapi.c
static void test_visitor_in_native_list_uint16(TestInputVisitorData *data, const void *unused) { test_native_list_integer_helper(data, unused, USER_DEF_NATIVE_LIST_UNION_KIND_U16); }
[ 0, 0 ]
qemu
hw/s390x/s390-virtio.c
void s390_add_running_cpu(S390CPU *cpu) { CPUState *cs = CPU(cpu); if (cs->halted) { s390_running_cpus++; cs->halted = 0; cs->exception_index = -1; } }
[ 0, 0 ]
qemu
block/curl.c
static void curl_close(BlockDriverState *bs) { BDRVCURLState *s = bs->opaque; int i; DPRINTF("CURL: Close\n"); for (i = 0; i < CURL_NUM_STATES; i++) { if (s->states[i].in_use) curl_clean_state(&s->states[i]); if (s->states[i].curl) { curl_easy_cleanup(s->states[i].curl); s->s...
[ 0, 0 ]
FFmpeg
libavformat/aviobuf.c
int get_buffer(ByteIOContext *s, unsigned char *buf, int size) { int len, size1; size1 = size; while (size > 0) { len = s->buf_end - s->buf_ptr; if (len > size) len = size; if (len == 0) { fill_buffer(s); len = s->buf_end - s->buf_ptr; if (len == 0) break; ...
[ 1, 0 ]
qemu
include/qemu/thread-win32.h
void qemu_cond_destroy(QemuCond *cond) { BOOL result; result = CloseHandle(cond->continue_event); if (!result) { error_exit(GetLastError(), __func__); } cond->continue_event = 0; result = CloseHandle(cond->sema); if (!result) { error_exit(GetLastError(), __func__); } cond->sema = 0; ...
[ 1, 0 ]
qemu
hw/vmware_vga.c
static inline int vmsvga_fifo_empty(struct vmsvga_state_s *s) { if (!s->config || !s->enable) return 1; return (s->cmd->next_cmd == s->cmd->stop); }
[ 1, 0 ]
FFmpeg
libswscale/Makefile
static inline void RENAME(rgb24ToUV_half)(uint8_t *dstU, uint8_t *dstV, const uint8_t *src1, const uint8_t *src2, long width, uint32_t *unused) { int i; assert(src1 == src2); for (i = 0; i < width; i++) { int r = src1[6 * i + 0] + src1[6 * i + 3]; int g = src1[6 * i + 1] + src...
[ 1, 0 ]
FFmpeg
libavcodec/pngdec.c
static int decode_iccp_chunk(PNGDecContext *s, int length, AVFrame *f) { int ret, cnt = 0; uint8_t *data, profile_name[82]; AVBPrint bp; AVFrameSideData *sd; while ((profile_name[cnt++] = bytestream2_get_byte(&s->gb)) && cnt < 81) ; if (cnt > 80) { av_log(s->avctx, AV_LOG_ERROR, "iCCP with i...
[ 1, 0 ]
FFmpeg
libavcodec/hevc_mvs.c
void ff_hevc_luma_mv_merge_mode(HEVCContext *s, int x0, int y0, int nPbW, int nPbH, int log2_cb_size, int part_idx, int merge_idx, MvField *mv) { int singleMCLFlag = 0; int nCS = 1 << log2_cb_size; LOCAL_ALIGNED(4, MvField, mergecand_list, [MRG...
[ 1, 0 ]
qemu
target/s390x/arch_dump.c
int s390_cpu_write_elf64_note(WriteCoreDumpFunction f, CPUState *cs, int cpuid, void *opaque) { S390CPU *cpu = S390_CPU(cs); return s390x_write_all_elf64_notes("CORE", f, cpu, cpuid, opaque); }
[ 1, 0 ]
qemu
target-ppc/mmu-hash32.c
static int ppc_hash64_pte_update_flags(struct mmu_ctx_hash64 *ctx, target_ulong *pte1p, int ret, int rw) { int store = 0; /* Update page flags */ if (!(*pte1p & HPTE64_R_R)) { /* Update accessed flag */ *pte1p |= HPTE64_...
[ 0, 0 ]
qemu
Makefile.objs
static void glib_pollfds_fill(int64_t *cur_timeout) { GMainContext *context = g_main_context_default(); int timeout = 0; int64_t timeout_ns; int n; g_main_context_prepare(context, &max_priority); glib_pollfds_idx = gpollfds->len; n = glib_n_poll_fds; do { GPollFD *pfds; glib_n_poll_fd...
[ 0, 0 ]
qemu
hw/ppc/spapr_pci.c
static void rtas_ibm_set_eeh_option(PowerPCCPU *cpu, sPAPRMachineState *spapr, uint32_t token, uint32_t nargs, target_ulong args, uint32_t nret, target_ulong rets) { sP...
[ 1, 0 ]
qemu
include/exec/gen-icount.h
static void dec_b(DisasContext *dc) { if (dc->r0 == R_RA) { LOG_DIS("ret\n"); } else if (dc->r0 == R_EA) { LOG_DIS("eret\n"); } else if (dc->r0 == R_BA) { LOG_DIS("bret\n"); } else { LOG_DIS("b r%d\n", dc->r0); } /* restore IE.IE in case of an eret */ if (dc->r0 == R_EA) { ...
[ 0, 0 ]
qemu
tcg/s390/tcg-target.h
static void query_facilities(void) { unsigned long hwcap = qemu_getauxval(AT_HWCAP); /* Is STORE FACILITY LIST EXTENDED available? Honestly, I believe this is present on all 64-bit systems, but let's check for it anyway. */ if (hwcap & HWCAP_S390_STFLE) { register int r0 __asm__("0"); regist...
[ 1, 0 ]
FFmpeg
cmdutils.c
static const OptionDef *find_option(const OptionDef *po, const char *name) { const char *p = strchr(name, ':'); int len = p ? p - name : strlen(name); while (po->name != NULL) { if (!strncmp(name, po->name, len) && strlen(po->name) == len) break; po++; } return po; }
[ 0, 0 ]