Projectname
large_stringclasses
15 values
Filepath
large_stringlengths
4
106
Function
large_stringlengths
11
3.45k
Label
list
qemu
hw/vfio_pci.c
static int vfio_enable_intx(VFIODevice *vdev) { VFIOIRQSetFD irq_set_fd = { .irq_set = { .argsz = sizeof(irq_set_fd), .flags = VFIO_IRQ_SET_DATA_EVENTFD | VFIO_IRQ_SET_ACTION_TRIGGER, .index = VFIO_PCI_INTX_IRQ_INDEX, .start = 0, ...
[ 1, 0 ]
qemu
fpu/softfloat.h
void helper_store_fpcr(uint64_t val) { #ifdef CONFIG_SOFTFLOAT set_float_exception_flags((val >> 52) & 0x3F, &FP_STATUS); #endif switch ((val >> 58) & 3) { case 0: set_float_rounding_mode(float_round_to_zero, &FP_STATUS); break; case 1: set_float_rounding_mode(float_round_down, &FP_STATUS)...
[ 1, 0 ]
qemu
linux-user/elfload.c
static int write_note(struct memelfnote *men, int fd) { struct elf_note en; en.n_namesz = men->namesz; en.n_type = men->type; en.n_descsz = men->datasz; bswap_note(&en); if (dump_write(fd, &en, sizeof(en)) != 0) return (-1); if (dump_write(fd, men->name, men->namesz_rounded) != 0) return...
[ 1, 0 ]
qemu
target-arm/translate-a64.c
static void handle_mrs(DisasContext *s, uint32_t insn, unsigned int op0, unsigned int op1, unsigned int op2, unsigned int crn, unsigned int crm, unsigned int rt) { unsupported_encoding(s, insn); }
[ 0, 0 ]
qemu
configure
void vnc_client_read(void *opaque) { VncState *vs = opaque; long ret; #ifdef CONFIG_VNC_SASL if (vs->sasl.conn && vs->sasl.runSSF) ret = vnc_client_read_sasl(vs); else #endif /* CONFIG_VNC_SASL */ #ifdef CONFIG_VNC_WS if (vs->encode_ws) { ret = vnc_client_read_ws(vs); if (ret == -1...
[ 1, 0 ]
qemu
hw/arm/nseries.c
static void csrhci_in_packet_vendor(struct csrhci_s *s, int ocf, uint8_t *data, int len) { int offset; uint8_t *rpkt; switch (ocf) { case OCF_CSR_SEND_FIRMWARE: /* Check if this is the bd_address packet */ if (len >= 18 + 8 && data[12] == 0x01 && data[13] == 0...
[ 1, 0 ]
FFmpeg
libavformat/omadec.c
static int nprobe(AVFormatContext *s, uint8_t *enc_header, const uint8_t *n_val) { OMAContext *oc = s->priv_data; uint32_t pos, taglen, datalen; struct AVDES av_des; if (!enc_header || !n_val) return -1; pos = OMA_ENC_HEADER_SIZE + oc->k_size; if (!memcmp(&enc_header[pos], "EKB ", 4)) pos +...
[ 1, 0 ]
qemu
block.c
static gboolean nbd_negotiate_continue(QIOChannel *ioc, GIOCondition condition, void *opaque) { qemu_coroutine_enter(opaque, NULL); return TRUE; }
[ 1, 0 ]
qemu
qmp.c
void object_add(const char *type, const char *id, const QDict *qdict, Visitor *v, Error **errp) { Object *obj; const QDictEntry *e; Error *local_err = NULL; if (!object_class_by_name(type)) { error_setg(errp, "invalid class name"); return; } obj = object_new(type); if (qd...
[ 1, 0 ]
qemu
docs/qapi-code-gen.txt
void visit_end_struct(Visitor *v, Error **errp) { assert(!error_is_set(errp)); v->end_struct(v, errp); }
[ 1, 0 ]
FFmpeg
libavformat/rtsp.c
static int udp_read_packet(AVFormatContext *s, RTSPStream **prtsp_st, uint8_t *buf, int buf_size) { RTSPState *rt = s->priv_data; RTSPStream *rtsp_st; fd_set rfds; int fd, fd_max, n, i, ret, tcp_fd; struct timeval tv; for (;;) { if (url_interrupt_cb()) return A...
[ 1, 1 ]
FFmpeg
libavcodec/ffv1.c
static int common_end(AVCodecContext *avctx) { FFV1Context *s = avctx->priv_data; int i; for (i = 0; i < s->plane_count; i++) { PlaneContext *p = &s->plane[i]; av_freep(&p->state); } return 0; }
[ 1, 0 ]
qemu
block.c
static BlockDriverState *get_bs_snapshots(void) { BlockDriverState *bs; DriveInfo *dinfo; if (bs_snapshots) return bs_snapshots; QTAILQ_FOREACH(dinfo, &drives, next) { bs = dinfo->bdrv; if (bdrv_can_snapshot(bs)) goto ok; } return NULL; ok: bs_snapshots = bs; return bs; }
[ 1, 0 ]
qemu
hw/loader.c
int read_targphys(const char *name, int fd, target_phys_addr_t dst_addr, size_t nbytes) { uint8_t *buf; size_t did; buf = g_malloc(nbytes); did = read(fd, buf, nbytes); if (did > 0) rom_add_blob_fixed("read", buf, did, dst_addr); g_free(buf); return did; }
[ 1, 0 ]
FFmpeg
libavfilter/vf_frei0r.c
static av_cold int source_init(AVFilterContext *ctx, const char *args, void *opaque) { Frei0rContext *frei0r = ctx->priv; char dl_name[1024], c; char frame_size[128] = ""; char frame_rate[128] = ""; AVRational frame_rate_q; memset(frei0r->params, 0, sizeof(frei0r->param...
[ 1, 0 ]
qemu
monitor.c
static void monitor_qmp_event(void *opaque, int event) { QObject *data; Monitor *mon = opaque; switch (event) { case CHR_EVENT_OPENED: mon->qmp.in_command_mode = false; data = get_qmp_greeting(); monitor_json_emitter(mon, data); qobject_decref(data); mon_refcount++; break; ...
[ 1, 0 ]
qemu
tests/test-qmp-input-strict.c
int main(int argc, char **argv) { TestInputVisitorData testdata; g_test_init(&argc, &argv, NULL); validate_test_add("/visitor/input-strict/pass/struct", &testdata, test_validate_struct); validate_test_add("/visitor/input-strict/pass/struct-nested", &testdata, test_...
[ 1, 0 ]
qemu
cpu-exec.c
static inline void gen_neon_widen(TCGv dest, TCGv src, int size, int u) { if (u) { switch (size) { case 0: gen_helper_neon_widen_u8(dest, src); break; case 1: gen_helper_neon_widen_u16(dest, src); break; case 2: tcg_gen_extu_i32_i64(dest, src); break; def...
[ 0, 0 ]
qemu
backends/baum.c
static CharDriverState *qemu_chr_open_win_con(const char *id, ChardevBackend *backend, ChardevReturn *ret, Error **errp) { return qemu_chr_open_win_file(GetStdHandle(STD_OUTPU...
[ 0, 0 ]
qemu
hw/9pfs/codir.c
int v9fs_co_mkdir(V9fsState *s, char *name, mode_t mode, uid_t uid, gid_t gid) { int err; FsCred cred; cred_init(&cred); cred.fc_mode = mode; cred.fc_uid = uid; cred.fc_gid = gid; v9fs_co_run_in_worker( { err = s->ops->mkdir(&s->ctx, name, &cred); if (err < 0) { ...
[ 0, 0 ]
FFmpeg
libavformat/utils.c
static int try_decode_frame(AVStream *st, AVPacket *avpkt) { int16_t *samples; AVCodec *codec; int got_picture, data_size, ret = 0; AVFrame picture; if (!st->codec->codec) { codec = avcodec_find_decoder(st->codec->codec_id); if (!codec) return -1; ret = avcodec_open(st->codec, code...
[ 1, 0 ]
qemu
hw/s390x/s390-virtio-hcall.c
int s390_virtio_hypercall(CPUS390XState *env) { s390_virtio_fn fn = s390_diag500_table[env->regs[1]]; if (!fn) { return -EINVAL; } return fn(&env->regs[2]); }
[ 1, 0 ]
qemu
hw/display/vmware_vga.c
static inline void vmsvga_fill_rect(struct vmsvga_state_s *s, uint32_t c, int x, int y, int w, int h) { DisplaySurface *surface = qemu_console_surface(s->vga.con); int bypl = surface_stride(surface); int width = surface_bytes_per_pixel(surface) * w; int line = h; int...
[ 1, 0 ]
FFmpeg
libavcodec/atrac3.c
static void IMLT(float *pInput, float *pOutput, int odd_band) { int i; if (odd_band) { /** * Reverse the odd bands before IMDCT, this is an effect of the QMF transform * or it gives better compression to do it this way. * FIXME: It should be possible to handle this in ff_imdct_calc * for...
[ 1, 1 ]
FFmpeg
libavcodec/common.h
static void mpeg_decode_quant_matrix_extension(MpegEncContext *s) { int i, v, j; dprintf("matrix extension\n"); if (get_bits1(&s->gb)) { for (i = 0; i < 64; i++) { v = get_bits(&s->gb, 8); j = zigzag_direct[i]; s->intra_matrix[j] = v; s->chroma_intra_matrix[j] = v; } } ...
[ 1, 0 ]
qemu
target-arm/neon_helper.c
uint64_t HELPER(neon_abdl_s16)(uint32_t a, uint32_t b) { uint64_t tmp; uint64_t result; DO_ABD(result, a, b, int8_t); DO_ABD(tmp, a >> 8, b >> 8, int8_t); result |= tmp << 16; DO_ABD(tmp, a >> 16, b >> 16, int8_t); result |= tmp << 32; DO_ABD(tmp, a >> 24, b >> 24, int8_t); result |= tmp << ...
[ 1, 0 ]
FFmpeg
libavcodec/h264_loopfilter.c
static void av_always_inline filter_mb_edgev(uint8_t *pix, int stride, const int16_t bS[4], unsigned int qp, H264Context *h, int intra) { const int qp_bd_offset = 6 * (h->sps.bit_dep...
[ 1, 0 ]
qemu
hw/s390x/s390-virtio.c
void s390_machine_reset(void) { S390CPU *ipl_cpu = S390_CPU(qemu_get_cpu(0)); qemu_devices_reset(); s390_cmma_reset(); s390_crypto_reset(); /* all cpus are stopped - configure and start the ipl cpu only */ s390_ipl_prepare_cpu(ipl_cpu); s390_cpu_set_state(CPU_STATE_OPERATING, ipl_cpu); }
[ 1, 0 ]
qemu
hw/9pfs/virtio-9p.c
static void v9fs_getlock(void *opaque) { size_t offset = 7; struct stat stbuf; V9fsFidState *fidp; V9fsGetlock *glock; int32_t fid, err = 0; V9fsPDU *pdu = opaque; V9fsState *s = pdu->s; glock = g_malloc(sizeof(*glock)); pdu_unmarshal(pdu, offset, "dbqqds", &fid, &glock->type, &glock->start, ...
[ 1, 0 ]
qemu
hw/virtio/virtio-pci.c
static int virtio_pci_set_host_notifier_internal(VirtIOPCIProxy *proxy, int n, bool assign, bool set_handler) { VirtIODevice *vdev = virtio_bus_get_device(&proxy->bus); VirtQueue *vq = virtio_get_queue(vdev, n); ...
[ 1, 0 ]
qemu
linux-user/signal.c
long do_sigreturn(CPUS390XState *env) { sigframe *frame; abi_ulong frame_addr = env->regs[15]; target_sigset_t target_set; sigset_t set; trace_user_do_sigreturn(env, frame_addr); if (!lock_user_struct(VERIFY_READ, frame, frame_addr, 1)) { goto badframe; } __get_user(target_set.sig[0], &fram...
[ 1, 0 ]
qemu
net/vhost-user.c
static int net_vhost_check_net(void *opaque, QemuOpts *opts, Error **errp) { const char *name = opaque; const char *driver, *netdev; const char virtio_name[] = "virtio-net-"; driver = qemu_opt_get(opts, "driver"); netdev = qemu_opt_get(opts, "netdev"); if (!driver || !netdev) { return 0; } ...
[ 1, 0 ]
qemu
cputlb.c
static bool tlb_is_dirty_ram(CPUTLBEntry *tlbe) { return (tlbe->addr_write & (TLB_INVALID_MASK | TLB_MMIO | TLB_NOTDIRTY)) == 0; }
[ 1, 0 ]
qemu
hw/virtio/virtio.c
uint32_t virtio_config_readl(VirtIODevice *vdev, uint32_t addr) { VirtioDeviceClass *k = VIRTIO_DEVICE_GET_CLASS(vdev); uint32_t val; k->get_config(vdev, vdev->config); if (addr > (vdev->config_len - sizeof(val))) return (uint32_t)-1; val = ldl_p(vdev->config + addr); return val; }
[ 1, 0 ]
FFmpeg
libavformat/oggenc.c
static void ogg_write_pages(AVFormatContext *s, int flush) { OGGContext *ogg = s->priv_data; OGGPageList *next, *p; if (!ogg->page_list) return; for (p = ogg->page_list; p;) { OGGStreamContext *oggstream = s->streams[p->page.stream_index]->priv_data; if (oggstream->page_count < 2 &&...
[ 1, 0 ]
FFmpeg
libavformat/rtsp.c
void ff_rtsp_undo_setup(AVFormatContext *s, int send_packets) { RTSPState *rt = s->priv_data; int i; for (i = 0; i < rt->nb_rtsp_streams; i++) { RTSPStream *rtsp_st = rt->rtsp_streams[i]; if (!rtsp_st) continue; if (rtsp_st->transport_priv) { if (s->oformat) { AVFormatCon...
[ 1, 0 ]
qemu
include/qemu/bitops.h
static void memory_region_dispatch_write(MemoryRegion *mr, hwaddr addr, uint64_t data, unsigned size) { if (!memory_region_access_valid(mr, addr, size, true)) { return; /* FIXME: better...
[ 1, 1 ]
qemu
block.c
static int qcow_check(BlockDriverState *bs) { return qcow2_check_refcounts(bs); }
[ 1, 0 ]
qemu
hw/pl061.c
static void pl061_save(QEMUFile *f, void *opaque) { pl061_state *s = (pl061_state *)opaque; qemu_put_be32(f, s->locked); qemu_put_be32(f, s->data); qemu_put_be32(f, s->old_data); qemu_put_be32(f, s->dir); qemu_put_be32(f, s->isense); qemu_put_be32(f, s->ibe); qemu_put_be32(f, s->iev); qemu_p...
[ 0, 0 ]
qemu
target-mips/helper.c
static void mvp_init(CPUMIPSState *env, const mips_def_t *def) { env->mvp = qemu_mallocz(sizeof(CPUMIPSMVPContext)); /* MVPConf1 implemented, TLB sharable, no gating storage support, programmable cache partitioning implemented, number of allocatable and sharable TLB entries, MVP has allocatable TCs, ...
[ 1, 1 ]
qemu
hw/i386/acpi-build.c
static void i440fx_pcihost_get_pci_hole64_start(Object *obj, Visitor *v, const char *name, void *opaque, Error **errp) { PCIHostState *h = PCI_HOST_BRIDGE(obj); Range w64; pci_bus_get_w64_range(h->bus, &w64); ...
[ 0, 0 ]
qemu
block.c
void bdrv_release_named_dirty_bitmaps(BlockDriverState *bs) { bdrv_do_release_matching_dirty_bitmap(bs, NULL, true); }
[ 0, 0 ]
qemu
hw/ppc/spapr.c
int kvmppc_put_books_sregs(PowerPCCPU *cpu) { CPUPPCState *env = &cpu->env; struct kvm_sregs sregs; int i; sregs.pvr = env->spr[SPR_PVR]; sregs.u.s.sdr1 = env->spr[SPR_SDR1]; /* Sync SLB */ #ifdef TARGET_PPC64 for (i = 0; i < ARRAY_SIZE(env->slb); i++) { sregs.u.s.ppc64.slb[i].slbe = env->sl...
[ 0, 0 ]
qemu
include/exec/gen-icount.h
static void gen_brcond(DisasContext *dc, TCGCond cond, TCGv_i32 t0, TCGv_i32 t1, uint32_t offset) { int label = gen_new_label(); gen_advance_ccount(dc); tcg_gen_brcond_i32(cond, t0, t1, label); gen_jumpi_check_loop_end(dc, 0); gen_set_label(label); gen_jumpi(dc, dc->pc + offse...
[ 0, 0 ]
qemu
hw/usb/core.c
static void do_token_in(USBDevice *s, USBPacket *p) { int request, value, index; assert(p->ep->nr == 0); request = (s->setup_buf[0] << 8) | s->setup_buf[1]; value = (s->setup_buf[3] << 8) | s->setup_buf[2]; index = (s->setup_buf[5] << 8) | s->setup_buf[4]; switch (s->setup_state) { case SETUP_STAT...
[ 1, 0 ]
qemu
hw/net/net_rx_pkt.c
static bool net_tx_pkt_rebuild_payload(struct NetTxPkt *pkt) { size_t payload_len = iov_size(pkt->raw, pkt->raw_frags) - pkt->hdr_len; pkt->payload_frags = iov_copy(&pkt->vec[NET_TX_PKT_PL_START_FRAG], pkt->max_payload_frags, pkt->raw, pkt->raw_fr...
[ 1, 0 ]
FFmpeg
libavutil/frame.c
static int get_video_buffer(AVFrame *frame, int align) { const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(frame->format); int ret, i; if (!desc) return AVERROR(EINVAL); if ((ret = av_image_check_size(frame->width, frame->height, 0, NULL)) < 0) return ret; if (!frame->linesize[0]) { re...
[ 1, 0 ]
qemu
tcg/aarch64/tcg-target.inc.c
static void tcg_out_label(TCGContext *s, TCGLabel *l, tcg_insn_unit *ptr) { intptr_t value = (intptr_t)ptr; TCGRelocation *r; assert(!l->has_value); for (r = l->u.first_reloc; r != NULL; r = r->next) { patch_reloc(r->ptr, r->type, value, r->addend); } l->has_value = 1; l->u.value_ptr = ptr; }
[ 0, 0 ]
qemu
hw/ide/qdev.c
static char *sysbus_get_fw_dev_path(DeviceState *dev) { SysBusDevice *s = sysbus_from_qdev(dev); char path[40]; int off; off = snprintf(path, sizeof(path), "%s", qdev_fw_name(dev)); if (s->num_mmio) { snprintf(path + off, sizeof(path) - off, "@" TARGET_FMT_plx, s->mmio[0].addr); } ...
[ 1, 0 ]
qemu
docs/qapi-code-gen.txt
static void qmp_input_start_alternate(Visitor *v, const char *name, GenericAlternate **obj, size_t size, bool promote_int, Error **errp) { QmpInputVisitor *qiv = to_qiv(v); QObject *qobj = qmp_input_get_object(qiv, name, false, errp); ...
[ 0, 0 ]
qemu
block.c
BlockDriverState *bdrv_lookup_bs(const char *device, const char *node_name, Error **errp) { BlockBackend *blk; BlockDriverState *bs; if (device) { blk = blk_by_name(device); if (blk) { return blk_bs(blk); } } if (nod...
[ 0, 0 ]
qemu
ui/gtk.c
static gboolean gd_enter_event(GtkWidget *widget, GdkEventCrossing *crossing, gpointer opaque) { VirtualConsole *vc = opaque; GtkDisplayState *s = vc->s; if (!gd_is_grab_active(s) && gd_grab_on_hover(s)) { gd_grab_keyboard(vc); } return TRUE; }
[ 0, 0 ]
FFmpeg
libswresample/swresample.c
int64_t swr_next_pts(struct SwrContext *s, int64_t pts) { if (pts == INT64_MIN) return s->outpts; if (s->min_compensation >= FLT_MAX) { return (s->outpts = pts - swr_get_delay(s, s->in_sample_rate * (int64_t)s->out_sample_rate)); } else { ...
[ 1, 0 ]
qemu
hw/fw_cfg.c
void fw_cfg_add_bytes(FWCfgState *s, uint16_t key, uint8_t *data, uint32_t len) { int arch = !!(key & FW_CFG_ARCH_LOCAL); key &= FW_CFG_ENTRY_MASK; assert(key < FW_CFG_MAX_ENTRY); s->entries[arch][key].data = data; s->entries[arch][key].len = len; }
[ 1, 0 ]
qemu
hw/9pfs/9p-posix-acl.c
static int mp_dacl_removexattr(FsContext *ctx, const char *path, const char *name) { int ret; char *buffer; buffer = rpath(ctx, path); ret = lremovexattr(buffer, MAP_ACL_DEFAULT); if (ret == -1 && errno == ENODATA) { /* * We don't get ENODATA error when trying ...
[ 1, 0 ]
qemu
block/block-backend.c
static void process_incoming_migration_bh(void *opaque) { Error *local_err = NULL; MigrationIncomingState *mis = opaque; /* Make sure all file formats flush their mutable metadata */ bdrv_invalidate_cache_all(&local_err); migrate_set_state(&mis->state, MIGRATION_STATUS_ACTIVE, MIGRATION_ST...
[ 1, 0 ]
FFmpeg
libavcodec/png.h
static int decode_phys_chunk(AVCodecContext *avctx, PNGDecContext *s) { if (s->state & PNG_IDAT) { av_log(avctx, AV_LOG_ERROR, "pHYs after IDAT\n"); return AVERROR_INVALIDDATA; } avctx->sample_aspect_ratio.num = bytestream2_get_be32(&s->gb); avctx->sample_aspect_ratio.den = bytestream2_get_be32(&s...
[ 1, 0 ]
qemu
hw/net/lance.c
static int pci_pcnet_init(PCIDevice *pci_dev) { PCIPCNetState *d = PCI_PCNET(pci_dev); PCNetState *s = &d->state; uint8_t *pci_conf; #if 0 printf("sizeof(RMD)=%d, sizeof(TMD)=%d\n", sizeof(struct pcnet_RMD), sizeof(struct pcnet_TMD)); #endif pci_conf = pci_dev->config; pci_set_word(pci_c...
[ 1, 0 ]
qemu
block-migration.c
BlockDirtyInfoList *bdrv_query_dirty_bitmaps(BlockDriverState *bs) { BdrvDirtyBitmap *bm; BlockDirtyInfoList *list = NULL; BlockDirtyInfoList **plist = &list; QLIST_FOREACH(bm, &bs->dirty_bitmaps, list) { BlockDirtyInfo *info = g_malloc0(sizeof(BlockDirtyInfo)); BlockDirtyInfoList *entry = g_mall...
[ 1, 0 ]
qemu
xen-all.c
static void cpu_ioreq_move(ioreq_t *req) { int i, sign; sign = req->df ? -1 : 1; if (!req->data_is_ptr) { if (req->dir == IOREQ_READ) { for (i = 0; i < req->count; i++) { cpu_physical_memory_read( req->addr + (sign * i * (int64_t)req->size), (uint8_t *)&req->data...
[ 1, 0 ]
qemu
hw/scsi/virtio-scsi-dataplane.c
static int virtio_scsi_vring_init(VirtIOSCSI *s, VirtQueue *vq, int n) { BusState *qbus = BUS(qdev_get_parent_bus(DEVICE(s))); VirtioBusClass *k = VIRTIO_BUS_GET_CLASS(qbus); int rc; /* Set up virtqueue notify */ rc = k->set_host_notifier(qbus->parent, n, true); if (rc != 0) { fprintf(stderr, "v...
[ 1, 0 ]
qemu
dump.c
void qemu_get_guest_memory_mapping(MemoryMappingList *list, Error **errp) { CPUState *cpu, *first_paging_enabled_cpu; RAMBlock *block; ram_addr_t offset, length; first_paging_enabled_cpu = find_paging_enabled_cpu(first_cpu); if (first_paging_enabled_cpu) { for (cpu = first_paging_enabled_cpu; cpu !...
[ 1, 0 ]
qemu
bsd-user/qemu.h
static inline int cpu_gdb_index(CPUState *cpu) { #if defined(CONFIG_USER_ONLY) return cpu->host_tid; #else return cpu->cpu_index + 1; #endif }
[ 1, 0 ]
qemu
hw/esp.c
static int usb_msd_initfn(USBDevice *dev) { MSDState *s = DO_UPCAST(MSDState, dev, dev); if (!s->conf.dinfo || !s->conf.dinfo->bdrv) { error_report("usb-msd: drive property not set"); s->dev.speed = USB_SPEED_FULL; scsi_bus_new(&s->bus, &s->dev.qdev, 0, 1, usb_msd_command_complete); s->scsi_d...
[ 1, 0 ]
qemu
include/qemu/osdep.h
size_t qemu_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; } } return getpagesize(); }
[ 1, 0 ]
qemu
hw/block/onenand.c
static inline int onenand_prog_spare(OneNANDState *s, int sec, int secn, void *src) { int result = 0; if (secn > 0) { const uint8_t *sp = (const uint8_t *)src; uint8_t *dp = 0, *dpp = 0; if (s->blk_cur) { dp = g_malloc(512); if (!dp ||...
[ 1, 0 ]
FFmpeg
libavformat/ircamdec.c
static int ircam_read_header(AVFormatContext *s) { uint32_t magic, sample_rate, channels, tag; const AVCodecTag *tags; int le = -1, i; AVStream *st; magic = avio_rl32(s->pb); for (i = 0; i < 7; i++) { if (magic == table[i].magic) { le = table[i].is_le; break; } } if (le ==...
[ 1, 0 ]
qemu
target/i386/kvm.c
int kvm_arch_release_virq_post(int virq) { MSIRouteEntry *entry, *next; QLIST_FOREACH_SAFE(entry, &msi_route_list, list, next) { if (entry->virq == virq) { trace_kvm_x86_remove_msi_route(virq); QLIST_REMOVE(entry, list); break; } } return 0; }
[ 1, 0 ]
qemu
monitor.c
monitor_qapi_event_queue(QAPIEvent event, QDict *qdict, Error **errp) { MonitorQAPIEventConf *evconf; MonitorQAPIEventState *evstate; assert(event < QAPI_EVENT__MAX); evconf = &monitor_qapi_event_conf[event]; trace_monitor_protocol_event_queue(event, qdict, evconf->rate); qemu_mutex_lock(&monitor_loc...
[ 1, 0 ]
FFmpeg
libavcodec/ac3dec.c
static inline void downmix_2f_1r_to_stereo(float *samples) { int i; for (i = 0; i < 256; i++) { samples[i] += samples[i + 512]; samples[i + 256] += samples[i + 512]; samples[i + 512] = 0; } }
[ 0, 0 ]
FFmpeg
libavformat/rdt.c
static PayloadContext *h264_new_extradata(void) { PayloadContext *data = av_mallocz(sizeof(PayloadContext) + FF_INPUT_BUFFER_PADDING_SIZE); if (data) { data->cookie = MAGIC_COOKIE; } return data; }
[ 0, 0 ]
qemu
HACKING
static uint64_t exynos4210_pwm_read(void *opaque, target_phys_addr_t offset, unsigned size) { Exynos4210PWMState *s = (Exynos4210PWMState *)opaque; uint32_t value = 0; int index; switch (offset) { case TCFG0: case TCFG1: index = (offset - TCFG0) >> 2; val...
[ 1, 0 ]
qemu
block/nbd-client.c
static int nbd_co_receive_reply(NBDClientSession *s, NBDRequest *request, QEMUIOVector *qiov) { int ret; int i = HANDLE_TO_INDEX(s, request->handle); /* Wait until we're woken up by nbd_read_reply_entry. */ s->requests[i].receiving = true; ...
[ 1, 0 ]
qemu
acl.c
int qemu_aio_set_fd_handler(int fd, IOHandler *io_read, IOHandler *io_write, AioFlushHandler *io_flush, void *opaque) { AioHandler *node; node = find_aio_handler(fd); /* Are we deleting the fd h...
[ 0, 0 ]
qemu
block/Makefile.objs
static int vhdx_parse_log(BlockDriverState *bs, BDRVVHDXState *s) { int ret = 0; int i; VHDXHeader *hdr; hdr = s->headers[s->curr_header]; /* either the log guid, or log length is zero, * then a replay log is present */ for (i = 0; i < sizeof(hdr->log_guid.data4); i++) { ret |= hdr->log_guid...
[ 1, 0 ]
qemu
HACKING
static void pmac_ide_writeb(void *opaque, target_phys_addr_t addr, uint32_t val) { MACIOIDEState *d = opaque; addr = (addr & 0xFFF) >> 4; switch (addr) { case 1 ... 7: ide_ioport_write(&d->bus, addr, val); break; case 8: case 22: ide_cmd_write(&d->bus, 0, v...
[ 0, 0 ]
FFmpeg
doc/APIchanges
static int MPA_encode_frame(AVCodecContext *avctx, AVPacket *avpkt, const AVFrame *frame, int *got_packet_ptr) { MpegAudioContext *s = avctx->priv_data; const int16_t *samples = (const int16_t *)frame->data[0]; short smr[MPA_MAX_CHANNELS][SBLIMIT]; unsigned char bit_alloc[MPA_M...
[ 1, 0 ]
FFmpeg
libavcodec/hevc_ps.c
static int parse_ptl(HEVCContext *s, PTL *ptl, int max_num_sub_layers) { int i; HEVCLocalContext *lc = s->HEVClc; GetBitContext *gb = &lc->gb; decode_profile_tier_level(s, &ptl->general_PTL); ptl->general_PTL.level_idc = get_bits(gb, 8); for (i = 0; i < max_num_sub_layers - 1; i++) { ptl->sub_la...
[ 1, 0 ]
FFmpeg
libavcodec/h264.c
static void ff_h264_idct8_add4_mmx2(uint8_t *dst, const int *block_offset, DCTELEM *block, int stride, const uint8_t nnzc[6 * 8]) { int i; for (i = 0; i < 16; i += 4) { int nnz = nnzc[scan8[i]]; if (nnz) { if (nnz == 1 && blo...
[ 1, 0 ]
qemu
block.c
static void raw_aio_writev_scrubbed(void *opaque, int ret) { RawScrubberBounce *b = opaque; if (ret < 0) { b->cb(b->opaque, ret); } else { b->cb(b->opaque, ret + 512); } qemu_iovec_destroy(&b->qiov); qemu_free(b); }
[ 1, 0 ]
qemu
target-mips/dsp_helper.c
static inline uint32_t mipsdsp_sat32_sub(int32_t a, int32_t b, CPUMIPSState *env) { int32_t temp; temp = a - b; if (MIPSDSP_OVERFLOW(a, -b, temp, 0x80000000)) { if (a > 0) { temp = 0x7FFFFFFF; } else { temp = 0x80000000; } set_DSPContr...
[ 1, 0 ]
qemu
hw/9pfs/9p-proxy.c
static int proxy_mkdir(FsContext *fs_ctx, V9fsPath *dir_path, const char *name, FsCred *credp) { int retval; V9fsString fullname; v9fs_string_init(&fullname); v9fs_string_sprintf(&fullname, "%s/%s", dir_path->data, name); retval = v9fs_request(fs_ctx->private, T_MKDIR, NULL, &ful...
[ 1, 0 ]
FFmpeg
ffmpeg.c
static void compute_pts_dts(AVStream *st, int64_t *ppts, int64_t *pdts, int64_t timestamp) { int frame_delay; int64_t pts, dts; if (st->codec.codec_type == CODEC_TYPE_VIDEO && st->codec.max_b_frames != 0) { frame_delay = (st->codec.frame_rate_base * 90000LL) / ...
[ 1, 0 ]
qemu
hw/9pfs/9p-posix-acl.c
static int mp_pacl_setxattr(FsContext *ctx, const char *path, const char *name, void *value, size_t size, int flags) { char *buffer; int ret; buffer = rpath(ctx, path); ret = lsetxattr(buffer, MAP_ACL_ACCESS, value, size, flags); g_free(buffer); return ret; }
[ 1, 0 ]
FFmpeg
libavcodec/dv.c
static int dvvideo_decode_frame(AVCodecContext *avctx, void *data, int *data_size, uint8_t *buf, int buf_size) { DVVideoContext *s = avctx->priv_data; s->sys = dv_frame_profile(buf); if (!s->sys || buf_size < s->sys->frame_size) return -1;...
[ 1, 0 ]
qemu
target-m68k/translate.c
static inline void qemu_assert(int cond, const char *msg) { if (!cond) { fprintf(stderr, "badness: %s\n", msg); abort(); } }
[ 1, 0 ]
qemu
hw/qdev-properties.c
static int parse_uint32(DeviceState *dev, Property *prop, const char *str) { uint32_t *ptr = qdev_get_prop_ptr(dev, prop); const char *fmt; /* accept both hex and decimal */ fmt = strncasecmp(str, "0x", 2) == 0 ? "%" PRIx32 : "%" PRIu32; if (sscanf(str, fmt, ptr) != 1) return -EINVAL; return 0; ...
[ 1, 0 ]
qemu
docs/qapi-code-gen.txt
void visit_start_list(Visitor *v, const char *name, Error **errp) { if (!error_is_set(errp)) { v->start_list(v, name, errp); } }
[ 1, 0 ]
FFmpeg
doc/muxers.texi
static void mp3_update_xing(AVFormatContext *s) { MP3Context *mp3 = s->priv_data; int i; /* replace "Xing" identification string with "Info" for CBR files. */ if (!mp3->has_variable_bitrate) { avio_seek(s->pb, mp3->xing_offset, SEEK_SET); ffio_wfourcc(s->pb, "Info"); } avio_seek(s->pb, mp3->...
[ 1, 0 ]
FFmpeg
libav/mpeg.c
static void mpeg_decode_sequence_extension(MpegEncContext *s) { int horiz_size_ext, vert_size_ext; int bit_rate_ext, vbv_buf_ext, low_delay; int frame_rate_ext_n, frame_rate_ext_d; skip_bits(&s->gb, 8); /* profil and level */ skip_bits(&s->gb, 1); /* progressive_sequence */ skip_bits(&s->gb, 2); /* c...
[ 1, 1 ]
FFmpeg
cmdutils.c
static void do_audio_out(AVFormatContext *s, OutputStream *ost, AVFrame *frame) { AVCodecContext *enc = ost->enc_ctx; AVPacket pkt; int got_packet = 0; av_init_packet(&pkt); pkt.data = NULL; pkt.size = 0; if (!check_recording_time(ost)) return; if (frame->pts == A...
[ 1, 0 ]
FFmpeg
libavcodec/dxva2_mpeg2.c
static void mpeg_er_decode_mb(void *opaque, int ref, int mv_dir, int mv_type, int (*mv)[2][4][2], int mb_x, int mb_y, int mb_intra, int mb_skipped) { MpegEncContext *s = opaque; s->mv_dir = mv_dir; s->mv_type = mv_type; s->mb_intra = mb_intra; ...
[ 1, 0 ]
qemu
exec.c
void stl_phys_notdirty(AddressSpace *as, hwaddr addr, uint32_t val) { uint8_t *ptr; MemoryRegion *mr; hwaddr l = 4; hwaddr addr1; mr = address_space_translate(as, addr, &addr1, &l, true); if (l < 4 || !memory_access_is_direct(mr, true)) { io_mem_write(mr, addr1, v...
[ 1, 0 ]
qemu
migration/ram.c
static void migration_end(void) { if (migration_bitmap) { memory_global_dirty_log_stop(); g_free(migration_bitmap); migration_bitmap = NULL; } XBZRLE_cache_lock(); if (XBZRLE.cache) { cache_fini(XBZRLE.cache); g_free(XBZRLE.encoded_buf); g_free(XBZRLE.current_buf); XBZRLE....
[ 0, 0 ]
qemu
cpu-exec.c
static unsigned int dec_btst_r(DisasContext *dc) { TCGv l0; DIS(fprintf(logfile, "btst $r%u, $r%u\n", dc->op1, dc->op2)); cris_cc_mask(dc, CC_MASK_NZ); l0 = tcg_temp_local_new(TCG_TYPE_TL); cris_alu(dc, CC_OP_BTST, l0, cpu_R[dc->op2], cpu_R[dc->op1], 4); cris_update_cc_op(dc, CC_OP_FLA...
[ 0, 0 ]
qemu
block/qcow2-cluster.c
int qcow2_alloc_clusters_at(BlockDriverState *bs, uint64_t offset, int nb_clusters) { BDRVQcow2State *s = bs->opaque; uint64_t cluster_index, refcount; uint64_t i; int ret; assert(nb_clusters >= 0); if (nb_clusters == 0) { return 0; } do { /* Check how many...
[ 1, 0 ]
qemu
hw/acpi/aml-build.c
build_rsdp(GArray *rsdp_table, GArray *linker, unsigned rsdt) { AcpiRsdpDescriptor *rsdp = acpi_data_push(rsdp_table, sizeof *rsdp); bios_linker_loader_alloc(linker, ACPI_BUILD_RSDP_FILE, 16, true /* fseg memory */); memcpy(&rsdp->signature, "RSD PTR ", sizeof(rsdp->signature)); ...
[ 1, 0 ]
qemu
hw/net/net_rx_pkt.c
bool net_tx_pkt_add_raw_fragment(struct NetTxPkt *pkt, hwaddr pa, size_t len) { hwaddr mapped_len = 0; struct iovec *ventry; assert(pkt); assert(pkt->max_raw_frags > pkt->raw_frags); if (!len) { return true; } ventry = &pkt->raw[pkt->raw_frags]; mapped_len ...
[ 0, 0 ]
qemu
hw/e1000.c
static void e1000_reset(void *opaque) { E1000State *d = opaque; qemu_del_timer(d->autoneg_timer); memset(d->phy_reg, 0, sizeof d->phy_reg); memmove(d->phy_reg, phy_reg_init, sizeof phy_reg_init); memset(d->mac_reg, 0, sizeof d->mac_reg); memmove(d->mac_reg, mac_reg_init, sizeof mac_reg_init); d->r...
[ 1, 0 ]
qemu
bsd-user/main.c
static void handle_arg_log_filename(const char *arg) { qemu_set_log_filename(arg); }
[ 1, 0 ]