Projectname
large_stringclasses
15 values
Filepath
large_stringlengths
4
106
Function
large_stringlengths
11
3.45k
Label
list
FFmpeg
libavcodec/mjpegenc.c
static void encode_block(MpegEncContext *s, int16_t *block, int n) { int i, j, table_id; int component, dc, last_index, val, run; MJpegContext *m = s->mjpeg_ctx; /* DC coef */ component = (n <= 3 ? 0 : (n & 1) + 1); table_id = (n <= 3 ? 0 : 1); dc = block[0]; /* overflow is impossible */ val = ...
[ 1, 0 ]
FFmpeg
cmdutils.c
int opt_codec_debug(void *optctx, const char *opt, const char *arg) { av_log_set_level(AV_LOG_DEBUG); return opt_default(NULL, opt, arg); }
[ 0, 0 ]
FFmpeg
libavformat/aviobuf.c
static int put_v(ByteIOContext *bc, uint64_t val) { int i; // if (bytes_left(s)*8 < 9) // return -1; if (bytes_left(bc) < 1) return -1; val &= 0x7FFFFFFFFFFFFFFFULL; // FIXME can only encode upto 63 bits currently i = get_length(val); for (i -= 7; i > 0; i -= 7) { put_byte(bc, 0x80 | ...
[ 1, 1 ]
FFmpeg
libavformat/mov.c
static int mov_read_extradata(MOVContext *c, ByteIOContext *pb, MOVAtom atom) { AVStream *st = c->fc->streams[c->fc->nb_streams - 1]; uint64_t size = (uint64_t)st->codec->extradata_size + atom.size + 8 + FF_INPUT_BUFFER_PADDING_SIZE; uint8_t *buf; if (size > INT_MAX || (uint64_t)atom.size...
[ 1, 1 ]
qemu
net/tap-solaris.c
int tap_open(char *ifname, int ifname_size, int *vnet_hdr, int vnet_hdr_required, int mq_required, Error **errp) { /* FIXME error_setg(errp, ...) on failure */ char dev[10] = ""; int fd; if ((fd = tap_alloc(dev, sizeof(dev))) < 0) { fprintf(stderr, "Cannot allocate TAP device\n"); r...
[ 1, 1 ]
qemu
ui/vnc.c
static void vnc_colordepth(VncState *vs) { if (vnc_has_feature(vs, VNC_FEATURE_WMVI)) { /* Sending a WMVi message to notify the client*/ vnc_lock_output(vs); vnc_write_u8(vs, VNC_MSG_SERVER_FRAMEBUFFER_UPDATE); vnc_write_u8(vs, 0); vnc_write_u16(vs, 1); /* number of rects */ vnc_frameb...
[ 1, 0 ]
FFmpeg
libavcodec/dnxhddec.c
static void dnxhd_decode_dct_block_10_444(const DNXHDContext *ctx, RowContext *row, int n) { dnxhd_decode_dct_block(ctx, row, n, 6, 32, 6); }
[ 1, 0 ]
FFmpeg
libavformat/rtsp.c
int redir_open(AVFormatContext **ic_ptr, ByteIOContext *f) { char buf[4096], *q; int c; AVFormatContext *ic = NULL; /* parse each URL and try to open it */ c = url_fgetc(f); while (c != URL_EOF) { /* skip spaces */ for (;;) { if (!redir_isspace(c)) break; c = url_fget...
[ 1, 0 ]
qemu
hw/usb-bus.c
USBDevice *usbdevice_create(const char *cmdline) { USBBus *bus = usb_bus_find(-1 /* any */); DeviceInfo *info; USBDeviceInfo *usb; char driver[32]; const char *params; int len; params = strchr(cmdline, ':'); if (params) { params++; len = params - cmdline; if (len > sizeof(driver)...
[ 1, 0 ]
qemu
block.c
static int max7310_tx(I2CSlave *i2c, uint8_t data) { MAX7310State *s = MAX7310(i2c); uint8_t diff; int line; if (s->len++ > 1) { #ifdef VERBOSE printf("%s: message too long (%i bytes)\n", __FUNCTION__, s->len); #endif return 1; } if (s->i2c_command_byte) { s->command = data; s->i...
[ 0, 0 ]
qemu
hw/ide/core.c
static int ide_drive_pio_post_load(void *opaque, int version_id) { IDEState *s = opaque; if (s->end_transfer_fn_idx < 0 || s->end_transfer_fn_idx > ARRAY_SIZE(transfer_end_table)) { return -EINVAL; } s->end_transfer_func = transfer_end_table[s->end_transfer_fn_idx]; s->data_ptr = s->io_buffer...
[ 1, 0 ]
qemu
block/qapi.c
static void test_visitor_in_native_list_int16(TestInputVisitorData *data, const void *unused) { test_native_list_integer_helper(data, unused, USER_DEF_NATIVE_LIST_UNION_KIND_S16); }
[ 0, 0 ]
qemu
linux-user/main.c
int get_osversion(void) { static int osversion; struct new_utsname buf; const char *s; int i, n, tmp; if (osversion) return osversion; if (qemu_uname_release && *qemu_uname_release) { s = qemu_uname_release; } else { if (sys_uname(&buf)) return 0; s = buf.release; } ...
[ 0, 0 ]
qemu
net/colo-compare.c
static int colo_packet_compare_common(Packet *ppkt, Packet *spkt) { trace_colo_compare_ip_info(ppkt->size, inet_ntoa(ppkt->ip->ip_src), inet_ntoa(ppkt->ip->ip_dst), spkt->size, inet_ntoa(spkt->ip->ip_src), inet_ntoa(spkt->ip->...
[ 0, 1 ]
qemu
hw/scsi/lsi53c895a.c
static int scsi_initfn(SCSIDevice *dev) { SCSIDiskState *s = DO_UPCAST(SCSIDiskState, qdev, dev); Error *err = NULL; if (!s->qdev.conf.bs) { error_report("drive property not set"); return -1; } if (!(s->features & (1 << SCSI_DISK_F_REMOVABLE)) && !bdrv_is_inserted(s->qdev.conf.bs)) { ...
[ 0, 0 ]
qemu
memory.c
static void access_with_adjusted_size(hwaddr addr, uint64_t *value, unsigned size, unsigned access_size_min, unsigned access_size_max, ...
[ 1, 1 ]
qemu
target-i386/kvm.c
static int kvm_put_msr_feature_control(X86CPU *cpu) { struct { struct kvm_msrs info; struct kvm_msr_entry entry; } msr_data; kvm_msr_entry_set(&msr_data.entry, MSR_IA32_FEATURE_CONTROL, cpu->env.msr_ia32_feature_control); msr_data.info.nmsrs = 1; return kvm_vcpu_ioctl(CPU(...
[ 0, 0 ]
qemu
tests/numa-test.c
static void aarch64_numa_cpu(const void *data) { char *cli; QDict *resp; QList *cpus; const QObject *e; cli = make_cli(data, "-smp 2 " "-numa node,nodeid=0 -numa node,nodeid=1 " "-numa cpu,node-id=1,thread-id=0 " "-numa cpu,node-id=...
[ 1, 0 ]
qemu
configure
static void qemu_kvm_eat_signals(CPUState *env) { struct timespec ts = {0, 0}; siginfo_t siginfo; sigset_t waitset; sigset_t chkset; int r; sigemptyset(&waitset); sigaddset(&waitset, SIG_IPI); sigaddset(&waitset, SIGBUS); do { r = sigtimedwait(&waitset, &siginfo, &ts); if (r == -1 ...
[ 1, 0 ]
FFmpeg
cmdutils.c
int cmdutils_read_file(const char *filename, char **bufptr, size_t *size) { int ret; FILE *f = fopen(filename, "rb"); if (!f) { av_log(NULL, AV_LOG_ERROR, "Cannot read file '%s': %s\n", filename, strerror(errno)); return AVERROR(errno); } fseek(f, 0, SEEK_END); *size = ftell(f); ...
[ 1, 0 ]
qemu
slirp/arp_table.c
void arp_table_add(Slirp *slirp, uint32_t ip_addr, uint8_t ethaddr[ETH_ALEN]) { const uint32_t broadcast_addr = ~slirp->vnetwork_mask.s_addr | slirp->vnetwork_addr.s_addr; ArpTable *arptbl = &slirp->arp_table; int i; DEBUG_CALL("arp_table_add"); DEBUG_ARG("ip = 0x%x", ip_addr); DEBUG_ARGS((dfd...
[ 1, 0 ]
qemu
target-ppc/cpu.h
void do_fctiwz(void) { union { double d; uint64_t i; } p; /* XXX: higher bits are not supposed to be significant. * to make tests easier, return the same as a real PowerPC 750 (aka G3) */ p.i = float64_to_int32_round_to_zero(FT0, &env->fp_status); p.i |= 0xFFF80000ULL << 32; FT...
[ 1, 1 ]
qemu
hw/acpi/piix4.c
static void l2x0_class_init(ObjectClass *klass, void *data) { SysBusDeviceClass *k = SYS_BUS_DEVICE_CLASS(klass); DeviceClass *dc = DEVICE_CLASS(klass); k->init = l2x0_priv_init; dc->vmsd = &vmstate_l2x0; dc->no_user = 1; dc->props = l2x0_properties; dc->reset = l2x0_priv_reset; }
[ 1, 0 ]
FFmpeg
libavformat/os_support.c
static int tcp_write(URLContext *h, const uint8_t *buf, int size) { TCPContext *s = h->priv_data; int ret, size1, fd_max, len; fd_set wfds; struct timeval tv; size1 = size; while (size > 0) { if (url_interrupt_cb()) return AVERROR(EINTR); fd_max = s->fd; FD_ZERO(&wfds); FD_...
[ 1, 0 ]
qemu
hw/net/rtl8139.c
static void rtl8139_cplus_transmit(RTL8139State *s) { int txcount = 0; while (rtl8139_cplus_transmit_one(s)) { ++txcount; } /* Mark transfer completed */ if (!txcount) { DPRINTF("C+ mode : transmitter queue stalled, current TxDesc = %d\n", s->currCPlusTxDesc); } else ...
[ 0, 0 ]
qemu
hw/9pfs/cofs.c
static int local_utimensat(FsContext *s, V9fsPath *fs_path, const struct timespec *buf) { char buffer[PATH_MAX]; char *path = fs_path->data; return qemu_utimens(rpath(s, path, buffer), buf); }
[ 0, 0 ]
FFmpeg
libavformat/aiffdec.c
static void id3v2_read_internal(AVIOContext *pb, AVDictionary **metadata, AVFormatContext *s, const char *magic, ID3v2ExtraMeta **extra_meta) { int len, ret; uint8_t buf[ID3v2_HEADER_SIZE]; int found_header; int64_t off; do { /* save...
[ 0, 0 ]
qemu
target-xtensa/cpu.c
int xtensa_get_physical_addr(CPUXtensaState *env, bool update_tlb, uint32_t vaddr, int is_write, int mmu_idx, uint32_t *paddr, uint32_t *page_size, unsigned *access) { if (xtensa_option_enabled(env->config, XTENSA_OPTION_MMU)) ...
[ 1, 0 ]
qemu
hw/ppc/spapr_drc.c
sPAPRDRConnector *spapr_drc_by_index(uint32_t index) { Object *obj; char name[256]; snprintf(name, sizeof(name), "%s/%x", DRC_CONTAINER_PATH, index); obj = object_resolve_path(name, NULL); return !obj ? NULL : SPAPR_DR_CONNECTOR(obj); }
[ 1, 0 ]
qemu
slirp/bootp.c
static int tftp_send_oack(struct tftp_session *spt, const char *keys[], uint32_t values[], int nb, struct tftp_t *recv_tp) { struct sockaddr_in saddr, daddr; struct mbuf *m; struct tftp_t *tp; int i, n = 0; m = m_get(spt->slirp); if (!m) retu...
[ 1, 0 ]
FFmpeg
ffmpeg.c
void check_audio_video_inputs(int *has_video_ptr, int *has_audio_ptr) { int has_video, has_audio, i, j; AVFormatContext *ic; has_video = 0; has_audio = 0; for (j = 0; j < nb_input_files; j++) { ic = input_files[j]; for (i = 0; i < ic->nb_streams; i++) { AVCodecContext *enc = &ic->stream...
[ 0, 0 ]
qemu
hw/char/cadence_uart.c
static int uart_can_receive(void *opaque) { UartState *s = (UartState *)opaque; return RX_FIFO_SIZE - s->rx_count; }
[ 0, 0 ]
qemu
hw/s390-virtio-bus.c
static uint32_t syborg_virtio_readl(void *opaque, target_phys_addr_t offset) { SyborgVirtIOProxy *s = opaque; VirtIODevice *vdev = s->vdev; uint32_t ret; DPRINTF("readl 0x%x\n", (int)offset); if (offset >= SYBORG_VIRTIO_CONFIG) { return virtio_config_readl(vdev, offset - SYBORG_VIRTIO_CONFIG); } ...
[ 1, 0 ]
qemu
hw/virtio.c
static bool vring_notify(VirtIODevice *vdev, VirtQueue *vq) { uint16_t old, new; bool v; /* Always notify when queue is empty (when feature acknowledge) */ if (((vdev->guest_features & (1 << VIRTIO_F_NOTIFY_ON_EMPTY)) && !vq->inuse && vring_avail_idx(vq) == vq->last_avail_idx)) { return true; ...
[ 1, 0 ]
qemu
hw/qdev-properties.c
static void set_int16(Object *obj, Visitor *v, void *opaque, const char *name, Error **errp) { DeviceState *dev = DEVICE(obj); Property *prop = opaque; int16_t *ptr = qdev_get_prop_ptr(dev, prop); Error *local_err = NULL; int64_t value; if (dev->state != DEV_STATE_CREATED) { ...
[ 1, 0 ]
qemu
savevm.c
size_t ram_control_save_page(QEMUFile *f, ram_addr_t block_offset, ram_addr_t offset, size_t size, int *bytes_sent) { if (f->ops->save_page) { int ret = f->ops->save_page(f, f->opaque, block_offset, offset, size, bytes_sent); if (ret != RAM_SA...
[ 1, 0 ]
FFmpeg
libavformat/allformats.c
static int gif_read_packet(AVFormatContext *s1, AVPacket *pkt) { GifState *s = s1->priv_data; int ret; ret = gif_parse_next_image(s); if (ret < 0) return ret; /* XXX: avoid copying */ if (av_new_packet(pkt, s->screen_width * s->screen_height * 3)) { return AVERRO...
[ 1, 1 ]
qemu
hw/ppc/e500.c
static XICSState *xics_system_init(int nr_servers, int nr_irqs) { XICSState *icp = NULL; if (kvm_enabled()) { QemuOpts *machine_opts = qemu_get_machine_opts(); bool irqchip_allowed = qemu_opt_get_bool(machine_opts, "kernel_irqchip", true); bool irqchip...
[ 1, 0 ]
FFmpeg
libavformat/mov.c
static int mov_read_hdlr(MOVContext *c, ByteIOContext *pb, MOVAtom atom) { AVStream *st = c->fc->streams[c->fc->nb_streams - 1]; uint32_t type; uint32_t ctype; get_byte(pb); /* version */ get_be24(pb); /* flags */ /* component type */ ctype = get_le32(pb); type = get_le32(pb); /* component subt...
[ 1, 0 ]
FFmpeg
libavcodec/qsvdec.c
static void close_decoder(QSVContext *q) { QSVFrame *cur; if (q->session) MFXVideoDECODE_Close(q->session); while (q->async_fifo && av_fifo_size(q->async_fifo)) { QSVFrame *out_frame; mfxSyncPoint *sync; av_fifo_generic_read(q->async_fifo, &out_frame, sizeof(out_frame), NULL); av_fifo...
[ 1, 0 ]
FFmpeg
libavcodec/apedec.c
static inline int ape_decode_value_3860(APEContext *ctx, GetBitContext *gb, APERice *rice) { unsigned int x, overflow; overflow = get_unary(gb, 1, get_bits_left(gb)); if (ctx->fileversion > 3880) { while (overflow >= 16) { overflow -= 16; rice->k += ...
[ 1, 0 ]
FFmpeg
ffmpeg_opt.c
static void assert_file_overwrite(const char *filename) { if (file_overwrite && no_file_overwrite) { fprintf(stderr, "Error, both -y and -n supplied. Exiting.\n"); exit_program(1); } if (!file_overwrite && (strchr(filename, ':') == NULL || filename[1] == ':' || av_strstart(filename, "f...
[ 1, 0 ]
qemu
hw/ide/qdev.c
static int ide_qdev_init(DeviceState *qdev, DeviceInfo *base) { IDEDevice *dev = DO_UPCAST(IDEDevice, qdev, qdev); IDEDeviceInfo *info = DO_UPCAST(IDEDeviceInfo, qdev, base); IDEBus *bus = DO_UPCAST(IDEBus, qbus, qdev->parent_bus); if (!dev->conf.bs) { fprintf(stderr, "%s: no drive specified\n", qdev-...
[ 1, 0 ]
qemu
hw/ds1338.c
static int ds1338_send(I2CSlave *i2c, uint8_t data) { DS1338State *s = FROM_I2C_SLAVE(DS1338State, i2c); if (s->addr_byte) { s->ptr = data; s->addr_byte = 0; return 0; } s->nvram[s->ptr - 8] = data; if (data < 8) { qemu_get_timedate(&s->now, s->offset); switch (data) { case ...
[ 1, 1 ]
qemu
block/Makefile.objs
static int cow_probe(const uint8_t *buf, int buf_size, const char *filename) { const struct cow_header_v2 *cow_header = (const void *)buf; if (buf_size >= sizeof(struct cow_header_v2) && be32_to_cpu(cow_header->magic) == COW_MAGIC && be32_to_cpu(cow_header->version) == COW_VERSION) return 100;...
[ 1, 0 ]
qemu
buffered_file.c
static void kbd_send_chars(void *opaque) { TextConsole *s = opaque; int len; uint8_t buf[16]; len = qemu_chr_can_read(s->chr); if (len > s->out_fifo.count) len = s->out_fifo.count; if (len > 0) { if (len > sizeof(buf)) len = sizeof(buf); qemu_fifo_read(&s->out_fifo, buf, len); ...
[ 1, 1 ]
qemu
block/dirty-bitmap.c
void bdrv_dirty_bitmap_deserialize_ones(BdrvDirtyBitmap *bitmap, uint64_t start, uint64_t count, bool finish) { hbitmap_deserialize_ones(bitmap->bitmap, start, count, finish); }
[ 0, 0 ]
qemu
slirp/Makefile.objs
void slirp_input(Slirp *slirp, const uint8_t *pkt, int pkt_len) { struct mbuf *m; int proto; if (pkt_len < ETH_HLEN) return; proto = ntohs(*(uint16_t *)(pkt + 12)); switch (proto) { case ETH_P_ARP: arp_input(slirp, pkt, pkt_len); break; case ETH_P_IP: m = m_get(slirp); if ...
[ 1, 0 ]
qemu
block/blkdebug.c
static int blkdebug_co_flush(BlockDriverState *bs) { BDRVBlkdebugState *s = bs->opaque; BlkdebugRule *rule = NULL; QSIMPLEQ_FOREACH(rule, &s->active_rules, active_next) { if (rule->options.inject.offset == -1) { break; } } if (rule && rule->options.inject.error) { return inject_error...
[ 1, 0 ]
FFmpeg
libavcodec/aac.c
static int decode_ics(AACContext *ac, SingleChannelElement *sce, GetBitContext *gb, int common_window, int scale_flag) { Pulse pulse; TemporalNoiseShaping *tns = &sce->tns; IndividualChannelStream *ics = &sce->ics; float *out = sce->coeffs; int global_gain, pulse_present = 0; /* ...
[ 1, 0 ]
qemu
Makefile.objs
static ssize_t buffered_flush(QEMUFileBuffered *s) { size_t offset = 0; ssize_t ret = 0; DPRINTF("flushing %zu byte(s) of data\n", s->buffer_size); while (s->bytes_xfer < s->xfer_limit && offset < s->buffer_size) { size_t to_send = MIN(s->buffer_size - offset, s->xfer_limit - s->bytes_xfer); ...
[ 1, 0 ]
qemu
block/block-backend.c
static int ide_handle_rw_error(IDEState *s, int error, int op) { bool is_read = (op & IDE_RETRY_READ) != 0; BlockErrorAction action = bdrv_get_error_action(s->bs, is_read, error); if (action == BLOCK_ERROR_ACTION_STOP) { s->bus->dma->ops->set_unit(s->bus->dma, s->unit); s->bus->error_status = op; ...
[ 1, 0 ]
FFmpeg
libavcodec/ppc/vc1dsp_altivec.c
void ff_vc1dsp_init_altivec(VC1DSPContext *dsp) { if (!(av_get_cpu_flags() & AV_CPU_FLAG_ALTIVEC)) return; dsp->vc1_inv_trans_8x8 = vc1_inv_trans_8x8_altivec; dsp->vc1_inv_trans_8x4 = vc1_inv_trans_8x4_altivec; dsp->put_no_rnd_vc1_chroma_pixels_tab[0] = put_no_rnd_vc1_chroma_mc8_altivec; dsp->avg_n...
[ 0, 0 ]
qemu
block/iscsi.c
iscsi_aio_flush(BlockDriverState *bs, BlockDriverCompletionFunc *cb, void *opaque) { IscsiLun *iscsilun = bs->opaque; struct iscsi_context *iscsi = iscsilun->iscsi; IscsiAIOCB *acb; acb = qemu_aio_get(&iscsi_aiocb_info, bs, cb, opaque); acb->iscsilun = iscsilun; acb->canceled = 0; ...
[ 0, 0 ]
qemu
block/block-backend.c
static void scsi_block_realize(SCSIDevice *dev, Error **errp) { SCSIDiskState *s = DO_UPCAST(SCSIDiskState, qdev, dev); int sg_version; int rc; if (!s->qdev.conf.bs) { error_setg(errp, "drive property not set"); return; } /* check we are using a driver managing SG_IO (version 3 and after) */...
[ 1, 1 ]
qemu
darwin-user/main.c
static void init_proc_460(CPUPPCState *env) { /* Time base */ gen_tbl(env); gen_spr_BookE(env); gen_spr_440(env); spr_register(env, SPR_BOOKE_MCSR, "MCSR", SPR_NOACCESS, SPR_NOACCESS, &spr_read_generic, &spr_write_generic, 0x00000000); spr_register(env,...
[ 0, 1 ]
qemu
hw/xen/xen_pt.h
static int xen_pt_status_reg_init(XenPCIPassthroughState *s, XenPTRegInfo *reg, uint32_t real_offset, uint32_t *data) { XenPTRegGroup *reg_grp_entry = NULL; XenPTReg *reg_entry = NULL; uint32_t reg_field = 0; /* find Header register grou...
[ 0, 0 ]
FFmpeg
libavcodec/h264.c
int ff_alloc_picture(MpegEncContext *s, Picture *pic, int shared) { int i, ret; if (shared) { assert(pic->f.data[0]); pic->shared = 1; } else { assert(!pic->f.data[0]); if (alloc_frame_buffer(s, pic) < 0) return -1; s->linesize = pic->f.linesize[0]; s->uvlinesize = pic->f....
[ 1, 0 ]
qemu
ui/console.c
static DisplaySurface *qemu_create_dummy_surface(void) { static const char msg[] = "This VM has no graphic display device."; DisplaySurface *surface = qemu_create_displaysurface(640, 480); pixman_color_t bg = color_table_rgb[0][COLOR_BLACK]; pixman_color_t fg = color_table_rgb[0][COLOR_WHITE]; pi...
[ 1, 0 ]
qemu
block.c
static int nfs_file_open(BlockDriverState *bs, QDict *options, int flags, Error **errp) { NFSClient *client = bs->opaque; int64_t ret; QemuOpts *opts; Error *local_err = NULL; opts = qemu_opts_create(&runtime_opts, NULL, 0, &error_abort); qemu_opts_absorb_qdict(opts, options,...
[ 0, 0 ]
qemu
MAINTAINERS
static void restore_native_fp_fxrstor(CPUState *env) { struct fpxstate *fp = &fpx1; int i, j, fptag; fp->fpuc = env->fpuc; fp->fpus = (env->fpus & ~0x3800) | (env->fpstt & 0x7) << 11; fptag = 0; for (i = 0; i < 8; i++) fptag |= (env->fptags[i] << i); fp->fptag = fptag ^ 0xff; j = env->fpst...
[ 1, 1 ]
qemu
hw/xen_platform.c
static uint32_t platform_mmio_read(ReadWriteHandler *handler, pcibus_t addr, int len) { DPRINTF("Warning: attempted read from physical address " "0x" TARGET_FMT_plx " in xen platform mmio space\n", addr); return 0; }
[ 0, 0 ]
qemu
target-ppc/fpu_helper.c
void helper_store_fpscr(CPUPPCState *env, uint64_t arg, uint32_t mask) { /* * We use only the 32 LSB of the incoming fpr */ uint32_t prev, new; int i; prev = env->fpscr; new = (uint32_t)arg; new &= ~0x60000000; new |= prev & 0x60000000; for (i = 0; i < 8; i++) { if (mask & (1 << i)...
[ 1, 1 ]
qemu
Makefile.objs
void timerlistgroup_init(QEMUTimerListGroup *tlg, QEMUTimerListNotifyCB *cb, void *opaque) { QEMUClockType type; for (type = 0; type < QEMU_CLOCK_MAX; type++) { tlg->tl[type] = timerlist_new(type, cb, opaque); } }
[ 0, 0 ]
qemu
HACKING
static struct dpll_ctl_s *omap_dpll_init(MemoryRegion *memory, target_phys_addr_t base, omap_clk clk) { struct dpll_ctl_s *s = g_malloc0(sizeof(*s)); memory_region_init_io(&s->iomem, &omap_dpll_ops, s, "omap-dpll", 0x100); s->dpll = clk; omap_dpll_reset(s); memo...
[ 0, 0 ]
qemu
block/qapi.c
static void qmp_output_complete(Visitor *v, void *opaque) { QmpOutputVisitor *qov = to_qov(v); /* A visit must have occurred, with each start paired with end. */ assert(qov->root && QSLIST_EMPTY(&qov->stack)); assert(opaque == qov->result); qobject_incref(qov->root); *qov->result = qov->root; qov...
[ 1, 0 ]
FFmpeg
libavformat/rmdec.c
ff_rm_retrieve_cache(AVFormatContext *s, AVIOContext *pb, AVStream *st, RMStream *ast, AVPacket *pkt) { RMDemuxContext *rm = s->priv_data; assert(rm->audio_pkt_cnt > 0); if (st->codec->codec_id == CODEC_ID_AAC) av_get_packet( pb, pkt, ast->sub_packet_lengths[ast->sub...
[ 1, 1 ]
qemu
hw/block/fdc.c
static void ioapic_class_init(ObjectClass *klass, void *data) { IOAPICCommonClass *k = IOAPIC_COMMON_CLASS(klass); DeviceClass *dc = DEVICE_CLASS(klass); k->realize = ioapic_realize; *If APIC is in kernel, we need to update the kernel cache after *migration, otherwise first 24 gsi ro...
[ 1, 0 ]
qemu
target-arm/translate.c
static inline void iwmmxt_store_creg(int reg, TCGv var) { tcg_gen_st_i32(var, cpu_env, offsetof(CPUState, iwmmxt.cregs[reg])); }
[ 1, 0 ]
qemu
qemu-nbd.c
static gboolean nbd_accept(QIOChannel *ioc, GIOCondition cond, gpointer opaque) { QIOChannelSocket *cioc; cioc = qio_channel_socket_accept(QIO_CHANNEL_SOCKET(ioc), NULL); if (!cioc) { return TRUE; } if (state >= TERMINATE) { object_unref(OBJECT(cioc)); r...
[ 0, 0 ]
qemu
block/sheepdog.c
static int read_object(int fd, char *buf, uint64_t oid, int copies, unsigned int datalen, uint64_t offset, bool cache) { return read_write_object(fd, buf, oid, copies, datalen, offset, false, false, cache); }
[ 0, 0 ]
qemu
util/qemu-option.c
bool is_valid_option_list(const char *param) { size_t buflen = strlen(param) + 1; char *buf = g_malloc(buflen); const char *p = param; bool result = true; while (*p) { p = get_opt_value(buf, buflen, p); if (*p && !*++p) { result = false; goto out; } if (!*buf || *buf == ...
[ 1, 0 ]
qemu
target-mips/op_helper.c
target_ulong helper_rdhwr_performance(CPUMIPSState *env) { check_hwrena(env, 4); return env->CP0_Performance0; }
[ 1, 0 ]
qemu
hw/openpic.c
static void openpic_reset(DeviceState *d) { OpenPICState *opp = FROM_SYSBUS(typeof(*opp), sysbus_from_qdev(d)); int i; opp->glbc = GLBC_RESET; /* Initialise controller registers */ opp->frep = ((opp->nb_irqs - 1) << FREP_NIRQ_SHIFT) | ((opp->nb_cpus - 1) << FREP_NCPU_SHIFT) | ...
[ 1, 0 ]
qemu
block/rbd.c
static void rbd_aio_bh_cb(void *opaque) { RBDAIOCB *acb = opaque; if (acb->cmd == RBD_AIO_READ) { qemu_iovec_from_buf(acb->qiov, 0, acb->bounce, acb->qiov->size); } qemu_vfree(acb->bounce); acb->common.cb(acb->common.opaque, (acb->ret > 0 ? 0 : acb->ret)); qemu_bh_delete(acb->bh); acb->bh = NU...
[ 1, 0 ]
qemu
net/l2tpv3.c
static void net_l2tpv3_cleanup(NetClientState *nc) { NetL2TPV3State *s = DO_UPCAST(NetL2TPV3State, nc, nc); qemu_purge_queued_packets(nc); l2tpv3_read_poll(s, false); l2tpv3_write_poll(s, false); if (s->fd > 0) { close(s->fd); } destroy_vector(s->msgvec, MAX_L2TPV3_MSGCNT, IOVSIZE); g_free(...
[ 1, 0 ]
qemu
aio.c
static AioHandler *find_aio_handler(int fd) { AioHandler *node; LIST_FOREACH(node, &aio_handlers, node) { if (node->fd == fd) return node; } return NULL; }
[ 1, 0 ]
FFmpeg
libavcodec/eacmv.c
static void cmv_process_header(CmvContext *s, const uint8_t *buf, const uint8_t *buf_end) { int pal_start, pal_count, i; if (buf + 16 >= buf_end) { av_log(s->avctx, AV_LOG_WARNING, "truncated header\n"); return; } s->width = AV_RL16(&buf[4]); s->height = AV_RL16(&...
[ 1, 0 ]
FFmpeg
libswscale/output.c
yuv2422_2_c_template(SwsContext *c, const int16_t *buf[2], const int16_t *ubuf[2], const int16_t *vbuf[2], const int16_t *abuf[2], uint8_t *dest, int dstW, int yalpha, int uvalpha, int y, enum PixelFormat target) { const int16_t *buf0 = buf[0], *buf1 = bu...
[ 1, 0 ]
FFmpeg
Makefile
const char *avutil_configuration(void) { return FFMPEG_CONFIGURATION; }
[ 0, 0 ]
FFmpeg
libavcodec/binkidct.c
void ff_bink_idct_put_c(uint8_t *dest, int linesize, DCTELEM *block) { int i; DCTELEM temp[64]; for (i = 0; i < 8; i++) bink_idct_col(&temp[i], &block[i]); for (i = 0; i < 8; i++) { IDCT_ROW((&dest[i * linesize]), (&temp[8 * i])); } }
[ 1, 0 ]
qemu
hw/qdev-properties.c
static int parse_pci_devfn(DeviceState *dev, Property *prop, const char *str) { uint32_t *ptr = qdev_get_prop_ptr(dev, prop); unsigned int slot, fn, n; if (sscanf(str, "%x.%x%n", &slot, &fn, &n) != 2) { fn = 0; if (sscanf(str, "%x%n", &slot, &n) != 1) { return -EINVAL; } } if (str[n]...
[ 1, 0 ]
FFmpeg
libavformat/nsvdec.c
static int nsv_read_header(AVFormatContext *s) { NSVContext *nsv = s->priv_data; int i, err; av_dlog(s, "%s()\n", __FUNCTION__); av_dlog(s, "filename '%s'\n", s->filename); nsv->state = NSV_UNSYNC; nsv->ahead[0].data = nsv->ahead[1].data = NULL; for (i = 0; i < NSV_MAX_RESYNC_TRIES; i++) { if...
[ 1, 0 ]
qemu
hw/ide/atapi.c
static void cd_read_sector_cb(void *opaque, int ret) { IDEState *s = opaque; block_acct_done(blk_get_stats(s->blk), &s->acct); #ifdef DEBUG_IDE_ATAPI printf("cd_read_sector_cb: lba=%d ret=%d\n", s->lba, ret); #endif if (ret < 0) { ide_atapi_io_error(s, ret); return; } if (s->cd_sector_size...
[ 1, 0 ]
FFmpeg
libavcodec/flac_parser.c
static int get_best_header(FLACParseContext *fpc, const uint8_t **poutbuf, int *poutbuf_size) { FLACHeaderMarker *header = fpc->best_header; FLACHeaderMarker *child = header->best_child; if (!child) { *poutbuf_size = av_fifo_size(fpc->fifo_buf) - header->offset; } else { ...
[ 1, 0 ]
qemu
hw/s390x/virtio-ccw.c
void virtio_bus_device_plugged(VirtIODevice *vdev, Error **errp) { DeviceState *qdev = DEVICE(vdev); BusState *qbus = BUS(qdev_get_parent_bus(qdev)); VirtioBusState *bus = VIRTIO_BUS(qbus); VirtioBusClass *klass = VIRTIO_BUS_GET_CLASS(bus); VirtioDeviceClass *vdc = VIRTIO_DEVICE_GET_CLASS(vdev); DPRI...
[ 0, 0 ]
qemu
Makefile.objs
GSource *aio_get_g_source(AioContext *ctx) { g_source_ref(&ctx->source); return &ctx->source; }
[ 0, 0 ]
qemu
default-configs/i386-softmmu.mak
int pci_drive_hot_add(Monitor *mon, const QDict *qdict, DriveInfo *dinfo) { int dom, pci_bus; unsigned slot; PCIDevice *dev; const char *pci_addr = qdict_get_str(qdict, "pci_addr"); switch (dinfo->type) { case IF_SCSI: if (pci_read_devaddr(mon, pci_addr, &dom, &pci_bus, &slot)) { goto err...
[ 0, 0 ]
qemu
fsdev/virtio-9p-marshal.c
static void v9fs_clunk(void *opaque) { int err; int32_t fid; size_t offset = 7; V9fsFidState *fidp; V9fsPDU *pdu = opaque; V9fsState *s = pdu->s; pdu_unmarshal(pdu, offset, "d", &fid); trace_v9fs_clunk(pdu->tag, pdu->id, fid); fidp = clunk_fid(s, fid); if (fidp == NULL) { err = -ENOE...
[ 0, 0 ]
FFmpeg
libavcodec/ac3dec.c
static inline void downmix_mono_to_stereo(float *samples) { int i; for (i = 0; i < 256; i++) samples[i + 256] = samples[i]; }
[ 0, 0 ]
FFmpeg
libavformat/sdp.c
static char *sdp_media_attributes(char *buff, int size, AVCodecContext *c, int payload_type) { char *config = NULL; switch (c->codec_id) { case CODEC_ID_MPEG4: if (c->flags & CODEC_FLAG_GLOBAL_HEADER) { config = extradata2config(c->extradata, c->extradata_size); ...
[ 1, 1 ]
FFmpeg
libavcodec/mpeg12.c
static int mpegvideo_parse(AVCodecParserContext *s, AVCodecContext *avctx, const uint8_t **poutbuf, int *poutbuf_size, const uint8_t *buf, int buf_size) { ParseContext1 *pc1 = s->priv_data; ParseContext *pc = &pc1->pc; int nex...
[ 1, 0 ]
qemu
block/nbd-client.c
static int nbd_co_flush(BlockDriverState *bs) { BDRVNBDState *s = bs->opaque; return nbd_client_session_co_flush(&s->client); }
[ 0, 0 ]
qemu
block.c
static int eject_device(Monitor *mon, BlockDriverState *bs, int force) { if (!bdrv_is_removable(bs)) { qerror_report(QERR_DEVICE_NOT_REMOVABLE, bdrv_get_device_name(bs)); return -1; } if (!force && bdrv_dev_is_medium_locked(bs)) { qerror_report(QERR_DEVICE_LOCKED, bdrv_get_device_name(bs)); ...
[ 0, 0 ]
qemu
tcg/aarch64/tcg-target.inc.c
static char *tcg_get_arg_str_idx(TCGContext *s, char *buf, int buf_size, int idx) { assert(idx >= 0 && idx < s->nb_temps); return tcg_get_arg_str_ptr(s, buf, buf_size, &s->temps[idx]); }
[ 1, 0 ]
FFmpeg
libavcodec/common.c
static inline int mpeg4_is_resync(MpegEncContext *s) { const int bits_count = get_bits_count(&s->gb); if (s->workaround_bugs & FF_BUG_NO_PADDING) { return 0; } if (bits_count + 8 >= s->gb.size * 8) { int v = show_bits(&s->gb, 8); v |= 0x7F >> (7 - (bits_count & 7)); if (v == 0x7F) ...
[ 1, 0 ]
qemu
target-i386/helper.c
void OPPROTO op_divb_AL_T0(void) { unsigned int num, den, q, r; num = (EAX & 0xffff); den = (T0 & 0xff); if (den == 0) { raise_exception(EXCP00_DIVZ); } q = (num / den) & 0xff; r = (num % den) & 0xff; EAX = (EAX & ~0xffff) | (r << 8) | q; }
[ 1, 0 ]
qemu
hw/9pfs/9p-xattr.c
ssize_t v9fs_list_xattr(FsContext *ctx, const char *path, void *value, size_t vsize) { ssize_t size = 0; char *buffer; void *ovalue = value; XattrOperations *xops; char *orig_value, *orig_value_start; ssize_t xattr_len, parsed_len = 0, attr_len; /* Get the actual len */ ...
[ 1, 0 ]
qemu
hw/misc/macio/macio.c
static int macio_newworld_initfn(PCIDevice *d) { MacIOState *s = MACIO(d); NewWorldMacIOState *ns = NEWWORLD_MACIO(d); SysBusDevice *sysbus_dev; MemoryRegion *timer_memory = g_new(MemoryRegion, 1); int i; int cur_irq = 0; int ret = macio_common_initfn(d); if (ret < 0) { return ret; } ...
[ 1, 0 ]
qemu
hw/openrisc/openrisc_sim.c
static void cpu_openrisc_load_kernel(ram_addr_t ram_size, const char *kernel_filename, OpenRISCCPU *cpu) { long kernel_size; uint64_t elf_entry; hwaddr entry; if (kernel_filename && !qtest_enabled()) { kernel_size = load_elf(k...
[ 1, 0 ]