Projectname
large_stringclasses
15 values
Filepath
large_stringlengths
4
106
Function
large_stringlengths
11
3.45k
Label
list
qemu
qobject/json-parser.c
static QObject *parse_keyword(JSONParserContext *ctxt) { QObject *token, *ret; JSONParserContext saved_ctxt = parser_context_save(ctxt); token = parser_context_pop_token(ctxt); if (token == NULL) { goto out; } if (token_get_type(token) != JSON_KEYWORD) { goto out; } if (token_is_keyword...
[ 1, 0 ]
FFmpeg
libavcodec/mips/h264qpel_msa.c
void ff_put_h264_qpel16_mc22_msa(uint8_t *dst, const uint8_t *src, ptrdiff_t stride) { avc_luma_mid_16w_msa(src - (2 * stride) - 2, stride, dst, stride, 16); }
[ 0, 0 ]
qemu
docs/qapi-code-gen.txt
static GenericList *qmp_input_next_list(Visitor *v, GenericList **list, size_t size) { QmpInputVisitor *qiv = to_qiv(v); GenericList *entry; StackObject *so = &qiv->stack[qiv->nb_stack - 1]; if (!so->entry) { return NULL; } entry = g_malloc0(size); if (...
[ 0, 0 ]
FFmpeg
libavformat/mov.c
static int mov_read_moov(MOVContext *c, ByteIOContext *pb, MOV_atom_t atom) { int err; err = mov_read_default(c, pb, atom); /* we parsed the 'moov' atom, we can terminate the parsing as soon as we find * the 'mdat' */ /* so we don't parse the whole file if over a network */ c->found_moov = 1; if (...
[ 0, 0 ]
qemu
hw/9pfs/Makefile.objs
static ssize_t v9fs_synth_preadv(FsContext *ctx, V9fsFidOpenState *fs, const struct iovec *iov, int iovcnt, off_t offset) { int i, count = 0, rcount; V9fsSynthOpenState *synth_open = fs->private; V9fsSynthNode *node = synth_open->node; if ...
[ 1, 0 ]
qemu
hw/scsi/virtio-scsi.c
void virtio_scsi_handle_ctrl_req(VirtIOSCSI *s, VirtIOSCSIReq *req) { VirtIODevice *vdev = (VirtIODevice *)s; int type; int r = 0; if (iov_to_buf(req->elem.out_sg, req->elem.out_num, 0, &type, sizeof(type)) < sizeof(type)) { virtio_scsi_bad_req(); return; } virtio_tswap32s(...
[ 1, 0 ]
qemu
hw/char/cadence_uart.c
static void uart_send_breaks(UartState *s) { int break_enabled = 1; qemu_chr_fe_ioctl(s->chr, CHR_IOCTL_SERIAL_SET_BREAK, &break_enabled); }
[ 0, 0 ]
qemu
hw/usb-audio.c
static int ehci_execute(EHCIQueue *q) { USBDevice *dev; int ret; int endp; int devadr; if (!(q->qh.token & QTD_TOKEN_ACTIVE)) { fprintf(stderr, "Attempting to execute inactive QH\n"); return USB_RET_PROCERR; } q->tbytes = (q->qh.token & QTD_TOKEN_TBYTES_MASK) >> QTD_TOKEN_TBYTES_SH; if...
[ 1, 1 ]
FFmpeg
avconv.c
static enum CodecID find_codec_or_die(const char *name, enum AVMediaType type, int encoder) { const char *codec_string = encoder ? "encoder" : "decoder"; AVCodec *codec; if (!name) return CODEC_ID_NONE; codec = encoder ? avcodec_find_encoder_by_...
[ 0, 0 ]
qemu
hw/qdev-properties.c
static void get_enum(Object *obj, Visitor *v, void *opaque, const char *name, Error **errp) { DeviceState *dev = DEVICE(obj); Property *prop = opaque; int *ptr = qdev_get_prop_ptr(dev, prop); visit_type_enum(v, ptr, prop->info->enum_table, prop->info->name, prop->na...
[ 0, 0 ]
qemu
docs/qapi-code-gen.txt
QapiDeallocVisitor *qapi_dealloc_visitor_new(void) { QapiDeallocVisitor *v; v = g_malloc0(sizeof(*v)); v->visitor.type = VISITOR_DEALLOC; v->visitor.start_struct = qapi_dealloc_start_struct; v->visitor.end_struct = qapi_dealloc_end_struct; v->visitor.start_alternate = qapi_dealloc_start_alternate; ...
[ 0, 0 ]
qemu
HACKING
static uint32_t dp8393x_readb(void *opaque, target_phys_addr_t addr) { uint16_t v = dp8393x_readw(opaque, addr & ~0x1); return (v >> (8 * (addr & 0x1))) & 0xff; }
[ 0, 0 ]
qemu
tcg/tcg.c
int tcg_global_mem_new_internal(TCGType type, TCGv_ptr base, intptr_t offset, const char *name) { TCGContext *s = &tcg_ctx; TCGTemp *ts, *base_ts = &s->temps[GET_TCGV_PTR(base)]; int idx, reg = base_ts->reg; idx = s->nb_globals; #if TCG_TARGET_REG_BITS == 32 if (type ==...
[ 1, 0 ]
qemu
exec-i386.c
static void cpu_x86_dump_state(FILE *f) { int eflags; char cc_op_name[32]; eflags = cc_table[CC_OP].compute_all(); eflags |= (DF & DF_MASK); if ((unsigned)env->cc_op < CC_OP_NB) strcpy(cc_op_name, cc_op_str[env->cc_op]); else snprintf(cc_op_name, sizeof(cc_op_name), "[%d]", env->cc_op); ...
[ 1, 0 ]
qemu
target-arm/translate.c
static inline void gen_lookup_tb(DisasContext *s) { tcg_gen_movi_i32(cpu_R[15], s->pc & ~1); s->is_jmp = DISAS_UPDATE; }
[ 1, 0 ]
qemu
target/m68k/translate.c
static void gen_load_fp(DisasContext *s, int opsize, TCGv addr, TCGv_ptr fp) { TCGv tmp; TCGv_i64 t64; int index = IS_USER(s); t64 = tcg_temp_new_i64(); tmp = tcg_temp_new(); switch (opsize) { case OS_BYTE: tcg_gen_qemu_ld8s(tmp, addr, index); gen_helper_exts32(cpu_env, fp, tmp); br...
[ 1, 1 ]
qemu
console.c
static int qemu_chr_open_udp(QemuOpts *opts, CharDriverState **_chr) { CharDriverState *chr = NULL; NetCharDriver *s = NULL; int fd = -1; int ret; chr = g_malloc0(sizeof(CharDriverState)); s = g_malloc0(sizeof(NetCharDriver)); fd = inet_dgram_opts(opts); if (fd < 0) { fprintf(stderr, "inet...
[ 1, 0 ]
qemu
block/nbd-client.c
int nbd_client_co_preadv(BlockDriverState *bs, uint64_t offset, uint64_t bytes, QEMUIOVector *qiov, int flags) { NBDRequest request = { .type = NBD_CMD_READ, .from = offset, .len = bytes, }; assert(bytes <= NBD_MAX_BUFFER_SIZE); assert(!flags); return nbd_c...
[ 1, 0 ]
qemu
qemu-io.c
writev_f(int argc, char **argv) { struct timeval t1, t2; int Cflag = 0, qflag = 0; int c, cnt; char *buf; int64_t offset; int total; int nr_iov; int pattern = 0xcd; QEMUIOVector qiov; while ((c = getopt(argc, argv, "CqP:")) != EOF) { switch (c) { case 'C': Cflag = 1; ...
[ 1, 0 ]
qemu
hw/usb/ccid-card-emulated.c
static void emulated_push_type(EmulatedState *card, uint32_t type) { EmulEvent *event = (EmulEvent *)g_malloc(sizeof(EmulEvent)); assert(event); event->p.gen.type = type; emulated_push_event(card, event); }
[ 1, 0 ]
FFmpeg
libavcodec/adx.c
static void write_long(unsigned char *p, uint32_t v) { p[0] = v >> 24; p[1] = v >> 16; p[2] = v >> 8; p[3] = v; }
[ 1, 0 ]
FFmpeg
libavfilter/vf_yadif.c
static void filter_edges_16bit(void *dst1, void *prev1, void *cur1, void *next1, int w, int prefs, int mrefs, int parity, int mode) { uint16_t *dst = dst1; uint16_t *prev = prev1; uint16_t *cur = cur1; uint16_t *next = next1; int x; uint1...
[ 1, 0 ]
qemu
console.c
int qemu_chr_open_spice(QemuOpts *opts, CharDriverState **_chr) { CharDriverState *chr; SpiceCharDriver *s; const char *name = qemu_opt_get(opts, "name"); uint32_t debug = qemu_opt_get_number(opts, "debug", 0); const char **psubtype = spice_server_char_device_recognized_subtypes(); const char *subtyp...
[ 1, 0 ]
FFmpeg
libavformat/dashdec.c
static char *get_content_url(xmlNodePtr *baseurl_nodes, int n_baseurl_nodes, char *rep_id_val, char *rep_bandwidth_val, char *val) { int i; char *text; char *url = NULL; char tmp_str[MAX_...
[ 1, 0 ]
qemu
translate-all.c
void tb_flush(CPUState *cpu) { #if defined(DEBUG_FLUSH) printf("qemu: flush code_size=%ld nb_tbs=%d avg_tb_size=%ld\n", (unsigned long)(tcg_ctx.code_gen_ptr - tcg_ctx.code_gen_buffer), tcg_ctx.tb_ctx.nb_tbs, tcg_ctx.tb_ctx.nb_tbs > 0 ? ((unsigned long)(tcg_ct...
[ 1, 1 ]
qemu
migration/migration.c
int register_savevm(DeviceState *dev, const char *idstr, int instance_id, int version_id, SaveStateHandler *save_state, LoadStateHandler *load_state, void *opaque) { SaveVMHandlers *ops = g_...
[ 1, 0 ]
FFmpeg
libavcodec/j2kdec.c
static int get_cod(J2kDecoderContext *s, J2kCodingStyle *c, uint8_t *properties) { J2kCodingStyle tmp; int compno; if (s->buf_end - s->buf < 5) return AVERROR(EINVAL); tmp.log2_prec_width = tmp.log2_prec_height = 15; tmp.csty = bytestream_get_byte(&s->buf); if (bytestream_get_byte(&s->buf...
[ 1, 0 ]
qemu
hw/mips/cps.c
static void create_cps(MaltaState *s, const char *cpu_model, qemu_irq *cbus_irq, qemu_irq *i8259_irq) { Error *err = NULL; s->cps = g_new0(MIPSCPSState, 1); object_initialize(s->cps, sizeof(MIPSCPSState), TYPE_MIPS_CPS); qdev_set_parent_bus(DEVICE(s->cps), sysbus_get_default()); ...
[ 1, 1 ]
FFmpeg
libavcodec/eamad.c
static void decode_mb(MadContext *t, int inter) { MpegEncContext *s = &t->s; int mv_map = 0; int mv_x, mv_y; int j; if (inter) { int v = decode210(&s->gb); if (v < 2) { mv_map = v ? get_bits(&s->gb, 6) : 63; mv_x = decode_motion(&s->gb); mv_y = decode_motion(&s->gb); ...
[ 0, 0 ]
FFmpeg
libavfilter/vf_waveform.c
static void envelope_instant16(WaveformContext *s, AVFrame *out, int plane, int component) { const int dst_linesize = out->linesize[component] / 2; const int bg = s->bg_color[component] * (s->size / 256); const int limit = s->size - 1; const int is_chroma = (component == 1 ||...
[ 1, 0 ]
FFmpeg
avconv.c
static int poll_filter(OutputStream *ost) { OutputFile *of = output_files[ost->file_index]; AVFrame *filtered_frame = NULL; int frame_size, ret; if (!ost->filtered_frame && !(ost->filtered_frame = avcodec_alloc_frame())) { return AVERROR(ENOMEM); } else avcodec_get_frame_defaults(ost->filtered...
[ 1, 1 ]
qemu
hw/net/virtio-net.c
static void virtio_net_handle_ctrl(VirtIODevice *vdev, VirtQueue *vq) { VirtIONet *n = VIRTIO_NET(vdev); struct virtio_net_ctrl_hdr ctrl; virtio_net_ctrl_ack status = VIRTIO_NET_ERR; VirtQueueElement elem; size_t s; struct iovec *iov; unsigned int iov_cnt; while (virtqueue_pop(vq, &elem)) { ...
[ 1, 0 ]
qemu
audio/ossaudio.c
static void *oss_audio_init(void) { OSSConf *conf = g_malloc(sizeof(OSSConf)); *conf = glob_conf; if (access(conf->devpath_in, R_OK | W_OK) < 0 || access(conf->devpath_out, R_OK | W_OK) < 0) { return NULL; } return conf; }
[ 1, 0 ]
FFmpeg
libavcodec/aacenc.c
static int encode_slice_plane(AVCodecContext *avctx, int mb_count, uint8_t *src, int src_stride, uint8_t *buf, unsigned buf_size, int *qmat, int chroma) { ProresContext *ctx = avctx->priv_data; FDCTDSPContext *fdsp = &ctx...
[ 1, 0 ]
FFmpeg
libavformat/webmdashenc.c
static int webm_dash_manifest_write_trailer(AVFormatContext *s) { WebMDashMuxContext *w = s->priv_data; int i; for (i = 0; i < w->nb_as; i++) { av_freep(&w->as[i].streams); } av_freep(&w->as); return 0; }
[ 1, 0 ]
qemu
hw/usb-bus.c
static void usb_hub_handle_attach(USBDevice *dev) { USBHubState *s = DO_UPCAST(USBHubState, dev, dev); int i; for (i = 0; i < NUM_PORTS; i++) { usb_port_location(&s->ports[i].port, dev->port, i + 1); } }
[ 0, 0 ]
qemu
hw/scsi/vmw_pvscsi.c
pvscsi_on_cmd_setup_rings(PVSCSIState *s) { PVSCSICmdDescSetupRings *rc = (PVSCSICmdDescSetupRings *)s->curr_cmd_data; trace_pvscsi_on_cmd_arrived("PVSCSI_CMD_SETUP_RINGS"); pvscsi_dbg_dump_tx_rings_config(rc); if (pvscsi_ring_init_data(&s->rings, rc) < 0) { return PVSCSI_COMMAND_PROCESSING_FAI...
[ 0, 0 ]
qemu
posix-aio-compat.c
int qemu_paio_cancel(int fd, struct qemu_paiocb *aiocb) { int ret; pthread_mutex_lock(&lock); if (!aiocb->active) { TAILQ_REMOVE(&request_list, aiocb, node); aiocb->ret = -ECANCELED; ret = QEMU_PAIO_CANCELED; } else if (aiocb->ret == -EINPROGRESS) ret = QEMU_PAIO_NOTCANCELED; else ...
[ 0, 0 ]
qemu
kvm.h
uint32_t kvm_arch_get_supported_cpuid(CPUState *env, uint32_t function, uint32_t index, int reg) { struct kvm_cpuid2 *cpuid; int i, max; uint32_t ret = 0; uint32_t cpuid_1_edx; int has_kvm_features = 0; max = 1; while ((cpuid = try_get_cpuid(env->kvm_state, m...
[ 1, 0 ]
qemu
include/sysemu/sysemu.h
static bool main_loop_should_exit(void) { RunState r; ShutdownCause request; if (qemu_debug_requested()) { vm_stop(RUN_STATE_DEBUG); } if (qemu_suspend_requested()) { qemu_system_suspend(); } request = qemu_shutdown_requested(); if (request) { qemu_kill_report(); /* TODO updat...
[ 0, 1 ]
qemu
hw/9pfs/virtio-9p-local.c
static int local_symlink(FsContext *fs_ctx, const char *oldpath, const char *newpath, FsCred *credp) { int err = -1; int serrno = 0; /* Determine the security model */ if (fs_ctx->fs_sm == SM_MAPPED) { int fd; ssize_t oldpath_size, write_size; fd = open(rpath(fs_ctx...
[ 1, 0 ]
FFmpeg
libswscale/yuv2rgb.c
void yuv2rgb_altivec_init_tables(SwsContext *c, const int inv_table[4], int brightness, int contrast, int saturation) { union { signed short tmp[8] __attribute__((aligned(16))); vector signed short vec; } buf; buf.tmp[0] = ((0xffffLL) * contrast >> 8) >> 9; // cy ...
[ 1, 0 ]
qemu
hw/virtio-serial-bus.c
static void control_out(VirtIODevice *vdev, VirtQueue *vq) { VirtQueueElement elem; VirtIOSerial *vser; vser = DO_UPCAST(VirtIOSerial, vdev, vdev); while (virtqueue_pop(vq, &elem)) { handle_control_message(vser, elem.out_sg[0].iov_base); virtqueue_push(vq, &elem, elem.out_sg[0].iov_len); } v...
[ 1, 0 ]
qemu
Makefile.objs
static int usb_net_handle_datain(USBNetState *s, USBPacket *p) { int ret = USB_RET_NAK; if (s->in_ptr > s->in_len) { s->in_ptr = s->in_len = 0; ret = USB_RET_NAK; return ret; } if (!s->in_len) { ret = USB_RET_NAK; return ret; } ret = s->in_len - s->in_ptr; if (ret > p->len) ...
[ 1, 0 ]
qemu
hw/input/ps2.c
static void ps2_reset_keyboard(PS2KbdState *s) { trace_ps2_reset_keyboard(s); s->scan_enabled = 1; s->scancode_set = 2; ps2_set_ledstate(s, 0); }
[ 1, 0 ]
qemu
MAINTAINERS
static void kqemu_vfree(void *ptr) { /* may be useful some day, but currently we do not need to free */ }
[ 0, 0 ]
qemu
hw/s390x/css.c
static int do_subchannel_work(SubchDev *sch) { if (sch->do_subchannel_work) { return sch->do_subchannel_work(sch); } else { return -EINVAL; } }
[ 0, 0 ]
qemu
block/crypto.c
static ssize_t test_block_write_func(QCryptoBlock *block, size_t offset, const uint8_t *buf, size_t buflen, Error **errp, void *op...
[ 1, 0 ]
qemu
backends/baum.c
int net_init_vde(const NetClientOptions *opts, const char *name, NetClientState *peer, Error **errp) { /* FIXME error_setg(errp, ...) on failure */ const NetdevVdeOptions *vde; assert(opts->type == NET_CLIENT_OPTIONS_KIND_VDE); vde = opts->u.vde; /* missing optional values have been in...
[ 1, 1 ]
qemu
include/sysemu/kvm.h
int kvm_set_signal_mask(CPUState *cpu, const sigset_t *sigset) { struct kvm_signal_mask *sigmask; int r; if (!sigset) { return kvm_vcpu_ioctl(cpu, KVM_SET_SIGNAL_MASK, NULL); } sigmask = g_malloc(sizeof(*sigmask) + sizeof(*sigset)); sigmask->len = 8; memcpy(sigmask->sigset, sigset, sizeof(*sig...
[ 1, 0 ]
FFmpeg
tests/checkasm/fixed_dsp.c
void checkasm_check_fixed_dsp(void) { LOCAL_ALIGNED_32(int32_t, src0, [BUF_SIZE]); LOCAL_ALIGNED_32(int32_t, src1, [BUF_SIZE]); LOCAL_ALIGNED_32(int32_t, src2, [BUF_SIZE]); AVFixedDSPContext *fdsp = avpriv_alloc_fixed_dsp(1); randomize_buffers(); if (check_func(fdsp->vector_fmul, "vector_fmul")) ...
[ 0, 0 ]
FFmpeg
libavcodec/h264.c
static int output_frame(H264Context *h, AVFrame *dst, Picture *srcp) { AVFrame *src = &srcp->f; int i; int ret = av_frame_ref(dst, src); if (ret < 0) return ret; av_dict_set(&dst->metadata, "stereo_mode", ff_h264_sei_stereo_mode(h), 0); if (!srcp->crop) return 0; for (i = 0; i < 3; i++) ...
[ 1, 0 ]
FFmpeg
avconv.c
void ff_mpeg_flush(AVCodecContext *avctx) { int i; MpegEncContext *s = avctx->priv_data; if (s == NULL || s->picture == NULL) return; for (i = 0; i < MAX_PICTURE_COUNT; i++) ff_mpeg_unref_picture(s, &s->picture[i]); s->current_picture_ptr = s->last_picture_ptr = s->next_picture_ptr = NULL; f...
[ 1, 0 ]
qemu
monitor.c
void st_print_trace(FILE *stream, int (*stream_printf)(FILE *stream, const char *fmt, ...)) { unsigned int i; for (i = 0; i < TRACE_BUF_LEN; i++) { TraceRecord record; if (!get_trace_record(i, &record)) { continue; } stream_printf(stream, "Event %" ...
[ 1, 0 ]
FFmpeg
libavcodec/dxva2_mpeg2.c
static int estimate_qp(MpegEncContext *s, int dry_run) { if (s->next_lambda) { s->current_picture_ptr->f.quality = s->current_picture.f.quality = s->next_lambda; if (!dry_run) s->next_lambda = 0; } else if (!s->fixed_qscale) { s->current_picture_ptr->f.quality = s->current_p...
[ 1, 1 ]
qemu
block-raw.c
static int raw_open(BlockDriverState *bs, const char *filename, int flags) { BDRVRawState *s = bs->opaque; int access_flags, create_flags; DWORD overlapped; s->type = FTYPE_FILE; if ((flags & BDRV_O_ACCESS) == O_RDWR) { access_flags = GENERIC_READ | GENERIC_WRITE; } else { access_flags = GE...
[ 0, 0 ]
qemu
include/qemu/readline.h
static void readline_printf_func(void *opaque, const char *fmt, ...) { va_list ap; va_start(ap, fmt); vprintf(fmt, ap); va_end(ap); }
[ 0, 0 ]
qemu
async.c
static int bdrv_qed_is_allocated(BlockDriverState *bs, int64_t sector_num, int nb_sectors, int *pnum) { BDRVQEDState *s = bs->opaque; uint64_t pos = (uint64_t)sector_num * BDRV_SECTOR_SIZE; size_t len = (size_t)nb_sectors * BDRV_SECTOR_SIZE; QEDIsAllocatedCB cb = { ...
[ 0, 0 ]
qemu
docs/migration.txt
int64_t qemu_file_set_rate_limit(QEMUFile *f, int64_t new_rate) { /* any failed or completed migration keeps its state to allow probing of * migration data, but has no associated file anymore */ if (f && f->ops->set_rate_limit) return f->ops->set_rate_limit(f->opaque, new_rate); return 0; }
[ 1, 0 ]
qemu
HACKING
static uint64_t lance_mem_read(void *opaque, target_phys_addr_t addr, unsigned size) { SysBusPCNetState *d = opaque; uint32_t val; val = pcnet_ioport_readw(&d->state, addr); trace_lance_mem_readw(addr, val & 0xffff); return val & 0xffff; }
[ 0, 0 ]
qemu
hw/hw.h
static QEMUFile *qemu_fopen_bdrv(BlockDriverState *bs, int64_t offset, int is_writable) { QEMUFile *f; f = qemu_mallocz(sizeof(QEMUFile)); if (!f) return NULL; f->is_file = 0; f->bs = bs; f->is_writable = is_writable; f->base_offset = offset; return f; }
[ 0, 0 ]
qemu
target-unicore32/Makefile.objs
float64 HELPER(ucf64_absd)(float64 a) { return float64_abs(a); }
[ 0, 0 ]
qemu
hw/virtio/vhost-user.c
static int vhost_user_get_u64(struct vhost_dev *dev, int request, uint64_t *u64) { VhostUserMsg msg = { .request = request, .flags = VHOST_USER_VERSION, }; if (vhost_user_one_time_request(request) && dev->vq_index != 0) { return 0; } vhost_user_write(dev, &msg, NULL, 0); if (vhost_u...
[ 1, 0 ]
qemu
block/qcow2.c
int qcow2_backing_read1(BlockDriverState *bs, QEMUIOVector *qiov, int64_t offset, int bytes) { uint64_t bs_size = bs->total_sectors * BDRV_SECTOR_SIZE; int n1; if ((offset + bytes) <= bs_size) { return bytes; } if (offset >= bs_size) { n1 = 0; } else { n1 = bs_s...
[ 1, 0 ]
qemu
hw/block/nvme.c
static void nvme_set_bootindex(Object *obj, Visitor *v, void *opaque, const char *name, Error **errp) { NvmeCtrl *s = NVME(obj); int32_t boot_index; Error *local_err = NULL; visit_type_int32(v, &boot_index, name, &local_err); if (local_err) { goto out; } /* chec...
[ 1, 0 ]
qemu
block/qed-cluster.c
static int qed_write_table(BDRVQEDState *s, uint64_t offset, QEDTable *table, unsigned int index, unsigned int n, bool flush) { unsigned int sector_mask = BDRV_SECTOR_SIZE / sizeof(uint64_t) - 1; unsigned int start, end, i; QEDTable *new_table; struct iovec iov; QEMUIOVector ...
[ 1, 0 ]
FFmpeg
libavformat/aiff.c
enum CodecID av_codec_get_id(const AVCodecTag *tags[4], unsigned int tag) { int i; for (i = 0; i < 4 && tags[i]; i++) { enum CodecID id = codec_get_id(tags[i], tag); if (id != CODEC_ID_NONE) return id; } return CODEC_ID_NONE; }
[ 1, 0 ]
qemu
hw/scsi/virtio-scsi.c
static void virtio_scsi_fail_cmd_req(VirtIOSCSIReq *req) { req->resp.cmd->response = VIRTIO_SCSI_S_FAILURE; virtio_scsi_complete_cmd_req(req); }
[ 0, 0 ]
qemu
target-i386/kvm.c
static int kvm_put_xsave(CPUState *env) { #ifdef KVM_CAP_XSAVE int i, r; struct kvm_xsave *xsave; uint16_t cwd, swd, twd, fop; if (!kvm_has_xsave()) return kvm_put_fpu(env); xsave = qemu_memalign(4096, sizeof(struct kvm_xsave)); memset(xsave, 0, sizeof(struct kvm_xsave)); cwd = swd = twd = f...
[ 1, 0 ]
qemu
hw/i386/acpi-build.c
static void string_output_append_range(StringOutputVisitor *sov, int64_t s, int64_t e) { Range *r = g_malloc0(sizeof(*r)); r->begin = s; r->end = e + 1; sov->ranges = range_list_insert(sov->ranges, r); }
[ 0, 0 ]
qemu
hw/9pfs/Makefile.objs
static void v9fs_synth_rewinddir(FsContext *ctx, V9fsFidOpenState *fs) { v9fs_synth_seekdir(ctx, fs, 0); }
[ 0, 0 ]
qemu
memory.c
static void memory_region_write_thunk_n(void *_mr, target_phys_addr_t addr, unsigned size, uint64_t data) { MemoryRegion *mr = _mr; if (!memory_region_access_valid(mr, addr, size)) { re...
[ 1, 1 ]
qemu
pc-bios/s390-ccw/bootmap.c
static int zipl_load_segment(struct component_entry *entry) { const int max_entries = (SECTOR_SIZE / sizeof(struct scsi_blockptr)); struct scsi_blockptr *bprs = (void *)sec; const int bprs_size = sizeof(sec); uint64_t blockno; long address; int i; blockno = entry->data.blockno; address = entry-...
[ 1, 0 ]
qemu
block/block-backend.c
static void virtio_blk_handle_write(VirtIOBlockReq *req, MultiReqBuffer *mrb) { BlockRequest *blkreq; uint64_t sector; sector = virtio_ldq_p(VIRTIO_DEVICE(req->dev), &req->out.sector); trace_virtio_blk_handle_write(req, sector, req->qiov.size / 512); if (!virtio_blk_sect_range_ok(req->dev, sector, req->...
[ 1, 0 ]
qemu
block.c
static void bdrv_co_complete(BlockAIOCBCoroutine *acb) { if (!acb->need_bh) { acb->common.cb(acb->common.opaque, acb->req.error); qemu_aio_unref(acb); } }
[ 0, 0 ]
qemu
qapi/qmp-output-visitor.c
QObject *qmp_output_get_qobject(QmpOutputVisitor *qov) { /* FIXME: we should require that a visit occurred, and that it is * complete (no starts without a matching end) */ QObject *obj = qov->root; if (obj) { qobject_incref(obj); } else { obj = qnull(); } return obj; }
[ 0, 1 ]
qemu
hw/eepro100.c
static void disable_interrupt(EEPRO100State *s) { if (s->int_stat) { logout("interrupt disabled\n"); qemu_irq_lower(s->pci_dev->irq[0]); s->int_stat = 0; } }
[ 0, 0 ]
qemu
hw/nvram/eeprom93xx.c
eeprom_t *eeprom93xx_new(DeviceState *dev, uint16_t nwords) { /* Add a new EEPROM (with 16, 64 or 256 words). */ eeprom_t *eeprom; uint8_t addrbits; switch (nwords) { case 16: case 64: addrbits = 6; break; case 128: case 256: addrbits = 8; break; default: assert(!"Un...
[ 0, 0 ]
qemu
hw/ide.c
static void cdrom_change_cb(void *opaque) { IDEState *s = opaque; uint64_t nb_sectors; /* XXX: send interrupt too */ bdrv_get_geometry(s->bs, &nb_sectors); s->nb_sectors = nb_sectors; }
[ 0, 1 ]
FFmpeg
libavcodec/h264pred_template.c
static void FUNCC(pred4x4_129_dc)(uint8_t *_src, const uint8_t *topright, int _stride) { pixel *src = (pixel *)_src; int stride = _stride / sizeof(pixel); ((pixel4 *)(src + 0 * stride))[0] = ((pixel4 *)(src + 1 * stride))[0] = ((pixel4 *)(src + 2 * stride))[0...
[ 1, 0 ]
qemu
ui/console.c
void unregister_displaychangelistener(DisplayChangeListener *dcl) { DisplayState *ds = dcl->ds; trace_displaychangelistener_unregister(dcl, dcl->ops->dpy_name); if (dcl->con) { dcl->con->dcls--; } QLIST_REMOVE(dcl, next); gui_setup_refresh(ds); }
[ 1, 0 ]
FFmpeg
libavformat/utils.c
static void dump_stream_format(AVFormatContext *ic, int i, int index, int is_output) { char buf[256]; int flags = (is_output ? ic->oformat->flags : ic->iformat->flags); AVStream *st = ic->streams[i]; int g = ff_gcd(st->time_base.num, st->time_base.den); avcodec_string(buf,...
[ 1, 1 ]
FFmpeg
libavcodec/ffjni.c
JNIEnv *ff_jni_attach_env(int *attached, void *log_ctx) { int ret = 0; JNIEnv *env = NULL; *attached = 0; pthread_mutex_lock(&lock); if (java_vm == NULL && (java_vm = av_jni_get_java_vm(log_ctx)) == NULL) { av_log(log_ctx, AV_LOG_INFO, "Retrieving current Java virtual machine using Andro...
[ 1, 0 ]
qemu
kvm-all.c
static int kvm_set_ioeventfd_mmio(int fd, hwaddr addr, uint32_t val, bool assign, uint32_t size, bool datamatch) { int ret; struct kvm_ioeventfd iofd; iofd.datamatch = datamatch ? adjust_ioeventfd_endianness(val, size) : 0; iofd.addr = addr; iofd.len = size; iofd.fl...
[ 1, 0 ]
qemu
cpus.c
static int tcg_cpu_exec(CPUState *cpu) { int ret; #ifdef CONFIG_PROFILER int64_t ti; #endif #ifdef CONFIG_PROFILER ti = profile_getclock(); #endif if (use_icount) { int64_t count; int64_t deadline; int decr; timers_state.qemu_icount -= (cpu->icount_decr.u16.low ...
[ 0, 0 ]
qemu
HACKING
static uint32_t cadence_ttc_read_imp(void *opaque, target_phys_addr_t offset) { CadenceTimerState *s = cadence_timer_from_addr(opaque, offset); uint32_t value; cadence_timer_sync(s); cadence_timer_run(s); switch (offset) { case 0x00: /* clock control */ case 0x04: case 0x08: return s->reg_...
[ 0, 0 ]
qemu
backends/hostmem-file.c
void desc_ring_free(DescRing *ring) { if (ring->info) { g_free(ring->info); } g_free(ring); }
[ 0, 0 ]
qemu
block/qapi.c
BlockStatsList *qmp_query_blockstats(bool has_query_nodes, bool query_nodes, Error **errp) { BlockStatsList *head = NULL, **p_next = &head; BlockBackend *blk = NULL; BlockDriverState *bs = NULL; /* Just to be safe if query_nodes is...
[ 0, 0 ]
qemu
block.c
void qmp_cont(Error **errp) { Error *local_err = NULL; BlockBackend *blk; BlockDriverState *bs; BdrvNextIterator it; /* if there is a dump in background, we should wait until the dump * finished */ if (dump_in_progress()) { error_setg(errp, "There is a dump in process, please wait."); r...
[ 0, 0 ]
qemu
target-i386/kvm.c
int kvm_arch_insert_sw_breakpoint(CPUState *env, struct kvm_sw_breakpoint *bp) { static const uint8_t int3 = 0xcc; if (cpu_memory_rw_debug(env, bp->pc, (uint8_t *)&bp->saved_insn, 1, 0) || cpu_memory_rw_debug(env, bp->pc, (uint8_t *)&int3, 1, 1)) return -EINVAL; return 0; }
[ 1, 0 ]
qemu
hw/ppc/spapr.c
static uint32_t cas_check_pvr(PowerPCCPU *cpu, target_ulong *addr, Error **errp) { bool explicit_match = false; /* Matched the CPU's real PVR */ uint32_t max_compat = cpu->max_compat; uint32_t best_compat = 0; int i; /* * We scan the supplied table of PVRs looking for ...
[ 1, 0 ]
FFmpeg
libavformat/rtpdec.c
RTPDemuxContext *rtp_parse_open(AVFormatContext *s1, AVStream *st, URLContext *rtpc, int payload_type, RTPPayloadData *rtp_payload_data) { RTPDemuxContext *s; s = av_mallocz(sizeof(RTPDemuxContext)); if (!s) return NULL; s->payload_type =...
[ 1, 1 ]
qemu
hw/virtio-balloon.c
static int virtio_balloon_load(QEMUFile *f, void *opaque, int version_id) { VirtIOBalloon *s = opaque; if (version_id != 1) return -EINVAL; virtio_load(&s->vdev, f); s->num_pages = qemu_get_be32(f); s->actual = qemu_get_be32(f); qemu_get_buffer(f, (uint8_t *)&s->stats_vq_elem, sizeof(VirtQueueEl...
[ 1, 0 ]
qemu
linux-user/elfload.c
static inline void init_thread(struct target_pt_regs *_regs, struct image_info *infop) { _regs->gpr[1] = infop->start_stack; #if defined(TARGET_PPC64) && !defined(TARGET_ABI32) if (get_ppc64_abi(infop) < 2) { _regs->gpr[2] = ldq_raw(infop->entry + 8) + infop->load_bias; ...
[ 1, 0 ]
qemu
hw/core/qdev-properties-system.c
static void release_drive(Object *obj, const char *name, void *opaque) { DeviceState *dev = DEVICE(obj); Property *prop = opaque; BlockBackend **ptr = qdev_get_prop_ptr(dev, prop); if (*ptr) { blk_detach_dev(*ptr, dev); blockdev_auto_del(*ptr); } }
[ 1, 0 ]
FFmpeg
libavcodec/simple_idct.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 ]
qemu
target-ppc/op.c
void OPPROTO op_check_addo(void) { if (likely(!(((uint32_t)T2 ^ (uint32_t)T1 ^ UINT32_MAX) & ((uint32_t)T2 ^ (uint32_t)T0) & (1UL << 31)))) { xer_ov = 0; } else { xer_so = 1; xer_ov = 1; } RETURN(); }
[ 1, 0 ]
FFmpeg
libavcodec/dsputil.c
void ff_vp3_idct_dc_add_c(uint8_t *dest /*align 8*/, int line_size, const DCTELEM *block /*align 16*/) { int i, dc = (block[0] + 15) >> 5; const uint8_t *cm = ff_cropTbl + MAX_NEG_CROP + dc; for (i = 0; i < 8; i++) { dest[0] = cm[dest[0]]; dest[1] = cm[dest[1]]; dest[2]...
[ 1, 0 ]
qemu
qom/object.c
void object_property_add_bool(Object *obj, const char *name, bool (*get)(Object *, Error **), void (*set)(Object *, bool, Error **), Error **errp) { BoolProperty *prop = g_malloc0(sizeof(*prop)); prop->get = get; prop...
[ 1, 0 ]
FFmpeg
libavcodec/h264.c
av_cold void ff_h264_free_context(H264Context *h) { int i; free_tables(h); // FIXME cleanup init stuff perhaps for (i = 0; i < MAX_SPS_COUNT; i++) av_freep(h->sps_buffers + i); for (i = 0; i < MAX_PPS_COUNT; i++) av_freep(h->pps_buffers + i); }
[ 1, 1 ]