project stringclasses 2
values | commit_id stringlengths 40 40 | target int64 0 1 | func stringlengths 26 142k | idx int64 0 27.3k |
|---|---|---|---|---|
qemu | f0c9d64a68b776374ec4732424a3e27753ce37b6 | 1 | void acpi_pcihp_init(Object *owner, AcpiPciHpState *s, PCIBus *root_bus,
MemoryRegion *address_space_io, bool bridges_enabled)
{
s->io_len = ACPI_PCIHP_SIZE;
s->io_base = ACPI_PCIHP_ADDR;
s->root= root_bus;
s->legacy_piix = !bridges_enabled;
if (s->legacy_piix) {
... | 13,336 |
FFmpeg | 1ee8fadb811f3b1ef370c7d6c7bf62088f1cc954 | 1 | paint_mouse_pointer(XImage *image, struct x11grab *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 pixstride = image->... | 13,338 |
qemu | d470ad42acfc73c45d3e8ed5311a491160b4c100 | 1 | int coroutine_fn bdrv_co_pdiscard(BlockDriverState *bs, int64_t offset,
int bytes)
{
BdrvTrackedRequest req;
int max_pdiscard, ret;
int head, tail, align;
return -ENOMEDIUM;
if (bdrv_has_readonly_bitmaps(bs)) {
return -EPERM;
ret = ... | 13,340 |
FFmpeg | 31fe3c4d23aab8b43614b1ea825603080775677e | 1 | int ff_mediacodec_dec_close(AVCodecContext *avctx, MediaCodecDecContext *s)
{
if (s->codec) {
ff_AMediaCodec_delete(s->codec);
s->codec = NULL;
}
if (s->format) {
ff_AMediaFormat_delete(s->format);
s->format = NULL;
}
return 0;
} | 13,341 |
qemu | 66a08cbe6ad1aebec8eecf58b3ba042e19dd1649 | 1 | static void uhci_async_validate_end(UHCIState *s)
{
UHCIQueue *queue, *n;
QTAILQ_FOREACH_SAFE(queue, &s->queues, next, n) {
if (!queue->valid) {
uhci_queue_free(queue);
}
}
}
| 13,342 |
FFmpeg | 73f863d751df84db7a0ca1bd83cdff1b95dc94dd | 1 | static int fic_decode_frame(AVCodecContext *avctx, void *data,
int *got_frame, AVPacket *avpkt)
{
FICContext *ctx = avctx->priv_data;
uint8_t *src = avpkt->data;
int ret;
int slice, nslices;
int msize;
int tsize;
int cur_x, cur_y;
int skip_cursor = c... | 13,343 |
qemu | b4ba67d9a702507793c2724e56f98e9b0f7be02b | 1 | static void cdrom_pio_impl(int nblocks)
{
QPCIDevice *dev;
void *bmdma_base, *ide_base;
FILE *fh;
int patt_blocks = MAX(16, nblocks);
size_t patt_len = ATAPI_BLOCK_SIZE * patt_blocks;
char *pattern = g_malloc(patt_len);
size_t rxsize = ATAPI_BLOCK_SIZE * nblocks;
uint16_t *rx = ... | 13,344 |
FFmpeg | 816577716bc6170bccfea3b9e865618b69a4b426 | 1 | static int append_to_cached_buf(AVCodecContext *avctx,
const uint8_t *buf, int buf_size)
{
DVDSubContext *ctx = avctx->priv_data;
if (ctx->buf_size > 0xffff - buf_size) {
av_log(avctx, AV_LOG_WARNING, "Attempt to reconstruct "
"too large SPU packets... | 13,345 |
qemu | ef546f1275f6563e8934dd5e338d29d9f9909ca6 | 0 | static RxFilterInfo *virtio_net_query_rxfilter(NetClientState *nc)
{
VirtIONet *n = qemu_get_nic_opaque(nc);
VirtIODevice *vdev = VIRTIO_DEVICE(n);
RxFilterInfo *info;
strList *str_list, *entry;
int i;
info = g_malloc0(sizeof(*info));
info->name = g_strdup(nc->name);
info->pro... | 13,348 |
qemu | 304ee9174f4761d3f4da611352a815ab27baba06 | 0 | static inline int64_t get_sector_offset(BlockDriverState *bs,
int64_t sector_num, int write)
{
BDRVVPCState *s = bs->opaque;
uint64_t offset = sector_num * 512;
uint64_t bitmap_offset, block_offset;
uint32_t pagetable_index, pageentry_index;
pagetable_index = offset / s->block_size;
... | 13,349 |
FFmpeg | 4cb6964244fd6c099383d8b7e99731e72cc844b9 | 0 | av_cold void ff_dcadsp_init_x86(DCADSPContext *s)
{
int cpu_flags = av_get_cpu_flags();
if (EXTERNAL_SSE(cpu_flags)) {
#if ARCH_X86_32
s->int8x8_fmul_int32 = ff_int8x8_fmul_int32_sse;
#endif
s->lfe_fir[0] = ff_dca_lfe_fir0_sse;
s->lfe_fir[1] = ff_dca_lfe_fir1_sse;... | 13,350 |
qemu | a03ef88f77af045a2eb9629b5ce774a3fb973c5e | 0 | vpc_co_preadv(BlockDriverState *bs, uint64_t offset, uint64_t bytes,
QEMUIOVector *qiov, int flags)
{
BDRVVPCState *s = bs->opaque;
int ret;
int64_t image_offset;
int64_t n_bytes;
int64_t bytes_done = 0;
VHDFooter *footer = (VHDFooter *) s->footer_buf;
QEMUIOVector loc... | 13,351 |
qemu | e1833e1f96456fd8fc17463246fe0b2050e68efb | 0 | void do_store_dcr (void)
{
if (unlikely(env->dcr_env == NULL)) {
if (loglevel != 0) {
fprintf(logfile, "No DCR environment\n");
}
do_raise_exception_err(EXCP_PROGRAM, EXCP_INVAL | EXCP_INVAL_INVAL);
} else if (unlikely(ppc_dcr_write(env->dcr_env, T0, T1) != 0)) {
... | 13,352 |
qemu | 65afd211c71fc91750d8a18f9604c1e57a5202fb | 0 | static int coroutine_fn bdrv_aligned_pwritev(BlockDriverState *bs,
int64_t offset, unsigned int bytes, QEMUIOVector *qiov, int flags)
{
BlockDriver *drv = bs->drv;
BdrvTrackedRequest req;
int ret;
int64_t sector_num = offset >> BDRV_SECTOR_BITS;
unsigned int nb_sectors = bytes >> BDRV_S... | 13,353 |
qemu | f090c9d4ad5812fb92843d6470a1111c15190c4c | 0 | INLINE flag extractFloat64Sign( float64 a )
{
return a>>63;
}
| 13,354 |
qemu | b02ef3d92b19ad304a84433d3817f0903296ebc7 | 0 | static void read_storage_element1_info(SCLPDevice *sclp, SCCB *sccb)
{
ReadStorageElementInfo *storage_info = (ReadStorageElementInfo *) sccb;
sclpMemoryHotplugDev *mhd = get_sclp_memory_hotplug_dev();
assert(mhd);
if ((mhd->standby_mem_size >> mhd->increment_size) >= 0x10000) {
sccb->... | 13,355 |
qemu | 3f26c1227e3b08010f2a65379cecf4cb4b5933fa | 0 | uint32_t HELPER(get_cp15)(CPUState *env, uint32_t insn)
{
cpu_abort(env, "cp15 insn %08x\n", insn);
return 0;
}
| 13,356 |
qemu | eabb7b91b36b202b4dac2df2d59d698e3aff197a | 0 | static void tcg_out_st(TCGContext *s, TCGType type, TCGReg arg, TCGReg arg1,
intptr_t arg2)
{
uint8_t *old_code_ptr = s->code_ptr;
if (type == TCG_TYPE_I32) {
tcg_out_op_t(s, INDEX_op_st_i32);
tcg_out_r(s, arg);
tcg_out_r(s, arg1);
tcg_out32(s, arg2... | 13,358 |
qemu | b6dcbe086c77ec683f5ff0b693593cda1d61f3a1 | 0 | static void sdram_unmap_bcr (ppc4xx_sdram_t *sdram)
{
int i;
for (i = 0; i < sdram->nbanks; i++) {
#ifdef DEBUG_SDRAM
printf("%s: Unmap RAM area " TARGET_FMT_plx " " TARGET_FMT_lx "\n",
__func__, sdram_base(sdram->bcr[i]), sdram_size(sdram->bcr[i]));
#endif
cpu_register_... | 13,359 |
qemu | 91cda45b69e45a089f9989979a65db3f710c9925 | 0 | static int find_pte64(CPUPPCState *env, struct mmu_ctx_hash64 *ctx, int h,
int rw, int type, int target_page_bits)
{
hwaddr pteg_off;
target_ulong pte0, pte1;
int i, good = -1;
int ret, r;
ret = -1; /* No entry found */
pteg_off = (ctx->hash[h] * HASH_PTEG_SIZE_64... | 13,362 |
qemu | 88b062c2036cfd05b5111147736a08ba05ea05a9 | 0 | int qed_read_l2_table_sync(BDRVQEDState *s, QEDRequest *request, uint64_t offset)
{
int ret = -EINPROGRESS;
qed_read_l2_table(s, request, offset, qed_sync_cb, &ret);
while (ret == -EINPROGRESS) {
aio_poll(bdrv_get_aio_context(s->bs), true);
}
return ret;
}
| 13,364 |
qemu | b9bec74bcb16519a876ec21cd5277c526a9b512d | 0 | static void kvm_getput_reg(__u64 *kvm_reg, target_ulong *qemu_reg, int set)
{
if (set)
*kvm_reg = *qemu_reg;
else
*qemu_reg = *kvm_reg;
}
| 13,368 |
qemu | 7b7258f810d2bd40e2fb99c469c5db318d6c3d92 | 0 | static bool sensor_type_is_dr(uint32_t sensor_type)
{
switch (sensor_type) {
case RTAS_SENSOR_TYPE_ISOLATION_STATE:
case RTAS_SENSOR_TYPE_DR:
case RTAS_SENSOR_TYPE_ALLOCATION_STATE:
return true;
}
return false;
}
| 13,369 |
qemu | a8170e5e97ad17ca169c64ba87ae2f53850dab4c | 0 | static uint64_t omap_mpuio_read(void *opaque, target_phys_addr_t addr,
unsigned size)
{
struct omap_mpuio_s *s = (struct omap_mpuio_s *) opaque;
int offset = addr & OMAP_MPUI_REG_MASK;
uint16_t ret;
if (size != 2) {
return omap_badwidth_read16(opaque, add... | 13,370 |
qemu | cbcfa0418f0c196afa765f5c9837b9344d1adcf3 | 0 | int64_t qemu_get_clock_ns(QEMUClock *clock)
{
return 0;
}
| 13,371 |
qemu | a7812ae412311d7d47f8aa85656faadac9d64b56 | 0 | static always_inline void gen_qemu_stf (TCGv t0, TCGv t1, int flags)
{
TCGv tmp = tcg_temp_new(TCG_TYPE_I32);
tcg_gen_helper_1_1(helper_f_to_memory, tmp, t0);
tcg_gen_qemu_st32(tmp, t1, flags);
tcg_temp_free(tmp);
}
| 13,374 |
qemu | b47d8efa9f430c332bf96ce6eede169eb48422ad | 0 | static void vfio_put_group(VFIOGroup *group)
{
if (!QLIST_EMPTY(&group->device_list)) {
return;
}
vfio_kvm_device_del_group(group);
vfio_disconnect_container(group);
QLIST_REMOVE(group, next);
trace_vfio_put_group(group->fd);
close(group->fd);
g_free(group);
if... | 13,376 |
qemu | 8dfbaa6ac450c4ec2646b1ca08a4017052a90c1d | 0 | static void virtio_ccw_start_ioeventfd(VirtioCcwDevice *dev)
{
VirtIODevice *vdev;
int n, r;
if (!(dev->flags & VIRTIO_CCW_FLAG_USE_IOEVENTFD) ||
dev->ioeventfd_disabled ||
dev->ioeventfd_started) {
return;
}
vdev = virtio_bus_get_device(&dev->bus);
for (n = 0... | 13,378 |
qemu | e2b8247a322cd92945785edf25f09e6b3e8285f9 | 0 | void bdrv_set_read_only(BlockDriverState *bs, bool read_only)
{
bs->read_only = read_only;
}
| 13,379 |
qemu | f1ecb913d81199758383b8cbc15f4eb435b91753 | 0 | void HELPER(crypto_aesmc)(CPUARMState *env, uint32_t rd, uint32_t rm,
uint32_t decrypt)
{
static uint32_t const mc[][256] = { {
/* MixColumns lookup table */
0x00000000, 0x03010102, 0x06020204, 0x05030306,
0x0c040408, 0x0f05050a, 0x0a06060c, 0x0907070e,
... | 13,380 |
qemu | a97c67ee6c1546b985c1048c7a1f9e4fc13d9ee1 | 0 | int qcow2_get_cluster_offset(BlockDriverState *bs, uint64_t offset,
int *num, uint64_t *cluster_offset)
{
BDRVQcowState *s = bs->opaque;
unsigned int l2_index;
uint64_t l1_index, l2_offset, *l2_table;
int l1_bits, c;
unsigned int index_in_cluster, nb_clusters;
uint64_t nb_available, ... | 13,381 |
qemu | 364031f17932814484657e5551ba12957d993d7e | 0 | static int v9fs_synth_mkdir(FsContext *fs_ctx, V9fsPath *path,
const char *buf, FsCred *credp)
{
errno = EPERM;
return -1;
}
| 13,382 |
FFmpeg | 3c895fc098f7637f6d5ec3a9d6766e724a8b9e41 | 0 | static int rm_write_packet(AVFormatContext *s, AVPacket *pkt)
{
if (s->streams[pkt->stream_index]->codec.codec_type ==
CODEC_TYPE_AUDIO)
return rm_write_audio(s, pkt->data, pkt->size);
else
return rm_write_video(s, pkt->data, pkt->size);
}
| 13,383 |
qemu | a8170e5e97ad17ca169c64ba87ae2f53850dab4c | 0 | static uint64_t cs_mem_read(void *opaque, target_phys_addr_t addr,
unsigned size)
{
CSState *s = opaque;
uint32_t saddr, ret;
saddr = addr >> 2;
switch (saddr) {
case 1:
switch (CS_RAP(s)) {
case 3: // Write only
ret = 0;
... | 13,384 |
FFmpeg | 2e59142fa9a0db5fab8aa2e676ba524f61280b83 | 0 | static int sctp_write(URLContext *h, const uint8_t *buf, int size)
{
SCTPContext *s = h->priv_data;
int ret;
if (!(h->flags & AVIO_FLAG_NONBLOCK)) {
ret = sctp_wait_fd(s->fd, 1);
if (ret < 0)
return ret;
}
if (s->max_streams) {
/*StreamId is introduc... | 13,386 |
FFmpeg | 631c56a8e46dea41585f3e7b3ef9c52b49faa385 | 0 | int avformat_network_init(void)
{
#if CONFIG_NETWORK
int ret;
ff_network_inited_globally = 1;
if ((ret = ff_network_init()) < 0)
return ret;
if ((ret = ff_tls_init()) < 0)
return ret;
#endif
return 0;
}
| 13,387 |
FFmpeg | 582552fb56ba6559cb1d094a7e7ae5dde3073c5c | 0 | static inline void cvtyuvtoRGB (SwsContext *c,
vector signed short Y, vector signed short U, vector signed short V,
vector signed short *R, vector signed short *G, vector signed short *B)
{
vector signed short vx,ux,uvx;
Y = vec_mradds (Y, c->CY, c->OY);
U = vec_sub (U,(vector signed short... | 13,390 |
FFmpeg | 5c2fb561d94fc51d76ab21d6f7cc5b6cc3aa599c | 0 | static void vaapi_encode_h264_write_sei(PutBitContext *pbc,
VAAPIEncodeContext *ctx,
VAAPIEncodePicture *pic)
{
VAAPIEncodeH264Context *priv = ctx->priv_data;
PutBitContext payload_bits;
char payload[256];
int payload... | 13,391 |
qemu | 0920a17199d23b3def3a60fa1fbbdeadcdda452d | 1 | Visitor *visitor_input_test_init(TestInputVisitorData *data,
const char *json_string, ...)
{
Visitor *v;
va_list ap;
va_start(ap, json_string);
data->obj = qobject_from_jsonv(json_string, &ap);
va_end(ap);
g_assert(data->obj != NULL);
data->qiv... | 13,392 |
qemu | d9bce9d99f4656ae0b0127f7472db9067b8f84ab | 1 | static void dump_syscall(CPUState *env)
{
fprintf(logfile, "syscall r0=0x%08x r3=0x%08x r4=0x%08x "
"r5=0x%08x r6=0x%08x nip=0x%08x\n",
env->gpr[0], env->gpr[3], env->gpr[4],
env->gpr[5], env->gpr[6], env->nip);
}
| 13,393 |
qemu | 7364dbdabb7824d5bde1e341bb6d928282f01c83 | 1 | static int vnc_auth_sasl_check_ssf(VncState *vs)
{
const void *val;
int err, ssf;
if (!vs->sasl.wantSSF)
return 1;
err = sasl_getprop(vs->sasl.conn, SASL_SSF, &val);
if (err != SASL_OK)
return 0;
ssf = *(const int *)val;
VNC_DEBUG("negotiated an SSF of %d\n", ... | 13,394 |
FFmpeg | 5e715b583dab85735660b15a8d217a69164675fe | 1 | static int parse_metadata(DBEContext *s)
{
int i, ret, key = parse_key(s), mtd_size;
if ((ret = convert_input(s, 1, key)) < 0)
return ret;
skip_bits(&s->gb, 4);
mtd_size = get_bits(&s->gb, 10);
if (!mtd_size) {
av_log(s->avctx, AV_LOG_ERROR, "Invalid metadata size\n");
... | 13,395 |
FFmpeg | bfa0f96586fe2c257cfa574ffb991da493a54da1 | 1 | static void vp8_release_frame(VP8Context *s, AVFrame *f, int is_close)
{
if (!is_close) {
if (f->ref_index[0]) {
assert(s->num_maps_to_be_freed < FF_ARRAY_ELEMS(s->segmentation_maps));
s->segmentation_maps[s->num_maps_to_be_freed++] = f->ref_index[0];
f->ref_index[0... | 13,397 |
qemu | 3a03bfa5a219fe06779706315f2555622b51193c | 1 | int qemu_socket(int domain, int type, int protocol)
{
int ret;
#ifdef SOCK_CLOEXEC
ret = socket(domain, type | SOCK_CLOEXEC, protocol);
#else
ret = socket(domain, type, protocol);
if (ret >= 0) {
qemu_set_cloexec(ret);
}
#endif
return ret;
}
| 13,398 |
FFmpeg | 0062869ae25007c8506517dcfcbe6f439dc6958a | 1 | static int smacker_probe(AVProbeData *p)
{
if(p->buf[0] == 'S' && p->buf[1] == 'M' && p->buf[2] == 'K'
&& (p->buf[3] == '2' || p->buf[3] == '4'))
return AVPROBE_SCORE_MAX;
else
return 0;
}
| 13,399 |
FFmpeg | e6c90ce94f1b07f50cea2babf7471af455cca0ff | 0 | static av_noinline void FUNC(hl_decode_mb)(H264Context *h, H264SliceContext *sl)
{
const int mb_x = h->mb_x;
const int mb_y = h->mb_y;
const int mb_xy = h->mb_xy;
const int mb_type = h->cur_pic.mb_type[mb_xy];
uint8_t *dest_y, *dest_cb, *dest_cr;
int linesize, uvlinesize /*dct_off... | 13,400 |
FFmpeg | 803e82276b3716bf6012ec69e8854dae14a4fd2b | 1 | static int hds_write_header(AVFormatContext *s)
{
HDSContext *c = s->priv_data;
int ret = 0, i;
AVOutputFormat *oformat;
mkdir(s->filename, 0777);
oformat = av_guess_format("flv", NULL, NULL);
if (!oformat) {
ret = AVERROR_MUXER_NOT_FOUND;
goto fail;
}
c-... | 13,401 |
qemu | 3977ee5d7a9f2e3664dd8b233f3224694e23b62b | 1 | static int disas_coproc_insn(DisasContext *s, uint32_t insn)
{
int cpnum, is64, crn, crm, opc1, opc2, isread, rt, rt2;
const ARMCPRegInfo *ri;
cpnum = (insn >> 8) & 0xf;
/* First check for coprocessor space used for XScale/iwMMXt insns */
if (arm_dc_feature(s, ARM_FEATURE_XSCALE) && (cpnum... | 13,402 |
FFmpeg | 92ea249d7db4baf64680f412c6bd99ff85860723 | 0 | static inline int round_sample(int64_t *sum)
{
int sum1;
sum1 = (int)((*sum) >> OUT_SHIFT);
*sum &= (1<<OUT_SHIFT)-1;
return av_clip(sum1, OUT_MIN, OUT_MAX);
}
| 13,403 |
qemu | 9807caccd605d09a72495637959568d690e10175 | 0 | bool virtio_is_big_endian(void)
{
#if defined(TARGET_WORDS_BIGENDIAN)
return true;
#else
return false;
#endif
}
| 13,404 |
qemu | eb159d13ee36a9ef2a83e3ab66f1b2ae1cc2d9f1 | 0 | static int check_opt(const CmdArgs *cmd_args, const char *name, QDict *args)
{
if (!cmd_args->optional) {
qerror_report(QERR_MISSING_PARAMETER, name);
return -1;
}
if (cmd_args->type == '-') {
/* handlers expect a value, they need to be changed */
qdict_put(args, na... | 13,405 |
qemu | a0efbf16604770b9d805bcf210ec29942321134f | 0 | static void i440fx_pcihost_get_pci_hole_end(Object *obj, Visitor *v,
const char *name, void *opaque,
Error **errp)
{
I440FXState *s = I440FX_PCI_HOST_BRIDGE(obj);
uint32_t value = s->pci_hole.end;
visit_type_uint... | 13,406 |
qemu | ef546f1275f6563e8934dd5e338d29d9f9909ca6 | 0 | bool vring_enable_notification(VirtIODevice *vdev, Vring *vring)
{
if (vdev->guest_features & (1 << VIRTIO_RING_F_EVENT_IDX)) {
vring_avail_event(&vring->vr) = vring->vr.avail->idx;
} else {
vring_clear_used_flags(vdev, vring, VRING_USED_F_NO_NOTIFY);
}
smp_mb(); /* ensure update ... | 13,407 |
qemu | 185698715dfb18c82ad2a5dbc169908602d43e81 | 0 | void helper_fcmpu (uint64_t arg1, uint64_t arg2, uint32_t crfD)
{
CPU_DoubleU farg1, farg2;
uint32_t ret = 0;
farg1.ll = arg1;
farg2.ll = arg2;
if (unlikely(float64_is_nan(farg1.d) ||
float64_is_nan(farg2.d))) {
ret = 0x01UL;
} else if (float64_lt(farg1.d, far... | 13,408 |
qemu | 97f90cbfe810bb153fc44bde732d9639610783bb | 0 | static void dec_fpu(DisasContext *dc)
{
if ((dc->tb_flags & MSR_EE_FLAG)
&& !(dc->env->pvr.regs[2] & PVR2_ILL_OPCODE_EXC_MASK)
&& !((dc->env->pvr.regs[2] & PVR2_USE_FPU_MASK))) {
tcg_gen_movi_tl(cpu_SR[SR_ESR], ESR_EC_ILLEGAL_OP);
t_gen_raise_exception(dc, EXCP_HW_EXCP);
... | 13,409 |
qemu | 543f8f13e256a081dd820375e9575439b659ccd8 | 0 | static void cdrom_pio_impl(int nblocks)
{
QPCIDevice *dev;
QPCIBar bmdma_bar, ide_bar;
FILE *fh;
int patt_blocks = MAX(16, nblocks);
size_t patt_len = ATAPI_BLOCK_SIZE * patt_blocks;
char *pattern = g_malloc(patt_len);
size_t rxsize = ATAPI_BLOCK_SIZE * nblocks;
uint16_t *rx = g... | 13,410 |
qemu | a8170e5e97ad17ca169c64ba87ae2f53850dab4c | 0 | static uint32_t m5206_mbar_readw(void *opaque, target_phys_addr_t offset)
{
m5206_mbar_state *s = (m5206_mbar_state *)opaque;
int width;
offset &= 0x3ff;
if (offset >= 0x200) {
hw_error("Bad MBAR read offset 0x%x", (int)offset);
}
width = m5206_mbar_width[offset >> 2];
if (w... | 13,411 |
qemu | b3db211f3c80bb996a704d665fe275619f728bd4 | 0 | static void test_visitor_out_bool(TestOutputVisitorData *data,
const void *unused)
{
bool value = true;
QObject *obj;
visit_type_bool(data->ov, NULL, &value, &error_abort);
obj = visitor_get(data);
g_assert(qobject_type(obj) == QTYPE_QBOOL);
g_assert... | 13,412 |
qemu | 18b21a2f83a26c3d6a9e7f0bdc4e8eb2b177e8f6 | 0 | static void do_dcbz(target_ulong addr, int dcache_line_size)
{
addr &= ~(dcache_line_size - 1);
int i;
for (i = 0 ; i < dcache_line_size ; i += 4) {
stl(addr + i , 0);
}
if (env->reserve == addr)
env->reserve = (target_ulong)-1ULL;
}
| 13,413 |
FFmpeg | f44b08a5a0ee46b52a9a608cbf2d075eab93db61 | 0 | static void render_slice(Vp3DecodeContext *s, int slice)
{
int x, y;
int m, n;
int i; /* indicates current fragment */
int16_t *dequantizer;
DCTELEM __align16 block[64];
unsigned char *output_plane;
unsigned char *last_plane;
unsigned char *golden_plane;
int stride;
i... | 13,414 |
qemu | d14a68b6dc0cc01ddd4c1c7c5907b95c3938679c | 0 | match_insn_m68k (bfd_vma memaddr,
disassemble_info * info,
const struct m68k_opcode * best,
struct private * priv)
{
unsigned char *save_p;
unsigned char *p;
const char *d;
bfd_byte *buffer = priv->the_buffer;
fprintf_ftype save_printer = info->fprintf_func;
void (* save_print_address) ... | 13,416 |
qemu | 8a5956ad6392f115521dad774055c737c49fb0dd | 0 | static void rcu_qtest_init(void)
{
struct list_element *new_el;
int i;
nthreadsrunning = 0;
srand(time(0));
for (i = 0; i < RCU_Q_LEN; i++) {
new_el = g_new(struct list_element, 1);
new_el->val = i;
QLIST_INSERT_HEAD_RCU(&Q_list_head, new_el, entry);
}
atom... | 13,417 |
qemu | d1b4259f1ab18af24e6a297edb6a8f71691f3256 | 0 | static void virtio_ccw_bus_class_init(ObjectClass *klass, void *data)
{
VirtioBusClass *k = VIRTIO_BUS_CLASS(klass);
BusClass *bus_class = BUS_CLASS(klass);
bus_class->max_dev = 1;
k->notify = virtio_ccw_notify;
k->vmstate_change = virtio_ccw_vmstate_change;
k->query_guest_notifiers = v... | 13,418 |
qemu | 57407ea44cc0a3d630b9b89a2be011f1955ce5c1 | 0 | static void lan9118_cleanup(NetClientState *nc)
{
lan9118_state *s = qemu_get_nic_opaque(nc);
s->nic = NULL;
}
| 13,419 |
qemu | 4efe27556dea874030f1cd53a6d70452ee064fba | 0 | void pci_cirrus_vga_init(PCIBus *bus, DisplayState *ds, uint8_t *vga_ram_base,
unsigned long vga_ram_offset, int vga_ram_size)
{
PCICirrusVGAState *d;
uint8_t *pci_conf;
CirrusVGAState *s;
int device_id;
device_id = CIRRUS_ID_CLGD5446;
/* setup PCI configurat... | 13,420 |
qemu | a178274efabcbbc5d44805b51def874e47051325 | 0 | static void spapr_io_write(void *opaque, hwaddr addr,
uint64_t data, unsigned size)
{
switch (size) {
case 1:
cpu_outb(addr, data);
return;
case 2:
cpu_outw(addr, data);
return;
case 4:
cpu_outl(addr, data);
return;
... | 13,421 |
qemu | 8cfacf079047c50d272ce64e45a78d816db8b36e | 0 | static int scsi_disk_emulate_inquiry(SCSIRequest *req, uint8_t *outbuf)
{
SCSIDiskState *s = DO_UPCAST(SCSIDiskState, qdev, req->dev);
int buflen = 0;
if (req->cmd.buf[1] & 0x2) {
/* Command support data - optional, not implemented */
BADF("optional INQUIRY command support request no... | 13,422 |
qemu | eed2bacfd2519e45498b585a147f11b0fd01c3c7 | 0 | static AddressSpace *memory_region_to_address_space(MemoryRegion *mr)
{
AddressSpace *as;
while (mr->container) {
mr = mr->container;
}
QTAILQ_FOREACH(as, &address_spaces, address_spaces_link) {
if (mr == as->root) {
return as;
}
}
abort();
}
| 13,423 |
FFmpeg | c49c5e23dc3fb273b46440656f74d416bcc9ab41 | 0 | static void bastardized_rice_decompress(ALACContext *alac,
int32_t *output_buffer,
int output_size,
int readsamplesize, /* arg_10 */
int rice_initialhistory, /* arg424->b */
... | 13,425 |
qemu | 504e56ebdca53bf8e8d379aa994e90a2e3b0d564 | 0 | void OPPROTO op_int_im(void)
{
EIP = PARAM1;
raise_exception(EXCP0D_GPF);
}
| 13,428 |
qemu | 7d1b0095bff7157e856d1d0e6c4295641ced2752 | 1 | static inline TCGv gen_ld16s(TCGv addr, int index)
{
TCGv tmp = new_tmp();
tcg_gen_qemu_ld16s(tmp, addr, index);
return tmp;
}
| 13,430 |
FFmpeg | b88be742fac7a77a8095e8155ba8790db4b77568 | 1 | static av_cold int vc2_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
const AVFrame *frame, int *got_packet_ptr)
{
int ret;
int max_frame_bytes, sig_size = 256;
VC2EncContext *s = avctx->priv_data;
const char aux_data[] = LIBAVCODEC_IDENT;
const int... | 13,431 |
qemu | 898248a32915024a4f01ce4f0c3519509fb703cb | 1 | static inline int xhci_running(XHCIState *xhci)
{
return !(xhci->usbsts & USBSTS_HCH) && !xhci->intr[0].er_full;
}
| 13,432 |
qemu | a33eda0dd99e00faa3bacae43d19490bb9500e07 | 1 | static int local_utimensat(FsContext *s, V9fsPath *fs_path,
const struct timespec *buf)
{
char *buffer;
int ret;
char *path = fs_path->data;
buffer = rpath(s, path);
ret = qemu_utimens(buffer, buf);
g_free(buffer);
return ret;
}
| 13,433 |
qemu | 1f51470d044852592922f91000e741c381582cdc | 1 | static int qemu_chr_open_stdio(QemuOpts *opts, CharDriverState **_chr)
{
CharDriverState *chr;
if (stdio_nb_clients >= STDIO_MAX_CLIENTS) {
return -EBUSY;
}
if (stdio_nb_clients == 0) {
old_fd0_flags = fcntl(0, F_GETFL);
tcgetattr (0, &oldtty);
fcntl(0, F_SET... | 13,434 |
qemu | 5839e53bbc0fec56021d758aab7610df421ed8c8 | 1 | static int qemu_gluster_reopen_prepare(BDRVReopenState *state,
BlockReopenQueue *queue, Error **errp)
{
int ret = 0;
BDRVGlusterReopenState *reop_s;
GlusterConf *gconf = NULL;
int open_flags = 0;
assert(state != NULL);
assert(state->bs != NULL);
... | 13,435 |
FFmpeg | 4ff94558f23a5de43aed4ca3429963dd1d995250 | 1 | static void cabac_reinit(HEVCLocalContext *lc)
{
skip_bytes(&lc->cc, 0);
}
| 13,436 |
FFmpeg | 636ced8e1dc8248a1353b416240b93d70ad03edb | 1 | static int write_option(void *optctx, const OptionDef *po, const char *opt,
const char *arg)
{
/* new-style options contain an offset into optctx, old-style address of
* a global var*/
void *dst = po->flags & (OPT_OFFSET | OPT_SPEC) ?
(uint8_t *)optctx + po->u.... | 13,438 |
qemu | 81174dae3f9189519cd60c7b79e91c291b021bbe | 1 | static uint32_t serial_ioport_read(void *opaque, uint32_t addr)
{
SerialState *s = opaque;
uint32_t ret;
addr &= 7;
switch(addr) {
default:
case 0:
if (s->lcr & UART_LCR_DLAB) {
ret = s->divider & 0xff;
} else {
ret = s->rbr;
s->l... | 13,439 |
qemu | ee640c625e190a0c0e6b8966adc0e4720fb75200 | 1 | e1000e_init_msix(E1000EState *s)
{
PCIDevice *d = PCI_DEVICE(s);
int res = msix_init(PCI_DEVICE(s), E1000E_MSIX_VEC_NUM,
&s->msix,
E1000E_MSIX_IDX, E1000E_MSIX_TABLE,
&s->msix,
E1000E_MSIX_IDX, E1000E_MSIX_PBA... | 13,440 |
FFmpeg | 857cd1f33bcf86005529af2a77f861f884327be5 | 0 | static int RENAME(resample_linear)(ResampleContext *c,
DELEM *dst, const DELEM *src,
int n, int update_ctx)
{
int dst_index;
int index= c->index;
int frac= c->frac;
int sample_index = index >> c->phase_shift;
#if FILTER_SHIFT ... | 13,441 |
FFmpeg | 68f593b48433842f3407586679fe07f3e5199ab9 | 0 | int ff_h263_resync(MpegEncContext *s){
int left, ret;
if(s->codec_id==CODEC_ID_MPEG4)
skip_bits1(&s->gb);
align_get_bits(&s->gb);
if(show_bits(&s->gb, 16)==0){
if(s->codec_id==CODEC_ID_MPEG4)
ret= mpeg4_decode_video_packet_header(s);
else
... | 13,443 |
qemu | 9e559533bd825a3e371497875576137a8586c831 | 1 | static void aio_write_done(void *opaque, int ret)
{
struct aio_ctx *ctx = opaque;
struct timeval t2;
gettimeofday(&t2, NULL);
if (ret < 0) {
printf("aio_write failed: %s\n", strerror(-ret));
goto out;
}
if (ctx->qflag) {
goto out;
}
/* Finall... | 13,444 |
FFmpeg | c23acbaed40101c677dfcfbbfe0d2c230a8e8f44 | 1 | static void add_pixels_clamped2_c(const DCTELEM *block, uint8_t *restrict pixels,
int line_size)
{
int i;
uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;
/* read the pixels */
for(i=0;i<2;i++) {
pixels[0] = cm[pixels[0] + block[0]];
pixels[1] = cm[pixels[1] +... | 13,445 |
FFmpeg | fd54dd028bc9f7bfb80ebf823a533dc84b73f936 | 1 | static int jpeg2000_read_main_headers(Jpeg2000DecoderContext *s)
{
Jpeg2000CodingStyle *codsty = s->codsty;
Jpeg2000QuantStyle *qntsty = s->qntsty;
uint8_t *properties = s->properties;
for (;;) {
int len, ret = 0;
uint16_t marker;
int oldpos;
if (byt... | 13,446 |
qemu | 3e4f910c8d490a1490409a7e381dbbb229f9d272 | 1 | static void ehci_reset(void *opaque)
{
EHCIState *s = opaque;
int i;
USBDevice *devs[NB_PORTS];
trace_usb_ehci_reset();
/*
* Do the detach before touching portsc, so that it correctly gets send to
* us or to our companion based on PORTSC_POWNER before the reset.
*/
f... | 13,447 |
qemu | 6f2d8978728c48ca46f5c01835438508aace5c64 | 1 | void OPPROTO op_POWER_slq (void)
{
uint32_t msk = -1, tmp;
msk = msk << (T1 & 0x1FUL);
if (T1 & 0x20UL)
msk = ~msk;
T1 &= 0x1FUL;
tmp = rotl32(T0, T1);
T0 = tmp & msk;
env->spr[SPR_MQ] = tmp;
RETURN();
}
| 13,450 |
FFmpeg | 5e885275f1eda3f0281747d9c78d072adb8bc940 | 1 | int ff_MPV_lowest_referenced_row(MpegEncContext *s, int dir)
{
int my_max = INT_MIN, my_min = INT_MAX, qpel_shift = !s->quarter_sample;
int my, off, i, mvs;
if (s->picture_structure != PICT_FRAME) goto unhandled;
switch (s->mv_type) {
case MV_TYPE_16X16:
mvs = 1;
... | 13,451 |
FFmpeg | 0d21a84605bad4e75dacb8196e5859902ed36f01 | 0 | static inline int snake_search(MpegEncContext * s, int *best, int dmin,
UINT8 *new_pic, UINT8 *old_pic, int pic_stride,
int pred_x, int pred_y, UINT16 *mv_penalty, int quant,
int xmin, int ymin, int x... | 13,452 |
qemu | e155494cf0b876c45c3c68a9ab6c641aac22dfdf | 1 | static int qio_channel_command_close(QIOChannel *ioc,
Error **errp)
{
QIOChannelCommand *cioc = QIO_CHANNEL_COMMAND(ioc);
int rv = 0;
/* We close FDs before killing, because that
* gives a better chance of clean shutdown
*/
if (close(cioc->writefd... | 13,453 |
FFmpeg | c3b6454d801638b091b51fe62937e6831a3a37b2 | 1 | AVFixedDSPContext * avpriv_alloc_fixed_dsp(int bit_exact)
{
AVFixedDSPContext * fdsp = av_malloc(sizeof(AVFixedDSPContext));
fdsp->vector_fmul_window_scaled = vector_fmul_window_fixed_scaled_c;
fdsp->vector_fmul_window = vector_fmul_window_fixed_c;
return fdsp;
} | 13,454 |
FFmpeg | f6774f905fb3cfdc319523ac640be30b14c1bc55 | 1 | static av_always_inline void encode_mb_internal(MpegEncContext *s,
int motion_x, int motion_y,
int mb_block_height,
int mb_block_count)
{
int16_t weight[8][64];
i... | 13,455 |
qemu | 6f9faa91f5fb3a866f5bf592207c9498a017740d | 1 | void sh_intc_register_sources(struct intc_desc *desc,
struct intc_vect *vectors,
int nr_vectors,
struct intc_group *groups,
int nr_groups)
{
unsigned int i, k;
struct intc_source *s;
for (i = 0; i < nr_vectors; i++) {
struct intc_vect *vect = vectors + i;
... | 13,456 |
qemu | 3d3efba020da1de57a715e2087cf761ed0ad0904 | 1 | void sparc64_get_context(CPUSPARCState *env)
{
abi_ulong ucp_addr;
struct target_ucontext *ucp;
target_mc_gregset_t *grp;
target_mcontext_t *mcp;
abi_ulong fp, i7, w_addr;
int err;
unsigned int i;
target_sigset_t target_set;
sigset_t set;
ucp_addr = env->regwptr[UREG... | 13,458 |
FFmpeg | a8dbe9514f865f6a8efb304a720025cb1ef9ae3f | 0 | void av_close_input_file(AVFormatContext *s)
{
int i;
if (s->iformat->read_close)
s->iformat->read_close(s);
for(i=0;i<s->nb_streams;i++) {
av_free(s->streams[i]);
}
if (s->packet_buffer) {
AVPacketList *p, *p1;
p = s->packet_buffer;
while (p != N... | 13,461 |
qemu | ad0ebb91cd8b5fdc4a583b03645677771f420a46 | 1 | void stw_tce(VIOsPAPRDevice *dev, uint64_t taddr, uint32_t val)
{
val = tswap32(val);
spapr_tce_dma_write(dev, taddr, &val, sizeof(val));
}
| 13,463 |
FFmpeg | 6e42e6c4b410dbef8b593c2d796a5dad95f89ee4 | 1 | static inline void RENAME(rgb32to24)(const uint8_t *src,uint8_t *dst,long src_size)
{
uint8_t *dest = dst;
const uint8_t *s = src;
const uint8_t *end;
#ifdef HAVE_MMX
const uint8_t *mm_end;
#endif
end = s + src_size;
#ifdef HAVE_MMX
__asm __volatile(PREFETCH" %0"::"m"(*s):"memory");
mm_end = en... | 13,464 |
qemu | 788cf9f8c8cbda53843e060540f3e91a060eb744 | 1 | static void term_exit(void)
{
tcsetattr(0, TCSANOW, &oldtty);
}
| 13,465 |
qemu | 86e18cae209f8101ff9a6013a1ff6ae620c06944 | 1 | static inline int ohci_put_hcca(OHCIState *ohci,
uint32_t addr, struct ohci_hcca *hcca)
{
cpu_physical_memory_write(addr + ohci->localmem_base, hcca, sizeof(*hcca));
return 1;
}
| 13,466 |
FFmpeg | cb08687180683a755d0fe9d425280d0e4d1e6db2 | 1 | static int vqf_read_seek(AVFormatContext *s,
int stream_index, int64_t timestamp, int flags)
{
VqfContext *c = s->priv_data;
AVStream *st;
int ret;
int64_t pos;
st = s->streams[stream_index];
pos = av_rescale_rnd(timestamp * st->codec->bit_rate,
... | 13,469 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.