project stringclasses 2
values | commit_id stringlengths 40 40 | target int64 0 1 | func stringlengths 26 142k | idx int64 0 27.3k |
|---|---|---|---|---|
qemu | 70556264a89a268efba1d7e8e341adcdd7881eb4 | 1 | bool qvirtio_wait_config_isr(const QVirtioBus *bus, QVirtioDevice *d,
uint64_t timeout)
{
do {
clock_step(100);
if (bus->get_config_isr_status(d)) {
break; /* It has ended */
}
} while (--timeout);
ret... | 9,444 |
qemu | 8409dc884a201bf74b30a9d232b6bbdd00cb7e2b | 1 | void serial_exit_core(SerialState *s)
{
qemu_chr_fe_deinit(&s->chr);
qemu_unregister_reset(serial_reset, s);
} | 9,446 |
FFmpeg | 3e0e1634585b1a26b7d753aa42c7f350636927ae | 0 | int ff_nvdec_frame_params(AVCodecContext *avctx,
AVBufferRef *hw_frames_ctx,
int dpb_size)
{
AVHWFramesContext *frames_ctx = (AVHWFramesContext*)hw_frames_ctx->data;
const AVPixFmtDescriptor *sw_desc;
int cuvid_codec_type, cuvid_chroma_format;
... | 9,447 |
FFmpeg | 97b1ba696baa1bb87415bad244533ac2beaf3568 | 0 | static const char *ass_split_section(ASSSplitContext *ctx, const char *buf)
{
const ASSSection *section = &ass_sections[ctx->current_section];
int *number = &ctx->field_number[ctx->current_section];
int *order = ctx->field_order[ctx->current_section];
int *tmp, i, len;
while (buf && *buf) {
... | 9,448 |
FFmpeg | b5da07d4340a8e8e40dcd1900977a76ff31fbb84 | 0 | void ff_put_h264_qpel16_mc10_msa(uint8_t *dst, const uint8_t *src,
ptrdiff_t stride)
{
avc_luma_hz_qrt_16w_msa(src - 2, stride, dst, stride, 16, 0);
}
| 9,449 |
qemu | 09b9418c6d085a0728372aa760ebd10128a020b1 | 1 | static void do_memory_save(Monitor *mon, const QDict *qdict, QObject **ret_data)
{
FILE *f;
uint32_t size = qdict_get_int(qdict, "size");
const char *filename = qdict_get_str(qdict, "filename");
target_long addr = qdict_get_int(qdict, "val");
uint32_t l;
CPUState *env;
uint8_t buf[10... | 9,450 |
qemu | 2a6391232fa58f32469fb61d55343eff32a91083 | 1 | static uint32_t virtio_read_config(PCIDevice *pci_dev,
uint32_t address, int len)
{
VirtIOPCIProxy *proxy = DO_UPCAST(VirtIOPCIProxy, pci_dev, pci_dev);
struct virtio_pci_cfg_cap *cfg;
if (proxy->config_cap &&
ranges_overlap(address, len, proxy->config_cap ... | 9,451 |
qemu | b45c03f585ea9bb1af76c73e82195418c294919d | 1 | static struct omap_mcbsp_s *omap_mcbsp_init(MemoryRegion *system_memory,
hwaddr base,
qemu_irq txirq, qemu_irq rxirq,
qemu_irq *dma, omap_clk clk)
{
struct omap_mcbsp_s *s = (stru... | 9,452 |
qemu | f2c385220598523c8b9fefbfff1a6754cfd8232a | 1 | FWCfgState *pc_memory_init(MachineState *machine,
MemoryRegion *system_memory,
ram_addr_t below_4g_mem_size,
ram_addr_t above_4g_mem_size,
MemoryRegion *rom_memory,
MemoryRegion **ram_m... | 9,453 |
qemu | 6df5718bd3ec56225c44cf96440c723c1b611b87 | 1 | static MegasasCmd *megasas_next_frame(MegasasState *s,
hwaddr frame)
{
MegasasCmd *cmd = NULL;
int num = 0, index;
cmd = megasas_lookup_frame(s, frame);
if (cmd) {
trace_megasas_qf_found(cmd->index, cmd->pa);
return cmd;
}
index = s->reply_queue_head;
num = 0... | 9,454 |
FFmpeg | 328e203ca9b5e5afcd0769dae149075735150346 | 1 | static int mpegts_audio_write(void *opaque, uint8_t *buf, int size)
{
MpegTSWriteStream *ts_st = (MpegTSWriteStream *)opaque;
if (ts_st->adata_pos + size > ts_st->adata_size)
return AVERROR(EIO);
memcpy(ts_st->adata + ts_st->adata_pos, buf, size);
ts_st->adata_pos += size;
return ... | 9,455 |
FFmpeg | 9257692ac15eff7b07540c1f61cebde0d8823fbd | 1 | AVFormatContext *avformat_alloc_context(void)
{
AVFormatContext *ic;
ic = av_malloc(sizeof(AVFormatContext));
if (!ic) return ic;
avformat_get_context_defaults(ic);
ic->internal = av_mallocz(sizeof(*ic->internal));
if (!ic->internal) {
avformat_free_context(ic);
retur... | 9,456 |
qemu | c5a49c63fa26e8825ad101dfe86339ae4c216539 | 1 | void gen_intermediate_code(CPUState *cs, struct TranslationBlock *tb)
{
CPUSH4State *env = cs->env_ptr;
DisasContext ctx;
target_ulong pc_start;
int num_insns;
int max_insns;
pc_start = tb->pc;
ctx.pc = pc_start;
ctx.tbflags = (uint32_t)tb->flags;
ctx.envflags = tb->flags... | 9,459 |
qemu | d1f193b0edb919ab109f88c53469ec9073f2e142 | 1 | static void sh_serial_ioport_write(void *opaque, uint32_t offs, uint32_t val)
{
sh_serial_state *s = opaque;
unsigned char ch;
#ifdef DEBUG_SERIAL
printf("sh_serial: write offs=0x%02x val=0x%02x\n",
offs, val);
#endif
switch(offs) {
case 0x00: /* SMR */
s->smr = val & ((s->fe... | 9,461 |
FFmpeg | e55c3857d20ba015e4914c2e80fcab037af0799d | 0 | int attribute_align_arg avcodec_encode_audio(AVCodecContext *avctx,
uint8_t *buf, int buf_size,
const short *samples)
{
AVPacket pkt;
AVFrame frame0 = { 0 };
AVFrame *frame;
int ret, samples_size, got_packet... | 9,462 |
FFmpeg | 81e85bc95cb1e4f8cc7b1ba71ec027c8791b55d1 | 1 | static int matroska_parse_block(MatroskaDemuxContext *matroska, uint8_t *data,
int size, int64_t pos, uint64_t cluster_time,
uint64_t block_duration, int is_keyframe,
uint8_t *additional, uint64_t additional_id, int addit... | 9,463 |
qemu | 1b0952445522af73b0e78420a9078b3653923703 | 1 | static void test_hbitmap_iter_past(TestHBitmapData *data,
const void *unused)
{
hbitmap_test_init(data, L3, 0);
hbitmap_test_set(data, 0, L3);
hbitmap_test_check(data, L3);
}
| 9,465 |
qemu | 30fb2ca603e8b8d0f02630ef18bc0d0637a88ffa | 1 | int do_balloon(Monitor *mon, const QDict *params,
MonitorCompletion cb, void *opaque)
{
int ret;
if (kvm_enabled() && !kvm_has_sync_mmu()) {
qerror_report(QERR_KVM_MISSING_CAP, "synchronous MMU", "balloon");
return -1;
}
ret = qemu_balloon(qdict_get_int(params, "value... | 9,467 |
FFmpeg | 76d7c327eba042106b729e9d671b6f85f515b1af | 1 | static void gif_put_bits_rev(PutBitContext *s, int n, unsigned int value)
{
unsigned int bit_buf;
int bit_cnt;
// printf("put_bits=%d %x\n", n, value);
assert(n == 32 || value < (1U << n));
bit_buf = s->bit_buf;
bit_cnt = 32 - s->bit_left; /* XXX:lazyness... was = s->bit_cnt; */
... | 9,468 |
qemu | 60fe637bf0e4d7989e21e50f52526444765c63b4 | 1 | uint64_t qemu_get_be64(QEMUFile *f)
{
uint64_t v;
v = (uint64_t)qemu_get_be32(f) << 32;
v |= qemu_get_be32(f);
return v;
}
| 9,469 |
FFmpeg | 7cc84d241ba6ef8e27e4d057176a4ad385ad3d59 | 1 | static int decode_b_mbs(VC9Context *v)
{
MpegEncContext *s = &v->s;
GetBitContext *gb = &v->s.gb;
int current_mb = 0, i /* MB / B postion information */;
int b_mv_type = BMV_TYPE_BACKWARD;
int mquant, mqdiff; /* MB quant stuff */
int ttmb; /* MacroBlock transform type */
static... | 9,470 |
qemu | 4f4321c11ff6e98583846bfd6f0e81954924b003 | 1 | static int ehci_execute(EHCIQueue *q)
{
USBPort *port;
USBDevice *dev;
int ret;
int i;
int endp;
int devadr;
if ( !(q->qh.token & QTD_TOKEN_ACTIVE)) {
fprintf(stderr, "Attempting to execute inactive QH\n");
return USB_RET_PROCERR;
}
q->tbytes = (q->qh.... | 9,471 |
qemu | 7843c0d60db694b6d97e14ec5538fb97424016c1 | 1 | static void powerpc_set_compat(Object *obj, Visitor *v, const char *name,
void *opaque, Error **errp)
{
Error *error = NULL;
char *value = NULL;
Property *prop = opaque;
uint32_t *max_compat = qdev_get_prop_ptr(DEVICE(obj), prop);
visit_type_str(v, name, &valu... | 9,472 |
qemu | 0b5538c300a56c3cfb33022840fe0b4968147e7a | 1 | static bool write_header(FILE *fp)
{
static const TraceRecord header = {
.event = HEADER_EVENT_ID,
.timestamp_ns = HEADER_MAGIC,
.x1 = HEADER_VERSION,
};
return fwrite(&header, sizeof header, 1, fp) == 1;
}
| 9,473 |
FFmpeg | a6e9448dc6971ba4e196656de3e6cd7bcac2cb8f | 1 | static int encode_mode(CinepakEncContext *s, int h, AVPicture *scratch_pict, AVPicture *last_pict, strip_info *info, unsigned char *buf)
{
int x, y, z, flags, bits, temp_size, header_ofs, ret = 0, mb_count = s->w * h / MB_AREA;
int needs_extra_bit, should_write_temp;
unsigned char temp[64]; //32/2 = 16 ... | 9,474 |
qemu | dc520a7dee0a9307e844eb6c5d4b21482bf52fcd | 1 | void mips_malta_init(MachineState *machine)
{
ram_addr_t ram_size = machine->ram_size;
ram_addr_t ram_low_size;
const char *cpu_model = machine->cpu_model;
const char *kernel_filename = machine->kernel_filename;
const char *kernel_cmdline = machine->kernel_cmdline;
const char *initrd_file... | 9,475 |
FFmpeg | 5ecfcc7dff04ff0e86d8b6b3a33709ae956dfef7 | 0 | static void video_refresh(void *opaque, double *remaining_time)
{
VideoState *is = opaque;
VideoPicture *vp;
double time;
SubPicture *sp, *sp2;
if (!is->paused && get_master_sync_type(is) == AV_SYNC_EXTERNAL_CLOCK && is->realtime)
check_external_clock_speed(is);
if (!displa... | 9,476 |
FFmpeg | 9d87374ec0f382c8394ad511243db6980afa42af | 0 | static void extrapolate_isf(float out[LP_ORDER_16k], float isf[LP_ORDER])
{
float diff_isf[LP_ORDER - 2], diff_mean;
float *diff_hi = diff_isf - LP_ORDER + 1; // diff array for extrapolated indexes
float corr_lag[3];
float est, scale;
int i, i_max_corr;
memcpy(out, isf, (LP_ORDER - 1) *... | 9,477 |
FFmpeg | 224afddc7c869472caa57fc571aaf979a85d24ef | 0 | static int get_video_private_data(struct VideoFile *vf, AVCodecContext *codec)
{
AVIOContext *io = NULL;
uint16_t sps_size, pps_size;
int err = AVERROR(EINVAL);
if (codec->codec_id == AV_CODEC_ID_VC1)
return get_private_data(vf, codec);
avio_open_dyn_buf(&io);
if (codec->extr... | 9,478 |
FFmpeg | c77b858c4cafe74cd663bdd1bc9d96a487b20e14 | 0 | static void FUNCC(pred8x8l_horizontal)(uint8_t *p_src, int has_topleft, int has_topright, int p_stride)
{
pixel *src = (pixel*)p_src;
int stride = p_stride>>(sizeof(pixel)-1);
PREDICT_8x8_LOAD_LEFT;
#define ROW(y) ((pixel4*)(src+y*stride))[0] =\
((pixel4*)(src+y*stride))[1] = PIXEL_SP... | 9,479 |
FFmpeg | 7c9d2ad45f4e46ad2c3b2e93051efbe1e0d0529e | 0 | static int dca_parse_params(DCAParseContext *pc1, const uint8_t *buf,
int buf_size, int *duration, int *sample_rate,
int *profile)
{
DCAExssAsset *asset = &pc1->exss.assets[0];
GetBitContext gb;
DCACoreFrameHeader h;
uint8_t hdr[DCA_CORE_FRA... | 9,480 |
FFmpeg | 65db4899fa8790049bec3af16ecdb75dd81051fd | 1 | static int ffmmal_fill_input_port(AVCodecContext *avctx)
{
MMALDecodeContext *ctx = avctx->priv_data;
while (ctx->waiting_buffers) {
MMAL_BUFFER_HEADER_T *mbuffer;
FFBufferEntry *buffer;
MMAL_STATUS_T status;
mbuffer = mmal_queue_get(ctx->pool_in->queue);
if (... | 9,484 |
FFmpeg | 1afd246960202917e244c844c534e9c1e3c323f5 | 1 | static av_always_inline int decode_mb_row_no_filter(AVCodecContext *avctx, void *tdata,
int jobnr, int threadnr, int is_vp7)
{
VP8Context *s = avctx->priv_data;
VP8ThreadData *prev_td, *next_td, *td = &s->thread_data[threadnr];
int mb_y = td->thread_mb_pos >> 16;... | 9,485 |
FFmpeg | 6fea8454acff29735ea46184cb183ca6ff42e514 | 1 | static test_speed(int step)
{
const struct pix_func* pix = pix_func;
const int linesize = 720;
char empty[32768];
char* bu =(char*)(((long)empty + 32) & ~0xf);
int sum = 0;
while (pix->name)
{
int i;
uint64_t te, ts;
op_pixels_func func = pix->func;
char* im... | 9,486 |
FFmpeg | cbba331aa02f29870581ff0b7ded7477b279ae2c | 0 | static void writer_print_ts(WriterContext *wctx, const char *key, int64_t ts, int is_duration)
{
if ((!is_duration && ts == AV_NOPTS_VALUE) || (is_duration && ts == 0)) {
writer_print_string(wctx, key, "N/A", 1);
} else {
writer_print_integer(wctx, key, ts);
}
}
| 9,487 |
FFmpeg | 1d16a1cf99488f16492b1bb48e023f4da8377e07 | 0 | static void ff_h264_idct8_add4_sse2(uint8_t *dst, const int *block_offset, DCTELEM *block, int stride, const uint8_t nnzc[6*8]){
int i;
for(i=0; i<16; i+=4){
int nnz = nnzc[ scan8[i] ];
if(nnz){
if(nnz==1 && block[i*16]) ff_h264_idct8_dc_add_mmx2(dst + block_offset[i], block + i... | 9,488 |
FFmpeg | 1181d93231e9b807965724587d363c1cfd5a1d0d | 0 | void ff_avg_h264_qpel16_mc31_msa(uint8_t *dst, const uint8_t *src,
ptrdiff_t stride)
{
avc_luma_hv_qrt_and_aver_dst_16x16_msa(src - 2,
src - (stride * 2) +
sizeof(uint8_t), stride,
... | 9,489 |
FFmpeg | 6ffa87d3254dd8bdc31b50b378e1cf59c5dc13e5 | 0 | int av_tempfile(char *prefix, char **filename) {
int fd=-1;
#ifdef __MINGW32__
*filename = tempnam(".", prefix);
#else
size_t len = strlen(prefix) + 12; /* room for "/tmp/" and "XXXXXX\0" */
*filename = av_malloc(len);
#endif
/* -----common section-----*/
if (*filename == NULL) {
... | 9,490 |
FFmpeg | e6c90ce94f1b07f50cea2babf7471af455cca0ff | 0 | static av_always_inline void xchg_mb_border(H264Context *h, H264SliceContext *sl,
uint8_t *src_y,
uint8_t *src_cb, uint8_t *src_cr,
int linesize, int uvlinesize,
... | 9,491 |
FFmpeg | fb7a2bf6956173eda6f9caceef8599fa4f83500d | 0 | unsigned int codec_get_tag(const CodecTag *tags, int id)
{
while (tags->id != 0) {
if (tags->id == id)
return tags->tag;
tags++;
}
return 0;
}
| 9,492 |
FFmpeg | 23a1f0c59241465ba30103388029a7afc0ead909 | 1 | static int rv34_decode_slice(RV34DecContext *r, int end, const uint8_t* buf, int buf_size)
{
MpegEncContext *s = &r->s;
GetBitContext *gb = &s->gb;
int mb_pos;
int res;
init_get_bits(&r->s.gb, buf, buf_size*8);
res = r->parse_slice_header(r, gb, &r->si);
if(res < 0){
av_log(s->avctx,... | 9,493 |
FFmpeg | 7f526efd17973ec6d2204f7a47b6923e2be31363 | 1 | static inline void RENAME(bgr24ToUV)(uint8_t *dstU, uint8_t *dstV, uint8_t *src1, uint8_t *src2, int width)
{
#ifdef HAVE_MMX
asm volatile(
"mov %4, %%"REG_a" \n\t"
"movq "MANGLE(w1111)", %%mm5 \n\t"
"movq "MANGLE(bgr2UCoeff)", %%mm6 \n\t"
"pxor %%mm7, %%mm7 \n\t"
"lea (%%"REG_a", %%"REG_a", 2), ... | 9,494 |
qemu | 302a0d3ed721e4c30c6a2a37f64c60b50ffd33b9 | 1 | static size_t pdu_marshal(V9fsPDU *pdu, size_t offset, const char *fmt, ...)
{
size_t old_offset = offset;
va_list ap;
int i;
va_start(ap, fmt);
for (i = 0; fmt[i]; i++) {
switch (fmt[i]) {
case 'b': {
uint8_t val = va_arg(ap, int);
offset += pdu_p... | 9,496 |
FFmpeg | f19442c069929727b19c948619488370d279e177 | 1 | static inline uint32_t celt_icwrsi(uint32_t N, uint32_t K, const int *y)
{
int i, idx = 0, sum = 0;
for (i = N - 1; i >= 0; i--) {
const uint32_t i_s = CELT_PVQ_U(N - i, sum + FFABS(y[i]) + 1);
idx += CELT_PVQ_U(N - i, sum) + (y[i] < 0)*i_s;
sum += FFABS(y[i]);
}
av_asser... | 9,497 |
FFmpeg | 1ca610c0152f31847ab760fda1fb147692f31e7e | 1 | static int matroska_read_header(AVFormatContext *s, AVFormatParameters *ap)
{
MatroskaDemuxContext *matroska = s->priv_data;
EbmlList *attachements_list = &matroska->attachments;
MatroskaAttachement *attachements;
EbmlList *chapters_list = &matroska->chapters;
MatroskaChapter *chapters;
M... | 9,498 |
FFmpeg | 599d746e07319dc792ed2e511b666fe482f1ff88 | 1 | static int vp8_decode_frame_header(VP8Context *s, const uint8_t *buf, int buf_size)
{
VP56RangeCoder *c = &s->c;
int header_size, hscale, vscale, ret;
int width = s->avctx->width;
int height = s->avctx->height;
s->keyframe = !(buf[0] & 1);
s->profile = (buf[0]>>1) & 7;
s->invisible = !(... | 9,499 |
FFmpeg | 1d0817d56b66797118880358ea7d7a2acfdca429 | 1 | static float voice_factor(float *p_vector, float p_gain,
float *f_vector, float f_gain,
CELPMContext *ctx)
{
double p_ener = (double) ctx->dot_productf(p_vector, p_vector,
AMRWB_SFR_SIZE) *
... | 9,500 |
qemu | eb2a770b178b9040c3fc04ee31dc38d1775db09a | 1 | static int qcrypto_cipher_setiv_aes(QCryptoCipher *cipher,
const uint8_t *iv, size_t niv,
Error **errp)
{
QCryptoCipherBuiltin *ctxt = cipher->opaque;
if (niv != 16) {
error_setg(errp, "IV must be 16 bytes not %zu", niv);
... | 9,501 |
FFmpeg | fe533628b9604e2f8e5179d5c5dd17c3cb764265 | 1 | int ff_jpegls_decode_picture(MJpegDecodeContext *s, int near,
int point_transform, int ilv)
{
int i, t = 0;
uint8_t *zero, *last, *cur;
JLSState *state;
int off = 0, stride = 1, width, shift, ret = 0;
zero = av_mallocz(s->picture_ptr->linesize[0]);
if (!zer... | 9,502 |
qemu | 4ab29b8214cc4b54e0c1a8270b610a340311470e | 1 | static void create_gic(const VirtBoardInfo *vbi, qemu_irq *pic)
{
/* We create a standalone GIC v2 */
DeviceState *gicdev;
SysBusDevice *gicbusdev;
const char *gictype = "arm_gic";
int i;
if (kvm_irqchip_in_kernel()) {
gictype = "kvm-arm-gic";
}
gicdev = qdev_create... | 9,503 |
qemu | a08aaff811fb194950f79711d2afe5a892ae03a4 | 1 | virtio_crypto_sym_op_helper(VirtIODevice *vdev,
struct virtio_crypto_cipher_para *cipher_para,
struct virtio_crypto_alg_chain_data_para *alg_chain_para,
struct iovec *iov, unsigned int out_num)
{
VirtIOCrypto *vcrypto = VIRTIO_CRYPTO(vdev);
CryptoDevBackendSymOpInfo *op_in... | 9,504 |
qemu | 5c843af22604edecda10d4bb89d4eede9e1bd3d0 | 1 | int net_slirp_parse_legacy(QemuOptsList *opts_list, const char *optarg, int *ret)
{
if (strcmp(opts_list->name, "net") != 0 ||
strncmp(optarg, "channel,", strlen("channel,")) != 0) {
return 0;
}
error_report("The '-net channel' option is deprecated. "
"Please use '-... | 9,505 |
FFmpeg | 6abc56e892c2c2500d1fc2698fa6d580b72f721b | 1 | static int shall_we_drop(AVFormatContext *s)
{
struct dshow_ctx *ctx = s->priv_data;
static const uint8_t dropscore[] = {62, 75, 87, 100};
const int ndropscores = FF_ARRAY_ELEMS(dropscore);
unsigned int buffer_fullness = (ctx->curbufsize*100)/s->max_picture_buffer;
if(dropscore[++ctx->video_... | 9,506 |
qemu | 7d1b0095bff7157e856d1d0e6c4295641ced2752 | 1 | static int disas_dsp_insn(CPUState *env, DisasContext *s, uint32_t insn)
{
int acc, rd0, rd1, rdhi, rdlo;
TCGv tmp, tmp2;
if ((insn & 0x0ff00f10) == 0x0e200010) {
/* Multiply with Internal Accumulate Format */
rd0 = (insn >> 12) & 0xf;
rd1 = insn & 0xf;
acc = (insn ... | 9,507 |
FFmpeg | 0d0d24af0159ff08f396ad04cd63ce5655b1fc60 | 1 | static void decode_profile_tier_level(HEVCContext *s, PTLCommon *ptl)
{
int i;
HEVCLocalContext *lc = s->HEVClc;
GetBitContext *gb = &lc->gb;
ptl->profile_space = get_bits(gb, 2);
ptl->tier_flag = get_bits1(gb);
ptl->profile_idc = get_bits(gb, 5);
if (ptl->profile_idc == FF_P... | 9,511 |
qemu | bbc5842211cdd90103cfe52f2ca24afac880694f | 1 | qemu_irq *mpic_init (target_phys_addr_t base, int nb_cpus,
qemu_irq **irqs, qemu_irq irq_out)
{
openpic_t *mpp;
int i;
struct {
CPUReadMemoryFunc * const *read;
CPUWriteMemoryFunc * const *write;
target_phys_addr_t start_addr;
ram_addr_t size;... | 9,513 |
FFmpeg | 9425dc3dba0bd1209aa7a788ea8f3c194fc7c7c5 | 1 | static void float_to_int16_stride_altivec(int16_t *dst, const float *src,
long len, int stride)
{
int i, j;
vector signed short d, s;
for (i = 0; i < len - 7; i += 8) {
d = float_to_int16_one_altivec(src + i);
for (j = 0; j < 8; j++) {
... | 9,517 |
qemu | 25e5e4c7e9d5ec3e95c9526d1abaca40ada50ab0 | 1 | ssize_t iov_send_recv(int sockfd, struct iovec *iov,
size_t offset, size_t bytes,
bool do_sendv)
{
int iovlen;
ssize_t ret;
size_t diff;
struct iovec *last_iov;
/* last_iov is inclusive, so count from one. */
iovlen = 1;
last_iov = iov... | 9,518 |
qemu | c599d4d6d6e9bfdb64e54c33a22cb26e3496b96d | 1 | static long do_rt_sigreturn_v2(CPUARMState *env)
{
abi_ulong frame_addr;
struct rt_sigframe_v2 *frame = NULL;
/*
* Since we stacked the signal on a 64-bit boundary,
* then 'sp' should be word aligned here. If it's
* not, then the user is trying to mess with us.
*/
frame_a... | 9,519 |
FFmpeg | ac4b32df71bd932838043a4838b86d11e169707f | 1 | static void vp8_h_loop_filter_simple_c(uint8_t *dst, ptrdiff_t stride, int flim)
{
int i;
for (i = 0; i < 16; i++)
if (simple_limit(dst + i * stride, 1, flim))
filter_common(dst + i * stride, 1, 1);
}
| 9,520 |
FFmpeg | 1eb1f6f281eb6036d363e0317c1500be4a2708f2 | 1 | static void gain_scale(G723_1_Context *p, int16_t * buf, int energy)
{
int num, denom, gain, bits1, bits2;
int i;
num = energy;
denom = 0;
for (i = 0; i < SUBFRAME_LEN; i++) {
int64_t temp = buf[i] >> 2;
temp = av_clipl_int32(MUL64(temp, temp) << 1);
denom = av_... | 9,521 |
qemu | a97fed52e57385fc749e6f6ef95be7ebdb81ba9b | 1 | void OPPROTO op_store_msr_32 (void)
{
ppc_store_msr_32(env, T0);
RETURN();
}
| 9,524 |
qemu | 0bd695a960bf05f27ad6d710d2b64059037574ce | 1 | int s390_cpu_handle_mmu_fault(CPUState *cs, vaddr orig_vaddr,
int rw, int mmu_idx)
{
S390CPU *cpu = S390_CPU(cs);
CPUS390XState *env = &cpu->env;
uint64_t asc = cpu_mmu_idx_to_asc(mmu_idx);
target_ulong vaddr, raddr;
int prot;
DPRINTF("%s: address 0x%" VAD... | 9,525 |
FFmpeg | 7fd65104f489302188a91af710b7520dc9ba7b04 | 1 | static int ffm_seek(AVFormatContext *s, int stream_index, int64_t wanted_pts, int flags)
{
FFMContext *ffm = s->priv_data;
int64_t pos_min, pos_max, pos;
int64_t pts_min, pts_max, pts;
double pos1;
av_dlog(s, "wanted_pts=%0.6f\n", wanted_pts / 1000000.0);
/* find the position using line... | 9,526 |
qemu | af7e9e74c6a62a5bcd911726a9e88d28b61490e0 | 1 | static void openpic_load_IRQ_queue(QEMUFile* f, IRQ_queue_t *q)
{
unsigned int i;
for (i = 0; i < BF_WIDTH(MAX_IRQ); i++)
qemu_get_be32s(f, &q->queue[i]);
qemu_get_sbe32s(f, &q->next);
qemu_get_sbe32s(f, &q->priority);
}
| 9,527 |
qemu | 210b580b106fa798149e28aa13c66b325a43204e | 0 | static void rtas_set_time_of_day(sPAPREnvironment *spapr,
uint32_t token, uint32_t nargs,
target_ulong args,
uint32_t nret, target_ulong rets)
{
struct tm tm;
tm.tm_year = rtas_ld(args, 0) - 1900;
tm.... | 9,529 |
qemu | 6bdc21c050a2a7b92cbbd0b2a1f8934e9b5f896f | 0 | void virtqueue_map(VirtIODevice *vdev, VirtQueueElement *elem)
{
virtqueue_map_iovec(vdev, elem->in_sg, elem->in_addr, &elem->in_num,
MIN(ARRAY_SIZE(elem->in_sg), ARRAY_SIZE(elem->in_addr)),
1);
virtqueue_map_iovec(vdev, elem->out_sg, elem->out_addr, &elem->o... | 9,530 |
qemu | b10170aca0616df85482dcc7ddda03437bc07cca | 0 | static int qed_write_header_sync(BDRVQEDState *s)
{
QEDHeader le;
int ret;
qed_header_cpu_to_le(&s->header, &le);
ret = bdrv_pwrite(s->bs->file, 0, &le, sizeof(le));
if (ret != sizeof(le)) {
return ret;
}
return 0;
}
| 9,531 |
qemu | 583f21f8b9982d60c451e812af2d9dfe19d19d3f | 0 | int v9fs_device_realize_common(V9fsState *s, Error **errp)
{
V9fsVirtioState *v = container_of(s, V9fsVirtioState, state);
int i, len;
struct stat stat;
FsDriverEntry *fse;
V9fsPath path;
int rc = 1;
/* initialize pdu allocator */
QLIST_INIT(&s->free_list);
QLIST_INIT(&s-... | 9,532 |
qemu | 7102fa7073b2cefb33ab4012a11f15fbf297a74b | 0 | static void pc_compat_1_6(MachineState *machine)
{
pc_compat_1_7(machine);
rom_file_has_mr = false;
has_acpi_build = false;
}
| 9,534 |
qemu | b84c4586234b26ccc875595713f6f4491e5b3385 | 0 | static void __attribute__((destructor)) coroutine_cleanup(void)
{
Coroutine *co;
Coroutine *tmp;
QSLIST_FOREACH_SAFE(co, &pool, pool_next, tmp) {
QSLIST_REMOVE_HEAD(&pool, pool_next);
qemu_coroutine_delete(co);
}
}
| 9,535 |
qemu | 72cf2d4f0e181d0d3a3122e04129c58a95da713e | 0 | int qemu_acl_party_is_allowed(qemu_acl *acl,
const char *party)
{
qemu_acl_entry *entry;
TAILQ_FOREACH(entry, &acl->entries, next) {
#ifdef CONFIG_FNMATCH
if (fnmatch(entry->match, party, 0) == 0)
return entry->deny ? 0 : 1;
#else
/* No fnmatc... | 9,536 |
qemu | b2c98d9d392c87c9b9e975d30f79924719d9cbbe | 0 | static void tcg_out_ld_abs(TCGContext *s, TCGType type, TCGReg dest, void *abs)
{
intptr_t addr = (intptr_t)abs;
if ((facilities & FACILITY_GEN_INST_EXT) && !(addr & 1)) {
ptrdiff_t disp = tcg_pcrel_diff(s, abs) >> 1;
if (disp == (int32_t)disp) {
if (type == TCG_TYPE_I32) {
... | 9,537 |
qemu | ddca7f86ac022289840e0200fd4050b2b58e9176 | 0 | static void v9fs_wstat(void *opaque)
{
int32_t fid;
int err = 0;
int16_t unused;
V9fsStat v9stat;
size_t offset = 7;
struct stat stbuf;
V9fsFidState *fidp;
V9fsPDU *pdu = opaque;
V9fsState *s = pdu->s;
pdu_unmarshal(pdu, offset, "dwS", &fid, &unused, &v9stat);
t... | 9,539 |
qemu | 1fdd4b7be3655d39c3594bc215eb1df5ce225c7d | 0 | static void drive_backup_prepare(BlkTransactionState *common, Error **errp)
{
DriveBackupState *state = DO_UPCAST(DriveBackupState, common, common);
BlockBackend *blk;
DriveBackup *backup;
Error *local_err = NULL;
assert(common->action->kind == TRANSACTION_ACTION_KIND_DRIVE_BACKUP);
bac... | 9,541 |
qemu | b0ee3ff06e54a30b1540c08507b873a00192aa0e | 0 | void helper_ltr_T0(void)
{
int selector;
SegmentCache *dt;
uint32_t e1, e2;
int index, type, entry_limit;
target_ulong ptr;
selector = T0 & 0xffff;
if ((selector & 0xfffc) == 0) {
/* NULL selector case: invalid TR */
env->tr.base = 0;
env->tr.limit = ... | 9,542 |
qemu | 5ad23e873c858292dc58b9296261365312b8f683 | 0 | static void uhci_async_cancel_device(UHCIState *s, USBDevice *dev)
{
UHCIQueue *queue;
UHCIAsync *curr, *n;
QTAILQ_FOREACH(queue, &s->queues, next) {
QTAILQ_FOREACH_SAFE(curr, &queue->asyncs, next, n) {
if (!usb_packet_is_inflight(&curr->packet) ||
curr->packet.e... | 9,543 |
FFmpeg | 2c660e34cf3c2b77cd2bef6f292920334dfd9192 | 0 | static int dnxhd_decode_macroblock(DNXHDContext *ctx, AVFrame *frame,
int x, int y)
{
int shift1 = ctx->bit_depth == 10;
int dct_linesize_luma = frame->linesize[0];
int dct_linesize_chroma = frame->linesize[1];
uint8_t *dest_y, *dest_u, *dest_v;
int dct_y_... | 9,544 |
FFmpeg | f44b08a5a0ee46b52a9a608cbf2d075eab93db61 | 0 | static void apply_loop_filter(Vp3DecodeContext *s)
{
int x, y, plane;
int width, height;
int fragment;
int stride;
unsigned char *plane_data;
int bounding_values_array[256];
int *bounding_values= bounding_values_array+127;
int filter_limit;
/* find the right loop limit ... | 9,545 |
qemu | 65ff544b41c4e097d49a0c81b97cb2f9f9b039b8 | 0 | static int vt82c686b_ide_initfn(PCIDevice *dev)
{
PCIIDEState *d = DO_UPCAST(PCIIDEState, dev, dev);;
uint8_t *pci_conf = d->dev.config;
pci_config_set_vendor_id(pci_conf, PCI_VENDOR_ID_VIA);
pci_config_set_device_id(pci_conf, PCI_DEVICE_ID_VIA_IDE);
pci_config_set_class(pci_conf, PCI_CLASS_... | 9,547 |
qemu | ee785fed5dd035d4b12142cacec6d3c344426dec | 0 | void set_numa_modes(void)
{
CPUArchState *env;
int i;
for (env = first_cpu; env != NULL; env = env->next_cpu) {
for (i = 0; i < nb_numa_nodes; i++) {
if (node_cpumask[i] & (1 << env->cpu_index)) {
env->numa_node = i;
}
}
}
}
| 9,549 |
qemu | a89f364ae8740dfc31b321eed9ee454e996dc3c1 | 0 | static void omap_mcbsp_writew(void *opaque, hwaddr addr,
uint32_t value)
{
struct omap_mcbsp_s *s = (struct omap_mcbsp_s *) opaque;
int offset = addr & OMAP_MPUI_REG_MASK;
if (offset == 0x04) { /* DXR */
if (((s->xcr[0] >> 5) & 7) < 3) /* XWDLEN1 */
return;
... | 9,550 |
qemu | 8d5c773e323b22402abdd0beef4c7d2fc91dd0eb | 0 | static void fcse_write(CPUARMState *env, const ARMCPRegInfo *ri, uint64_t value)
{
ARMCPU *cpu = arm_env_get_cpu(env);
if (env->cp15.c13_fcse != value) {
/* Unlike real hardware the qemu TLB uses virtual addresses,
* not modified virtual addresses, so this causes a TLB flush.
*... | 9,551 |
qemu | a8170e5e97ad17ca169c64ba87ae2f53850dab4c | 0 | static void bw_io_write(void *opaque, target_phys_addr_t addr,
uint64_t val, unsigned size)
{
switch (size) {
case 1:
cpu_outb(addr, val);
break;
case 2:
cpu_outw(addr, val);
break;
case 4:
cpu_outl(addr, val);
break;
... | 9,552 |
qemu | 08225676b279fd14683275b65ed701972e008043 | 0 | static void check_watchpoint(int offset, int len, int flags)
{
CPUState *cpu = current_cpu;
CPUArchState *env = cpu->env_ptr;
target_ulong pc, cs_base;
target_ulong vaddr;
CPUWatchpoint *wp;
int cpu_flags;
if (cpu->watchpoint_hit) {
/* We re-entered the check after replaci... | 9,553 |
qemu | 6315633b2535dc82dc1b3403f884b81e26b4c72c | 0 | static void *qpa_thread_in (void *arg)
{
PAVoiceIn *pa = arg;
HWVoiceIn *hw = &pa->hw;
int threshold;
threshold = conf.divisor ? hw->samples / conf.divisor : 0;
if (audio_pt_lock (&pa->pt, AUDIO_FUNC)) {
return NULL;
}
for (;;) {
int incr, to_grab, wpos;
... | 9,554 |
qemu | 64c7b9d8e07936383db181876b59c597d6a1ff69 | 0 | void check_file_unfixed_eof_mmaps(void)
{
char *cp;
unsigned int *p1;
uintptr_t p;
int i;
fprintf (stderr, "%s", __func__);
for (i = 0; i < 0x10; i++)
{
p1 = mmap(NULL, pagesize, PROT_READ,
MAP_PRIVATE,
test_fd,
(test_fsize - sizeof *p1) & ~pagemask);
fail_unless (p1 != MAP... | 9,555 |
FFmpeg | 224944895efe6ac23e3b8f9d35abfee9f5c6c440 | 0 | static int64_t update_scr(AVFormatContext *ctx,int stream_index,int64_t pts)
{
MpegMuxContext *s = ctx->priv_data;
int64_t scr;
if (s->is_vcd)
/* Since the data delivery rate is constant, SCR is computed
using the formula C + i * 1200 where C is the start constant
and ... | 9,556 |
qemu | 3a1f426828cd8ffeec1a4fa8ca6ca3ed4f800edb | 0 | static int decode_micromips_opc (CPUMIPSState *env, DisasContext *ctx)
{
uint32_t op;
/* make sure instructions are on a halfword boundary */
if (ctx->pc & 0x1) {
env->CP0_BadVAddr = ctx->pc;
generate_exception(ctx, EXCP_AdEL);
ctx->bstate = BS_STOP;
return 2;
... | 9,557 |
qemu | 6ef228fc0de1d5fb43ebfef039563d39a3a37067 | 0 | static void ratelimit_set_speed(RateLimit *limit, uint64_t speed)
{
limit->slice_quota = speed / (1000000000ULL / SLICE_TIME);
}
| 9,558 |
qemu | a90a7425cf592a3afeff3eaf32f543b83050ee5c | 0 | static void tap_update_fd_handler(TAPState *s)
{
qemu_set_fd_handler2(s->fd,
s->read_poll && s->enabled ? tap_can_send : NULL,
s->read_poll && s->enabled ? tap_send : NULL,
s->write_poll && s->enabled ? tap_writable : NULL,
... | 9,559 |
qemu | 8832cb805dcb65009b979cd8e17d75ac4b03c7e4 | 0 | static void pc_init1(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,
int pci_enab... | 9,560 |
qemu | 97f90cbfe810bb153fc44bde732d9639610783bb | 0 | static void dec_mul(DisasContext *dc)
{
TCGv d[2];
unsigned int subcode;
if ((dc->tb_flags & MSR_EE_FLAG)
&& !(dc->env->pvr.regs[2] & PVR2_ILL_OPCODE_EXC_MASK)
&& !(dc->env->pvr.regs[0] & PVR0_USE_HW_MUL_MASK)) {
tcg_gen_movi_tl(cpu_SR[SR_ESR], ESR_EC_ILLEGAL_OP);
... | 9,561 |
qemu | a8170e5e97ad17ca169c64ba87ae2f53850dab4c | 0 | static void fimd_update_memory_section(Exynos4210fimdState *s, unsigned win)
{
Exynos4210fimdWindow *w = &s->window[win];
target_phys_addr_t fb_start_addr, fb_mapped_len;
if (!s->enabled || !(w->wincon & FIMD_WINCON_ENWIN) ||
FIMD_WINDOW_PROTECTED(s->shadowcon, win)) {
return;
... | 9,562 |
qemu | a369da5f31ddbdeb32a7f76622e480d3995fbb00 | 0 | PCIDevice *pci_try_create_multifunction(PCIBus *bus, int devfn,
bool multifunction,
const char *name)
{
DeviceState *dev;
dev = qdev_try_create(&bus->qbus, name);
if (!dev) {
return NULL;
}
qdev_prop_s... | 9,563 |
qemu | 6e0d8677cb443e7408c0b7a25a93c6596d7fa380 | 0 | void OPPROTO op_addq_ESI_T0(void)
{
ESI = (ESI + T0);
}
| 9,564 |
FFmpeg | 0e70266bbfade1457189cc402cab2cdd7ec94c7b | 0 | static int mov_write_trailer(AVFormatContext *s)
{
MOVMuxContext *mov = s->priv_data;
AVIOContext *pb = s->pb;
int res = 0;
int i;
int64_t moov_pos;
/*
* Before actually writing the trailer, make sure that there are no
* dangling subtitles, that need a terminating sample.
... | 9,565 |
qemu | 621ff94d5074d88253a5818c6b9c4db718fbfc65 | 0 | static void acquire_privilege(const char *name, Error **errp)
{
HANDLE token = NULL;
TOKEN_PRIVILEGES priv;
Error *local_err = NULL;
if (OpenProcessToken(GetCurrentProcess(),
TOKEN_ADJUST_PRIVILEGES|TOKEN_QUERY, &token))
{
if (!LookupPrivilegeValue(NULL, name, &priv.Privile... | 9,566 |
qemu | 031380d8770d2df6c386e4aeabd412007d3ebd54 | 0 | static int aio_write_f(int argc, char **argv)
{
int nr_iov, c;
int pattern = 0xcd;
struct aio_ctx *ctx = calloc(1, sizeof(struct aio_ctx));
while ((c = getopt(argc, argv, "CqP:")) != EOF) {
switch (c) {
case 'C':
ctx->Cflag = 1;
break;
case 'q'... | 9,567 |
qemu | 88e89a57f985296a6eeb416b2a875072e09d7faa | 0 | void tlb_set_page(CPUState *cpu, target_ulong vaddr,
hwaddr paddr, int prot,
int mmu_idx, target_ulong size)
{
CPUArchState *env = cpu->env_ptr;
MemoryRegionSection *section;
unsigned int index;
target_ulong address;
target_ulong code_address;
uintptr... | 9,568 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.