Projectname large_stringclasses 15
values | Filepath large_stringlengths 4 106 ⌀ | Function large_stringlengths 11 3.45k | Label list |
|---|---|---|---|
FFmpeg | libavfilter/src_movie.c | static int amovie_request_frame(AVFilterLink *outlink)
{
MovieContext *movie = outlink->src->priv;
int ret;
if (movie->is_done)
return AVERROR_EOF;
if ((ret = amovie_get_samples(outlink)) < 0)
return ret;
avfilter_filter_samples(outlink, avfilter_ref_buffer(movie->samplesref, ~0));
avfilter... | [
1,
0
] |
qemu | hw/usb/hcd-xhci.c | static TRBCCode xhci_disable_ep(XHCIState *xhci, unsigned int slotid,
unsigned int epid)
{
XHCISlot *slot;
XHCIEPContext *epctx;
int i;
trace_usb_xhci_ep_disable(slotid, epid);
assert(slotid >= 1 && slotid <= xhci->numslots);
assert(epid >= 1 && epid <= 31);
slot =... | [
1,
0
] |
qemu | hw/virtio-net.c | static int virtio_net_can_receive(VLANClientState *vc)
{
VirtIONet *n = vc->opaque;
return do_virtio_net_can_receive(n, VIRTIO_NET_MAX_BUFSIZE);
} | [
0,
0
] |
qemu | HACKING | static void intel_hda_mmio_writel(void *opaque, target_phys_addr_t addr,
uint32_t val)
{
IntelHDAState *d = opaque;
const IntelHDAReg *reg = intel_hda_reg_find(d, addr);
intel_hda_reg_write(d, reg, val, 0xffffffff);
} | [
0,
0
] |
qemu | cpus.c | static void qemu_wait_io_event(CPUState *env)
{
while (!tcg_has_work())
qemu_cond_timedwait(env->halt_cond, &qemu_global_mutex, 1000);
qemu_mutex_unlock(&qemu_global_mutex);
/*
* Users of qemu_global_mutex can be starved, having no chance
* to acquire it since this path will get to it first.
... | [
0,
0
] |
qemu | include/block/coroutine_int.h | void qemu_co_queue_init(CoQueue *queue)
{
QTAILQ_INIT(&queue->entries);
/* This will be exposed to callers once there are multiple AioContexts */
queue->ctx = qemu_get_aio_context();
} | [
0,
0
] |
qemu | hw/acpi/aml-build.c | build_rsdt(GArray *table_data, BIOSLinker *linker, GArray *table_offsets,
const char *oem_id, const char *oem_table_id)
{
AcpiRsdtDescriptorRev1 *rsdt;
size_t rsdt_len;
int i;
const int table_data_len = (sizeof(uint32_t) * table_offsets->len);
rsdt_len = sizeof(*rsdt) + table_data_len;
rs... | [
1,
0
] |
FFmpeg | libavcodec/libfaac.c | static av_cold int Faac_encode_close(AVCodecContext *avctx)
{
FaacAudioContext *s = avctx->priv_data;
av_freep(&avctx->coded_frame);
av_freep(&avctx->extradata);
faacEncClose(s->faac_handle);
return 0;
} | [
0,
0
] |
qemu | backends/tpm.c | void tpm_backend_cancel_cmd(TPMBackend *s)
{
TPMBackendClass *k = TPM_BACKEND_GET_CLASS(s);
assert(k->cancel_cmd);
k->cancel_cmd(s);
} | [
1,
0
] |
qemu | hw/esp.c | void scsi_bus_legacy_handle_cmdline(SCSIBus *bus)
{
DriveInfo *dinfo;
int unit;
for (unit = 0; unit < MAX_SCSI_DEVS; unit++) {
dinfo = drive_get(IF_SCSI, bus->busnr, unit);
if (dinfo == NULL) {
continue;
}
scsi_bus_legacy_add_drive(bus, dinfo, unit);
}
} | [
1,
0
] |
qemu | target-arm/translate.c | static TCGv_i32 new_tmp(void)
{
num_temps++;
return tcg_temp_new_i32();
} | [
1,
0
] |
qemu | hw/s390x/css.c | void ioinst_handle_ssch(S390CPU *cpu, uint64_t reg1, uint32_t ipb)
{
int cssid, ssid, schid, m;
SubchDev *sch;
ORB orig_orb, orb;
uint64_t addr;
int ret = -ENODEV;
int cc;
CPUS390XState *env = &cpu->env;
uint8_t ar;
addr = decode_basedisp_s(env, ipb, &ar);
if (addr & 3) {
program_int... | [
1,
1
] |
FFmpeg | libavcodec/nvdec.c | static int nvdec_vp9_decode_slice(AVCodecContext *avctx, const uint8_t *buffer,
uint32_t size)
{
NVDECContext *ctx = avctx->internal->hwaccel_priv_data;
void *tmp;
tmp = av_fast_realloc(ctx->slice_offsets, &ctx->slice_offsets_allocated,
(ctx->nb_slice... | [
1,
0
] |
FFmpeg | tests/checkasm/jpeg2000dsp.c | static void check_mct(uint8_t *ref0, uint8_t *ref1, uint8_t *ref2,
uint8_t *new0, uint8_t *new1, uint8_t *new2) {
declare_func(void, void *src0, void *src1, void *src2, int csize);
randomize_buffers();
call_ref(ref0, ref1, ref2, BUF_SIZE / sizeof(int32_t));
call_new(new0, new1, new2, ... | [
1,
0
] |
FFmpeg | libavcodec/h264addpx_template.c | static void FUNCC(ff_h264_add_pixels4)(uint8_t *_dst, int16_t *_src, int stride)
{
int i;
pixel *dst = (pixel *)_dst;
dctcoef *src = (dctcoef *)_src;
stride /= sizeof(pixel);
for (i = 0; i < 4; i++) {
dst[0] += src[0];
dst[1] += src[1];
dst[2] += src[2];
dst[3] += src[3];
dst +=... | [
1,
0
] |
FFmpeg | libavcodec/ac3dec.c | static inline void downmix_3f_1r_to_dolby(float *samples)
{
int i;
for (i = 0; i < 256; i++) {
samples[i] += (samples[i + 256] - samples[i + 768]);
samples[i + 256] += (samples[i + 512] + samples[i + 768]);
samples[i + 512] = samples[i + 768] = 0;
}
} | [
0,
0
] |
qemu | qom/cpu.c | static void sparc_cpu_realizefn(DeviceState *dev, Error **errp) {
SPARCCPUClass *scc = SPARC_CPU_GET_CLASS(dev);
scc->parent_realize(dev, errp);
} | [
1,
0
] |
qemu | Makefile.objs | static void block_migration_cancel(void *opaque)
{
blk_mig_cleanup();
} | [
1,
0
] |
FFmpeg | doc/APIchanges | static int mov_read_dac3(MOVContext *c, AVIOContext *pb, MOVAtom atom)
{
AVStream *st;
enum AVAudioServiceType *ast;
int ac3info, acmod, lfeon, bsmod;
if (c->fc->nb_streams < 1)
return 0;
st = c->fc->streams[c->fc->nb_streams - 1];
ast = (enum AVAudioServiceType *)ff_stream_new_side_data(
... | [
1,
0
] |
qemu | console.c | static int jazz_led_init(SysBusDevice *dev)
{
LedState *s = FROM_SYSBUS(LedState, dev);
memory_region_init_io(&s->iomem, &led_ops, s, "led", 1);
sysbus_init_mmio(dev, &s->iomem);
s->ds = graphic_console_init(jazz_led_update_display,
jazz_led_invalidate_display,
... | [
1,
0
] |
qemu | Makefile.objs | static int blk_mig_save_bulked_block(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(f, bmds) == 1) {
/* completed ... | [
1,
0
] |
qemu | HACKING | dma_read(void *opaque, target_phys_addr_t addr, unsigned int size)
{
struct fs_dma_ctrl *ctrl = opaque;
int c;
uint32_t r = 0;
if (size != 4) {
dma_rinvalid(opaque, addr);
}
/* Make addr relative to this channel and bounded to nr regs. */
c = fs_channel(addr);
addr &= 0xff;
addr >>= 2;
... | [
1,
0
] |
qemu | check-qint.c | START_TEST(qint_from_int64_test)
{
QInt *qi;
const int64_t value = 0x1234567890abcdefLL;
qi = qint_from_int(value);
fail_unless((int64_t)qi->value == value);
QDECREF(qi);
} | [
1,
0
] |
qemu | qemu-char.c | static gboolean pty_chr_read(GIOChannel *chan, GIOCondition cond, void *opaque)
{
CharDriverState *chr = opaque;
PtyCharDriver *s = chr->opaque;
gsize size, len;
uint8_t buf[READ_BUF_LEN];
GIOStatus status;
len = sizeof(buf);
if (len > s->read_bytes)
len = s->read_bytes;
if (len == 0)
... | [
1,
0
] |
qemu | hw/intc/arm_gic.c | void gic_update(GICState *s)
{
int best_irq;
int best_prio;
int irq;
int level;
int cpu;
int cm;
for (cpu = 0; cpu < NUM_CPU(s); cpu++) {
cm = 1 << cpu;
s->current_pending[cpu] = 1023;
if (!s->enabled || !s->cpu_enabled[cpu]) {
qemu_irq_lower(s->parent_irq[cpu]);
retur... | [
1,
0
] |
qemu | target-ppc/cpu.h | void ppc_tlb_invalidate_all(CPUPPCState *env)
{
switch (env->mmu_model) {
case POWERPC_MMU_SOFT_6xx:
case POWERPC_MMU_SOFT_74xx:
ppc6xx_tlb_invalidate_all(env);
break;
case POWERPC_MMU_SOFT_4xx:
case POWERPC_MMU_SOFT_4xx_Z:
ppc4xx_tlb_invalidate_all(env);
break;
case POWERPC_MMU_R... | [
1,
1
] |
FFmpeg | libavfilter/af_asetnsamples.c | static int push_samples(AVFilterLink *outlink)
{
ASNSContext *asns = outlink->src->priv;
AVFrame *outsamples = NULL;
int ret, nb_out_samples, nb_pad_samples;
if (asns->pad) {
nb_out_samples = av_audio_fifo_size(asns->fifo) ? asns->nb_out_samples : 0;
nb_pad_samples =
nb_out_samples - FFMI... | [
1,
0
] |
qemu | tests/virtio-9p-test.c | static void pci_basic(gconstpointer data)
{
QVirtioPCIDevice *dev;
QPCIBus *bus;
QVirtQueuePCI *tx, *rx;
QGuestAllocator *alloc;
void (*func)(QVirtioDevice *dev,
QGuestAllocator *alloc,
QVirtQueue *rvq,
QVirtQueue *tvq,
int socket) = data;
... | [
1,
0
] |
qemu | docs/qapi-code-gen.txt | static void qmp_input_type_bool(Visitor *v, const char *name, bool *obj,
Error **errp)
{
QmpInputVisitor *qiv = to_qiv(v);
QObject *qobj = qmp_input_get_object(qiv, name, true, errp);
QBool *qbool;
if (!qobj) {
return;
}
qbool = qobject_to_qbool(qobj);
if (!qbo... | [
0,
0
] |
qemu | hw/spapr_llan.c | static int spapr_vio_busdev_init(DeviceState *qdev, DeviceInfo *qinfo)
{
VIOsPAPRDeviceInfo *info = (VIOsPAPRDeviceInfo *)qinfo;
VIOsPAPRDevice *dev = (VIOsPAPRDevice *)qdev;
char *id;
int ret;
ret = spapr_vio_check_reg(dev, info);
if (ret) {
return ret;
}
/* Don't overwrite ids assigned on... | [
0,
0
] |
qemu | block/linux-aio.c | static void ioq_init(LaioQueue *io_q)
{
QSIMPLEQ_INIT(&io_q->pending);
io_q->plugged = 0;
io_q->n = 0;
io_q->blocked = false;
} | [
0,
0
] |
qemu | configure | static int sys_utimensat(int dirfd, const char *pathname,
const struct timespec times[2], int flags)
{
return (utimensat(dirfd, pathname, times, flags));
} | [
0,
0
] |
qemu | block/vmdk.c | static int vmdk_open(BlockDriverState *bs, QDict *options, int flags,
Error **errp)
{
char *buf;
int ret;
BDRVVmdkState *s = bs->opaque;
uint32_t magic;
Error *local_err = NULL;
bs->file = bdrv_open_child(NULL, options, "file", bs, &child_file,
fals... | [
1,
0
] |
FFmpeg | libavformat/rtpdec_h264.c | static PayloadContext *h264_new_context(void)
{
PayloadContext *data =
av_mallocz(sizeof(PayloadContext) +
FF_INPUT_BUFFER_PADDING_SIZE);
if (data) {
data->cookie = MAGIC_COOKIE;
}
return data;
} | [
1,
0
] |
FFmpeg | libavcodec/h264.c | static void ff_h264_idct_add16_sse2(uint8_t *dst, const int *block_offset,
DCTELEM *block, int stride,
const uint8_t nnzc[6 * 8]) {
int i;
for (i = 0; i < 16; i += 2)
if (nnzc[scan8[i + 0]] | nnzc[scan8[i + 1]])
ff_x264_add8x4_idc... | [
1,
0
] |
qemu | hw/virtio-net.c | static int virtio_net_has_buffers(VirtIONet *n, int bufsize)
{
if (virtio_queue_empty(n->rx_vq) ||
(n->mergeable_rx_bufs &&
!virtqueue_avail_bytes(n->rx_vq, bufsize, 0))) {
virtio_queue_set_notification(n->rx_vq, 1);
return 0;
}
virtio_queue_set_notification(n->rx_vq, 0);
return 1;
... | [
1,
0
] |
qemu | hw/core/qdev.c | static void qbus_initfn(Object *obj)
{
BusState *bus = BUS(obj);
QTAILQ_INIT(&bus->children);
object_property_add_link(obj, QDEV_HOTPLUG_HANDLER_PROPERTY,
TYPE_HOTPLUG_HANDLER,
(Object **)&bus->hotplug_handler, NULL);
object_property_add_bool(obj, "re... | [
1,
0
] |
FFmpeg | libavformat/tests/movenc.c | static int io_write_data_type(void *opaque, uint8_t *buf, int size,
enum AVIODataMarkerType type, int64_t time)
{
char timebuf[30], content[5] = {0};
const char *str;
switch (type) {
case AVIO_DATA_MARKER_HEADER:
str = "header";
break;
case AVIO_DATA_MARKER_SYNC_PO... | [
1,
0
] |
qemu | target-arm/translate.c | static TCGv_i64 gen_addq_msw(TCGv_i64 a, TCGv b)
{
TCGv_i64 tmp64 = tcg_temp_new_i64();
tcg_gen_extu_i32_i64(tmp64, b);
dead_tmp(b);
tcg_gen_shli_i64(tmp64, tmp64, 32);
tcg_gen_add_i64(a, tmp64, a);
tcg_temp_free_i64(tmp64);
return a;
} | [
1,
0
] |
qemu | hw/pci-host/bonito.c | static uint64_t bonito_readl(void *opaque, hwaddr addr,
unsigned size)
{
PCIBonitoState *s = opaque;
uint32_t saddr;
saddr = (addr - BONITO_REGBASE) >> 2;
DPRINTF("bonito_readl " TARGET_FMT_plx "\n", addr);
switch (saddr) {
case BONITO_INTISR:
return s->regs[saddr];... | [
1,
0
] |
qemu | hw/arm/nseries.c | static void bt_hci_inquiry_result(struct bt_hci_s *hci,
struct bt_device_s *slave)
{
if (!slave->inquiry_scan || !hci->lm.responses_left)
return;
hci->lm.responses_left--;
hci->lm.responses++;
switch (hci->lm.inquiry_mode) {
case 0x00:
bt_hci_inquiry_result_s... | [
0,
0
] |
qemu | hw/usb/dev-storage.c | static void usb_msd_realize_storage(USBDevice *dev, Error **errp)
{
MSDState *s = USB_STORAGE_DEV(dev);
BlockBackend *blk = s->conf.blk;
SCSIDevice *scsi_dev;
Error *err = NULL;
if (!blk) {
error_setg(errp, "drive property not set");
return;
}
bdrv_add_key(blk_bs(blk), NULL, &err);
if ... | [
1,
1
] |
qemu | hw/acpi/piix4.c | static void pm_update_sci(PIIX4PMState *s)
{
int sci_level, pmsts;
pmsts = acpi_pm1_evt_get_sts(&s->ar);
sci_level = (((pmsts & s->ar.pm1.evt.en) &
(ACPI_BITMASK_RT_CLOCK_ENABLE |
ACPI_BITMASK_POWER_BUTTON_ENABLE |
ACPI_BITMASK_GLOBAL_LOCK_ENABLE |
... | [
1,
0
] |
qemu | hw/vfio/common.c | void memory_region_iommu_replay(MemoryRegion *mr, IOMMUNotifier *n,
bool is_write)
{
hwaddr addr, granularity;
IOMMUTLBEntry iotlb;
IOMMUAccessFlags flag = is_write ? IOMMU_WO : IOMMU_RO;
/* If the IOMMU has its own replay callback, override */
if (mr->iommu_ops->replay)... | [
0,
0
] |
qemu | qapi/qmp-output-visitor.c | static void qmp_output_end_list(Visitor *v)
{
QmpOutputVisitor *qov = to_qov(v);
qmp_output_pop(qov);
} | [
0,
0
] |
FFmpeg | libavcodec/wavpack.c | static inline int wv_get_value_integer(WavpackFrameContext *s, uint32_t *crc,
int S)
{
int bit;
if (s->extra_bits) {
S <<= s->extra_bits;
if (s->got_extra_bits) {
S |= get_bits(&s->gb_extra_bits, s->extra_bits);
*crc = *crc * 9 + (S & 0xffff) * 3 + (... | [
1,
0
] |
qemu | HACKING | static struct omap_tipb_bridge_s *omap_tipb_bridge_init(
MemoryRegion *memory, target_phys_addr_t base,
qemu_irq abort_irq, omap_clk clk)
{
struct omap_tipb_bridge_s *s = (struct omap_tipb_bridge_s *)
g_malloc0(sizeof(struct omap_tipb_bridge_s));
s->abort = abort_irq;
omap_tipb_bridge_reset(s... | [
0,
0
] |
FFmpeg | libavformat/mxfdec.c | static int mxf_read_seek(AVFormatContext *s, int stream_index,
int64_t sample_time, int flags)
{
AVStream *st = s->streams[stream_index];
int64_t seconds;
MXFContext *mxf = s->priv_data;
int64_t seekpos;
int ret;
MXFIndexTable *t;
if (mxf->nb_index_tables <= 0) {
if (... | [
1,
1
] |
qemu | hw/vt82c686.c | static int vt82c686b_ac97_initfn(PCIDevice *dev)
{
VT686AC97State *s = DO_UPCAST(VT686AC97State, dev, dev);
uint8_t *pci_conf = s->dev.config;
pci_config_set_vendor_id(pci_conf, PCI_VENDOR_ID_VIA);
pci_config_set_device_id(pci_conf, PCI_DEVICE_ID_VIA_AC97);
pci_config_set_class(pci_conf, PCI_CLASS_MULTI... | [
0,
1
] |
qemu | block.c | static void bdrv_co_maybe_schedule_bh(BlockAIOCBCoroutine *acb)
{
acb->need_bh = false;
if (acb->req.error != -EINPROGRESS) {
BlockDriverState *bs = acb->common.bs;
acb->bh = aio_bh_new(bdrv_get_aio_context(bs), bdrv_co_em_bh, acb);
qemu_bh_schedule(acb->bh);
}
} | [
1,
0
] |
FFmpeg | libavutil/aes.c | static void init_multbl2(uint8_t tbl[1024], const int c[4],
const uint8_t *log8, const uint8_t *alog8,
const uint8_t *sbox)
{
int i, j;
for (i = 0; i < 1024; i++) {
int x = sbox[i >> 2];
if (x)
tbl[i] = alog8[log8[x] + log8[c[i & 3]]];
}
#if... | [
1,
0
] |
qemu | hw/char/escc.c | static void sunkbd_event(void *opaque, int ch)
{
ChannelState *s = opaque;
int release = ch & 0x80;
trace_escc_sunkbd_event_in(ch);
switch (ch) {
case 58: // Caps lock press
s->caps_lock_mode ^= 1;
if (s->caps_lock_mode == 2)
return; // Drop second press
break;
case 69: // Num l... | [
1,
0
] |
qemu | qemu-img.c | static void dump_human_image_check(ImageCheck *check)
{
if (!(check->corruptions || check->leaks || check->check_errors)) {
printf("No errors were found on the image.\n");
} else {
if (check->corruptions) {
printf("\n%" PRId64 " errors were found on the image.\n"
"Data may be corru... | [
1,
0
] |
qemu | Makefile | void *get_mmap_addr(unsigned long size)
{
return NULL;
} | [
0,
0
] |
qemu | target-arm/neon_helper.c | uint32_t HELPER(neon_narrow_sat_s32)(CPUState *env, uint64_t x)
{
if ((int64_t)x != (int32_t)x) {
SET_QC();
return (x >> 63) ^ 0x7fffffff;
}
return x;
} | [
0,
0
] |
qemu | monitor.c | static void do_balloon(Monitor *mon, const QDict *qdict, QObject **ret_data)
{
int value = qdict_get_int(qdict, "value");
ram_addr_t target = value;
qemu_balloon(target << 20);
} | [
0,
0
] |
qemu | accel/kvm/kvm-all.c | void xen_map_cache_init(phys_offset_to_gaddr_t f, void *opaque)
{
unsigned long size;
struct rlimit rlimit_as;
mapcache = g_malloc0(sizeof(MapCache));
mapcache->phys_offset_to_gaddr = f;
mapcache->opaque = opaque;
qemu_mutex_init(&mapcache->lock);
QTAILQ_INIT(&mapcache->locked_entries);
if (get... | [
1,
0
] |
FFmpeg | doc/filters.texi | static void init_filter_param(AVFilterContext *ctx, FilterParam *fp,
const char *effect_type, int width)
{
int z;
const char *effect;
effect = fp->amount == 0 ? "none" : fp->amount < 0 ? "blur" : "sharpen";
av_log(ctx, AV_LOG_VERBOSE,
"effect:%s type:%s msize_x:%d msi... | [
1,
0
] |
FFmpeg | libavformat/mov.c | static int mov_read_stco(MOVContext *c, AVIOContext *pb, MOVAtom atom)
{
AVStream *st;
MOVStreamContext *sc;
unsigned int i, entries;
if (c->fc->nb_streams < 1)
return 0;
st = c->fc->streams[c->fc->nb_streams - 1];
sc = st->priv_data;
avio_r8(pb); /* version */
avio_rb24(pb); /* flags */
... | [
1,
0
] |
FFmpeg | libavformat/asfdec.c | static int process_metadata(AVFormatContext *s, uint8_t *name,
uint16_t name_len,
uint16_t val_len, uint16_t type, AVDictionary **met)
{
int ret;
ff_asf_guid guid;
if (val_len) {
switch (type) {
case ASF_UNICODE:
asf_read_value(s, name,... | [
1,
0
] |
FFmpeg | libavcodec/pngdsp.c | static void add_bytes_l2_c(uint8_t *dst, uint8_t *src1, uint8_t *src2, int w)
{
long i;
for (i = 0; i <= w - sizeof(long); i += sizeof(long)) {
long a = *(long *)(src1 + i);
long b = *(long *)(src2 + i);
*(long *)(dst + i) = ((a & pb_7f) + (b & pb_7f)) ^ ((a ^ b) & pb_80);
}
for (; i < w; i++... | [
1,
0
] |
qemu | aio-posix.c | void aio_set_fd_handler(AioContext *ctx,
int fd,
IOHandler *io_read,
IOHandler *io_write,
AioFlushHandler *io_flush,
void *opaque)
{
AioHandler *node;
node = find_aio_handler(ctx, fd);
... | [
1,
0
] |
qemu | hw/g364fb.c | static void g364fb_update_display(void *opaque) {
G364State *s = opaque;
if (s->width == 0 || s->height == 0)
return;
if (s->width != ds_get_width(s->ds) || s->height != ds_get_height(s->ds)) {
qemu_console_resize(s->ds, s->width, s->height);
}
if (s->ctla & CTLA_FORCE_BLANK) {
g364fb_draw_blank(s... | [
1,
0
] |
qemu | Makefile.objs | static void bmds_set_aio_inflight(BlkMigDevState *bmds, int64_t sector_num,
int nb_sectors, int set)
{
int64_t start, end;
unsigned long val, idx, bit;
start = sector_num / BDRV_SECTORS_PER_DIRTY_CHUNK;
end = (sector_num + nb_sectors - 1) / BDRV_SECTORS_PER_DIRTY_CHUNK;
... | [
1,
0
] |
qemu | qapi/qmp-input-visitor.c | const char *qdict_get_try_str(const QDict *qdict, const char *key)
{
QObject *obj;
obj = qdict_get(qdict, key);
if (!obj || qobject_type(obj) != QTYPE_QSTRING)
return NULL;
return qstring_get_str(qobject_to_qstring(obj));
} | [
1,
0
] |
qemu | exec.c | static IOMMUTLBEntry vtd_iommu_translate(MemoryRegion *iommu, hwaddr addr,
bool is_write)
{
VTDAddressSpace *vtd_as = container_of(iommu, VTDAddressSpace, iommu);
IntelIOMMUState *s = vtd_as->iommu_state;
IOMMUTLBEntry ret = {
.target_as = &address_space_memory... | [
0,
0
] |
qemu | check-qlist.c | START_TEST(qlist_append_test)
{
QInt *qi;
QList *qlist;
QListEntry *entry;
qi = qint_from_int(42);
qlist = qlist_new();
qlist_append(qlist, qi);
entry = QTAILQ_FIRST(&qlist->head);
fail_unless(entry != NULL);
fail_unless(entry->value == QOBJECT(qi));
// destroy doesn't exist yet
QDECRE... | [
0,
0
] |
qemu | hw/9pfs/9p.c | ssize_t virtio_pdu_vunmarshal(V9fsPDU *pdu, size_t offset,
const char *fmt, va_list ap)
{
V9fsState *s = pdu->s;
V9fsVirtioState *v = container_of(s, V9fsVirtioState, state);
VirtQueueElement *elem = &v->elems[pdu->idx];
return v9fs_iov_vunmarshal(elem->out_sg, elem->out_num,... | [
0,
0
] |
qemu | acl.c | static DeviceState *qbus_find_dev(BusState *bus, char *elem)
{
DeviceState *dev;
/*
* try to match in order:
* (1) instance id, if present
* (2) driver name
* (3) driver alias, if present
*/
LIST_FOREACH(dev, &bus->children, sibling) {
if (dev->id && strcmp(dev->id, elem) == 0) ... | [
1,
0
] |
qemu | qmp.c | void qmp_object_add(const char *type, const char *id,
bool has_props, QObject *props, Error **errp)
{
const QDict *pdict = NULL;
QmpInputVisitor *qiv;
Object *obj;
if (props) {
pdict = qobject_to_qdict(props);
if (!pdict) {
error_setg(errp, QERR_INVALID_PARAMETER_TYPE,... | [
0,
0
] |
qemu | HACKING | static void register_multipage(AddressSpaceDispatch *d,
MemoryRegionSection *section)
{
target_phys_addr_t start_addr = section->offset_within_address_space;
ram_addr_t size = section->size;
target_phys_addr_t addr;
uint16_t section_index = phys_section_add(section);
asser... | [
0,
0
] |
qemu | block/qapi.c | static void dump_json_image_info_list(ImageInfoList *list)
{
QString *str;
QmpOutputVisitor *ov = qmp_output_visitor_new();
QObject *obj;
visit_type_ImageInfoList(qmp_output_get_visitor(ov), NULL, &list,
&error_abort);
obj = qmp_output_get_qobject(ov);
str = qobject_to_jso... | [
0,
0
] |
qemu | target-sparc/cpu.h | static inline int ultrasparc_tag_match(SparcTLBEntry *tlb,
uint64_t address, uint64_t context,
target_phys_addr_t *physical,
int is_nucleus)
{
uint64_t mask;
switch ((tlb->tte >> 61) & 3) {
... | [
1,
0
] |
qemu | block.c | int bdrv_enable_write_cache(BlockDriverState *bs)
{
return bs->enable_write_cache;
} | [
0,
0
] |
qemu | hw/s390x/s390-virtio-ccw.c | S390CPU *cpu_s390x_create(const char *cpu_model, Error **errp)
{
static bool features_parsed;
char *name, *features;
const char *typename;
ObjectClass *oc;
CPUClass *cc;
name = g_strdup(cpu_model);
features = strchr(name, ',');
if (features) {
features[0] = 0;
features++;
}
oc = ... | [
0,
0
] |
qemu | hw/usb/redirect.c | static int usbredir_handle_bulk_data(USBRedirDevice *dev, USBPacket *p,
uint8_t ep)
{
AsyncURB *aurb = async_alloc(dev, p);
struct usb_redir_bulk_packet_header bulk_packet;
DPRINTF("bulk-out ep %02X len %zd id %u\n", ep,
p->iov.size, aurb->packet_id);
bulk_p... | [
1,
0
] |
qemu | block.c | void *qemu_blockalign(BlockDriverState *bs, size_t size)
{
return qemu_memalign(
(bs && bs->buffer_alignment) ? bs->buffer_alignment : 512, size);
} | [
1,
0
] |
qemu | block-qcow.c | void bdrv_close(BlockDriverState *bs)
{
if (bs->drv) {
if (bs->backing_hd)
bdrv_delete(bs->backing_hd);
bs->drv->bdrv_close(bs);
qemu_free(bs->opaque);
#ifdef _WIN32
if (bs->is_temporary) {
unlink(bs->filename);
}
#endif
bs->opaque = NULL;
bs->drv = NULL;
/* ca... | [
1,
0
] |
qemu | block.c | void bdrv_attach_aio_context(BlockDriverState *bs,
AioContext *new_context)
{
BdrvAioNotifier *ban;
BdrvChild *child;
if (!bs->drv) {
return;
}
bs->aio_context = new_context;
QLIST_FOREACH(child, &bs->children, next) {
bdrv_attach_aio_context(child->bs, new_cont... | [
1,
0
] |
qemu | block-migration.c | static int block_save_iterate(QEMUFile *f, void *opaque)
{
int ret;
int64_t last_ftell = qemu_ftell(f);
DPRINTF("Enter save live iterate submitted %d transferred %d\n",
block_mig_state.submitted, block_mig_state.transferred);
ret = flush_blks(f);
if (ret) {
return ret;
}
blk_mig_res... | [
1,
0
] |
FFmpeg | libavcodec/ac3enc.c | static av_cold int fft_init(AVCodecContext *avctx, AC3MDCTContext *mdct, int ln)
{
int i, n, n2;
float alpha;
n = 1 << ln;
n2 = n >> 1;
FF_ALLOC_OR_GOTO(avctx, mdct->costab, n2 * sizeof(*mdct->costab),
fft_alloc_fail);
FF_ALLOC_OR_GOTO(avctx, mdct->sintab, n2 * sizeof(*mdct->sintab... | [
1,
0
] |
FFmpeg | libavcodec/huffyuv.c | static void read_len_table(uint8_t *dst, GetBitContext *gb) {
int i, val, repeat;
for (i = 0; i < 256;) {
repeat = get_bits(gb, 3);
val = get_bits(gb, 5);
if (repeat == 0)
repeat = get_bits(gb, 8);
// printf("%d %d\n", val, repeat);
while (repeat--)
dst[i++] = val;
}
} | [
1,
0
] |
FFmpeg | libavcodec/dca_parser.c | static int dca_parse(AVCodecParserContext *s, AVCodecContext *avctx,
const uint8_t **poutbuf, int *poutbuf_size,
const uint8_t *buf, int buf_size)
{
DCAParseContext *pc1 = s->priv_data;
ParseContext *pc = &pc1->pc;
int next, duration, sample_rate;
if (s->flags & ... | [
1,
0
] |
qemu | blockdev-nbd.c | static void nbd_client_closed(NBDClient *client)
{
nb_fds--;
if (nb_fds == 0 && !persistent && state == RUNNING) {
state = TERMINATE;
}
nbd_update_server_watch();
nbd_client_put(client);
} | [
1,
0
] |
FFmpeg | libavcodec/dnxhddec.c | static void dnxhd_decode_dct_block_10(const DNXHDContext *ctx,
RowContext *row, int n)
{
dnxhd_decode_dct_block(ctx, row, n, 6, 8, 4);
} | [
1,
0
] |
FFmpeg | libswscale/swscale_internal.h | static inline void
RENAME(yuv2bgr24_2)(SwsContext *c, const uint16_t *buf0,
const uint16_t *buf1, const uint16_t *ubuf0,
const uint16_t *ubuf1, const uint16_t *vbuf0,
const uint16_t *vbuf1, const uint16_t *abuf0,
const uint16_t *abuf1, ... | [
1,
0
] |
FFmpeg | libavformat/network.c | int avformat_network_init(void)
{
#if CONFIG_NETWORK
int ret;
ff_network_inited_globally = 1;
if ((ret = ff_network_init()) < 0)
return ret;
ff_tls_init();
#endif
return 0;
} | [
1,
0
] |
qemu | hw/misc/ivshmem.c | static void close_guest_eventfds(IVShmemState *s, int posn)
{
int i, guest_curr_max;
if (!ivshmem_has_feature(s, IVSHMEM_IOEVENTFD)) {
guest_curr_max = s->peers[posn].nb_eventfds;
memory_region_transaction_begin();
for (i = 0; i < guest_curr_max; i++) {
ivshmem_del_eventfd(s, posn, i);
... | [
1,
0
] |
FFmpeg | libavformat/mm.c | static int read_packet(AVFormatContext *s,
AVPacket *pkt)
{
MmDemuxContext *mm = s->priv_data;
AVIOContext *pb = s->pb;
unsigned char preamble[MM_PREAMBLE_SIZE];
unsigned int type, length;
while (1) {
if (avio_read(pb, preamble, MM_PREAMBLE_SIZE) != MM_PREAMBLE_SIZE) {
... | [
1,
0
] |
qemu | cpu-exec.c | static inline void t_gen_addx_carry(DisasContext *dc, TCGv d)
{
if (dc->flagx_known) {
if (dc->flags_x) {
TCGv c;
c = tcg_temp_new(TCG_TYPE_TL);
t_gen_mov_TN_preg(c, PR_CCS);
/* C flag is already at bit 0. */
tcg_gen_andi_tl(c, c, C_FLAG);
tcg_gen_add_tl(d, d, c);
... | [
0,
0
] |
qemu | hw/nvram/spapr_nvram.c | static void rtas_start_cpu(sPAPREnvironment *spapr,
uint32_t token, uint32_t nargs,
target_ulong args,
uint32_t nret, target_ulong rets)
{
target_ulong id, start, r3;
CPUState *cs;
if (nargs != 3 || nret != 1) {
rtas_st(r... | [
1,
0
] |
FFmpeg | ffmpeg_qsv.c | static mfxIMPL choose_implementation(const InputStream *ist)
{
static const struct {
const char *name;
mfxIMPL impl;
} impl_map[] = {
{"auto", MFX_IMPL_AUTO},
{"sw", MFX_IMPL_SOFTWARE},
{"hw", MFX_IMPL_HARDWARE},
{"auto_any", MFX_IMPL_AUTO_ANY},
{"hw_any", MFX_IMPL_HA... | [
0,
0
] |
qemu | hw/usb/hcd-uhci.c | static void uhci_fill_queue(UHCIState *s, UHCI_TD *td)
{
uint32_t int_mask = 0;
uint32_t plink = td->link;
uint32_t token = uhci_queue_token(td);
UHCI_TD ptd;
int ret;
while (is_valid(plink)) {
pci_dma_read(&s->dev, plink & ~0xf, &ptd, sizeof(ptd));
le32_to_cpus(&ptd.link);
le32_to_cpu... | [
1,
0
] |
qemu | hw/virtio-9p-local.c | static int local_fstat(FsContext *ctx, int fd, struct stat *stbuf)
{
return fstat(fd, stbuf);
} | [
0,
0
] |
qemu | hw/sd/sdhci.c | static void sdhci_generic_reset(DeviceState *ds)
{
SDHCIState *s = SDHCI(ds);
SDHCI_GET_CLASS(s)->reset(s);
} | [
0,
0
] |
qemu | block/block-backend.c | static uint32_t ahci_port_read(AHCIState *s, int port, int offset)
{
uint32_t val;
AHCIPortRegs *pr;
pr = &s->dev[port].port_regs;
switch (offset) {
case PORT_LST_ADDR:
val = pr->lst_addr;
break;
case PORT_LST_ADDR_HI:
val = pr->lst_addr_hi;
break;
case PORT_FIS_ADDR:
val ... | [
0,
0
] |
FFmpeg | libavcodec/avpacket.c | int av_packet_split_side_data(AVPacket *pkt) {
if (!pkt->side_data_elems && pkt->size > 12 &&
AV_RB64(pkt->data + pkt->size - 8) == FF_MERGE_MARKER) {
int i;
unsigned int size, orig_pktsize = pkt->size;
uint8_t *p;
p = pkt->data + pkt->size - 8 - 5;
for (i = 1;; i++) {
size = AV... | [
1,
0
] |
FFmpeg | libavcodec/dxva2.c | static int dxva_get_decoder_guid(AVCodecContext *avctx, void *service,
void *surface_format,
unsigned guid_count, const GUID *guid_list,
GUID *decoder_guid)
{
FFDXVASharedContext *sctx = DXVA_SHARED_CONTEXT(avctx);
... | [
0,
0
] |
qemu | target-ppc/translate_init.c | void cpu_ppc_set_papr(PowerPCCPU *cpu)
{
CPUPPCState *env = &cpu->env;
/* PAPR always has exception vectors in RAM not ROM. To ensure this,
* MSR[IP] should never be set.
*
* We also disallow setting of MSR_HV
*/
env->msr_mask &= ~((1ull << MSR_EP) | MSR_HVB);
/* Set a full AMOR so guest ca... | [
1,
0
] |
qemu | qga/service-win32.c | int ga_install_service(const char *path, const char *logfile)
{
SC_HANDLE manager;
SC_HANDLE service;
TCHAR cmdline[MAX_PATH];
if (GetModuleFileName(NULL, cmdline, MAX_PATH) == 0) {
printf_win_error("No full path to service's executable");
return EXIT_FAILURE;
}
_snprintf(cmdline, MAX_PATH -... | [
1,
0
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.