Projectname
large_stringclasses
15 values
Filepath
large_stringlengths
4
106
Function
large_stringlengths
11
3.45k
Label
list
qemu
arch_init.c
static int ram_save_setup(QEMUFile *f, void *opaque) { RAMBlock *block; int64_t ram_pages = last_ram_offset() >> TARGET_PAGE_BITS; migration_bitmap = bitmap_new(ram_pages); bitmap_set(migration_bitmap, 0, ram_pages); migration_dirty_pages = ram_pages; mig_throttle_on = false; dirty_rate_high_cnt =...
[ 1, 0 ]
FFmpeg
libavformat/rsd.c
static int rsd_probe(AVProbeData *p) { if (!memcmp(p->buf, "RSD", 3) && p->buf[3] - '0' >= 2 && p->buf[3] - '0' <= 6) return AVPROBE_SCORE_EXTENSION; return 0; }
[ 1, 0 ]
qemu
net/net.c
void qemu_macaddr_default_if_unset(MACAddr *macaddr) { static int index = 0; static const MACAddr zero = {.a = {0, 0, 0, 0, 0, 0}}; if (memcmp(macaddr, &zero, sizeof(zero)) != 0) return; macaddr->a[0] = 0x52; macaddr->a[1] = 0x54; macaddr->a[2] = 0x00; macaddr->a[3] = 0x12; macaddr->a[4] =...
[ 1, 0 ]
qemu
hw/pxa2xx_timer.c
static int pxa2xx_timer_init(SysBusDevice *dev) { int i; int iomemtype; PXA2xxTimerInfo *s; qemu_irq irq4; s = FROM_SYSBUS(PXA2xxTimerInfo, dev); s->irq_enabled = 0; s->oldclock = 0; s->clock = 0; s->lastload = qemu_get_clock(vm_clock); s->reset3 = 0; for (i = 0; i < 4; i++) { s->...
[ 1, 0 ]
qemu
hw/xen/xen_backend.c
int xen_be_send_notify(struct XenDevice *xendev) { return xc_evtchn_notify(xendev->evtchndev, xendev->local_port); }
[ 0, 0 ]
qemu
Makefile.objs
static bool event_notifier_poll(void *opaque) { EventNotifier *e = opaque; AioContext *ctx = container_of(e, AioContext, notifier); return atomic_read(&ctx->notified); }
[ 0, 0 ]
qemu
include/qemu/mmap-alloc.h
static size_t fd_getpagesize(int fd) { #ifdef CONFIG_LINUX struct statfs fs; int ret; if (fd != -1) { do { ret = fstatfs(fd, &fs); } while (ret != 0 && errno == EINTR); if (ret == 0 && fs.f_type == HUGETLBFS_MAGIC) { return fs.f_bsize; } } #endif return getpagesize(); }
[ 1, 0 ]
FFmpeg
libavformat/utils.c
static int64_t wrap_timestamp(AVStream *st, int64_t timestamp) { if (st->pts_wrap_behavior != AV_PTS_WRAP_IGNORE && st->pts_wrap_bits < 64 && st->pts_wrap_reference != AV_NOPTS_VALUE && timestamp != AV_NOPTS_VALUE) { if (st->pts_wrap_behavior == AV_PTS_WRAP_ADD_OFFSET && timestamp < st->pts_wra...
[ 1, 0 ]
qemu
tests/virtio-9p-test.c
static QVirtIO9P *qvirtio_9p_pci_init(void) { QVirtIO9P *v9p; QVirtioPCIDevice *dev; v9p = g_new0(QVirtIO9P, 1); v9p->alloc = pc_alloc_init(); v9p->bus = qpci_init_pc(NULL); dev = qvirtio_pci_device_find(v9p->bus, VIRTIO_ID_9P); g_assert_nonnull(dev); g_assert_cmphex(dev->vdev.device_type, ==, ...
[ 0, 0 ]
qemu
Makefile
static void vnc_write(VncState *vs, const void *data, size_t len) { buffer_reserve(&vs->output, len); if (buffer_empty(&vs->output)) { qemu_set_fd_handler2(vs->csock, NULL, vnc_client_read, vnc_client_write, vs); } buffer_append(&vs->output, data, len); }
[ 0, 0 ]
qemu
hw/block/dataplane/virtio-blk.c
void virtio_blk_data_plane_destroy(VirtIOBlockDataPlane *s) { if (!s) { return; } virtio_blk_data_plane_stop(s); g_free(s->batch_notify_vqs); qemu_bh_delete(s->bh); object_unref(OBJECT(s->iothread)); g_free(s); }
[ 0, 0 ]
qemu
hw/ide/cmd646.c
static uint32_t bmdma_readb(void *opaque, uint32_t addr) { BMDMAState *bm = opaque; PCIIDEState *pci_dev = pci_from_bm(bm); uint32_t val; switch (addr & 3) { case 0: val = bm->cmd; break; case 1: val = pci_dev->dev.config[MRDMODE]; break; case 2: val = bm->status; bre...
[ 1, 0 ]
FFmpeg
libavcodec/arm/vp8dsp.h
static av_always_inline int normal_limit(uint8_t *p, ptrdiff_t stride, int E, int I) { LOAD_PIXELS return simple_limit(p, stride, E) && FFABS(p3 - p2) <= I && FFABS(p2 - p1) <= I && FFABS(p1 - p0) <= I && FFABS(q3 - q2) <= I && FFABS(q2 - q1) <= I && F...
[ 1, 0 ]
qemu
hw/acpi/aml-build.c
static void nvdimm_build_nfit(GSList *device_list, GArray *table_offsets, GArray *table_data, GArray *linker) { GArray *structures = nvdimm_build_device_structure(device_list); unsigned int header; acpi_add_table(table_offsets, table_data); /* NFIT header. */ header = tabl...
[ 1, 0 ]
qemu
hw/eepro100.c
static void pci_mmio_map(PCIDevice *pci_dev, int region_num, uint32_t addr, uint32_t size, int type) { PCIEEPRO100State *d = DO_UPCAST(PCIEEPRO100State, dev, pci_dev); logout("region %d, addr=0x%08x, size=0x%08x, type=%d\n", region_num, addr, size, type); if (region_num == ...
[ 0, 0 ]
qemu
HACKING
uint32_t ldl_le_phys(target_phys_addr_t addr) { return ldl_phys_internal(addr, DEVICE_LITTLE_ENDIAN); }
[ 0, 0 ]
qemu
hw/misc/ivshmem.c
static void ivshmem_check_memdev_is_busy(const Object *obj, const char *name, Object *val, Error **errp) { if (host_memory_backend_is_mapped(MEMORY_BACKEND(val))) { char *path = object_get_canonical_path_component(val); error_setg(errp, "can't use already busy mem...
[ 0, 0 ]
qemu
hw/virtio-pci.c
int kvm_irqchip_add_irq_notifier(KVMState *s, EventNotifier *n, int virq) { return -ENOSYS; }
[ 0, 0 ]
FFmpeg
libavcodec/tiff.c
static double tget_double(const uint8_t **p, int le) { av_alias64 i = {.u64 = le ? AV_RL64(*p) : AV_RB64(*p)}; *p += 8; return i.f64; }
[ 0, 0 ]
qemu
hw/arm/Makefile.objs
static void xlnx_ep108_machine_init(MachineClass *mc) { mc->desc = "Xilinx ZynqMP EP108 board"; mc->init = xlnx_ep108_init; mc->block_default_type = IF_IDE; mc->units_per_default_bus = 1; mc->ignore_memory_transaction_failures = true; }
[ 0, 0 ]
qemu
hw/acpi/aml-build.c
build_fadt(GArray *table_data, BIOSLinker *linker, unsigned dsdt) { AcpiFadtDescriptorRev5_1 *fadt = acpi_data_push(table_data, sizeof(*fadt)); /* Hardware Reduced = 1 and use PSCI 0.2+ and with HVC */ fadt->flags = cpu_to_le32(1 << ACPI_FADT_F_HW_REDUCED_ACPI); fadt->arm_boot_flags = cpu_to_le16((1 << ACP...
[ 1, 0 ]
qemu
HACKING
void apic_enable_vapic(DeviceState *d, target_phys_addr_t paddr) { APICCommonState *s = DO_UPCAST(APICCommonState, busdev.qdev, d); APICCommonClass *info = APIC_COMMON_GET_CLASS(s); s->vapic_paddr = paddr; info->vapic_base_update(s); }
[ 0, 0 ]
qemu
tcg/aarch64/tcg-target.inc.c
static void tcg_out_logicali(TCGContext *s, AArch64Insn insn, TCGType ext, TCGReg rd, TCGReg rn, uint64_t limm) { unsigned h, l, r, c; assert(is_limm(limm)); h = clz64(limm); l = ctz64(limm); if (l == 0) { r = 0; /* form 0....01....1 */ c = ctz64(~limm) - 1; ...
[ 0, 0 ]
qemu
hw/acpi/nvdimm.c
void nvdimm_acpi_hotplug(AcpiNVDIMMState *state) { nvdimm_build_fit_buffer(&state->fit_buf); }
[ 0, 0 ]
FFmpeg
libavcodec/yop.c
static void yop_paint_block(YopDecContext *s, int tag) { s->dstptr[0] = s->srcptr[0]; s->dstptr[1] = s->srcptr[paint_lut[tag][0]]; s->dstptr[s->frame.linesize[0]] = s->srcptr[paint_lut[tag][1]]; s->dstptr[s->frame.linesize[0] + 1] = s->srcptr[paint_lut[tag][2]]; // The number of src bytes consumed is in...
[ 1, 0 ]
FFmpeg
libavcodec/rv34.c
av_cold int ff_rv34_decode_init(AVCodecContext *avctx) { RV34DecContext *r = avctx->priv_data; MpegEncContext *s = &r->s; int ret; ff_MPV_decode_defaults(s); s->avctx = avctx; s->out_format = FMT_H263; s->codec_id = avctx->codec_id; s->width = avctx->width; s->height = avctx->height; r->s...
[ 1, 0 ]
qemu
qemu-char.c
static int tcp_chr_write(CharDriverState *chr, const uint8_t *buf, int len) { TCPCharDriver *s = chr->opaque; if (s->connected) { return send_all(s->fd, buf, len); } else { /* (Re-)connect for unconnected writing */ tcp_chr_connect(chr); return 0; } }
[ 0, 0 ]
qemu
tcg/aarch64/tcg-target.inc.c
static inline void tcg_out_ext8u(TCGContext *s, int dest, int src) { /* movzbl */ assert(src < 4 || TCG_TARGET_REG_BITS == 64); tcg_out_modrm(s, OPC_MOVZBL + P_REXB_RM, dest, src); }
[ 1, 0 ]
qemu
hw/eepro100.c
static void pci_map(PCIDevice *pci_dev, int region_num, uint32_t addr, uint32_t size, int type) { PCIEEPRO100State *d = DO_UPCAST(PCIEEPRO100State, dev, pci_dev); EEPRO100State *s = &d->eepro100; logout("region %d, addr=0x%08x, size=0x%08x, type=%d\n", region_num, addr, size, ty...
[ 0, 0 ]
qemu
hw/esp.c
static void lsi_do_command(LSIState *s) { SCSIDevice *dev; uint8_t buf[16]; uint32_t id; int n; DPRINTF("Send command len=%d\n", s->dbc); if (s->dbc > 16) s->dbc = 16; cpu_physical_memory_read(s->dnad, buf, s->dbc); s->sfbr = buf[0]; s->command_complete = 0; id = (s->select_tag >> 8)...
[ 1, 0 ]
qemu
hw/pci-host/versatile.c
static void pci_vpb_init(Object *obj) { PCIHostState *h = PCI_HOST_BRIDGE(obj); PCIVPBState *s = PCI_VPB(obj); memory_region_init(&s->pci_io_space, OBJECT(s), "pci_io", 1ULL << 32); memory_region_init(&s->pci_mem_space, OBJECT(s), "pci_mem", 1ULL << 32); pci_bus_new_inplace(&s->pci_bus, sizeof(s->pci_bu...
[ 1, 0 ]
qemu
block/qapi.c
static Visitor *visitor_input_test_init_raw(TestInputVisitorData *data, const char *json_string) { return visitor_input_test_init_internal(data, json_string, NULL); }
[ 0, 0 ]
qemu
target/s390x/excp_helper.c
int s390_cpu_handle_mmu_fault(CPUState *cs, vaddr orig_vaddr, int rw, int mmu_idx) { S390CPU *cpu = S390_CPU(cs); CPUS390XState *env = &cpu->env; target_ulong vaddr, raddr; uint64_t asc; int prot; DPRINTF("%s: address 0x%" VADDR_PRIx " rw %d mmu_idx %d\n", __...
[ 1, 0 ]
qemu
target/mips/helper.c
void cpu_mips_store_status(CPUMIPSState *env, target_ulong val) { uint32_t mask = env->CP0_Status_rw_bitmask; target_ulong old = env->CP0_Status; if (env->insn_flags & ISA_MIPS32R6) { bool has_supervisor = extract32(mask, CP0St_KSU, 2) == 0x3; #if defined(TARGET_MIPS64) uint32_t ksux = (1 << CP0St_...
[ 1, 0 ]
qemu
configure
static void do_info_version(Monitor *mon) { monitor_printf(mon, "%s\n", QEMU_VERSION); }
[ 0, 0 ]
qemu
linux-user/signal.c
setup_sigcontext(struct target_sigcontext *sc, /*struct _fpstate *fpstate,*/ CPUState *env, unsigned long mask) { int err = 0; __put_user_error(env->regs[0], &sc->arm_r0, err); __put_user_error(env->regs[1], &sc->arm_r1, err); __put_user_error(env->regs[2], &sc->arm_r2, err); __put_use...
[ 0, 0 ]
qemu
docs/qapi-code-gen.txt
static void test_visitor_in_intList(TestInputVisitorData *data, const void *unused) { int64_t value[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 20}; int16List *res = NULL, *tmp; Error *err = NULL; Visitor *v; int i = 0; v = visitor_input_test_init(data, "1,2,0,2-4,20,5-9,1...
[ 1, 1 ]
FFmpeg
libavformat/mxfdec.c
static int mxf_read_source_package(MXFPackage *package, ByteIOContext *pb, int tag) { switch (tag) { case 0x4403: package->tracks_count = get_be32(pb); if (package->tracks_count >= UINT_MAX / sizeof(UID)) return -1; package->tracks_refs = av_malloc(package...
[ 1, 0 ]
qemu
hw/arm_gic.c
static int arm_gic_common_init(SysBusDevice *dev) { GICState *s = FROM_SYSBUS(GICState, dev); int num_irq = s->num_irq; if (s->num_cpu > NCPU) { hw_error("requested %u CPUs exceeds GIC maximum %d\n", s->num_cpu, NCPU); } s->num_irq += GIC_BASE_IRQ; if (s->num_irq > GIC_MAXIRQ) { ...
[ 1, 0 ]
qemu
Makefile.objs
bool migrate_rdma_pin_all(void) { MigrationState *s; s = migrate_get_current(); return s->enabled_capabilities[MIGRATION_CAPABILITY_RDMA_PIN_ALL]; }
[ 1, 0 ]
qemu
target-mips/helper.h
target_ulong helper_lwr(CPUMIPSState *env, target_ulong arg1, target_ulong arg2, int mem_idx) { target_ulong tmp; tmp = do_lbu(env, arg2, mem_idx); arg1 = (arg1 & 0xFFFFFF00) | tmp; if (GET_LMASK(arg2) >= 1) { tmp = do_lbu(env, GET_OFFSET(arg2, -1), mem_idx); arg1 = (arg1...
[ 1, 0 ]
FFmpeg
libavcodec/h264.c
static av_cold void common_init(H264Context *h) { MpegEncContext *const s = &h->s; s->width = s->avctx->width; s->height = s->avctx->height; s->codec_id = s->avctx->codec->id; ff_h264dsp_init(&h->h264dsp, 8, 1); ff_h264_pred_init(&h->hpc, s->codec_id, 8, 1); h->dequant_coeff_pps = -1; s->unrestr...
[ 1, 1 ]
qemu
backends/baum.c
static SocketAddress *nbd_config(BDRVNBDState *s, QDict *options, char **export, Error **errp) { SocketAddress *saddr; if (qdict_haskey(options, "path") == qdict_haskey(options, "host")) { if (qdict_haskey(options, "path")) { error_setg(errp, "path and host may not b...
[ 1, 0 ]
qemu
hw/net/net_rx_pkt.c
void eth_setup_vlan_headers(struct eth_header *ehdr, uint16_t vlan_tag, bool *is_new) { struct vlan_header *vhdr = PKT_GET_VLAN_HDR(ehdr); switch (be16_to_cpu(ehdr->h_proto)) { case ETH_P_VLAN: case ETH_P_DVLAN: /* vlan hdr exists */ *is_new = false; break; de...
[ 0, 0 ]
qemu
HACKING
static uint64_t bw_conf1_read(void *opaque, target_phys_addr_t addr, unsigned size) { PCIBus *b = opaque; return pci_data_read(b, addr, size); }
[ 0, 0 ]
qemu
block/nbd-client.h
int nbd_init(int fd, QIOChannelSocket *ioc, uint32_t flags, off_t size) { return -ENOTSUP; }
[ 0, 0 ]
FFmpeg
libavcodec/dca_parser.c
static int dca_find_frame_end(DCAParseContext *pc1, const uint8_t *buf, int buf_size) { int start_found, i; uint32_t state; ParseContext *pc = &pc1->pc; start_found = pc->frame_start_found; state = pc->state; i = 0; if (!start_found) { for (i = 0; i < buf_size; ...
[ 1, 0 ]
qemu
disas.c
static void do_info_block(int argc, const char **argv) { bdrv_info(); }
[ 0, 0 ]
qemu
hw/vt82c686.c
static int vt82c686b_mc97_initfn(PCIDevice *dev) { VT686MC97State *s = DO_UPCAST(VT686MC97State, dev, dev); uint8_t *pci_conf = s->dev.config; pci_config_set_vendor_id(pci_conf, PCI_VENDOR_ID_VIA); pci_config_set_device_id(pci_conf, PCI_DEVICE_ID_VIA_MC97); pci_config_set_class(pci_conf, PCI_CLASS_COMMU...
[ 0, 0 ]
FFmpeg
libavcodec/mips/h264qpel_msa.c
void ff_put_h264_qpel8_mc12_msa(uint8_t *dst, const uint8_t *src, ptrdiff_t stride) { avc_luma_midh_qrt_8w_msa(src - (2 * stride) - 2, stride, dst, stride, 8, 0); }
[ 0, 0 ]
qemu
hw/serial.c
static void serial_receive_byte(SerialState *s, int ch) { s->rbr = ch; s->lsr |= UART_LSR_DR; serial_update_irq(s); }
[ 1, 0 ]
qemu
target-arm/translate.c
static inline TCGv gen_ld8u(TCGv addr, int index) { TCGv tmp = new_tmp(); tcg_gen_qemu_ld8u(tmp, addr, index); return tmp; }
[ 1, 0 ]
qemu
tests/boot-sector.c
void boot_sector_test(void) { uint8_t signature_low; uint8_t signature_high; uint16_t signature; int i; /* Wait at most 90 seconds */ #define TEST_DELAY (1 * G_USEC_PER_SEC / 10) #define TEST_CYCLES MAX((90 * G_USEC_PER_SEC / TEST_DELAY), 1) /* Poll until code has run and modified memory. Once it ...
[ 1, 1 ]
qemu
block/qcow2-refcount.c
int64_t qcow2_alloc_bytes(BlockDriverState *bs, int size) { BDRVQcowState *s = bs->opaque; int64_t offset; size_t free_in_cluster; int ret; BLKDBG_EVENT(bs->file, BLKDBG_CLUSTER_ALLOC_BYTES); assert(size > 0 && size <= s->cluster_size); assert(!s->free_byte_offset || offset_into_cluster(s, s->free...
[ 1, 0 ]
qemu
include/qemu/coroutine_int.h
void aio_co_schedule(AioContext *ctx, Coroutine *co) { trace_aio_co_schedule(ctx, co); QSLIST_INSERT_HEAD_ATOMIC(&ctx->scheduled_coroutines, co, co_scheduled_next); qemu_bh_schedule(ctx->co_schedule_bh);
[ 1, 0 ]
qemu
exec.c
void cpu_physical_memory_write_rom(target_phys_addr_t addr, const uint8_t *buf, int len) { int l; uint8_t *ptr; target_phys_addr_t page; MemoryRegionSection *section; while (len > 0) { page = addr & TARGET_PAGE_MASK; l = (page + TARGET_PAGE_SIZE) - addr; ...
[ 1, 0 ]
qemu
hw/usb/redirect.c
static void usbredir_do_attach(void *opaque) { USBRedirDevice *dev = opaque; /* In order to work properly with XHCI controllers we need these caps */ if ((dev->dev.port->speedmask & USB_SPEED_MASK_SUPER) && !( usb_redir_cap_ep_info_max_packet_size) && usb_redir_cap_64bits_ids))) { ...
[ 1, 0 ]
FFmpeg
libavformat/dv.c
static int64_t dv_frame_offset(AVFormatContext *s, DVDemuxContext *c, int64_t timestamp, int flags) { // FIXME: sys may be wrong if last dv_read_packet() failed (buffer is junk) const AVDVProfile *sys = av_dv_codec_profile2(c->vst->codec->width, c->vst->codec->height, ...
[ 1, 1 ]
qemu
hw/i2c.h
static void menelaus_rtc_hz(void *opaque) { struct menelaus_s *s = (struct menelaus_s *)opaque; s->rtc.next_comp--; s->rtc.alm_sec--; s->rtc.next += 1000; qemu_mod_timer(s->rtc.hz, s->rtc.next); if ((s->rtc.ctrl >> 3) & 3) { /* EVERY */ menelaus_rtc_update(s); if (((s->rtc.ctrl >> 3) & 3) =...
[ 1, 1 ]
FFmpeg
tests/api/api-codec-param-test.c
static int find_video_stream_info(AVFormatContext *fmt_ctx, int decode) { int ret = 0; int i, done = 0; AVPacket pkt; av_init_packet(&pkt); while (!done) { AVCodecContext *codec_ctx = NULL; AVStream *st; if ((ret = av_read_frame(fmt_ctx, &pkt)) < 0) { av_log(fmt_ctx, AV_LOG_ERROR, "Failed to...
[ 1, 0 ]
qemu
tests/hd-geo-test.c
static void test_ide_drive_user(const char *dev, bool trans) { char *argv[256], *opts; int argc; int secs = img_secs[backend_small]; const CHST expected_chst = {secs / (4 * 32), 4, 32, trans}; argc = setup_common(argv, ARRAY_SIZE(argv)); opts = g_strdup_printf("%s,%s%scyls=%d,heads=%d,secs=%d", ...
[ 1, 0 ]
FFmpeg
libavformat/sgi.c
static int read_rle_sgi(const SGIInfo *sgi_info, AVPicture *pict, ByteIOContext *f) { uint8_t *dest_row, *rle_data = NULL; unsigned long *start_table, *length_table; int y, z, xsize, ysize, zsize, tablen; long start_offset, run_length; int ret = 0; xsize = sgi_info->xsize; ...
[ 1, 0 ]
FFmpeg
libavcodec/4xm.c
static void init_2d_vlc_rl(RLTable *rl) { int i; init_vlc(&rl->vlc, TEX_VLC_BITS, rl->n + 2, &rl->table_vlc[0][1], 4, 2, &rl->table_vlc[0][0], 4, 2); rl->rl_vlc[0] = av_malloc(rl->vlc.table_size * sizeof(RL_VLC_ELEM)); for (i = 0; i < rl->vlc.table_size; i++) { int code = rl->v...
[ 1, 0 ]
qemu
hw/xtensa/xtfpga.c
static void xtensa_kc705_init(MachineState *machine) { static const LxBoardDesc kc705_board = { .flash_base = 0xf0000000, .flash_size = 0x08000000, .flash_boot_base = 0x06000000, .flash_sector_size = 0x20000, .sram_size = 0x2000000, }; lx_init(&kc705_board, machine); }
[ 0, 0 ]
qemu
HACKING
static uint32_t pmac_ide_readl(void *opaque, target_phys_addr_t addr) { uint32_t retval; MACIOIDEState *d = opaque; addr = (addr & 0xFFF) >> 4; if (addr == 0) { retval = ide_data_readl(&d->bus, 0); } else { retval = 0xFFFFFFFF; } retval = bswap32(retval); return retval; }
[ 1, 0 ]
qemu
block.c
static int vmdk_reopen_prepare(BDRVReopenState *state, BlockReopenQueue *queue, Error **errp) { BDRVVmdkState *s; int ret = -1; int i; VmdkExtent *e; assert(state != NULL); assert(state->bs != NULL); if (queue == NULL) { error_setg(errp, "No reopen queue for VM...
[ 1, 0 ]
qemu
hw/arm_gic.c
static void gic_complete_irq(gic_state *s, int cpu, int irq) { int update = 0; int cm = 1 << cpu; DPRINTF("EOI %d\n", irq); if (s->running_irq[cpu] == 1023) return; /* No active IRQ. */ if (irq != 1023) { /* Mark level triggered interrupts as pending if they are still raised. */ ...
[ 0, 0 ]
qemu
hw/virtio-pci.c
static void kvm_virtio_pci_vq_vector_release(VirtIOPCIProxy *proxy, unsigned int queue_no, unsigned int vector) { VirtQueue *vq = virtio_get_queue(proxy->vdev, queue_no); EventNotifier *n = virtio_queue_get_guest_notifier...
[ 1, 0 ]
qemu
linux-user/syscall.c
static TargetFdAddrFunc fd_trans_target_to_host_addr(int fd) { if (fd < target_fd_max && target_fd_trans[fd]) { return target_fd_trans[fd]->target_to_host_addr; } return NULL; }
[ 0, 0 ]
qemu
tcg/aarch64/tcg-target.c
static inline void tcg_out_goto_label(TCGContext *s, int label_index) { TCGLabel *l = &s->labels[label_index]; if (!l->has_value) { tcg_out_reloc(s, s->code_ptr, R_AARCH64_JUMP26, label_index, 0); tcg_out_goto_noaddr(s); } else { tcg_out_goto(s, l->u.value_ptr); } }
[ 0, 0 ]
qemu
backends/hostmem-file.c
static void sd_reset(SDState *sd) { uint64_t size; uint64_t sect; if (sd->blk) { blk_get_geometry(sd->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); sd_set_c...
[ 1, 0 ]
qemu
tcg/aarch64/tcg-target.inc.c
static bool tcg_out_opc_jmp(TCGContext *s, MIPSInsn opc, void *target) { uintptr_t dest = (uintptr_t)target; uintptr_t from = (uintptr_t)s->code_ptr + 4; int32_t inst; /* The pc-region branch happens within the 256MB region of the delay slot (thus the +4). */ if ((from ^ dest) & -(1 << 28)) { ...
[ 1, 0 ]
qemu
qemu-char.c
static gboolean fd_chr_read(GIOChannel *chan, GIOCondition cond, void *opaque) { CharDriverState *chr = opaque; FDCharDriver *s = chr->opaque; int len; uint8_t buf[READ_BUF_LEN]; GIOStatus status; gsize bytes_read; len = sizeof(buf); if (len > s->max_size) { len = s->max_size; } if (l...
[ 1, 0 ]
qemu
balloon.c
static int qemu_balloon_status(BalloonInfo *info) { if (!balloon_stat_fn) { return 0; } balloon_stat_fn(balloon_opaque, info); return 1; }
[ 0, 0 ]
qemu
include/exec/gen-icount.h
static inline TCGOp *tcg_emit_op(TCGOpcode opc) { TCGContext *ctx = tcg_ctx; int oi = ctx->gen_next_op_idx; int ni = oi + 1; int pi = oi - 1; TCGOp *op = &ctx->gen_op_buf[oi]; tcg_debug_assert(oi < OPC_BUF_SIZE); ctx->gen_op_buf[0].prev = oi; ctx->gen_next_op_idx = ni; memset(op, 0, offsetof...
[ 1, 0 ]
FFmpeg
libavcodec/dsicinav.c
static av_cold int cinvideo_decode_init(AVCodecContext *avctx) { CinVideoContext *cin = avctx->priv_data; unsigned int i; cin->avctx = avctx; avctx->pix_fmt = AV_PIX_FMT_PAL8; avcodec_get_frame_defaults(&cin->frame); cin->frame.data[0] = NULL; cin->bitmap_size = avctx->width * avctx->height; fo...
[ 1, 0 ]
qemu
pc-bios/s390-ccw/bootmap.c
static void jump_to_IPL_code(uint64_t address) { /* store the subsystem information _after_ the bootmap was loaded */ write_subsystem_identification(); /* * The IPL PSW is at address 0. We also must not overwrite the * content of non-BIOS memory after we loaded the guest, so we * save the original...
[ 1, 1 ]
qemu
hw/audio/adlib.c
static void wdt_ib700_realize(DeviceState *dev, Error **errp) { IB700State *s = IB700(dev); PortioList *port_list = g_new(PortioList, 1); ib700_debug("watchdog init\n"); s->timer = timer_new_ns(QEMU_CLOCK_VIRTUAL, ib700_timer_expired, s); portio_list_init(port_list, OBJECT(s), wdt_portio_list, s, "ib700...
[ 1, 0 ]
FFmpeg
ffmpeg.c
static int ffm_write_packet(AVFormatContext *s, AVPacket *pkt) { FFMContext *ffm = s->priv_data; AVStream *st = s->streams[pkt->stream_index]; int64_t pts; uint8_t header[FRAME_HEADER_SIZE]; pts = ffm->start_time + pkt->pts; /* packet size & key_frame */ header[0] = pkt->stream_index; header[1]...
[ 1, 0 ]
FFmpeg
libavformat/sol.c
static int sol_read_packet(AVFormatContext *s, AVPacket *pkt) { int ret; if (s->pb->eof_reached) return AVERROR(EIO); ret = av_get_packet(s->pb, pkt, MAX_SIZE); pkt->stream_index = 0; /* note: we need to modify the packet size here to handle the last packet */ p...
[ 1, 0 ]
qemu
kvm-all.c
static int kvm_irqchip_get_virq(KVMState *s) { uint32_t *word = s->used_gsi_bitmap; int max_words = ALIGN(s->gsi_count, 32) / 32; int i, zeroes; bool retry = true; again: /* Return the lowest unused GSI in the bitmap */ for (i = 0; i < max_words; i++) { zeroes = ctz32(~word[i]); if (zeroes...
[ 1, 0 ]
qemu
hw/9pfs/9p.c
static int v9fs_xattr_read(V9fsState *s, V9fsPDU *pdu, V9fsFidState *fidp, uint64_t off, uint32_t max_count) { ssize_t err; size_t offset = 7; int read_count; int64_t xattr_len; V9fsVirtioState *v = container_of(s, V9fsVirtioState, state); VirtQueueElement *elem = &v->elem...
[ 0, 0 ]
qemu
Makefile.objs
bool aio_prepare(AioContext *ctx) { /* Poll mode cannot be used with glib's event loop, disable it. */ poll_set_started(ctx, false); return false; }
[ 0, 0 ]
qemu
hw/realview.c
static void pci_vpb_unmap(SysBusDevice *dev, target_phys_addr_t base) { PCIVPBState *s = (PCIVPBState *)dev; /* Selfconfig area. */ memory_region_del_subregion(get_system_memory(), &s->mem_config); /* Normal config area. */ memory_region_del_subregion(get_system_memory(), &s->mem_config2); if (s->r...
[ 0, 0 ]
qemu
hw/9pfs/Makefile.objs
static int v9fs_synth_init(FsContext *ctx) { QLIST_INIT(&v9fs_synth_root.child); qemu_mutex_init(&v9fs_synth_mutex); /* Add "." and ".." entries for root */ v9fs_add_dir_node(&v9fs_synth_root, v9fs_synth_root.attr->mode, "..", v9fs_synth_root.attr, v9fs_synth_root.attr->inode); v9fs...
[ 0, 0 ]
qemu
hw/acpi/piix4.c
static void m48t59_isa_class_init(ObjectClass *klass, void *data) { DeviceClass *dc = DEVICE_CLASS(klass); dc->realize = m48t59_isa_realize; dc->no_user = 1; dc->reset = m48t59_reset_isa; dc->props = m48t59_isa_properties; }
[ 1, 0 ]
FFmpeg
libavcodec/audio_frame_queue.c
void ff_af_queue_log_state(AudioFrameQueue *afq) { AudioFrame *f; av_log(afq->avctx, AV_LOG_DEBUG, "remaining delay = %d\n", afq->remaining_delay); av_log(afq->avctx, AV_LOG_DEBUG, "remaining samples = %d\n", afq->remaining_samples); av_log(afq->avctx, AV_LOG_DEBUG, "frames:\n"); f...
[ 0, 0 ]
FFmpeg
libavcodec/truemotion1.c
static int make_cdt24_entry(int p1, int p2, int16_t *cdt) { int r, b; b = cdt[p2]; r = cdt[p1] << 16; return (b + r) << 1; }
[ 1, 0 ]
FFmpeg
postproc/rgb2rgb.c
static inline void RENAME(yvu9toyv12)(const uint8_t *ysrc, const uint8_t *usrc, const uint8_t *vsrc, uint8_t *ydst, uint8_t *udst, uint8_t *vdst, unsigned int width, ...
[ 1, 1 ]
FFmpeg
ffmpeg.c
static void sub2video_copy_rect(uint8_t *dst, int dst_linesize, int w, int h, AVSubtitleRect *r) { uint32_t *pal, *dst2; uint8_t *src, *src2; int x, y; if (r->type != SUBTITLE_BITMAP) { av_log(NULL, AV_LOG_WARNING, "sub2video: non-bitmap subtitle\n"); return; } ...
[ 1, 0 ]
FFmpeg
Changelog
SchroVideoFormatEnum ff_get_schro_video_format_preset(AVCodecContext *avctx) { unsigned int num_formats = sizeof(ff_schro_video_formats) / sizeof(ff_schro_video_formats[0]); unsigned int idx = get_video_format_idx(avctx); return (idx < num_formats) ? ff_schro_video_formats[idx] :...
[ 1, 0 ]
qemu
hw/display/cirrus_vga.c
void qemu_console_copy(QemuConsole *con, int src_x, int src_y, int dst_x, int dst_y, int w, int h) { assert(con->console_type == GRAPHIC_CONSOLE); dpy_gfx_copy(con, src_x, src_y, dst_x, dst_y, w, h); }
[ 1, 0 ]
FFmpeg
libavcodec/aac_adtstoasc_bsf.c
static int aac_adtstoasc_init(AVBSFContext *ctx) { av_freep(&ctx->par_out->extradata); ctx->par_out->extradata_size = 0; return 0; }
[ 0, 0 ]
FFmpeg
doc/muxers.texi
static void mpegts_write_section(MpegTSSection *s, uint8_t *buf, int len) { unsigned int crc; unsigned char packet[TS_PACKET_SIZE]; const unsigned char *buf_ptr; unsigned char *q; int first, b, len1, left; crc = av_bswap32(av_crc(av_crc_get_table(AV_CRC_32_IEEE), -1, buf, l...
[ 1, 0 ]
qemu
memory.c
void address_space_init(AddressSpace *as, MemoryRegion *root, const char *name) { memory_region_transaction_begin(); as->root = root; as->current_map = g_new(FlatView, 1); flatview_init(as->current_map); as->ioeventfd_nb = 0; as->ioeventfds = NULL; QTAILQ_INSERT_TAIL(&address_spaces, as, address_s...
[ 1, 0 ]
qemu
ui/vnc-auth-sasl.c
static int protocol_client_auth_sasl_mechname(VncState *vs, uint8_t *data, size_t len) { char *mechname = malloc(len + 1); if (!mechname) { VNC_DEBUG("Out of memory reading mechname\n"); vnc_client_error(vs); } strncpy(mechname, (char *)data, len); ...
[ 1, 0 ]
qemu
audio/alsaaudio.c
static int no_init_in(HWVoiceIn *hw, struct audsettings *as) { audio_pcm_init_info(&hw->info, as); hw->samples = 1024; return 0; }
[ 1, 0 ]
qemu
console.c
void vga_hw_screen_dump(const char *filename) { TextConsole *previous_active_console; previous_active_console = active_console; active_console = consoles[0]; /* There is currently no way of specifying which screen we want to dump, so always dump the first one. */ if (consoles[0] && consoles[0]->h...
[ 1, 0 ]
qemu
net/socket.c
static int net_socket_udp_init(NetClientState *peer, const char *model, const char *name, const char *rhost, const char *lhost) { NetSocketState *s; int fd, ret; struct sockaddr_in l...
[ 1, 0 ]
qemu
hw/scsi/virtio-scsi-dataplane.c
bool virtio_scsi_handle_event_vq(VirtIOSCSI *s, VirtQueue *vq) { virtio_scsi_acquire(s); if (s->events_dropped) { virtio_scsi_push_event(s, NULL, VIRTIO_SCSI_T_NO_EVENT, 0); virtio_scsi_release(s); return true; } virtio_scsi_release(s); return false; }
[ 1, 0 ]