Projectname
large_stringclasses
15 values
Filepath
large_stringlengths
4
106
Function
large_stringlengths
11
3.45k
Label
list
qemu
block/io.c
static void bdrv_qed_refresh_limits(BlockDriverState *bs, Error **errp) { BDRVQEDState *s = bs->opaque; bs->bl.write_zeroes_alignment = s->header.cluster_size >> BDRV_SECTOR_BITS; }
[ 1, 0 ]
qemu
include/block/aio.h
void qemu_iohandler_fill(GArray *pollfds) { IOHandlerRecord *ioh; QLIST_FOREACH(ioh, &io_handlers, next) { int events = 0; if (ioh->deleted) continue; if (ioh->fd_read && (!ioh->fd_read_poll || ioh->fd_read_poll(ioh->opaque) != 0)) { events |= G_IO_IN | G_IO_HUP | ...
[ 1, 0 ]
qemu
include/block/aio.h
static void test_bh_flush(void) { BHTestData data = {.n = 0}; data.bh = aio_bh_new(ctx, bh_test_cb, &data); qemu_bh_schedule(data.bh); g_assert_cmpint(data.n, ==, 0); wait_for_aio(); g_assert_cmpint(data.n, ==, 1); g_assert(!aio_poll(ctx, false)); g_assert_cmpint(data.n, ==, 1); qemu_bh_dele...
[ 0, 0 ]
qemu
block/block-backend.c
AioContext *blk_get_aio_context(BlockBackend *blk) { return bdrv_get_aio_context(blk->bs); }
[ 0, 0 ]
qemu
HACKING
static uint64_t cirrus_linear_read(void *opaque, target_phys_addr_t addr, unsigned size) { CirrusVGAState *s = opaque; uint32_t ret; addr &= s->cirrus_addr_mask; if (((s->vga.sr[0x17] & 0x44) == 0x44) && ((addr & s->linear_mmio_mask) == s->linear_mmio_mask)) { ...
[ 1, 1 ]
FFmpeg
libavformat/aviobuf.c
AVIOContext *avio_alloc_context( unsigned char *buffer, int buffer_size, int write_flag, void *opaque, int (*read_packet)(void *opaque, uint8_t *buf, int buf_size), int (*write_packet)(void *opaque, uint8_t *buf, int buf_size), int64_t (*seek)(void *opaque, int64_t offset, int whence)...
[ 1, 0 ]
qemu
hw/qxl.c
static void qxl_exit_vga_mode(PCIQXLDevice *d) { if (d->mode != QXL_MODE_VGA) { return; } trace_qxl_exit_vga_mode(d->id); qxl_destroy_primary(d, QXL_SYNC); }
[ 1, 0 ]
qemu
block/blkverify.c
static BlkverifyAIOCB *blkverify_aio_get(BlockDriverState *bs, bool is_write, int64_t sector_num, QEMUIOVector *qiov, int nb_sectors, BlockCompletionFunc *cb, ...
[ 1, 0 ]
FFmpeg
libavcodec/hevcdsp_template.c
static void FUNC(transquant_bypass16x16)(uint8_t *_dst, int16_t *coeffs, ptrdiff_t stride) { int x, y; pixel *dst = (pixel *)_dst; stride /= sizeof(pixel); for (y = 0; y < 16; y++) { for (x = 0; x < 16; x++) { dst[x] += *coeffs; coeffs++; } ...
[ 1, 0 ]
FFmpeg
libavcodec/dsputil.c
static inline void idct4col_put(uint8_t *dest, int line_size, const DCTELEM *col) { int c0, c1, c2, c3, a0, a1, a2, a3; const uint8_t *cm = ff_cropTbl + MAX_NEG_CROP; a0 = col[8 * 0]; a1 = col[8 * 2]; a2 = col[8 * 4]; a3 = col[8 * 6]; c0 = ((a0 + a2) << (CN_SHIFT - ...
[ 1, 0 ]
FFmpeg
ffprobe.c
static inline void writer_print_string(WriterContext *wctx, const char *key, const char *val) { wctx->writer->print_string(wctx, key, val); wctx->nb_item++; }
[ 0, 0 ]
qemu
hw/s390x/css.c
static int css_add_virtual_chpid(uint8_t cssid, uint8_t chpid, uint8_t type) { CssImage *css; trace_css_chpid_add(cssid, chpid, type); if (cssid > MAX_CSSID) { return -EINVAL; } css = channel_subsys.css[cssid]; if (!css) { return -EINVAL; } if (css->chpids[chpid].in_use) { return -...
[ 1, 0 ]
qemu
block.c
static BlockDriverState *bdrv_new_open(const char *filename, const char *fmt, int flags, bool require_io, bool quiet) { BlockDriverState *bs; BlockDriver...
[ 1, 0 ]
qemu
HACKING
static uint64_t grlib_irqmp_read(void *opaque, target_phys_addr_t addr, unsigned size) { IRQMP *irqmp = opaque; IRQMPState *state; assert(irqmp != NULL); state = irqmp->state; assert(state != NULL); addr &= 0xff; /* global registers */ switch (addr) { case L...
[ 1, 0 ]
qemu
HACKING
static void megasas_port_write(void *opaque, target_phys_addr_t addr, uint64_t val, unsigned size) { megasas_mmio_write(opaque, addr & 0xff, val, size); }
[ 0, 0 ]
qemu
main-loop.c
static inline void os_host_main_loop_wait(int *timeout) {}
[ 0, 0 ]
qemu
block/block-backend.c
static void flash_sync_page(Flash *s, int page) { int bdrv_sector, nb_sectors; QEMUIOVector iov; if (!s->bdrv || bdrv_is_read_only(s->bdrv)) { return; } bdrv_sector = (page * s->pi->page_size) / BDRV_SECTOR_SIZE; nb_sectors = DIV_ROUND_UP(s->pi->page_size, BDRV_SECTOR_SIZE); qemu_iovec_init(&i...
[ 1, 0 ]
qemu
hw/acpi/aml-build.c
void bios_linker_loader_add_checksum(GArray *linker, const char *file, GArray *table, void *start, unsigned size, uint8_t *checksum) { BiosLinkerLoaderEntry entry; ptrdiff_t checksum_offset = (gchar ...
[ 1, 0 ]
qemu
block/backup.c
void backup_do_checkpoint(BlockJob *job, Error **errp) { BackupBlockJob *backup_job = container_of(job, BackupBlockJob, common); int64_t len; assert(job->driver->job_type == BLOCK_JOB_TYPE_BACKUP); if (backup_job->sync_mode != MIRROR_SYNC_MODE_NONE) { error_setg(errp, "The backup job only supports blo...
[ 1, 0 ]
qemu
check-qjson.c
START_TEST(simple_number) { int i; struct { const char *encoded; int64_t decoded; } test_cases[] = { {"0", 0}, {"1234", 1234}, {"1", 1}, {"-32", -32}, {"-0", 0}, {}, }; for (i = 0; test_cases[i].encoded; i++) { QObject *obj; QInt *qint; ...
[ 0, 0 ]
FFmpeg
libavcodec/v410enc.c
static int v410_encode_frame(AVCodecContext *avctx, uint8_t *buf, int buf_size, void *data) { AVFrame *pic = data; uint8_t *dst = buf; uint16_t *y, *u, *v; uint32_t val; int i, j; int output_size = 0; if (buf_size < avctx->width * avctx->height * 3) { av_log(avct...
[ 1, 0 ]
qemu
coroutine-ucontext.c
static void qemu_coroutine_thread_cleanup(void *opaque) { CoroutineThreadState *s = opaque; Coroutine *co; Coroutine *tmp; QLIST_FOREACH_SAFE(co, &s->pool, pool_next, tmp) { g_free(DO_UPCAST(CoroutineUContext, base, co)->stack); g_free(co); } g_free(s); }
[ 0, 0 ]
qemu
tcg/aarch64/tcg-target.inc.c
static void tcg_out_brcond(TCGContext *s, TCGMemOp ext, TCGCond c, TCGArg a, TCGArg b, bool b_const, TCGLabel *l) { intptr_t offset; bool need_cmp; if (b_const && b == 0 && (c == TCG_COND_EQ || c == TCG_COND_NE)) { need_cmp = false; } else { need_cmp = true; tcg_o...
[ 1, 0 ]
qemu
monitor.c
void monitor_init(CharDriverState *chr, int show_banner) { int i; if (is_first_init) { key_timer = qemu_new_timer(vm_clock, release_keys, NULL); if (!key_timer) return; for (i = 0; i < MAX_MON; i++) { monitor_hd[i] = NULL; } is_first_init = 0; } for (i = 0; i < MAX_MON;...
[ 0, 0 ]
qemu
hw/9pfs/Makefile.objs
static int v9fs_synth_readdir_r(FsContext *ctx, V9fsFidOpenState *fs, struct dirent *entry, struct dirent **result) { int ret; V9fsSynthOpenState *synth_open = fs->private; V9fsSynthNode *node = synth_open->node; ret = v9fs_synth_get_dentry(node, entry, result, synth_open->...
[ 1, 0 ]
qemu
include/qapi/qmp/json-lexer.h
static int parse_pair(JSONParserContext *ctxt, QDict *dict, va_list *ap) { QObject *key = NULL, *token = NULL, *value, *peek; JSONParserContext saved_ctxt = parser_context_save(ctxt); peek = parser_context_peek_token(ctxt); if (peek == NULL) { parse_error(ctxt, NULL, "premature EOI"); goto out; ...
[ 1, 0 ]
qemu
cpu-exec.c
static void gen_addq(DisasContext *s, TCGv val, int rlow, int rhigh) { TCGv tmp; TCGv tmpl; TCGv tmph; /* Load 64-bit value rd:rn. */ tmpl = load_reg(s, rlow); tmph = load_reg(s, rhigh); tmp = tcg_temp_new(TCG_TYPE_I64); tcg_gen_concat_i32_i64(tmp, tmpl, tmph); dead_tmp(tmpl); dead_tmp(t...
[ 0, 0 ]
qemu
hw/ppc/spapr_drc.c
void spapr_drc_attach(sPAPRDRConnector *drc, DeviceState *d, void *fdt, int fdt_start_offset, Error **errp) { trace_spapr_drc_attach(spapr_drc_index(drc)); if (drc->isolation_state != SPAPR_DR_ISOLATION_STATE_ISOLATED) { error_setg(errp, "an attached device is still awaiting release")...
[ 0, 0 ]
qemu
exec.c
int cpu_watchpoint_insert(CPUState *cpu, vaddr addr, vaddr len, int flags, CPUWatchpoint **watchpoint) { CPUWatchpoint *wp; /* forbid ranges which are empty or run off the end of the address space */ if (len == 0 || (addr + len - 1) <= addr) { error_report("tried to set invalid...
[ 0, 0 ]
qemu
util/qemu-sockets.c
static int unix_connect_saddr(UnixSocketAddress *saddr, NonBlockingConnectHandler *callback, void *opaque, Error **errp) { struct sockaddr_un un; ConnectState *connect_state = NULL; int sock, rc; if (saddr->path == NULL) { error_setg(errp, ...
[ 1, 0 ]
qemu
target-i386/kvm.c
uint32_t kvm_arch_get_supported_cpuid(KVMState *s, uint32_t function, uint32_t index, int reg) { struct kvm_cpuid2 *cpuid; uint32_t ret = 0; uint32_t cpuid_1_edx; bool found = false; cpuid = get_supported_cpuid(s); struct kvm_cpuid_entry2 *entry = cpuid_find_entry(cpuid...
[ 1, 0 ]
qemu
hw/s390x/event-facility.c
static uint16_t handle_write_event_buf(SCLPEventFacility *ef, EventBufferHeader *event_buf, SCCB *sccb) { uint16_t rc; BusChild *kid; SCLPEvent *event; SCLPEventClass *ec; QTAILQ_FOREACH(kid, &ef->sbus.qbus.children, sibling) { DeviceState *qdev = kid->child;...
[ 1, 0 ]
qemu
qga/commands-win32.c
static DWORD WINAPI do_suspend(LPVOID opaque) { GuestSuspendMode *mode = opaque; DWORD ret = 0; if (!SetSuspendState(*mode == GUEST_SUSPEND_MODE_DISK, TRUE, TRUE)) { slog("failed to suspend guest, %s", GetLastError()); ret = -1; } g_free(mode); return ret; }
[ 1, 0 ]
qemu
qemu-img.c
static BlockBackend *img_open_opts(const char *optstr, QemuOpts *opts, int flags, bool writethrough, bool quiet, bool force_share) { QDict *options; Error *local_err = NULL; BlockBackend *blk; options = qemu_opts_to_qdict(opts, NULL); ...
[ 1, 0 ]
qemu
hw/e1000.c
set_phy_ctrl(E1000State *s, int index, uint16_t val) { if ((val & MII_CR_AUTO_NEG_EN) && (val & MII_CR_RESTART_AUTO_NEG)) { qemu_get_queue(s->nic)->link_down = true; e1000_link_down(s); s->phy_reg[PHY_STATUS] &= ~MII_SR_AUTONEG_COMPLETE; DBGOUT(PHY, "Start link auto negotiation\n"); qemu_mo...
[ 1, 0 ]
qemu
hw/apb_pci.c
PCIBus *i440fx_init(PCII440FXState **pi440fx_state, int *piix3_devfn, qemu_irq *pic) { DeviceState *dev; PCIBus *b; PCIDevice *d; I440FXState *s; PIIX3State *piix3; dev = qdev_create(NULL, "i440FX-pcihost"); s = FROM_SYSBUS(I440FXState, sysbus_from_qdev(dev)); b = pci_bus_ne...
[ 1, 0 ]
qemu
monitor.c
static void do_wav_capture(Monitor *mon, const QDict *qdict) { const char *path = qdict_get_str(qdict, "path"); int has_freq = qdict_haskey(qdict, "freq"); int freq = qdict_get_try_int(qdict, "freq", -1); int has_bits = qdict_haskey(qdict, "bits"); int bits = qdict_get_try_int(qdict, "bits", -1); int...
[ 1, 0 ]
FFmpeg
libavcodec/videotoolboxenc.c
static av_cold int vtenc_close(AVCodecContext *avctx) { VTEncContext *vtctx = avctx->priv_data; if (!vtctx->session) return 0; VTCompressionSessionInvalidate(vtctx->session); pthread_cond_destroy(&vtctx->cv_sample_sent); pthread_mutex_destroy(&vtctx->lock); CFRelease(vtctx->session); vtctx->se...
[ 1, 0 ]
FFmpeg
libavfilter/vf_blend.c
static void blend_frame(AVFilterContext *ctx, AVFrame *top_buf, AVFrame *bottom_buf, AVFrame *dst_buf) { BlendContext *b = ctx->priv; AVFilterLink *inlink = ctx->inputs[0]; FilterParams *param; int plane; for (plane = 0; dst_buf-...
[ 1, 0 ]
qemu
hw/ppc/Makefile.objs
static void pnv_chip_power8e_class_init(ObjectClass *klass, void *data) { DeviceClass *dc = DEVICE_CLASS(klass); PnvChipClass *k = PNV_CHIP_CLASS(klass); k->cpu_model = "POWER8E"; k->chip_type = PNV_CHIP_POWER8E; k->chip_cfam_id = 0x221ef04980000000ull; /* P8 Murano DD2.1 */ k->cores_mask = POWER8E_C...
[ 1, 0 ]
qemu
tests/e1000e-test.c
void uhci_port_test(struct qhc *hc, int port, uint16_t expect) { void *addr = hc->base + 0x10 + 2 * port; uint16_t value = qpci_io_readw(hc->dev, addr); uint16_t mask = ~(UHCI_PORT_WRITE_CLEAR | UHCI_PORT_RSVD1); g_assert((value & mask) == (expect & mask)); }
[ 1, 0 ]
qemu
accel/tcg/cpu-exec.c
static void cpu_exec_step(CPUState *cpu) { CPUClass *cc = CPU_GET_CLASS(cpu); TranslationBlock *tb; target_ulong cs_base, pc; uint32_t flags; uint32_t cflags = 1 | CF_IGNORE_ICOUNT; if (sigsetjmp(cpu->jmp_env, 0) == 0) { tb = tb_lookup__cpu_state(cpu, &pc, &cs_base, &flags, ...
[ 0, 0 ]
FFmpeg
libavformat/flvdec.c
static int flv_read_metabody(AVFormatContext *s, int64_t next_pos) { AMFDataType type; AVStream *stream, *astream, *vstream; AVIOContext *ioc; int i; // only needs to hold the string "onMetaData". // Anything longer is something we don't want. char buffer[11]; astream = NULL; vstream = NULL;...
[ 1, 0 ]
qemu
include/block/aio.h
static bool aio_dispatch_handlers(AioContext *ctx) { AioHandler *node, *tmp; bool progress = false; /* * We have to walk very carefully in case aio_set_fd_handler is * called while we're walking. */ qemu_lockcnt_inc(&ctx->list_lock); QLIST_FOREACH_SAFE_RCU(node, &ctx->aio_handlers, node, tmp...
[ 0, 0 ]
qemu
cputlb.c
static void destroy_all_mappings(void) { destroy_l2_mapping(&phys_map, P_L2_LEVELS - 1); phys_map_nodes_reset(); }
[ 0, 0 ]
qemu
target-alpha/helper.h
void helper_stq_raw(uint64_t t0, uint64_t t1) { stq_raw(t1, t0); }
[ 0, 0 ]
qemu
monitor.c
void term_flush(void) {}
[ 0, 0 ]
qemu
migration/page_cache.c
PageCache *cache_init(size_t num_pages, size_t page_size) { int64_t i; PageCache *cache; if (num_pages <= 0) { DPRINTF("invalid number of pages\n"); return NULL; } /* We prefer not to abort if there is no memory */ cache = g_try_malloc(sizeof(*cache)); if (!cache) { DPRINTF("Failed t...
[ 1, 0 ]
qemu
hw/i8254.c
void pit_set_gate(PITState *pit, int channel, int val) { PITChannelState *s = &pit->channels[channel]; switch (s->mode) { default: case 0: case 4: /* XXX: just disable/enable counting */ break; case 1: case 5: if (s->gate < val) { /* restart counting on rising edge */ ...
[ 0, 1 ]
qemu
include/exec/gen-icount.h
DISAS_INSN(scc) { int l1; int cond; TCGv reg; l1 = gen_new_label(); cond = (insn >> 8) & 0xf; reg = DREG(insn, 0); tcg_gen_andi_i32(reg, reg, 0xffffff00); /* This is safe because we modify the reg directly, with no other values live. */ gen_jmpcc(s, cond ^ 1, l1); tcg_gen_ori_i32(r...
[ 1, 0 ]
qemu
block/qcow2-refcount.c
static int inc_refcounts(BlockDriverState *bs, BdrvCheckResult *res, uint16_t *refcount_table, int64_t refcount_table_size, int64_t offset, int64_t size) { BDRVQcowState *s = bs->opaque; uint64_t start, last, ...
[ 1, 0 ]
qemu
tests/qht-bench.c
static void run_test(void) { unsigned int remaining; int i; while (atomic_read(&n_ready_threads) != n_rw_threads + n_rz_threads) { cpu_relax(); } atomic_mb_set(&test_start, true); do { remaining = sleep(duration); } while (remaining); atomic_mb_set(&test_stop, true); for (i = 0; i <...
[ 0, 0 ]
qemu
target-ppc/helper.c
void do_sraw(void) { int32_t ret; if (likely(!(T1 & 0x20UL))) { if (likely((uint32_t)T1 != 0)) { ret = (int32_t)T0 >> (T1 & 0x1fUL); if (likely(ret >= 0 || ((int32_t)T0 & ((1 << T1) - 1)) == 0)) { xer_ca = 0; } else { xer_ca = 1; } } else { ret = T0; ...
[ 1, 0 ]
FFmpeg
libavcodec/snow.c
static void spatial_compose97i_dy(dwt_compose_t *cs, DWTELEM *buffer, int width, int height, int stride) { int y = cs->y; DWTELEM *b0 = cs->b0; DWTELEM *b1 = cs->b1; DWTELEM *b2 = cs->b2; DWTELEM *b3 = cs->b3; DWTELEM *b4 = buffer + mirror(y + 3, height - 1) * stride;...
[ 1, 0 ]
qemu
hw/net/eepro100.c
static void pci_nic_uninit(PCIDevice *pci_dev) { EEPRO100State *s = DO_UPCAST(EEPRO100State, dev, pci_dev); vmstate_unregister(&pci_dev->qdev, s->vmstate, s); eeprom93xx_free(&pci_dev->qdev, s->eeprom); qemu_del_nic(s->nic); }
[ 1, 0 ]
qemu
target/hppa/translate.c
static ExitStatus trans_log(DisasContext *ctx, uint32_t insn, const DisasInsn *di) { unsigned r2 = extract32(insn, 21, 5); unsigned r1 = extract32(insn, 16, 5); unsigned cf = extract32(insn, 12, 4); unsigned rt = extract32(insn, 0, 5); TCGv tcg_r1, tcg_r2; ExitStatus ret;...
[ 1, 0 ]
FFmpeg
libavcodec/gif.c
static int gif_image_write_image(AVCodecContext *avctx, uint8_t **bytestream, uint8_t *end, const uint8_t *buf, int linesize) { GIFContext *s = avctx->priv_data; int len, height; const uint8_t *ptr; /* image block */ bytestream_put_byte...
[ 1, 0 ]
FFmpeg
libavformat/dvenc.c
static int dv_write_header(AVFormatContext *s) { s->priv_data = dv_init_mux(s); if (!s->priv_data) { av_log(s, AV_LOG_ERROR, "Can't initialize DV format!\n" "Make sure that you supply exactly two streams:\n" " video: 25fps or 29.97fps, audio: 2ch/48Khz/PCM\n" ...
[ 1, 0 ]
FFmpeg
libavutil/Makefile
static int test_vector_dmac_scalar(AVFloatDSPContext *fdsp, AVFloatDSPContext *cdsp, const double *v1, const double *src0, double scale) { LOCAL_ALIGNED(32, double, cdst, [LEN]); LOCAL_ALIGNED(32, double, odst, [LEN]); int ret; memcpy(cdst, v1, LEN * sizeof(*v1)); memcpy(odst, v...
[ 1, 0 ]
FFmpeg
libavcodec/iff.c
static void decodeplane8(uint8_t *dst, const uint8_t *const buf, int buf_size, int bps, int plane) { GetBitContext gb; int i, b; init_get_bits(&gb, buf, buf_size * 8); for (i = 0; i < (buf_size * 8 + bps - 1) / bps; i++) { for (b = 0; b < bps; b++) { dst[i * bps + b] |=...
[ 1, 0 ]
FFmpeg
ffmpeg.c
static void mpeg_decode_sequence_extension(MpegEncContext *s) { int horiz_size_ext, vert_size_ext; int bit_rate_ext; int level, profile; skip_bits(&s->gb, 1); /* profil and level esc*/ profile = get_bits(&s->gb, 3); level = get_bits(&s->gb, 4); s->progressive_sequence = get_bits1(&s->gb); /* progr...
[ 1, 1 ]
FFmpeg
libavcodec/dsputil.h
static void vc1_loop_filter_iblk(MpegEncContext *s, int pq) { int i, j; if (!s->first_slice_line) s->dsp.vc1_loop_filter(s->dest[0], 1, s->linesize, 16, pq); s->dsp.vc1_loop_filter(s->dest[0] + 8 * s->linesize, 1, s->linesize, 16, pq); for (i = !s->mb_x * 8; i < 16; i += 8) s->dsp.vc1_loop_filter...
[ 1, 0 ]
FFmpeg
libavformat/mpegts.c
static void mpegts_close_filter(MpegTSContext *ts, MpegTSFilter *filter) { int pid; pid = filter->pid; if (filter->type == MPEGTS_SECTION) av_freep(&filter->u.section_filter.section_buf); av_free(filter); ts->pids[pid] = NULL;
[ 1, 0 ]
qemu
Makefile.objs
static void blk_mig_reset_dirty_cursor(void) { BlkMigDevState *bmds; QSIMPLEQ_FOREACH(bmds, &block_mig_state.bmds_list, entry) { bmds->cur_dirty = 0; } }
[ 1, 0 ]
qemu
target-ppc/cpu.h
void ppc_tlb_invalidate_all(CPUPPCState *env) { switch (env->mmu_model) { case POWERPC_MMU_SOFT_6xx: case POWERPC_MMU_SOFT_74xx: ppc6xx_tlb_invalidate_all(env); break; case POWERPC_MMU_SOFT_4xx: case POWERPC_MMU_SOFT_4xx_Z: ppc4xx_tlb_invalidate_all(env); break; case POWERPC_MMU_R...
[ 1, 1 ]
FFmpeg
libavformat/mov.c
static int mov_read_stsc(MOVContext *c, ByteIOContext *pb, MOVAtom atom) { AVStream *st = c->fc->streams[c->fc->nb_streams - 1]; MOVStreamContext *sc = st->priv_data; unsigned int i, entries; get_byte(pb); /* version */ get_be24(pb); /* flags */ entries = get_be32(pb); dprintf(c->fc, "track[%i].st...
[ 1, 0 ]
FFmpeg
avconv.c
WINDOW_FUNC(eight_short) { const float *swindow = sce->ics.use_kb_window[0] ? ff_aac_kbd_short_128 : ff_sine_128; const float *pwindow = sce->ics.use_kb_window[1] ? ff_aac_kbd_short_128 : ff_sine_128; const float *in = audio + 448; float *out = sce->ret; for (int w = 0; w < 8; w++) { ds...
[ 0, 0 ]
FFmpeg
ffmpeg_filter.c
enum AVPixelFormat choose_pixel_fmt(AVStream *st, AVCodec *codec, enum AVPixelFormat target) { if (codec && codec->pix_fmts) { const enum AVPixelFormat *p = codec->pix_fmts; int has_alpha = av_pix_fmt_desc_get(target)->nb_components % 2 == 0; enum AVPixelFormat bes...
[ 1, 0 ]
FFmpeg
libavcodec/avs.c
static void cdg_load_palette(CDGraphicsContext *cc, uint8_t *data, int low) { uint8_t r, g, b; uint16_t color; int i; int array_offset = low ? 0 : 8; uint32_t *palette = (uint32_t *)cc->frame.data[1]; for (i = 0; i < 8; i++) { color = (data[2 * i] << 6) + (data[2 * i + 1] & 0x3F); r = ((col...
[ 1, 0 ]
qemu
hw/arm/omap1.c
static struct omap_lpg_s *omap_lpg_init(MemoryRegion *system_memory, hwaddr base, omap_clk clk) { struct omap_lpg_s *s = (struct omap_lpg_s *) g_malloc0(sizeof(struct omap_lpg_s)); s->tm = timer_new_ms(QEMU_CLOCK_VIRTUAL, omap_lpg_tick, s); omap_lpg_reset(s); ...
[ 1, 0 ]
qemu
block.c
static void restart_coroutine(void *opaque) { Coroutine *co = opaque; DPRINTF("co=%p", co); qemu_coroutine_enter(co, NULL); }
[ 1, 0 ]
qemu
monitor.c
int monitor_read_bdrv_key_start(Monitor *mon, BlockDriverState *bs, BlockCompletionFunc *completion_cb, void *opaque) { Error *local_err = NULL; int err; bdrv_add_key(bs, NULL, &local_err); if (!local_err) { if (completion_cb) co...
[ 1, 0 ]
FFmpeg
libavformat/rtpdec_mpeg4.c
static int aac_parse_packet(AVFormatContext *ctx, PayloadContext *data, AVStream *st, AVPacket *pkt, uint32_t *timestamp, const uint8_t *buf, int len, uint16_t seq, int flags) { int ret; if (rtp_parse_mp4_au(data, buf)) r...
[ 1, 1 ]
qemu
tests/ivshmem-test.c
static QPCIDevice *get_device(void) { QPCIDevice *dev; QPCIBus *pcibus; pcibus = qpci_init_pc(); dev = NULL; qpci_device_foreach(pcibus, 0x1af4, 0x1110, save_fn, &dev); g_assert(dev != NULL); return dev; }
[ 1, 0 ]
qemu
target-ppc/cpu.h
void do_nego(void) { if (likely(T0 != INT32_MIN)) { xer_ov = 0; T0 = -Ts0; } else { xer_ov = 1; xer_so = 1; } }
[ 1, 0 ]
qemu
block.c
int bdrv_pread(BlockDriverState *bs, int64_t offset, void *buf1, int count1) { BlockDriver *drv = bs->drv; if (!drv) return -ENOMEDIUM; if (!drv->bdrv_pread) return bdrv_pread_em(bs, offset, buf1, count1); return drv->bdrv_pread(bs, offset, buf1, count1); }
[ 1, 0 ]
FFmpeg
libavfilter/unsharp_opencl.c
static int compute_mask(int step, uint32_t *mask) { int i, z, ret = 0; int counter_size = sizeof(uint32_t) * (2 * step + 1); uint32_t *temp1_counter, *temp2_counter, **counter; temp1_counter = av_mallocz(counter_size); if (!temp1_counter) { ret = AVERROR(ENOMEM); goto end; } temp2_counter...
[ 1, 0 ]
qemu
block/qcow2-refcount.c
static void compare_refcounts(BlockDriverState *bs, BdrvCheckResult *res, BdrvCheckMode fix, int64_t *highest_cluster, uint16_t *refcount_table, int64_t nb_clusters) { BDRVQcowState *s = bs->opaque; int64_t i; int refcount1, refcount2, ret; for ...
[ 1, 0 ]
qemu
hw/usb/hcd-xhci.c
static TRBCCode xhci_disable_ep(XHCIState *xhci, unsigned int slotid, unsigned int epid) { XHCISlot *slot; XHCIEPContext *epctx; int i; trace_usb_xhci_ep_disable(slotid, epid); assert(slotid >= 1 && slotid <= xhci->numslots); assert(epid >= 1 && epid <= 31); slot = &xhci->s...
[ 1, 0 ]
FFmpeg
libavcodec/jpeg2000.c
static void sd_1d97_float(float *p, int i0, int i1) { int i; if (i1 <= i0 + 1) { if (i0 == 1) p[1] *= F_LFTG_X; else p[0] *= F_LFTG_K; return; } extend97_float(p, i0, i1); i0++; i1++; for (i = i0 / 2 - 2; i < i1 / 2 + 1; i++) p[2 * i + 1] -= 1.586134 * (p[2 * i] + p...
[ 1, 0 ]
qemu
backends/rng-egd.c
static int mon_init_func(QemuOpts *opts, void *opaque) { CharDriverState *chr; const char *chardev; const char *mode; int flags; mode = qemu_opt_get(opts, "mode"); if (mode == NULL) { mode = "readline"; } if (strcmp(mode, "readline") == 0) { flags = MONITOR_USE_READLINE; } else if (...
[ 1, 0 ]
qemu
qga/main.c
void ga_unset_frozen(GAState *s) { if (!ga_is_frozen(s)) { return; } /* if we delayed creation/opening of pid/log files due to being * in a frozen state at start up, do it now */ if (s->deferred_options.log_filepath) { s->log_file = fopen(s->deferred_options.log_filepath, "a"); if (!s...
[ 1, 0 ]
qemu
hw/acpi/aml-build.c
void nvdimm_build_acpi(GArray *table_offsets, GArray *table_data, GArray *linker) { GSList *device_list; /* no NVDIMM device is plugged. */ device_list = nvdimm_get_plugged_device_list(); if (!device_list) { return; } nvdimm_build_nfit(device_list, table_offsets, table_dat...
[ 0, 0 ]
qemu
Makefile.objs
void aio_bh_call(QEMUBH *bh) { bh->cb(bh->opaque); }
[ 0, 0 ]
qemu
hw/sd/sd.c
static bool sd_get_inserted(SDState *sd) { return blk_is_inserted(sd->blk); }
[ 0, 0 ]
qemu
fpu/softfloat-native.c
uint32_t helper_efdctsi(uint64_t val) { CPU_DoubleU u; u.ll = val; /* NaN are not treated the same way IEEE 754 does */ if (unlikely(float64_is_nan(u.d))) return 0; return float64_to_int32(u.d, &env->vec_status); }
[ 0, 0 ]
qemu
target-mips/op_helper.c
target_ulong helper_yield(target_ulong arg1) { if (arg1 < 0) { /* No scheduling policy implemented. */ if (arg1 != -2) { if (env->CP0_VPEControl & (1 << CP0VPECo_YSI) && env->active_tc.CP0_TCStatus & (1 << CP0TCSt_DT)) { env->CP0_VPEControl &= ~(0x7 << CP0VPECo_EXCPT); ...
[ 1, 1 ]
qemu
hw/mips/cps.c
static void slirp_socket_save(QEMUFile *f, struct socket *so) { qemu_put_be32(f, so->so_urgc); qemu_put_be16(f, so->so_ffamily); switch (so->so_ffamily) { case AF_INET: qemu_put_be32(f, so->so_faddr.s_addr); qemu_put_be16(f, so->so_fport); break; default: error_report( "so_f...
[ 0, 0 ]
FFmpeg
libavcodec/common.c
static void jpeg_put_comments(MpegEncContext *s) { PutBitContext *p = &s->pb; int size; uint8_t *ptr; if (s->aspect_ratio_info /* && !lossless */) { /* JFIF header */ put_marker(p, APP0); put_bits(p, 16, 16); put_string(p, "JFIF"); /* this puts the trailing zero-byte too */ put_...
[ 1, 0 ]
qemu
hw/intc/arm_gicv3_redist.c
MemTxResult gicv3_redist_read(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
libavutil/crc.c
uint32_t av_crc(const AVCRC *ctx, uint32_t crc, const uint8_t *buffer, size_t length) { const uint8_t *end = buffer + length; #if !CONFIG_SMALL if (!ctx[256]) while (buffer < end - 3) { crc ^= le2me_32(*(const uint32_t *)buffer); buffer += 4; crc = ctx[3 * 256 + (crc & 0x...
[ 1, 0 ]
qemu
Makefile.objs
void migrate_add_blocker(Error *reason) { migration_blockers = g_slist_prepend(migration_blockers, reason); }
[ 1, 0 ]
FFmpeg
libavformat/hls.c
static int open_url(AVFormatContext *s, AVIOContext **pb, const char *url, AVDictionary *opts, AVDictionary *opts2, int *is_http) { HLSContext *c = s->priv_data; AVDictionary *tmp = NULL; const char *proto_name = NULL; int ret; av_dict_copy(&tmp, opts, 0); av_dict_copy(&tmp, opts...
[ 1, 0 ]
FFmpeg
libavformat/wav.c
static int find_tag(ByteIOContext *pb, uint32_t tag1) { unsigned int tag; int size; for (;;) { if (url_feof(pb)) return -1; tag = get_le32(pb); size = get_le32(pb); if (tag == tag1) break; url_fseek(pb, size, SEEK_CUR); } if (size < 0) size = 0x7fffffff; ret...
[ 1, 1 ]
FFmpeg
libavcodec/aacdec.c
static int aac_decode_frame(AVCodecContext *avctx, void *data, int *got_frame_ptr, AVPacket *avpkt) { AACContext *ac = avctx->priv_data; const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; GetBitContext gb; int buf_consumed; int buf_offset; int err; int ne...
[ 1, 0 ]
qemu
hw/input/hid.c
static void pointer_event(VncState *vs, int button_mask, int x, int y) { static uint32_t bmap[INPUT_BUTTON__MAX] = { [INPUT_BUTTON_LEFT] = 0x01, [INPUT_BUTTON_MIDDLE] = 0x02, [INPUT_BUTTON_RIGHT] = 0x04, [INPUT_BUTTON_WHEEL_UP] = 0x08, [INPUT_BUTTON_WHEEL_DOWN] = 0x10, }; Qe...
[ 1, 0 ]
qemu
block/qcow2.c
static bool is_zero_cluster(BlockDriverState *bs, int64_t start) { BDRVQcow2State *s = bs->opaque; int nr; BlockDriverState *file; int64_t res = bdrv_get_block_status_above(bs, NULL, start, s->cluster_sectors, &nr, &file); return res >= 0 && (res & BDRV_BLOCK...
[ 0, 0 ]
qemu
hw/core/qdev.c
void qdev_property_add_static(DeviceState *dev, Property *prop, Error **errp) { Error *local_err = NULL; Object *obj = OBJECT(dev); /* * TODO qdev_prop_ptr does not have getters or setters. It must * go now that it can be replaced with links. The test should be * r...
[ 1, 1 ]
qemu
block.c
static uint16_t shpc_get_status(SHPCDevice *shpc, int slot, uint16_t msk) { uint8_t *status = shpc->config + SHPC_SLOT_STATUS(slot); return (pci_get_word(status) & msk) >> (ffs(msk) - 1); }
[ 0, 0 ]
qemu
hw/alpha_pci.c
DeviceState *pc_vga_init(ISABus *isa_bus, PCIBus *pci_bus) { DeviceState *dev = NULL; if (cirrus_vga_enabled) { if (pci_bus) { dev = pci_cirrus_vga_init(pci_bus); } else { dev = isa_cirrus_vga_init(get_system_memory()); } } else if (vmsvga_enabled) { if (pci_bus) { dev ...
[ 0, 0 ]