Projectname large_stringclasses 15
values | Filepath large_stringlengths 4 106 ⌀ | Function large_stringlengths 11 3.45k | Label list |
|---|---|---|---|
FFmpeg | libavcodec/mpegvideo_motion.c | static inline int hpel_motion(MpegEncContext *s,
uint8_t *dest, uint8_t *src,
int src_x, int src_y,
op_pixels_func *pix_op,
int motion_x, int motion_y)
{
int dxy = 0;
int emu = 0;
src_x ... | [
1,
1
] |
FFmpeg | libavcodec/mips/h264qpel_msa.c | void ff_put_h264_qpel4_mc01_msa(uint8_t *dst, const uint8_t *src,
ptrdiff_t stride)
{
avc_luma_vt_qrt_4w_msa(src - (stride * 2), stride, dst, stride, 4, 0);
} | [
0,
0
] |
qemu | hw/usb/dev-storage.c | static void usb_msd_class_initfn_bot(ObjectClass *klass, void *data)
{
USBDeviceClass *uc = USB_DEVICE_CLASS(klass);
uc->realize = usb_msd_realize_bot;
uc->attached_settable = true;
} | [
1,
0
] |
FFmpeg | libavcodec/dxva2_h264.c | static int init_dimensions(H264Context *h)
{
int width = h->width - (h->sps.crop_right + h->sps.crop_left);
int height = h->height - (h->sps.crop_top + h->sps.crop_bottom);
/* handle container cropping */
if (FFALIGN(h->avctx->width, 16) == FFALIGN(width, 16) &&
FFALIGN(h->avctx->height, 16) == FFAL... | [
1,
0
] |
qemu | hw/usb/combined-packet.c | void usb_ep_combine_input_packets(USBEndpoint *ep)
{
USBPacket *p, *u, *next, *prev = NULL, *first = NULL;
USBPort *port = ep->dev->port;
int ret;
assert(ep->pipeline);
assert(ep->pid == USB_TOKEN_IN);
QTAILQ_FOREACH_SAFE(p, &ep->queue, queue, next) {
/* Empty the queue on a halt */
if (ep-... | [
1,
0
] |
qemu | exec.c | static MemoryRegionSection *address_space_lookup_region(AddressSpaceDispatch *d,
hwaddr addr,
bool resolve_subpage)
{
MemoryRegionSection *section = atomic_read(&d->mru_section);
subpage_t *subpage;
... | [
1,
0
] |
qemu | migration/ram.c | static int save_zero_page(RAMState *rs, RAMBlock *block, ram_addr_t offset,
uint8_t *p)
{
int pages = -1;
if (is_zero_range(p, TARGET_PAGE_SIZE)) {
rs->zero_pages++;
rs->bytes_transferred +=
save_page_header(rs, block, offset | RAM_SAVE_FLAG_COMPRESS);
qemu_put_... | [
1,
0
] |
FFmpeg | ffmpeg.c | static int ftp_close(URLContext *h)
{
FTPContext *s = h->priv_data;
av_dlog(h, "ftp protocol close\n");
ftp_close_both_connections(s);
av_freep(&s->user);
av_freep(&s->password);
av_freep(&s->hostname);
av_freep(&s->path);
av_freep(&s->features);
return 0;
} | [
0,
0
] |
qemu | audio/audio.c | static void audio_reset_timer(AudioState *s)
{
if (audio_is_timer_needed()) {
timer_mod(s->ts,
qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL) + conf.period.ticks);
}
else {
timer_del(s->ts);
}
} | [
0,
0
] |
FFmpeg | libavcodec/aaccoder.c | static inline void conv_to_int32(int32_t *loc, float *samples, int num,
float norm)
{
int i;
for (i = 0; i < num; i++)
loc[i] = ceilf((samples[i] / norm) * INT32_MAX);
} | [
0,
0
] |
qemu | hw/xen/xen_pt.c | static int xen_pt_pci_config_access_check(PCIDevice *d, uint32_t addr, int len)
{
/* check offset range */
if (addr >= 0xFF) {
XEN_PT_ERR(d,
"Failed to access register with offset exceeding 0xFF. "
"(addr: 0x%02x, len: %d)\n",
addr, len);
return -1;
}
... | [
0,
0
] |
qemu | block/dmg.c | static inline int dmg_read_chunk(BlockDriverState *bs, int sector_num)
{
BDRVDMGState *s = bs->opaque;
if (!is_sector_in_chunk(s, s->current_chunk, sector_num)) {
int ret;
uint32_t chunk = search_chunk(s, sector_num);
if (chunk >= s->n_chunks)
return -1;
s->current_chunk = s->n_chunks;... | [
1,
0
] |
qemu | tests/libi2c-omap.c | static void omap_i2c_send(I2CAdapter *i2c, uint8_t addr,
const uint8_t *buf, uint16_t len)
{
OMAPI2C *s = (OMAPI2C *)i2c;
uint16_t data;
omap_i2c_set_slave_addr(s, addr);
data = len;
memwrite(s->addr + OMAP_I2C_CNT, &data, 2);
data = OMAP_I2C_CON_I2C_EN |
OMAP_I2C... | [
1,
0
] |
qemu | target-mips/gdbstub.c | int mips_cpu_gdb_write_register(CPUState *cs, uint8_t *mem_buf, int n)
{
MIPSCPU *cpu = MIPS_CPU(cs);
CPUMIPSState *env = &cpu->env;
target_ulong tmp;
tmp = ldtul_p(mem_buf);
if (n < 32) {
env->active_tc.gpr[n] = tmp;
return sizeof(target_ulong);
}
if (env->CP0_Config1 & (1 << CP0C1_FP)
... | [
1,
0
] |
FFmpeg | libavformat/yuv4mpegdec.c | static int yuv4_read_packet(AVFormatContext *s, AVPacket *pkt)
{
int i;
char header[MAX_FRAME_HEADER + 1];
int ret;
int64_t off = avio_tell(s->pb);
for (i = 0; i < MAX_FRAME_HEADER; i++) {
header[i] = avio_r8(s->pb);
if (header[i] == '\n') {
header[i + 1] = 0;
break;
}
}
... | [
1,
0
] |
FFmpeg | libavformat/mpegts.c | static void new_pes_packet(PESContext *pes, AVPacket *pkt)
{
av_init_packet(pkt);
pkt->destruct = av_destruct_packet;
pkt->data = pes->buffer;
pkt->size = pes->data_index;
memset(pkt->data + pkt->size, 0, FF_INPUT_BUFFER_PADDING_SIZE);
// Separate out the AC3 substream from an HDMV combined TrueHD/AC... | [
1,
0
] |
qemu | hw/ppc/Makefile.objs | static int vscsi_send_adapter_info(VSCSIState *s, vscsi_req *req)
{
struct viosrp_adapter_info *sinfo;
struct mad_adapter_info_data info;
int rc;
sinfo = &req->iu.mad.adapter_info;
#if 0 /* What for ? */
rc = spapr_tce_dma_read(&s->vdev, be64_to_cpu(sinfo->buffer),
&info,... | [
1,
0
] |
qemu | target-ppc/helper.h | static void gen_spr_970_lpar(CPUPPCState *env)
{
/* Logical partitionning */
/* PPC970: HID4 is effectively the LPCR */
spr_register(env, SPR_970_HID4, "HID4",
SPR_NOACCESS, SPR_NOACCESS,
&spr_read_generic, &spr_write_generic,
0x00000000);
} | [
1,
0
] |
qemu | monitor.c | static void do_loadvm(Monitor *mon, const QDict *qdict)
{
int saved_vm_running = vm_running;
const char *name = qdict_get_str(qdict, "name");
vm_stop(0);
if (load_vmstate(name) >= 0 && saved_vm_running)
vm_start();
} | [
1,
0
] |
qemu | block.c | static void coroutine_fn bdrv_co_do_rw(void *opaque)
{
BlockAIOCBCoroutine *acb = opaque;
BlockDriverState *bs = acb->common.bs;
if (!acb->is_write) {
acb->req.error =
bdrv_co_do_readv(bs, acb->req.sector,
acb->req.nb_sectors, acb->req.qiov, acb->req.flags);
} else {
... | [
0,
0
] |
qemu | audio/alsaaudio.c | static int fmod_init_in(HWVoiceIn *hw, audsettings_t *as)
{
int bits16, mode;
FMODVoiceIn *fmd = (FMODVoiceIn *)hw;
audsettings_t obt_as = *as;
if (conf.broken_adc) {
return -1;
}
mode = aud_to_fmodfmt(as->fmt, as->nchannels == 2 ? 1 : 0);
fmd->fmod_sample = FSOUND_Sample_Alloc(
FSOUND_... | [
1,
0
] |
qemu | hw/vfio/common.c | void memory_region_iommu_replay_all(MemoryRegion *mr)
{
IOMMUNotifier *notifier;
IOMMU_NOTIFIER_FOREACH(notifier, mr) {
memory_region_iommu_replay(mr, notifier, false);
}
} | [
0,
0
] |
qemu | hw/usb-uhci.c | static int usb_uhci_piix3_initfn(PCIDevice *dev)
{
UHCIState *s = DO_UPCAST(UHCIState, dev, dev);
uint8_t *pci_conf = s->dev.config;
pci_config_set_vendor_id(pci_conf, PCI_VENDOR_ID_INTEL);
pci_config_set_device_id(pci_conf, PCI_DEVICE_ID_INTEL_82371SB_2);
return usb_uhci_common_initfn(s);
} | [
0,
0
] |
qemu | target-ppc/mmu-hash32.c | static void hash32_bat_size(CPUPPCState *env, target_ulong *blp, int *validp,
target_ulong batu, target_ulong batl)
{
target_ulong bl;
int valid;
bl = (batu & BATU32_BL) << 15;
valid = 0;
if (((msr_pr == 0) && (batu & BATU32_VS)) ||
((msr_pr != 0) && (batu & BATU32_VP... | [
0,
0
] |
qemu | cpu-exec.c | static unsigned int dec_addi_r(DisasContext *dc)
{
TCGv t0;
DIS(fprintf(logfile, "addi.%c $r%u, $r%u\n",
memsize_char(memsize_zz(dc)), dc->op2, dc->op1));
cris_cc_mask(dc, 0);
t0 = tcg_temp_new(TCG_TYPE_TL);
tcg_gen_shl_tl(t0, cpu_R[dc->op2], tcg_const_tl(dc->zzsize));
tcg_gen_add_tl(c... | [
0,
0
] |
qemu | exec.c | static void destroy_l2_mapping(PhysPageEntry *lp, unsigned level)
{
unsigned i;
PhysPageEntry *p = lp->u.node;
if (!p) {
return;
}
for (i = 0; i < L2_SIZE; ++i) {
if (level > 0) {
destroy_l2_mapping(&p[i], level - 1);
} else {
destroy_page_desc(p[i].u.leaf);
}
}
g_fr... | [
0,
0
] |
qemu | Makefile.objs | void json_start_object(QJSON *json, const char *name)
{
json_emit_element(json, name);
qstring_append(json->str, "{ ");
json->omit_comma = true;
} | [
0,
0
] |
qemu | check-qdict.c | START_TEST(qdict_get_int_test)
{
int ret;
const int value = 100;
const char *key = "int";
qdict_put(tests_dict, key, qint_from_int(value));
ret = qdict_get_int(tests_dict, key);
fail_unless(ret == value);
} | [
0,
0
] |
qemu | gdbstub.c | static void replay_add_event(ReplayAsyncEventKind event_kind,
void *opaque,
void *opaque2, uint64_t id)
{
assert(event_kind < REPLAY_ASYNC_COUNT);
if (!replay_file || replay_mode == REPLAY_MODE_NONE
|| !events_enabled) {
Event e;
e.even... | [
1,
0
] |
qemu | block/backup.c | static void unsafe_flush_warning(BDRVSSHState *s, const char *what)
{
if (!s->unsafe_flush_warning) {
error_report("warning: ssh server %s does not support fsync",
s->inet->host);
if (what) {
error_report("to support fsync, you need %s", what);
}
s->unsafe_flush_warning =... | [
0,
0
] |
FFmpeg | libavcodec/mpegvideo.c | static void draw_line(uint8_t *buf, int sx, int sy, int ex, int ey,
int w, int h, int stride, int color)
{
int x, y, fr, f;
sx = av_clip(sx, 0, w - 1);
sy = av_clip(sy, 0, h - 1);
ex = av_clip(ex, 0, w - 1);
ey = av_clip(ey, 0, h - 1);
buf[sy * stride + sx] += color;
if (FFA... | [
1,
0
] |
qemu | hw/musicpal.c | static void eth_send(mv88w8618_eth_state *s, int queue_index)
{
uint32_t desc_addr = s->tx_queue[queue_index];
mv88w8618_tx_desc desc;
uint8_t buf[2048];
int len;
do {
eth_tx_desc_get(desc_addr, &desc);
if (desc.cmdstat & MP_ETH_TX_OWN) {
len = desc.bytes;
if (len < 2048) {
... | [
0,
0
] |
qemu | tests/test-thread-pool.c | static void test_submit_aio(void)
{
WorkerTestData data = {.n = 0, .ret = -EINPROGRESS};
data.aiocb = thread_pool_submit_aio(worker_cb, &data, done_cb, &data);
/* The callbacks are not called until after the first wait. */
active = 1;
g_assert_cmpint(data.ret, ==, -EINPROGRESS);
qemu_aio_flush();
... | [
0,
0
] |
FFmpeg | libavformat/hlsenc.c | static int hls_start(AVFormatContext *s)
{
HLSContext *c = s->priv_data;
AVFormatContext *oc = c->avf;
int err = 0;
if (c->wrap)
c->number %= c->wrap;
if (av_get_frame_filename(oc->filename, sizeof(oc->filename),
c->basename, c->number++) < 0)
return AVERROR(EINVAL... | [
1,
0
] |
qemu | vl.c | static int bt_parse(const char *opt)
{
const char *endp, *p;
int vlan;
if (strstart(opt, "hci", &endp)) {
if (!*endp || *endp == ',') {
if (*endp)
if (!strstart(endp, ",vlan=", 0))
opt = endp + 1;
return bt_hci_parse(opt);
}
} else if (strstart(opt, "vhci", &endp)... | [
0,
0
] |
qemu | migration/ram.c | void migrate_decompress_threads_create(void)
{
int i, thread_count;
thread_count = migrate_decompress_threads();
decompress_threads = g_new0(QemuThread, thread_count);
decomp_param = g_new0(DecompressParam, thread_count);
quit_decomp_thread = false;
qemu_mutex_init(&decomp_done_lock);
qemu_cond_in... | [
0,
0
] |
qemu | block_int.h | void qdev_prop_set_drive(DeviceState *dev, const char *name, DriveInfo *value)
{
qdev_prop_set(dev, name, &value, PROP_TYPE_DRIVE);
} | [
0,
0
] |
qemu | Makefile.objs | void timerlistgroup_deinit(QEMUTimerListGroup *tlg)
{
QEMUClockType type;
for (type = 0; type < QEMU_CLOCK_MAX; type++) {
timerlist_free(tlg->tl[type]);
}
} | [
0,
0
] |
qemu | disas.c | static void term_handle_command(char *cmdline)
{
char *p, *pstart;
int argc;
const char *args[MAX_ARGS + 1];
term_cmd_t *cmd;
#ifdef DEBUG
term_printf("command='%s'\n", cmdline);
#endif
/* split command in words */
argc = 0;
p = cmdline;
for (;;) {
while (isspace(*p))
p++;
... | [
0,
0
] |
qemu | hw/arm/nseries.c | static uint64_t pxa2xx_gpio_read(void *opaque, hwaddr offset,
unsigned size)
{
PXA2xxGPIOInfo *s = (PXA2xxGPIOInfo *)opaque;
uint32_t ret;
int bank;
if (offset >= 0x200)
return 0;
bank = pxa2xx_gpio_regs[offset].bank;
switch (pxa2xx_gpio_regs[offset].reg) {
c... | [
0,
0
] |
qemu | hw/scsi/megasas.c | static bool megasas_use_msi(MegasasState *s)
{
return s->msi != ON_OFF_AUTO_OFF;
} | [
1,
0
] |
FFmpeg | libavcodec/vda_h264.c | static int vda_h264_uninit(AVCodecContext *avctx)
{
VDAContext *vda = avctx->internal->hwaccel_priv_data;
av_freep(&vda->bitstream);
if (vda->frame)
CVPixelBufferRelease(vda->frame);
return 0;
} | [
1,
0
] |
qemu | Makefile.objs | int qemu_peek_byte(QEMUFile *f, int offset)
{
int index = f->buf_index + offset;
assert(!qemu_file_is_writable(f));
assert(offset < IO_BUF_SIZE);
if (index >= f->buf_size) {
qemu_fill_buffer(f);
index = f->buf_index + offset;
if (index >= f->buf_size) {
return 0;
}
}
return f... | [
1,
0
] |
qemu | include/qemu/readline.h | ReadLineState *readline_init(ReadLinePrintfFunc *printf_func,
ReadLineFlushFunc *flush_func,
void *opaque,
ReadLineCompletionFunc *completion_finder)
{
ReadLineState *rs = g_malloc0(sizeof(*rs));
rs->hist_entry = -1;
rs-... | [
1,
0
] |
qemu | qemu-log.c | void qemu_set_log(int log_flags, bool use_own_buffers)
{
qemu_loglevel = log_flags;
if (qemu_loglevel && !qemu_logfile) {
qemu_logfile = fopen(logfilename, log_append ? "a" : "w");
if (!qemu_logfile) {
perror(logfilename);
_exit(1);
}
/* must avoid mmap() usage of glibc by settin... | [
1,
0
] |
qemu | hw/pci.c | void pci_data_write(PCIBus *s, uint32_t addr, uint32_t val, int len)
{
PCIDevice *pci_dev = pci_dev_find_by_addr(s, addr);
uint32_t config_addr = addr & (PCI_CONFIG_SPACE_SIZE - 1);
if (!pci_dev)
return;
PCI_DPRINTF("%s: %s: addr=%02" PRIx32 " val=%08" PRIx32 " len=%d\n",
__func__, pci_... | [
1,
0
] |
FFmpeg | libavcodec/pthread_frame.c | void ff_thread_report_progress(ThreadFrame *f, int n, int field)
{
PerThreadContext *p;
atomic_int *progress = f->progress ? (atomic_int *)f->progress->data : NULL;
if (!progress ||
atomic_load_explicit(&progress[field], memory_order_relaxed) >= n)
return;
p = f->owner[field]->internal->thread_... | [
1,
0
] |
FFmpeg | libavcodec/h264pred_template.c | static void FUNCC(pred8x8_horizontal)(uint8_t *_src, int stride) {
int i;
pixel *src = (pixel *)_src;
stride /= sizeof(pixel);
for (i = 0; i < 8; i++) {
((pixel4 *)(src + i * stride))[0] =
((pixel4 *)(src + i * stride))[1] =
PIXEL_SPLAT_X4(src[-1 + i * stride]);
}
} | [
1,
0
] |
qemu | monitor.c | monitor_protocol_event_queue(MonitorEvent event,
QObject *data)
{
MonitorEventState *evstate;
int64_t now = qemu_clock_get_ns(QEMU_CLOCK_REALTIME);
assert(event < QEVENT_MAX);
qemu_mutex_lock(&monitor_event_state_lock);
evstate = &(monitor_event_state[event]);
trace_moni... | [
1,
0
] |
FFmpeg | libavcodec/ffv1enc.c | static void find_best_state(uint8_t best_state[256][256],
const uint8_t one_state[256])
{
int i, j, k, m;
double l2tab[256];
for (i = 1; i < 256; i++)
l2tab[i] = log2(i / 256.0);
for (i = 0; i < 256; i++) {
double best_len[256];
double p = i / 256.0;
for (j ... | [
1,
0
] |
qemu | target/alpha/translate.c | static ExitStatus gen_bcond(DisasContext *ctx, TCGCond cond, int ra,
int32_t disp, int mask)
{
TCGv cmp_tmp;
if (mask) {
cmp_tmp = tcg_temp_new();
tcg_gen_andi_i64(cmp_tmp, load_gpr(ctx, ra), 1);
} else {
cmp_tmp = load_gpr(ctx, ra);
}
return gen_bcond_internal... | [
1,
0
] |
qemu | osdep.c | void *qemu_memalign(size_t alignment, size_t size)
{
if (!size) {
abort();
}
return oom_check(VirtualAlloc(NULL, size, MEM_COMMIT, PAGE_READWRITE));
} | [
1,
0
] |
FFmpeg | libavfilter/vf_ssim.c | static float ssim_end4(int sum0[5][4], int sum1[5][4], int width)
{
float ssim = 0.0;
int i;
for (i = 0; i < width; i++)
ssim +=
ssim_end1(sum0[i][0] + sum0[i + 1][0] + sum1[i][0] + sum1[i + 1][0],
sum0[i][1] + sum0[i + 1][1] + sum1[i][1] + sum1[i + 1][1],
su... | [
0,
0
] |
qemu | hw/acpi/pcihp.c | static void pcibus_dev_print(Monitor *mon, DeviceState *dev, int indent)
{
PCIDevice *d = (PCIDevice *)dev;
const pci_class_desc *desc;
char ctxt[64];
PCIIORegion *r;
int i, class;
class = pci_get_word(d->config + PCI_CLASS_DEVICE);
desc = pci_class_descriptions;
while (desc->desc && class != d... | [
1,
0
] |
qemu | hw/pc.h | static void vga_update_display(void *opaque)
{
VGACommonState *s = opaque;
int full_update, graphic_mode;
qemu_flush_coalesced_mmio_buffer();
if (ds_get_bits_per_pixel(s->ds) == 0) {
/* nothing to do */
} else {
full_update = 0;
if (!(s->ar_index & 0x20) &&
/* extra CGA compatibi... | [
1,
1
] |
qemu | pc-bios/s390-ccw/bootmap.c | static bool eckd_valid_address(BootMapPointer *p)
{
const uint64_t cylinder = p->eckd.cylinder
+ ((p->eckd.head & 0xfff0) << 12);
const uint64_t head = p->eckd.head & 0x000f;
if (head >= virtio_get_heads()
|| p->eckd.sector > virtio_get_sectors()
|| p->eckd.sector <=... | [
1,
0
] |
qemu | include/block/aio.h | static void test_bh_delete_from_cb(void)
{
BHTestData data1 = {.n = 0, .max = 1};
data1.bh = aio_bh_new(ctx, bh_delete_cb, &data1);
qemu_bh_schedule(data1.bh);
g_assert_cmpint(data1.n, ==, 0);
wait_for_aio();
g_assert_cmpint(data1.n, ==, data1.max);
g_assert(data1.bh == NULL);
g_assert(!aio_pol... | [
0,
0
] |
qemu | block_int.h | SCSIDevice *scsi_bus_legacy_add_drive(SCSIBus *bus, DriveInfo *dinfo, int unit)
{
const char *driver;
DeviceState *dev;
driver = bdrv_is_sg(dinfo->bdrv) ? "scsi-generic" : "scsi-disk";
dev = qdev_create(&bus->qbus, driver);
qdev_prop_set_uint32(dev, "scsi-id", unit);
qdev_prop_set_drive(dev, "drive",... | [
0,
0
] |
qemu | target-sparc/fop_helper.c | static void check_ieee_exceptions(CPUSPARCState *env)
{
target_ulong status;
status = get_float_exception_flags(&env->fp_status);
if (status) {
/* Copy IEEE 754 flags into FSR */
if (status & float_flag_invalid) {
env->fsr |= FSR_NVC;
}
if (status & float_flag_overflow) {
env-... | [
0,
0
] |
FFmpeg | libavcodec/h264.c | static int split_field_ref_list(Picture *dest, int dest_len,
Picture *src, int src_len,
int parity, int long_i) {
int i = split_field_half_ref_list(dest, dest_len, src, long_i, parity);
dest += i;
dest_len -= i;
i += split_field_half_ref_list... | [
0,
0
] |
FFmpeg | libswscale/x86/yuv2rgb_mmx.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
if (cpu_flags & AV_CPU_FLAG_MMX2) {
switch (c->dstFormat) {
case PIX_FMT_RGB24:
return yuv420_rgb24_... | [
1,
0
] |
qemu | target-arm/helper.c | void cpsr_write(CPUARMState *env, uint32_t val, uint32_t mask)
{
if (mask & CPSR_NZCV) {
env->ZF = (~val) & CPSR_Z;
env->NF = val;
env->CF = (val >> 29) & 1;
env->VF = (val << 3) & 0x80000000;
}
if (mask & CPSR_Q)
env->QF = ((val & CPSR_Q) != 0);
if (mask & CPSR_T)
env->thumb =... | [
1,
0
] |
FFmpeg | libavcodec/h264pred.c | static void pred8x8_top_dc_rv40_c(uint8_t *src, int stride) {
int i;
int dc0;
dc0 = 0;
for (i = 0; i < 8; i++)
dc0 += src[i - stride];
dc0 = 0x01010101 * ((dc0 + 4) >> 3);
for (i = 0; i < 8; i++) {
((uint32_t *)(src + i * stride))[0] =
((uint32_t *)(src + i * stride))[1] = dc0;
}
... | [
1,
0
] |
qemu | nbd/client.c | static int nbd_errno_to_system_errno(int err)
{
switch (err) {
case NBD_SUCCESS:
return 0;
case NBD_EPERM:
return EPERM;
case NBD_EIO:
return EIO;
case NBD_ENOMEM:
return ENOMEM;
case NBD_ENOSPC:
return ENOSPC;
case NBD_EINVAL:
default:
return EINVAL;
}
} | [
1,
0
] |
FFmpeg | libavformat/avienc.c | static void write_odml_master(AVFormatContext *s, int stream_index)
{
AVIOContext *pb = s->pb;
AVStream *st = s->streams[stream_index];
AVCodecContext *enc = st->codec;
AVIStream *avist = st->priv_data;
unsigned char tag[5];
int j;
/* Starting to lay out AVI OpenDML master index.
* We want ... | [
1,
0
] |
FFmpeg | libavformat/mp3enc.c | static int mp3_write_trailer(struct AVFormatContext *s)
{
uint8_t buf[ID3v1_TAG_SIZE];
MP3Context *mp3 = s->priv_data;
/* write the id3v1 tag */
if (id3v1_create_tag(s, buf) > 0) {
avio_write(s->pb, buf, ID3v1_TAG_SIZE);
}
/* write number of frames */
if (mp3 && mp3->nb_frames_offset) {
a... | [
1,
0
] |
qemu | exec.c | void qemu_ram_free_from_ptr(ram_addr_t addr)
{
RAMBlock *block;
/* This assumes the iothread lock is taken here too. */
qemu_mutex_lock_ramlist();
QTAILQ_FOREACH(block, &ram_list.blocks, next) {
if (addr == block->offset) {
QTAILQ_REMOVE(&ram_list.blocks, block, next);
ram_list.mru_bloc... | [
0,
0
] |
qemu | HACKING | static void cadence_ttc_write(void *opaque, target_phys_addr_t offset,
uint64_t value, unsigned size)
{
CadenceTimerState *s = cadence_timer_from_addr(opaque, offset);
DB_PRINT("addr: %08x data %08x\n", offset, (unsigned)value);
cadence_timer_sync(s);
switch (offset) {
cas... | [
1,
0
] |
qemu | tests/test-cutils.c | static void test_qemu_strtoull_max(void)
{
char *str = g_strdup_printf("%llu", ULLONG_MAX);
char f = 'X';
const char *endptr = &f;
uint64_t res = 999;
int err;
err = qemu_strtoull(str, &endptr, 0, &res);
g_assert_cmpint(err, ==, 0);
g_assert_cmpint(res, ==, ULLONG_MAX);
g_assert(endptr == st... | [
0,
0
] |
qemu | hw/9pfs/cofs.c | static int local_chown(FsContext *fs_ctx, V9fsPath *fs_path, FsCred *credp)
{
char buffer[PATH_MAX];
char *path = fs_path->data;
if ((credp->fc_uid == -1 && credp->fc_gid == -1) ||
(fs_ctx->export_flags & V9FS_SM_PASSTHROUGH) ||
(fs_ctx->export_flags & V9FS_SM_NONE)) {
return lchown(rpath(f... | [
1,
0
] |
qemu | block/qapi.c | Visitor *qmp_output_get_visitor(QmpOutputVisitor *v)
{
return &v->visitor;
} | [
0,
0
] |
qemu | block-vmdk.c | static int vmdk_write(BlockDriverState *bs, int64_t sector_num,
const uint8_t *buf, int nb_sectors)
{
BDRVVmdkState *s = bs->opaque;
int index_in_cluster, n;
uint64_t cluster_offset;
static int cid_update = 0;
while (nb_sectors > 0) {
index_in_cluster = sector_num & (s->clust... | [
1,
0
] |
FFmpeg | libavcodec/vda_h264_dec.c | static void vdadec_flush(AVCodecContext *avctx)
{
return ff_h264_decoder.flush(avctx);
} | [
0,
0
] |
FFmpeg | libavcodec/adx.c | static int adx_decode_init(AVCodecContext *avctx)
{
ADXContext *c = avctx->priv_data;
// printf("adx_decode_init\n"); fflush(stdout);
c->prev[0].s1 = 0;
c->prev[0].s2 = 0;
c->prev[1].s1 = 0;
c->prev[1].s2 = 0;
c->header_parsed = 0;
c->in_temp = 0;
return 0;
} | [
1,
0
] |
FFmpeg | libavcodec/h264_parser.c | static int init(AVCodecParserContext *s)
{
H264Context *h = s->priv_data;
h->thread_context[0] = h;
return 0;
} | [
1,
0
] |
FFmpeg | libavformat/segment.c | static int set_segment_filename(AVFormatContext *s)
{
SegmentContext *seg = s->priv_data;
AVFormatContext *oc = seg->avf;
size_t size;
if (seg->segment_idx_wrap)
seg->segment_idx %= seg->segment_idx_wrap;
if (seg->use_strftime) {
time_t now0;
struct tm *tm, tmpbuf;
time(&now0);
... | [
1,
0
] |
qemu | hw/serial.c | static int fifo_put(SerialState *s, int fifo, uint8_t chr)
{
SerialFIFO *f = (fifo) ? &s->recv_fifo : &s->xmit_fifo;
f->data[f->head++] = chr;
if (f->head == UART_FIFO_LENGTH)
f->head = 0;
f->count++;
return 1;
} | [
1,
0
] |
qemu | hw/dma/rc4030.c | static void rc4030_reset(DeviceState *dev)
{
rc4030State *s = RC4030(dev);
int i;
s->config = 0x410; /* some boards seem to accept 0x104 too */
s->revision = 1;
s->invalid_address_register = 0;
memset(s->dma_regs, 0, sizeof(s->dma_regs));
rc4030_dma_tt_update(s, 0, 0);
s->remote_failed_address ... | [
1,
1
] |
qemu | hw/arm/pxa2xx_gpio.c | static uint64_t pxa2xx_gpio_read(void *opaque, hwaddr offset,
unsigned size)
{
PXA2xxGPIOInfo *s = (PXA2xxGPIOInfo *)opaque;
uint32_t ret;
int bank;
if (offset >= 0x200)
return 0;
bank = pxa2xx_gpio_regs[offset].bank;
switch (pxa2xx_gpio_regs[offset].reg) {
c... | [
1,
0
] |
qemu | block-vmdk.c | static void vmdk_close(BlockDriverState *bs)
{
BDRVVmdkState *s = bs->opaque;
qemu_free(s->l1_table);
qemu_free(s->l2_cache);
bdrv_delete(s->hd);
// try to close parent image, if exist
vmdk_parent_close(s->hd);
} | [
1,
0
] |
qemu | target-i386/cpu.c | static void x86_cpu_apic_create(X86CPU *cpu, Error **errp)
{
APICCommonState *apic;
const char *apic_type = "apic";
if (kvm_apic_in_kernel()) {
apic_type = "kvm-apic";
} else if (xen_enabled()) {
apic_type = "xen-apic";
}
cpu->apic_state = DEVICE(object_new(apic_type));
object_property_ad... | [
1,
1
] |
qemu | qga/commands-posix.c | GuestMemoryBlockList *qmp_guest_get_memory_blocks(Error **errp)
{
GuestMemoryBlockList *head, **link;
Error *local_err = NULL;
struct dirent *de;
DIR *dp;
head = NULL;
link = &head;
dp = opendir("/sys/devices/system/memory/");
if (!dp) {
error_setg_errno(errp, errno,
"... | [
1,
0
] |
qemu | nbd/server.c | static int nbd_can_accept(void)
{
return nb_fds < shared;
} | [
1,
0
] |
qemu | crypto/cipher-builtin.c | int qcrypto_cipher_decrypt(QCryptoCipher *cipher, const void *in, void *out,
size_t len, Error **errp) {
QCryptoCipherBuiltin *ctxt = cipher->opaque;
return ctxt->decrypt(cipher, in, out, len, errp); | [
1,
0
] |
qemu | hw/sparc/sun4m.c | static bool do_modify_softint(CPUSPARCState *env, uint32_t value)
{
if (env->softint != value) {
env->softint = value;
#if !defined(CONFIG_USER_ONLY)
if (cpu_interrupts_enabled(env)) {
cpu_check_irqs(env);
}
#endif
return true;
}
return false;
} | [
1,
0
] |
qemu | hw/scsi-bus.c | static int get_blocksize(BlockDriverState *bdrv)
{
uint8_t cmd[10];
uint8_t buf[8];
uint8_t sensebuf[8];
sg_io_hdr_t io_header;
int ret;
memset(cmd, 0, sizeof(cmd));
memset(buf, 0, sizeof(buf));
cmd[0] = READ_CAPACITY;
memset(&io_header, 0, sizeof(io_header));
io_header.interface_id = 'S'... | [
1,
1
] |
FFmpeg | libavcodec/dxva2_h264.c | static int dxva2_h264_decode_slice(AVCodecContext *avctx,
const uint8_t *buffer,
uint32_t size)
{
const H264Context *h = avctx->priv_data;
struct dxva_context *ctx = avctx->hwaccel_context;
const Picture *current_picture = h->cur_pic_ptr;... | [
1,
0
] |
qemu | hw/fdc.c | static void fdctrl_raise_irq(FDCtrl *fdctrl, uint8_t status0)
{
/* Sparc mutation */
if (fdctrl->sun4m && (fdctrl->msr & FD_MSR_CMDBUSY)) {
/* XXX: not sure */
fdctrl->msr &= ~FD_MSR_CMDBUSY;
fdctrl->msr |= FD_MSR_RQM | FD_MSR_DIO;
fdctrl->status0 = status0;
return;
}
if (!(fdctrl->... | [
1,
1
] |
qemu | net/queue.c | static void qemu_net_queue_append_iov(NetQueue *queue,
NetClientState *sender,
unsigned flags,
const struct iovec *iov,
int iovcnt,
... | [
1,
0
] |
qemu | monitor.c | static void do_send_key(const char *string)
{
char keybuf[16], *q;
uint8_t keycodes[16];
const char *p;
int nb_keycodes, keycode, i;
nb_keycodes = 0;
p = string;
while (*p != '\0') {
q = keybuf;
while (*p != '\0' && *p != '-') {
if ((q - keybuf) < sizeof(keybuf) - 1) {
*q... | [
1,
0
] |
qemu | usb-linux.c | static int parse_filter(const char *spec, struct USBAutoFilter *f)
{
enum { BUS, DEV, VID, PID, DONE };
const char *p = spec;
int i;
f->bus_num = -1;
f->addr = -1;
f->vendor_id = -1;
f->product_id = -1;
for (i = BUS; i < DONE; i++) {
p = strpbrk(p, ":.");
if (!p)
break;
p++... | [
1,
0
] |
qemu | hw/usb/hcd-ehci.c | static int ehci_state_executing(EHCIQueue *q)
{
EHCIPacket *p = QTAILQ_FIRST(&q->packets);
int again = 0;
assert(p != NULL);
assert(p->qtdaddr == q->qtdaddr);
ehci_execute_complete(q);
if (p->usb_status == USB_RET_ASYNC) {
goto out;
}
if (p->usb_status == USB_RET_PROCERR) {
again = -1;... | [
0,
0
] |
qemu | migration.c | void do_migrate_set_speed(Monitor *mon, const QDict *qdict, QObject **ret_data)
{
double d;
char *ptr;
FdMigrationState *s;
const char *value = qdict_get_str(qdict, "value");
d = strtod(value, &ptr);
switch (*ptr) {
case 'G':
case 'g':
d *= 1024;
case 'M':
case 'm':
d *= 1024;
... | [
0,
0
] |
qemu | hw/i386/acpi-build.c | static void vtd_handle_gcmd_qie(IntelIOMMUState *s, bool en)
{
uint64_t iqa_val = vtd_get_quad_raw(s, DMAR_IQA_REG);
trace_vtd_inv_qi_enable(en);
if (en) {
s->iq = iqa_val & VTD_IQA_IQA_MASK(VTD_HOST_ADDRESS_WIDTH);
/* 2^(x+8) entries */
s->iq_size = 1UL << ((iqa_val & VTD_IQA_QS) + 8);
s-... | [
0,
0
] |
qemu | HACKING | static void mv88w8618_pit_write(void *opaque, target_phys_addr_t offset,
uint64_t value, unsigned size)
{
mv88w8618_pit_state *s = opaque;
mv88w8618_timer_state *t;
int i;
switch (offset) {
case MP_PIT_TIMER1_LENGTH ... MP_PIT_TIMER4_LENGTH:
t = &s->timer[offset >> ... | [
1,
0
] |
qemu | docs/qapi-code-gen.txt | static void qmp_input_type_null(Visitor *v, const char *name, Error **errp)
{
QmpInputVisitor *qiv = to_qiv(v);
QObject *qobj = qmp_input_get_object(qiv, name, true, errp);
if (!qobj) {
return;
}
if (qobject_type(qobj) != QTYPE_QNULL) {
error_setg(errp, QERR_INVALID_PARAMETER_TYPE, name ? name ... | [
0,
0
] |
qemu | qemu-char.c | void qemu_chr_printf(CharDriverState *s, const char *fmt, ...)
{
char buf[4096];
va_list ap;
va_start(ap, fmt);
vsnprintf(buf, sizeof(buf), fmt, ap);
qemu_chr_write(s, (uint8_t *)buf, strlen(buf));
va_end(ap);
} | [
1,
0
] |
qemu | block/io.c | void laio_io_plug(BlockDriverState *bs, void *aio_ctx)
{
struct qemu_laio_state *s = aio_ctx;
s->io_q.plugged++;
} | [
0,
0
] |
qemu | include/exec/gen-icount.h | static void gen_srlq(DisasContext *ctx)
{
int l1 = gen_new_label();
int l2 = gen_new_label();
TCGv t0 = tcg_temp_local_new();
TCGv t1 = tcg_temp_local_new();
TCGv t2 = tcg_temp_local_new();
tcg_gen_andi_tl(t2, cpu_gpr[rB(ctx->opcode)], 0x1F);
tcg_gen_movi_tl(t1, 0xFFFFFFFF);
tcg_gen_shr_tl(t2, ... | [
0,
0
] |
qemu | block.c | static bool bdrv_exceed_io_limits(BlockDriverState *bs, int nb_sectors,
bool is_write, int64_t *wait)
{
int64_t now, max_wait;
uint64_t bps_wait = 0, iops_wait = 0;
double elapsed_time;
int bps_ret, iops_ret;
now = qemu_get_clock_ns(vm_clock);
if ((bs->slice_start <... | [
1,
0
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.