project stringclasses 2
values | commit_id stringlengths 40 40 | target int64 0 1 | func stringlengths 26 142k | idx int64 0 27.3k |
|---|---|---|---|---|
qemu | 9bc3a3a216e2689bfcdd36c3e079333bbdbf3ba0 | 0 | static int ehci_state_waitlisthead(EHCIState *ehci, int async)
{
EHCIqh qh;
int i = 0;
int again = 0;
uint32_t entry = ehci->asynclistaddr;
/* set reclamation flag at start event (4.8.6) */
if (async) {
ehci_set_usbsts(ehci, USBSTS_REC);
}
ehci_queues_rip_unused(eh... | 27,249 |
qemu | b00c72180c36510bf9b124e190bd520e3b7e1358 | 0 | static void gen_rdhwr(DisasContext *ctx, int rt, int rd)
{
TCGv t0;
#if !defined(CONFIG_USER_ONLY)
/* The Linux kernel will emulate rdhwr if it's not supported natively.
Therefore only check the ISA in system mode. */
check_insn(ctx, ISA_MIPS32R2);
#endif
t0 = tcg_temp_new();
sw... | 27,250 |
qemu | 439e2a6e10ed7f5da819bf7dcaa54b8cfdbeab0d | 0 | Aml *aml_shiftright(Aml *arg1, Aml *count)
{
Aml *var = aml_opcode(0x7A /* ShiftRightOp */);
aml_append(var, arg1);
aml_append(var, count);
build_append_byte(var->buf, 0x00); /* NullNameOp */
return var;
}
| 27,251 |
qemu | 37cc9f7f684ed035da63274daca1594c7ee16213 | 0 | static ssize_t handle_aiocb_write_zeroes(RawPosixAIOData *aiocb)
{
int ret = -EOPNOTSUPP;
BDRVRawState *s = aiocb->bs->opaque;
if (s->has_write_zeroes == 0) {
return -ENOTSUP;
}
if (aiocb->aio_type & QEMU_AIO_BLKDEV) {
#ifdef BLKZEROOUT
do {
uint64_t range[2... | 27,252 |
qemu | 9fd3171af9d7de2777bf38ce79c2fe3dd6f9a49e | 0 | int bdrv_open(BlockDriverState *bs, const char *filename, QDict *options,
int flags, BlockDriver *drv, Error **errp)
{
int ret;
/* TODO: extra byte is a hack to ensure MAX_PATH space on Windows. */
char tmp_filename[PATH_MAX + 1];
BlockDriverState *file = NULL;
QDict *file_optio... | 27,253 |
FFmpeg | 3a2b9911bffeffc3fc0541df3b4f6d492e122714 | 0 | static void filter(struct vf_priv_s *p, uint8_t *dst[3], uint8_t *src[3], int dst_stride[3], int src_stride[3], int width, int height){
int x, y, i;
for(i=0; i<3; i++){
p->frame->data[i]= src[i];
p->frame->linesize[i]= src_stride[i];
}
p->avctx_enc->me_cmp=
p->avctx_enc->m... | 27,255 |
qemu | 1e2713384c58037ad44f716c31c08daca18862c5 | 1 | static void test_qga_config(gconstpointer data)
{
GError *error = NULL;
char *cwd, *cmd, *out, *err, *str, **strv, **argv = NULL;
char *env[2];
int status;
gsize n;
GKeyFile *kf;
cwd = g_get_current_dir();
cmd = g_strdup_printf("%s%cqemu-ga -D",
cwd,... | 27,258 |
FFmpeg | 7effbee66cf457c62f795d9b9ed3a1110b364b89 | 1 | static int apc_read_packet(AVFormatContext *s, AVPacket *pkt)
{
if (av_get_packet(s->pb, pkt, MAX_READ_SIZE) <= 0)
return AVERROR(EIO);
pkt->stream_index = 0;
return 0;
} | 27,260 |
qemu | 7385aed20db5d83979f683b9d0048674411e963c | 0 | void helper_fitoq(CPUSPARCState *env, int32_t src)
{
/* No possible exceptions converting int to long double. */
QT0 = int32_to_float128(src, &env->fp_status);
}
| 27,262 |
qemu | d0d7708ba29cbcc343364a46bff981e0ff88366f | 0 | int gdbserver_start(const char *device)
{
GDBState *s;
char gdbstub_device_name[128];
CharDriverState *chr = NULL;
CharDriverState *mon_chr;
if (!device)
return -1;
if (strcmp(device, "none") != 0) {
if (strstart(device, "tcp:", NULL)) {
/* enforce require... | 27,263 |
qemu | eb700029c7836798046191d62d595363d92c84d4 | 0 | net_checksum_add_iov(const struct iovec *iov, const unsigned int iov_cnt,
uint32_t iov_off, uint32_t size)
{
size_t iovec_off, buf_off;
unsigned int i;
uint32_t res = 0;
uint32_t seq = 0;
iovec_off = 0;
buf_off = 0;
for (i = 0; i < iov_cnt && size; i++) {
... | 27,265 |
qemu | 54bf36ed351c526cde0c853079f9ff1ab7e2ff89 | 0 | static inline int get_phys_addr(CPUARMState *env, target_ulong address,
int access_type, int is_user,
hwaddr *phys_ptr, int *prot,
target_ulong *page_size)
{
/* This is not entirely correct as get_phys_addr() can al... | 27,267 |
qemu | 1960966d1b57628f730b66fe33cd2005846092e0 | 0 | DriveInfo *drive_init(QemuOpts *opts, int default_to_scsi, int *fatal_error)
{
const char *buf;
const char *file = NULL;
char devname[128];
const char *serial;
const char *mediastr = "";
BlockInterfaceType type;
enum { MEDIA_DISK, MEDIA_CDROM } media;
int bus_id, unit_id;
i... | 27,268 |
qemu | b3db211f3c80bb996a704d665fe275619f728bd4 | 0 | static void test_visitor_in_struct(TestInputVisitorData *data,
const void *unused)
{
TestStruct *p = NULL;
Visitor *v;
v = visitor_input_test_init(data, "{ 'integer': -42, 'boolean': true, 'string': 'foo' }");
visit_type_TestStruct(v, NULL, &p, &error_abort);... | 27,270 |
qemu | 393a98924eb00df76231384b86652e1d5f964d67 | 0 | static int msix_add_config(struct PCIDevice *pdev, unsigned short nentries,
unsigned bar_nr, unsigned bar_size)
{
int config_offset;
uint8_t *config;
uint32_t new_size;
if (nentries < 1 || nentries > PCI_MSIX_FLAGS_QSIZE + 1)
return -EINVAL;
if (bar_size ... | 27,271 |
qemu | 2f4d0f5990ede025720e41fa473029e9ca85e8b8 | 0 | void qmp_memsave(int64_t addr, int64_t size, const char *filename,
bool has_cpu, int64_t cpu_index, Error **errp)
{
FILE *f;
uint32_t l;
CPUState *cpu;
uint8_t buf[1024];
if (!has_cpu) {
cpu_index = 0;
}
cpu = qemu_get_cpu(cpu_index);
if (cpu == NU... | 27,273 |
qemu | 4098d49db549e20a2d87ca3cced28ace6e5864bf | 0 | static void xen_platform_class_init(ObjectClass *klass, void *data)
{
DeviceClass *dc = DEVICE_CLASS(klass);
PCIDeviceClass *k = PCI_DEVICE_CLASS(klass);
k->init = xen_platform_initfn;
k->vendor_id = PCI_VENDOR_ID_XEN;
k->device_id = PCI_DEVICE_ID_XEN_PLATFORM;
k->class_id = PCI_CLASS_O... | 27,274 |
qemu | 62112d181ca33fea976100c4335dfc3e2f727e6c | 0 | int net_init_slirp(QemuOpts *opts,
Monitor *mon,
const char *name,
VLANState *vlan)
{
struct slirp_config_str *config;
const char *vhost;
const char *vhostname;
const char *vdhcp_start;
const char *vnamesrv;
const char *tftp_expo... | 27,277 |
qemu | 30ca440eec9fe1d7eec5a48addac656438778278 | 0 | static QOSState *qvirtio_9p_start(void)
{
const char *cmd = "-fsdev local,id=fsdev0,security_model=none,path=%s "
"-device virtio-9p-pci,fsdev=fsdev0,mount_tag=%s";
test_share = g_strdup("/tmp/qtest.XXXXXX");
g_assert_nonnull(mkdtemp(test_share));
return qtest_pc_boot(cmd... | 27,278 |
qemu | 6f442fe83821a06c5408056c7879e83a74f2ff32 | 1 | static void test_read_without_media(void)
{
uint8_t ret;
ret = send_read_command();
g_assert(ret == 0);
}
| 27,279 |
qemu | 4f298a4b2957b7833bc607c951ca27c458d98d88 | 1 | static void set_acpi_power_state(IPMIBmcSim *ibs,
uint8_t *cmd, unsigned int cmd_len,
uint8_t *rsp, unsigned int *rsp_len,
unsigned int max_rsp_len)
{
IPMI_CHECK_CMD_LEN(4);
ibs->acpi_power_state[0] = cmd[2];
ibs->acpi_powe... | 27,280 |
qemu | cd7bc87868d534f95e928cad98e2a52df7695771 | 1 | static void usb_uas_unrealize(USBDevice *dev, Error **errp)
{
UASDevice *uas = USB_UAS(dev);
qemu_bh_delete(uas->status_bh);
} | 27,281 |
FFmpeg | c89658008705d949c319df3fa6f400c481ad73e1 | 0 | static int sdp_parse(AVFormatContext *s, const char *content)
{
const char *p;
int letter;
/* Some SDP lines, particularly for Realmedia or ASF RTSP streams,
* contain long SDP lines containing complete ASF Headers (several
* kB) or arrays of MDPR (RM stream descriptor) headers plus
* ... | 27,282 |
FFmpeg | aaa7d2fafcc375d8cdef25a289008821c9c2fbaa | 1 | static void flush_change(H264Context *h)
{
h->outputed_poc = h->next_outputed_poc = INT_MIN;
h->prev_interlaced_frame = 1;
idr(h);
h->prev_frame_num = -1;
if (h->s.current_picture_ptr)
h->s.current_picture_ptr->f.reference = 0;
h->s.first_field = 0;
memset(h->ref_list[0], 0,... | 27,283 |
qemu | 3a661f1eabf7e8db66e28489884d9b54aacb94ea | 1 | int qcrypto_cipher_decrypt(QCryptoCipher *cipher,
const void *in,
void *out,
size_t len,
Error **errp)
{
QCryptoCipherNettle *ctx = cipher->opaque;
switch (cipher->mode) {
case QCRYPTO_CIPHE... | 27,284 |
qemu | e7c8526b2a1482a9b14319fda9f8ad4bfda5b958 | 1 | static void ahci_migrate(AHCIQState *from, AHCIQState *to, const char *uri)
{
QOSState *tmp = to->parent;
QPCIDevice *dev = to->dev;
char *uri_local = NULL;
if (uri == NULL) {
uri_local = g_strdup_printf("%s%s", "unix:", mig_socket);
uri = uri_local;
}
/* context wil... | 27,285 |
qemu | 53510bfc1256711365cd2a841649f3ad5a79790f | 1 | static int kvm_virtio_pci_vq_vector_unmask(VirtIOPCIProxy *proxy,
unsigned int queue_no,
unsigned int vector,
MSIMessage msg)
{
VirtQueue *vq = virtio_get_queue(proxy->vdev, queue_no);
E... | 27,286 |
qemu | 273e4e03b3413fd489601cd9d8ba407ccb3b4130 | 1 | static int vvfat_open(BlockDriverState *bs, const char* dirname, int flags)
{
BDRVVVFATState *s = bs->opaque;
int floppy = 0;
int i;
#ifdef DEBUG
vvv = s;
#endif
DLOG(if (stderr == NULL) {
stderr = fopen("vvfat.log", "a");
setbuf(stderr, NULL);
})
s->bs = bs;
s->fat_... | 27,287 |
qemu | 619d7ae952bb61ec27ec21fe4a383a8d4dd4cd70 | 1 | VirtIODevice *virtio_scsi_init(DeviceState *dev, VirtIOSCSIConf *proxyconf)
{
VirtIOSCSI *s;
static int virtio_scsi_id;
size_t sz;
int i;
sz = sizeof(VirtIOSCSI) + proxyconf->num_queues * sizeof(VirtQueue *);
s = (VirtIOSCSI *)virtio_common_init("virtio-scsi", VIRTIO_ID_SCSI,
... | 27,288 |
FFmpeg | f9158b01d0f3effb58e87fb07db0382bc1e47de5 | 1 | static ResampleContext *resample_init(ResampleContext *c, int out_rate, int in_rate, int filter_size, int phase_shift, int linear,
double cutoff0, enum AVSampleFormat format, enum SwrFilterType filter_type, int kaiser_beta,
double precision, int ch... | 27,289 |
qemu | 0380aef323154205a7d838fb9953423621290d41 | 1 | static void test_properties(const char *path)
{
char *child_path;
QDict *response, *tuple;
QList *list;
QListEntry *entry;
g_test_message("Obtaining properties of %s", path);
response = qmp("{ 'execute': 'qom-list',"
" 'arguments': { 'path': '%s' } }", path);
g... | 27,291 |
FFmpeg | 3ca5df36a50e3ffd3b24734725bf545617a627a8 | 1 | static int decode_packet(AVCodecContext *avctx, void *data, int *got_frame_ptr,
AVPacket* avpkt)
{
WmallDecodeCtx *s = avctx->priv_data;
GetBitContext* gb = &s->pgb;
const uint8_t* buf = avpkt->data;
int buf_size = avpkt->size;
int num_bits_prev_frame, packet_s... | 27,292 |
FFmpeg | 60fcc19b9068614f25cf64dff5e4aa0e8dbff6a5 | 1 | static void mpegts_write_pes(AVFormatContext *s, AVStream *st,
const uint8_t *payload, int payload_size,
int64_t pts, int64_t dts, int key)
{
MpegTSWriteStream *ts_st = st->priv_data;
MpegTSWrite *ts = s->priv_data;
uint8_t buf[TS_PACKET_SIZE];... | 27,293 |
FFmpeg | 93f4538363069b721c24417f3d38575274394845 | 0 | static void RENAME(postProcess)(const uint8_t src[], int srcStride, uint8_t dst[], int dstStride, int width, int height,
const QP_STORE_T QPs[], int QPStride, int isColor, PPContext *c2)
{
DECLARE_ALIGNED(8, PPContext, c)= *c2; //copy to stack for faster access
int x,y;
#ifd... | 27,294 |
FFmpeg | 432fe9a38afca9104c1c11942d21739e2a48ba96 | 1 | static char *choose_pix_fmts(OutputStream *ost)
{
if (ost->keep_pix_fmt) {
if (ost->filter)
avfilter_graph_set_auto_convert(ost->filter->graph->graph,
AVFILTER_AUTO_CONVERT_NONE);
if (ost->st->codec->pix_fmt == PIX_FMT_NONE)
... | 27,295 |
FFmpeg | a23379a0a68a6dd9a0e0d583e11b0c6f9b33f9ae | 0 | static int xiph_handle_packet(AVFormatContext *ctx, PayloadContext *data,
AVStream *st, AVPacket *pkt, uint32_t *timestamp,
const uint8_t *buf, int len, uint16_t seq,
int flags)
{
int ident, fragmented, tdt, num_pkts, p... | 27,297 |
FFmpeg | 37f573543c4fd7f44339e04d8d15b95118493ddd | 0 | static int check_image_pointers(uint8_t *data[4], enum AVPixelFormat pix_fmt,
const int linesizes[4])
{
const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt);
int i;
for (i = 0; i < 4; i++) {
int plane = desc->comp[i].plane;
if (!data[plane] |... | 27,298 |
FFmpeg | ae591aeea58d64399b8281be31dacec0de85ae04 | 0 | static void vc1_mc_4mv_luma(VC1Context *v, int n, int dir)
{
MpegEncContext *s = &v->s;
DSPContext *dsp = &v->s.dsp;
uint8_t *srcY;
int dxy, mx, my, src_x, src_y;
int off;
int fieldmv = (v->fcm == ILACE_FRAME) ? v->blk_mv_type[s->block_index[n]] : 0;
int v_edge_pos = s->v_edge_pos >>... | 27,299 |
qemu | a03ef88f77af045a2eb9629b5ce774a3fb973c5e | 0 | int coroutine_fn blk_co_pwritev(BlockBackend *blk, int64_t offset,
unsigned int bytes, QEMUIOVector *qiov,
BdrvRequestFlags flags)
{
int ret;
trace_blk_co_pwritev(blk, blk_bs(blk), offset, bytes, flags);
ret = blk_check_byte_request(b... | 27,300 |
qemu | 23fabed13645fdf66473e458f318baa63be56b22 | 0 | void monitor_protocol_event(MonitorEvent event, QObject *data)
{
QDict *qmp;
const char *event_name;
Monitor *mon;
assert(event < QEVENT_MAX);
switch (event) {
case QEVENT_DEBUG:
event_name = "DEBUG";
break;
case QEVENT_SHUTDOWN:
eve... | 27,301 |
qemu | 903585dec63ee83bd8149006e31f92ea789b38e3 | 0 | static int ppce500_prep_device_tree(MachineState *machine,
PPCE500Params *params,
hwaddr addr,
hwaddr initrd_base,
hwaddr initrd_size)
{
DeviceTreeParams *p = g_new(D... | 27,302 |
qemu | 61007b316cd71ee7333ff7a0a749a8949527575f | 0 | int bdrv_ioctl(BlockDriverState *bs, unsigned long int req, void *buf)
{
BlockDriver *drv = bs->drv;
if (drv && drv->bdrv_ioctl)
return drv->bdrv_ioctl(bs, req, buf);
return -ENOTSUP;
}
| 27,303 |
qemu | ac1970fbe8ad5a70174f462109ac0f6c7bf1bc43 | 0 | void tb_invalidate_phys_addr(target_phys_addr_t addr)
{
ram_addr_t ram_addr;
MemoryRegionSection *section;
section = phys_page_find(addr >> TARGET_PAGE_BITS);
if (!(memory_region_is_ram(section->mr)
|| (section->mr->rom_device && section->mr->readable))) {
return;
}
... | 27,304 |
qemu | 4be746345f13e99e468c60acbd3a355e8183e3ce | 0 | static void scsi_generic_realize(SCSIDevice *s, Error **errp)
{
int rc;
int sg_version;
struct sg_scsi_id scsiid;
if (!s->conf.bs) {
error_setg(errp, "drive property not set");
return;
}
if (bdrv_get_on_error(s->conf.bs, 0) != BLOCKDEV_ON_ERROR_ENOSPC) {
err... | 27,305 |
FFmpeg | 84be80698227366d970e045001e4b59e4f99f0a1 | 0 | static void pool_release_buffer(void *opaque, uint8_t *data)
{
BufferPoolEntry *buf = opaque;
AVBufferPool *pool = buf->pool;
if(CONFIG_MEMORY_POISONING)
memset(buf->data, 0x2a, pool->size);
add_to_pool(buf);
if (!avpriv_atomic_int_add_and_fetch(&pool->refcount, -1))
buff... | 27,306 |
qemu | 3aa80988430f41847e1b78d165440ac03503b6d0 | 0 | static void dec_load(DisasContext *dc)
{
TCGv t, *addr;
unsigned int size;
size = 1 << (dc->opcode & 3);
LOG_DIS("l %x %d\n", dc->opcode, size);
t_sync_flags(dc);
addr = compute_ldst_addr(dc, &t);
/* If we get a fault on a dslot, the jmpstate better be in sync. */
sync_jm... | 27,307 |
qemu | 920557971b60e53c2f3f22e5d6c620ab1ed411fd | 0 | void ich9_lpc_pm_init(PCIDevice *lpc_pci, bool smm_enabled)
{
ICH9LPCState *lpc = ICH9_LPC_DEVICE(lpc_pci);
qemu_irq sci_irq;
sci_irq = qemu_allocate_irq(ich9_set_sci, lpc, 0);
ich9_pm_init(lpc_pci, &lpc->pm, smm_enabled, sci_irq);
ich9_lpc_reset(&lpc->d.qdev);
}
| 27,308 |
qemu | 185698715dfb18c82ad2a5dbc169908602d43e81 | 0 | uint64_t helper_fctiw (uint64_t arg)
{
CPU_DoubleU farg;
farg.ll = arg;
if (unlikely(float64_is_signaling_nan(farg.d))) {
/* sNaN conversion */
farg.ll = fload_invalid_op_excp(POWERPC_EXCP_FP_VXSNAN | POWERPC_EXCP_FP_VXCVI);
} else if (unlikely(float64_is_nan(farg.d) || float64_... | 27,309 |
qemu | 347a5c73bafd1b5872c9d3192a4d08f8aa1d5f5a | 0 | static int ppc_hash64_pte_prot(PowerPCCPU *cpu,
ppc_slb_t *slb, ppc_hash_pte64_t pte)
{
CPUPPCState *env = &cpu->env;
unsigned pp, key;
/* Some pp bit combinations have undefined behaviour, so default
* to no access in those cases */
int prot = 0;
key = ... | 27,310 |
qemu | a8170e5e97ad17ca169c64ba87ae2f53850dab4c | 0 | static void exynos4210_mct_write(void *opaque, target_phys_addr_t offset,
uint64_t value, unsigned size)
{
Exynos4210MCTState *s = (Exynos4210MCTState *)opaque;
int index; /* index in buffer which represents register set */
int shift;
int lt_i;
uint64_t new_frc;
uint32_t i;
... | 27,312 |
qemu | 1ea879e5580f63414693655fcf0328559cdce138 | 0 | static int no_init_in (HWVoiceIn *hw, audsettings_t *as)
{
audio_pcm_init_info (&hw->info, as);
hw->samples = 1024;
return 0;
}
| 27,313 |
qemu | f74990a5d019751c545e9800a3376b6336e77d38 | 0 | uint32_t HELPER(stfle)(CPUS390XState *env, uint64_t addr)
{
uint64_t words[MAX_STFL_WORDS];
unsigned count_m1 = env->regs[0] & 0xff;
unsigned max_m1 = do_stfle(env, words);
unsigned i;
for (i = 0; i <= count_m1; ++i) {
cpu_stq_data(env, addr + 8 * i, words[i]);
}
env->re... | 27,314 |
qemu | a89f364ae8740dfc31b321eed9ee454e996dc3c1 | 0 | static void pxa2xx_fir_write(void *opaque, hwaddr addr,
uint64_t value64, unsigned size)
{
PXA2xxFIrState *s = (PXA2xxFIrState *) opaque;
uint32_t value = value64;
uint8_t ch;
switch (addr) {
case ICCR0:
s->control[0] = value;
if (!(value & (1 ... | 27,315 |
qemu | 39fb730aed8c5f7b0058845cb9feac0d4b177985 | 0 | static void disas_thumb_insn(CPUARMState *env, DisasContext *s)
{
uint32_t val, insn, op, rm, rn, rd, shift, cond;
int32_t offset;
int i;
TCGv_i32 tmp;
TCGv_i32 tmp2;
TCGv_i32 addr;
if (s->condexec_mask) {
cond = s->condexec_cond;
if (cond != 0x0e) { /* Skip c... | 27,316 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.