Projectname large_stringclasses 15
values | Filepath large_stringlengths 4 106 ⌀ | Function large_stringlengths 11 3.45k | Label list |
|---|---|---|---|
qemu | target-s390x/cpu.h | static void mvc_fast_memset(CPUS390XState *env, uint32_t l, uint64_t dest,
uint8_t byte)
{
S390CPU *cpu = s390_env_get_cpu(env);
hwaddr dest_phys;
hwaddr len = l;
void *dest_p;
uint64_t asc = env->psw.mask & PSW_MASK_ASC;
int flags;
if (mmu_translate(env, dest, 1, asc,... | [
1,
0
] |
qemu | hw/qdev-properties.c | void qdev_set_parent_bus(DeviceState *dev, BusState *bus)
{
Property *prop;
if (qdev_hotplug) {
assert(bus->allow_hotplug);
}
dev->parent_bus = bus;
QTAILQ_INSERT_HEAD(&bus->children, dev, sibling);
qdev_prop_set_defaults(dev, dev->parent_bus->info->props);
for (prop = qdev_get_bus_info(dev)->... | [
1,
0
] |
qemu | target-i386/op.c | static inline void gen_stack_update(DisasContext *s, int addend)
{
#ifdef TARGET_X86_64
if (CODE64(s)) {
gen_op_addq_ESP_im(addend);
} else
#endif
if (s->ss32) {
gen_op_addl_ESP_im(addend);
} else {
gen_op_addw_ESP_im(addend);
}
} | [
0,
0
] |
qemu | fpu/softfloat-specialize.h | float32 int64_to_float32(int64 a STATUS_PARAM)
{
flag zSign;
uint64 absA;
int8 shiftCount;
if (a == 0)
return 0;
zSign = (a < 0);
absA = zSign ? -a : a;
shiftCount = countLeadingZeros64(absA) - 40;
if (0 <= shiftCount) {
return packFloat32(zSign, 0x95 - shiftCount, absA << shiftCount);... | [
1,
0
] |
FFmpeg | configure | void clear_blocks_dcbz32_ppc(DCTELEM *blocks)
{
POWERPC_TBL_DECLARE(powerpc_clear_blocks_dcbz32, 1);
register int misal = ((unsigned long)blocks & 0x00000010);
register int i = 0;
POWERPC_TBL_START_COUNT(powerpc_clear_blocks_dcbz32, 1);
#if 1
if (misal) {
((unsigned long *)blocks)[0] = 0L;
((... | [
1,
0
] |
qemu | target-arm/cpu.c | static uint64_t read_raw_cp_reg(CPUARMState *env, const ARMCPRegInfo *ri)
{
/* Raw read of a coprocessor register (as needed for migration, etc). */
if (ri->type & ARM_CP_CONST) {
return ri->resetvalue;
} else if (ri->raw_readfn) {
return ri->raw_readfn(env, ri);
} else if (ri->readfn) {
ret... | [
0,
0
] |
qemu | HACKING | static uint64_t omap_sti_read(void *opaque, target_phys_addr_t addr,
unsigned size)
{
struct omap_sti_s *s = (struct omap_sti_s *)opaque;
if (size != 4) {
return omap_badwidth_read32(opaque, addr);
}
switch (addr) {
case 0x00: /* STI_REVISION */
return 0x10;
ca... | [
1,
1
] |
qemu | memory.c | int memory_region_get_fd(MemoryRegion *mr)
{
if (mr->alias) {
return memory_region_get_fd(mr->alias);
}
assert(mr->terminates);
return qemu_get_ram_fd(mr->ram_addr & TARGET_PAGE_MASK);
} | [
0,
0
] |
FFmpeg | libavcodec/utils.c | static int video_get_buffer(AVCodecContext *s, AVFrame *pic)
{
FramePool *pool = s->internal->pool;
const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pic->format);
int i;
if (pic->data[0]) {
av_log(s, AV_LOG_ERROR,
"pic->data[0]!=NULL in avcodec_default_get_buffer\n");
return -1;
... | [
1,
0
] |
qemu | hw/block/virtio-blk.c | static void virtio_net_save_device(VirtIODevice *vdev, QEMUFile *f)
{
VirtIONet *n = VIRTIO_NET(vdev);
int i;
qemu_put_buffer(f, n->mac, ETH_ALEN);
qemu_put_be32(f, n->vqs[0].tx_waiting);
qemu_put_be32(f, n->mergeable_rx_bufs);
qemu_put_be16(f, n->status);
qemu_put_byte(f, n->promisc);
qemu_put... | [
1,
0
] |
qemu | target-i386/helper.c | void cpu_x86_inject_mce(Monitor *mon, CPUState *cenv, int bank,
uint64_t status, uint64_t mcg_status, uint64_t addr,
uint64_t misc, int flags)
{
unsigned bank_num = cenv->mcg_cap & 0xff;
CPUState *env;
int flag = 0;
if (!cenv->mcg_cap) {
monitor_printf... | [
1,
0
] |
qemu | block/mirror.c | static void mirror_iteration_done(MirrorOp *op, int ret)
{
MirrorBlockJob *s = op->s;
struct iovec *iov;
int64_t chunk_num;
int i, nb_chunks, sectors_per_chunk;
trace_mirror_iteration_done(s, op->sector_num * BDRV_SECTOR_SIZE,
op->nb_sectors * BDRV_SECTOR_SIZE, ret);
s-... | [
0,
0
] |
FFmpeg | libavformat/utils.c | int av_write_frame(AVFormatContext *s, AVPacket *pkt)
{
int ret = compute_pkt_fields2(s, s->streams[pkt->stream_index], pkt);
if (ret < 0 && !(s->oformat->flags & AVFMT_NOTIMESTAMPS))
return ret;
ret = s->oformat->write_packet(s, pkt);
if (!ret)
ret = url_ferror(s->pb);
return ret;
} | [
1,
0
] |
FFmpeg | libavcodec/arm/fft_init_arm.c | av_cold int ff_fft_init(FFTContext *s, int nbits, int inverse)
{
int i, j, n;
if (nbits < 2 || nbits > 16)
goto fail;
s->nbits = nbits;
n = 1 << nbits;
s->revtab = av_malloc(n * sizeof(uint16_t));
if (!s->revtab)
goto fail;
s->tmp_buf = av_malloc(n * sizeof(FFTComplex));
if (!s->tmp_b... | [
1,
0
] |
FFmpeg | libavfilter/vf_overlay.c | static void start_frame(AVFilterLink *inlink, AVFilterBufferRef *inpicref)
{
AVFilterBufferRef *outpicref = avfilter_ref_buffer(inpicref, ~0);
AVFilterContext *ctx = inlink->dst;
OverlayContext *over = ctx->priv;
av_unused AVFilterLink *outlink = ctx->outputs[0];
inlink->dst->outputs[0]->out_buf = outpi... | [
1,
0
] |
qemu | include/qemu/timer.h | void timer_del(QEMUTimer *ts)
{
QEMUTimerList *timer_list = ts->timer_list;
qemu_mutex_lock(&timer_list->active_timers_lock);
timer_del_locked(timer_list, ts);
qemu_mutex_unlock(&timer_list->active_timers_lock);
} | [
1,
0
] |
qemu | Makefile.objs | static void put_bitmap(QEMUFile *f, void *pv, size_t size)
{
unsigned long *bmp = pv;
int i, idx = 0;
for (i = 0; i < BITS_TO_U64S(size); i++) {
uint64_t w = bmp[idx++];
if (sizeof(unsigned long) == 4 && idx < BITS_TO_LONGS(size)) {
w |= ((uint64_t)bmp[idx++]) << 32;
}
qemu_put_be64(... | [
1,
0
] |
qemu | hw/mc146818rtc.c | static int rtc_initfn(ISADevice *dev)
{
RTCState *s = DO_UPCAST(RTCState, dev, dev);
int base = 0x70;
int isairq = 8;
isa_init_irq(dev, &s->irq, isairq);
s->cmos_data[RTC_REG_A] = 0x26;
s->cmos_data[RTC_REG_B] = 0x02;
s->cmos_data[RTC_REG_C] = 0x00;
s->cmos_data[RTC_REG_D] = 0x80;
rtc_set_da... | [
1,
0
] |
qemu | hw/scsi/scsi-disk.c | static void scsi_dma_complete_noio(void *opaque, int ret)
{
SCSIDiskReq *r = (SCSIDiskReq *)opaque;
SCSIDiskState *s = DO_UPCAST(SCSIDiskState, qdev, r->req.dev);
if (r->req.aiocb != NULL) {
r->req.aiocb = NULL;
block_acct_done(bdrv_get_stats(s->qdev.conf.bs), &r->acct);
}
if (r->req.io_cancele... | [
0,
0
] |
qemu | check-qdict.c | START_TEST(qdict_get_str_test)
{
const char *p;
const char *key = "key";
const char *str = "string";
qdict_put(tests_dict, key, qstring_from_str(str));
p = qdict_get_str(tests_dict, key);
fail_unless(p != NULL);
fail_unless(strcmp(p, str) == 0);
} | [
0,
0
] |
qemu | hw/nvram/spapr_nvram.c | static void rtas_set_tce_bypass(sPAPREnvironment *spapr, uint32_t token,
uint32_t nargs, target_ulong args,
uint32_t nret, target_ulong rets)
{
VIOsPAPRBus *bus = spapr->vio_bus;
VIOsPAPRDevice *dev;
uint32_t unit, enable;
if (nargs != 2) {
... | [
0,
0
] |
qemu | hw/net/virtio-net.c | static int virtio_net_load(QEMUFile *f, void *opaque, int version_id)
{
VirtIONet *n = opaque;
VirtIODevice *vdev = VIRTIO_DEVICE(n);
if (version_id < 2 || version_id > VIRTIO_NET_VM_VERSION)
return -EINVAL;
return virtio_load(vdev, f, version_id);
} | [
1,
0
] |
FFmpeg | libavcodec/h264.h | static int get_last_needed_nal(H264Context *h)
{
int nals_needed = 0;
int i;
for (i = 0; i < h->pkt.nb_nals; i++) {
H2645NAL *nal = &h->pkt.nals[i];
GetBitContext gb;
/* packets can sometimes contain multiple PPS/SPS,
* e.g. two PAFF field pictures in one packet, or a demuxer
* whic... | [
1,
0
] |
FFmpeg | Changelog | static enum AVPixelFormat get_chroma_format(SchroChromaFormat schro_pix_fmt)
{
int num_formats = sizeof(schro_pixel_format_map) /
sizeof(schro_pixel_format_map[0]);
int idx;
for (idx = 0; idx < num_formats; ++idx)
if (schro_pixel_format_map[idx].schro_pix_fmt == schro_pix_fmt)
... | [
1,
0
] |
FFmpeg | libavformat/mpegts.c | static int mpegts_read_close(AVFormatContext *s)
{
MpegTSContext *ts = s->priv_data;
int i;
clear_programs(ts);
for (i = 0; i < NB_PID_MAX; i++)
if (ts->pids[i])
mpegts_close_filter(ts, ts->pids[i]);
return 0;
} | [
1,
0
] |
FFmpeg | libavcodec/adx.h | static void adx_encode(unsigned char *adx, const short *wav,
ADXChannelState *prev)
{
int scale;
int i;
int s0, s1, s2, d;
int max = 0;
int min = 0;
int data[32];
s1 = prev->s1;
s2 = prev->s2;
for (i = 0; i < 32; i++) {
s0 = wav[i];
d = ((s0 << 14) - SCALE1 ... | [
1,
0
] |
qemu | qga/channel-posix.c | GAChannel *ga_channel_new(GAChannelMethod method, const gchar *path,
GAChannelCallback cb, gpointer opaque)
{
GAChannel *c = g_malloc0(sizeof(GAChannel));
SECURITY_ATTRIBUTES sec_attrs;
if (!ga_channel_open(c, method, path)) {
g_critical("error opening channel");
g_free(c)... | [
1,
0
] |
qemu | block/qcow2-cluster.c | int qcow2_snapshot_goto(BlockDriverState *bs, const char *snapshot_id)
{
BDRVQcowState *s = bs->opaque;
QCowSnapshot *sn;
int i, snapshot_index, l1_size2;
snapshot_index = find_snapshot_by_id_or_name(bs, snapshot_id);
if (snapshot_index < 0)
return -ENOENT;
sn = &s->snapshots[snapshot_index];
... | [
1,
0
] |
qemu | hw/block/dataplane/virtio-blk.c | static void virtio_blk_handle_scsi(VirtIOBlockReq *req)
{
int status;
status = virtio_blk_handle_scsi_req(req->dev, req->elem);
virtio_blk_req_complete(req, status);
virtio_blk_free_request(req);
} | [
1,
0
] |
FFmpeg | libavformat/avio.h | int avio_read(AVIOContext *s, unsigned char *buf, int size)
{
int len, size1;
size1 = size;
while (size > 0) {
len = FFMIN(s->buf_end - s->buf_ptr, size);
if (len == 0 || s->write_flag) {
if ((s->direct || size > s->buffer_size) && !s->update_checksum) {
// bypass the buffer and read... | [
1,
0
] |
FFmpeg | libavformat/hls.c | static int hls_probe(AVProbeData *p)
{
/* Require #EXTM3U at the start, and either one of the ones below
* somewhere for a proper match. */
if (strncmp(p->buf, "#EXTM3U", 7))
return 0;
if (p->filename && !av_match_ext(p->filename, "m3u8,m3u"))
return 0;
if (strstr(p->buf, "#EXT-X-STREAM-INF:"... | [
1,
0
] |
FFmpeg | libavcodec/svq1dec.c | static int svq1_motion_inter_block(MpegEncContext *s, GetBitContext *bitbuf,
uint8_t *current, uint8_t *previous,
int pitch, svq1_pmv *motion, int x, int y)
{
uint8_t *src;
uint8_t *dst;
svq1_pmv mv;
svq1_pmv *pmv[3];
int result;
... | [
1,
0
] |
FFmpeg | libavformat/rtsp.c | static void sdp_parse_fmtp_config(AVCodecContext *codec, char *attr,
char *value)
{
switch (codec->codec_id) {
case CODEC_ID_MPEG4:
case CODEC_ID_AAC:
if (!strcmp(attr, "config")) {
/* decode the hexa encoded parameter */
int len = hex_to_data(NULL, value);... | [
1,
0
] |
qemu | hw/scsi/spapr_vscsi.c | static int vscsi_send_iu(VSCSIState *s, vscsi_req *req,
uint64_t length, uint8_t format)
{
long rc, rc1;
/* First copy the SRP */
rc = spapr_vio_dma_write(&s->vdev, req->crq.s.IU_data_ptr,
&req->iu, length);
if (rc) {
fprintf(stderr, "vscsi_send_iu... | [
1,
0
] |
FFmpeg | libavformat/r3d.c | static int r3d_read_reda(AVFormatContext *s, AVPacket *pkt, Atom *atom)
{
AVStream *st = s->streams[1];
int av_unused tmp, tmp2;
int samples, size;
uint64_t pos = avio_tell(s->pb);
unsigned dts;
int ret;
dts = avio_rb32(s->pb);
st->codec->sample_rate = avio_rb32(s->pb);
samples = avio_rb32(s... | [
1,
0
] |
qemu | hw/ppc/spapr.c | static int kvm_ppc_register_host_cpu_type(void)
{
TypeInfo type_info = {
.name = TYPE_HOST_POWERPC_CPU,
.instance_init = kvmppc_host_cpu_initfn,
.class_init = kvmppc_host_cpu_class_init,
};
PowerPCCPUClass *pvr_pcc;
DeviceClass *dc;
pvr_pcc = kvm_ppc_get_host_cpu_class();
if (pvr... | [
1,
0
] |
qemu | hw/i386/pc.c | void pc_hot_add_cpu(const int64_t id, Error **errp)
{
X86CPU *cpu;
ObjectClass *oc;
PCMachineState *pcms = PC_MACHINE(qdev_get_machine());
int64_t apic_id = x86_cpu_apic_id_from_index(id);
Error *local_err = NULL;
if (id < 0) {
error_setg(errp, "Invalid CPU id: %" PRIi64, id);
return;
}
... | [
0,
0
] |
FFmpeg | avprobe.c | static void show_packet(AVFormatContext *fmt_ctx, AVPacket *pkt)
{
char val_str[128];
AVStream *st = fmt_ctx->streams[pkt->stream_index];
printf("[PACKET]\n");
printf("codec_type=%s\n", media_type_string(st->codec->codec_type));
printf("stream_index=%d\n", pkt->stream_index);
printf("pts=%s\n", ts_va... | [
1,
0
] |
qemu | target-arm/cpu.h | static inline void assert_fp_access_checked(DisasContext *s)
{
#ifdef CONFIG_DEBUG_TCG
if (unlikely(!s->fp_access_checked || !s->cpacr_fpen)) {
fprintf(stderr,
"target-arm: FP access check missing for "
"instruction 0x%08x\n",
s->insn);
abort();
}
#endif
} | [
0,
0
] |
qemu | HACKING | static void dp8393x_writew(void *opaque, target_phys_addr_t addr, uint32_t val)
{
dp8393xState *s = opaque;
int reg;
if ((addr & ((1 << s->it_shift) - 1)) != 0) {
return;
}
reg = addr >> s->it_shift;
write_register(s, reg, (uint16_t)val);
} | [
1,
0
] |
FFmpeg | libavfilter/vf_drawtext.c | static int draw_glyphs(DrawTextContext *dtext, AVFilterBufferRef *picref,
int width, int height, const uint8_t rgbcolor[4],
const uint8_t yuvcolor[4], int x, int y)
{
char *text = dtext->text;
uint32_t code = 0;
int i;
uint8_t *p;
Glyph *glyph = NULL;
fo... | [
1,
0
] |
qemu | hw/pci.c | static void pci_device_reset(PCIDevice *dev)
{
int r;
memset(dev->irq_state, 0, sizeof dev->irq_state);
dev->config[PCI_COMMAND] &= ~(PCI_COMMAND_IO | PCI_COMMAND_MEMORY |
PCI_COMMAND_MASTER);
dev->config[PCI_CACHE_LINE_SIZE] = 0x0;
dev->config[PCI_INTERRUPT_LINE] = 0x0;... | [
1,
0
] |
FFmpeg | libavformat/rtsp.c | static int rtsp_read_play(AVFormatContext *s)
{
RTSPState *rt = s->priv_data;
RTSPMessageHeader reply1, *reply = &reply1;
int i;
char cmd[1024];
av_log(s, AV_LOG_DEBUG, "hello state=%d\n", rt->state);
if (!(rt->server_type == RTSP_SERVER_REAL && rt->need_subscription)) {
if (rt->state == RTSP_ST... | [
1,
0
] |
qemu | exec.c | static void cris_cpu_initfn(Object *obj)
{
CPUState *cs = CPU(obj);
CRISCPU *cpu = CRIS_CPU(obj);
CRISCPUClass *ccc = CRIS_CPU_GET_CLASS(obj);
CPUCRISState *env = &cpu->env;
static bool tcg_initialized;
cs->env_ptr = env;
cpu_exec_init(cs, &error_abort);
env->pregs[PR_VR] = ccc->vr;
#ifndef CO... | [
1,
0
] |
FFmpeg | libavcodec/jpeg2000dec.c | static int get_cod(Jpeg2000DecoderContext *s, Jpeg2000CodingStyle *c,
uint8_t *properties)
{
Jpeg2000CodingStyle tmp;
int compno;
if (s->buf_end - s->buf < 5)
return AVERROR(EINVAL);
tmp.log2_prec_width =
tmp.log2_prec_height = 15;
tmp.csty = bytestream_get_byte(&s->buf);... | [
1,
0
] |
FFmpeg | libavcodec/ac3dec.c | static inline float to_float(uint8_t exp, int16_t mantissa)
{
return ((float)(mantissa * scale_factors[exp]));
} | [
0,
0
] |
qemu | hw/scsi/virtio-scsi.c | static bool virtio_scsi_handle_cmd_req_prepare(VirtIOSCSI *s,
VirtIOSCSIReq *req)
{
VirtIOSCSICommon *vs = &s->parent_obj;
SCSIDevice *d;
int rc;
rc = virtio_scsi_parse_req(req, sizeof(VirtIOSCSICmdReq) + vs->cdb_size,
sizeof(Virt... | [
1,
0
] |
FFmpeg | libavcodec/flacenc.c | static void calc_sums(int pmin, int pmax, uint32_t *data, int n, int pred_order,
uint32_t sums[][MAX_PARTITIONS])
{
int i, j;
int parts;
uint32_t *res, *res_end;
/* sums for highest level */
parts = (1 << pmax);
res = &data[pred_order];
res_end = &data[n >> pmax];
for (i ... | [
1,
0
] |
qemu | target/s390x/helper.c | void load_psw(CPUS390XState *env, uint64_t mask, uint64_t addr)
{
uint64_t old_mask = env->psw.mask;
env->psw.addr = addr;
env->psw.mask = mask;
if (tcg_enabled()) {
env->cc_op = (mask >> 44) & 3;
}
if ((old_mask ^ mask) & PSW_MASK_PER) {
s390_cpu_recompute_watchpoints(CPU(s390_env_get_cpu(e... | [
1,
0
] |
FFmpeg | libavformat/amr.c | static int amr_read_packet(AVFormatContext *s, AVPacket *pkt)
{
AVCodecContext *enc = s->streams[0]->codec;
int read, size = 0, toc, mode;
int64_t pos = avio_tell(s->pb);
if (url_feof(s->pb)) {
return AVERROR(EIO);
}
// FIXME this is wrong, this should rather be in a AVParset
toc = avio_r8(s->... | [
1,
1
] |
FFmpeg | ffmpeg.c | static int rm_write_audio(AVFormatContext *s, const uint8_t *buf, int size)
{
uint8_t *buf1;
RMContext *rm = s->priv_data;
ByteIOContext *pb = &s->pb;
StreamInfo *stream = rm->audio_stream;
int i;
/* XXX: suppress this malloc */
buf1 = (uint8_t *)av_malloc(size * sizeof(uint8_t));
write_packet_... | [
1,
1
] |
qemu | block.c | static BlockStats *bdrv_query_bds_stats(const BlockDriverState *bs,
bool query_backing)
{
BlockStats *s = NULL;
s = g_malloc0(sizeof(*s));
s->stats = g_malloc0(sizeof(*s->stats));
if (!bs) {
return s;
}
if (bdrv_get_node_name(bs)[0]) {
s->has_node_nam... | [
1,
0
] |
qemu | cpus.c | void hmp_info_cpus(Monitor *mon, const QDict *qdict)
{
CpuInfoList *cpu_list, *cpu;
cpu_list = qmp_query_cpus(NULL);
for (cpu = cpu_list; cpu; cpu = cpu->next) {
int active = ' ';
if (cpu->value->CPU == monitor_get_cpu_index()) {
active = '*';
}
monitor_printf(mon, "%c CPU #%" PRId64... | [
1,
0
] |
qemu | kvm-all.c | MemTxResult memory_region_dispatch_write(MemoryRegion *mr, hwaddr addr,
uint64_t data, unsigned size,
MemTxAttrs attrs) {
if (!memory_region_access_valid(mr, addr, size, true)) {
unassigned_mem_write(mr, addr, data, size);
retur... | [
1,
0
] |
FFmpeg | libavcodec/lagarith.c | static int lag_decode_zero_run_line(LagarithContext *l, uint8_t *dst,
const uint8_t *src, const uint8_t *src_end,
int width, int esc_count)
{
int i = 0;
int count;
uint8_t zero_run = 0;
const uint8_t *src_start = src;
uint8_t mask... | [
1,
0
] |
FFmpeg | libavcodec/mjpegenc.c | static int amv_encode_picture(AVCodecContext *avctx, AVPacket *pkt,
const AVFrame *pic_arg, int *got_packet)
{
MpegEncContext *s = avctx->priv_data;
AVFrame *pic;
int i, ret;
int chroma_h_shift, chroma_v_shift;
av_pix_fmt_get_chroma_sub_sample(avctx->pix_fmt, &chroma_h_shi... | [
1,
0
] |
FFmpeg | libavfilter/vf_paletteuse.c | static av_always_inline int
get_dst_color_err(PaletteUseContext *s,
uint32_t c, int *er, int *eg, int *eb,
const enum color_search_method search_method)
{
const uint8_t a = c >> 24 & 0xff;
const uint8_t r = c >> 16 & 0xff;
const uint8_t g = c >> 8 & 0xff;
const uint8_t... | [
1,
0
] |
FFmpeg | libavcodec/ffv1.c | static inline void put_symbol_inline(RangeCoder *c, uint8_t *state, int v,
int is_signed) {
int i;
if (v) {
const int a = FFABS(v);
const int e = av_log2(a);
put_rac(c, state + 0, 0);
assert(e <= 9);
for (i = 0; i < e; i++) {
put_rac(c, state + ... | [
1,
0
] |
FFmpeg | libavcodec/mpegaudiodec.c | static int decode_frame(AVCodecContext *avctx,
void *data, int *data_size,
AVPacket *avpkt)
{
const uint8_t *buf = avpkt->data;
int buf_size = avpkt->size;
MPADecodeContext *s = avctx->priv_data;
uint32_t header;
int out_size;
OUT_INT *out_samples = d... | [
1,
1
] |
qemu | hw/i386/kvm/pci-assign.c | static bool check_irqchip_in_kernel(void)
{
if (kvm_irqchip_in_kernel()) {
return true;
}
error_report("pci-assign: error: requires KVM with in-kernel irqchip "
"enabled");
return false;
} | [
1,
0
] |
qemu | tcg/tcg.c | void tcg_prologue_init(TCGContext *s) {
/* init global prologue and epilogue */
s->code_buf = s->code_gen_prologue;
s->code_ptr = s->code_buf;
tcg_target_qemu_prologue(s);
flush_icache_range((tcg_target_ulong)s->code_buf,
(tcg_target_ulong)s->code_ptr); | [
1,
0
] |
FFmpeg | libavfilter/af_dynaudnorm.c | static av_cold void uninit(AVFilterContext *ctx)
{
DynamicAudioNormalizerContext *s = ctx->priv;
int c;
av_freep(&s->prev_amplification_factor);
av_freep(&s->dc_correction_value);
av_freep(&s->compress_threshold);
av_freep(&s->fade_factors[0]);
av_freep(&s->fade_factors[1]);
for (c = 0; c < s->... | [
1,
0
] |
FFmpeg | libavformat/mxfdec.c | static int mxf_read_sequence(void *arg, AVIOContext *pb, int tag, int size,
UID uid)
{
MXFSequence *sequence = arg;
switch (tag) {
case 0x0202:
sequence->duration = avio_rb64(pb);
break;
case 0x0201:
avio_read(pb, sequence->data_definition_ul, 16);
break;
... | [
1,
0
] |
qemu | hw/net/rocker/rocker.c | World *world_alloc(Rocker *r, size_t sizeof_private,
enum rocker_world_type type, WorldOps *ops)
{
World *w = g_malloc0(sizeof(World) + sizeof_private);
if (w) {
w->r = r;
w->type = type;
w->ops = ops;
if (w->ops->init) {
w->ops->init(w);
}
}
return w;
} | [
1,
0
] |
qemu | hw/misc/ivshmem.c | static int resize_peers(IVShmemState *s, int new_min_size)
{
int j, old_size;
/* limit number of max peers */
if (new_min_size <= 0 || new_min_size > IVSHMEM_MAX_PEERS) {
return -1;
}
if (new_min_size <= s->nb_peers) {
return 0;
}
old_size = s->nb_peers;
s->nb_peers = new_min_size;
I... | [
1,
0
] |
qemu | qemu-io-cmds.c | create_iovec(BlockBackend *blk, QEMUIOVector *qiov, char **argv, int nr_iov,
int pattern)
{
size_t *sizes = g_new0(size_t, nr_iov);
size_t count = 0;
void *buf = NULL;
void *p;
int i;
for (i = 0; i < nr_iov; i++) {
char *arg = argv[i];
int64_t len;
len = cvtnum(arg);
... | [
1,
0
] |
qemu | target-arm/cpu-qom.h | static void aarch64_cpu_class_init(ObjectClass *oc, void *data)
{
CPUClass *cc = CPU_CLASS(oc);
cc->dump_state = aarch64_cpu_dump_state;
cc->set_pc = aarch64_cpu_set_pc;
cc->gdb_read_register = aarch64_cpu_gdb_read_register;
cc->gdb_write_register = aarch64_cpu_gdb_write_register;
cc->gdb_num_core_re... | [
1,
0
] |
FFmpeg | libavcodec/vorbisenc.c | static void move_audio(vorbis_enc_context *venc, float **audio, int *samples,
int sf_size)
{
AVFrame *cur = NULL;
int frame_size = 1 << (venc->log2_blocksize[1] - 1);
int subframes = frame_size / sf_size;
for (int sf = 0; sf < subframes; sf++) {
cur = ff_bufqueue_get(&venc->bufq... | [
1,
0
] |
FFmpeg | libavformat/dump.c | static void pkt_dump_internal(void *avcl, FILE *f, int level,
const AVPacket *pkt,
int dump_payload, AVRational time_base)
{
HEXDUMP_PRINT("stream #%d:\n", pkt->stream_index);
HEXDUMP_PRINT(" keyframe=%d\n", (pkt->flags & AV_PKT_FLAG_KEY) != 0);
HE... | [
1,
0
] |
qemu | include/qapi/visitor-impl.h | void visit_type_uint32(Visitor *v, uint32_t *obj, const char *name,
Error **errp)
{
int64_t value;
if (v->type_uint32) {
v->type_uint32(v, obj, name, errp);
} else {
value = *obj;
v->type_int64(v, &value, name, errp);
if (value < 0 || value > UINT32_MAX) {
/* ... | [
1,
1
] |
FFmpeg | libavformat/nutdec.c | static int decode_frame(NUTContext *nut, AVPacket *pkt, int frame_code) {
AVFormatContext *s = nut->avf;
ByteIOContext *bc = &s->pb;
int size, stream_id, flags, discard;
int64_t pts, last_IP_pts;
size = decode_frame_header(nut, &flags, &pts, &stream_id, frame_code);
if (size < 0)
return -1;
if... | [
1,
0
] |
FFmpeg | libavcodec/mjpeg.c | static int mjpeg_decode_dht(MJpegDecodeContext *s)
{
int len, index, i, class, n, v, code_max;
uint8_t bits_table[17];
uint8_t val_table[256];
len = get_bits(&s->gb, 16) - 2;
while (len > 0) {
if (len < 17)
return -1;
class = get_bits(&s->gb, 4);
if (class >= 2)
return -1;
... | [
1,
0
] |
qemu | hw/usb-bt.c | static int usb_net_handle_dataout(USBNetState *s, USBPacket *p)
{
int ret = p->len;
int sz = sizeof(s->out_buf) - s->out_ptr;
struct rndis_packet_msg_type *msg =
(struct rndis_packet_msg_type *)s->out_buf;
uint32_t len;
#ifdef TRAFFIC_DEBUG
fprintf(stderr, "usbnet: data out len %u\n", p->len);
... | [
1,
0
] |
qemu | block.c | int bdrv_can_snapshot(BlockDriverState *bs)
{
BlockDriver *drv = bs->drv;
if (!drv || bdrv_is_removable(bs) || bdrv_is_read_only(bs)) {
return 0;
}
if (!drv->bdrv_snapshot_create) {
if (bs->file != NULL) {
return bdrv_can_snapshot(bs->file);
}
return 0;
}
return 1;
} | [
0,
0
] |
qemu | target-i386/helper.c | static void add_flagname_to_bitmaps(char *flagname, uint32_t *features,
uint32_t *ext_features,
uint32_t *ext2_features,
uint32_t *ext3_features)
{
int i;
int found = 0;
for (i = 0; i < 32; i++)
... | [
1,
0
] |
qemu | block/quorum.c | static void quorum_aio_cb(void *opaque, int ret)
{
QuorumChildRequest *sacb = opaque;
QuorumAIOCB *acb = sacb->parent;
BDRVQuorumState *s = acb->common.bs->opaque;
sacb->ret = ret;
acb->count++;
if (ret == 0) {
acb->success_count++;
} else {
quorum_report_bad(acb, sacb->aiocb->bs->node_n... | [
1,
0
] |
qemu | docs/qapi-code-gen.txt | void visit_type_int16(Visitor *v, int16_t *obj, const char *name, Error **errp)
{
int64_t value;
if (!error_is_set(errp)) {
if (v->type_int16) {
v->type_int16(v, obj, name, errp);
} else {
value = *obj;
v->type_int(v, &value, name, errp);
if (value < INT16_MIN || value > INT... | [
1,
0
] |
qemu | Makefile | static void *sigwait_compat(void *opaque)
{
struct sigfd_compat_info *info = opaque;
int err;
sigset_t all;
sigfillset(&all);
sigprocmask(SIG_BLOCK, &all, NULL);
do {
siginfo_t siginfo;
err = sigwaitinfo(&info->mask, &siginfo);
if (err == -1 && errno == EINTR) {
err = 0;
... | [
1,
0
] |
qemu | ui/console.c | DisplayState *init_displaystate(void)
{
gchar *name;
int i;
if (!display_state) {
display_state = g_new0(DisplayState, 1);
}
for (i = 0; i < nb_consoles; i++) {
if (consoles[i]->console_type != GRAPHIC_CONSOLE &&
consoles[i]->ds == NULL) {
text_console_do_init(consoles[i]->chr, ... | [
1,
0
] |
FFmpeg | libavcodec/wmv2dec.c | static int decode_ext_header(Wmv2Context *w) {
MpegEncContext *const s = &w->s;
GetBitContext gb;
int fps;
int code;
if (s->avctx->extradata_size < 4)
return -1;
init_get_bits(&gb, s->avctx->extradata, s->avctx->extradata_size * 8);
fps = get_bits(&gb, 5);
s->bit_rate = get_bits(&gb, 11) * 1... | [
1,
0
] |
qemu | accel/tcg/cputlb.c | static void tlb_flush_nocheck(CPUState *cpu)
{
CPUArchState *env = cpu->env_ptr;
/* The QOM tests will trigger tlb_flushes without setting up TCG
* so we bug out here in that case.
*/
if (!tcg_enabled()) {
return;
}
assert_cpu_is_self(cpu);
tlb_debug("(count: %d)\n", tlb_flush_count++);
... | [
1,
0
] |
qemu | exec.c | static uint64_t addrrange_end(AddrRange r)
{
return r.start + r.size;
} | [
1,
0
] |
FFmpeg | libavfilter/af_dynaudnorm.c | static void cqueue_free(cqueue *q)
{
av_free(q->elements);
av_free(q);
} | [
1,
0
] |
qemu | hw/usb-msd.c | static void usb_msd_cancel_io(USBDevice *dev, USBPacket *p)
{
MSDState *s = DO_UPCAST(MSDState, dev, dev);
scsi_req_cancel(s->req);
} | [
1,
0
] |
qemu | hw/usb-ehci.c | static void ehci_advance_periodic_state(EHCIState *ehci)
{
uint32_t entry;
uint32_t list;
const int async = 0;
// 4.6
switch (ehci_get_state(ehci, async)) {
case EST_INACTIVE:
if (!(ehci->frindex & 7) && (ehci->usbcmd & USBCMD_PSE)) {
ehci_set_usbsts(ehci, USBSTS_PSS);
ehci_set_sta... | [
1,
0
] |
qemu | include/block/aio.h | static void test_bh_schedule10(void)
{
BHTestData data = {.n = 0, .max = 10};
data.bh = aio_bh_new(ctx, bh_test_cb, &data);
qemu_bh_schedule(data.bh);
g_assert_cmpint(data.n, ==, 0);
g_assert(aio_poll(ctx, false));
g_assert_cmpint(data.n, ==, 1);
g_assert(aio_poll(ctx, true));
g_assert_cmpint(d... | [
0,
0
] |
qemu | hw/ppc/spapr_iommu.c | static void rtas_set_tce_bypass(PowerPCCPU *cpu, sPAPREnvironment *spapr,
uint32_t token,
uint32_t nargs, target_ulong args,
uint32_t nret, target_ulong rets)
{
VIOsPAPRBus *bus = spapr->vio_bus;
VIOsPAPRDevice *de... | [
0,
0
] |
qemu | linux-user/signal.c | int target_to_host_signal(int sig)
{
if (sig >= _NSIG)
return sig;
return target_to_host_signal_table[sig];
} | [
0,
0
] |
qemu | net/dump.c | int net_init_tap(const NetClientOptions *opts, const char *name,
NetClientState *peer, Error **errp)
{
/* FIXME error_setg(errp, ...) on failure */
const NetdevTapOptions *tap;
assert(opts->kind == NET_CLIENT_OPTIONS_KIND_TAP);
tap = opts->tap;
if (!tap->has_ifname) {
error_report... | [
0,
1
] |
qemu | block/qcow2.c | static int qcow2_save_vmstate(BlockDriverState *bs, QEMUIOVector *qiov,
int64_t pos)
{
BDRVQcow2State *s = bs->opaque;
int64_t total_sectors = bs->total_sectors;
bool zero_beyond_eof = bs->zero_beyond_eof;
int ret;
BLKDBG_EVENT(bs->file, BLKDBG_VMSTATE_SAVE);
bs->zero_b... | [
0,
0
] |
qemu | net.c | void net_host_device_remove(Monitor *mon, int vlan_id, const char *device)
{
VLANState *vlan;
VLANClientState *vc;
vlan = qemu_find_vlan(vlan_id);
for (vc = vlan->first_client; vc != NULL; vc = vc->next)
if (!strcmp(vc->name, device))
break;
if (!vc) {
monitor_printf(mon, "can't find de... | [
0,
0
] |
qemu | Makefile.objs | static int buffered_put_buffer(void *opaque, const uint8_t *buf, int64_t pos,
int size)
{
QEMUFileBuffered *s = opaque;
ssize_t error;
DPRINTF("putting %d bytes at %" PRId64 "\n", size, pos);
error = qemu_file_get_error(s->file);
if (error) {
DPRINTF("flush when error... | [
1,
0
] |
qemu | hw/vfio_pci.c | static void vfio_bar_write(void *opaque, hwaddr addr,
uint64_t data, unsigned size)
{
VFIOBAR *bar = opaque;
union {
uint8_t byte;
uint16_t word;
uint32_t dword;
uint64_t qword;
} buf;
switch (size) {
case 1:
buf.byte = data;
break;
case 2:
... | [
1,
0
] |
qemu | hw/acpi/aml-build.c | build_gtdt(GArray *table_data, GArray *linker)
{
int gtdt_start = table_data->len;
AcpiGenericTimerTable *gtdt;
gtdt = acpi_data_push(table_data, sizeof *gtdt);
/* The interrupt values are the same with the device tree when adding 16 */
gtdt->secure_el1_interrupt = ARCH_TIMER_S_EL1_IRQ + 16;
gtdt->se... | [
0,
0
] |
qemu | vl.c | void main_loop_wait(int nonblocking)
{
fd_set rfds, wfds, xfds;
int ret, nfds;
struct timeval tv;
int timeout;
if (nonblocking)
timeout = 0;
else {
timeout = qemu_calculate_timeout();
qemu_bh_update_timeout(&timeout);
}
os_host_main_loop_wait(&timeout);
tv.tv_sec = timeout / 10... | [
0,
1
] |
qemu | block/sheepdog.c | static coroutine_fn void do_co_req(void *opaque)
{
int ret;
Coroutine *co;
SheepdogReqCo *srco = opaque;
int sockfd = srco->sockfd;
SheepdogReq *hdr = srco->hdr;
void *data = srco->data;
unsigned int *wlen = srco->wlen;
unsigned int *rlen = srco->rlen;
co = qemu_coroutine_self();
qemu_aio... | [
1,
0
] |
qemu | io/channel-websock.c | static ssize_t qio_channel_websock_read_wire(QIOChannelWebsock *ioc,
Error **errp)
{
ssize_t ret;
if (ioc->encinput.offset < 4096) {
size_t want = 4096 - ioc->encinput.offset;
buffer_reserve(&ioc->encinput, want);
ret = qio_channel_read(ioc->master,
... | [
1,
0
] |
qemu | block/qcow2-snapshot.c | int qcow2_snapshot_delete(BlockDriverState *bs, const char *snapshot_id)
{
BDRVQcowState *s = bs->opaque;
QCowSnapshot sn;
int snapshot_index, ret;
/* Search the snapshot */
snapshot_index = find_snapshot_by_id_or_name(bs, snapshot_id);
if (snapshot_index < 0) {
return -ENOENT;
}
sn = s->sn... | [
1,
0
] |
qemu | hw/spapr_pci.c | static void rtas_ibm_read_pci_config(sPAPREnvironment *spapr,
uint32_t token, uint32_t nargs,
target_ulong args,
uint32_t nret, target_ulong rets)
{
uint32_t val, size, addr;
uint64_t buid = ((uint64... | [
1,
0
] |
qemu | hw/sd/sdhci.c | static void sdhci_sysbus_realize(DeviceState *dev, Error **errp)
{
SDHCIState *s = SYSBUS_SDHCI(dev);
SysBusDevice *sbd = SYS_BUS_DEVICE(dev);
sdhci_common_realize(s, errp);
if (errp && *errp) {
return;
}
if (s->dma_mr) {
address_space_init(s->dma_as, s->dma_mr, "sdhci-dma");
} else {
... | [
1,
0
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.