Projectname large_stringclasses 15
values | Filepath large_stringlengths 4 106 ⌀ | Function large_stringlengths 11 3.45k | Label list |
|---|---|---|---|
FFmpeg | libavcodec/pthread.c | static attribute_align_arg void *frame_worker_thread(void *arg)
{
PerThreadContext *p = arg;
FrameThreadContext *fctx = p->parent;
AVCodecContext *avctx = p->avctx;
AVCodec *codec = avctx->codec;
while (1) {
int i;
if (p->state == STATE_INPUT_READY && !fctx->die) {
pthread_mutex_lock(&p... | [
1,
0
] |
qemu | hw/esp.c | static vscsi_req *vscsi_find_req(VSCSIState *s, uint32_t tag)
{
if (tag >= VSCSI_REQ_LIMIT || !s->reqs[tag].active) {
return NULL;
}
return &s->reqs[tag];
} | [
1,
0
] |
qemu | block.c | void do_commit(Monitor *mon, const QDict *qdict)
{
const char *device = qdict_get_str(qdict, "device");
BlockDriverState *bs;
if (!strcmp(device, "all")) {
bdrv_commit_all();
} else {
int ret;
bs = bdrv_find(device);
if (!bs) {
qerror_report(QERR_DEVICE_NOT_FOUND, device);
... | [
1,
0
] |
FFmpeg | libavfilter/avfilter.c | void avfilter_start_frame(AVFilterLink *link, AVFilterPicRef *picref)
{
void (*start_frame)(AVFilterLink *, AVFilterPicRef *);
AVFilterPad *dst = &link_dpad(link);
if (!(start_frame = dst->start_frame))
start_frame = avfilter_default_start_frame;
/* prepare to copy the picture if it has insufficient p... | [
1,
1
] |
qemu | hw/cuda.c | void cuda_init(int *cuda_mem_index, qemu_irq irq)
{
struct tm tm;
CUDAState *s = &cuda_state;
s->irq = irq;
s->timers[0].index = 0;
s->timers[0].timer = qemu_new_timer(vm_clock, cuda_timer1, s);
s->timers[1].index = 1;
qemu_get_timedate(&tm, RTC_OFFSET);
s->tick_offset = mktimegm(&tm);
s->ad... | [
1,
0
] |
FFmpeg | libavcodec/cook.c | static inline void expand_category(COOKContext *q, int *category,
int *category_index)
{
int i;
for (i = 0; i < q->num_vectors; i++)
++category[category_index[i]];
} | [
1,
0
] |
FFmpeg | libavcodec/a64multienc.c | static int gif_encode_close(AVCodecContext *avctx)
{
GIFContext *s = avctx->priv_data;
av_frame_free(&avctx->coded_frame);
av_freep(&s->lzw);
av_freep(&s->buf);
return 0;
} | [
0,
0
] |
FFmpeg | libavcodec/vqavideo.c | static av_cold int vqa_decode_end(AVCodecContext *avctx)
{
VqaContext *s = avctx->priv_data;
av_free(s->codebook);
av_free(s->next_codebook_buffer);
av_free(s->decode_buffer);
if (s->frame.data[0])
avctx->release_buffer(avctx, &s->frame);
return 0;
} | [
0,
0
] |
FFmpeg | libavcodec/a64multienc.c | static av_cold int pam_encode_init(AVCodecContext *avctx)
{
avctx->coded_frame = av_frame_alloc();
if (!avctx->coded_frame)
return AVERROR(ENOMEM);
avctx->coded_frame->pict_type = AV_PICTURE_TYPE_I;
avctx->coded_frame->key_frame = 1;
return 0;
} | [
0,
0
] |
FFmpeg | libavcodec/hevcdsp_template.c | static void FUNC(put_hevc_qpel_bi_w_h)(uint8_t *_dst, ptrdiff_t _dststride,
uint8_t *_src, ptrdiff_t _srcstride,
int16_t *src2,
int height, int denom, int wx0, int wx1,
... | [
1,
0
] |
qemu | hw/arm_gic.c | static qemu_irq *icp_pic_init(uint32_t base,
qemu_irq parent_irq, qemu_irq parent_fiq)
{
icp_pic_state *s;
int iomemtype;
qemu_irq *qi;
s = (icp_pic_state *)qemu_mallocz(sizeof(icp_pic_state));
if (!s)
return NULL;
qi = qemu_allocate_irqs(icp_pic_set_irq, s, 32);
... | [
1,
0
] |
FFmpeg | libavformat/omadec.c | static int nprobe(AVFormatContext *s, uint8_t *enc_header, int size,
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[... | [
0,
0
] |
qemu | hw/ppc405_uc.c | static void dcr_write_pob(void *opaque, int dcrn, uint32_t val)
{
ppc4xx_pob_t *pob;
pob = opaque;
switch (dcrn) {
case POB0_BEAR:
/* Read only */
break;
case POB0_BESR0:
case POB0_BESR1:
/* Write-clear */
pob->besr[dcrn - POB0_BESR0] &= ~val;
break;
}
} | [
1,
0
] |
FFmpeg | libswscale/swscale-example.c | static inline void
yuv2yuvXinC(int16_t *lumFilter, int16_t **lumSrc, int lumFilterSize,
int16_t *chrFilter, int16_t **chrSrc, int chrFilterSize,
uint8_t *dest, uint8_t *uDest, uint8_t *vDest, int dstW,
int chrDstW)
{
// FIXME Optimize (just quickly writen not opti..)
int i;
... | [
1,
1
] |
FFmpeg | libavcodec/mjpeg.c | static int mjpeg_decode_com(MJpegDecodeContext *s)
{
int i;
UINT8 *cbuf;
/* XXX: verify len field validity */
unsigned int len = get_bits(&s->gb, 16) - 2;
cbuf = av_malloc(len + 1);
for (i = 0; i < len; i++)
cbuf[i] = get_bits(&s->gb, 8);
if (cbuf[i - 1] == '\n')
cbuf[i - 1] = 0;
else... | [
1,
1
] |
qemu | dump.c | static ram_addr_t get_start_block(DumpState *s)
{
RAMBlock *block;
if (!s->has_filter) {
s->block = QTAILQ_FIRST(&ram_list.blocks);
return 0;
}
QTAILQ_FOREACH(block, &ram_list.blocks, next) {
if (block->offset >= s->begin + s->length ||
block->offset + block->length <= s->begin) {
... | [
1,
0
] |
FFmpeg | libavformat/matroskadec.c | static int matroska_parse_cluster(MatroskaDemuxContext *matroska)
{
MatroskaCluster cluster = {0};
EbmlList *blocks_list;
MatroskaBlock *blocks;
int i, res;
int64_t pos = url_ftell(matroska->ctx->pb);
matroska->prev_pkt = NULL;
if (matroska->has_cluster_id) {
/* For the first cluster we parse... | [
1,
0
] |
FFmpeg | libavcodec/twinvq.c | static av_cold void init_mdct_win(TwinContext *tctx)
{
int i, j;
const ModeTab *mtab = tctx->mtab;
int size_s = mtab->size / mtab->fmode[FT_SHORT].sub;
int size_m = mtab->size / mtab->fmode[FT_MEDIUM].sub;
int channels = tctx->avctx->channels;
float norm = channels == 1 ? 2. : 1.;
for (i = 0; i < ... | [
1,
0
] |
qemu | memory.c | static MemTxResult memory_region_oldmmio_write_accessor(MemoryRegion *mr,
hwaddr addr,
uint64_t *value,
unsigned size,
... | [
1,
0
] |
FFmpeg | libavformat/aviobuf.c | static uint64_t get_v(ByteIOContext *bc)
{
uint64_t val = 0;
for (; bytes_left(bc) > 0;)
{
int tmp = get_byte(bc);
if (tmp & 0x80)
val = (val << 7) + tmp - 0x80;
else
return (val << 7) + tmp;
}
return -1;
} | [
1,
0
] |
qemu | slirp/mbuf.c | m_get(Slirp *slirp)
{
register struct mbuf *m;
int flags = 0;
DEBUG_CALL("m_get");
if (slirp->m_freelist.m_next == &slirp->m_freelist) {
m = (struct mbuf *)malloc(SLIRP_MSIZE);
if (m == NULL)
goto end_error;
slirp->mbuf_alloced++;
if (slirp->mbuf_alloced > MBUF_THRESH)
flag... | [
1,
0
] |
qemu | hw/block/dataplane/virtio-blk.c | void virtio_blk_data_plane_start(VirtIOBlockDataPlane *s)
{
BusState *qbus = BUS(qdev_get_parent_bus(DEVICE(s->vdev)));
VirtioBusClass *k = VIRTIO_BUS_GET_CLASS(qbus);
VirtIOBlock *vblk = VIRTIO_BLK(s->vdev);
int r;
if (vblk->dataplane_started || s->starting) {
return;
}
s->starting = true;
... | [
1,
0
] |
qemu | hw/s390x/css.c | int do_subchannel_work_passthrough(SubchDev *sch)
{
int ret = 0;
SCSW *s = &sch->curr_status.scsw;
if (s->ctrl & SCSW_FCTL_CLEAR_FUNC) {
/* TODO: Clear handling */
sch_handle_clear_func(sch);
} else if (s->ctrl & SCSW_FCTL_HALT_FUNC) {
/* TODO: Halt handling */
sch_handle_halt_func(sch)... | [
1,
1
] |
qemu | hw/scsi/scsi-bus.c | SCSIRequest *scsi_req_alloc(const SCSIReqOps *reqops, SCSIDevice *d,
uint32_t tag, uint32_t lun, void *hba_private)
{
SCSIRequest *req;
SCSIBus *bus = scsi_bus_from_device(d);
BusState *qbus = BUS(bus);
req = g_malloc0(reqops->size);
req->refcount = 1;
req->bus = bus;
... | [
1,
0
] |
qemu | hw/s390x/sclpconsole.c | static int chr_can_read(void *opaque)
{
int can_read;
SCLPConsole *scon = opaque;
can_read = SIZE_BUFFER_VT220 - scon->iov_data_len;
return can_read;
} | [
1,
0
] |
qemu | target-arm/translate.c | static void gen_op_iwmmxt_setpsr_nz(void)
{
TCGv tmp = new_tmp();
gen_helper_iwmmxt_setpsr_nz(tmp, cpu_M0);
store_cpu_field(tmp, iwmmxt.cregs[ARM_IWMMXT_wCASF]);
} | [
1,
0
] |
qemu | Makefile.objs | static int vmstate_subsection_load(QEMUFile *f, const VMStateDescription *vmsd,
void *opaque)
{
while (qemu_peek_byte(f, 0) == QEMU_VM_SUBSECTION) {
char idstr[256];
int ret;
uint8_t version_id, len, size;
const VMStateDescription *sub_vmsd;
len = qemu_pe... | [
1,
0
] |
FFmpeg | avconv.c | int show_filters(void *optctx, const char *opt, const char *arg)
{
AVFilter av_unused(**filter) = NULL;
printf("Filters:\n");
#if CONFIG_AVFILTER
while ((filter = av_filter_next(filter)) && *filter)
printf("%-16s %s\n", (*filter)->name, (*filter)->description);
#endif
return 0;
} | [
0,
0
] |
FFmpeg | libavcodec/vp9_superframe_bsf.c | static void vp9_superframe_close(AVBSFContext *ctx)
{
VP9BSFContext *s = ctx->priv_data;
int n;
// free cached data
for (n = 0; n < s->n_cache; n++)
av_packet_free(&s->cache[n]);
} | [
1,
0
] |
qemu | hw/pci/pci.c | PCIDevice *pci_nic_init_nofail(NICInfo *nd, PCIBus *rootbus,
const char *default_model,
const char *default_devaddr)
{
Error *err = NULL;
PCIDevice *res;
if (qemu_show_nic_models(nd->model, pci_nic_models))
exit(0);
res = pci_nic_init(nd,... | [
1,
0
] |
qemu | block/blkverify.c | static void blkverify_aio_bh(void *opaque)
{
BlkverifyAIOCB *acb = opaque;
if (acb->buf) {
qemu_iovec_destroy(&acb->raw_qiov);
qemu_vfree(acb->buf);
}
acb->common.cb(acb->common.opaque, acb->ret);
qemu_aio_unref(acb);
} | [
1,
0
] |
qemu | hw/vhost.c | static void vhost_dev_sync_region(struct vhost_dev *dev,
uint64_t mfirst, uint64_t mlast,
uint64_t rfirst, uint64_t rlast)
{
uint64_t start = MAX(mfirst, rfirst);
uint64_t end = MIN(mlast, rlast);
vhost_log_chunk_t *from = dev->log + start ... | [
1,
0
] |
qemu | hmp.c | void hmp_chardev_add(Monitor *mon, const QDict *qdict)
{
const char *args = qdict_get_str(qdict, "args");
Error *err = NULL;
QemuOpts *opts;
opts = qemu_opts_parse_noisily(qemu_find_opts("chardev"), args, true);
if (opts == NULL) {
error_setg(&err, "Parsing chardev args failed");
} else {
q... | [
1,
0
] |
qemu | hw/i386/xen/xen_platform.c | static int xen_platform_initfn(PCIDevice *dev) {
PCIXenPlatformState *d = XEN_PLATFORM(dev);
uint8_t *pci_conf;
pci_conf = dev->config;
pci_set_word(pci_conf + PCI_COMMAND, PCI_COMMAND_IO | PCI_COMMAND_MEMORY);
pci_config_set_prog_interface(pci_conf, 0);
pci_conf[PCI_INTERRUPT_PIN] = 1;
platform_ioport_ba... | [
1,
0
] |
qemu | hw/i386/pc_piix.c | void pvpanic_init(ISABus *bus)
{
isa_create_simple(bus, TYPE_ISA_PVPANIC_DEVICE);
} | [
1,
0
] |
FFmpeg | libavcodec/loco.c | static int
loco_decode_plane(LOCOContext *l, uint8_t *data, int width, int height,
int stride, const uint8_t *buf, int buf_size, int step)
{
RICEContext rc;
int val;
int i, j;
if (buf_size <= 0)
return -1;
init_get_bits8(&rc.gb, buf, buf_size);
rc.save = 0;
rc.run = 0;
r... | [
1,
0
] |
FFmpeg | libavcodec/mpegvideo.c | static void copy_bits(PutBitContext *pb, UINT8 *src, int length)
{
#if 1
int bytes = length >> 4;
int bits = length & 15;
int i;
for (i = 0; i < bytes; i++)
put_bits(pb, 16, be2me_16(((uint16_t *)src)[i]));
put_bits(pb, bits, be2me_16(((uint16_t *)src)[i]) >> (16 - bits));
#else
int bytes = len... | [
0,
0
] |
FFmpeg | libavdevice/v4l2.c | static void mmap_release_buffer(AVPacket *pkt)
{
struct v4l2_buffer buf;
int res, fd;
struct buff_data *buf_descriptor = pkt->priv;
if (pkt->data == NULL)
return;
memset(&buf, 0, sizeof(struct v4l2_buffer));
buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
buf.memory = V4L2_MEMORY_MMAP;
buf.index =... | [
1,
0
] |
qemu | main-loop.c | static void pollfds_poll(GArray *pollfds, int nfds, fd_set *rfds,
fd_set *wfds, fd_set *xfds)
{
int i;
for (i = 0; i < pollfds->len; i++) {
GPollFD *pfd = &g_array_index(pollfds, GPollFD, i);
int fd = pfd->fd;
int revents = 0;
if (FD_ISSET(fd, rfds)) {
revents... | [
1,
0
] |
FFmpeg | libavcodec/pthread.c | static av_always_inline void avcodec_thread_park_workers(ThreadContext *c,
int thread_count)
{
pthread_cond_wait(&c->last_job_cond, &c->current_job_lock);
pthread_mutex_unlock(&c->current_job_lock);
} | [
1,
0
] |
qemu | block/vvfat.c | static int write_target_commit(BlockDriverState *bs, int64_t sector_num,
const uint8_t *buffer, int nb_sectors) {
BDRVVVFATState *s = bs->opaque;
return try_commit(s);
} | [
1,
0
] |
FFmpeg | avprobe.c | static void show_packets(AVFormatContext *fmt_ctx)
{
AVPacket pkt;
av_init_packet(&pkt);
probe_array_header("packets", 0);
while (!av_read_frame(fmt_ctx, &pkt))
show_packet(fmt_ctx, &pkt);
probe_array_footer("packets", 0);
} | [
1,
0
] |
FFmpeg | libswscale/swscale_template.c | static inline void RENAME(yuy2ToY)(uint8_t *dst, uint8_t *src, long width)
{
#ifdef HAVE_MMX
asm volatile(
"movq " MANGLE(bm01010101) ", %%mm2\n\t"
"mov %0, %%" REG_a " \n\t"
"1: \n\t"
"movq (%1, %%" RE... | [
1,
1
] |
qemu | block-migration.c | BdrvDirtyBitmap *bdrv_create_dirty_bitmap(BlockDriverState *bs, int granularity,
Error **errp)
{
int64_t bitmap_size;
BdrvDirtyBitmap *bitmap;
assert((granularity & (granularity - 1)) == 0);
granularity >>= BDRV_SECTOR_BITS;
assert(granularity);
bitmap_size ... | [
1,
0
] |
qemu | Makefile.objs | void qemu_bh_delete(QEMUBH *bh)
{
qemu_free(bh);
} | [
0,
0
] |
qemu | hw/dp8393x.c | static void net_socket_receive(void *opaque, const uint8_t *buf, size_t size)
{
NetSocketState *s = opaque;
uint32_t len;
len = htonl(size);
send_all(s->fd, (const uint8_t *)&len, sizeof(len));
send_all(s->fd, buf, size);
} | [
1,
0
] |
qemu | target-unicore32/Makefile.objs | float64 HELPER(ucf64_divd)(float64 a, float64 b, CPUUniCore32State *env)
{
return float64_div(a, b, &env->ucf64.fp_status);
} | [
0,
0
] |
qemu | hw/vfio/common.c | int vfio_mmap_region(Object *obj, VFIORegion *region,
MemoryRegion *mem, MemoryRegion *submem,
void **map, size_t size, off_t offset,
const char *name)
{
int ret = 0;
VFIODevice *vbasedev = region->vbasedev;
if (vbasedev->allow_mmap && size &&
... | [
1,
0
] |
qemu | hw/nseries.c | static uint64_t omap_ulpd_pm_read(void *opaque, target_phys_addr_t addr,
unsigned size)
{
struct omap_mpu_state_s *s = (struct omap_mpu_state_s *)opaque;
uint16_t ret;
if (size != 2) {
return omap_badwidth_read16(opaque, addr);
}
switch (addr) {
case 0x14: /* IT... | [
1,
1
] |
qemu | HACKING | static uint64_t apb_config_readl(void *opaque,
target_phys_addr_t addr, unsigned size)
{
APBState *s = opaque;
uint32_t val;
switch (addr & 0xffff) {
case 0x30 ... 0x4f: /* DMA error registers */
val = 0;
/* XXX: not implemented yet */
break;
case 0x200 .... | [
0,
1
] |
qemu | block.c | int coroutine_fn bdrv_is_allocated(BlockDriverState *bs, int64_t sector_num,
int nb_sectors, int *pnum)
{
int64_t ret = bdrv_get_block_status(bs, sector_num, nb_sectors, pnum);
if (ret < 0) {
return ret;
}
return (ret & BDRV_BLOCK_ALLOCATED);
} | [
1,
0
] |
qemu | hw/usb/dev-network.c | static int rndis_query_response(USBNetState *s,
rndis_query_msg_type *buf, unsigned int length)
{
rndis_query_cmplt_type *resp;
/* oid_supported_list is the largest data reply */
uint8_t infobuf[sizeof(oid_supported_list)];
uint32_t bufoffs, buflen;
int infobuflen;
un... | [
1,
0
] |
qemu | main-loop.c | static int pollfds_fill(GArray *pollfds, fd_set *rfds, fd_set *wfds,
fd_set *xfds)
{
int nfds = -1;
int i;
for (i = 0; i < pollfds->len; i++) {
GPollFD *pfd = &g_array_index(pollfds, GPollFD, i);
int fd = pfd->fd;
int events = pfd->events;
if (events & (G_IO_IN | G... | [
1,
0
] |
qemu | net/eth.c | _eth_get_rss_ex_src_addr(const struct iovec *pkt, int pkt_frags,
size_t dsthdr_offset,
struct ip6_ext_hdr *ext_hdr,
struct in6_address *src_addr)
{
size_t bytes_left = (ext_hdr->ip6r_len + 1) * 8 - sizeof(*ext_hdr);
struct ip6_option_h... | [
1,
0
] |
FFmpeg | libavformat/ftp.c | static int ftp_getc(FTPContext *s)
{
int len;
if (s->control_buf_ptr >= s->control_buf_end) {
if (s->conn_control_block_flag)
return AVERROR_EXIT;
len = ffurl_read(s->conn_control, s->control_buffer, CONTROL_BUFFER_SIZE);
if (len < 0) {
return len;
} else if (!len) {
retu... | [
1,
0
] |
qemu | hw/ide/ich.c | static int pci_ich9_ahci_init(PCIDevice *dev)
{
struct AHCIPCIState *d;
d = DO_UPCAST(struct AHCIPCIState, card, dev);
pci_config_set_vendor_id(d->card.config, PCI_VENDOR_ID_INTEL);
pci_config_set_device_id(d->card.config, PCI_DEVICE_ID_INTEL_82801IR);
pci_config_set_class(d->card.config, PCI_CLASS_STOR... | [
1,
1
] |
qemu | tests/check-qjson.c | static void test_visitor_out_enum(TestOutputVisitorData *data,
const void *unused)
{
QObject *obj;
EnumOne i;
for (i = 0; i < ENUM_ONE__MAX; i++) {
visit_type_EnumOne(data->ov, "unused", &i, &error_abort);
obj = visitor_get(data);
g_assert(qobject_type(obj) ==... | [
0,
0
] |
qemu | hw/ac97.c | static void nabm_writel(void *opaque, uint32_t addr, uint32_t val)
{
PCIAC97LinkState *d = opaque;
AC97LinkState *s = &d->ac97;
AC97BusMasterRegs *r = NULL;
uint32_t index = addr - s->base[1];
switch (index) {
case PI_BDBAR:
case PO_BDBAR:
case MC_BDBAR:
r = &s->bm_regs[GET_BM(index)];
... | [
1,
0
] |
qemu | hw/spapr_pci.c | static uint64_t spapr_io_read(void *opaque, hwaddr addr,
unsigned size)
{
switch (size) {
case 1:
return cpu_inb(addr);
case 2:
return cpu_inw(addr);
case 4:
return cpu_inl(addr);
}
assert(0);
} | [
1,
0
] |
qemu | block.c | static bool bdrv_is_valid_name(const char *name)
{
return qemu_opts_id_wellformed(name);
} | [
0,
0
] |
qemu | hw/intc/xics.c | static void xics_realize(DeviceState *dev, Error **errp)
{
XICSState *icp = XICS(dev);
ICSState *ics = icp->ics;
Error *error = NULL;
int i;
if (!icp->nr_servers) {
error_setg(errp, "Number of servers needs to be greater 0");
return;
}
/* Registration of global state belongs into realize ... | [
1,
0
] |
qemu | ui/vnc-auth-vencrypt.c | static void vnc_tls_handshake_io(void *opaque) {
struct VncState *vs = (struct VncState *)opaque;
VNC_DEBUG("Handshake IO continue\n");
vnc_start_vencrypt_handshake(vs);
} | [
0,
0
] |
qemu | qemu-nbd.c | static void termsig_handler(int signum)
{
static int sigterm_reported;
if (!sigterm_reported) {
sigterm_reported = (write(sigterm_wfd, "", 1) == 1);
}
} | [
0,
0
] |
qemu | target-arm/helper.c | static void handle_sync(DisasContext *s, uint32_t insn,
unsigned int op1, unsigned int op2, unsigned int crm)
{
if (op1 != 3) {
unallocated_encoding(s);
return;
}
switch (op2) {
case 2: /* CLREX */
gen_clrex(s, insn);
return;
case 4: /* DSB */
case 5: /* DM... | [
0,
0
] |
qemu | target-arm/cpu.c | static inline int get_phys_addr(CPUARMState *env, uint32_t address,
int access_type, int is_user,
hwaddr *phys_ptr, int *prot,
target_ulong *page_size)
{
/* Fast Context Switch Extension. */
if (address < 0x020000... | [
1,
0
] |
qemu | hw/scsi/scsi-bus.c | void scsi_req_abort(SCSIRequest *req, int status)
{
if (!req->enqueued) {
return;
}
scsi_req_ref(req);
scsi_req_dequeue(req);
req->io_canceled = true;
if (req->ops->cancel_io) {
req->ops->cancel_io(req);
}
scsi_req_complete(req, status);
scsi_req_unref(req);
} | [
0,
0
] |
qemu | cmd.c | command_loop(void)
{
int c, i, j = 0, done = 0;
char *input;
char **v;
const cmdinfo_t *ct;
for (i = 0; !done && i < ncmdline; i++) {
input = strdup(cmdline[i]);
if (!input) {
fprintf(stderr,
_("cannot strdup command '%s': %s\n"),
cmdline[i], strerror(errno... | [
1,
0
] |
qemu | memory.c | void memory_region_sync_dirty_bitmap(MemoryRegion *mr)
{
AddressSpace *as;
FlatRange *fr;
QTAILQ_FOREACH(as, &address_spaces, address_spaces_link) {
FlatView *view = as->current_map;
FOR_EACH_FLAT_RANGE(fr, view) {
if (fr->mr == mr) {
MEMORY_LISTENER_UPDATE_REGION(fr, as, Forward, lo... | [
0,
0
] |
FFmpeg | libavformat/rdt.c | rdt_free_extradata(PayloadContext *rdt)
{
int i;
for (i = 0; i < MAX_STREAMS; i++)
if (rdt->rmst[i]) {
ff_rm_free_rmstream(rdt->rmst[i]);
av_freep(&rdt->rmst[i]);
}
if (rdt->rmctx)
av_close_input_stream(rdt->rmctx);
av_freep(&rdt->mlti_data);
av_free(rdt);
} | [
0,
0
] |
qemu | hmp-commands.hx | static int migrate_fd_close(void *opaque)
{
MigrationState *s = opaque;
if (s->mon) {
monitor_resume(s->mon);
}
qemu_set_fd_handler2(s->fd, NULL, NULL, NULL, NULL);
return s->close(s);
} | [
0,
0
] |
qemu | block/qcow2-cache.c | int qcow2_get_refcount(BlockDriverState *bs, int64_t cluster_index,
uint64_t *refcount)
{
BDRVQcowState *s = bs->opaque;
uint64_t refcount_table_index, block_index;
int64_t refcount_block_offset;
int ret;
void *refcount_block;
refcount_table_index = cluster_index >> s->refcoun... | [
1,
0
] |
qemu | Makefile.objs | static void jpeg_prepare_row24(VncState *vs, uint8_t *dst, int x, int y,
int count)
{
VncDisplay *vd = vs->vd;
uint32_t *fbptr;
uint32_t pix;
fbptr = (uint32_t *)(vd->server->data + y * ds_get_linesize(vs->ds) +
x * ds_get_bytes_per_pixel(vs->ds));
... | [
1,
0
] |
qemu | HACKING | static void dp8393x_writeb(void *opaque, target_phys_addr_t addr, uint32_t val)
{
uint16_t old_val = dp8393x_readw(opaque, addr & ~0x1);
switch (addr & 3) {
case 0:
val = val | (old_val & 0xff00);
break;
case 1:
val = (val << 8) | (old_val & 0x00ff);
break;
}
dp8393x_writew(opaque,... | [
1,
0
] |
qemu | memory.c | static uint32_t memory_region_read_thunk_n(void *_mr,
target_phys_addr_t addr,
unsigned size)
{
MemoryRegion *mr = _mr;
uint64_t data = 0;
if (!memory_region_access_valid(mr, addr, size)) {
return -1U; /* FIXME: bette... | [
1,
1
] |
qemu | target-sparc/fop_helper.c | int64_t helper_fstox(CPUSPARCState *env, float32 src)
{
int64_t ret;
clear_float_exceptions(env);
ret = float32_to_int64_round_to_zero(src, &env->fp_status);
check_ieee_exceptions(env);
return ret;
} | [
0,
0
] |
qemu | block.c | static int raw_open_common(BlockDriverState *bs, QDict *options,
int bdrv_flags, int open_flags, Error **errp)
{
BDRVRawState *s = bs->opaque;
QemuOpts *opts;
Error *local_err = NULL;
const char *filename;
int fd, ret;
opts = qemu_opts_create_nofail(&raw_runtime_opts);
... | [
0,
0
] |
qemu | block/qcow2-cluster.c | int qcow2_encrypt_sectors(BDRVQcow2State *s, int64_t sector_num,
uint8_t *buf, int nb_sectors, bool enc,
Error **errp)
{
union {
uint64_t ll[2];
uint8_t b[16];
} ivec;
int i;
int ret;
for (i = 0; i < nb_sectors; i++) {
ivec.ll[0] = cpu... | [
0,
0
] |
FFmpeg | libavcodec/options_table.h | int av_opt_set_sample_fmt(void *obj, const char *name, enum AVSampleFormat fmt,
int search_flags)
{
return set_format(obj, name, fmt, search_flags, AV_OPT_TYPE_SAMPLE_FMT,
"sample", AV_SAMPLE_FMT_NB - 1);
} | [
0,
0
] |
FFmpeg | libswscale/Makefile | static void RENAME(yuyvtoyuv422)(uint8_t *ydst, uint8_t *udst, uint8_t *vdst,
const uint8_t *src,
long width, long height,
long lumStride, long chromStride,
long srcStride)
{
long y;... | [
0,
0
] |
FFmpeg | libavcodec/xan.c | static inline void xan_wc3_copy_pixel_run(XanContext *s, AVFrame *frame,
int x, int y,
int pixel_count, int motion_x,
int motion_y)
{
int stride;
int line_inc;
int curframe_index, p... | [
1,
0
] |
FFmpeg | libavformat/electronicarts.c | static int ea_probe(AVProbeData *p)
{
switch (AV_RL32(&p->buf[0])) {
case ISNh_TAG:
case SCHl_TAG:
case SEAD_TAG:
case SHEN_TAG:
case kVGT_TAG:
case MADk_TAG:
case MPCh_TAG:
case MVhd_TAG:
case MVIh_TAG:
break;
default:
return 0;
}
if (AV_RL32(&p->buf[4]) > 0xfffff && AV... | [
1,
0
] |
qemu | hw/arm/omap1.c | static struct omap_watchdog_timer_s *omap_wd_timer_init(MemoryRegion *memory,
hwaddr base,
qemu_irq irq,
omap_clk clk)
{
struct omap_watchdog_time... | [
1,
0
] |
FFmpeg | libavformat/utils.c | static int tb_unreliable(AVCodecContext *c)
{
if (c->time_base.den >= 101L * c->time_base.num ||
c->time_base.den < 5L * c->time_base.num ||
// c->codec_tag == AV_RL32("DIVX") ||
// c->codec_tag == AV_RL32("XVID") ||
c->codec_id == AV_CODEC_ID_MPEG2VIDEO ||
c->codec_id == AV_CODEC... | [
1,
0
] |
FFmpeg | libavcodec/ac3enc.c | static inline int asym_quant(int c, int e, int qbits)
{
int m;
c = (((c << e) >> (24 - qbits)) + 1) >> 1;
m = (1 << (qbits - 1));
if (c >= m)
c = m - 1;
av_assert2(c >= -m);
return c;
} | [
1,
0
] |
qemu | block/vvfat.c | static int64_t coroutine_fn vvfat_co_get_block_status(BlockDriverState *bs,
int64_t sector_num,
int nb_sectors, int *n,
BlockDriverState **file)
{
BDRVVV... | [
1,
0
] |
qemu | configure | static void usbredir_handle_bulk_data(USBRedirDevice *dev, USBPacket *p,
uint8_t ep)
{
struct usb_redir_bulk_packet_header bulk_packet;
size_t size = (p->combined) ? p->combined->iov.size : p->iov.size;
DPRINTF("bulk-out ep %02X len %zd id %" PRIu64 "\n", ep, size, p->id... | [
1,
0
] |
FFmpeg | libavformat/dvbsub.c | static int dvbsub_probe(AVProbeData *p)
{
int i, j, k;
const uint8_t *end = p->buf + p->buf_size;
int type, len;
int max_score = 0;
for (i = 0; i < p->buf_size; i++) {
if (p->buf[i] == 0x0f) {
const uint8_t *ptr = p->buf + i;
uint8_t histogram[6] = {0};
int min = 255;
fo... | [
1,
0
] |
qemu | hw/char/xen_console.c | static void common_unbind(struct common *c)
{
xen_be_unbind_evtchn(&c->xendev);
if (c->page) {
munmap(c->page, XC_PAGE_SIZE);
c->page = NULL;
}
} | [
1,
0
] |
qemu | hw/dp8393x.c | static NetSocketState *net_socket_fd_init_stream(VLANState *vlan,
const char *model,
const char *name,
int fd, int is_connected)
{
NetSocketState *s;
s = qemu_mall... | [
1,
0
] |
qemu | qemu-option.c | int qemu_opt_set_bool(QemuOpts *opts, const char *name, bool val)
{
QemuOpt *opt;
const QemuOptDesc *desc = opts->list->desc;
int i;
for (i = 0; desc[i].name != NULL; i++) {
if (strcmp(desc[i].name, name) == 0) {
break;
}
}
if (desc[i].name == NULL) {
if (i == 0) {
/* empty... | [
1,
0
] |
FFmpeg | libavcodec/mpegvideo.h | static void merge_context_after_encode(MpegEncContext *dst,
MpegEncContext *src) {
int i;
MERGE(dct_count[0]); // note, the other dct vars are not part of the context
MERGE(dct_count[1]);
MERGE(mv_bits);
MERGE(i_tex_bits);
MERGE(p_tex_bits);
MERGE(i_count);
... | [
1,
0
] |
FFmpeg | ffserver_config.c | static int ffserver_set_int_param(int *dest, const char *value, int factor,
int min, int max, FFServerConfig *config,
const char *error_msg, ...)
{
int tmp;
char *tailp;
if (!value || !value[0])
goto error;
errno = 0;
tmp = strto... | [
1,
0
] |
FFmpeg | libavcodec/dsputil.c | static inline void h264_loop_filter_chroma_intra_c(uint8_t *pix, int xstride,
int ystride, int alpha,
int beta)
{
int d;
for (d = 0; d < 8; d++) {
const int p0 = pix[-1 * xstride];
const int p1 = pix[-... | [
1,
0
] |
FFmpeg | libavcodec/avcodec.h | static inline void get_limits(MpegEncContext *s, int *range, int *xmin,
int *ymin, int *xmax, int *ymax, int f_code)
{
*range = 8 * (1 << (f_code - 1));
/* XXX: temporary kludge to avoid overflow for msmpeg4 */
if (s->out_format == FMT_H263 && !s->h263_msmpeg4)
*range *= 2;
... | [
1,
1
] |
qemu | Makefile.objs | static void qemu_rdma_move_header(RDMAContext *rdma, int idx,
RDMAControlHeader *head)
{
rdma->wr_data[idx].control_len = head->len;
rdma->wr_data[idx].control_curr =
rdma->wr_data[idx].control + sizeof(RDMAControlHeader);
} | [
1,
0
] |
qemu | target-ppc/cpu.h | void ppc_store_msr_32(CPUPPCState *env, uint32_t value)
{
do_store_msr(env,
(do_load_msr(env) & ~0xFFFFFFFFULL) | (value & 0xFFFFFFFF));
} | [
1,
0
] |
FFmpeg | libavcodec/fic.c | static int fic_decode_slice(AVCodecContext *avctx, void *tdata)
{
FICContext *ctx = avctx->priv_data;
FICThreadContext *tctx = tdata;
GetBitContext gb;
uint8_t *src = tctx->src;
int slice_h = tctx->slice_h;
int src_size = tctx->src_size;
int y_off = tctx->y_off;
int x, y, p;
init_get_bits(&g... | [
1,
0
] |
FFmpeg | libavutil/md5.c | static void body(uint32_t ABCD[4], uint32_t X[16])
{
int i av_unused;
uint32_t t;
uint32_t a = ABCD[3];
uint32_t b = ABCD[2];
uint32_t c = ABCD[1];
uint32_t d = ABCD[0];
#if HAVE_BIGENDIAN
for (i = 0; i < 16; i++)
X[i] = av_bswap32(X[i]);
#endif
#if CONFIG_SMALL
for (i = 0; i < 64; i++)... | [
0,
0
] |
qemu | hw/core/qdev-properties.c | void qdev_prop_set_globals(DeviceState *dev)
{
ObjectClass *class = object_get_class(OBJECT(dev));
do {
qdev_prop_set_globals_for_type(dev, object_class_get_name(class));
class = object_class_get_parent(class);
} while (class);
} | [
1,
0
] |
qemu | Makefile.objs | const QEMUSizedBuffer *qemu_buf_get(QEMUFile *f)
{
QEMUBuffer *p;
qemu_fflush(f);
p = f->opaque;
return p->qsb;
} | [
1,
0
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.