project stringclasses 2
values | commit_id stringlengths 40 40 | target int64 0 1 | func stringlengths 26 142k | idx int64 0 27.3k |
|---|---|---|---|---|
qemu | c60bf3391bf4cb79b7adc6650094e21671ddaabd | 0 | static void readline_completion(ReadLineState *rs)
{
int len, i, j, max_width, nb_cols, max_prefix;
char *cmdline;
rs->nb_completions = 0;
cmdline = g_malloc(rs->cmd_buf_index + 1);
memcpy(cmdline, rs->cmd_buf, rs->cmd_buf_index);
cmdline[rs->cmd_buf_index] = '\0';
rs->completion... | 9,710 |
qemu | f7c11b535040df31cc8bc3b1f0c33f546073ee62 | 0 | static void tlb_unprotect_code_phys(CPUState *env, ram_addr_t ram_addr,
target_ulong vaddr)
{
phys_ram_dirty[ram_addr >> TARGET_PAGE_BITS] |= CODE_DIRTY_FLAG;
}
| 9,711 |
qemu | 7385aed20db5d83979f683b9d0048674411e963c | 0 | float64 helper_fqtod(CPUSPARCState *env)
{
float64 ret;
clear_float_exceptions(env);
ret = float128_to_float64(QT1, &env->fp_status);
check_ieee_exceptions(env);
return ret;
}
| 9,713 |
qemu | 0fada67420e29f389119ca6f44285203400e0730 | 0 | static bool vhost_section(MemoryRegionSection *section)
{
return section->address_space == get_system_memory()
&& memory_region_is_ram(section->mr);
}
| 9,714 |
qemu | a0efbf16604770b9d805bcf210ec29942321134f | 0 | static int parse_str(StringInputVisitor *siv, const char *name, Error **errp)
{
char *str = (char *) siv->string;
long long start, end;
Range *cur;
char *endptr;
if (siv->ranges) {
return 0;
}
do {
errno = 0;
start = strtoll(str, &endptr, 0);
i... | 9,715 |
FFmpeg | 92fabca427ff2d8fffa4bd4f09839d8d3822ef31 | 0 | static void DEF(put, pixels8_x2)(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h)
{
MOVQ_BFE(mm6);
__asm__ volatile(
"lea (%3, %3), %%"REG_a" \n\t"
".p2align 3 \n\t"
"1: \n\t"
"movq (%1), %%mm0 ... | 9,716 |
qemu | 8786db7cb96f8ce5c75c6e1e074319c9dca8d356 | 1 | static void address_space_update_topology(AddressSpace *as)
{
FlatView old_view = as->current_map;
FlatView new_view = generate_memory_topology(as->root);
address_space_update_topology_pass(as, old_view, new_view, false);
address_space_update_topology_pass(as, old_view, new_view, true);
as... | 9,717 |
FFmpeg | e3fc4481b6dd60acdb9f3e370ee9a1d1bd4ddd73 | 1 | static int vqf_probe(AVProbeData *probe_packet)
{
if (AV_RL32(probe_packet->buf) != MKTAG('T','W','I','N'))
return 0;
if (!memcmp(probe_packet->buf + 4, "97012000", 8))
return AVPROBE_SCORE_MAX;
if (!memcmp(probe_packet->buf + 4, "00052200", 8))
return AVPROBE_SCORE_MAX;
return A... | 9,718 |
qemu | 2d896b454a0e19ec4c1ddbb0e0b65b7e54fcedf3 | 1 | static void boston_platreg_write(void *opaque, hwaddr addr,
uint64_t val, unsigned size)
{
if (size != 4) {
qemu_log_mask(LOG_UNIMP, "%uB platform register write", size);
return;
}
switch (addr & 0xffff) {
case PLAT_FPGA_BUILD:
case PLAT_CO... | 9,719 |
qemu | 94e7340b5db8bce7866e44e700ffa8fd26585c7e | 1 | static int nbd_co_send_reply(NBDRequest *req, struct nbd_reply *reply,
int len)
{
NBDClient *client = req->client;
int csock = client->sock;
int rc, ret;
qemu_co_mutex_lock(&client->send_lock);
qemu_set_fd_handler2(csock, nbd_can_read, nbd_read,
... | 9,720 |
FFmpeg | 0c46e958d1fd3817b8e9fa048d0450d509c80378 | 1 | static int mxf_get_d10_aes3_packet(AVIOContext *pb, AVStream *st, AVPacket *pkt, int64_t length)
{
const uint8_t *buf_ptr, *end_ptr;
uint8_t *data_ptr;
int i;
if (length > 61444) /* worst case PAL 1920 samples 8 channels */
return -1;
av_new_packet(pkt, length);
avio_read(pb, p... | 9,723 |
FFmpeg | e02f7490da1ce126c679e513791071e56617b69a | 0 | static int cavs_decode_frame(AVCodecContext * avctx,void *data, int *data_size,
uint8_t * buf, int buf_size) {
AVSContext *h = avctx->priv_data;
MpegEncContext *s = &h->s;
int input_size;
const uint8_t *buf_end;
const uint8_t *buf_ptr;
AVFrame *picture = data;... | 9,724 |
FFmpeg | 34a8dcd031d637273cdea021e5a79cf720c4c51c | 0 | static int decode_end(AVCodecContext *avctx)
{
SmackVContext * const smk = (SmackVContext *)avctx->priv_data;
if(smk->mmap_tbl)
av_free(smk->mmap_tbl);
if(smk->mclr_tbl)
av_free(smk->mclr_tbl);
if(smk->full_tbl)
av_free(smk->full_tbl);
if(smk->type_tbl)
av... | 9,725 |
FFmpeg | 3d3243577cfdca6dec39a8c4e75feefd2a170f90 | 0 | static void test_sum_square(void)
{
INTFLOAT res0;
INTFLOAT res1;
LOCAL_ALIGNED_16(INTFLOAT, src, [256], [2]);
declare_func(INTFLOAT, INTFLOAT (*x)[2], int n);
randomize((INTFLOAT *)src, 256 * 2);
res0 = call_ref(src, 256);
res1 = call_new(src, 256);
if (!float_near_abs_eps(... | 9,726 |
FFmpeg | fd00203554334f602ee1d7c5416ff25f356f4fb7 | 0 | static int decode_residuals(FLACContext *s, int32_t *decoded, int pred_order)
{
int i, tmp, partition, method_type, rice_order;
int rice_bits, rice_esc;
int samples;
method_type = get_bits(&s->gb, 2);
if (method_type > 1) {
av_log(s->avctx, AV_LOG_ERROR, "illegal residual coding met... | 9,728 |
qemu | fd56e0612b6454a282fa6a953fdb09281a98c589 | 0 | MemoryRegion *pci_address_space(PCIDevice *dev)
{
return dev->bus->address_space_mem;
}
| 9,729 |
qemu | 011de2b512a83aa5e9f8899ed5bbf2f31995b90e | 0 | static void net_socket_accept(void *opaque)
{
NetSocketListenState *s = opaque;
NetSocketState *s1;
struct sockaddr_in saddr;
socklen_t len;
int fd;
for(;;) {
len = sizeof(saddr);
fd = qemu_accept(s->fd, (struct sockaddr *)&saddr, &len);
if (fd < 0 && errno !=... | 9,730 |
qemu | 8297be80f7cf71e09617669a8bd8b2836dcfd4c3 | 0 | static int vvfat_open(BlockDriverState *bs, QDict *options, int flags,
Error **errp)
{
BDRVVVFATState *s = bs->opaque;
int cyls, heads, secs;
bool floppy;
const char *dirname, *label;
QemuOpts *opts;
Error *local_err = NULL;
int ret;
#ifdef DEBUG
vvv = ... | 9,731 |
qemu | 72cf2d4f0e181d0d3a3122e04129c58a95da713e | 0 | static void qemu_opt_del(QemuOpt *opt)
{
TAILQ_REMOVE(&opt->opts->head, opt, next);
qemu_free((/* !const */ char*)opt->name);
qemu_free((/* !const */ char*)opt->str);
qemu_free(opt);
}
| 9,732 |
qemu | 04088adbe0c5adca66adb6022723362ad90ed0fc | 0 | static void bamboo_init(ram_addr_t ram_size,
const char *boot_device,
const char *kernel_filename,
const char *kernel_cmdline,
const char *initrd_filename,
const char *cpu_model)
{
unsigned... | 9,733 |
qemu | e2b8247a322cd92945785edf25f09e6b3e8285f9 | 0 | static int bochs_open(BlockDriverState *bs, QDict *options, int flags,
Error **errp)
{
BDRVBochsState *s = bs->opaque;
uint32_t i;
struct bochs_header bochs;
int ret;
bs->file = bdrv_open_child(NULL, options, "file", bs, &child_file,
fal... | 9,734 |
qemu | 364031f17932814484657e5551ba12957d993d7e | 0 | static V9fsSynthNode *v9fs_add_dir_node(V9fsSynthNode *parent, int mode,
const char *name,
V9fsSynthNodeAttr *attr, int inode)
{
V9fsSynthNode *node;
/* Add directory type and remove write bits */
mode = ((mode & 0777) |... | 9,735 |
FFmpeg | 08a747afb98c11da48b89339c2f1c5fdc56ced7e | 0 | void ff_eac3_output_frame_header(AC3EncodeContext *s)
{
int blk, ch;
AC3EncOptions *opt = &s->options;
put_bits(&s->pb, 16, 0x0b77); /* sync word */
/* BSI header */
put_bits(&s->pb, 2, 0); /* stream type = independent */
put_bits(&s->pb, 3, ... | 9,736 |
qemu | 6e0d8677cb443e7408c0b7a25a93c6596d7fa380 | 0 | static inline void gen_lods(DisasContext *s, int ot)
{
gen_string_movl_A0_ESI(s);
gen_op_ld_T0_A0(ot + s->mem_index);
gen_op_mov_reg_T0(ot, R_EAX);
gen_op_movl_T0_Dshift[ot]();
#ifdef TARGET_X86_64
if (s->aflag == 2) {
gen_op_addq_ESI_T0();
} else
#endif
if (s->aflag) {
... | 9,737 |
qemu | a8170e5e97ad17ca169c64ba87ae2f53850dab4c | 0 | static uint64_t hb_regs_read(void *opaque, target_phys_addr_t offset,
unsigned size)
{
uint32_t *regs = opaque;
uint32_t value = regs[offset/4];
if ((offset == 0x100) || (offset == 0x108) || (offset == 0x10C)) {
value |= 0x30000000;
}
return value;
}... | 9,738 |
qemu | fc19f8a02e45c4d8ad24dd7eb374330b03dfc28e | 0 | size_t nbd_wr_sync(int fd, void *buffer, size_t size, bool do_read)
{
size_t offset = 0;
if (qemu_in_coroutine()) {
if (do_read) {
return qemu_co_recv(fd, buffer, size);
} else {
return qemu_co_send(fd, buffer, size);
}
}
while (offset < size... | 9,739 |
qemu | 4b5d5e87c7ab2e979a2cad6c8e01bcae55b85f1c | 0 | static uint32_t vfio_pci_read_config(PCIDevice *pdev, uint32_t addr, int len)
{
VFIODevice *vdev = DO_UPCAST(VFIODevice, pdev, pdev);
uint32_t val = 0;
/*
* We only need QEMU PCI config support for the ROM BAR, the MSI and MSIX
* capabilities, and the multifunction bit below. We let VFIO ... | 9,740 |
qemu | 3dc6f8693694a649a9c83f1e2746565b47683923 | 0 | static void x86_cpu_realizefn(DeviceState *dev, Error **errp)
{
CPUState *cs = CPU(dev);
X86CPU *cpu = X86_CPU(dev);
X86CPUClass *xcc = X86_CPU_GET_CLASS(dev);
CPUX86State *env = &cpu->env;
Error *local_err = NULL;
static bool ht_warned;
if (xcc->kvm_required && !kvm_enabled()) {
... | 9,741 |
qemu | d28fca153bb27ff965b9eb26d73327fa4d2402c8 | 0 | static void pci_realview_class_init(ObjectClass *class, void *data)
{
DeviceClass *dc = DEVICE_CLASS(class);
/* Reason: object_unref() hangs */
dc->cannot_destroy_with_object_finalize_yet = true;
}
| 9,742 |
qemu | 5158de241b0fb344a6c948dfcbc4e611ab5fafbe | 0 | static int disas_thumb2_insn(DisasContext *s, uint32_t insn)
{
uint32_t imm, shift, offset;
uint32_t rd, rn, rm, rs;
TCGv_i32 tmp;
TCGv_i32 tmp2;
TCGv_i32 tmp3;
TCGv_i32 addr;
TCGv_i64 tmp64;
int op;
int shiftop;
int conds;
int logic_cc;
/* The only 32 bit ... | 9,746 |
qemu | 5fe269b16c6dc8f19da3e8c13d4c66958b00d2f0 | 0 | static int spapr_populate_memory(sPAPREnvironment *spapr, void *fdt)
{
uint32_t associativity[] = {cpu_to_be32(0x4), cpu_to_be32(0x0),
cpu_to_be32(0x0), cpu_to_be32(0x0),
cpu_to_be32(0x0)};
char mem_name[32];
hwaddr node0_size, mem_start;... | 9,750 |
qemu | 1fdc11c36971e0d4eeb2ce817f7e520b2028c2f2 | 0 | static void migrate_fd_put_notify(void *opaque)
{
MigrationState *s = opaque;
qemu_set_fd_handler2(s->fd, NULL, NULL, NULL, NULL);
qemu_file_put_notify(s->file);
if (qemu_file_get_error(s->file)) {
migrate_fd_error(s);
}
}
| 9,751 |
qemu | defdb20e1a8ac3a7200aaf190d7fb20a5ac8bcea | 0 | ParallelState *parallel_init(int index, CharDriverState *chr)
{
ISADevice *dev;
dev = isa_create("isa-parallel");
qdev_prop_set_uint32(&dev->qdev, "index", index);
qdev_prop_set_chr(&dev->qdev, "chardev", chr);
if (qdev_init(&dev->qdev) < 0)
return NULL;
return &DO_UPCAST(ISAPa... | 9,752 |
qemu | 0ee442502bc8af7fe1679ccf775e54fcf62dd8ac | 0 | static void main_loop(void)
{
int r;
#ifdef CONFIG_IOTHREAD
qemu_system_ready = 1;
qemu_cond_broadcast(&qemu_system_cond);
#endif
for (;;) {
do {
#ifdef CONFIG_PROFILER
int64_t ti;
#endif
#ifndef CONFIG_IOTHREAD
tcg_cpu_exec();
#endif
#ifdef CONFIG_PROF... | 9,753 |
qemu | 4a1418e07bdcfaa3177739e04707ecaec75d89e1 | 0 | static void qpi_mem_writeb(void *opaque, target_phys_addr_t addr, uint32_t val)
{
}
| 9,755 |
qemu | 4a1418e07bdcfaa3177739e04707ecaec75d89e1 | 0 | uint64_t cpu_get_tsc(CPUX86State *env)
{
/* Note: when using kqemu, it is more logical to return the host TSC
because kqemu does not trap the RDTSC instruction for
performance reasons */
#ifdef CONFIG_KQEMU
if (env->kqemu_enabled) {
return cpu_get_real_ticks();
} else
#endif
... | 9,757 |
qemu | becf8217deb2afc347d5172d9f30c8a8964b8b27 | 0 | void HELPER(diag)(CPUS390XState *env, uint32_t r1, uint32_t r3, uint32_t num)
{
uint64_t r;
switch (num) {
case 0x500:
/* KVM hypercall */
qemu_mutex_lock_iothread();
r = s390_virtio_hypercall(env);
qemu_mutex_unlock_iothread();
break;
case 0x44:
... | 9,758 |
qemu | fd56e0612b6454a282fa6a953fdb09281a98c589 | 0 | static void piix3_write_config(PCIDevice *dev,
uint32_t address, uint32_t val, int len)
{
pci_default_write_config(dev, address, val, len);
if (ranges_overlap(address, len, PIIX_PIRQC, 4)) {
PIIX3State *piix3 = PIIX3_PCI_DEVICE(dev);
int pic_irq;
p... | 9,760 |
FFmpeg | aabdc4618788a90c4a2b64a569f560d5b7378271 | 1 | static void idcin_decode_vlcs(IdcinContext *s)
{
hnode_t *hnodes;
long x, y;
int prev;
unsigned char v = 0;
int bit_pos, node_num, dat_pos;
prev = bit_pos = dat_pos = 0;
for (y = 0; y < (s->frame.linesize[0] * s->avctx->height);
y += s->frame.linesize[0]) {
for (x... | 9,762 |
FFmpeg | 9e9d731b510666edac3a2b450dfc331279db818b | 1 | static int decode_frame_common(AVCodecContext *avctx, PNGDecContext *s,
AVFrame *p, AVPacket *avpkt)
{
AVDictionary *metadata = NULL;
uint32_t tag, length;
int decode_next_dat = 0;
int ret;
for (;;) {
length = bytestream2_get_bytes_left(&s->gb);
... | 9,763 |
qemu | 45bbbb466cf4a6280076ea5a51f67ef5bedee345 | 1 | void helper_idivq_EAX_T0(void)
{
uint64_t r0, r1;
if (T0 == 0) {
raise_exception(EXCP00_DIVZ);
}
r0 = EAX;
r1 = EDX;
idiv64(&r0, &r1, T0);
EAX = r0;
EDX = r1;
}
| 9,764 |
FFmpeg | 95d9a85ca3e662388d5fa7ef1937d1c3fbe2dcd5 | 1 | static void start_children(FFServerStream *feed)
{
char *pathname;
char *slash;
int i;
size_t cmd_length;
if (no_launch)
return;
cmd_length = strlen(my_program_name);
/**
* FIXME: WIP Safeguard. Remove after clearing all harcoded
* '1024' path lengths
*/
... | 9,766 |
FFmpeg | 6abc56e892c2c2500d1fc2698fa6d580b72f721b | 1 | static int dshow_read_packet(AVFormatContext *s, AVPacket *pkt)
{
struct dshow_ctx *ctx = s->priv_data;
AVPacketList *pktl = NULL;
while (!ctx->eof && !pktl) {
WaitForSingleObject(ctx->mutex, INFINITE);
pktl = ctx->pktl;
if (pktl) {
*pkt = pktl->pkt;
... | 9,767 |
qemu | c508277335e3b6b20cf18e6ea3a35c1fa835c64a | 1 | static void vmxnet3_update_pm_state(VMXNET3State *s)
{
struct Vmxnet3_VariableLenConfDesc pm_descr;
pm_descr.confLen =
VMXNET3_READ_DRV_SHARED32(s->drv_shmem, devRead.pmConfDesc.confLen);
pm_descr.confVer =
VMXNET3_READ_DRV_SHARED32(s->drv_shmem, devRead.pmConfDesc.confVer);
pm_... | 9,768 |
FFmpeg | f19af812a32c1398d48c3550d11dbc6aafbb2bfc | 1 | static int adx_encode_frame(AVCodecContext *avctx,
unsigned char *frame, int buf_size, const void *data)
{
ADXContext *c = avctx->priv_data;
const short *samples = data;
unsigned char *dst = frame;
int rest = avctx->frame_size;
/*
input data size =
ffmpeg.c: do_audio_out()
frame_bytes = enc->f... | 9,769 |
qemu | cecd8504b80148b66cdc1ce32046429bc3549090 | 1 | void HELPER(vfp_set_fpscr)(CPUState *env, uint32_t val)
{
int i;
uint32_t changed;
changed = env->vfp.xregs[ARM_VFP_FPSCR];
env->vfp.xregs[ARM_VFP_FPSCR] = (val & 0xffc8ffff);
env->vfp.vec_len = (val >> 16) & 7;
env->vfp.vec_stride = (val >> 20) & 3;
changed ^= val;
if (chan... | 9,770 |
qemu | caffdac363801cd2cf2bf01ad013a8c1e1e43800 | 1 | static int virtio_blk_pci_init(VirtIOPCIProxy *vpci_dev)
{
VirtIOBlkPCI *dev = VIRTIO_BLK_PCI(vpci_dev);
DeviceState *vdev = DEVICE(&dev->vdev);
virtio_blk_set_conf(vdev, &(dev->blk));
qdev_set_parent_bus(vdev, BUS(&vpci_dev->bus));
if (qdev_init(vdev) < 0) {
return -1;
}
re... | 9,771 |
FFmpeg | c753b56b4d56724284dd7ed972efdb843db80f12 | 1 | void ff_convert_matrix(DSPContext *dsp, int (*qmat)[64],
uint16_t (*qmat16)[2][64],
const uint16_t *quant_matrix,
int bias, int qmin, int qmax, int intra)
{
int qscale;
int shift = 0;
for (qscale = qmin; qscale <= qmax; qscale++) ... | 9,773 |
FFmpeg | f55bc96a5449179ee9b0aab6f0a4581ba1df6b62 | 1 | static int pcm_dvd_parse_header(AVCodecContext *avctx, const uint8_t *header)
{
/* no traces of 44100 and 32000Hz in any commercial software or player */
static const uint32_t frequencies[4] = { 48000, 96000, 44100, 32000 };
PCMDVDContext *s = avctx->priv_data;
int header_int = (header[0] & 0xe0) |... | 9,776 |
qemu | f1a7ff770f7d71ee7833ff019aac9d6cc3d13f71 | 1 | static int64_t nfs_client_open(NFSClient *client, QDict *options,
int flags, int open_flags, Error **errp)
{
int ret = -EINVAL;
QemuOpts *opts = NULL;
Error *local_err = NULL;
struct stat st;
char *file = NULL, *strp = NULL;
qemu_mutex_init(&client->mutex... | 9,777 |
qemu | 6ab3fc32ea640026726bc5f9f4db622d0954fb8a | 1 | ssize_t slirp_send(struct socket *so, const void *buf, size_t len, int flags)
{
if (so->s == -1 && so->extra) {
qemu_chr_fe_write(so->extra, buf, len);
return len;
}
return send(so->s, buf, len, flags);
}
| 9,778 |
FFmpeg | 6c0107822d3ed7588fa857c3ed1ee886b4ba62e9 | 1 | static int diff_C(unsigned char *old, unsigned char *new, int os, int ns)
{
int x, y, d=0;
for (y = 8; y; y--) {
for (x = 8; x; x--) {
d += abs(new[x] - old[x]);
}
new += ns;
old += os;
}
return d;
}
| 9,782 |
qemu | d9bce9d99f4656ae0b0127f7472db9067b8f84ab | 1 | void do_icbi (void)
{
uint32_t tmp;
/* Invalidate one cache line :
* PowerPC specification says this is to be treated like a load
* (not a fetch) by the MMU. To be sure it will be so,
* do the load "by hand".
*/
#if defined(TARGET_PPC64)
if (!msr_sf)
T0 &= 0xFFFFFFFFULL... | 9,783 |
qemu | 81b23ef82cd1be29ca3d69ab7e98b5b5e55926ce | 1 | static int xen_pt_register_regions(XenPCIPassthroughState *s)
{
int i = 0;
XenHostPCIDevice *d = &s->real_device;
/* Register PIO/MMIO BARs */
for (i = 0; i < PCI_ROM_SLOT; i++) {
XenHostPCIIORegion *r = &d->io_regions[i];
uint8_t type;
if (r->base_addr == 0 || r->siz... | 9,784 |
qemu | c4237dfa635900e4d1cdc6038d5efe3507f45f0c | 1 | void bdrv_set_dirty(BlockDriverState *bs, int64_t cur_sector,
int nr_sectors)
{
BdrvDirtyBitmap *bitmap;
QLIST_FOREACH(bitmap, &bs->dirty_bitmaps, list) {
hbitmap_set(bitmap->bitmap, cur_sector, nr_sectors);
}
}
| 9,785 |
FFmpeg | ac4b32df71bd932838043a4838b86d11e169707f | 1 | av_cold void ff_vp8dsp_init_armv6(VP8DSPContext *dsp)
{
dsp->vp8_luma_dc_wht = ff_vp8_luma_dc_wht_armv6;
dsp->vp8_luma_dc_wht_dc = ff_vp8_luma_dc_wht_dc_armv6;
dsp->vp8_idct_add = ff_vp8_idct_add_armv6;
dsp->vp8_idct_dc_add = ff_vp8_idct_dc_add_armv6;
dsp->vp8_idct_dc_add4y = ff... | 9,786 |
qemu | ccfcaba6fd9f69a9322af1911302e71127bee1e0 | 1 | static void gdb_set_cpu_pc(GDBState *s, target_ulong pc)
{
#if defined(TARGET_I386)
cpu_synchronize_state(s->c_cpu);
s->c_cpu->eip = pc;
#elif defined (TARGET_PPC)
s->c_cpu->nip = pc;
#elif defined (TARGET_SPARC)
s->c_cpu->npc = pc + 4;
#elif defined (TARGET_ARM)
s->c_cpu->regs[15] = pc;
... | 9,788 |
qemu | 51dbea77a29ea46173373a6dad4ebd95d4661f42 | 1 | void hid_reset(HIDState *hs)
{
switch (hs->kind) {
case HID_KEYBOARD:
memset(hs->kbd.keycodes, 0, sizeof(hs->kbd.keycodes));
memset(hs->kbd.key, 0, sizeof(hs->kbd.key));
hs->kbd.keys = 0;
break;
case HID_MOUSE:
case HID_TABLET:
memset(hs->ptr.queue, 0, ... | 9,790 |
FFmpeg | 6fb2fd895e858ab93f46e656a322778ee181c307 | 1 | av_cold int avcodec_close(AVCodecContext *avctx)
{
/* If there is a user-supplied mutex locking routine, call it. */
if (ff_lockmgr_cb) {
if ((*ff_lockmgr_cb)(&codec_mutex, AV_LOCK_OBTAIN))
return -1;
}
entangled_thread_counter++;
if (entangled_thread_counter != 1) {
... | 9,791 |
qemu | 5c6c0e513600ba57c3e73b7151d3c0664438f7b5 | 1 | static SCSIDiskReq *scsi_find_request(SCSIDiskState *s, uint32_t tag)
{
return DO_UPCAST(SCSIDiskReq, req, scsi_req_find(&s->qdev, tag));
}
| 9,792 |
qemu | 374ec0669a1aa3affac7850a16c6cad18221c439 | 1 | static ssize_t sdp_svc_search(struct bt_l2cap_sdp_state_s *sdp,
uint8_t *rsp, const uint8_t *req, ssize_t len)
{
ssize_t seqlen;
int i, count, start, end, max;
int32_t handle;
/* Perform the search */
for (i = 0; i < sdp->services; i ++)
sdp->service_list[i].match =... | 9,794 |
FFmpeg | 83548fe894cdb455cc127f754d09905b6d23c173 | 0 | void ff_id3v1_read(AVFormatContext *s)
{
int ret;
uint8_t buf[ID3v1_TAG_SIZE];
int64_t filesize, position = avio_tell(s->pb);
if (s->pb->seekable) {
/* XXX: change that */
filesize = avio_size(s->pb);
if (filesize > 128) {
avio_seek(s->pb, filesize - 128, S... | 9,796 |
FFmpeg | d6604b29ef544793479d7fb4e05ef6622bb3e534 | 0 | static av_cold int dvvideo_encode_init(AVCodecContext *avctx)
{
DVVideoContext *s = avctx->priv_data;
FDCTDSPContext fdsp;
MECmpContext mecc;
PixblockDSPContext pdsp;
int ret;
s->sys = av_dv_codec_profile(avctx->width, avctx->height, avctx->pix_fmt);
if (!s->sys) {
av_log(... | 9,797 |
FFmpeg | 13a099799e89a76eb921ca452e1b04a7a28a9855 | 0 | yuv2rgb48_2_c_template(SwsContext *c, const uint16_t *buf0,
const uint16_t *buf1, const uint16_t *ubuf0,
const uint16_t *ubuf1, const uint16_t *vbuf0,
const uint16_t *vbuf1, const uint16_t *abuf0,
const uint16_t *abuf1, uint... | 9,798 |
qemu | a83000f5e3fac30a7f213af1ba6a8f827622854d | 0 | void *kvmppc_create_spapr_tce(uint32_t liobn, uint32_t window_size, int *pfd)
{
struct kvm_create_spapr_tce args = {
.liobn = liobn,
.window_size = window_size,
};
long len;
int fd;
void *table;
/* Must set fd to -1 so we don't try to munmap when called for
* des... | 9,799 |
FFmpeg | 0c32e19d584ba6ddbc27f0a796260404daaf4b6a | 0 | static void filter_mb_mbaff_edgecv( H264Context *h, uint8_t *pix, int stride, int16_t bS[4], int bsi, int qp ) {
int i;
int index_a = qp + h->slice_alpha_c0_offset;
int alpha = (alpha_table+52)[index_a];
int beta = (beta_table+52)[qp + h->slice_beta_offset];
for( i = 0; i < 4; i++, pix += stri... | 9,800 |
qemu | 61c7887e0f3dcfa9c4ccdfe43374243a4a5c0e8d | 0 | static void bdrv_qed_invalidate_cache(BlockDriverState *bs, Error **errp)
{
BDRVQEDState *s = bs->opaque;
Error *local_err = NULL;
int ret;
bdrv_qed_close(bs);
memset(s, 0, sizeof(BDRVQEDState));
ret = bdrv_qed_do_open(bs, NULL, bs->open_flags, &local_err);
if (local_err) {
... | 9,801 |
qemu | c89d52997cf4849a9ee16b5d2cf462d0cd137634 | 0 | void spapr_register_hypercall(target_ulong opcode, spapr_hcall_fn fn)
{
spapr_hcall_fn *slot;
if (opcode <= MAX_HCALL_OPCODE) {
assert((opcode & 0x3) == 0);
slot = &papr_hypercall_table[opcode / 4];
} else {
assert((opcode >= KVMPPC_HCALL_BASE) && (opcode <= KVMPPC_HCALL_M... | 9,802 |
qemu | 537e8f1aa838677c8efd5e0966e89c4b5423dd18 | 0 | static int usb_host_open(USBHostDevice *dev, int bus_num,
int addr, const char *port,
const char *prod_name, int speed)
{
int fd = -1, ret;
trace_usb_host_open_started(bus_num, addr);
if (dev->fd != -1) {
goto fail;
}
fd = usb_... | 9,803 |
qemu | e268ca52328eb0460ae0d10b7f4313a63d5b000c | 0 | static void ide_init2(IDEState *ide_state,
BlockDriverState *hd0, BlockDriverState *hd1,
qemu_irq irq)
{
IDEState *s;
static int drive_serial = 1;
int i, cylinders, heads, secs;
uint64_t nb_sectors;
for(i = 0; i < 2; i++) {
s = ide_state... | 9,804 |
qemu | d1fdf257d52822695f5ace6c586e059aa17d4b79 | 0 | static ssize_t nbd_send_reply(QIOChannel *ioc, NBDReply *reply)
{
uint8_t buf[NBD_REPLY_SIZE];
reply->error = system_errno_to_nbd_errno(reply->error);
TRACE("Sending response to client: { .error = %" PRId32
", handle = %" PRIu64 " }",
reply->error, reply->handle);
/* Rep... | 9,806 |
qemu | a0efbf16604770b9d805bcf210ec29942321134f | 0 | static void q35_host_get_pci_hole64_end(Object *obj, Visitor *v,
const char *name, void *opaque,
Error **errp)
{
PCIHostState *h = PCI_HOST_BRIDGE(obj);
Range w64;
pci_bus_get_w64_range(h->bus, &w64);
visit_type_u... | 9,807 |
qemu | 61007b316cd71ee7333ff7a0a749a8949527575f | 0 | static BlockAIOCB *bdrv_co_aio_rw_vector(BlockDriverState *bs,
int64_t sector_num,
QEMUIOVector *qiov,
int nb_sectors,
BdrvRequestFlags flags,
... | 9,808 |
qemu | 67a0fd2a9bca204d2b39f910a97c7137636a0715 | 0 | static int64_t coroutine_fn raw_co_get_block_status(BlockDriverState *bs,
int64_t sector_num,
int nb_sectors, int *pnum)
{
*pnum = nb_sectors;
return BDRV_BLOCK_RAW | BDRV_BLOCK_OFFSET_VALID | BDRV_BLOCK_DATA |
... | 9,809 |
qemu | 425532d71d5d295cc9c649500e4969ac621ce51d | 0 | static inline int check_fit_tl(tcg_target_long val, unsigned int bits)
{
return (val << ((sizeof(tcg_target_long) * 8 - bits))
>> (sizeof(tcg_target_long) * 8 - bits)) == val;
}
| 9,810 |
FFmpeg | 7b46add7257628bffac96d3002308d1f9e1ed172 | 0 | int av_cold ff_celt_pvq_init(CeltPVQ **pvq, int encode)
{
CeltPVQ *s = av_malloc(sizeof(CeltPVQ));
if (!s)
return AVERROR(ENOMEM);
s->pvq_search = ppp_pvq_search_c;
s->quant_band = encode ? pvq_encode_band : pvq_decode_band;
s->band_cost = pvq_band_cost;
if (ARCH_X86)
... | 9,811 |
qemu | 364031f17932814484657e5551ba12957d993d7e | 0 | static off_t v9fs_synth_telldir(FsContext *ctx, V9fsFidOpenState *fs)
{
V9fsSynthOpenState *synth_open = fs->private;
return synth_open->offset;
}
| 9,812 |
qemu | c50f65118b429e6847d5c11b1a20a560d61c34b7 | 0 | bool gs_allowed(void)
{
if (kvm_enabled()) {
MachineClass *mc = MACHINE_GET_CLASS(qdev_get_machine());
if (object_class_dynamic_cast(OBJECT_CLASS(mc),
TYPE_S390_CCW_MACHINE)) {
S390CcwMachineClass *s390mc = S390_MACHINE_CLASS(mc);
... | 9,813 |
qemu | 245f7b51c0ea04fb2224b1127430a096c91aee70 | 0 | tight_filter_gradient24(VncState *vs, uint8_t *buf, int w, int h)
{
uint32_t *buf32;
uint32_t pix32;
int shift[3];
int *prev;
int here[3], upper[3], left[3], upperleft[3];
int prediction;
int x, y, c;
buf32 = (uint32_t *)buf;
memset(vs->tight_gradient.buffer, 0, w * 3 * s... | 9,814 |
qemu | 7d5e199ade76c53ec316ab6779800581bb47c50a | 0 | static void qmp_output_type_uint64(Visitor *v, const char *name, uint64_t *obj,
Error **errp)
{
/* FIXME values larger than INT64_MAX become negative */
QmpOutputVisitor *qov = to_qov(v);
qmp_output_add(qov, name, qint_from_int(*obj));
}
| 9,815 |
qemu | 384acbf46b70edf0d2c1648aa1a92a90bcf7057d | 0 | static void bh_run_aio_completions(void *opaque)
{
QEMUBH **bh = opaque;
qemu_bh_delete(*bh);
qemu_free(bh);
qemu_aio_process_queue();
}
| 9,816 |
qemu | f0267ef7115656119bf00ed77857789adc036bda | 0 | long do_rt_sigreturn(CPUARMState *env)
{
struct target_rt_sigframe *frame = NULL;
abi_ulong frame_addr = env->xregs[31];
trace_user_do_rt_sigreturn(env, frame_addr);
if (frame_addr & 15) {
goto badframe;
}
if (!lock_user_struct(VERIFY_READ, frame, frame_addr, 1)) {
... | 9,818 |
FFmpeg | 465e1dadbef7596a3eb87089a66bb4ecdc26d3c4 | 0 | static void update(NUTContext *nut, int stream_index, int64_t frame_start, int frame_type, int frame_code, int key_frame, int size, int64_t pts){
StreamContext *stream= &nut->stream[stream_index];
stream->last_key_frame= key_frame;
nut->last_frame_start[ frame_type ]= frame_start;
update_lru(s... | 9,819 |
FFmpeg | 507dce2536fea4b78a9f4973f77e1fa20cfe1b81 | 0 | void ff_rv34dsp_init_neon(RV34DSPContext *c, DSPContext* dsp)
{
c->rv34_inv_transform = ff_rv34_inv_transform_noround_neon;
c->rv34_inv_transform_dc = ff_rv34_inv_transform_noround_dc_neon;
c->rv34_idct_add = ff_rv34_idct_add_neon;
c->rv34_idct_dc_add = ff_rv34_idct_dc_add_neon;
}
| 9,820 |
FFmpeg | 15e9c4afdc8efbf8da86bb3f7eaf374310b44bf8 | 0 | static int request_samples(AVFilterContext *ctx, int min_samples)
{
MixContext *s = ctx->priv;
int i, ret;
av_assert0(s->nb_inputs > 1);
for (i = 1; i < s->nb_inputs; i++) {
ret = 0;
if (!(s->input_state[i] & INPUT_ON))
continue;
if (av_audio_fifo_size(s-... | 9,821 |
FFmpeg | 28f9ab7029bd1a02f659995919f899f84ee7361b | 0 | void ff_vp3_idct_dc_add_c(uint8_t *dest/*align 8*/, int line_size, const DCTELEM *block/*align 16*/){
int i, dc = (block[0] + 15) >> 5;
for(i = 0; i < 8; i++){
dest[0] = av_clip_uint8(dest[0] + dc);
dest[1] = av_clip_uint8(dest[1] + dc);
dest[2] = av_clip_uint8(dest[2] + dc);
... | 9,822 |
FFmpeg | dcc39ee10e82833ce24aa57926c00ffeb1948198 | 0 | static enum AVPixelFormat mpeg_get_pixelformat(AVCodecContext *avctx)
{
Mpeg1Context *s1 = avctx->priv_data;
MpegEncContext *s = &s1->mpeg_enc_ctx;
const enum AVPixelFormat *pix_fmts;
#if FF_API_XVMC
FF_DISABLE_DEPRECATION_WARNINGS
if (avctx->xvmc_acceleration)
return ff_get_format(av... | 9,823 |
FFmpeg | 2580bae54a45d6aaf85ddc5e780389e7e90b2c86 | 1 | static int init_tiles(Jpeg2000EncoderContext *s)
{
int tileno, tilex, tiley, compno;
Jpeg2000CodingStyle *codsty = &s->codsty;
Jpeg2000QuantStyle *qntsty = &s->qntsty;
s->numXtiles = ff_jpeg2000_ceildiv(s->width, s->tile_width);
s->numYtiles = ff_jpeg2000_ceildiv(s->height, s->tile_height);... | 9,824 |
qemu | 7d1b0095bff7157e856d1d0e6c4295641ced2752 | 1 | static TCGv neon_load_reg(int reg, int pass)
{
TCGv tmp = new_tmp();
tcg_gen_ld_i32(tmp, cpu_env, neon_reg_offset(reg, pass));
return tmp;
}
| 9,825 |
FFmpeg | 5312c319be98c63b8e59695222a13068a0dbc7ab | 1 | int avformat_find_stream_info(AVFormatContext *ic, AVDictionary **options)
{
int i, count, ret = 0, j;
int64_t read_size;
AVStream *st;
AVPacket pkt1, *pkt;
int64_t old_offset = avio_tell(ic->pb);
int orig_nb_streams = ic->nb_streams; // new streams might appear, no options for tho... | 9,826 |
qemu | 8d04fb55dec381bc5105cb47f29d918e579e8cbd | 1 | static void tcg_handle_interrupt(CPUState *cpu, int mask)
{
int old_mask;
old_mask = cpu->interrupt_request;
cpu->interrupt_request |= mask;
/*
* If called from iothread context, wake the target cpu in
* case its halted.
*/
if (!qemu_cpu_is_self(cpu)) {
qemu_cpu_... | 9,827 |
qemu | 12f8def0e02232d7c6416ad9b66640f973c531d1 | 1 | void qemu_cond_broadcast(QemuCond *cond)
{
BOOLEAN result;
/*
* As in pthread_cond_signal, access to cond->waiters and
* cond->target is locked via the external mutex.
*/
if (cond->waiters == 0) {
return;
}
cond->target = 0;
result = ReleaseSemaphore(cond->sem... | 9,828 |
qemu | b4ba67d9a702507793c2724e56f98e9b0f7be02b | 1 | static uint16_t qvirtio_pci_config_readw(QVirtioDevice *d, uint64_t off)
{
QVirtioPCIDevice *dev = (QVirtioPCIDevice *)d;
uint16_t value;
value = qpci_io_readw(dev->pdev, CONFIG_BASE(dev) + off);
if (qvirtio_is_big_endian(d)) {
value = bswap16(value);
}
return value;
}
| 9,829 |
FFmpeg | 7cc84d241ba6ef8e27e4d057176a4ad385ad3d59 | 1 | static int advanced_decode_picture_secondary_header(VC9Context *v)
{
GetBitContext *gb = &v->s.gb;
int index, status = 0;
switch(v->s.pict_type)
{
case P_TYPE: status = decode_p_picture_secondary_header(v); break;
case B_TYPE: status = decode_b_picture_secondary_header(v); break;
c... | 9,830 |
qemu | b45c03f585ea9bb1af76c73e82195418c294919d | 1 | struct omap_mmc_s *omap2_mmc_init(struct omap_target_agent_s *ta,
BlockBackend *blk, qemu_irq irq, qemu_irq dma[],
omap_clk fclk, omap_clk iclk)
{
struct omap_mmc_s *s = (struct omap_mmc_s *)
g_malloc0(sizeof(struct omap_mmc_s));
s->irq = irq;
s->dma = dm... | 9,831 |
qemu | 0187688f3270433269fc7d4909ad36dc5c5db7aa | 1 | static void dec_store(DisasContext *dc)
{
TCGv t, *addr;
unsigned int size;
size = 1 << (dc->opcode & 3);
LOG_DIS("s%d%s\n", size, dc->type_b ? "i" : "");
t_sync_flags(dc);
/* If we get a fault on a dslot, the jmpstate better be in sync. */
sync_jmpstate(dc);
addr = compute_ldst_addr(dc... | 9,832 |
FFmpeg | 5b8009f4c80d8fd96523c8c163441ad4011ad472 | 1 | static inline void range_dec_normalize(APEContext *ctx)
{
while (ctx->rc.range <= BOTTOM_VALUE) {
ctx->rc.buffer <<= 8;
if(ctx->ptr < ctx->data_end)
ctx->rc.buffer += *ctx->ptr;
ctx->ptr++;
ctx->rc.low = (ctx->rc.low << 8) | ((ctx->rc.buffer >> 1) & 0xFF);
... | 9,833 |
FFmpeg | 45115315820a14d0c3f836adafb879475736e750 | 1 | static int theora_header(AVFormatContext *s, int idx)
{
struct ogg *ogg = s->priv_data;
struct ogg_stream *os = ogg->streams + idx;
AVStream *st = s->streams[idx];
TheoraParams *thp = os->private;
int cds = st->codec->extradata_size + os->psize + 2;
int err;
... | 9,834 |
FFmpeg | 5d639b2b4a6d1f5710cfe247dea4d4c6debdfe0d | 1 | static int buffer_needs_copy(PadContext *s, AVFrame *frame, AVBufferRef *buf)
{
int planes[4] = { -1, -1, -1, -1}, *p = planes;
int i, j;
/* get all planes in this buffer */
for (i = 0; i < FF_ARRAY_ELEMS(planes) && frame->data[i]; i++) {
if (av_frame_get_plane_buffer(frame, i) == buf)
... | 9,836 |
qemu | 77cb0f5aafc8e6d0c6d3c339f381c9b7921648e0 | 1 | static void adb_kbd_initfn(Object *obj)
{
ADBDevice *d = ADB_DEVICE(obj);
d->devaddr = ADB_DEVID_KEYBOARD;
}
| 9,837 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.