Projectname large_stringclasses 15
values | Filepath large_stringlengths 4 106 ⌀ | Function large_stringlengths 11 3.45k | Label list |
|---|---|---|---|
qemu | scripts/tracetool/backend/simple.py | void trace_event_set_vcpu_state_dynamic(CPUState *vcpu,
TraceEvent *ev, bool state)
{
TraceEventVCPUID vcpu_id;
bool state_pre;
assert(trace_event_get_state_static(ev));
assert(trace_event_is_vcpu(ev));
vcpu_id = trace_event_get_vcpu_id(ev);
state_pre = test_b... | [
1,
0
] |
FFmpeg | libavcodec/avs.c | static av_cold int truemotion1_decode_init(AVCodecContext *avctx)
{
TrueMotion1Context *s = avctx->priv_data;
s->avctx = avctx;
// FIXME: it may change ?
// if (avctx->bits_per_sample == 24)
// avctx->pix_fmt = AV_PIX_FMT_RGB24;
// else
// avctx->pix_fmt = AV_PIX_FMT_RGB555;
... | [
1,
1
] |
qemu | include/qemu/hbitmap.h | uint64_t hbitmap_serialization_granularity(const HBitmap *hb)
{
/* Must hold true so that the shift below is defined
* (ld(64) == 6, i.e. 1 << 6 == 64) */
assert(hb->granularity < 64 - 6);
/* Require at least 64 bit granularity to be safe on both 64 bit and 32 bit
* hosts. */
return UINT64_C(64) <<... | [
1,
0
] |
qemu | hw/ppc/spapr.c | void helper_store_sdr1(CPUPPCState *env, target_ulong val)
{
ppc_store_sdr1(env, val);
} | [
1,
0
] |
qemu | block/vdi.c | int uuid_is_null(const uuid_t uu)
{
uuid_t null_uuid = {0};
return memcmp(uu, null_uuid, sizeof(uuid_t)) == 0;
} | [
1,
0
] |
qemu | libcacard/vscclient.c | send_msg(
VSCMsgType type,
uint32_t reader_id,
const void *msg,
unsigned int length
) {
VSCMsgHeader mhHeader;
qemu_mutex_lock(&socket_to_send_lock);
if (verbose > 10) {
printf("sending type=%d id=%u, len =%u (0x%x)\n",
type, reader_id, length, length);
}
mhHeader.typ... | [
1,
0
] |
qemu | block.c | int qemu_opts_do_parse(QemuOpts *opts, const char *params,
const char *firstname)
{
Error *err = NULL;
opts_do_parse(opts, params, firstname, false, &err);
if (err) {
qerror_report_err(err);
error_free(err);
return -1;
}
return 0;
} | [
0,
0
] |
qemu | linux-user/aarch64/target_cpu.h | do_kernel_trap(CPUARMState *env)
{
uint32_t addr;
uint32_t cpsr;
uint32_t val;
switch (env->regs[15]) {
case 0xffff0fa0: /* __kernel_memory_barrier */
/* ??? No-op. Will need to do better for SMP. */
break;
case 0xffff0fc0: /* __kernel_cmpxchg */
/* XXX: This only works between thread... | [
0,
1
] |
FFmpeg | libavformat/avio.c | int avio_check(const char *url, int flags)
{
URLContext *h;
int ret = ffurl_alloc(&h, url, flags, NULL);
if (ret)
return ret;
if (h->prot->url_check) {
ret = h->prot->url_check(h, flags);
} else {
ret = ffurl_connect(h, NULL);
if (ret >= 0)
ret = flags;
}
ffurl_close(h);
... | [
0,
0
] |
FFmpeg | libavcodec/arm/h264idct_neon.S | static void FUNCC(pred8x8_horizontal_add)(uint8_t *pix, const int *block_offset,
const int16_t *block,
ptrdiff_t stride)
{
int i;
for (i = 0; i < 4; i++)
FUNCC(pred4x4_horizontal_add)(pix + block_offset[i],
... | [
1,
0
] |
FFmpeg | libavcodec/arm/h264idct_neon.S | void FUNCC(ff_h264_idct_dc_add)(uint8_t *_dst, int16_t *block, int stride) {
int i, j;
int dc = (((dctcoef *)block)[0] + 32) >> 6;
pixel *dst = (pixel *)_dst;
stride >>= sizeof(pixel) - 1;
for (j = 0; j < 4; j++)
{
for (i = 0; i < 4; i++)
dst[i] = av_clip_pixel(dst[i] + dc);
dst += st... | [
1,
0
] |
FFmpeg | libavformat/mpeg.c | static int mpeg_mux_write_packet(AVFormatContext *ctx, int stream_index,
const uint8_t *buf, int size, int64_t pts)
{
MpegMuxContext *s = ctx->priv_data;
AVStream *st = ctx->streams[stream_index];
StreamInfo *stream = st->priv_data;
int len;
while (size > 0) {
/* s... | [
1,
0
] |
FFmpeg | libavcodec/4xm.c | static int decode_i_block(FourXContext *f, int16_t *block)
{
int code, i, j, level, val;
if (get_bits_left(&f->gb) < 2) {
av_log(f->avctx, AV_LOG_ERROR, "%d bits left before decode_i_block()\n",
get_bits_left(&f->gb));
return -1;
}
/* DC coef */
val = get_vlc2(&f->pre_gb, f->pre_vlc.... | [
0,
0
] |
FFmpeg | libavformat/file.c | static int file_read(URLContext *h, unsigned char *buf, int size)
{
FileContext *c = h->priv_data;
int r = read(c->fd, buf, size);
return (-1 == r) ? AVERROR(errno) : r;
} | [
0,
0
] |
FFmpeg | libavdevice/x11grab.c | paint_mouse_pointer(XImage *image, struct x11_grab *s)
{
int x_off = s->x_off;
int y_off = s->y_off;
int width = s->width;
int height = s->height;
Display *dpy = s->dpy;
XFixesCursorImage *xcim;
int x, y;
int line, column;
int to_line, to_column;
int image_addr, xcim_addr;
xcim = XFixe... | [
1,
0
] |
FFmpeg | libavcodec/xiph.c | int ff_split_xiph_headers(uint8_t *extradata, int extradata_size,
int first_header_size, uint8_t *header_start[3],
int header_len[3])
{
int i, j;
if (AV_RB16(extradata) == first_header_size) {
for (i = 0; i < 3; i++) {
header_len[i] = AV_RB16(extr... | [
1,
0
] |
qemu | configure | static uint64_t boston_platreg_read(void *opaque, hwaddr addr,
unsigned size)
{
BostonState *s = opaque;
uint32_t gic_freq, val;
if (size != 4) {
qemu_log_mask(LOG_UNIMP, "%uB platform register read", size);
return 0;
}
switch (addr & 0xffff) {
case PLAT_... | [
1,
0
] |
FFmpeg | libavcodec/svq1dec.c | static int svq1_decode_delta_block(MpegEncContext *s, GetBitContext *bitbuf,
uint8_t *current, uint8_t *previous,
int pitch, svq1_pmv *motion, int x, int y)
{
uint32_t block_type;
int result = 0;
/* get block type */
block_type = get_v... | [
1,
0
] |
qemu | util/qemu-thread-posix.c | void qemu_mutex_init(QemuMutex *mutex)
{
int err;
pthread_mutexattr_t mutexattr;
pthread_mutexattr_init(&mutexattr);
pthread_mutexattr_settype(&mutexattr, PTHREAD_MUTEX_ERRORCHECK);
err = pthread_mutex_init(&mutex->lock, &mutexattr);
pthread_mutexattr_destroy(&mutexattr);
if (err)
error_exit(... | [
1,
0
] |
qemu | hw/9pfs/virtio-9p-synth.c | int qemu_v9fs_synth_add_file(V9fsSynthNode *parent, int mode,
const char *name, v9fs_synth_read read,
v9fs_synth_write write, void *arg)
{
int ret;
V9fsSynthNode *node, *tmp;
if (!v9fs_synth_fs) {
return EAGAIN;
}
if (!name || (strlen(name)... | [
1,
0
] |
FFmpeg | libavformat/4xm.c | static uint64_t get_vb(ByteIOContext *bc) {
uint64_t val = 0;
int i = get_v(bc);
if (i > 8)
return UINT64_MAX;
while (i--)
val = (val << 8) + get_byte(bc);
// av_log(NULL, AV_LOG_DEBUG, "get_vb()= %lld\n", val);
return val;
} | [
1,
0
] |
qemu | hw/virtio/virtio-balloon.c | static void virtio_balloon_receive_stats(VirtIODevice *vdev, VirtQueue *vq)
{
VirtIOBalloon *s = VIRTIO_BALLOON(vdev);
VirtQueueElement *elem;
VirtIOBalloonStat stat;
size_t offset = 0;
qemu_timeval tv;
s->stats_vq_elem = elem = virtqueue_pop(vq, sizeof(VirtQueueElement));
if (!elem) {
goto o... | [
1,
0
] |
qemu | qom/cpu.c | static void xtensa_cpu_realizefn(DeviceState *dev, Error **errp) {
CPUState *cs = CPU(dev);
XtensaCPUClass *xcc = XTENSA_CPU_GET_CLASS(dev);
cs->gdb_num_regs = xcc->config->gdb_regmap.num_regs;
xcc->parent_realize(dev, errp);
} | [
1,
0
] |
FFmpeg | libavcodec/alsdec.c | static void read_const_block_data(ALSDecContext *ctx, ALSBlockData *bd)
{
ALSSpecificConfig *sconf = &ctx->sconf;
AVCodecContext *avctx = ctx->avctx;
GetBitContext *gb = &ctx->gb;
*bd->raw_samples = 0;
*bd->const_block =
get_bits1(gb); // 1 = constant value, 0 = zero block (silence)
bd->js_bloc... | [
1,
0
] |
qemu | hw/acpi/piix4.c | static void port92_class_initfn(ObjectClass *klass, void *data)
{
DeviceClass *dc = DEVICE_CLASS(klass);
dc->no_user = 1;
dc->realize = port92_realizefn;
dc->reset = port92_reset;
dc->vmsd = &vmstate_port92_isa;
} | [
1,
0
] |
qemu | tcg/arm/tcg-target.c | void tcg_target_qemu_prologue(TCGContext *s)
{
/* stmdb sp!, { r9 - r11, lr } */
tcg_out32(s, (COND_AL << 28) | 0x092d4e00);
tcg_out_bx(s, COND_AL, TCG_REG_R0);
tb_ret_addr = s->code_ptr;
/* ldmia sp!, { r9 - r11, pc } */
tcg_out32(s, (COND_AL << 28) | 0x08bd8e00);
} | [
1,
0
] |
FFmpeg | libavcodec/eval.c | AVEvalExpr *ff_parse(const char *s, const char *const *const_name,
double (**func1)(void *, double), const char **func1_name,
double (**func2)(void *, double, double),
const char **func2_name,
const char **error) {
Parser p;
AV... | [
1,
0
] |
qemu | hw/ccid-card-emulated.c | static void *handle_apdu_thread(void *arg)
{
EmulatedState *card = arg;
uint8_t recv_data[APDU_BUF_SIZE];
int recv_len;
VReaderStatus reader_status;
EmulEvent *event;
while (1) {
qemu_mutex_lock(&card->handle_apdu_mutex);
qemu_cond_wait(&card->handle_apdu_cond, &card->handle_apdu_mutex);
... | [
1,
0
] |
FFmpeg | libavcodec/apedec.c | static inline void update_rice(APERice *rice, int x)
{
rice->ksum += ((x + 1) / 2) - ((rice->ksum + 16) >> 5);
if (rice->k == 0)
rice->k = 1;
else if (rice->ksum < (1 << (rice->k + 4)))
rice->k--;
else if (rice->ksum >= (1 << (rice->k + 5)))
rice->k++;
} | [
1,
0
] |
FFmpeg | libavcodec/vp8.c | void vp78_decode_mv_mb_modes(AVCodecContext *avctx, VP8Frame *curframe,
VP8Frame *prev_frame, int is_vp7)
{
VP8Context *s = avctx->priv_data;
int mb_x, mb_y;
s->mv_min.y = -MARGIN;
s->mv_max.y = ((s->mb_height - 1) << 6) + MARGIN;
for (mb_y = 0; mb_y < s->mb_height; mb_y++)... | [
1,
0
] |
FFmpeg | libavcodec/pcx.c | static const uint8_t *pcx_rle_decode(const uint8_t *src, uint8_t *dst,
unsigned int bytes_per_scanline,
int compressed)
{
unsigned int i = 0;
unsigned char run, value;
if (compressed) {
while (i < bytes_per_scanline) {
run... | [
1,
0
] |
FFmpeg | ffprobe.c | static void read_packets(WriterContext *w, AVFormatContext *fmt_ctx)
{
int i, ret = 0;
int64_t cur_ts = fmt_ctx->start_time;
if (read_intervals_nb == 0) {
ReadInterval interval = (ReadInterval){.has_start = 0, .has_end = 0};
ret = read_interval_packets(w, fmt_ctx, &interval, &cur_ts);
} else {
... | [
0,
0
] |
FFmpeg | libavcodec/nvenc.c | static av_cold int check_cuda_errors(AVCodecContext *avctx, CUresult err,
const char *func)
{
if (err != CUDA_SUCCESS) {
av_log(avctx, AV_LOG_FATAL, ">> %s - failed with error code 0x%x\n", func,
err);
return 0;
}
return 1;
} | [
1,
0
] |
qemu | net/net.c | static ssize_t nc_sendv_compat(NetClientState *nc, const struct iovec *iov,
int iovcnt, unsigned flags)
{
uint8_t *buf = NULL;
uint8_t *buffer;
size_t offset;
ssize_t ret;
if (iovcnt == 1) {
buffer = iov[0].iov_base;
offset = iov[0].iov_len;
} else {
buf... | [
1,
0
] |
FFmpeg | libavcodec/rtjpeg.c | static inline int get_block(GetBitContext *gb, DCTELEM *block,
const uint8_t *scan,
const uint32_t *quant) {
int coeff, i, n;
int8_t ac;
uint8_t dc = get_bits(gb, 8);
// block not coded
if (dc == 255)
// number of non-zero coefficients
co... | [
1,
0
] |
qemu | hw/misc/macio/cuda.c | static bool cuda_cmd_set_time(CUDAState *s,
const uint8_t *in_data, int in_len,
uint8_t *out_data, int *out_len)
{
uint32_t ti;
if (in_len != 4) {
return false;
}
ti = (((uint32_t)in_data[1]) << 24) + (((uint32_t)in_data[2]) << 16)
+... | [
1,
0
] |
FFmpeg | libswscale/cs_test.c | static inline void RENAME(yv12touyvy)(const uint8_t *ysrc, const uint8_t *usrc,
const uint8_t *vsrc, uint8_t *dst,
long width, long height,
long lumStride, long chromStride,
... | [
1,
1
] |
qemu | target-arm/cpu.h | static uint64_t pmsav5_data_ap_read(CPUARMState *env, const ARMCPRegInfo *ri)
{
return simple_mpu_ap_bits(env->cp15.c5_data);
} | [
1,
0
] |
qemu | linux-user/signal.c | restore_sigcontext(CPUMIPSState *regs, struct target_sigcontext *sc)
{
int err = 0;
int i;
__get_user(regs->CP0_EPC, &sc->sc_pc);
__get_user(regs->active_tc.HI[0], &sc->sc_mdhi);
__get_user(regs->active_tc.LO[0], &sc->sc_mdlo);
for (i = 1; i < 32; ++i) {
__get_user(regs->active_tc.gpr[i], &sc->s... | [
1,
0
] |
qemu | block/vpc.c | static int vpc_has_zero_init(BlockDriverState *bs)
{
BDRVVPCState *s = bs->opaque;
VHDFooter *footer = (VHDFooter *)s->footer_buf;
if (cpu_to_be32(footer->type) == VHD_FIXED) {
return bdrv_has_zero_init(bs->file);
} else {
return 1;
}
} | [
1,
0
] |
FFmpeg | libavutil/opt.c | int av_opt_set_from_string(void *ctx, const char *opts,
const char *const *shorthand,
const char *key_val_sep, const char *pairs_sep)
{
int ret, count = 0;
const char *dummy_shorthand = NULL;
char key_buf[68], *value;
const char *key;
if (!opts)
... | [
1,
0
] |
FFmpeg | libavformat/allformats.c | static int gif_read_extension(GifState *s)
{
ByteIOContext *f = s->f;
int ext_code, ext_len, i, gce_flags, gce_transparent_index;
/* extension */
ext_code = get_byte(f);
ext_len = get_byte(f);
#ifdef DEBUG
printf("gif: ext_code=0x%x len=%d\n", ext_code, ext_len);
#endif
switch (ext_code) {
ca... | [
1,
0
] |
qemu | main-loop.c | static void __attribute__((constructor)) init_main_loop(void)
{
init_clocks();
init_timer_alarm();
qemu_clock_enable(vm_clock, false);
} | [
0,
0
] |
qemu | hw/ide/atapi.c | static void cmd_read_cdvd_capacity(IDEState *s, uint8_t *buf)
{
uint64_t total_sectors = s->nb_sectors >> 2;
if (total_sectors == 0) {
ide_atapi_cmd_error(s, SENSE_NOT_READY, ASC_MEDIUM_NOT_PRESENT);
return;
}
/* NOTE: it is really the number of sectors minus 1 */
cpu_to_ube32(buf, total_sector... | [
0,
0
] |
qemu | hw/usb-uhci.c | static int uhci_broadcast_packet(UHCIState *s, USBPacket *p)
{
UHCIPort *port;
USBDevice *dev;
int i, ret;
#ifdef DEBUG_PACKET
{
const char *pidstr;
switch (p->pid) {
case USB_TOKEN_SETUP:
pidstr = "SETUP";
break;
case USB_TOKEN_IN:
pidstr = "IN";
break;
ca... | [
1,
0
] |
qemu | hw/i386/pc.c | static void x86_cpu_apic_create(X86CPU *cpu, Error **errp)
{
DeviceState *dev = DEVICE(cpu);
APICCommonState *apic;
const char *apic_type = "apic";
if (kvm_irqchip_in_kernel()) {
apic_type = "kvm-apic";
} else if (xen_enabled()) {
apic_type = "xen-apic";
}
cpu->apic_state = qdev_try_creat... | [
0,
1
] |
qemu | block/raw-posix.c | static int posix_aio_flush(void *opaque)
{
PosixAioState *s = opaque;
return !!s->first_aio;
} | [
0,
0
] |
qemu | exec.c | static MemoryRegionSection *address_space_lookup_region(AddressSpaceDispatch *d,
hwaddr addr,
bool resolve_subpage)
{
MemoryRegionSection *section;
subpage_t *subpage;
section = phys_page_find(d->... | [
1,
0
] |
qemu | hw/ppc/spapr_pci.c | static void finish_read_pci_config(sPAPREnvironment *spapr, uint64_t buid,
uint32_t addr, uint32_t size,
target_ulong rets)
{
PCIDevice *pci_dev;
uint32_t val;
if ((size != 1) && (size != 2) && (size != 4)) {
/* access must be 1, 2 o... | [
1,
0
] |
qemu | block/nbd.c | static void test_io_channel_setup_async(SocketAddress *listen_addr,
SocketAddress *connect_addr,
QIOChannel **src,
QIOChannel **dst)
{
QIOChannelSocket *lioc;
struct TestIOChannelData data;
... | [
1,
0
] |
qemu | block/iscsi.c | iscsi_process_read(void *arg)
{
IscsiLun *iscsilun = arg;
struct iscsi_context *iscsi = iscsilun->iscsi;
aio_context_acquire(iscsilun->aio_context);
iscsi_service(iscsi, POLLIN);
iscsi_set_events(iscsilun);
aio_context_release(iscsilun->aio_context);
} | [
0,
0
] |
qemu | hw/ide/piix.c | static int pci_piix_ide_initfn(PCIIDEState *d)
{
uint8_t *pci_conf = d->dev.config;
pci_conf[PCI_CLASS_PROG] = 0x80; // legacy ATA mode
pci_config_set_class(pci_conf, PCI_CLASS_STORAGE_IDE);
qemu_register_reset(piix3_reset, d);
pci_register_bar(&d->dev, 4, 0x10, PCI_BASE_ADDRESS_SPACE_IO, bmdma_map);
... | [
1,
0
] |
qemu | target-arm/cpu.h | static inline bool extended_addresses_enabled(CPUARMState *env)
{
return arm_el_is_aa64(env, 1)
|| ((arm_feature(env, ARM_FEATURE_LPAE)
&& (env->cp15.c2_control & (1U << 31))));
} | [
0,
0
] |
qemu | blockdev.c | void qmp_block_job_pause(const char *device, Error **errp)
{
BlockJob *job = find_block_job(device);
if (!job) {
error_set(errp, QERR_BLOCK_JOB_NOT_ACTIVE, device);
return;
}
trace_qmp_block_job_pause(job);
block_job_pause(job);
} | [
0,
0
] |
qemu | hw/usb/hcd-ehci.c | static void ehci_free_packet(EHCIPacket *p)
{
trace_usb_ehci_packet_action(p->queue, p, "free");
if (p->async == EHCI_ASYNC_INFLIGHT) {
usb_cancel_packet(&p->packet);
usb_packet_unmap(&p->packet, &p->sgl);
qemu_sglist_destroy(&p->sgl);
QTAILQ_REMOVE(&p->queue->packets, p, next);
usb_pack... | [
1,
0
] |
qemu | target-alpha/helper.h | uint64_t helper_mullv(uint64_t op1, uint64_t op2)
{
int64_t res = (int64_t)op1 * (int64_t)op2;
if (unlikely((int32_t)res != res)) {
arith_excp(env, GETPC(), EXC_M_IOV, 0);
}
return (int64_t)((int32_t)res);
} | [
1,
0
] |
FFmpeg | libavcodec/utils.c | int attribute_align_arg avcodec_decode_audio3(AVCodecContext *avctx,
int16_t *samples,
int *frame_size_ptr,
AVPacket *avpkt)
{
AVFrame frame;
int ret, got_frame = 0;
if (... | [
1,
0
] |
qemu | hw/timer/hpet.c | static uint32_t hpet_time_after(uint64_t a, uint64_t b)
{
return ((int32_t)(b) - (int32_t)(a) < 0);
} | [
1,
0
] |
FFmpeg | libswscale/Makefile | static inline void RENAME(nv12ToUV)(uint8_t *dstU, uint8_t *dstV,
const uint8_t *src1, const uint8_t *src2,
long width, uint32_t *unused)
{
RENAME(nvXXtoUV)(dstU, dstV, src1, width);
} | [
0,
0
] |
qemu | target-s390x/ioinst.c | int ioinst_handle_ssch(CPUS390XState *env, 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;
hwaddr len = sizeof(*orig_orb);
if (ioinst_disassemble_sch_ident(reg1, &m, &cssid, &ssid, &schid)) {
program_int... | [
1,
0
] |
qemu | hw/acpi.c | i2c_bus *piix4_pm_init(PCIBus *bus, int devfn, uint32_t smb_io_base,
qemu_irq sci_irq, qemu_irq cmos_s3, qemu_irq smi_irq,
int kvm_enabled)
{
PCIDevice *dev;
PIIX4PMState *s;
dev = pci_create(bus, devfn, "PIIX4_PM");
qdev_prop_set_uint32(&dev->qdev, "smb_io_b... | [
0,
0
] |
qemu | audio/alsaaudio.c | static int alsa_run_out(HWVoiceOut *hw)
{
ALSAVoiceOut *alsa = (ALSAVoiceOut *)hw;
int rpos, live, decr;
int samples;
uint8_t *dst;
st_sample_t *src;
snd_pcm_sframes_t avail;
live = audio_pcm_hw_get_live_out(hw);
if (!live) {
return 0;
}
avail = alsa_get_avail(alsa->handle);
if (av... | [
1,
0
] |
qemu | hw/core/machine.c | void machine_register_compat_props(MachineState *machine)
{
MachineClass *mc = MACHINE_GET_CLASS(machine);
int i;
GlobalProperty *p;
if (!mc->compat_props) {
return;
}
for (i = 0; i < mc->compat_props->len; i++) {
p = g_array_index(mc->compat_props, GlobalProperty *, i);
qdev_prop_regis... | [
1,
0
] |
qemu | hw/ipmi/ipmi_bmc_sim.c | static void set_sensor_evt_enable(IPMIBmcSim *ibs,
uint8_t *cmd, unsigned int cmd_len,
uint8_t *rsp, unsigned int *rsp_len,
unsigned int max_rsp_len)
{
IPMISensor *sens;
IPMI_CHECK_CMD_LEN(4);
if ((cmd[2] ... | [
1,
0
] |
qemu | arch_init.c | static inline void *host_from_stream_offset(QEMUFile *f,
ram_addr_t offset,
int flags)
{
static RAMBlock *block = NULL;
char id[256];
uint8_t len;
if (flags & RAM_SAVE_FLAG_CONTINUE) {
if (!block) {
error_... | [
1,
0
] |
qemu | include/migration/qemu-file.h | static void qemu_fill_buffer(QEMUFile *f)
{
int len;
int pending;
assert(!qemu_file_is_writable(f));
pending = f->buf_size - f->buf_index;
if (pending > 0) {
memmove(f->buf, f->buf + f->buf_index, pending);
}
f->buf_index = 0;
f->buf_size = pending;
len = f->ops->get_buffer(f->opaque, f-... | [
1,
0
] |
FFmpeg | libavformat/utils.c | int avformat_seek_file(AVFormatContext *s, int stream_index, int64_t min_ts,
int64_t ts, int64_t max_ts, int flags)
{
if (min_ts > ts || max_ts < ts)
return -1;
ff_read_frame_flush(s);
if (s->iformat->read_seek2)
return s->iformat->read_seek2(s, stream_index, min_ts, ts, max_t... | [
1,
0
] |
qemu | hw/display/virtio-gpu.c | static void update_cursor_data_virgl(VirtIOGPU *g,
struct virtio_gpu_scanout *s,
uint32_t resource_id)
{
uint32_t width, height;
uint32_t pixels, *data;
data = virgl_renderer_get_cursor_data(resource_id, &width, &height);
if (!data... | [
1,
0
] |
qemu | linux-user/syscall.c | abi_long do_brk(abi_ulong new_brk)
{
abi_ulong brk_page;
abi_long mapped_addr;
int new_alloc_size;
if (!new_brk)
return target_brk;
if (new_brk < target_original_brk)
return target_brk;
brk_page = HOST_PAGE_ALIGN(target_brk);
/* If the new brk is less than this, set it and we're done... ... | [
1,
0
] |
qemu | hw/pci_ids.h | static void virtio_console_init_pci(PCIDevice *pci_dev)
{
VirtIOPCIProxy *proxy = DO_UPCAST(VirtIOPCIProxy, pci_dev, pci_dev);
VirtIODevice *vdev;
vdev = virtio_console_init(&pci_dev->qdev);
virtio_init_pci(proxy, vdev,
PCI_VENDOR_ID_REDHAT_QUMRANET,
PCI_DEVICE_ID_VIRT... | [
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 | hw/ppc/pnv_xscom.c | static void xscom_write(void *opaque, hwaddr addr, uint64_t val,
unsigned width)
{
PnvChip *chip = opaque;
uint32_t pcba = pnv_xscom_pcba(chip, addr);
MemTxResult result;
/* Handle some SCOMs here before dispatch */
if (xscom_write_default(chip, pcba, val)) {
goto complete;... | [
1,
0
] |
qemu | hw/scsi/esp-pci.c | static int esp_pci_scsi_init(PCIDevice *dev)
{
PCIESPState *pci = PCI_ESP(dev);
DeviceState *d = DEVICE(dev);
ESPState *s = &pci->esp;
uint8_t *pci_conf;
Error *err = NULL;
pci_conf = dev->config;
/* Interrupt pin A */
pci_conf[PCI_INTERRUPT_PIN] = 0x01;
s->dma_memory_read = esp_pci_dma_memo... | [
1,
0
] |
qemu | net/dump.c | static void net_dump_cleanup(VLANClientState *vc)
{
DumpState *s = vc->opaque;
close(s->fd);
qemu_free(s);
} | [
1,
0
] |
qemu | configure | static void usbredir_iso_packet(void *priv, uint64_t id,
struct usb_redir_iso_packet_header *iso_packet,
uint8_t *data, int data_len)
{
USBRedirDevice *dev = priv;
uint8_t ep = iso_packet->endpoint;
DPRINTF2("iso-in status %d ep %02X len %d id ... | [
1,
0
] |
qemu | event_notifier-posix.c | int event_notifier_init(EventNotifier *e, int active)
{
#ifdef CONFIG_EVENTFD
int fd = eventfd(!!active, EFD_NONBLOCK | EFD_CLOEXEC);
if (fd < 0)
return -errno;
e->fd = fd;
return 0;
#else
return -ENOSYS;
#endif
} | [
0,
0
] |
qemu | io/channel-command.c | static ssize_t qio_channel_socket_readv(QIOChannel *ioc,
const struct iovec *iov,
size_t niov,
int **fds,
size_t *nfds,
... | [
1,
0
] |
qemu | Makefile.objs | static void tight_palette_rgb2buf(uint32_t rgb, int bpp, uint8_t buf[6])
{
memset(buf, 0, 6);
if (bpp == 32) {
buf[0] = ((rgb >> 24) & 0xFF);
buf[1] = ((rgb >> 16) & 0xFF);
buf[2] = ((rgb >> 8) & 0xFF);
buf[3] = ((rgb >> 0) & 0xFF);
buf[4] = ((buf[0] & 1) == 0) << 3 | ((buf[1] & 1) == 0)... | [
1,
0
] |
qemu | Makefile.objs | static ssize_t local_lgetxattr(FsContext *ctx, const char *path,
const char *name, void *value, size_t size)
{
if ((ctx->fs_sm == SM_MAPPED) &&
(strncmp(name, "user.virtfs.", 12) == 0)) {
/*
* Don't allow fetch of user.virtfs namesapce
* in case of mapped secu... | [
0,
0
] |
qemu | qapi/opts-visitor.c | void visit_type_any(Visitor *v, const char *name, QObject **obj, Error **errp)
{
v->type_any(v, name, obj, errp);
} | [
1,
0
] |
FFmpeg | libavcodec/mips/h264qpel_msa.c | void ff_put_h264_qpel4_mc11_msa(uint8_t *dst, const uint8_t *src,
ptrdiff_t stride)
{
avc_luma_hv_qrt_4w_msa(src - 2, src - (stride * 2), stride, dst, stride, 4);
} | [
0,
0
] |
FFmpeg | libavformat/vc1test.c | static int vc1t_read_header(AVFormatContext *s,
AVFormatParameters *ap)
{
ByteIOContext *pb = s->pb;
AVStream *st;
int fps, frames;
frames = get_le24(pb);
if (get_byte(pb) != 0xC5 || get_le32(pb) != 4)
return -1;
/* init video codec */
st = av_new_stream(s, 0);
... | [
1,
0
] |
FFmpeg | libavformat/mov.c | static int mov_read_ctts(MOVContext *c, ByteIOContext *pb, MOV_atom_t atom)
{
AVStream *st = c->fc->streams[c->fc->nb_streams - 1];
MOVStreamContext *sc = st->priv_data;
unsigned int i, entries;
get_byte(pb); /* version */
get_be24(pb); /* flags */
entries = get_be32(pb);
if (entries >= UINT_MAX /... | [
1,
0
] |
FFmpeg | ffmpeg_qsv.c | static void qsv_uninit(AVCodecContext *s)
{
InputStream *ist = s->opaque;
QSVContext *qsv = ist->hwaccel_ctx;
av_freep(&qsv->ost->enc_ctx->hwaccel_context);
av_freep(&s->hwaccel_context);
av_buffer_unref(&qsv->opaque_surfaces_buf);
av_freep(&qsv->surface_used);
av_freep(&qsv->surface_ptrs);
av_... | [
0,
0
] |
qemu | hw/i386/pc.c | static MemoryRegion *pc_dimm_get_memory_region(PCDIMMDevice *dimm)
{
return host_memory_backend_get_memory(dimm->hostmem, &error_abort);
} | [
1,
0
] |
qemu | ui/vnc.c | static void send_ext_audio_ack(VncState *vs)
{
vnc_lock_output(vs);
vnc_write_u8(vs, VNC_MSG_SERVER_FRAMEBUFFER_UPDATE);
vnc_write_u8(vs, 0);
vnc_write_u16(vs, 1);
vnc_framebuffer_update(vs, 0, 0,
surface_width(vs->vd->ds),
surface_height(vs->vd->ds),
... | [
1,
0
] |
qemu | Makefile | target_ulong spapr_hypercall(CPUState *env, target_ulong opcode,
target_ulong *args)
{
if (msr_pr) {
hcall_dprintf("Hypercall made with MSR[PR]=1\n");
return H_PRIVILEGE;
}
if ((opcode <= MAX_HCALL_OPCODE)
&& ((opcode & 0x3) == 0)) {
spapr_hcall_fn fn = hyper... | [
1,
0
] |
qemu | target-mips/helper.h | target_ulong helper_emt(target_ulong arg1)
{
// TODO
arg1 = 0;
// rt = arg1
return arg1;
} | [
1,
1
] |
FFmpeg | libavformat/id3v2.c | void ff_id3v2_free_extra_meta(ID3v2ExtraMeta **extra_meta)
{
ID3v2ExtraMeta *current = *extra_meta, *next;
void (*free_func)(ID3v2ExtraMeta *);
while (current) {
if ((free_func = get_extra_meta_func(current->tag, 1)->free))
free_func(current->data);
next = current->next;
av_freep(¤... | [
1,
0
] |
qemu | net/net.c | static int net_init_nic(const NetClientOptions *opts, const char *name,
NetClientState *peer, Error **errp)
{
/* FIXME error_setg(errp, ...) on failure */
int idx;
NICInfo *nd;
const NetLegacyNicOptions *nic;
assert(opts->kind == NET_CLIENT_OPTIONS_KIND_NIC);
nic = opts->nic;... | [
1,
1
] |
qemu | Makefile.objs | void migrate_del_blocker(Error *reason)
{
migration_blockers = g_slist_remove(migration_blockers, reason);
} | [
1,
0
] |
qemu | hw/net/rocker/rocker.c | char *desc_get_buf(DescInfo *info, bool read_only)
{
PCIDevice *dev = PCI_DEVICE(info->ring->r);
size_t size = read_only ? le16_to_cpu(info->desc.tlv_size) :
le16_to_cpu(info->desc.buf_size);
if (size > info->buf_size) {
info->buf = g_realloc(info->buf, size);
info->buf_si... | [
1,
0
] |
qemu | block/qcow2.c | int qcow2_backing_read1(BlockDriverState *bs, QEMUIOVector *qiov,
int64_t sector_num, int nb_sectors)
{
int n1;
if ((sector_num + nb_sectors) <= bs->total_sectors)
return nb_sectors;
if (sector_num >= bs->total_sectors)
n1 = 0;
else
n1 = bs->total_sectors - sector_nu... | [
1,
0
] |
qemu | hw/9pfs/virtio-9p.c | static void v9fs_version(void *opaque) {
V9fsPDU *pdu = opaque;
V9fsState *s = pdu->s;
V9fsString version;
size_t offset = 7;
pdu_unmarshal(pdu, offset, "ds", &s->msize, &version);
trace_v9fs_version(pdu->tag, pdu->id, s->msize, version.data);
if (!strcmp(version.data, "9P2000.u")) {
s->proto_version ... | [
1,
0
] |
qemu | hw/cpu/core.c | static void core_prop_set_core_id(Object *obj, Visitor *v, const char *name,
void *opaque, Error **errp) {
CPUCore *core = CPU_CORE(obj);
Error *local_err = NULL;
int64_t value;
visit_type_int(v, name, &value, &local_err);
if (local_err) {
error_propagate(errp, local_err)... | [
1,
0
] |
FFmpeg | libavcodec/ac3dec.c | static inline void mix_3f_2r_to_mono(AC3DecodeContext *ctx)
{
int i;
float (*output)[256] = ctx->audio_block.block_output;
for (i = 0; i < 256; i++)
output[1][i] += (output[2][i] + output[3][i] + output[4][i] + output[5][i]);
memset(output[2], 0, sizeof(output[2]));
memset(output[3], 0, sizeof(outp... | [
1,
0
] |
FFmpeg | libavformat/oma.c | static int nprobe(AVFormatContext *s, uint8_t *enc_header, 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[pos], "EKB ", 4))
pos +... | [
0,
0
] |
qemu | block/nbd.c | socket_sockaddr_to_address_inet(struct sockaddr_storage *sa,
socklen_t salen,
Error **errp)
{
char host[NI_MAXHOST];
char serv[NI_MAXSERV];
SocketAddressLegacy *addr;
InetSocketAddress *inet;
int ret;
ret = getnameinfo((struct sockaddr... | [
1,
0
] |
qemu | target-i386/kvm.c | static int kvm_get_fpu(CPUState *env)
{
struct kvm_fpu fpu;
int i, ret;
ret = kvm_vcpu_ioctl(env, KVM_GET_FPU, &fpu);
if (ret < 0)
return ret;
env->fpstt = (fpu.fsw >> 11) & 7;
env->fpus = fpu.fsw;
env->fpuc = fpu.fcw;
for (i = 0; i < 8; ++i)
env->fptags[i] = !((fpu.ftwx >> i) & 1);
... | [
1,
0
] |
qemu | fsdev/file-op-9p.h | static int local_mknod(FsContext *fs_ctx, V9fsPath *dir_path,
const char *name, FsCred *credp)
{
int err = -1;
int dirfd;
if (fs_ctx->export_flags & V9FS_SM_MAPPED_FILE &&
local_is_mapped_file_metadata(fs_ctx, name)) {
errno = EINVAL;
return -1;
}
dirfd = local_op... | [
0,
0
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.