Projectname
large_stringclasses
15 values
Filepath
large_stringlengths
4
106
Function
large_stringlengths
11
3.45k
Label
list
qemu
block.c
static void coroutine_fn bdrv_create_co_entry(void *opaque) { Error *local_err = NULL; int ret; CreateCo *cco = opaque; assert(cco->drv); ret = cco->drv->bdrv_create(cco->filename, cco->opts, &local_err); if (local_err) { error_propagate(&cco->err, local_err); } cco->ret = ret; }
[ 0, 0 ]
qemu
block/qapi.c
static void qmp_output_start_list(Visitor *v, const char *name, GenericList **listp, size_t size, Error **errp) { QmpOutputVisitor *qov = to_qov(v); QList *list = qlist_new(); qmp_output_add(qov, name, list); qmp_output_push(qov, list, l...
[ 0, 0 ]
qemu
qemu-char.c
static gboolean tcp_chr_read(GIOChannel *chan, GIOCondition cond, void *opaque) { CharDriverState *chr = opaque; TCPCharDriver *s = chr->opaque; uint8_t buf[READ_BUF_LEN]; int len, size; if (!s->connected || s->max_size <= 0) { return TRUE; } len = sizeof(buf); if (len > s->max_size) l...
[ 1, 0 ]
FFmpeg
libavcodec/msrle.c
static int msrle_decode_init(AVCodecContext *avctx) { MsrleContext *s = (MsrleContext *)avctx->priv_data; int i, j; unsigned char *palette; s->avctx = avctx; avctx->pix_fmt = PIX_FMT_PAL8; avctx->has_b_frames = 0; s->frame.data[0] = s->prev_frame.data[0] = NULL; /* convert palette */ palette...
[ 1, 0 ]
FFmpeg
libavcodec/idctdsp.c
static void put_pixels_clamped_c(const int16_t *block, uint8_t *av_restrict pixels, ptrdiff_t line_size) { int i; /* read the pixels */ for (i = 0; i < 8; i++) { pixels[0] = av_clip_uint8(block[0]); pixels[1] = av_clip_uint8(block[1]...
[ 1, 0 ]
qemu
libcacard/vcard_emul_nss.c
vcard_emul_replay_insertion_events(void) { VReaderListEntry *current_entry; VReaderListEntry *next_entry = NULL; VReaderList *list = vreader_get_reader_list(); for (current_entry = vreader_list_get_first(list); current_entry; current_entry = next_entry) { VReader *vreader = vreader_list_get_reader(cu...
[ 1, 0 ]
qemu
include/monitor/monitor.h
int monitor_fdset_dup_fd_remove(int dupfd) { return -1; }
[ 1, 0 ]
FFmpeg
libavfilter/buffersink.c
int av_buffersrc_add_frame(AVFilterContext *ctx, AVFrame *frame) { BufferSourceContext *s = ctx->priv; AVFrame *copy; int ret; if (!frame) { s->eof = 1; return 0; } else if (s->eof) return AVERROR(EINVAL); switch (ctx->outputs[0]->type) { case AVMEDIA_TYPE_VIDEO: CHECK_VIDEO_PA...
[ 1, 0 ]
FFmpeg
doc/filters.texi
static av_cold int asink_init(AVFilterContext *ctx, void *opaque) { BufferSinkContext *buf = ctx->priv; AVABufferSinkParams *params = opaque; if (params && params->sample_fmts) { buf->sample_fmts = ff_copy_int_list(params->sample_fmts); if (!buf->sample_fmts) return AVERROR(ENOMEM); } if...
[ 1, 0 ]
qemu
block/qapi.c
void qapi_copy_SocketAddress(SocketAddress **p_dest, SocketAddress *src) { QmpOutputVisitor *qov; Visitor *ov, *iv; QObject *obj; *p_dest = NULL; qov = qmp_output_visitor_new(); ov = qmp_output_get_visitor(qov); visit_type_SocketAddress(ov, NULL, &src, &error_abort); ...
[ 0, 0 ]
qemu
hw/openpic.c
static inline int test_bit(uint32_t *field, int bit) { return (field[bit >> 5] & 1 << (bit & 0x1F)) != 0; }
[ 0, 0 ]
qemu
balloon.c
void qemu_add_balloon_handler(QEMUBalloonEvent *func, void *opaque) { balloon_event_fn = func; balloon_opaque = opaque; }
[ 1, 0 ]
qemu
exec.c
static MemoryRegionSection *phys_page_find(PhysPageEntry lp, hwaddr index, Node *nodes, MemoryRegionSection *sections) { PhysPageEntry *p; int i; for (i = P_L2_LEVELS - 1; i >= 0 && !lp.is_leaf; i--) { if (lp.ptr == PH...
[ 1, 0 ]
qemu
arch_init.c
static int ram_save_block(QEMUFile *f, bool last_stage) { RAMBlock *block = last_seen_block; ram_addr_t offset = last_offset; int bytes_sent = -1; MemoryRegion *mr; ram_addr_t current_addr; if (!block) block = QTAILQ_FIRST(&ram_list.blocks); do { mr = block->mr; if (migration_bitmap...
[ 1, 0 ]
qemu
hw/usb/redirect.c
static void usbredir_interrupt_packet( void *priv, uint32_t id, struct usb_redir_interrupt_packet_header *interrupt_packet, uint8_t *data, int data_len) { USBRedirDevice *dev = priv; uint8_t ep = interrupt_packet->endpoint; DPRINTF("interrupt-in status %d ep %02X len %d id %u\n", inte...
[ 1, 0 ]
qemu
hw/scsi-bus.c
int scsi_req_parse(SCSIRequest *req, uint8_t *buf) { int rc; if (req->dev->type == TYPE_TAPE) { rc = scsi_req_stream_length(&req->cmd, req->dev, buf); } else { rc = scsi_req_length(&req->cmd, req->dev, buf); } if (rc != 0) return rc; assert(buf == req->cmd.buf); scsi_cmd_xfer_mode(&r...
[ 1, 0 ]
qemu
hw/scsi/vmw_pvscsi.c
pvscsi_convert_sglist(PVSCSIRequest *r) { int chunk_size; uint64_t data_length = r->req.dataLen; PVSCSISGState sg = r->sg; while (data_length) { while (!sg.resid) { pvscsi_get_next_sg_elem(&sg); trace_pvscsi_convert_sglist(r->req.context, r->sg.dataAddr, ...
[ 0, 0 ]
qemu
hw/scsi/scsi-bus.c
static void scsi_dma_restart_bh(void *opaque) { SCSIDevice *s = opaque; SCSIRequest *req, *next; qemu_bh_delete(s->bh); s->bh = NULL; QTAILQ_FOREACH_SAFE(req, &s->requests, next, next) { scsi_req_ref(req); if (req->retry) { req->retry = false; switch (req->cmd.mode) { case...
[ 1, 0 ]
qemu
audio/audio.c
static uint64_t get_guest_rtc_ns(RTCState *s) { uint64_t guest_rtc; uint64_t guest_clock = qemu_clock_get_ns(rtc_clock); guest_rtc = s->base_rtc * NANOSECONDS_PER_SECOND + guest_clock - s->last_update + s->offset; return guest_rtc; }
[ 0, 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
tests/libqos/pci-pc.c
static void qpci_pc_config_writew(QPCIBus *bus, int devfn, uint8_t offset, uint16_t value) { outl(0xcf8, (1 << 31) | (devfn << 8) | offset); outw(0xcfc, value); }
[ 1, 0 ]
qemu
hmp.c
void qmp_memchar_write(const char *device, int64_t size, const char *data, bool has_format, enum DataFormat format, Error **errp) { CharDriverState *chr; guchar *write_data; int ret; gsize write_count; chr = qemu_chr_find(device); ...
[ 1, 0 ]
qemu
block/raw-posix.c
kern_return_t GetBSDPath(io_iterator_t mediaIterator, char *bsdPath, CFIndex maxPathSize) { io_object_t nextMedia; kern_return_t kernResult = KERN_FAILURE; *bsdPath = '\0'; nextMedia = IOIteratorNext(mediaIterator); if (nextMedia) { CFTypeRef bsdPathAsCFString; bsdP...
[ 1, 0 ]
qemu
hw/scsi/scsi-bus.c
void scsi_req_cancel(SCSIRequest *req) { trace_scsi_req_cancel(req->dev->id, req->lun, req->tag); if (!req->enqueued) { return; } scsi_req_ref(req); scsi_req_dequeue(req); req->io_canceled = true; if (req->aiocb) { blk_aio_cancel(req->aiocb); } else { scsi_req_cancel_complete(req)...
[ 1, 0 ]
qemu
hw/arm/allwinner-a10.c
static void host_x86_cpu_class_init(ObjectClass *oc, void *data) { DeviceClass *dc = DEVICE_CLASS(oc); X86CPUClass *xcc = X86_CPU_CLASS(oc); uint32_t eax = 0, ebx = 0, ecx = 0, edx = 0; xcc->kvm_required = true; host_cpuid(0x0, 0, &eax, &ebx, &ecx, &edx); x86_cpu_vendor_words2str(host_cpudef.vendor, ...
[ 1, 0 ]
qemu
fpu/softfloat.c
uint_fast16_t float32_to_uint16_round_to_zero(float32 a STATUS_PARAM) { int64_t v; uint_fast16_t res; v = float32_to_int64_round_to_zero(a STATUS_VAR); if (v < 0) { res = 0; float_raise(float_flag_invalid STATUS_VAR); } else if (v > 0xffff) { res = 0xffff; float_raise(float_flag_inva...
[ 1, 0 ]
qemu
target-arm/translate.c
static int gen_set_psr_im(DisasContext *s, uint32_t mask, int spsr, uint32_t val) { TCGv tmp; tmp = new_tmp(); tcg_gen_movi_i32(tmp, val); return gen_set_psr(s, mask, spsr, tmp); }
[ 1, 0 ]
FFmpeg
libavcodec/dv.c
static always_inline int dv_rl2vlc_size(int run, int l) { int level = (l ^ (l >> 8)) - (l >> 8); int size; if (run < DV_VLC_MAP_RUN_SIZE && level < DV_VLC_MAP_LEV_SIZE) { size = dv_vlc_map[run][level].size; } else { size = (level < DV_VLC_MAP_LEV_SIZE) ? dv_vlc_map[0][level].size : 16; if...
[ 1, 0 ]
FFmpeg
libavfilter/vf_tinterlace.c
static void start_frame(AVFilterLink *inlink, AVFilterBufferRef *picref) { AVFilterContext *ctx = inlink->dst; TInterlaceContext *tinterlace = ctx->priv; if (tinterlace->cur) avfilter_unref_buffer(tinterlace->cur); tinterlace->cur = tinterlace->next; tinterlace->next = picref; }
[ 0, 0 ]
qemu
target-s390x/kvm.c
static int handle_sigp(S390CPU *cpu, struct kvm_run *run, uint8_t ipa1) { CPUS390XState *env = &cpu->env; uint8_t order_code; uint16_t cpu_addr; int r = -1; S390CPU *target_cpu; cpu_synchronize_state(CPU(cpu)); /* get order code */ order_code = decode_basedisp_rs(env, run->s390_sieic.ipb) & SIG...
[ 0, 0 ]
qemu
net.c
static int tap_set_sndbuf(TAPState *s, const char *sndbuf_str) { int sndbuf = TAP_DEFAULT_SNDBUF; if (sndbuf_str) { sndbuf = atoi(sndbuf_str); } if (!sndbuf) { sndbuf = INT_MAX; } if (ioctl(s->fd, TUNSETSNDBUF, &sndbuf) == -1 && sndbuf_str) { qemu_error("TUNSETSNDBUF ioctl failed: %s\n",...
[ 0, 0 ]
qemu
block.c
static void vhost_ccw_scsi_realize(VirtioCcwDevice *ccw_dev, Error **errp) { VHostSCSICcw *dev = VHOST_SCSI_CCW(ccw_dev); DeviceState *vdev = DEVICE(&dev->vdev); Error *err = NULL; qdev_set_parent_bus(vdev, BUS(&ccw_dev->bus)); object_property_set_bool(OBJECT(vdev), true, "realized", &err); if (err) ...
[ 0, 0 ]
qemu
hw/acpi/aml-build.c
build_tpm2(GArray *table_data, GArray *linker) { Acpi20TPM2 *tpm2_ptr; tpm2_ptr = acpi_data_push(table_data, sizeof *tpm2_ptr); tpm2_ptr->platform_class = cpu_to_le16(TPM2_ACPI_CLASS_CLIENT); tpm2_ptr->control_area_address = cpu_to_le64(0); tpm2_ptr->start_method = cpu_to_le32(TPM2_START_METHOD_MMIO); ...
[ 1, 0 ]
qemu
cpu-exec.c
static unsigned int dec_subu_r(DisasContext *dc) { TCGv t0; int size = memsize_z(dc); DIS(fprintf(logfile, "subu.%c $r%u, $r%u\n", memsize_char(size), dc->op1, dc->op2)); cris_cc_mask(dc, CC_MASK_NZVC); t0 = tcg_temp_new(TCG_TYPE_TL); /* Size can only be qi or hi. */ ...
[ 0, 0 ]
qemu
hw/acpi.c
void acpi_pm1_cnt_write(ACPIREGS *ar, uint16_t val) { ar->pm1.cnt.cnt = val & ~(ACPI_BITMASK_SLEEP_ENABLE); if (val & ACPI_BITMASK_SLEEP_ENABLE) { /* change suspend type */ uint16_t sus_typ = (val >> 10) & 7; switch (sus_typ) { case 0: /* soft power off */ qemu_system_shutdown_request(...
[ 0, 0 ]
qemu
vl.c
static void win32_rearm_timer(struct qemu_alarm_timer *t) { struct qemu_alarm_win32 *data = t->priv; uint64_t nearest_delta_us; if (!active_timers[QEMU_TIMER_REALTIME] && !active_timers[QEMU_TIMER_VIRTUAL]) return; nearest_delta_us = qemu_next_deadline_dyntick(); nearest_delta_us /= 1000; ...
[ 1, 0 ]
qemu
block/nbd.c
ssize_t nbd_send_request(int csock, struct nbd_request *request) { uint8_t buf[4 + 4 + 8 + 8 + 4]; cpu_to_be32w((uint32_t *)buf, NBD_REQUEST_MAGIC); cpu_to_be32w((uint32_t *)(buf + 4), request->type); cpu_to_be64w((uint64_t *)(buf + 8), request->handle); cpu_to_be64w((uint64_t *)(buf + 16), request->fro...
[ 1, 0 ]
qemu
hw/scsi-disk.c
static void scsi_do_read(void *opaque, int ret) { SCSIDiskReq *r = opaque; SCSIDiskState *s = DO_UPCAST(SCSIDiskState, qdev, r->req.dev); uint32_t n; if (r->req.aiocb != NULL) { r->req.aiocb = NULL; bdrv_acct_done(s->qdev.conf.bs, &r->acct); } if (ret < 0) { if (scsi_handle_rw_error(r, ...
[ 1, 0 ]
qemu
hw/ppc.c
void ppc40x_chip_reset(CPUState *env) { target_ulong dbsr; printf("Reset PowerPC chip\n"); cpu_ppc_reset(env); /* XXX: TODO reset all internal peripherals */ dbsr = env->spr[SPR_40x_DBSR]; dbsr &= ~0x00000300; dbsr |= 0x00000200; env->spr[SPR_40x_DBSR] = dbsr; cpu_loop_exit(); }
[ 1, 1 ]
FFmpeg
libavcodec/h264_slice.c
static int thread_get_buffer_internal(AVCodecContext *avctx, ThreadFrame *f, int flags) { PerThreadContext *p = avctx->internal->thread_ctx; int err; f->owner = avctx; ff_init_buffer_info(avctx, f->f); if (!(avctx->active_thread_type & FF_THREAD_FRAME)) return ...
[ 1, 0 ]
qemu
hw/ppc/ppc.c
static void gen_spr_power5p_lpar(CPUPPCState *env) { #if !defined(CONFIG_USER_ONLY) /* Logical partitionning */ spr_register_kvm(env, SPR_LPCR, "LPCR", &spr_read_generic, &spr_write_lpcr, KVM_REG_PPC_LPCR, LPCR_LPES0 | LPCR_LPES1); #endif }
[ 1, 0 ]
qemu
hw/acpi/piix4.c
static void via_class_init(ObjectClass *klass, void *data) { DeviceClass *dc = DEVICE_CLASS(klass); PCIDeviceClass *k = PCI_DEVICE_CLASS(klass); k->init = vt82c686b_initfn; k->config_write = vt82c686b_write_config; k->vendor_id = PCI_VENDOR_ID_VIA; k->device_id = PCI_DEVICE_ID_VIA_ISA_BRIDGE; k->c...
[ 1, 0 ]
FFmpeg
libavcodec/avs.c
static av_cold int avs_decode_init(AVCodecContext *avctx) { avctx->pix_fmt = PIX_FMT_PAL8; return 0; }
[ 1, 0 ]
qemu
include/sysemu/char.h
CharDriverState *qemu_chr_alloc(ChardevCommon *backend, Error **errp) { CharDriverState *chr = g_malloc0(sizeof(CharDriverState)); qemu_mutex_init(&chr->chr_write_lock); chr->mux_idx = -1; if (backend->has_logfile) { int flags = O_WRONLY | O_CREAT; if (backend->has_logappend && backend->...
[ 1, 0 ]
qemu
block/crypto.c
static void qapi_dealloc_end_struct(Visitor *v, Error **errp) { QapiDeallocVisitor *qov = to_qov(v); void **obj = qapi_dealloc_pop(qov); if (obj) { g_free(*obj); } }
[ 1, 0 ]
qemu
tests/e1000e-test.c
static void test_bmdma_one_sector_short_prdt(void) { QPCIDevice *dev; void *bmdma_base, *ide_base; uint8_t status; /* Read 2 sectors but only give 1 sector in PRDT */ PrdtEntry prdt[] = { { .addr = 0, .size = cpu_to_le32(0x200 | PRDT_EOT), }, }; dev = get_pci_de...
[ 1, 0 ]
qemu
hw/spapr.c
static uint32_t regtype_to_ss(uint8_t type) { if (type & PCI_BASE_ADDRESS_MEM_TYPE_64) { return 3; } if (type == PCI_BASE_ADDRESS_SPACE_IO) { return 1; } return 2; }
[ 1, 0 ]
FFmpeg
libavcodec/j2k.c
static void dequantization_float(int x, int y, Jpeg2000Cblk *cblk, Jpeg2000Component *comp, Jpeg2000T1Context *t1, Jpeg2000Band *band) { int i, j, idx; float *datap = &comp->data[(comp->coord[0][1] - comp->coord[0][0]) * y + x]; for (j = 0; j...
[ 1, 0 ]
qemu
hw/qdev-properties.c
static void set_int8(Object *obj, Visitor *v, void *opaque, const char *name, Error **errp) { DeviceState *dev = DEVICE(obj); Property *prop = opaque; int8_t *ptr = qdev_get_prop_ptr(dev, prop); Error *local_err = NULL; int64_t value; if (dev->state != DEV_STATE_CREATED) { ...
[ 1, 0 ]
qemu
linux-user/syscall.c
static inline abi_long do_msgrcv(int msqid, abi_long msgp, unsigned int msgsz, abi_long msgtyp, int msgflg) { struct target_msgbuf *target_mb; char *target_mtext; struct msgbuf *host_mb; abi_long ret = 0; if (!lock_user_struct(VERIFY_WR...
[ 1, 0 ]
qemu
usb-linux.c
device_init(usb_host_register_devices) USBDevice *usb_host_device_open(const char *devname) { struct USBAutoFilter filter = {0, 0, 0, 0}; USBDevice *dev; USBHostDevice *s; char *p; dev = usb_create(NULL /* FIXME */, "USB Host Device"); s = DO_UPCAST(USBHostDevice, dev, dev); if (strstr(devnam...
[ 1, 1 ]
qemu
monitor.c
void qemu_error_internal(const char *file, int linenr, const char *func, const char *fmt, ...) { va_list va; QError *qerror; assert(qemu_error_sink != NULL); va_start(va, fmt); qerror = qerror_from_info(file, linenr, func, fmt, &va); va_end(va); switch (qemu_error_sink->d...
[ 1, 0 ]
FFmpeg
libavcodec/tiertexseqv.c
static int seqvideo_decode(SeqVideoContext *seq, const unsigned char *data, int data_size) { const unsigned char *data_end = data + data_size; GetBitContext gb; int flags, i, j, x, y, op; unsigned char c[3]; unsigned char *dst; uint32_t *palette; flags = *data++; if (...
[ 1, 0 ]
qemu
include/ui/console.h
int dpy_set_ui_info(QemuConsole *con, QemuUIInfo *info) { assert(con != NULL); con->ui_info = *info; if (!con->hw_ops->ui_info) { return -1; } /* * Typically we get a flood of these as the user resizes the window. * Wait until the dust has settled (one second without updates), then * go ...
[ 1, 0 ]
qemu
block/backup.c
static void coroutine_fn v9fs_flush(void *opaque) { ssize_t err; int16_t tag; size_t offset = 7; V9fsPDU *cancel_pdu = NULL; V9fsPDU *pdu = opaque; V9fsState *s = pdu->s; err = pdu_unmarshal(pdu, offset, "w", &tag); if (err < 0) { pdu_complete(pdu, err); return; } trace_v9fs_flus...
[ 0, 0 ]
qemu
fpu/softfloat-native.c
void helper_fcmpo(uint64_t arg1, uint64_t arg2, uint32_t crfD) { CPU_DoubleU farg1, farg2; uint32_t ret = 0; farg1.ll = arg1; farg2.ll = arg2; if (unlikely(float64_is_nan(farg1.d) || float64_is_nan(farg2.d))) { ret = 0x01UL; } else if (float64_lt(farg1.d, farg2.d, &env->fp_status...
[ 1, 0 ]
qemu
target-ppc/cpu.h
static const ppc_def_t *ppc_find_by_pvr(uint32_t pvr) { int i; for (i = 0; i < ARRAY_SIZE(ppc_defs); i++) { /* If we have an exact match, we're done */ if (pvr == ppc_defs[i].pvr) { return &ppc_defs[i]; } } return NULL; }
[ 0, 0 ]
qemu
HACKING
qemu_irq *mcf_intc_init(MemoryRegion *sysmem, target_phys_addr_t base, CPUM68KState *env) { mcf_intc_state *s; s = g_malloc0(sizeof(mcf_intc_state)); s->env = env; mcf_intc_reset(s); memory_region_init_io(&s->iomem, &mcf_intc_ops, s, "mcf", 0x100); me...
[ 0, 0 ]
qemu
blockdev.c
void qmp_x_blockdev_set_iothread(const char *node_name, StrOrNull *iothread, Error **errp) { AioContext *old_context; AioContext *new_context; BlockDriverState *bs; bs = bdrv_find_node(node_name); if (!bs) { error_setg(errp, "Cannot find node %s", node_name); ...
[ 0, 0 ]
qemu
hw/arm/nseries.c
static uint64_t pxa2xx_mm_read(void *opaque, hwaddr addr, unsigned size) { PXA2xxState *s = (PXA2xxState *)opaque; switch (addr) { case MDCNFG ... SA1110: if ((addr & 3) == 0) return s->mm_regs[addr >> 2]; default: printf("%s: Bad register " REG_FMT "\n", __...
[ 0, 0 ]
qemu
tcg/aarch64/tcg-target.c
static inline void tcg_out_goto_label(TCGContext *s, int cond, int label_index) { TCGLabel *l = &s->labels[label_index]; if (l->has_value) { tcg_out_goto(s, cond, l->u.value_ptr); } else { tcg_out_reloc(s, s->code_ptr, R_ARM_PC24, label_index, 0); tcg_out_b_noaddr(s, cond); } }
[ 0, 0 ]
qemu
hw/ac97.c
static uint32_t nabm_readl(void *opaque, uint32_t addr) { PCIAC97LinkState *d = opaque; AC97LinkState *s = &d->ac97; AC97BusMasterRegs *r = NULL; uint32_t index = addr - s->base[1]; uint32_t val = ~0U; switch (index) { case PI_BDBAR: case PO_BDBAR: case MC_BDBAR: r = &s->bm_regs[GET_BM(...
[ 0, 0 ]
FFmpeg
libavformat/img.c
static int img_read_packet(AVFormatContext *s1, AVPacket *pkt) { VideoData *s = s1->priv_data; char filename[1024]; int ret; ByteIOContext f1, *f; if (!s->is_pipe) { if (get_frame_filename(filename, sizeof(filename), s->path, s->img_number) < 0) return -EIO; ...
[ 1, 0 ]
qemu
qemu-char.c
int qemu_chr_fe_write_all(CharDriverState *s, const uint8_t *buf, int len) { int offset = 0; int res; qemu_mutex_lock(&s->chr_write_lock); while (offset < len) { do { res = s->chr_write(s, buf + offset, len - offset); if (res == -1 && errno == EAGAIN) { g_usleep(100); } ...
[ 1, 0 ]
qemu
tests/test-cutils.c
static void test_qemu_strtoll_full_empty(void) { const char *str = ""; int64_t res = 999; int err; err = qemu_strtoll(str, NULL, 0, &res); g_assert_cmpint(err, ==, 0); g_assert_cmpint(res, ==, 0); }
[ 1, 0 ]
qemu
configure
bool trace_init_backends(void) { #ifdef CONFIG_TRACE_SIMPLE if (!st_init()) { fprintf(stderr, "failed to initialize simple tracing backend.\n"); return false; } #ifdef CONFIG_TRACE_FTRACE if (!ftrace_init()) { fprintf(stderr, "failed to initialize ftrace backend.\n"); return false; } return tr...
[ 1, 0 ]
qemu
hw/i386/acpi-build.c
static inline void acpi_build_tables_cleanup(AcpiBuildTables *tables, bool mfre) { void *linker_data = bios_linker_loader_cleanup(tables->linker); if (mfre) { g_free(linker_data); } g_array_free(tables->rsdp, mfre); g_array_free(tables->table_data, mfre); g_array_free(tables->tcpalog, mfre); }
[ 1, 0 ]
qemu
target-lm32/translate.c
static void dec_mul(DisasContext *dc) { if (dc->format == OP_FMT_RI) { LOG_DIS("muli r%d, r%d, %d\n", dc->r0, dc->r1, sign_extend(dc->imm16, 16)); } else { LOG_DIS("mul r%d, r%d, r%d\n", dc->r2, dc->r0, dc->r1); } if (!(dc->env->features & LM32_FEATURE_MULTIPLY)) { cpu_abort(dc->...
[ 1, 0 ]
qemu
linux-user/elfload.c
static abi_ulong setup_arg_pages(abi_ulong p, struct linux_binprm *bprm, struct image_info *info) { abi_ulong stack_base, size, error; int i; /* Create enough stack to hold everything. If we don't use * it for args, we'll use it for something else... */ size = x86...
[ 1, 1 ]
qemu
hw/bt/sdp.c
static void bt_l2cap_sdp_close_ch(void *opaque) { struct bt_l2cap_sdp_state_s *sdp = opaque; int i; for (i = 0; i < sdp->services; i++) { g_free(sdp->service_list[i].attribute_list->pair); g_free(sdp->service_list[i].attribute_list); g_free(sdp->service_list[i].uuid); } g_free(sdp->service...
[ 1, 0 ]
qemu
hw/virtio/virtio.c
static uint16_t vring_used_idx(VirtQueue *vq) { VRingMemoryRegionCaches *caches = atomic_rcu_read(&vq->vring.caches); hwaddr pa = offsetof(VRingUsed, idx); return virtio_lduw_phys_cached(vq->vdev, &caches->used, pa); }
[ 1, 0 ]
qemu
hw/core/qdev-properties.c
const char *object_get_typename(Object *obj) { return obj->class->type->name; }
[ 1, 0 ]
qemu
xen-mapcache.c
void xen_map_cache_init(void) { unsigned long size; struct rlimit rlimit_as; mapcache = g_malloc0(sizeof(MapCache)); QTAILQ_INIT(&mapcache->locked_entries); mapcache->last_address_index = -1; getrlimit(RLIMIT_AS, &rlimit_as); if (rlimit_as.rlim_max < MCACHE_MAX_SIZE) { rlimit_as.rlim_cur = rl...
[ 1, 0 ]
FFmpeg
libavformat/tls_securetransport.c
static int tls_read(URLContext *h, uint8_t *buf, int size) { TLSContext *c = h->priv_data; size_t processed = 0; int ret = SSLRead(c->ssl_context, buf, size, &processed); ret = map_ssl_error(ret, processed); if (ret > 0) return ret; if (ret == 0) return AVERROR_EOF; return print_tls_erro...
[ 1, 0 ]
qemu
block/qcow2-snapshot.c
static int qemu_rbd_snap_remove(BlockDriverState *bs, const char *snapshot_name) { BDRVRBDState *s = bs->opaque; int r; r = rbd_snap_remove(s->image, snapshot_name); return r; }
[ 1, 0 ]
qemu
block/raw-posix.c
int tcp_start_incoming_migration(const char *host_port) { struct sockaddr_in addr; int val; int s; if (parse_host_port(&addr, host_port) < 0) { fprintf(stderr, "invalid host/port combination: %s\n", host_port); return -EINVAL; } s = socket(PF_INET, SOCK_STREAM, 0); if (s == -1) retur...
[ 1, 0 ]
FFmpeg
libavcodec/dsputil.c
static void ff_jref_idct1_add(uint8_t *dest, int line_size, DCTELEM *block) { uint8_t *cm = ff_cropTbl + MAX_NEG_CROP; dest[0] = cm[dest[0] + ((block[0] + 4) >> 3)]; }
[ 1, 0 ]
FFmpeg
doc/APIchanges
static int init_file(AVFormatContext *s, OutputStream *os, int64_t start_ts) { int ret, i; ret = avio_open2(&os->out, os->temp_filename, AVIO_FLAG_WRITE, &s->interrupt_callback, NULL); if (ret < 0) return ret; avio_wb32(os->out, 0); avio_wl32(os->out, MKTAG('m', 'd', 'a', 't'));...
[ 1, 0 ]
FFmpeg
libavcodec/amrwbdec.c
static int decode_mime_header(AMRWBContext *ctx, const uint8_t *buf) { /* Decode frame header (1st octet) */ ctx->fr_cur_mode = buf[0] >> 3 & 0x0F; ctx->fr_quality = (buf[0] & 0x4) != 0x4; return 1; }
[ 1, 0 ]
qemu
hw/dma/rc4030.c
static void rc4030_unrealize(DeviceState *dev, Error **errp) { rc4030State *s = RC4030(dev); int i; timer_free(s->periodic_timer); address_space_destroy(&s->dma_as); object_unparent(OBJECT(&s->dma_tt)); object_unparent(OBJECT(&s->dma_tt_alias)); object_unparent(OBJECT(&s->dma_mr)); for (i = 0; ...
[ 1, 0 ]
qemu
exec.c
void qemu_system_guest_panicked(void) { qapi_event_send_guest_panicked(GUEST_PANIC_ACTION_PAUSE, &error_abort); vm_stop(RUN_STATE_GUEST_PANICKED);
[ 1, 0 ]
qemu
block.c
bool bdrv_is_first_non_filter(BlockDriverState *candidate) { BlockDriverState *bs; BdrvNextIterator *it = NULL; /* walk down the bs forest recursively */ while ((it = bdrv_next(it, &bs)) != NULL) { bool perm; /* try to recurse in this top level bs */ perm = bdrv_recurse_is_first_non_filter(b...
[ 1, 0 ]
qemu
block/raw-posix.c
static ssize_t handle_aiocb_rw_linear(RawPosixAIOData *aiocb, char *buf) { ssize_t offset = 0; ssize_t len; while (offset < aiocb->aio_nbytes) { if (aiocb->aio_type & QEMU_AIO_WRITE) { len = pwrite(aiocb->aio_fildes, (const char *)buf + offset, aiocb->aio_nb...
[ 1, 0 ]
FFmpeg
libavcodec/rtjpeg.c
static inline int get_block(GetBitContext *gb, DCTELEM *block, const uint8_t *scan, const uint32_t *quant) { int coeff, i, n; int8_t ac; uint8_t dc = get_bits(gb, 8); // block not coded if (dc == 255) // number of non-zero coefficients coeff = get_bits(gb, 6); // normally...
[ 1, 0 ]
FFmpeg
libavfilter/avfiltergraph.c
static int can_merge_formats(AVFilterFormats *a_arg, AVFilterFormats *b_arg, enum AVMediaType type, int is_sample_rate) { AVFilterFormats *a, *b, *ret; if (a == b) return 1; a = clone_filter_formats(a_arg); b = c...
[ 0, 0 ]
qemu
hw/virtio/virtio.c
void virtio_config_writew(VirtIODevice *vdev, uint32_t addr, uint32_t data) { VirtioDeviceClass *k = VIRTIO_DEVICE_GET_CLASS(vdev); uint16_t val = data; if (addr > (vdev->config_len - sizeof(val))) return; stw_p(vdev->config + addr, val); if (k->set_config) { k->set_config(vdev, vdev->config);...
[ 1, 0 ]
FFmpeg
libavcodec/j2kdec.c
static uint8_t get_sot(J2kDecoderContext *s) { if (s->buf_end - s->buf < 4) return AVERROR(EINVAL); s->curtileno = bytestream_get_be16(&s->buf); ///< Isot if ((unsigned)s->curtileno >= s->numXtiles * s->numYtiles) { s->curtileno = 0; return AVERROR(EINVAL); } s->buf += 4; ///< Psot (ignore...
[ 1, 0 ]
qemu
block/nbd-client.c
static int nbd_co_readv_1(NbdClientSession *client, int64_t sector_num, int nb_sectors, QEMUIOVector *qiov, int offset) { struct nbd_request request; struct nbd_reply reply; ssize_t ret; request.type = NBD_CMD_READ; request.from = sector_num * 512; ...
[ 1, 0 ]
qemu
target/hppa/translate.c
static ExitStatus trans_fop_dew_0e(DisasContext *ctx, uint32_t insn, const DisasInsn *di) { unsigned rt = extract32(insn, 0, 5); unsigned ra = assemble_ra64(insn); return do_fop_dew(ctx, rt, ra, di->f_dew); }
[ 1, 0 ]
qemu
hw/acpi_piix4.c
static int acpi_load_old(QEMUFile *f, void *opaque, int version_id) { PIIX4PMState *s = opaque; int ret, i; uint16_t temp; ret = pci_device_load(&s->dev, f); if (ret < 0) { return ret; } qemu_get_be16s(f, &s->ar.pm1.evt.sts); qemu_get_be16s(f, &s->ar.pm1.evt.en); qemu_get_be16s(f, &s->ar...
[ 1, 0 ]
qemu
hw/usb-ccid.c
static CCIDBus *ccid_bus_new(DeviceState *dev) { CCIDBus *bus; bus = FROM_QBUS(CCIDBus, qbus_create(&ccid_bus_info, dev, NULL)); bus->qbus.allow_hotplug = 1; return bus; }
[ 1, 0 ]
qemu
util/bitmap.c
bool bitmap_test_and_clear_atomic(unsigned long *map, long start, long nr) { unsigned long *p = map + BIT_WORD(start); const long size = start + nr; int bits_to_clear = BITS_PER_LONG - (start % BITS_PER_LONG); unsigned long mask_to_clear = BITMAP_FIRST_WORD_MASK(start); unsigned long dirty = 0; unsigned lon...
[ 1, 0 ]
qemu
block-migration.c
static int blk_mig_save_bulked_block(Monitor *mon, QEMUFile *f) { int64_t completed_sector_sum = 0; BlkMigDevState *bmds; int progress; int ret = 0; QSIMPLEQ_FOREACH(bmds, &block_mig_state.bmds_list, entry) { if (bmds->bulk_completed == 0) { if (mig_save_device_bulk(mon, f, bmds) == 1) { ...
[ 1, 0 ]
FFmpeg
libavformat/wtv.c
static AVIOContext *wtvfile_open2(AVFormatContext *s, const uint8_t *buf, int buf_size, const uint8_t *filename, int filename_size) { const uint8_t *buf_end = buf + buf_size; while (buf + 48 <= buf_end) { int dir_length, name_size, first_se...
[ 1, 0 ]
FFmpeg
libavcodec/texturedsp.c
static inline void dxt5_block_internal(uint8_t *dst, ptrdiff_t stride, const uint8_t *block) { int x, y; uint32_t colors[4]; uint8_t alpha_indices[16]; uint16_t color0 = AV_RL16(block + 8); uint16_t color1 = AV_RL16(block + 10); uint32_t code = AV_RL32(block + ...
[ 1, 0 ]
qemu
target-ppc/cpu.h
void OPPROTO op_POWER_sre(void) { T1 &= 0x1FUL; env->spr[SPR_MQ] = rotl32(T0, 32 - T1); T0 = Ts0 >> T1; RETURN(); }
[ 1, 0 ]
qemu
scripts/tracetool/__init__.py
TraceEvent *trace_event_iter_next(TraceEventIter *iter) { while (iter->event < TRACE_EVENT_COUNT) { TraceEvent *ev = &(trace_events[iter->event]); iter->event++; if (!iter->pattern || pattern_glob(iter->pattern, trace_event_get_name(ev))) { return ev; } } ...
[ 1, 0 ]
qemu
libcacard/cac.c
vcard_free(VCard *vcard) { VCardApplet *current_applet = NULL; VCardApplet *next_applet = NULL; if (vcard == NULL) { return; } vcard->reference_count--; if (vcard->reference_count != 0) { return; } if (vcard->vcard_private_free) { (*vcard->vcard_private_free)(vcard->vcard_private);...
[ 0, 0 ]
qemu
hw/ppc/spapr_hcall.c
static inline bool valid_ptex(PowerPCCPU *cpu, target_ulong ptex) { /* * hash value/pteg group index is normalized by htab_mask */ if (((ptex & ~7ULL) / HPTES_PER_GROUP) & ~cpu->env.htab_mask) { return false; } return true; }
[ 0, 0 ]
qemu
cpus.c
static void *qemu_kvm_cpu_thread_fn(void *arg) { CPUState *env = arg; int r; qemu_mutex_lock(&qemu_global_mutex); qemu_thread_self(env->thread); r = kvm_init_vcpu(env); if (r < 0) { fprintf(stderr, "kvm_init_vcpu failed: %s\n", strerror(-r)); exit(1); } qemu_kvm_init_cpu_signals(env); ...
[ 0, 0 ]