project stringclasses 2
values | commit_id stringlengths 40 40 | target int64 0 1 | func stringlengths 26 142k | idx int64 0 27.3k |
|---|---|---|---|---|
qemu | 2d896b454a0e19ec4c1ddbb0e0b65b7e54fcedf3 | 1 | static void boston_mach_init(MachineState *machine)
{
DeviceState *dev;
BostonState *s;
Error *err = NULL;
const char *cpu_model;
MemoryRegion *flash, *ddr, *ddr_low_alias, *lcd, *platreg;
MemoryRegion *sys_mem = get_system_memory();
XilinxPCIEHost *pcie2;
PCIDevice *ahci;
... | 1,479 |
FFmpeg | e7b9d136a1ba2d048b1a17df5778e426b825676d | 1 | static int cng_decode_frame(AVCodecContext *avctx, void *data,
int *got_frame_ptr, AVPacket *avpkt)
{
AVFrame *frame = data;
CNGContext *p = avctx->priv_data;
int buf_size = avpkt->size;
int ret, i;
int16_t *buf_out;
float e = 1.0;
float scaling;
if (avpkt->s... | 1,480 |
qemu | b47d8efa9f430c332bf96ce6eede169eb48422ad | 0 | static int vfio_pci_hot_reset_multi(VFIOPCIDevice *vdev)
{
return vfio_pci_hot_reset(vdev, false);
}
| 1,481 |
qemu | 2a74440547ea0a15195224fa2b7784b267cbfe15 | 0 | void qerror_print(QError *qerror)
{
QString *qstring = qerror_human(qerror);
loc_push_restore(&qerror->loc);
error_report("%s", qstring_get_str(qstring));
loc_pop(&qerror->loc);
QDECREF(qstring);
}
| 1,482 |
qemu | d4551293d68a1876df87400be6c71c657756d0bb | 0 | static int is_async_return(const QObject *data)
{
if (data && qobject_type(data) == QTYPE_QDICT) {
return qdict_haskey(qobject_to_qdict(data), "__mon_async");
}
return 0;
}
| 1,483 |
FFmpeg | bf1945af301aff54c33352e75f17aec6cb5269d7 | 0 | static void stereo_processing(PSContext *ps, float (*l)[32][2], float (*r)[32][2], int is34)
{
int e, b, k, n;
float (*H11)[PS_MAX_NUM_ENV+1][PS_MAX_NR_IIDICC] = ps->H11;
float (*H12)[PS_MAX_NUM_ENV+1][PS_MAX_NR_IIDICC] = ps->H12;
float (*H21)[PS_MAX_NUM_ENV+1][PS_MAX_NR_IIDICC] = ps->H21;
f... | 1,484 |
qemu | 94171e119cb6f7bab2578896643b0daff1d9b184 | 0 | static int monitor_read_password(Monitor *mon, ReadLineFunc *readline_func,
void *opaque)
{
if (mon->rs) {
readline_start(mon->rs, "Password: ", 1, readline_func, opaque);
/* prompt is printed on return from the command handler */
return 0;
} else ... | 1,485 |
qemu | 27a69bb088bee6d4efea254659422fb9c751b3c7 | 0 | static inline void gen_efdnabs(DisasContext *ctx)
{
if (unlikely(!ctx->spe_enabled)) {
gen_exception(ctx, POWERPC_EXCP_APU);
return;
}
#if defined(TARGET_PPC64)
tcg_gen_ori_tl(cpu_gpr[rD(ctx->opcode)], cpu_gpr[rA(ctx->opcode)], 0x8000000000000000LL);
#else
tcg_gen_mov_tl(cpu_gpr... | 1,486 |
qemu | b931bfbf042983f311b3b09894d8030b2755a638 | 0 | int vhost_dev_init(struct vhost_dev *hdev, void *opaque,
VhostBackendType backend_type)
{
uint64_t features;
int i, r;
if (vhost_set_backend_type(hdev, backend_type) < 0) {
close((uintptr_t)opaque);
return -1;
}
if (hdev->vhost_ops->vhost_backend_init(... | 1,488 |
qemu | 03fc0548b70393b0c8d43703591a9e34fb8e3123 | 0 | static void tcg_out_ld(TCGContext *s, TCGType type, TCGReg ret, TCGReg arg1,
tcg_target_long arg2)
{
uint8_t *old_code_ptr = s->code_ptr;
if (type == TCG_TYPE_I32) {
tcg_out_op_t(s, INDEX_op_ld_i32);
tcg_out_r(s, ret);
tcg_out_r(s, arg1);
tcg_out32(... | 1,489 |
qemu | 368d25881c94f9e09ef19a3d93e8fec797dbcd05 | 0 | static int tight_send_framebuffer_update(VncState *vs, int x, int y,
int w, int h)
{
int max_rows;
if (vs->clientds.pf.bytes_per_pixel == 4 && vs->clientds.pf.rmax == 0xFF &&
vs->clientds.pf.bmax == 0xFF && vs->clientds.pf.gmax == 0xFF) {
vs->tigh... | 1,490 |
qemu | 2e569845bd314fc1dde83d65dc9b87e71b4d29b4 | 0 | void helper_booke206_tlbwe(CPUPPCState *env)
{
PowerPCCPU *cpu = ppc_env_get_cpu(env);
uint32_t tlbncfg, tlbn;
ppcmas_tlb_t *tlb;
uint32_t size_tlb, size_ps;
target_ulong mask;
switch (env->spr[SPR_BOOKE_MAS0] & MAS0_WQ_MASK) {
case MAS0_WQ_ALWAYS:
/* good to go, write t... | 1,491 |
qemu | 4a1418e07bdcfaa3177739e04707ecaec75d89e1 | 0 | static uint32_t qpi_mem_readl(void *opaque, target_phys_addr_t addr)
{
CPUState *env;
env = cpu_single_env;
if (!env)
return 0;
return env->eflags & (IF_MASK | IOPL_MASK);
}
| 1,492 |
qemu | 8978b34af3250354e0b67340a7e920f909beda13 | 0 | static void test_visitor_out_number(TestOutputVisitorData *data,
const void *unused)
{
double value = 3.14;
QObject *obj;
visit_type_number(data->ov, NULL, &value, &error_abort);
obj = visitor_get(data);
g_assert(qobject_type(obj) == QTYPE_QFLOAT);
... | 1,493 |
qemu | f95d7cc7fecbc0e320e83c864ce2d99fee3d9236 | 0 | static int find_pte32(CPUPPCState *env, struct mmu_ctx_hash32 *ctx,
target_ulong eaddr, int h, int rwx, 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 = get_pteg_offset32(env,... | 1,494 |
FFmpeg | e2ad0b66fa273c5c823978e8f601f2c0d9ee42f8 | 0 | int avpicture_get_size(enum AVPixelFormat pix_fmt, int width, int height)
{
const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt);
AVPicture dummy_pict;
int ret;
if (!desc)
return AVERROR(EINVAL);
if ((ret = av_image_check_size(width, height, 0, NULL)) < 0)
return r... | 1,495 |
qemu | 2bcf018340cbf233f7145e643fc1bb367f23fd90 | 0 | uint32_t HELPER(testblock)(CPUS390XState *env, uint64_t real_addr)
{
uintptr_t ra = GETPC();
CPUState *cs = CPU(s390_env_get_cpu(env));
int i;
real_addr = wrap_address(env, real_addr) & TARGET_PAGE_MASK;
/* Check low-address protection */
if ((env->cregs[0] & CR0_LOWPROT) && real_addr... | 1,496 |
qemu | 32bafa8fdd098d52fbf1102d5a5e48d29398c0aa | 0 | static void block_dirty_bitmap_add_prepare(BlkActionState *common,
Error **errp)
{
Error *local_err = NULL;
BlockDirtyBitmapAdd *action;
BlockDirtyBitmapState *state = DO_UPCAST(BlockDirtyBitmapState,
common, commo... | 1,498 |
qemu | c39ce112b60ffafbaf700853e32bea74cbb2c148 | 0 | int32_t scsi_req_enqueue(SCSIRequest *req, uint8_t *buf)
{
int32_t rc;
assert(!req->enqueued);
scsi_req_ref(req);
req->enqueued = true;
QTAILQ_INSERT_TAIL(&req->dev->requests, req, next);
scsi_req_ref(req);
rc = req->ops->send_command(req, buf);
scsi_req_unref(req);
ret... | 1,499 |
qemu | 89e2a31d337f96ab8d5b7bdfe4bcce0a25181ed1 | 0 | static int sd_parse_uri(BDRVSheepdogState *s, const char *filename,
char *vdi, uint32_t *snapid, char *tag)
{
URI *uri;
QueryParams *qp = NULL;
int ret = 0;
uri = uri_parse(filename);
if (!uri) {
return -EINVAL;
}
/* transport */
if (!strcmp... | 1,501 |
qemu | 210b580b106fa798149e28aa13c66b325a43204e | 0 | static void rtas_ibm_query_interrupt_source_number(sPAPREnvironment *spapr,
uint32_t token,
uint32_t nargs,
target_ulong args,
... | 1,502 |
qemu | 5861a33898bbddfd1a80c2e202cb9352e3b1ba62 | 0 | static void mpic_irq_raise(openpic_t *mpp, int n_CPU, IRQ_src_t *src)
{
int n_ci = IDR_CI0 - n_CPU;
if(test_bit(&src->ide, n_ci)) {
qemu_irq_raise(mpp->dst[n_CPU].irqs[OPENPIC_OUTPUT_CINT]);
}
else {
qemu_irq_raise(mpp->dst[n_CPU].irqs[OPENPIC_OUTPUT_INT]);
}
}
| 1,503 |
qemu | 786a4ea82ec9c87e3a895cf41081029b285a5fe5 | 0 | static void tc6393xb_gpio_handler_update(TC6393xbState *s)
{
uint32_t level, diff;
int bit;
level = s->gpio_level & s->gpio_dir;
for (diff = s->prev_level ^ level; diff; diff ^= 1 << bit) {
bit = ffs(diff) - 1;
qemu_set_irq(s->handler[bit], (level >> bit) & 1);
}
s... | 1,504 |
qemu | 94ad93bd976841c26af75322301f5aad925114d6 | 0 | static void spapr_cpu_core_realize(DeviceState *dev, Error **errp)
{
/* We don't use SPAPR_MACHINE() in order to exit gracefully if the user
* tries to add a sPAPR CPU core to a non-pseries machine.
*/
sPAPRMachineState *spapr =
(sPAPRMachineState *) object_dynamic_cast(qdev_get_machine(... | 1,505 |
FFmpeg | 6086731299e4d249ddc459e406b2ebb0cb71f6f4 | 1 | static int unpack_block_qpis(Vp3DecodeContext *s, GetBitContext *gb)
{
int qpi, i, j, bit, run_length, blocks_decoded, num_blocks_at_qpi;
int num_blocks = s->total_num_coded_frags;
for (qpi = 0; qpi < s->nqps-1 && num_blocks > 0; qpi++) {
i = blocks_decoded = num_blocks_at_qpi = 0;
... | 1,506 |
qemu | b544c1aba8681c2fe5d6715fbd37cf6caf1bc7bb | 1 | static int coroutine_fn sd_co_flush_to_disk(BlockDriverState *bs)
{
BDRVSheepdogState *s = bs->opaque;
SheepdogAIOCB *acb;
AIOReq *aio_req;
if (s->cache_flags != SD_FLAG_CMD_CACHE) {
return 0;
}
acb = sd_aio_setup(bs, NULL, 0, 0);
acb->aiocb_type = AIOCB_FLUSH_CACHE;
... | 1,510 |
qemu | 12d4536f7d911b6d87a766ad7300482ea663cea2 | 1 | void qemu_notify_event(void)
{
CPUState *env = cpu_single_env;
qemu_event_increment ();
if (env) {
cpu_exit(env);
}
if (next_cpu && env != next_cpu) {
cpu_exit(next_cpu);
}
exit_request = 1;
}
| 1,511 |
qemu | cd3b29b745b0ff393b2d37317837bc726b8dacc8 | 1 | static void tcg_out_qemu_ld(TCGContext* s, TCGReg data_reg, TCGReg addr_reg,
TCGMemOpIdx oi)
{
TCGMemOp opc = get_memop(oi);
#ifdef CONFIG_SOFTMMU
unsigned mem_index = get_mmuidx(oi);
tcg_insn_unit *label_ptr;
TCGReg base_reg;
base_reg = tcg_out_tlb_read(s, addr... | 1,512 |
qemu | 11b7b07f8a15879134a54e73fade98d5e11e04f8 | 1 | char *qdist_pr_plain(const struct qdist *dist, size_t n)
{
struct qdist binned;
char *ret;
if (dist->n == 0) {
return NULL;
}
qdist_bin__internal(&binned, dist, n);
ret = qdist_pr_internal(&binned);
qdist_destroy(&binned);
return ret;
}
| 1,513 |
FFmpeg | aa06658248a49f6ebf381894b9426cdfb377cd32 | 1 | static int dvvideo_encode_frame(AVCodecContext *c, uint8_t *buf, int buf_size,
void *data)
{
DVVideoContext *s = c->priv_data;
s->sys = dv_codec_profile(c);
if (!s->sys)
return -1;
if(buf_size < s->sys->frame_size)
return -1;
c->pix_fmt = ... | 1,514 |
FFmpeg | 852859ff7cd29a926a9a7e811d77192b61a6956e | 1 | static int mov_read_esds(MOVContext *c, ByteIOContext *pb, MOV_atom_t atom)
{
AVStream *st = c->fc->streams[c->fc->nb_streams-1];
int tag, len;
get_be32(pb); /* version + flags */
len = mp4_read_descr(c, pb, &tag);
if (tag == MP4ESDescrTag) {
get_be16(pb); /* ID */
get_byte... | 1,515 |
qemu | 3d4d16f4dc101e16f643acc44dfffdbaf2a8f01c | 1 | static void audio_run_in (AudioState *s)
{
HWVoiceIn *hw = NULL;
while ((hw = audio_pcm_hw_find_any_enabled_in (hw))) {
SWVoiceIn *sw;
int captured, min;
captured = hw->pcm_ops->run_in (hw);
min = audio_pcm_hw_find_min_in (hw);
hw->total_samples_captured += ... | 1,516 |
FFmpeg | 5d44c061cf511d97be5fac8d76be2f3915c6e798 | 1 | static int avs_read_packet(AVFormatContext * s, AVPacket * pkt)
{
AvsFormat *avs = s->priv_data;
int sub_type = 0, size = 0;
AvsBlockType type = AVS_NONE;
int palette_size = 0;
uint8_t palette[4 + 3 * 256];
int ret;
if (avs->remaining_audio_size > 0)
if (avs_read_audio_pac... | 1,517 |
qemu | e7eee62a90c671d22d50964b7de05e3f4fd96f5f | 1 | void HELPER(simcall)(CPUXtensaState *env)
{
uint32_t *regs = env->regs;
switch (regs[2]) {
case TARGET_SYS_exit:
qemu_log("exit(%d) simcall\n", regs[3]);
exit(regs[3]);
break;
case TARGET_SYS_read:
case TARGET_SYS_write:
{
bool is_write = re... | 1,518 |
FFmpeg | 5d31f03a0264cac24434c8108daef4ccba6d28f9 | 1 | static void decode_lpc(int32_t *coeffs, int mode, int length)
{
int i;
if (length < 2)
return;
if (mode == 1) {
unsigned a1 = *coeffs++;
for (i = 0; i < length - 1 >> 1; i++) {
*coeffs += a1;
coeffs[1] += *coeffs;
a1 = coeff... | 1,520 |
FFmpeg | e16e49ac90f6da9e019fdf23084cbb256d14bd9c | 0 | static void term_init(void)
{
#ifndef __MINGW32__
struct termios tty;
tcgetattr (0, &tty);
oldtty = tty;
tty.c_iflag &= ~(IGNBRK|BRKINT|PARMRK|ISTRIP
|INLCR|IGNCR|ICRNL|IXON);
tty.c_oflag |= OPOST;
tty.c_lflag &= ~(ECHO|ECHONL|ICANON|IEXTEN);
tty.c_cfl... | 1,521 |
FFmpeg | 77693c541a541661357a0edd5bbaae69c64b2039 | 0 | static int xan_decode_frame_type0(AVCodecContext *avctx)
{
XanContext *s = avctx->priv_data;
uint8_t *ybuf, *prev_buf, *src = s->scratch_buffer;
unsigned chroma_off, corr_off;
int cur, last;
int i, j;
int ret;
chroma_off = bytestream2_get_le32(&s->gb);
corr_off = bytestream... | 1,522 |
FFmpeg | f320fb894c695044ef15239d27844d9ac01c9d16 | 0 | static int bethsoftvid_decode_frame(AVCodecContext *avctx,
void *data, int *data_size,
AVPacket *avpkt)
{
BethsoftvidContext * vid = avctx->priv_data;
char block_type;
uint8_t * dst;
uint8_t * frame_end;
int remaining = avctx->width... | 1,523 |
FFmpeg | 810a8ba5b67389e808ed2f124e1cd54b8a26e679 | 0 | static void decode_delta_d(uint8_t *dst,
const uint8_t *buf, const uint8_t *buf_end,
int w, int flag, int bpp, int dst_size)
{
int planepitch = FFALIGN(w, 16) >> 3;
int pitch = planepitch * bpp;
int planepitch_byte = (w + 7) / 8;
unsigned entr... | 1,524 |
FFmpeg | 662234a9a22f1cd0f0ac83b8bb1ffadedca90c0a | 0 | static void avc_luma_hv_qrt_and_aver_dst_8x8_msa(const uint8_t *src_x,
const uint8_t *src_y,
int32_t src_stride,
uint8_t *dst,
... | 1,526 |
FFmpeg | 2254b559cbcfc0418135f09add37c0a5866b1981 | 1 | static void hScale8To19_c(SwsContext *c, int16_t *_dst, int dstW, const uint8_t *src,
const int16_t *filter, const int16_t *filterPos,
int filterSize)
{
int i;
int32_t *dst = (int32_t *) _dst;
for (i=0; i<dstW; i++) {
int j;
int src... | 1,527 |
qemu | e95205e1f9cd2c4262b7a7b1c992a94512c86d0e | 1 | static void cpu_notify_map_clients_locked(void)
{
MapClient *client;
while (!QLIST_EMPTY(&map_client_list)) {
client = QLIST_FIRST(&map_client_list);
client->callback(client->opaque);
cpu_unregister_map_client(client);
}
}
| 1,529 |
FFmpeg | 5ef19590802f000299e418143fc2301e3f43affe | 1 | int show_bsfs(void *optctx, const char *opt, const char *arg)
{
AVBitStreamFilter *bsf = NULL;
printf("Bitstream filters:\n");
while ((bsf = av_bitstream_filter_next(bsf)))
printf("%s\n", bsf->name);
printf("\n");
return 0;
}
| 1,530 |
FFmpeg | 3aa661ec561d7a20812b84b353b0d7855ac346c8 | 1 | static inline int decode_vui_parameters(H264Context *h, SPS *sps){
MpegEncContext * const s = &h->s;
int aspect_ratio_info_present_flag;
unsigned int aspect_ratio_idc;
aspect_ratio_info_present_flag= get_bits1(&s->gb);
if( aspect_ratio_info_present_flag ) {
aspect_ratio_idc= get_bi... | 1,531 |
qemu | e122636562218b3d442cd2cd18fbc188dd9ce709 | 1 | void migration_set_incoming_channel(MigrationState *s,
QIOChannel *ioc)
{
QEMUFile *f = qemu_fopen_channel_input(ioc);
process_incoming_migration(f);
}
| 1,532 |
qemu | 1e973051b96bac5eef46393eec15b68796e7c7d3 | 1 | static int buffered_rate_limit(void *opaque)
{
MigrationState *s = opaque;
int ret;
ret = qemu_file_get_error(s->file);
if (ret) {
return ret;
}
if (s->bytes_xfer > s->xfer_limit) {
return 1;
}
return 0;
}
| 1,534 |
FFmpeg | 5d7e3d71673d64a16b58430a0027afadb6b3a54e | 1 | static const unsigned char *seq_decode_op2(SeqVideoContext *seq, const unsigned char *src, unsigned char *dst)
{
int i;
for (i = 0; i < 8; i++) {
memcpy(dst, src, 8);
src += 8;
dst += seq->frame.linesize[0];
}
return src;
}
| 1,535 |
FFmpeg | f3abdf4392a146462dc679846c061b8bf2b5c7a0 | 1 | int opt_default(void *optctx, const char *opt, const char *arg)
{
const AVOption *o;
int consumed = 0;
char opt_stripped[128];
const char *p;
const AVClass *cc = avcodec_get_class(), *fc = avformat_get_class();
const av_unused AVClass *rc_class;
const AVClass *sc, *swr_class;
... | 1,536 |
qemu | 4b32e11a59e34c5cf570c1fd102a78d9351e71f5 | 1 | static void event_test_emit(test_QAPIEvent event, QDict *d, Error **errp)
{
QObject *obj;
QDict *t;
int64_t s, ms;
/* Verify that we have timestamp, then remove it to compare other fields */
obj = qdict_get(d, "timestamp");
g_assert(obj);
t = qobject_to_qdict(obj);
g_assert(t)... | 1,537 |
FFmpeg | 6796a1dd8c14843b77925cb83a3ef88706ae1dd0 | 0 | void ff_put_h264_qpel8_mc20_msa(uint8_t *dst, const uint8_t *src,
ptrdiff_t stride)
{
avc_luma_hz_8w_msa(src - 2, stride, dst, stride, 8);
}
| 1,538 |
FFmpeg | aeb23fc4549a25ef32ff085d2a76227f90caf403 | 0 | static void ini_print_object_header(const char *name)
{
int i;
PrintElement *el = octx.prefix + octx.level -1;
if (el->nb_elems)
avio_printf(probe_out, "\n");
avio_printf(probe_out, "[");
for (i = 1; i < octx.level; i++) {
el = octx.prefix + i;
avio_printf(prob... | 1,539 |
FFmpeg | 0f87b42b44f8da7234e8e43b27d1dc5e4dce7582 | 0 | int avformat_queue_attached_pictures(AVFormatContext *s)
{
int i;
for (i = 0; i < s->nb_streams; i++)
if (s->streams[i]->disposition & AV_DISPOSITION_ATTACHED_PIC &&
s->streams[i]->discard < AVDISCARD_ALL) {
AVPacket copy = s->streams[i]->attached_pic;
if (copy... | 1,541 |
FFmpeg | 486637af8ef29ec215e0e0b7ecd3b5470f0e04e5 | 0 | static inline void mix_dualmono_to_mono(AC3DecodeContext *ctx)
{
int i;
float (*output)[256] = ctx->audio_block.block_output;
for (i = 0; i < 256; i++)
output[1][i] += output[2][i];
memset(output[2], 0, sizeof(output[2]));
}
| 1,542 |
FFmpeg | 1e763454322f7fbc7799f6009bf2e11d7a3b9821 | 0 | static int decode_frame(AVCodecContext *avctx,
void *data, int *got_frame,
AVPacket *avpkt)
{
PNGDecContext *const s = avctx->priv_data;
const uint8_t *buf = avpkt->data;
int buf_size = avpkt->size;
AVFrame *p = data;
... | 1,543 |
qemu | 79853e18d904b0a4bcef62701d48559688007c93 | 0 | static bool rtas_event_log_contains(uint32_t event_mask)
{
sPAPREventLogEntry *entry = NULL;
/* we only queue EPOW events atm. */
if ((event_mask & EVENT_MASK_EPOW) == 0) {
return false;
}
QTAILQ_FOREACH(entry, &spapr->pending_events, next) {
/* EPOW and hotplug events ar... | 1,544 |
qemu | b3db211f3c80bb996a704d665fe275619f728bd4 | 0 | static void test_visitor_out_native_list_int16(TestOutputVisitorData *data,
const void *unused)
{
test_native_list(data, unused, USER_DEF_NATIVE_LIST_UNION_KIND_S16);
}
| 1,545 |
qemu | 9a78eead0c74333a394c0f7bbfc4423ac746fcd5 | 0 | void sh4_cpu_list(FILE *f, int (*cpu_fprintf)(FILE *f, const char *fmt, ...))
{
int i;
for (i = 0; i < ARRAY_SIZE(sh4_defs); i++)
(*cpu_fprintf)(f, "%s\n", sh4_defs[i].name);
}
| 1,546 |
qemu | 7c7e9df0232a1ce5c411f0f348038d2e72097ae1 | 0 | static int qemu_rbd_set_conf(rados_t cluster, const char *conf)
{
char *p, *buf;
char name[RBD_MAX_CONF_NAME_SIZE];
char value[RBD_MAX_CONF_VAL_SIZE];
int ret = 0;
buf = g_strdup(conf);
p = buf;
while (p) {
ret = qemu_rbd_next_tok(name, sizeof(name), p,
... | 1,547 |
qemu | eabb7b91b36b202b4dac2df2d59d698e3aff197a | 0 | static void patch_reloc(tcg_insn_unit *code_ptr, int type,
intptr_t value, intptr_t addend)
{
assert(type == R_ARM_PC24);
assert(addend == 0);
reloc_pc24(code_ptr, (tcg_insn_unit *)value);
}
| 1,548 |
FFmpeg | 1181d93231e9b807965724587d363c1cfd5a1d0d | 0 | void ff_avg_h264_qpel8_mc13_msa(uint8_t *dst, const uint8_t *src,
ptrdiff_t stride)
{
avc_luma_hv_qrt_and_aver_dst_8x8_msa(src + stride - 2,
src - (stride * 2),
stride, dst, stride);
}
| 1,549 |
qemu | 879c28133dfa54b780dffbb29e4dcfc6581f6281 | 0 | static int v9fs_do_symlink(V9fsState *s, V9fsString *oldpath,
V9fsString *newpath)
{
return s->ops->symlink(&s->ctx, oldpath->data, newpath->data);
}
| 1,550 |
qemu | b227a8e9aa5f27d29f77ba90d5eb9d0662a1175e | 0 | static int find_pte32 (mmu_ctx_t *ctx, int h, int rw)
{
return _find_pte(ctx, 0, h, rw);
}
| 1,551 |
qemu | 3706c43f021918684cf19fe0f6ef8498815e4313 | 0 | static int nic_load(QEMUFile * f, void *opaque, int version_id)
{
EEPRO100State *s = opaque;
int i;
int ret;
if (version_id > 3)
return -EINVAL;
if (version_id >= 3) {
ret = pci_device_load(&s->dev, f);
if (ret < 0)
return ret;
}
if (vers... | 1,552 |
qemu | b3ceef24f4fee8d5ed96b8c4a5d3e80c0a651f0b | 0 | static uint32_t slavio_serial_mem_readb(void *opaque, target_phys_addr_t addr)
{
SerialState *ser = opaque;
ChannelState *s;
uint32_t saddr;
uint32_t ret;
int channel;
saddr = (addr & 3) >> 1;
channel = (addr & SERIAL_MAXADDR) >> 2;
s = &ser->chn[channel];
switch (saddr) ... | 1,553 |
qemu | b769d8fef6c06ddb39ef0337882a4f8872b9c2bc | 0 | int cpu_sparc_handle_mmu_fault (CPUState *env, uint32_t address, int rw,
int is_user, int is_softmmu)
{
int exception = 0;
int access_type, access_perms = 0, access_index = 0;
uint8_t *pde_ptr;
uint32_t pde, virt_addr;
int error_code = 0, is_dirty, prot, ret = 0;... | 1,554 |
qemu | 7f6613cedc59fa849105668ae971dc31004bca1c | 0 | static void gen_farith (DisasContext *ctx, enum fopcode op1,
int ft, int fs, int fd, int cc)
{
const char *opn = "farith";
const char *condnames[] = {
"c.f",
"c.un",
"c.eq",
"c.ueq",
"c.olt",
"c.ult",
... | 1,555 |
qemu | a8170e5e97ad17ca169c64ba87ae2f53850dab4c | 0 | static uint64_t ecc_mem_read(void *opaque, target_phys_addr_t addr,
unsigned size)
{
ECCState *s = opaque;
uint32_t ret = 0;
switch (addr >> 2) {
case ECC_MER:
ret = s->regs[ECC_MER];
trace_ecc_mem_readl_mer(ret);
break;
case ECC_MDR:
... | 1,556 |
qemu | 079d0b7f1eedcc634c371fe05b617fdc55c8b762 | 0 | static int usb_host_handle_iso_data(USBHostDevice *s, USBPacket *p, int in)
{
AsyncURB *aurb;
int i, j, ret, max_packet_size, offset, len = 0;
uint8_t *buf;
max_packet_size = usb_ep_get_max_packet_size(&s->dev, p->pid, p->devep);
if (max_packet_size == 0)
return USB_RET_NAK;
... | 1,558 |
qemu | 007ac6faed12abdd4113e2460ba4464aacb7f4dd | 0 | static void gen_farith (DisasContext *ctx, uint32_t op1,
int ft, int fs, int fd, int cc)
{
const char *opn = "farith";
const char *condnames[] = {
"c.f",
"c.un",
"c.eq",
"c.ueq",
"c.olt",
"c.ult",
... | 1,559 |
FFmpeg | 8f6b919d99687416deaedb2df6b8b5f49645a291 | 0 | static void mkv_write_block(AVFormatContext *s, AVIOContext *pb,
unsigned int blockid, AVPacket *pkt, int flags)
{
MatroskaMuxContext *mkv = s->priv_data;
AVCodecContext *codec = s->streams[pkt->stream_index]->codec;
uint8_t *data = NULL, *side_data = NULL;
int offset =... | 1,560 |
qemu | 0919ac787641db11024912651f3bc5764d4f1286 | 0 | static void omap2_mpu_reset(void *opaque)
{
struct omap_mpu_state_s *mpu = (struct omap_mpu_state_s *) opaque;
omap_inth_reset(mpu->ih[0]);
omap_dma_reset(mpu->dma);
omap_prcm_reset(mpu->prcm);
omap_sysctl_reset(mpu->sysc);
omap_gp_timer_reset(mpu->gptimer[0]);
omap_gp_timer_reset(... | 1,561 |
qemu | 79ca616f291124d166ca173e512c4ace1c2fe8b2 | 0 | void do_pci_device_hot_remove(Monitor *mon, const QDict *qdict)
{
pci_device_hot_remove(mon, qdict_get_str(qdict, "pci_addr"));
}
| 1,562 |
qemu | 53cb28cbfea038f8ad50132dc8a684e638c7d48b | 0 | static void register_multipage(AddressSpaceDispatch *d,
MemoryRegionSection *section)
{
hwaddr start_addr = section->offset_within_address_space;
uint16_t section_index = phys_section_add(section);
uint64_t num_pages = int128_get64(int128_rshift(section->size,
... | 1,564 |
qemu | b3db211f3c80bb996a704d665fe275619f728bd4 | 0 | static void test_visitor_in_errors(TestInputVisitorData *data,
const void *unused)
{
TestStruct *p = NULL;
Error *err = NULL;
Visitor *v;
strList *q = NULL;
UserDefTwo *r = NULL;
WrapAlternate *s = NULL;
v = visitor_input_test_init(data, "{ 'inte... | 1,566 |
qemu | 5a2223ca26b1a34e131b5b9a63599d9426d2c25c | 0 | static void acpi_pcihp_update_hotplug_bus(AcpiPciHpState *s, int bsel)
{
BusChild *kid, *next;
PCIBus *bus = acpi_pcihp_find_hotplug_bus(s, bsel);
/* Execute any pending removes during reset */
while (s->acpi_pcihp_pci_status[bsel].down) {
acpi_pcihp_eject_slot(s, bsel, s->acpi_pcihp_pci... | 1,567 |
qemu | a8170e5e97ad17ca169c64ba87ae2f53850dab4c | 0 | static void ahci_idp_write(void *opaque, target_phys_addr_t addr,
uint64_t val, unsigned size)
{
AHCIState *s = opaque;
if (addr == s->idp_offset) {
/* index register - mask off reserved bits */
s->idp_index = (uint32_t)val & ((AHCI_MEM_BAR_SIZE - 1) & ~3);
... | 1,568 |
qemu | 9445673ea67c272616b9f718396e267caa6446b7 | 0 | static void nbd_refresh_filename(BlockDriverState *bs, QDict *options)
{
BDRVNBDState *s = bs->opaque;
QDict *opts = qdict_new();
QObject *saddr_qdict;
Visitor *ov;
const char *host = NULL, *port = NULL, *path = NULL;
if (s->saddr->type == SOCKET_ADDRESS_KIND_INET) {
const Inet... | 1,569 |
qemu | 51b19ebe4320f3dcd93cea71235c1219318ddfd2 | 0 | static void virtio_balloon_receive_stats(VirtIODevice *vdev, VirtQueue *vq)
{
VirtIOBalloon *s = VIRTIO_BALLOON(vdev);
VirtQueueElement *elem = &s->stats_vq_elem;
VirtIOBalloonStat stat;
size_t offset = 0;
qemu_timeval tv;
if (!virtqueue_pop(vq, elem)) {
goto out;
}
... | 1,570 |
qemu | e23a1b33b53d25510320b26d9f154e19c6c99725 | 1 | ISABus *isa_bus_new(DeviceState *dev)
{
if (isabus) {
fprintf(stderr, "Can't create a second ISA bus\n");
return NULL;
}
if (NULL == dev) {
dev = qdev_create(NULL, "isabus-bridge");
qdev_init(dev);
}
isabus = FROM_QBUS(ISABus, qbus_create(&isa_bus_info, de... | 1,574 |
qemu | 3eadc68ebd174f5bad51fe6e0bbcf6d6651c784c | 1 | void os_set_proc_name(const char *s)
{
#if defined(PR_SET_NAME)
char name[16];
if (!s)
return;
name[sizeof(name) - 1] = 0;
strncpy(name, s, sizeof(name));
/* Could rewrite argv[0] too, but that's a bit more complicated.
This simple way is enough for `top'. */
if (prctl(P... | 1,575 |
qemu | b027a538c6790bcfc93ef7f4819fe3e581445959 | 1 | static int oss_poll_out (HWVoiceOut *hw)
{
OSSVoiceOut *oss = (OSSVoiceOut *) hw;
return qemu_set_fd_handler (oss->fd, NULL, oss_helper_poll_out, NULL);
}
| 1,576 |
qemu | d9bce9d99f4656ae0b0127f7472db9067b8f84ab | 1 | void OPPROTO op_addzeo (void)
{
do_addzeo();
RETURN();
}
| 1,577 |
FFmpeg | bcd7bf7eeb09a395cc01698842d1b8be9af483fc | 0 | static void avc_loopfilter_cb_or_cr_inter_edge_hor_msa(uint8_t *data,
uint8_t bs0, uint8_t bs1,
uint8_t bs2, uint8_t bs3,
uint8_t tc0, uint8_t tc1,
... | 1,579 |
FFmpeg | cc276c85d15272df6e44fb3252657a43cbd49555 | 0 | static int64_t truehd_layout(int chanmap)
{
int layout = 0, i;
for (i = 0; i < 13; i++)
layout |= thd_layout[i] * ((chanmap >> i) & 1);
return layout;
}
| 1,580 |
FFmpeg | 3af1060319b46005dbfb3b01f9104539caf30146 | 0 | void copy_picture_field(TInterlaceContext *tinterlace,
uint8_t *dst[4], int dst_linesize[4],
const uint8_t *src[4], int src_linesize[4],
enum AVPixelFormat format, int w, int src_h,
int src_field, int interleave, int dst... | 1,581 |
FFmpeg | a5202bc968cf3ca5b64c623b9271f76e8fa02211 | 0 | static double bessel(double x){
double lastv=0;
double t, v;
int i;
static const double inv[100]={
1.0/( 1* 1), 1.0/( 2* 2), 1.0/( 3* 3), 1.0/( 4* 4), 1.0/( 5* 5), 1.0/( 6* 6), 1.0/( 7* 7), 1.0/( 8* 8), 1.0/( 9* 9), 1.0/(10*10),
1.0/(11*11), 1.0/(12*12), 1.0/(13*13), 1.0/(14*14), 1.0/(15*15), 1.... | 1,582 |
FFmpeg | 33d69a90085d30af8a292d9364b835a26565d6b9 | 0 | static int check_jni_invocation(void *log_ctx)
{
int ret = AVERROR_EXTERNAL;
void *handle = NULL;
void **jni_invocation = NULL;
handle = dlopen(NULL, RTLD_LOCAL);
if (!handle) {
goto done;
}
jni_invocation = (void **)dlsym(handle, "_ZN13JniInvocation15jni_invocation_E");... | 1,583 |
FFmpeg | c33030bd7b81f7ef7d7ff9da9bfa1a3b4bfbafa1 | 0 | static int gif_image_write_header(uint8_t **bytestream,
int width, int height, int loop_count,
uint32_t *palette)
{
int i;
unsigned int v;
bytestream_put_buffer(bytestream, "GIF", 3);
bytestream_put_buffer(bytestream, "89a", 3)... | 1,584 |
FFmpeg | e5540b3fd30367ce3cc33b2f34a04b660dbc4b38 | 0 | static int decode_p_mbs(VC9Context *v)
{
int x, y, current_mb = 0, i; /* MB/Block Position info */
int skip_mb_bit = 0, cbpcy; /* MB/B skip */
int hybrid_pred, ac_pred; /* Prediction types */
int mb_has_coeffs = 1 /* last_flag */, mb_is_intra;
int dmv_x, dmv_y; /* Differential MV components *... | 1,585 |
FFmpeg | 9c3e2f78a04200e604add6139ba6f64078fa2274 | 0 | matroska_parse_block(MatroskaDemuxContext *matroska, uint8_t *data, int size,
int64_t pos, uint64_t cluster_time, uint64_t duration,
int is_keyframe, int is_bframe)
{
int res = 0;
int track;
AVStream *st;
AVPacket *pkt;
uint8_t *origdata = data;
... | 1,586 |
qemu | 87ca1f77b1c406137fe36ab73b2dc91fb75f8d0a | 1 | static void vfio_listener_region_add(MemoryListener *listener,
MemoryRegionSection *section)
{
VFIOContainer *container = container_of(listener, VFIOContainer,
iommu_data.listener);
hwaddr iova, end;
void *vaddr;
int... | 1,587 |
FFmpeg | fd6e513ee1dc13174256de8adaeeb2c2691eee95 | 1 | static int mov_read_hdlr(MOVContext *c, ByteIOContext *pb, MOV_atom_t atom)
{
AVStream *st = c->fc->streams[c->fc->nb_streams-1];
int len = 0;
uint8_t *buf;
uint32_t type;
uint32_t ctype;
print_atom("hdlr", atom);
get_byte(pb); /* version */
get_byte(pb); get_byte(pb); get_b... | 1,588 |
qemu | 60fe637bf0e4d7989e21e50f52526444765c63b4 | 1 | static void qemu_rdma_dump_gid(const char *who, struct rdma_cm_id *id)
{
char sgid[33];
char dgid[33];
inet_ntop(AF_INET6, &id->route.addr.addr.ibaddr.sgid, sgid, sizeof sgid);
inet_ntop(AF_INET6, &id->route.addr.addr.ibaddr.dgid, dgid, sizeof dgid);
DPRINTF("%s Source GID: %s, Dest GID: %s\n"... | 1,589 |
FFmpeg | 11ca3416f92744f376c08e5f31bcbe5d9b44acb2 | 1 | static int v410_decode_frame(AVCodecContext *avctx, void *data,
int *data_size, AVPacket *avpkt)
{
AVFrame *pic = avctx->coded_frame;
uint8_t *src = avpkt->data;
uint16_t *y, *u, *v;
uint32_t val;
int i, j;
if (pic->data[0])
avctx->release_buffer(avctx, pic);... | 1,590 |
qemu | 6b2699672d5b56f8c2902fb9db9879e8cafb2afe | 1 | static void host_memory_backend_init(Object *obj)
{
HostMemoryBackend *backend = MEMORY_BACKEND(obj);
backend->merge = qemu_opt_get_bool(qemu_get_machine_opts(),
"mem-merge", true);
backend->dump = qemu_opt_get_bool(qemu_get_machine_opts(),
... | 1,591 |
FFmpeg | 33d7f822f8ed2d1870babc1d04d4d48cf8b6f240 | 1 | static void adaptive_gain_control(float *out, const float *in,
const float *speech_synth,
int size, float alpha, float *gain_mem)
{
int i;
float speech_energy = 0.0, postfilter_energy = 0.0, gain_scale_factor;
float mem = *gain_mem;
... | 1,592 |
qemu | 4b635c59b04cae594f49d9aa45d31b3f318def8f | 1 | void *qxl_phys2virt(PCIQXLDevice *qxl, QXLPHYSICAL pqxl, int group_id)
{
uint64_t phys = le64_to_cpu(pqxl);
uint32_t slot = (phys >> (64 - 8)) & 0xff;
uint64_t offset = phys & 0xffffffffffff;
switch (group_id) {
case MEMSLOT_GROUP_HOST:
return (void *)(intptr_t)offset;
cas... | 1,593 |
FFmpeg | 0181b202cc42133eacd74bad33745cf1ba699e6b | 1 | static void ps_add_squares_c(INTFLOAT *dst, const INTFLOAT (*src)[2], int n)
{
int i;
for (i = 0; i < n; i++)
dst[i] += AAC_MADD28(src[i][0], src[i][0], src[i][1], src[i][1]);
}
| 1,594 |
qemu | ce266b75febdeee5b91ab630a7158ddff3e002fb | 1 | static void rtas_ibm_change_msi(PowerPCCPU *cpu, sPAPRMachineState *spapr,
uint32_t token, uint32_t nargs,
target_ulong args, uint32_t nret,
target_ulong rets)
{
uint32_t config_addr = rtas_ld(args, 0);
uint64_... | 1,595 |
qemu | 7372c2b926200db295412efbb53f93773b7f1754 | 1 | static inline TCGv gen_extend(TCGv val, int opsize, int sign)
{
TCGv tmp;
switch (opsize) {
case OS_BYTE:
tmp = tcg_temp_new();
if (sign)
tcg_gen_ext8s_i32(tmp, val);
else
tcg_gen_ext8u_i32(tmp, val);
break;
case OS_WORD:
tmp ... | 1,596 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.