Projectname
large_stringclasses
15 values
Filepath
large_stringlengths
4
106
Function
large_stringlengths
11
3.45k
Label
list
qemu
HACKING
static uint64_t mv88w8618_pit_read(void *opaque, target_phys_addr_t offset, unsigned size) { mv88w8618_pit_state *s = opaque; mv88w8618_timer_state *t; switch (offset) { case MP_PIT_TIMER1_VALUE ... MP_PIT_TIMER4_VALUE: t = &s->timer[(offset - MP_PIT_TIMER1_VALUE) >...
[ 0, 0 ]
qemu
qemu-io.c
static int openfile(char *name, int flags, int growable) { if (bs) { fprintf(stderr, "file open already, try 'help close'\n"); return 1; } bs = bdrv_new("hda"); if (!bs) return 1; if (bdrv_open(bs, name, flags) == -1) { fprintf(stderr, "%s: can't open device %s\n", progname, name); ...
[ 1, 0 ]
qemu
hw/virtio/virtio.c
static inline void vring_used_idx_set(VirtQueue *vq, uint16_t val) { VRingMemoryRegionCaches *caches = atomic_rcu_read(&vq->vring.caches); hwaddr pa = offsetof(VRingUsed, idx); virtio_stw_phys_cached(vq->vdev, &caches->used, pa, val); address_space_cache_invalidate(&caches->used, pa, sizeof(val)); vq->u...
[ 1, 0 ]
qemu
hw/usb/redirect.c
static void usbredir_interrupt_packet( void *priv, uint64_t id, struct usb_redir_interrupt_packet_header *interrupt_packet, uint8_t *data, int data_len) { USBRedirDevice *dev = priv; uint8_t ep = interrupt_packet->endpoint; DPRINTF("interrupt-in status %d ep %02X len %d id %" PRIu64 "\n", ...
[ 1, 0 ]
qemu
hw/i386/pc.c
int e820_add_entry(uint64_t address, uint64_t length, uint32_t type) { int index = le32_to_cpu(e820_reserve.count); struct e820_entry *entry; if (type != E820_RAM) { /* old FW_CFG_E820_TABLE entry -- reservations only */ if (index >= E820_NR_ENTRIES) { return -EBUSY; } entry = &e820_...
[ 1, 0 ]
FFmpeg
libavcodec/mace.c
static void chomp6(ChannelData *ctx, int16_t *output, uint8_t val, const uint16_t tab1[], const int16_t *tab2, int tab2_stride, uint32_t numChannels) { int16_t current; current = tab2[((ctx->index & 0x7f0) >> 4) * tab2_stride + val]; if ((ctx->previo...
[ 1, 0 ]
qemu
qemu-io.c
aio_read_done(void *opaque, int ret) { struct aio_ctx *ctx = opaque; struct timeval t2; gettimeofday(&t2, NULL); if (ret < 0) { printf("readv failed: %s\n", strerror(-ret)); return; } if (ctx->Pflag) { void *cmp_buf = malloc(ctx->qiov.size); memset(cmp_buf, ctx->pattern, ctx->qiov....
[ 1, 0 ]
qemu
block/gluster.c
static void gluster_finish_aiocb(struct glfs_fd *fd, ssize_t ret, void *arg) { GlusterAIOCB *acb = (GlusterAIOCB *)arg; BlockDriverState *bs = acb->common.bs; BDRVGlusterState *s = bs->opaque; int retval; acb->ret = ret; retval = qemu_write_full(s->fds[GLUSTER_FD_WRITE], &acb, sizeof(acb)); if (re...
[ 1, 0 ]
qemu
hw/ppc/spapr.c
void spapr_dt_events(void *fdt, uint32_t check_exception_irq) { int event_sources, epow_events; uint32_t irq_ranges[] = {cpu_to_be32(check_exception_irq), cpu_to_be32(1)}; uint32_t interrupts[] = {cpu_to_be32(check_exception_irq), 0}; _FDT(event_sources = fdt_add_subnode(fdt, 0, "event-sources")); _FDT(...
[ 1, 0 ]
qemu
block/block-backend.c
static void ide_sector_read_cb(void *opaque, int ret) { IDEState *s = opaque; int n; s->pio_aiocb = NULL; s->status &= ~BUSY_STAT; if (ret == -ECANCELED) { return; } block_acct_done(bdrv_get_stats(s->bs), &s->acct); if (ret != 0) { if (ide_handle_rw_error(s, -ret, ...
[ 0, 0 ]
qemu
qemu-coroutine.c
static void coroutine_delete(Coroutine *co) { if (CONFIG_COROUTINE_POOL) { qemu_mutex_lock(&pool_lock); if (pool_size < pool_max_size) { QSLIST_INSERT_HEAD(&pool, co, pool_next); co->caller = NULL; pool_size++; qemu_mutex_unlock(&pool_lock); return; } qemu_mutex...
[ 0, 0 ]
qemu
target-i386/op.c
void OPPROTO op_addw_EDI_T0(void) { EDI = (EDI & ~0xffff) | ((EDI + T0) & 0xffff); }
[ 0, 0 ]
qemu
target-ppc/op_helper.c
uint64_t helper_fdiv(uint64_t arg1, uint64_t arg2) { CPU_DoubleU farg1, farg2; farg1.ll = arg1; farg2.ll = arg2; #if USE_PRECISE_EMULATION if (unlikely(float64_is_signaling_nan(farg1.d) || float64_is_signaling_nan(farg2.d))) { /* sNaN division */ farg1.ll = fload_invalid_op_excp(...
[ 0, 0 ]
FFmpeg
libavfilter/asrc_abuffer.c
static void ff_dlog_link(void *ctx, AVFilterLink *link, int end) { if (link->type == AVMEDIA_TYPE_VIDEO) { av_dlog(ctx, "link[%p s:%dx%d fmt:%-16s %-16s->%-16s]%s", link, link->w, link->h, av_pix_fmt_descriptors[link->format].name, link->src ? link->src->filt...
[ 1, 0 ]
qemu
tests/boot-sector.c
int boot_sector_init(char *fname) { int fd, ret; size_t len = sizeof boot_sector; fd = mkstemp(fname); if (fd < 0) { fprintf(stderr, "Couldn't open \"%s\": %s", fname, strerror(errno)); return 1; } /* For Open Firmware based system, we can use a Forth script instead */ if (strcmp(qtest_ge...
[ 1, 0 ]
FFmpeg
libavformat/rtp.c
int ff_rtp_get_payload_type(AVFormatContext *fmt, AVCodecContext *codec, int idx) { int i; AVOutputFormat *ofmt = fmt ? fmt->oformat : NULL; /* Was the payload type already specified for the RTP muxer? */ if (ofmt && ofmt->priv_class && fmt->priv_data) { int64_t payload_ty...
[ 1, 0 ]
qemu
monitor.c
void qmp_qmp_capabilities(Error **errp) { cur_mon->qmp.in_command_mode = true; }
[ 1, 0 ]
FFmpeg
libavcodec/pictordec.c
static void picmemset(PicContext *s, AVFrame *frame, unsigned value, int run, int *x, int *y, int *plane, int bits_per_plane) { uint8_t *d; int shift = *plane * bits_per_plane; unsigned mask = ((1 << bits_per_plane) - 1) << shift; value <<= shift; while (run > 0) { int j; ...
[ 1, 0 ]
qemu
target-tricore/op_helper.c
target_ulong helper_mul_suov(CPUTriCoreState *env, target_ulong r1, target_ulong r2) { int64_t t1 = extract64(r1, 0, 32); int64_t t2 = extract64(r2, 0, 32); int64_t result = t1 * t2; return suov32(env, result); }
[ 1, 0 ]
FFmpeg
ffmpeg_qsv.c
static int init_opaque_surf(QSVContext *qsv) { AVQSVContext *hwctx_enc = qsv->ost->enc_ctx->hwaccel_context; mfxFrameSurface1 *surfaces; int i; qsv->nb_surfaces = hwctx_enc->nb_opaque_surfaces; qsv->opaque_surfaces_buf = av_buffer_ref(hwctx_enc->opaque_surfaces); qsv->surface_ptrs = av_mallocz_...
[ 1, 0 ]
qemu
hw/virtio/vhost-user.c
static int vhost_user_get_vring_base(struct vhost_dev *dev, struct vhost_vring_state *ring) { VhostUserMsg msg = { .request = VHOST_USER_GET_VRING_BASE, .flags = VHOST_USER_VERSION, .state = *ring, .size = sizeof(*ring), }; vhost_user_write(dev...
[ 1, 0 ]
qemu
cpu-all.h
void arm_cpu_list(FILE *f, int (*cpu_fprintf)(FILE *f, const char *fmt, ...)) { int i; (*cpu_fprintf)(f, "Available CPUs:\n"); for (i = 0; arm_cpu_names[i].name; i++) { (*cpu_fprintf)(f, " %s\n", arm_cpu_names[i].name); } }
[ 0, 0 ]
qemu
monitor.c
static QDict *build_qmp_error_dict(const QError *err) { QObject *obj; obj = qobject_from_jsonf("{ 'error': { 'class': %s, 'desc': %p } }", ErrorClass_lookup[err->err_class], qerror_human(err)); return qobject_to_qdict(obj); }
[ 0, 0 ]
qemu
ui/gtk.c
static void gd_update_caption(GtkDisplayState *s) { const char *status = ""; gchar *title; if (!runstate_is_running()) { status = " [Stopped]"; } if (qemu_name) { title = g_strdup_printf("QEMU (%s)%s", qemu_name, status); } else { title = g_strdup_printf("QEMU%s", status); } gtk_wi...
[ 0, 0 ]
qemu
hw/s390x/css.c
void css_adapter_interrupt(uint8_t isc) { S390CPU *cpu = s390_cpu_addr2state(0); uint32_t io_int_word = (isc << 27) | IO_INT_WORD_AI; trace_css_adapter_interrupt(isc); s390_io_interrupt(cpu, 0, 0, 0, io_int_word); }
[ 0, 0 ]
qemu
MAINTAINERS
ram_addr_t qemu_ram_addr_from_host(void *ptr) { RAMBlock *prev; RAMBlock **prevp; RAMBlock *block; uint8_t *host = ptr; #ifdef CONFIG_KQEMU if (kqemu_phys_ram_base) { return host - kqemu_phys_ram_base; } #endif prev = NULL; prevp = &ram_blocks; block = ram_blocks; while (block && (b...
[ 1, 0 ]
qemu
block/iscsi.c
static int parse_chap(struct iscsi_context *iscsi, const char *target) { QemuOptsList *list; QemuOpts *opts; const char *user = NULL; const char *password = NULL; list = qemu_find_opts("iscsi"); if (!list) { return 0; } opts = qemu_opts_find(list, target); if (opts == NULL) { opts =...
[ 1, 0 ]
FFmpeg
libavcodec/m101.c
static av_cold int m101_decode_init(AVCodecContext *avctx) { if (avctx->extradata_size < 6 * 4) return AVERROR_INVALIDDATA; if (avctx->extradata[2 * 4] == 10) avctx->pix_fmt = AV_PIX_FMT_YUV422P10; else avctx->pix_fmt = AV_PIX_FMT_YUYV422; return 0; }
[ 1, 0 ]
qemu
target-lm32/translate.c
static void dec_sru(DisasContext *dc) { if (dc->format == OP_FMT_RI) { LOG_DIS("srui r%d, r%d, %d\n", dc->r1, dc->r0, dc->imm5); } else { LOG_DIS("sru r%d, r%d, r%d\n", dc->r2, dc->r0, dc->r1); } if (!(dc->env->features & LM32_FEATURE_SHIFT)) { if (dc->format == OP_FMT_RI) { /* TODO: c...
[ 1, 1 ]
FFmpeg
libavcodec/vc9.c
static void decode_rowskip(uint8_t *plane, int width, int height, int stride, VC9Context *v) { int x, y; GetBitContext *gb = &v->s.gb; for (y = 0; y < height; y++) { if (!get_bits(gb, 1)) // rowskip memset(plane, 0, width); else for (x = 0; x < width; x++) ...
[ 1, 0 ]
qemu
contrib/libvhost-user/libvhost-user.c
vu_queue_notify(VuDev *dev, VuVirtq *vq) { if (unlikely(dev->broken)) { return; } if (!vring_notify(dev, vq)) { DPRINT("skipped notify...\n"); return; } if (eventfd_write(vq->call_fd, 1) < 0) { vu_panic(dev, "Error writing eventfd: %s", strerror(errno)); } }
[ 1, 0 ]
FFmpeg
libavcodec/atrac.c
void ff_atrac_iqmf(float *inlo, float *inhi, unsigned int nIn, float *pOut, float *delayBuf, float *temp) { int i, j; float *p1, *p3; memcpy(temp, delayBuf, 46 * sizeof(float)); p3 = temp + 46; /* loop1 */ for (i = 0; i < nIn; i += 2) { p3[2 * i + 0] = inlo[i] + inhi[i]; ...
[ 1, 0 ]
FFmpeg
libavcodec/bytestream.h
static int read_rle_sgi(unsigned char *out_buf, const uint8_t *in_buf, const uint8_t *in_end, SgiState *s) { uint8_t *dest_row; unsigned int len = s->height * s->depth * 4; const uint8_t *start_table = in_buf; unsigned int y, z; unsigned int start_offset; /* size of RLE offs...
[ 1, 0 ]
qemu
tests/postcopy-test.c
static void wait_for_serial(const char *side) { char *serialpath = g_strdup_printf("%s/%s", tmpfs, side); FILE *serialfile = fopen(serialpath, "r"); const char *arch = qtest_get_arch(); int started = (strcmp(side, "src_serial") == 0 && strcmp(arch, "ppc64") == 0) ? 0 ...
[ 1, 0 ]
qemu
hw/syborg_virtio.c
static void syborg_virtio_writel(void *opaque, target_phys_addr_t offset, uint32_t value) { SyborgVirtIOProxy *s = opaque; VirtIODevice *vdev = s->vdev; DPRINTF("writel 0x%x = 0x%x\n", (int)offset, value); if (offset >= SYBORG_VIRTIO_CONFIG) { return virtio_config_wri...
[ 1, 0 ]
qemu
hw/arm/omap1.c
static struct omap_mcbsp_s *omap_mcbsp_init(MemoryRegion *system_memory, hwaddr base, qemu_irq txirq, qemu_irq rxirq, qemu_irq *dma, omap_clk clk) { struct omap_mcbsp_s *s = (struct...
[ 1, 0 ]
FFmpeg
libavformat/mpegtsenc.c
static int mpegts_audio_write(void *opaque, uint8_t *buf, int size) { MpegTSWriteStream *ts_st = (MpegTSWriteStream *)opaque; if (ts_st->adata_pos + size > ts_st->adata_size) return AVERROR(EIO); memcpy(ts_st->adata + ts_st->adata_pos, buf, size); ts_st->adata_pos += size; return 0; }
[ 1, 0 ]
FFmpeg
libavcodec/gif.c
static void gif_put_bits_rev(PutBitContext *s, int n, unsigned int value) { unsigned int bit_buf; int bit_cnt; // printf("put_bits=%d %x\n", n, value); assert(n == 32 || value < (1U << n)); bit_buf = s->bit_buf; bit_cnt = 32 - s->bit_left; /* XXX:lazyness... was = s->bit_cnt; */ // printf("n...
[ 1, 1 ]
FFmpeg
tools/ismindex.c
static int get_video_private_data(struct VideoFile *vf, AVCodecContext *codec) { AVIOContext *io = NULL; uint16_t sps_size, pps_size; int err = AVERROR(EINVAL); if (codec->codec_id == AV_CODEC_ID_VC1) return get_private_data(vf, codec); avio_open_dyn_buf(&io); if (codec->extradata_size < 11 || c...
[ 1, 0 ]
FFmpeg
libavcodec/cavsdec.c
static int decode_seq_header(AVSContext *h) { MpegEncContext *s = &h->s; int frame_rate_code; h->profile = get_bits(&s->gb, 8); h->level = get_bits(&s->gb, 8); skip_bits1(&s->gb); // progressive sequence s->width = get_bits(&s->gb, 14); s->height = get_bits(&s->gb, 14); skip_bits(&s->gb, 2); // ...
[ 1, 0 ]
FFmpeg
libavcodec/error_resilience.c
int ff_mpeg_er_init(MpegEncContext *s) { ERContext *er = &s->er; int mb_array_size = s->mb_height * s->mb_stride; int i; er->avctx = s->avctx; er->mb_index2xy = s->mb_index2xy; er->mb_num = s->mb_num; er->mb_width = s->mb_width; er->mb_height = s->mb_height; er->mb_stride = s->mb_stride; ...
[ 1, 0 ]
FFmpeg
libavcodec/mmaldec.c
static int ffmmal_fill_input_port(AVCodecContext *avctx) { MMALDecodeContext *ctx = avctx->priv_data; while (ctx->waiting_buffers) { MMAL_BUFFER_HEADER_T *mbuffer; FFBufferEntry *buffer; MMAL_STATUS_T status; mbuffer = mmal_queue_get(ctx->pool_in->queue); if (!mbuffer) return 0; ...
[ 1, 0 ]
FFmpeg
Changelog
static void writer_print_ts(WriterContext *wctx, const char *key, int64_t ts, int is_duration) { if ((!is_duration && ts == AV_NOPTS_VALUE) || (is_duration && ts == 0)) { writer_print_string(wctx, key, "N/A", 1); } else { writer_print_integer(wctx, key, ts); } }
[ 1, 0 ]
FFmpeg
libavformat/avienc.c
unsigned int codec_get_tag(const CodecTag *tags, int id) { while (tags->id != 0) { if (tags->id == id) return tags->tag; tags++; } return 0; }
[ 0, 0 ]
FFmpeg
libavdevice/dshow.c
static int shall_we_drop(AVFormatContext *s) { struct dshow_ctx *ctx = s->priv_data; static const uint8_t dropscore[] = {62, 75, 87, 100}; const int ndropscores = FF_ARRAY_ELEMS(dropscore); unsigned int buffer_fullness = (ctx->curbufsize * 100) / s->max_picture_buffer; if (dropscore[++ctx->video_f...
[ 1, 0 ]
qemu
migration/migration.c
static int qemu_rdma_register_and_get_keys(RDMAContext *rdma, RDMALocalBlock *block, uintptr_t host_addr, uint32_t *lkey, uint32_t *rkey, int chunk, uint8_t *chunk_start, uint8_t *chunk_end) { if (block->mr) { if...
[ 1, 0 ]
FFmpeg
libavcodec/hevc_ps.c
static void decode_profile_tier_level(HEVCContext *s, PTLCommon *ptl) { int i; HEVCLocalContext *lc = s->HEVClc; GetBitContext *gb = &lc->gb; ptl->profile_space = get_bits(gb, 2); ptl->tier_flag = get_bits1(gb); ptl->profile_idc = get_bits(gb, 5); if (ptl->profile_idc == FF_PROFILE_HEVC_MAIN) ...
[ 1, 0 ]
qemu
hw/serial.c
SerialState *serial_init(int base, qemu_irq irq, int baudbase, CharDriverState *chr) { SerialState *s; s = qemu_mallocz(sizeof(SerialState)); if (!s) return NULL; s->irq = irq; s->baudbase = baudbase; s->tx_timer = qemu_new_timer(vm_clock, serial_tx_done, s); if (!s-...
[ 1, 0 ]
qemu
linux-user/signal.c
static long do_rt_sigreturn_v2(CPUARMState *env) { abi_ulong frame_addr; struct rt_sigframe_v2 *frame = NULL; /* * Since we stacked the signal on a 64-bit boundary, * then 'sp' should be word aligned here. If it's * not, then the user is trying to mess with us. */ frame_addr = env->regs[13...
[ 1, 0 ]
FFmpeg
Changelog
static void vp8_h_loop_filter_simple_c(uint8_t *dst, ptrdiff_t stride, int flim) { int i; for (i = 0; i < 16; i++) if (simple_limit(dst + i * stride, 1, flim)) filter_common(dst + i * stride, 1, 1); }
[ 1, 0 ]
FFmpeg
libswscale/bfin/internal_bfin.S
static inline void RENAME(bgr24ToUV_half)(uint8_t *dstU, uint8_t *dstV, const uint8_t *src1, const uint8_t *src2, int width, uint32_t *unused) { int i; for (i = 0; i < width; i++) { int b = src1[6 * i + 0] + src1[6 * i + 3]; int g = src1[6 * i + 1] + src1[6 * i + 4]; int r =...
[ 1, 0 ]
qemu
hw/openpic.c
static void openpic_load_IRQ_queue(QEMUFile *f, IRQ_queue_t *q) { unsigned int i; for (i = 0; i < BF_WIDTH(MAX_IRQ); i++) qemu_get_be32s(f, &q->queue[i]); qemu_get_sbe32s(f, &q->next); qemu_get_sbe32s(f, &q->priority); }
[ 1, 0 ]
qemu
hw/virtio/virtio.c
void virtqueue_map(VirtIODevice *vdev, VirtQueueElement *elem) { virtqueue_map_iovec(vdev, elem->in_sg, elem->in_addr, &elem->in_num, MIN(ARRAY_SIZE(elem->in_sg), ARRAY_SIZE(elem->in_addr)), 1); virtqueue_map_iovec(vdev, elem->out_sg, elem->out_addr, &elem->out_num, ...
[ 0, 0 ]
qemu
target-i386/helper.c
void helper_ltr_T0(void) { int selector; SegmentCache *dt; uint32_t e1, e2; int index, type, entry_limit; target_ulong ptr; selector = T0 & 0xffff; if ((selector & 0xfffc) == 0) { /* NULL selector case: invalid TR */ env->tr.base = 0; env->tr.limit = 0; env->tr.flags = 0; } ...
[ 1, 0 ]
qemu
cpus.c
void set_numa_modes(void) { CPUArchState *env; int i; for (env = first_cpu; env != NULL; env = env->next_cpu) { for (i = 0; i < nb_numa_nodes; i++) { if (node_cpumask[i] & (1 << env->cpu_index)) { env->numa_node = i; } } } }
[ 0, 0 ]
qemu
hw/arm/nseries.c
static void omap_mcbsp_writew(void *opaque, hwaddr addr, uint32_t value) { struct omap_mcbsp_s *s = (struct omap_mcbsp_s *)opaque; int offset = addr & OMAP_MPUI_REG_MASK; if (offset == 0x04) { /* DXR */ if (((s->xcr[0] >> 5) & 7) < 3) /* XWDLEN1 */ return; if (s...
[ 1, 0 ]
qemu
audio/paaudio.c
static void *qpa_thread_in(void *arg) { PAVoiceIn *pa = arg; HWVoiceIn *hw = &pa->hw; int threshold; threshold = conf.divisor ? hw->samples / conf.divisor : 0; if (audio_pt_lock(&pa->pt, AUDIO_FUNC)) { return NULL; } for (;;) { int incr, to_grab, wpos; for (;;) { if (pa->done)...
[ 1, 0 ]
FFmpeg
libavformat/mpeg.c
static int64_t update_scr(AVFormatContext *ctx, int stream_index, int64_t pts) { MpegMuxContext *s = ctx->priv_data; int64_t scr; if (s->is_vcd) /* Since the data delivery rate is constant, SCR is computed using the formula C + i * 1200 where C is the start constant and i is the pack inde...
[ 1, 1 ]
qemu
target-i386/cpu.c
static void host_x86_cpu_initfn(Object *obj) { X86CPU *cpu = X86_CPU(obj); CPUX86State *env = &cpu->env; KVMState *s = kvm_state; /* We can't fill the features array here because we don't know yet if * "migratable" is true or false. */ cpu->host_features = true; /* If KVM is disabled, cpu_x86...
[ 0, 0 ]
qemu
hw/usb/bus.c
void usb_device_attach(USBDevice *dev, Error **errp) { USBBus *bus = usb_bus_from_device(dev); USBPort *port = dev->port; char devspeed[32], portspeed[32]; assert(port != NULL); assert(!dev->attached); usb_mask_to_str(devspeed, sizeof(devspeed), dev->speedmask); usb_mask_to_str(portspeed, sizeof(p...
[ 1, 0 ]
qemu
gdbstub.c
static int gdbserver_open(int port) { struct sockaddr_in sockaddr; int fd, ret; fd = socket(PF_INET, SOCK_STREAM, 0); if (fd < 0) { perror("socket"); return -1; } #ifndef _WIN32 fcntl(fd, F_SETFD, FD_CLOEXEC); #endif socket_set_fast_reuse(fd); sockaddr.sin_family = AF_INET; sockad...
[ 1, 0 ]
qemu
HACKING
MemoryRegion *escc_init(target_phys_addr_t base, qemu_irq irqA, qemu_irq irqB, CharDriverState *chrA, CharDriverState *chrB, int clock, int it_shift) { DeviceState *dev; SysBusDevice *s; SerialState *d; dev = qdev_create(NULL, "escc"); qdev_prop_set_uint...
[ 0, 0 ]
qemu
bsd-user/mmap.c
int mmap_frag(unsigned long host_start, unsigned long start, unsigned long end, int prot, int flags, int fd, unsigned long offset) { unsigned long host_end, ret, addr; int prot1, prot_new; host_end = host_start + qemu_host_page_size; /* get the protection of the target pages o...
[ 1, 0 ]
FFmpeg
libavcodec/cabac.h
static int decode_cabac_field_decoding_flag(H264Context *h) { MpegEncContext *const s = &h->s; const int mb_x = s->mb_x; const int mb_y = s->mb_y & ~1; const int mba_xy = mb_x - 1 + mb_y * s->mb_stride; const int mbb_xy = mb_x + (mb_y - 2) * s->mb_stride; unsigned int ctx = 0; if (h->slice_table[mb...
[ 1, 0 ]
qemu
hw/i386/xen/xen-hvm.c
void qemu_system_reset_request(void) { if (no_reboot) { shutdown_requested = 1; } else { reset_requested = 1; } cpu_stop_current(); qemu_notify_event(); }
[ 1, 0 ]
FFmpeg
libavformat/mpeg.c
static int mpeg_mux_end(AVFormatContext *ctx) { MpegMuxContext *s = ctx->priv_data; StreamInfo *stream; int i; /* flush each packet */ for (i = 0; i < ctx->nb_streams; i++) { stream = ctx->streams[i]->priv_data; while (stream->buffer_ptr > 0) { flush_packet(ctx, i, AV_NOPTS_VALUE, AV_NO...
[ 1, 0 ]
qemu
hw/i386/acpi-build.c
static bool acpi_get_mcfg(AcpiMcfgInfo *mcfg) { Object *pci_host; QObject *o; pci_host = acpi_get_i386_pci_host(); g_assert(pci_host); o = object_property_get_qobject(pci_host, PCIE_HOST_MCFG_BASE, NULL); if (!o) { return false; } mcfg->mcfg_base = qnum_get_int(qobject_to_qnum(o)); qobje...
[ 1, 0 ]
FFmpeg
libavcodec/svq1.c
static int decode_frame_header(bit_buffer_t *bitbuf, MpegEncContext *s) { int frame_size_code; /* unknown field */ get_bits(bitbuf, 8); /* frame type */ s->pict_type = get_bits(bitbuf, 2); if (s->pict_type == 3) return -1; if (s->pict_type == SVQ1_FRAME_INTRA) { /* unknown fields */ ...
[ 1, 0 ]
qemu
Makefile.objs
static void do_smbios_option(const char *optarg) { if (smbios_entry_add(optarg) < 0) { fprintf(stderr, "Wrong smbios provided\n"); exit(1); } }
[ 0, 0 ]
qemu
include/exec/gen-icount.h
static ExitStatus gen_store_conditional(DisasContext *ctx, int ra, int rb, int32_t disp16, int quad) { TCGv addr; if (ra == 31) { /* ??? Don't bother storing anything. The user can't tell the difference, since the zero register always reads zero. */ re...
[ 0, 0 ]
qemu
darwin-user/main.c
static void spr_write_dbatu(void *opaque, int sprn) { DisasContext *ctx = opaque; gen_op_store_dbatu((sprn - SPR_DBAT0U) / 2); RET_STOP(ctx); }
[ 0, 0 ]
qemu
hw/vga.c
void qemu_pixman_linebuf_fill(pixman_image_t *linebuf, pixman_image_t *fb, int width, int y) { pixman_image_composite(PIXMAN_OP_SRC, fb, NULL, linebuf, 0, y, 0, 0, 0, 0, width, 1); }
[ 0, 0 ]
qemu
cpus.c
void qemu_thread_self(QemuThread *thread) { thread->thread = pthread_self(); }
[ 0, 0 ]
FFmpeg
libavcodec/subviewerdec.c
static int subviewer_decode_frame(AVCodecContext *avctx, void *data, int *got_sub_ptr, AVPacket *avpkt) { char c; AVSubtitle *sub = data; const char *ptr = avpkt->data; AVBPrint buf; /* To be removed later */ if (sscanf(ptr, "%*u:%*u:%*u.%*u,%*u:%*u:%*u.%*u%c", &c) ...
[ 1, 0 ]
qemu
include/qemu/coroutine_int.h
void qemu_co_rwlock_rdlock(CoRwlock *lock) { while (lock->writer) { qemu_co_queue_wait(&lock->queue); } lock->reader++; }
[ 1, 0 ]
qemu
hw/bt/hci-csr.c
static int csrhci_write(struct CharDriverState *chr, const uint8_t *buf, int len) { struct csrhci_s *s = (struct csrhci_s *)chr->opaque; int plen = s->in_len; if (!s->enable) return 0; s->in_len += len; memcpy(s->inpkt + plen, buf, len); while (1) { if (s->in_len >=...
[ 1, 0 ]
qemu
cpu-all.h
static void fpu_dump_state(CPUState *env, FILE *f, int (*fpu_fprintf)(FILE *f, const char *fmt, ...), int flags) { int i; int is_fpu64 = !!(env->hflags & MIPS_HFLAG_F64); #define printfpr(fp) do { if (is_fpu64) fpu_fprintf(f, ...
[ 0, 0 ]
qemu
hw/sh7750.c
int get_physical_address(CPUState *env, target_ulong *physical, int *prot, target_ulong address, int rw, int access_type) { /* P1, P2 and P4 areas do not use translation */ if ((address >= 0x80000000 && address < 0xc0000000) || address >= 0xe0000000) { ...
[ 1, 0 ]
qemu
Makefile.target
static int protocol_version(VncState *vs, char *version, size_t len) { char local[13]; int maj, min; memcpy(local, version, 12); local[12] = 0; if (sscanf(local, "RFB %03d.%03d\n", &maj, &min) != 2) { vnc_client_error(vs); return 0; } vnc_write_u32(vs, 1); /* None */ vnc_flush(vs); ...
[ 1, 0 ]
qemu
hw/net/vhost_net.c
static void virtio_net_set_mrg_rx_bufs(VirtIONet *n, int mergeable_rx_bufs) { int i; NetClientState *nc; n->mergeable_rx_bufs = mergeable_rx_bufs; n->guest_hdr_len = n->mergeable_rx_bufs ? sizeof(struct virtio_net_hdr_mrg_rxbuf) : ...
[ 1, 0 ]
qemu
acl.c
void qemu_acl_reset(qemu_acl *acl) { qemu_acl_entry *entry; /* Put back to deny by default, so there is no window * of "open access" while the user re-initializes the * access control list */ acl->defaultDeny = 1; TAILQ_FOREACH(entry, &acl->entries, next) { TAILQ_REMOVE(&acl->entries, entry, n...
[ 1, 0 ]
FFmpeg
Changelog
static int show_format(WriterContext *w, AVFormatContext *fmt_ctx) { char val_str[128]; int64_t size = fmt_ctx->pb ? avio_size(fmt_ctx->pb) : -1; int ret = 0; writer_print_section_header(w, SECTION_ID_FORMAT); print_str("filename", fmt_ctx->filename); print_int("nb_streams", fmt_ctx->nb_streams); ...
[ 1, 0 ]
FFmpeg
libavcodec/pthread_slice.c
static int thread_execute2(AVCodecContext *avctx, action_func2 *func2, void *arg, int *ret, int job_count) { ThreadContext *c = avctx->thread_opaque; c->func2 = func2; return thread_execute(avctx, NULL, arg, ret, job_count, 0); }
[ 0, 0 ]
qemu
docs/qapi-code-gen.txt
static void qmp_input_optional(Visitor *v, const char *name, bool *present) { QmpInputVisitor *qiv = to_qiv(v); QObject *qobj = qmp_input_get_object(qiv, name, false, NULL); if (!qobj) { *present = false; return; } *present = true; }
[ 0, 0 ]
FFmpeg
libavformat/utils.c
int av_find_best_stream(AVFormatContext *ic, enum AVMediaType type, int wanted_stream_nb, int related_stream, AVCodec **decoder_ret, int flags) { int i, nb_streams = ic->nb_streams, stream_nu...
[ 1, 0 ]
qemu
block.c
BlockDriverState *bdrv_new(const char *device_name, Error **errp) { BlockDriverState *bs; int i; if (*device_name && !bdrv_is_valid_name(device_name)) { error_setg(errp, "Invalid device name"); return NULL; } if (bdrv_find(device_name)) { error_setg(errp, "Device with id '%s' already exist...
[ 1, 0 ]
qemu
memory.c
static void address_space_update_topology(AddressSpace *as) { FlatView old_view = as->current_map; FlatView new_view = generate_memory_topology(as->root); address_space_update_topology_pass(as, old_view, new_view, false); address_space_update_topology_pass(as, old_view, new_view, true); as->current_map ...
[ 1, 0 ]
FFmpeg
libavcodec/kmvc.c
static int decode_end(AVCodecContext *avctx) { SmackVContext *const smk = (SmackVContext *)avctx->priv_data; if (smk->mmap_tbl) av_free(smk->mmap_tbl); if (smk->mclr_tbl) av_free(smk->mclr_tbl); if (smk->full_tbl) av_free(smk->full_tbl); if (smk->type_tbl) av_free(smk->type_tbl); ...
[ 0, 0 ]
FFmpeg
tests/checkasm/sbrdsp.c
static void test_sum_square(void) { INTFLOAT res0; INTFLOAT res1; LOCAL_ALIGNED_16(INTFLOAT, src, [256], [2]); declare_func(INTFLOAT, INTFLOAT(*x)[2], int n); randomize((INTFLOAT *)src, 256 * 2); res0 = call_ref(src, 256); res1 = call_new(src, 256); if (!float_near_abs_eps(res0, res1, EPS)) ...
[ 0, 0 ]
qemu
net/socket.c
static void net_socket_accept(void *opaque) { NetSocketListenState *s = opaque; NetSocketState *s1; struct sockaddr_in saddr; socklen_t len; int fd; for (;;) { len = sizeof(saddr); fd = qemu_accept(s->fd, (struct sockaddr *)&saddr, &len); if (fd < 0 && errno != EINTR) { return; ...
[ 1, 0 ]
qemu
acl.c
static void qemu_opt_del(QemuOpt *opt) { TAILQ_REMOVE(&opt->opts->head, opt, next); qemu_free((/* !const */ char *)opt->name); qemu_free((/* !const */ char *)opt->str); qemu_free(opt); }
[ 0, 0 ]
qemu
hw/9pfs/Makefile.objs
static V9fsSynthNode *v9fs_add_dir_node(V9fsSynthNode *parent, int mode, const char *name, V9fsSynthNodeAttr *attr, int inode) { V9fsSynthNode *node; /* Add directory type and remove write bits */ mode = ((mode & 0777) | S_IFDIR...
[ 1, 0 ]
qemu
HACKING
static uint64_t hb_regs_read(void *opaque, target_phys_addr_t offset, unsigned size) { uint32_t *regs = opaque; uint32_t value = regs[offset / 4]; if ((offset == 0x100) || (offset == 0x108) || (offset == 0x10C)) { value |= 0x30000000; } return value; }
[ 1, 0 ]
qemu
hw/pci-host/versatile.c
static void pci_realview_class_init(ObjectClass *class, void *data) { DeviceClass *dc = DEVICE_CLASS(class); /* Reason: object_unref() hangs */ dc->cannot_destroy_with_object_finalize_yet = true; }
[ 0, 0 ]
qemu
block.c
void bdrv_aio_cancel_async(BlockAIOCB *acb) { if (acb->aiocb_info->cancel_async) { acb->aiocb_info->cancel_async(acb); } }
[ 0, 0 ]
qemu
hw/parallel.c
ParallelState *parallel_init(int index, CharDriverState *chr) { ISADevice *dev; dev = isa_create("isa-parallel"); qdev_prop_set_uint32(&dev->qdev, "index", index); qdev_prop_set_chr(&dev->qdev, "chardev", chr); if (qdev_init(&dev->qdev) < 0) return NULL; return &DO_UPCAST(ISAParallelState, dev, ...
[ 0, 0 ]
qemu
MAINTAINERS
uint64_t cpu_get_tsc(CPUX86State *env) { /* Note: when using kqemu, it is more logical to return the host TSC because kqemu does not trap the RDTSC instruction for performance reasons */ #ifdef CONFIG_KQEMU if (env->kqemu_enabled) { return cpu_get_real_ticks(); } else #endif { retur...
[ 0, 0 ]
FFmpeg
libavcodec/idcinvideo.c
static void idcin_decode_vlcs(IdcinContext *s) { hnode_t *hnodes; long x, y; int prev; unsigned char v = 0; int bit_pos, node_num, dat_pos; prev = bit_pos = dat_pos = 0; for (y = 0; y < (s->frame.linesize[0] * s->avctx->height); y += s->frame.linesize[0]) { for (x = y; x < y + s->avct...
[ 1, 0 ]
qemu
backends/rng-egd.c
ssize_t slirp_send(struct socket *so, const void *buf, size_t len, int flags) { if (so->s == -1 && so->extra) { qemu_chr_fe_write(so->extra, buf, len); return len; } return send(so->s, buf, len, flags); }
[ 1, 0 ]
FFmpeg
libavfilter/libmpcodecs/vf_decimate.c
static int diff_C(unsigned char *old, unsigned char *new, int os, int ns) { int x, y, d = 0; for (y = 8; y; y--) { for (x = 8; x; x--) { d += abs(new[x] - old[x]); } new += ns; old += os; } return d; }
[ 1, 0 ]