Projectname large_stringclasses 15
values | Filepath large_stringlengths 4 106 ⌀ | Function large_stringlengths 11 3.45k | Label list |
|---|---|---|---|
qemu | util/bitops.c | unsigned long find_next_bit(const unsigned long *addr, unsigned long size,
unsigned long offset)
{
const unsigned long *p = addr + BITOP_WORD(offset);
unsigned long result = offset & ~(BITS_PER_LONG - 1);
unsigned long tmp;
if (offset >= size) {
return size;
}
size -=... | [
1,
0
] |
qemu | block/block-backend.c | static void rtas_nvram_store(PowerPCCPU *cpu, sPAPREnvironment *spapr,
uint32_t token, uint32_t nargs,
target_ulong args,
uint32_t nret, target_ulong rets)
{
sPAPRNVRAM *nvram = spapr->nvram;
hwaddr offset, buffer, len;
... | [
1,
0
] |
qemu | HACKING | static uint32_t gic_dist_readl(void *opaque, target_phys_addr_t offset)
{
uint32_t val;
val = gic_dist_readw(opaque, offset);
val |= gic_dist_readw(opaque, offset + 2) << 16;
return val;
} | [
0,
0
] |
FFmpeg | libavcodec/apedec.c | static inline int ape_decode_value_3900(APEContext *ctx, APERice *rice)
{
unsigned int x, overflow;
int tmpk;
overflow = range_get_symbol(ctx, counts_3970, counts_diff_3970);
if (overflow == (MODEL_ELEMENTS - 1)) {
tmpk = range_decode_bits(ctx, 5);
overflow = 0;
} else
tmpk = (rice->k < 1... | [
1,
0
] |
qemu | block/nbd-client.c | static void nbd_teardown_connection(NbdClientSession *client)
{
struct nbd_request request = {
.type = NBD_CMD_DISC,
.from = 0,
.len = 0
};
nbd_send_request(client->sock, &request);
/* finish any pending coroutines */
shutdown(client->sock, 2);
nbd_recv_coroutines_enter_all(clien... | [
1,
0
] |
FFmpeg | libavcodec/adxdec.c | static int adx_decode_header(AVCodecContext *avctx, const uint8_t *buf,
int bufsize)
{
int offset;
if (buf[0] != 0x80)
return 0;
offset = (AV_RB32(buf) ^ 0x80000000) + 4;
if (bufsize < offset || memcmp(buf + offset - 6, "(c)CRI", 6))
return 0;
avctx->channels = bu... | [
1,
0
] |
qemu | hw/scsi/scsi-disk.c | static void scsi_write_complete(void *opaque, int ret)
{
SCSIDiskReq *r = (SCSIDiskReq *)opaque;
SCSIDiskState *s = DO_UPCAST(SCSIDiskState, qdev, r->req.dev);
uint32_t n;
if (r->req.aiocb != NULL) {
r->req.aiocb = NULL;
block_acct_done(bdrv_get_stats(s->qdev.conf.bs), &r->acct);
}
if (r->re... | [
1,
0
] |
qemu | docs/qapi-code-gen.txt | start_list(Visitor *v, const char *name, Error **errp)
{
StringInputVisitor *siv = to_siv(v);
if (parse_str(siv, name, errp) < 0) {
return;
}
siv->cur_range = g_list_first(siv->ranges);
if (siv->cur_range) {
Range *r = siv->cur_range->data;
if (r) {
siv->cur = r->begin;
}
}
} | [
1,
0
] |
qemu | target-ppc/fpu_helper.c | static inline uint64_t do_fri(CPUPPCState *env, uint64_t arg,
int rounding_mode)
{
CPU_DoubleU farg;
farg.ll = arg;
if (unlikely(float64_is_signaling_nan(farg.d))) {
/* sNaN round */
farg.ll = fload_invalid_op_excp(env, POWERPC_EXCP_FP_VXSNAN |
... | [
0,
0
] |
qemu | include/exec/memory.h | static void memory_region_initfn(Object *obj)
{
MemoryRegion *mr = MEMORY_REGION(obj);
ObjectProperty *op;
mr->ops = &unassigned_mem_ops;
mr->enabled = true;
mr->romd_mode = true;
mr->global_locking = true;
mr->destructor = memory_region_destructor_none;
QTAILQ_INIT(&mr->subregions);
QTAILQ_... | [
0,
0
] |
qemu | block/qapi.c | static Visitor *validate_test_init_raw(TestInputVisitorData *data,
const char *json_string)
{
return validate_test_init_internal(data, json_string, NULL);
} | [
0,
0
] |
qemu | backends/baum.c | static CharDriverState *qmp_chardev_open_udp(const char *id,
ChardevBackend *backend,
ChardevReturn *ret,
Error **errp)
{
ChardevUdp *udp = backend->u.udp;
ChardevCommon *comm... | [
0,
0
] |
qemu | target-arm/translate-a64.c | static inline int vec_reg_offset(int regno, int element, TCGMemOp size)
{
int offs = offsetof(CPUARMState, vfp.regs[regno * 2]);
#ifdef HOST_WORDS_BIGENDIAN
/* This is complicated slightly because vfp.regs[2n] is
* still the low half and vfp.regs[2n+1] the high half
* of the 128 bit vector, even on big... | [
0,
0
] |
qemu | include/exec/gen-icount.h | static void gen_doz(DisasContext *ctx)
{
int l1 = gen_new_label();
int l2 = gen_new_label();
tcg_gen_brcond_tl(TCG_COND_GE, cpu_gpr[rB(ctx->opcode)],
cpu_gpr[rA(ctx->opcode)], l1);
tcg_gen_sub_tl(cpu_gpr[rD(ctx->opcode)], cpu_gpr[rB(ctx->opcode)],
cpu_gpr[rA(ctx->opcode... | [
0,
0
] |
qemu | hw/char/sclpconsole-lm.c | static int write_console_data(SCLPEvent *event, const uint8_t *buf, int len)
{
int ret = 0;
const uint8_t *buf_offset;
SCLPConsoleLM *scon = SCLPLM_CONSOLE(event);
if (!scon->chr) {
/* If there's no backend, we can just say we consumed all data. */
return len;
}
buf_offset = buf;
while (l... | [
1,
0
] |
qemu | tcg/ppc64/tcg-target.c | static void tcg_target_init(TCGContext *s)
{
#ifdef CONFIG_GETAUXVAL
unsigned long hwcap = getauxval(AT_HWCAP);
if (hwcap & PPC_FEATURE_ARCH_2_06) {
have_isa_2_06 = true;
}
#endif
tcg_regset_set32(tcg_target_available_regs[TCG_TYPE_I32], 0, 0xffffffff);
tcg_regset_set32(tcg_target_available_regs[T... | [
1,
0
] |
qemu | block/qapi.c | static void test_validate_alternate(TestInputVisitorData *data,
const void *unused)
{
UserDefAlternate *tmp = NULL;
Visitor *v;
v = validate_test_init(data, "42");
visit_type_UserDefAlternate(v, NULL, &tmp, &error_abort);
qapi_free_UserDefAlternate(tmp);
} | [
0,
0
] |
FFmpeg | libavcodec/ac3dec.c | static inline void downmix_dualmono_to_stereo(float *samples)
{
int i;
float tmp;
for (i = 0; i < 256; i++) {
tmp = samples[i] + samples[i + 256];
samples[i] = samples[i + 256] = tmp;
}
} | [
0,
0
] |
qemu | linux-user/signal.c | long do_rt_sigreturn(CPUS390XState *env)
{
rt_sigframe *frame;
abi_ulong frame_addr = env->regs[15];
sigset_t set;
trace_user_do_rt_sigreturn(env, frame_addr);
if (!lock_user_struct(VERIFY_READ, frame, frame_addr, 1)) {
goto badframe;
}
target_to_host_sigset(&set, &frame->uc.tuc_sigmask);
s... | [
1,
0
] |
FFmpeg | libavcodec/indeo2.c | static int ir2_decode_plane(Ir2Context *ctx, int width, int height,
uint8_t *dst,
int pitch, const uint8_t *table)
{
int i;
int j;
int out = 0;
if (width & 1)
return AVERROR_INVALIDDATA;
/* first line contain absolute values, other lines cont... | [
1,
0
] |
qemu | hmp.c | void hmp_change(Monitor *mon, const QDict *qdict)
{
const char *device = qdict_get_str(qdict, "device");
const char *target = qdict_get_str(qdict, "target");
const char *arg = qdict_get_try_str(qdict, "arg");
const char *read_only = qdict_get_try_str(qdict, "read-only-mode");
BlockdevChangeReadOnlyMode ... | [
1,
0
] |
qemu | qemu-char.c | static int mux_chr_can_read(void *opaque)
{
CharDriverState *chr = opaque;
MuxDriver *d = chr->opaque;
if ((d->prod - d->cons) < MUX_BUFFER_SIZE)
return 1;
if (d->chr_can_read[chr->focus])
return d->chr_can_read[chr->focus](d->ext_opaque[chr->focus]);
return 0;
} | [
1,
0
] |
qemu | hw/i386/intel_iommu.c | static inline bool vtd_queued_inv_enable_check(IntelIOMMUState *s)
{
return s->iq_tail == 0;
} | [
1,
0
] |
qemu | blockjob.c | static void run_block_job(BlockJob *job, Error **errp)
{
AioContext *aio_context = blk_get_aio_context(job->blk);
/* FIXME In error cases, the job simply goes away and we access a dangling
* pointer below. */
aio_context_acquire(aio_context);
do {
aio_poll(aio_context, true);
qemu_progress_pr... | [
1,
1
] |
FFmpeg | libavcodec/dxtory.c | static int dxtory_decode_v1_420(AVCodecContext *avctx, AVFrame *pic,
const uint8_t *src, int src_size)
{
int h, w;
uint8_t *Y1, *Y2, *U, *V;
int ret;
if (src_size < avctx->width * avctx->height * 3 / 2) {
av_log(avctx, AV_LOG_ERROR, "packet too small\n");
return A... | [
1,
0
] |
FFmpeg | libavcodec/dxva2.c | static int dxva2_hevc_start_frame(AVCodecContext *avctx,
av_unused const uint8_t *buffer,
av_unused uint32_t size)
{
const HEVCContext *h = avctx->priv_data;
AVDXVAContext *ctx = avctx->hwaccel_context;
struct hevc_dxva2_picture_context *ct... | [
1,
0
] |
qemu | hw/isa-bus.c | ISADevice *isa_create(const char *name)
{
DeviceState *dev;
if (!isabus) {
fprintf(stderr, "Tried to create isa device %s with no isa bus present.\n",
name);
return NULL;
}
dev = qdev_create(&isabus->qbus, name);
return DO_UPCAST(ISADevice, qdev, dev);
} | [
1,
0
] |
qemu | cutils.c | int coroutine_fn qemu_co_recvv(int sockfd, struct iovec *iov,
int len, int iov_offset)
{
int total = 0;
int ret;
while (len) {
ret = qemu_recvv(sockfd, iov, len, iov_offset + total);
if (ret < 0) {
if (errno == EAGAIN) {
qemu_coroutine_yield();
... | [
1,
0
] |
FFmpeg | libavformat/iff.c | static int get_metadata(AVFormatContext *s,
const char *const tag,
const unsigned data_size)
{
uint8_t *buf = ((data_size + 1) == 0) ? NULL : av_malloc(data_size + 1);
if (!buf)
return AVERROR(ENOMEM);
if (avio_read(s->pb, buf, data_size) < 0) {
av_f... | [
1,
0
] |
FFmpeg | libavcodec/ratecontrol.c | void avcodec_get_context_defaults2(AVCodecContext *s,
enum CodecType codec_type) {
int flags = 0;
memset(s, 0, sizeof(AVCodecContext));
s->av_class = &av_codec_context_class;
s->codec_type = codec_type;
if (codec_type == CODEC_TYPE_AUDIO)
flags = AV_OPT_FLAG_AUDIO_... | [
1,
1
] |
FFmpeg | libavcodec/shorten.c | static void fix_bitshift(ShortenContext *s, int32_t *buffer)
{
int i;
if (s->bitshift != 0)
for (i = 0; i < s->blocksize; i++)
buffer[s->nwrap + i] <<= s->bitshift;
} | [
1,
0
] |
qemu | io/channel-command.c | static ssize_t qio_channel_command_readv(QIOChannel *ioc,
const struct iovec *iov,
size_t niov,
int **fds,
size_t *nfds,
... | [
0,
0
] |
qemu | block/Makefile.objs | static BlockDriverAIOCB *
raw_aio_readv(BlockDriverState *bs,
int64_t sector_num, QEMUIOVector *qiov, int nb_sectors,
BlockDriverCompletionFunc *cb, void *opaque)
{
BDRVRawState *s = bs->opaque;
return paio_submit(bs, s->hfile, sector_num, qiov, nb_sectors,
cb,... | [
0,
0
] |
qemu | Makefile.objs | aio_ctx_dispatch(GSource *source,
GSourceFunc callback,
gpointer user_data)
{
AioContext *ctx = (AioContext *)source;
assert(callback == NULL);
aio_dispatch(ctx, true);
return true;
} | [
0,
0
] |
FFmpeg | libavcodec/motion_est.c | static void predict_plane(SnowContext *s, DWTELEM *buf, int plane_index,
int add) {
Plane *p = &s->plane[plane_index];
const int mb_w = s->mb_band.width;
const int mb_h = s->mb_band.height;
const int mb_stride = s->mb_band.stride;
int x, y, mb_x, mb_y;
int scale = plane_index... | [
1,
0
] |
qemu | configure | xilinx_pcie_init(MemoryRegion *sys_mem, uint32_t bus_nr,
hwaddr cfg_base, uint64_t cfg_size,
hwaddr mmio_base, uint64_t mmio_size,
qemu_irq irq, bool link_up)
{
DeviceState *dev;
MemoryRegion *cfg, *mmio;
dev = qdev_create(NULL, TYPE_XILINX_PCIE_HOST);
... | [
1,
0
] |
FFmpeg | libavcodec/aacsbr_template.c | static void sbr_qmf_analysis(AVFixedDSPContext *dsp, FFTContext *mdct,
#else
static void sbr_qmf_analysis(AVFloatDSPContext *dsp, FFTContext *mdct,
#endif /* USE_FIXED */
SBRDSPContext *sbrdsp, const INTFLOAT *in, INTFLOAT *x,
INTFLOAT z[320], INTFLOAT W[2]... | [
1,
0
] |
qemu | block.c | void block_job_cancel_sync(BlockJob *job)
{
BlockDriverState *bs = job->bs;
assert(bs->job == job);
block_job_cancel(job);
while (bs->job != NULL && bs->job->busy) {
qemu_aio_wait();
}
} | [
1,
0
] |
qemu | block/replication.c | static void replication_close(BlockDriverState *bs)
{
BDRVReplicationState *s = bs->opaque;
if (s->replication_state == BLOCK_REPLICATION_RUNNING) {
replication_stop(s->rs, false, NULL);
if (s->mode == REPLICATION_MODE_SECONDARY) {
g_free(s->top_id);
replication_remove(s->rs); | [
1,
0
] |
qemu | hw/ppc/e500.c | static int kvm_irqchip_create(KVMState *s)
{
QemuOptsList *list = qemu_find_opts("machine");
int ret;
if (QTAILQ_EMPTY(&list->head) ||
!qemu_opt_get_bool(QTAILQ_FIRST(&list->head),
"kernel_irqchip", true) ||
!kvm_check_extension(s, KVM_CAP_IRQCHIP)) {
return 0;
}... | [
1,
0
] |
qemu | tests/e1000e-test.c | uint32_t qpci_io_readl(QPCIDevice *dev, void *data)
{
uintptr_t addr = (uintptr_t)data;
if (addr < QPCI_PIO_LIMIT) {
return dev->bus->pio_readl(dev->bus, addr);
} else {
uint32_t val;
dev->bus->memread(dev->bus, addr, &val, sizeof(val));
return le32_to_cpu(val);
}
} | [
1,
0
] |
FFmpeg | libavformat/wtvdec.c | static int read_seek(AVFormatContext *s, int stream_index,
int64_t ts, int flags)
{
WtvContext *wtv = s->priv_data;
AVIOContext *pb = wtv->pb;
AVStream *st = s->streams[0];
int64_t ts_relative;
int i;
if ((flags & AVSEEK_FLAG_FRAME) || (flags & AVSEEK_FLAG_BYTE))
return AVE... | [
1,
0
] |
qemu | block/iscsi.c | iscsi_aio_ioctl_cb(struct iscsi_context *iscsi, int status,
void *command_data, void *opaque)
{
IscsiAIOCB *acb = opaque;
if (acb->canceled) {
qemu_aio_release(acb);
return;
}
acb->status = 0;
if (status < 0) {
error_report("Failed to ioctl(SG_IO) to iSCSI lun. %s",
... | [
1,
0
] |
qemu | hw/qdev-properties.c | static int parse_hex32(DeviceState *dev, Property *prop, const char *str)
{
uint32_t *ptr = qdev_get_prop_ptr(dev, prop);
if (sscanf(str, "%" PRIx32, ptr) != 1)
return -EINVAL;
return 0;
} | [
1,
0
] |
qemu | hw/net/xilinx_ethlite.c | static ssize_t eth_rx(NetClientState *nc, const uint8_t *buf, size_t size)
{
struct xlx_ethlite *s = qemu_get_nic_opaque(nc);
unsigned int rxbase = s->rxbuf * (0x800 / 4);
/* DA filter. */
if (!(buf[0] & 0x80) && memcmp(&s->conf.macaddr.a[0], buf, 6))
return size;
if (s->regs[rxbase + R_RX_CTRL0] ... | [
1,
0
] |
qemu | docs/qapi-code-gen.txt | void visit_type_uint32(Visitor *v, uint32_t *obj, const char *name,
Error **errp)
{
int64_t value;
if (!error_is_set(errp)) {
if (v->type_uint32) {
v->type_uint32(v, obj, name, errp);
} else {
value = *obj;
v->type_int(v, &value, name, errp);
if (value... | [
1,
0
] |
FFmpeg | libavcodec/psymodel.c | av_cold void ff_psy_preprocess_end(struct FFPsyPreprocessContext *ctx)
{
int i;
ff_iir_filter_free_coeffs(ctx->fcoeffs);
if (ctx->fstate)
for (i = 0; i < ctx->avctx->channels; i++)
ff_iir_filter_free_state(ctx->fstate[i]);
av_freep(&ctx->fstate);
} | [
1,
0
] |
qemu | osdep.c | static int qemu_dup_flags(int fd, int flags)
{
int ret;
int serrno;
int dup_flags;
int setfl_flags;
#ifdef F_DUPFD_CLOEXEC
ret = fcntl(fd, F_DUPFD_CLOEXEC, 0);
#else
ret = dup(fd);
if (ret != -1) {
qemu_set_cloexec(ret);
}
#endif
if (ret == -1) {
goto fail;
}
dup_flags = fcn... | [
1,
0
] |
qemu | HACKING | void stw_le_phys(target_phys_addr_t addr, uint32_t val)
{
stw_phys_internal(addr, val, DEVICE_LITTLE_ENDIAN);
} | [
0,
0
] |
qemu | target-i386/translate.c | static void gen_compute_eflags_o(DisasContext *s, TCGv reg)
{
gen_compute_eflags(s);
tcg_gen_shri_tl(reg, cpu_cc_src, 11);
tcg_gen_andi_tl(reg, reg, 1);
} | [
0,
0
] |
qemu | Makefile.objs | static V9fsFidState *lookup_fid(V9fsState *s, int32_t fid)
{
V9fsFidState *f;
for (f = s->fid_list; f; f = f->next) {
if (f->fid == fid) {
v9fs_do_setuid(s, f->uid);
return f;
}
}
return NULL;
} | [
0,
0
] |
qemu | tests/test-vmstate.c | static QEMUFile *open_test_file(bool write)
{
int fd = dup(temp_fd);
QIOChannel *ioc;
lseek(fd, 0, SEEK_SET);
if (write) {
g_assert_cmpint(ftruncate(fd, 0), ==, 0);
}
ioc = QIO_CHANNEL(qio_channel_file_new_fd(fd));
if (write) {
return qemu_fopen_channel_output(ioc);
} else {
retur... | [
1,
0
] |
qemu | target-ppc/kvm.c | static uint64_t kvmppc_read_int_cpu_dt(const char *propname)
{
char buf[PATH_MAX];
union {
uint32_t v32;
uint64_t v64;
} u;
FILE *f;
int len;
if (kvmppc_find_cpu_dt(buf, sizeof(buf))) {
return -1;
}
strncat(buf, "/", sizeof(buf) - strlen(buf));
strncat(buf, propname, sizeof(buf... | [
1,
0
] |
qemu | hw/arm_gic.c | void icp_pit_init(uint32_t base, qemu_irq *pic, int irq)
{
int iomemtype;
icp_pit_state *s;
s = (icp_pit_state *)qemu_mallocz(sizeof(icp_pit_state));
s->base = base;
/* Timer 0 runs at the system clock speed (40MHz). */
s->timer[0] = arm_timer_init(40000000, pic[irq]);
/* The other two timers run... | [
1,
0
] |
FFmpeg | libavformat/adtsenc.c | static int adts_write_header(AVFormatContext *s)
{
ADTSContext *adts = s->priv_data;
AVCodecContext *avc = s->streams[0]->codec;
if (avc->extradata_size > 0)
decode_extradata(adts, avc->extradata, avc->extradata_size);
return 0;
} | [
1,
0
] |
qemu | migration.c | void process_incoming_migration(QEMUFile *f) {
if (qemu_loadvm_state(f) < 0) {
fprintf(stderr, "load of migration failed\n");
exit(0);
}
qemu_announce_self();
DPRINTF("successfully loaded vm state\n");
if (autostart)
vm_start();
} | [
1,
0
] |
FFmpeg | cmdutils.c | void *av_realloc(void *ptr, unsigned int size) {
#ifdef MEMALIGN_HACK
// FIXME this isnt aligned correctly though it probably isnt needed
int diff;
if (!ptr)
return av_malloc(size);
diff = ((char *)ptr)[-1];
return realloc(ptr - diff, size + diff) + diff;
#else
return realloc(ptr, size);
#endif
} | [
1,
1
] |
qemu | docs/qmp/qmp-events.txt | static void handle_event(int event)
{
static bool logged;
if (event & ~PVPANIC_PANICKED && !logged) {
qemu_log_mask(LOG_GUEST_ERROR, "pvpanic: unknown event %#x.\n", event);
logged = true;
}
if (event & PVPANIC_PANICKED) {
panicked_mon_event("pause");
vm_stop(RUN_STATE_GUEST_PANICKED);
... | [
1,
0
] |
qemu | cpus.c | static void qemu_mod_timer_ns(QEMUTimer *ts, int64_t expire_time)
{
QEMUTimer **pt, *t;
qemu_del_timer(ts);
/* add the timer in the sorted list */
/* NOTE: this code must be signal safe because
qemu_timer_expired() can be called from a signal. */
pt = &active_timers[ts->clock->type];
for (;;) {... | [
1,
0
] |
qemu | hw/block/dataplane/virtio-blk.c | void virtio_scsi_dataplane_notify(VirtIODevice *vdev, VirtIOSCSIReq *req)
{
if (virtio_should_notify(vdev, req->vq)) {
event_notifier_set(virtio_queue_get_guest_notifier(req->vq));
}
} | [
1,
0
] |
FFmpeg | libswscale/utils.c | SwsFunc ff_yuv2rgb_init_mmx(SwsContext *c)
{
int cpu_flags = av_get_cpu_flags();
if (c->srcFormat != PIX_FMT_YUV420P &&
c->srcFormat != PIX_FMT_YUVA420P)
return NULL;
if (HAVE_MMX2 && cpu_flags & AV_CPU_FLAG_MMX2) {
switch (c->dstFormat) {
case PIX_FMT_RGB24:
return yuv420_rgb24_MM... | [
1,
0
] |
FFmpeg | libavcodec/g2meet.c | static int g2m_init_buffers(G2MContext *c)
{
int aligned_height;
if (!c->framebuf || c->old_width < c->width || c->old_height < c->height) {
c->framebuf_stride = FFALIGN(c->width * 3, 16);
aligned_height = FFALIGN(c->height, 16);
av_free(c->framebuf);
c->framebuf = av_mallocz(c->framebuf_stri... | [
1,
0
] |
qemu | exec-all.h | static uint32_t unassigned_mem_readb(void *opaque, target_phys_addr_t addr)
{
#ifdef DEBUG_UNASSIGNED
printf("Unassigned mem read " TARGET_FMT_plx "\n", addr);
#endif
#if defined(TARGET_ALPHA) || defined(TARGET_SPARC) || defined(TARGET_MICROBLAZE)
do_unassigned_access(addr, 0, 0, 0, 1);
#endif
return 0;
} | [
1,
0
] |
FFmpeg | libavformat/rdt.c | rdt_parse_packet(PayloadContext *rdt, AVStream *st,
AVPacket *pkt, uint32_t *timestamp,
const uint8_t *buf, int len, int flags)
{
int seq = 1, res;
ByteIOContext pb;
if (rdt->audio_pkt_cnt == 0) {
int pos;
init_put_byte(&pb, buf, len, 0, NULL, NULL, NULL, NULL);
... | [
1,
0
] |
FFmpeg | libavformat/segment.c | static int select_reference_stream(AVFormatContext *s)
{
SegmentContext *seg = s->priv_data;
int ret, i;
seg->reference_stream_index = -1;
if (!strcmp(seg->reference_stream_specifier, "auto")) {
/* select first index of type with highest priority */
int type_index_map[AVMEDIA_TYPE_NB];
stati... | [
1,
0
] |
qemu | Makefile.objs | void qemu_put_byte(QEMUFile *f, int v)
{
if (f->last_error) {
return;
}
f->buf[f->buf_index] = v;
f->bytes_xfer++;
if (f->ops->writev_buffer) {
add_to_iovec(f, f->buf + f->buf_index, 1);
}
f->buf_index++;
if (f->buf_index == IO_BUF_SIZE) {
qemu_fflush(f);
}
} | [
1,
0
] |
qemu | hw/serial.c | static void serial_receive1(void *opaque, const uint8_t *buf, int size)
{
SerialState *s = opaque;
serial_receive_byte(s, buf[0]);
} | [
1,
0
] |
qemu | hw/dma/i82374.c | static void cpu_request_exit(void *opaque, int irq, int level)
{
CPUState *cpu = current_cpu;
if (cpu && level) {
cpu_exit(cpu);
}
} | [
0,
0
] |
qemu | Makefile | int qemu_get_thread_id(void)
{
#if defined(__linux__)
return syscall(SYS_gettid);
#else
return getpid();
#endif
} | [
0,
0
] |
qemu | acl.c | void watchdog_add_model(WatchdogTimerModel *model)
{
LIST_INSERT_HEAD(&watchdog_list, model, entry);
} | [
0,
0
] |
FFmpeg | libavcodec/indeo3.c | static int decode_plane(Indeo3DecodeContext *ctx, AVCodecContext *avctx,
Plane *plane, const uint8_t *data, int32_t data_size,
int32_t strip_width)
{
Cell curr_cell;
int num_vectors;
/* each plane data starts with mc_vector_count field, */
/* an optional ar... | [
0,
0
] |
qemu | hw/arm/nseries.c | static inline uint8_t *bt_hci_event_start(struct bt_hci_s *hci,
int evt, int len)
{
uint8_t *packet, mask;
int mask_byte;
if (len > 255) {
fprintf(stderr, "%s: HCI event params too long (%ib)\n",
__FUNCTION__, len);
exit(-1);
}
mask_byte =... | [
0,
0
] |
qemu | hw/hw.h | int64_t qemu_fseek(QEMUFile *f, int64_t pos, int whence)
{
if (whence == SEEK_SET) {
/* nothing to do */
} else if (whence == SEEK_CUR) {
pos += qemu_ftell(f);
} else {
/* SEEK_END not supported */
return -1;
}
if (f->is_writable) {
qemu_fflush(f);
f->buf_offset = pos;
} ... | [
0,
0
] |
qemu | hw/spapr_vty.c | static target_ulong h_put_term_char(CPUState *env, sPAPREnvironment *spapr,
target_ulong opcode, target_ulong *args)
{
target_ulong reg = args[0];
target_ulong len = args[1];
target_ulong char0_7 = args[2];
target_ulong char8_15 = args[3];
VIOsPAPRDevice *sdev = spap... | [
0,
0
] |
qemu | migration/migration.c | bool postcopy_ram_supported_by_host(void)
{
error_report("%s: No OS support", __func__);
return false;
} | [
0,
0
] |
qemu | Makefile.objs | int64_t qemu_file_get_rate_limit(QEMUFile *f)
{
return f->xfer_limit;
} | [
1,
0
] |
FFmpeg | libavcodec/vorbisenc.c | static inline void put_codeword(PutBitContext *pb, vorbis_enc_codebook *cb,
int entry)
{
assert(entry >= 0);
assert(entry < cb->nentries);
assert(cb->lens[entry]);
put_bits(pb, cb->lens[entry], cb->codewords[entry]);
} | [
1,
0
] |
qemu | block/vmdk.c | static int vmdk_open_desc_file(BlockDriverState *bs, int flags,
int64_t desc_offset)
{
int ret;
char buf[2048];
char ct[128];
BDRVVmdkState *s = bs->opaque;
ret = bdrv_pread(bs->file, desc_offset, buf, sizeof(buf));
if (ret < 0) {
return ret;
}
buf[2047] = '\... | [
1,
0
] |
FFmpeg | libavformat/oggdec.c | static int ogg_restore(AVFormatContext *s, int discard)
{
struct ogg *ogg = s->priv_data;
AVIOContext *bc = s->pb;
struct ogg_state *ost = ogg->state;
int i;
if (!ost)
return 0;
ogg->state = ost->next;
if (!discard) {
for (i = 0; i < ogg->nstreams; i++)
av_free(ogg->streams[i].buf... | [
1,
0
] |
FFmpeg | libavformat/rdt.c | rdt_free_context(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
] |
FFmpeg | libavformat/concatdec.c | static int copy_stream_props(AVStream *st, AVStream *source_st)
{
int ret;
if (st->codecpar->codec_id || !source_st->codecpar->codec_id) {
if (st->codecpar->extradata_size < source_st->codecpar->extradata_size) {
if (st->codecpar->extradata) {
av_freep(&st->codecpar->extradata);
st-... | [
1,
0
] |
qemu | async.c | aio_ctx_finalize(GSource *source) {
AioContext *ctx = (AioContext *)source;
thread_pool_free(ctx->thread_pool);
aio_set_event_notifier(ctx, &ctx->notifier, NULL);
event_notifier_cleanup(&ctx->notifier);
rfifolock_destroy(&ctx->lock);
qemu_mutex_destroy(&ctx->bh_lock);
timerlistgroup_deinit(&ctx->tlg); | [
1,
0
] |
qemu | target-ppc/helper.c | static always_inline target_phys_addr_t get_pgaddr(target_phys_addr_t sdr1,
int sdr_sh,
target_phys_addr_t hash,
target_phys_addr_t mask)
{
return (sdr1 & ((tar... | [
1,
0
] |
qemu | util/qemu-option.c | int qemu_opts_foreach(QemuOptsList *list, qemu_opts_loopfunc func,
void *opaque, Error **errp)
{
Location loc;
QemuOpts *opts;
int rc;
loc_push_none(&loc);
QTAILQ_FOREACH(opts, &list->head, next) {
loc_restore(&opts->loc);
rc = func(opaque, opts, errp);
if (rc) {
... | [
1,
0
] |
qemu | util/bitmap.c | void bitmap_set_atomic(unsigned long *map, long start, long nr) {
unsigned long *p = map + BIT_WORD(start);
const long size = start + nr;
int bits_to_set = BITS_PER_LONG - (start % BITS_PER_LONG);
unsigned long mask_to_set = BITMAP_FIRST_WORD_MASK(start);
/* First word */
if (nr - bits_to_set > 0) {
ato... | [
1,
0
] |
qemu | block.c | static int qcow_write(BlockDriverState *bs, int64_t sector_num,
const uint8_t *buf, int nb_sectors)
{
Coroutine *co;
AioContext *aio_context = bdrv_get_aio_context(bs);
QcowWriteCo data = {
.bs = bs,
.sector_num = sector_num,
.buf = buf,
.nb_sectors = nb_sect... | [
1,
0
] |
qemu | hw/9pfs/virtio-9p.c | static void v9fs_readdir(void *opaque)
{
int32_t fid;
V9fsFidState *fidp;
ssize_t retval = 0;
size_t offset = 7;
int64_t initial_offset;
int32_t count, max_count;
V9fsPDU *pdu = opaque;
V9fsState *s = pdu->s;
pdu_unmarshal(pdu, offset, "dqd", &fid, &initial_offset, &max_count);
trace_v9fs... | [
1,
0
] |
qemu | hw/openpic.c | static int IRQ_get_next(OpenPICState *opp, IRQ_queue_t *q)
{
if (q->next == -1) {
/* XXX: optimize */
IRQ_check(opp, q);
}
return q->next;
} | [
1,
1
] |
FFmpeg | libavfilter/vf_gradfun.c | static void end_frame(AVFilterLink *inlink)
{
GradFunContext *gf = inlink->dst->priv;
AVFilterBufferRef *inpic = inlink->cur_buf;
AVFilterLink *outlink = inlink->dst->outputs[0];
AVFilterBufferRef *outpic = outlink->out_buf;
int p;
for (p = 0; p < 4 && inpic->data[p]; p++) {
int w = inlink->w;
... | [
1,
0
] |
FFmpeg | libavcodec/wmalosslessdec.c | static void decode_mclms(WmallDecodeCtx *s)
{
s->mclms_order = (get_bits(&s->gb, 4) + 1) * 2;
s->mclms_scaling = get_bits(&s->gb, 4);
if (get_bits1(&s->gb)) {
// mclms_send_coef
int i;
int send_coef_bits;
int cbits = av_log2(s->mclms_scaling + 1);
assert(cbits == my_log2(s->mclms_scal... | [
1,
0
] |
qemu | hw/acpi/nvdimm.c | static void nvdimm_dsm_set_label_data(NVDIMMDevice *nvdimm, NvdimmDsmIn *in,
hwaddr dsm_mem_addr)
{
NVDIMMClass *nvc = NVDIMM_GET_CLASS(nvdimm);
NvdimmFuncSetLabelDataIn *set_label_data;
uint32_t status;
set_label_data = (NvdimmFuncSetLabelDataIn *)in->arg3;
le32_t... | [
1,
0
] |
qemu | target-lm32/translate.c | static void dec_rcsr(DisasContext *dc)
{
LOG_DIS("rcsr r%d, %d\n", dc->r2, dc->csr);
switch (dc->csr) {
case CSR_IE:
tcg_gen_mov_tl(cpu_R[dc->r2], cpu_ie);
break;
case CSR_IM:
gen_helper_rcsr_im(cpu_R[dc->r2], cpu_env);
break;
case CSR_IP:
gen_helper_rcsr_ip(cpu_R[dc->r2], cpu_e... | [
1,
0
] |
qemu | block/qcow2-cluster.c | static int write_refcount_block(BlockDriverState *bs)
{
BDRVQcowState *s = bs->opaque;
size_t size = s->cluster_size;
if (s->refcount_block_cache_offset == 0) {
return 0;
}
BLKDBG_EVENT(bs->file, BLKDBG_REFBLOCK_UPDATE);
if (bdrv_pwrite(bs->file, s->refcount_block_cache_offset,
... | [
1,
0
] |
qemu | target-ppc/cpu.h | static void gen_lswi(DisasContext *ctx)
{
TCGv t0;
TCGv_i32 t1, t2;
int nb = NB(ctx->opcode);
int start = rD(ctx->opcode);
int ra = rA(ctx->opcode);
int nr;
if (nb == 0)
nb = 32;
nr = nb / 4;
if (unlikely(((start + nr) > 32 &&
start <= ra && (start + nr - 32) > ra) ||
... | [
1,
0
] |
FFmpeg | libavcodec/h264.c | int ff_h264_check_intra_pred_mode(H264Context *h, int mode, int is_chroma)
{
static const int8_t top[7] = {LEFT_DC_PRED8x8, 1, -1, -1};
static const int8_t left[7] = {TOP_DC_PRED8x8, -1, 2, -1, DC_128_PRED8x8};
if (mode > 6U) {
av_log(h->avctx, AV_LOG_ERROR,
"out of range intra chroma pred mo... | [
1,
0
] |
qemu | HACKING | static void bonito_spciconf_writew(void *opaque, target_phys_addr_t addr,
uint32_t val)
{
PCIBonitoState *s = opaque;
PCIDevice *d = PCI_DEVICE(s);
PCIHostState *phb = PCI_HOST_BRIDGE(s->pcihost);
uint32_t pciaddr;
uint16_t status;
DPRINTF("bonito_spciconf_writew "... | [
0,
0
] |
qemu | backends/baum.c | static void numa_stat_memory_devices(uint64_t node_mem[])
{
MemoryDeviceInfoList *info_list = NULL;
MemoryDeviceInfoList **prev = &info_list;
MemoryDeviceInfoList *info;
qmp_pc_dimm_device_list(qdev_get_machine(), &prev);
for (info = info_list; info; info = info->next) {
MemoryDeviceInfo *value = i... | [
1,
0
] |
qemu | audio/alsaaudio.c | void audio_pcm_init_info(struct audio_pcm_info *info, audsettings_t *as)
{
int bits = 8, sign = 0, shift = 0;
switch (as->fmt) {
case AUD_FMT_S8:
sign = 1;
case AUD_FMT_U8:
break;
case AUD_FMT_S16:
sign = 1;
case AUD_FMT_U16:
bits = 16;
shift = 1;
break;
case AUD_FMT_... | [
1,
0
] |
FFmpeg | libavcodec/flac.c | static void allocate_buffers(FLACContext *s) {
int i;
assert(s->max_blocksize);
if (s->max_framesize == 0 && s->max_blocksize) {
s->max_framesize = (s->channels * s->bps * s->max_blocksize + 7) /
8; // FIXME header overhead
}
for (i = 0; i < s->channels; i++)
{
s->decod... | [
1,
1
] |
qemu | backends/baum.c | void replay_save_input_event(InputEvent *evt)
{
InputKeyEvent *key;
InputBtnEvent *btn;
InputMoveEvent *move;
replay_put_dword(evt->type);
switch (evt->type) {
case INPUT_EVENT_KIND_KEY:
key = evt->u.key;
replay_put_dword(key->key->type);
switch (key->key->type) {
case KEY_VALUE_K... | [
1,
0
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.