project stringclasses 2
values | commit_id stringlengths 40 40 | target int64 0 1 | func stringlengths 26 142k | idx int64 0 27.3k |
|---|---|---|---|---|
qemu | 9dbbc748d671c70599101836cd1c2719d92f3017 | 0 | static int disas_neon_data_insn(DisasContext *s, uint32_t insn)
{
int op;
int q;
int rd, rn, rm;
int size;
int shift;
int pass;
int count;
int pairwise;
int u;
uint32_t imm, mask;
TCGv_i32 tmp, tmp2, tmp3, tmp4, tmp5;
TCGv_i64 tmp64;
/* FIXME: this acc... | 21,733 |
qemu | 210b580b106fa798149e28aa13c66b325a43204e | 0 | static void rtas_int_on(sPAPREnvironment *spapr, uint32_t token,
uint32_t nargs, target_ulong args,
uint32_t nret, target_ulong rets)
{
struct ics_state *ics = spapr->icp->ics;
uint32_t nr;
if ((nargs != 1) || (nret != 1)) {
rtas_st(rets, 0, -... | 21,734 |
qemu | 25b422eb4051b9b7473feea1ae848f1e3b4f799f | 0 | static void do_info(Monitor *mon, const QDict *qdict, QObject **ret_data)
{
const mon_cmd_t *cmd;
const char *item = qdict_get_try_str(qdict, "item");
if (!item)
goto help;
for (cmd = info_cmds; cmd->name != NULL; cmd++) {
if (compare_cmd(item, cmd->name))
break;
... | 21,735 |
qemu | 68d553587c0aa271c3eb2902921b503740d775b6 | 0 | static int ehci_state_fetchsitd(EHCIState *ehci, int async)
{
uint32_t entry;
EHCIsitd sitd;
assert(!async);
entry = ehci_get_fetch_addr(ehci, async);
get_dwords(NLPTR_GET(entry), (uint32_t *)&sitd,
sizeof(EHCIsitd) >> 2);
ehci_trace_sitd(ehci, entry, &sitd);
if... | 21,736 |
qemu | 543f8f13e256a081dd820375e9575439b659ccd8 | 0 | static void test_cdrom_dma(void)
{
static const size_t len = ATAPI_BLOCK_SIZE;
char *pattern = g_malloc(ATAPI_BLOCK_SIZE * 16);
char *rx = g_malloc0(len);
uintptr_t guest_buf;
PrdtEntry prdt[1];
FILE *fh;
ide_test_start("-drive if=none,file=%s,media=cdrom,format=raw,id=sr0,index=0 ... | 21,737 |
qemu | dbb2a604a94f3899fa34bd1ede462f213e822e03 | 0 | static void test_abstract_interfaces(void)
{
QList *all_types;
QList *obj_types;
QListEntry *ae;
qtest_start(common_args);
/* qom-list-types implements=interface would return any type
* that implements _any_ interface (not just interface types),
* so use a trick to find the inter... | 21,741 |
qemu | 64d7e9a421fea0ac50b44541f5521de455e7cd5d | 0 | static void mips_fulong2e_init(ram_addr_t ram_size, const char *boot_device,
const char *kernel_filename, const char *kernel_cmdline,
const char *initrd_filename, const char *cpu_model)
{
char *filename;
unsigned long ram_offset, bios_offset;
long bios_s... | 21,742 |
qemu | 1069985fb132cd4324fc02d371f1e61492a1823f | 0 | static ssize_t nic_receive(NetClientState *nc, const uint8_t * buf, size_t size)
{
/* TODO:
* - Magic packets should set bit 30 in power management driver register.
* - Interesting packets should set bit 29 in power management driver register.
*/
EEPRO100State *s = DO_UPCAST(NICState, nc, n... | 21,743 |
qemu | a0efbf16604770b9d805bcf210ec29942321134f | 0 | void pci_bus_get_w64_range(PCIBus *bus, Range *range)
{
range->begin = range->end = 0;
pci_for_each_device_under_bus(bus, pci_dev_get_w64, range);
}
| 21,744 |
qemu | a8170e5e97ad17ca169c64ba87ae2f53850dab4c | 0 | static void m5208_timer_write(void *opaque, target_phys_addr_t offset,
uint64_t value, unsigned size)
{
m5208_timer_state *s = (m5208_timer_state *)opaque;
int prescale;
int limit;
switch (offset) {
case 0:
/* The PIF bit is set-to-clear. */
if... | 21,745 |
FFmpeg | 2ed0f76655a76cc49f8a1a1d59e545f5906e7924 | 1 | static void free_tables(H264Context *h){
int i;
H264Context *hx;
av_freep(&h->intra4x4_pred_mode);
av_freep(&h->chroma_pred_mode_table);
av_freep(&h->cbp_table);
av_freep(&h->mvd_table[0]);
av_freep(&h->mvd_table[1]);
av_freep(&h->direct_table);
av_freep(&h->non_zero_count);... | 21,747 |
qemu | f3c7d0389fe8a2792fd4c1cf151b885de03c8f62 | 1 | CBus *cbus_init(qemu_irq dat)
{
CBusPriv *s = (CBusPriv *) g_malloc0(sizeof(*s));
s->dat_out = dat;
s->cbus.clk = qemu_allocate_irqs(cbus_clk, s, 1)[0];
s->cbus.dat = qemu_allocate_irqs(cbus_dat, s, 1)[0];
s->cbus.sel = qemu_allocate_irqs(cbus_sel, s, 1)[0];
s->sel = 1;
s->clk = ... | 21,748 |
qemu | 7d1b0095bff7157e856d1d0e6c4295641ced2752 | 1 | static int cp15_tls_load_store(CPUState *env, DisasContext *s, uint32_t insn, uint32_t rd)
{
TCGv tmp;
int cpn = (insn >> 16) & 0xf;
int cpm = insn & 0xf;
int op = ((insn >> 5) & 7) | ((insn >> 18) & 0x38);
if (!arm_feature(env, ARM_FEATURE_V6K))
return 0;
if (!(cpn == 13 && ... | 21,749 |
qemu | f51074cdc6e750daa3b6df727d83449a7e42b391 | 1 | void hmp_pci_add(Monitor *mon, const QDict *qdict)
{
PCIDevice *dev = NULL;
const char *pci_addr = qdict_get_str(qdict, "pci_addr");
const char *type = qdict_get_str(qdict, "type");
const char *opts = qdict_get_try_str(qdict, "opts");
/* strip legacy tag */
if (!strncmp(pci_addr, "pci_a... | 21,751 |
FFmpeg | 6a287b739f3a8660d5e4405be1302da8b3e51e88 | 1 | static int ape_decode_frame(AVCodecContext * avctx,
void *data, int *data_size,
const uint8_t * buf, int buf_size)
{
APEContext *s = avctx->priv_data;
int16_t *samples = data;
int nblocks;
int i, n;
int blockstodecode;
int bytes_used;
i... | 21,752 |
FFmpeg | 347c27988d1924f795a6b30ae6d41e0b774a219f | 0 | AVAES *av_aes_init(uint8_t *key, int key_bits, int decrypt) {
AVAES *a;
int i, j, t, rconpointer = 0;
uint8_t tk[8][4];
int KC= key_bits>>5;
int rounds= KC + 6;
uint8_t log8[256];
uint8_t alog8[512];
if(!sbox[255]){
j=1;
for(i=0; i<255; i++){
alo... | 21,753 |
FFmpeg | 5eaaffaf64d1854493f0fe9ec822eed1b3cd9fe1 | 0 | av_cold void ff_mpadsp_init(MPADSPContext *s)
{
DCTContext dct;
ff_dct_init(&dct, 5, DCT_II);
ff_init_mpadsp_tabs_float();
ff_init_mpadsp_tabs_fixed();
s->apply_window_float = ff_mpadsp_apply_window_float;
s->apply_window_fixed = ff_mpadsp_apply_window_fixed;
s->dct32_float = d... | 21,754 |
FFmpeg | cb78d14cf9b5ab59b4a9177f390f5e1abff58644 | 0 | static int get_range_off(int *off, int *y_rng, int *uv_rng,
enum AVColorRange rng, int depth)
{
switch (rng) {
case AVCOL_RANGE_MPEG:
*off = 16 << (depth - 8);
*y_rng = 219 << (depth - 8);
*uv_rng = 224 << (depth - 8);
break;
case AVCOL_RANGE... | 21,755 |
FFmpeg | b77fffa127663028169c5ed543956af4b9496c29 | 0 | static av_always_inline void fill_filter_caches_inter(const H264Context *h,
H264SliceContext *sl,
int mb_type, int top_xy,
int left_xy[LEFT_MBS],
... | 21,756 |
FFmpeg | 330194b9cec1b31cd61a80d1914bc8cfc73ad45d | 0 | static int adpcm_decode_frame(AVCodecContext *avctx,
void *data, int *data_size,
uint8_t *buf, int buf_size)
{
ADPCMContext *c = avctx->priv_data;
ADPCMChannelStatus *cs;
int n, m, channel, i;
int block_predictor[2];
short *samples;
... | 21,757 |
FFmpeg | 1d16a1cf99488f16492b1bb48e023f4da8377e07 | 0 | static void ff_h264_idct_add16intra_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+=2){
if(nnzc[ scan8[i+0] ]|nnzc[ scan8[i+1] ])
ff_x264_add8x4_idct_sse2 (dst + block_offset[i], block + i*16, stride);
el... | 21,758 |
FFmpeg | 834b3760a7ca112573e813bd6c3573a8c0daf4ed | 0 | int swr_init(SwrContext *s){
s->in_buffer_index= 0;
s->in_buffer_count= 0;
s->resample_in_constraint= 0;
free_temp(&s->postin);
free_temp(&s->midbuf);
free_temp(&s->preout);
free_temp(&s->in_buffer);
swr_audio_convert_free(&s-> in_convert);
swr_audio_convert_free(&s->out_con... | 21,759 |
FFmpeg | 6e42e6c4b410dbef8b593c2d796a5dad95f89ee4 | 1 | static inline void RENAME(rgb24toyv12)(const uint8_t *src, uint8_t *ydst, uint8_t *udst, uint8_t *vdst,
long width, long height,
long lumStride, long chromStride, long srcStride)
{
long y;
const long chromWidth= width>>1;
#ifdef HAVE_MMX
for(y=0; y<height-2; y+=2)
{
long i;
for(i=0; i<2; i++)
{
... | 21,761 |
qemu | 40a1f64b468ee247fca3b237f0b89f066e59626c | 1 | static inline void gen_mtcr(CPUTriCoreState *env, DisasContext *ctx, TCGv r1,
int32_t offset)
{
if (ctx->hflags & TRICORE_HFLAG_SM) {
/* since we're caching PSW make this a special case */
if (offset == 0xfe04) {
gen_helper_psw_write(cpu_env, r1);
... | 21,763 |
qemu | e0cf6d15e374c8db39acda551845ecc62f5205a3 | 1 | m_free(struct mbuf *m)
{
DEBUG_CALL("m_free");
DEBUG_ARG("m = %lx", (long )m);
if(m) {
/* Remove from m_usedlist */
if (m->m_flags & M_USEDLIST)
remque(m);
/* If it's M_EXT, free() it */
if (m->m_flags & M_EXT)
free(m->m_ext);
/*
* Either free() it or put it on the free list
... | 21,764 |
qemu | b5eff355460643d09e533024360fe0522f368c07 | 1 | static int qcow_open(BlockDriverState *bs, const char *filename, int flags)
{
BDRVQcowState *s = bs->opaque;
int len, i, shift, ret;
QCowHeader header;
ret = bdrv_file_open(&s->hd, filename, flags | BDRV_O_AUTOGROW);
if (ret < 0)
return ret;
if (bdrv_pread(s->hd, 0, &header, si... | 21,768 |
qemu | 3e48dd4a2d48aabafe22ce3611d65544d0234a69 | 1 | static uint32_t rtl8139_io_readl(void *opaque, uint8_t addr)
{
RTL8139State *s = opaque;
uint32_t ret;
switch (addr)
{
case RxMissed:
ret = s->RxMissed;
DPRINTF("RxMissed read val=0x%08x\n", ret);
break;
case TxConfig:
ret ... | 21,769 |
FFmpeg | 535df748c5043bac6b03e598cfa93160ecce8383 | 1 | static void video_decode_example(const char *outfilename, const char *filename)
{
AVCodec *codec;
AVCodecContext *c= NULL;
int frame, got_picture, len;
FILE *f;
AVFrame *picture;
uint8_t inbuf[INBUF_SIZE + FF_INPUT_BUFFER_PADDING_SIZE];
char buf[1024];
AVPacket avpkt;
av_... | 21,770 |
FFmpeg | 58f21b6c9354bbc8414d9ff87645a7292cbe0d92 | 1 | static int open_input(HLSContext *c, struct playlist *pls, struct segment *seg)
{
AVDictionary *opts = NULL;
int ret;
// broker prior HTTP options that should be consistent across requests
av_dict_set(&opts, "user-agent", c->user_agent, 0);
av_dict_set(&opts, "cookies", c->cookies, 0);
... | 21,771 |
FFmpeg | d509c743b78da198af385fea362b632292cd00ad | 1 | static int dvvideo_decode_frame(AVCodecContext *avctx,
void *data, int *data_size,
AVPacket *avpkt)
{
const uint8_t *buf = avpkt->data;
int buf_size = avpkt->size;
DVVideoContext *s = avctx->priv_data;
s->sys = dv_frame_profile(b... | 21,772 |
qemu | 9ed5726c043958359b0f1fa44ab3e4f25f9d9a47 | 1 | target_ulong helper_dvpe(target_ulong arg1)
{
// TODO
arg1 = 0;
// rt = arg1
return arg1;
}
| 21,773 |
qemu | dfd917a9c2bed578c31043126c9f558190bf21e4 | 1 | static void colo_compare_finalize(Object *obj)
{
CompareState *s = COLO_COMPARE(obj);
qemu_chr_fe_deinit(&s->chr_pri_in);
qemu_chr_fe_deinit(&s->chr_sec_in);
qemu_chr_fe_deinit(&s->chr_out);
g_queue_free(&s->conn_list);
if (qemu_thread_is_self(&s->thread)) {
/* compare conn... | 21,774 |
qemu | d9bce9d99f4656ae0b0127f7472db9067b8f84ab | 1 | void cpu_dump_state(CPUState *env, FILE *f,
int (*cpu_fprintf)(FILE *f, const char *fmt, ...),
int flags)
{
#if defined(TARGET_PPC64) || 1
#define FILL ""
#define RGPL 4
#define RFPL 4
#else
#define FILL " "
#define RGPL 8
#define RFPL 4
#endif
int ... | 21,775 |
qemu | 3c01ae0ea29915d165c384d0bd1cbafcf4364a4d | 1 | static void tci_out_label(TCGContext *s, TCGArg arg)
{
TCGLabel *label = &s->labels[arg];
if (label->has_value) {
tcg_out_i(s, label->u.value);
assert(label->u.value);
} else {
tcg_out_reloc(s, s->code_ptr, sizeof(tcg_target_ulong), arg, 0);
tcg_out_i(s, 0);
}
}... | 21,777 |
FFmpeg | f8ca8138f01d0a7d96d4e1ea65fecd1197f96206 | 0 | int64_t ff_gen_search(AVFormatContext *s, int stream_index, int64_t target_ts,
int64_t pos_min, int64_t pos_max, int64_t pos_limit,
int64_t ts_min, int64_t ts_max, int flags, int64_t *ts_ret,
int64_t (*read_timestamp)(struct AVFormatContext *, int , i... | 21,778 |
FFmpeg | d9432789bd119f0e37bcf65cebda05d36aafd4ed | 0 | static int mov_write_udta_tag(AVIOContext *pb, MOVMuxContext *mov,
AVFormatContext *s)
{
AVIOContext *pb_buf;
int i, ret, size;
uint8_t *buf;
for (i = 0; i < s->nb_streams; i++)
if (s->flags & AVFMT_FLAG_BITEXACT) {
return 0;
}
... | 21,780 |
FFmpeg | b933c72b5e36967b6be73555e8289cc074fb44a7 | 0 | static void write_video_frame(AVFormatContext *oc, AVStream *st)
{
int ret;
static struct SwsContext *sws_ctx;
AVCodecContext *c = st->codec;
if (frame_count >= STREAM_NB_FRAMES) {
/* No more frames to compress. The codec has a latency of a few
* frames if using B-frames, so we... | 21,781 |
FFmpeg | 52486603b5b8e2827627afbc8a2028fb74554920 | 0 | static int h264_mp4toannexb_filter(AVBitStreamFilterContext *bsfc,
AVCodecContext *avctx, const char *args,
uint8_t **poutbuf, int *poutbuf_size,
const uint8_t *buf, int buf_size,
... | 21,782 |
FFmpeg | 536b48b2583d9616e574ca36308b1afb5802246f | 0 | static uint_fast8_t vorbis_floor0_decode(vorbis_context *vc,
vorbis_floor_data *vfu, float *vec) {
vorbis_floor0 * vf=&vfu->t0;
float * lsp=vf->lsp;
uint_fast32_t amplitude;
uint_fast32_t book_idx;
amplitude=get_bits(&vc->gb, vf->amplitude_bits);
... | 21,783 |
FFmpeg | 1c8fbd7b90469f69fe3a3f78ba7886195d97c34f | 0 | static void check_itxfm(void)
{
LOCAL_ALIGNED_32(uint8_t, src, [32 * 32 * 2]);
LOCAL_ALIGNED_32(uint8_t, dst, [32 * 32 * 2]);
LOCAL_ALIGNED_32(uint8_t, dst0, [32 * 32 * 2]);
LOCAL_ALIGNED_32(uint8_t, dst1, [32 * 32 * 2]);
LOCAL_ALIGNED_32(int16_t, coef, [32 * 32 * 2]);
LOCAL_ALIGNED_32(in... | 21,784 |
FFmpeg | e549933a270dd2cfc36f2cf9bb6b29acf3dc6d08 | 0 | void ff_put_h264_qpel4_mc32_msa(uint8_t *dst, const uint8_t *src,
ptrdiff_t stride)
{
avc_luma_midh_qrt_4w_msa(src - (2 * stride) - 2, stride, dst, stride, 4, 1);
}
| 21,785 |
FFmpeg | 81efc03f5883cf17a1ad6acedfbb876163d7d06a | 0 | static void put_ebml_utf8(ByteIOContext *pb, unsigned int elementid, char *str)
{
put_ebml_binary(pb, elementid, str, strlen(str));
}
| 21,786 |
FFmpeg | 6f1ec38ce2193d3d4cacd87edb452c6d7ba751ec | 0 | static void compute_antialias_fixed(MPADecodeContext *s, GranuleDef *g)
{
int32_t *ptr, *csa;
int n, i;
/* we antialias only "long" bands */
if (g->block_type == 2) {
if (!g->switch_point)
return;
/* XXX: check this for 8000Hz case */
n = 1;
} else {
... | 21,787 |
FFmpeg | d42dc217ed2b0f886ffc50b26c2bbff1fee5feca | 1 | av_cold struct FFIIRFilterCoeffs* ff_iir_filter_init_coeffs(enum IIRFilterType filt_type,
enum IIRFilterMode filt_mode,
int order, float cutoff_ratio,
float stop... | 21,788 |
qemu | 60fe637bf0e4d7989e21e50f52526444765c63b4 | 1 | static inline uint64_t ram_chunk_index(const uint8_t *start,
const uint8_t *host)
{
return ((uintptr_t) host - (uintptr_t) start) >> RDMA_REG_CHUNK_SHIFT;
}
| 21,789 |
FFmpeg | 9100d4d6327b077c44e5fdbc8082255f11953978 | 1 | static void av_estimate_timings_from_bit_rate(AVFormatContext *ic)
{
int64_t filesize, duration;
int bit_rate, i;
AVStream *st;
/* if bit_rate is already set, we believe it */
if (ic->bit_rate == 0) {
bit_rate = 0;
for(i=0;i<ic->nb_streams;i++) {
st = ic->strea... | 21,790 |
FFmpeg | 3c70251780647d49e09522bbe22758c841e37a9a | 1 | static void sr_1d97_int(int32_t *p, int i0, int i1)
{
int i;
if (i1 <= i0 + 1) {
if (i0 == 1)
p[1] = (p[1] * I_LFTG_K + (1<<16)) >> 17;
else
p[0] = (p[0] * I_LFTG_X + (1<<15)) >> 16;
return;
}
extend97_int(p, i0, i1);
for (i = (i0 >> 1... | 21,791 |
qemu | 15fa08f8451babc88d733bd411d4c94976f9d0f8 | 1 | static void arm_tr_insn_start(DisasContextBase *dcbase, CPUState *cpu)
{
DisasContext *dc = container_of(dcbase, DisasContext, base);
dc->insn_start_idx = tcg_op_buf_count();
tcg_gen_insn_start(dc->pc,
(dc->condexec_cond << 4) | (dc->condexec_mask >> 1),
... | 21,792 |
FFmpeg | 323e6fead07c75f418e4b60704a4f437bb3483b2 | 1 | static void fft(AC3MDCTContext *mdct, IComplex *z, int ln)
{
int j, l, np, np2;
int nblocks, nloops;
register IComplex *p,*q;
int tmp_re, tmp_im;
np = 1 << ln;
/* reverse */
for (j = 0; j < np; j++) {
int k = av_reverse[j] >> (8 - ln);
if (k < j)
FF... | 21,793 |
FFmpeg | 073c2593c9f0aa4445a6fc1b9b24e6e52a8cc2c1 | 1 | static int mjpeg_decode_init(AVCodecContext *avctx)
{
MJpegDecodeContext *s = avctx->priv_data;
MpegEncContext s2;
s->avctx = avctx;
/* ugly way to get the idct & scantable FIXME */
memset(&s2, 0, sizeof(MpegEncContext));
s2.avctx= avctx;
// s2->out_format = FMT_MJPEG;
dsputi... | 21,795 |
FFmpeg | 083300bea935d125b83f60d7030f78a7ffb0f3df | 1 | int ff_thread_ref_frame(ThreadFrame *dst, ThreadFrame *src)
{
int ret;
dst->owner = src->owner;
ret = av_frame_ref(dst->f, src->f);
if (ret < 0)
return ret;
av_assert0(!dst->progress);
if (src->progress &&
!(dst->progress = av_buffer_ref(src->progress))) {
... | 21,797 |
qemu | c9262e8a84a29f22fbb5edde5d17f4f6166d5ae1 | 1 | void zipl_load(void)
{
ScsiMbr *mbr = (void *)sec;
LDL_VTOC *vlbl = (void *)sec;
/* Grab the MBR */
memset(sec, FREE_SPACE_FILLER, sizeof(sec));
read_block(0, mbr, "Cannot read block 0");
dputs("checking magic\n");
if (magic_match(mbr->magic, ZIPL_MAGIC)) {
ipl_scsi();... | 21,798 |
qemu | 8d04fb55dec381bc5105cb47f29d918e579e8cbd | 1 | void ppc_set_irq(PowerPCCPU *cpu, int n_IRQ, int level)
{
CPUState *cs = CPU(cpu);
CPUPPCState *env = &cpu->env;
unsigned int old_pending = env->pending_interrupts;
if (level) {
env->pending_interrupts |= 1 << n_IRQ;
cpu_interrupt(cs, CPU_INTERRUPT_HARD);
} else {
... | 21,799 |
qemu | bdd81addf4033ce26e6cd180b060f63095f3ded9 | 1 | static void vfio_vga_probe_ati_3c3_quirk(VFIOPCIDevice *vdev)
{
VFIOQuirk *quirk;
/*
* As long as the BAR is >= 256 bytes it will be aligned such that the
* lower byte is always zero. Filter out anything else, if it exists.
*/
if (!vfio_pci_is(vdev, PCI_VENDOR_ID_ATI, PCI_ANY_ID) ||... | 21,800 |
qemu | 09b9418c6d085a0728372aa760ebd10128a020b1 | 1 | static void mem_info(Monitor *mon)
{
CPUState *env;
int l1, l2, prot, last_prot;
uint32_t pgd, pde, pte, start, end;
env = mon_get_cpu();
if (!env)
return;
if (!(env->cr[0] & CR0_PG_MASK)) {
monitor_printf(mon, "PG disabled\n");
return;
}
pgd = env... | 21,801 |
qemu | 2d528d45ecf5ee3c1a566a9f3d664464925ef830 | 1 | CharDriverState *chr_testdev_init(void)
{
TestdevCharState *testdev;
CharDriverState *chr;
testdev = g_malloc0(sizeof(TestdevCharState));
testdev->chr = chr = g_malloc0(sizeof(CharDriverState));
chr->opaque = testdev;
chr->chr_write = testdev_write;
chr->chr_close = testdev_close... | 21,802 |
qemu | f4658285f99473367dbbc34ce6970ec4637c2388 | 1 | static int coroutine_fn bdrv_co_do_writev(BlockDriverState *bs,
int64_t sector_num, int nb_sectors, QEMUIOVector *qiov)
{
BlockDriver *drv = bs->drv;
BdrvTrackedRequest req;
int ret;
if (!bs->drv) {
return -ENOMEDIUM;
if (bs->read_only) {
return -EACCES;
if (bdrv_check_reques... | 21,803 |
qemu | ae50b2747f77944faa79eb914272b54eb30b63b3 | 1 | void *etraxfs_eth_init(NICInfo *nd, target_phys_addr_t base, int phyaddr)
{
struct etraxfs_dma_client *dma = NULL;
struct fs_eth *eth = NULL;
qemu_check_nic_model(nd, "fseth");
dma = qemu_mallocz(sizeof *dma * 2);
eth = qemu_mallocz(sizeof *eth);
dma[0].client.push = eth_tx_push;
dma[0].client.opa... | 21,804 |
FFmpeg | 9b7a8bddac52bd05dddb28afd4dff92739946d3b | 1 | static void do_udp_write(void *arg, void *buf, int size) {
URLContext *h = arg;
UDPContext *s = h->priv_data;
int ret;
if (!(h->flags & AVIO_FLAG_NONBLOCK)) {
ret = ff_network_wait_fd(s->udp_fd, 1);
if (ret < 0) {
s->circular_buffer_error = ret;
return... | 21,805 |
FFmpeg | 20d1f6fec1aa2a33c4cf8162e72ca88ead3d389d | 1 | av_cold struct FFPsyPreprocessContext* ff_psy_preprocess_init(AVCodecContext *avctx)
{
FFPsyPreprocessContext *ctx;
int i;
float cutoff_coeff = 0;
ctx = av_mallocz(sizeof(FFPsyPreprocessContext));
ctx->avctx = avctx;
if (avctx->cutoff > 0)
cutoff_coeff = 2.0 * avctx->cut... | 21,806 |
qemu | 80e1eea37a25a7696137e680285e36d0bfdc9f34 | 1 | static QVirtioPCIDevice *virtio_blk_pci_init(QPCIBus *bus, int slot)
{
QVirtioPCIDevice *dev;
dev = qvirtio_pci_device_find(bus, VIRTIO_ID_BLOCK);
g_assert(dev != NULL);
g_assert_cmphex(dev->vdev.device_type, ==, VIRTIO_ID_BLOCK);
g_assert_cmphex(dev->pdev->devfn, ==, ((slot << 3) | PCI_FN))... | 21,807 |
qemu | 81c219ac6ce0d6182e35f3976f2caa4cefcaf9f0 | 1 | static int64_t coroutine_fn bdrv_co_get_block_status(BlockDriverState *bs,
int64_t sector_num,
int nb_sectors, int *pnum,
BlockDriverState **file)
{
int... | 21,808 |
qemu | 4652b8f3e1ec91bb9d6f00e40df7f96d1f1aafee | 1 | static int qcow2_do_open(BlockDriverState *bs, QDict *options, int flags,
Error **errp)
{
BDRVQcow2State *s = bs->opaque;
unsigned int len, i;
int ret = 0;
QCowHeader header;
Error *local_err = NULL;
uint64_t ext_end;
uint64_t l1_vm_state_index;
ret =... | 21,809 |
qemu | 372579427a5040a26dfee78464b50e2bdf27ef26 | 1 | static void *qemu_tcg_cpu_thread_fn(void *arg)
{
CPUState *cpu = arg;
rcu_register_thread();
qemu_mutex_lock_iothread();
qemu_thread_get_self(cpu->thread);
CPU_FOREACH(cpu) {
cpu->thread_id = qemu_get_thread_id();
cpu->created = true;
cpu->can_do_io = 1;
}... | 21,810 |
FFmpeg | cb079b1b2bb1f7d0609ea7196090802a2788913a | 1 | static void png_filter_row(PNGDSPContext *dsp, uint8_t *dst, int filter_type,
uint8_t *src, uint8_t *last, int size, int bpp)
{
int i, p, r, g, b, a;
switch (filter_type) {
case PNG_FILTER_VALUE_NONE:
memcpy(dst, src, size);
break;
case PNG_FILTER_VAL... | 21,811 |
FFmpeg | c341f734e5f9d6af4a8fdcceb6f5d12de6395c76 | 1 | static void vp56_mc(VP56Context *s, int b, int plane, uint8_t *src,
int stride, int x, int y)
{
uint8_t *dst = s->frames[VP56_FRAME_CURRENT]->data[plane] + s->block_offset[b];
uint8_t *src_block;
int src_offset;
int overlap_offset = 0;
int mask = s->vp56_coord_div[b] - 1;
... | 21,812 |
qemu | 772034b63e9c0caf6c92e31413f2d8df2ee69c88 | 1 | static int elf_core_dump(int signr, const CPUArchState *env)
{
const CPUState *cpu = ENV_GET_CPU((CPUArchState *)env);
const TaskState *ts = (const TaskState *)cpu->opaque;
struct vm_area_struct *vma = NULL;
char corefile[PATH_MAX];
struct elf_note_info info;
struct elfhdr elf;
struc... | 21,813 |
qemu | 0ce6a434176e274a7e86bcaa268542c5cc402696 | 1 | void qemu_acl_reset(qemu_acl *acl)
{
qemu_acl_entry *entry;
/* Put back to deny by default, so there is no window
* of "open access" while the user re-initializes the
* access control list */
acl->defaultDeny = 1;
QTAILQ_FOREACH(entry, &acl->entries, next) {
QTAILQ_REMOVE(&ac... | 21,814 |
FFmpeg | 5331773cc33ba26b9e26ace643d926219e46a17b | 0 | void ff_id3v2_read(AVFormatContext *s, const char *magic,
ID3v2ExtraMeta **extra_meta)
{
id3v2_read_internal(s->pb, &s->metadata, s, magic, extra_meta);
}
| 21,816 |
qemu | 9366f4186025e1d8fc3bebd41fb714521c170b6f | 1 | static int qemu_loadvm_state(QEMUFile *f)
{
SaveStateEntry *se;
int len, ret, instance_id, record_len, version_id;
int64_t total_len, end_pos, cur_pos;
unsigned int v;
char idstr[256];
v = qemu_get_be32(f);
if (v != QEMU_VM_FILE_MAGIC)
goto fail;
v = qemu_get_be32(f);... | 21,817 |
FFmpeg | fbdaebb29861d32acc93fa55fd13554a2ae32eb4 | 0 | int ff_h263_decode_picture_header(MpegEncContext *s)
{
int format, width, height, i;
uint32_t startcode;
align_get_bits(&s->gb);
if (show_bits(&s->gb, 2) == 2 && s->avctx->frame_number == 0) {
av_log(s->avctx, AV_LOG_WARNING, "Header looks like RTP instead of H.263\n");
}
... | 21,818 |
qemu | 79482e5ab38a05ca8869040b0d8b8f451f16ff62 | 1 | static inline void gen_op_arith_add(DisasContext *ctx, TCGv ret, TCGv arg1,
TCGv arg2, bool add_ca, bool compute_ca,
bool compute_ov, bool compute_rc0)
{
TCGv t0 = ret;
if (((compute_ca && add_ca) || compute_ov)
&& (TCGV_EQU... | 21,819 |
qemu | be48e9951214a78ebef025cefecfc77be3d1c13c | 1 | static void qxl_check_state(PCIQXLDevice *d)
{
QXLRam *ram = d->ram;
assert(SPICE_RING_IS_EMPTY(&ram->cmd_ring));
assert(SPICE_RING_IS_EMPTY(&ram->cursor_ring));
}
| 21,821 |
qemu | c24a8a0b6dad5a33d84f5fb846edb28c43312c71 | 1 | static inline uint64_t inline_cvttq(CPUAlphaState *env, uint64_t a,
int roundmode, int VI)
{
uint64_t frac, ret = 0;
uint32_t exp, sign, exc = 0;
int shift;
sign = (a >> 63);
exp = (uint32_t)(a >> 52) & 0x7ff;
frac = a & 0xfffffffffffffull;
if... | 21,824 |
FFmpeg | c4e2a535b3a8b192c144acfaa9f1a7bc8b7f99f3 | 1 | static inline void ff_mpeg4_set_one_direct_mv(MpegEncContext *s, int mx, int my, int i){
static const int tab_size = sizeof(s->direct_scale_mv[0])/sizeof(int16_t);
static const int tab_bias = (tab_size/2);
int xy= s->block_index[i];
uint16_t time_pp= s->pp_time;
uint16_t time_pb= s->pb_time;
... | 21,825 |
FFmpeg | f9e083a156f19094cb6fcd134c1ca4ca899a1a6d | 1 | static int read_braindead_odml_indx(AVFormatContext *s, int frame_num){
AVIContext *avi = s->priv_data;
AVIOContext *pb = s->pb;
int longs_pre_entry= avio_rl16(pb);
int index_sub_type = avio_r8(pb);
int index_type = avio_r8(pb);
int entries_in_use = avio_rl32(pb);
int chunk_id ... | 21,826 |
FFmpeg | d1adad3cca407f493c3637e20ecd4f7124e69212 | 0 | static inline void RENAME(rgb24ToUV)(uint8_t *dstU, uint8_t *dstV, const uint8_t *src1, const uint8_t *src2, long width, uint32_t *unused)
{
#if COMPILE_TEMPLATE_MMX
assert(src1==src2);
RENAME(bgr24ToUV_mmx)(dstU, dstV, src1, width, PIX_FMT_RGB24);
#else
int i;
assert(src1==src2);
for (i=0; ... | 21,827 |
qemu | 0920a17199d23b3def3a60fa1fbbdeadcdda452d | 1 | static Visitor *visitor_input_test_init_raw(TestInputVisitorData *data,
const char *json_string)
{
Visitor *v;
data->obj = qobject_from_json(json_string);
g_assert(data->obj != NULL);
data->qiv = qmp_input_visitor_new(data->obj);
g_assert(data... | 21,829 |
qemu | 8af00205445eb901f17ca5b632d976065187538e | 1 | ssize_t v9fs_get_xattr(FsContext *ctx, const char *path,
const char *name, void *value, size_t size)
{
XattrOperations *xops = get_xattr_operations(ctx->xops, name);
if (xops) {
return xops->getxattr(ctx, path, name, value, size);
}
errno = -EOPNOTSUPP;
return ... | 21,830 |
qemu | e907746266721f305d67bc0718795fedee2e824c | 1 | static void fdctrl_write_data(FDCtrl *fdctrl, uint32_t value)
{
FDrive *cur_drv;
int pos;
/* Reset mode */
if (!(fdctrl->dor & FD_DOR_nRESET)) {
FLOPPY_DPRINTF("Floppy controller in RESET state !\n");
return;
}
if (!(fdctrl->msr & FD_MSR_RQM) || (fdctrl->msr & FD_MSR_D... | 21,831 |
qemu | 5c6c0e513600ba57c3e73b7151d3c0664438f7b5 | 1 | static uint8_t *scsi_get_buf(SCSIDevice *d, uint32_t tag)
{
SCSIDiskState *s = DO_UPCAST(SCSIDiskState, qdev, d);
SCSIDiskReq *r;
r = scsi_find_request(s, tag);
if (!r) {
BADF("Bad buffer tag 0x%x\n", tag);
return NULL;
}
return (uint8_t *)r->iov.iov_base;
}
| 21,832 |
FFmpeg | 67f9bbbb3f6295ca27da7c367f31c6d65339dd4a | 1 | static int noise(AVBitStreamFilterContext *bsfc, AVCodecContext *avctx, const char *args,
uint8_t **poutbuf, int *poutbuf_size,
const uint8_t *buf, int buf_size, int keyframe){
unsigned int *state= bsfc->priv_data;
int amount= args ? atoi(args) : (*state % 10001+1);... | 21,833 |
qemu | efec3dd631d94160288392721a5f9c39e50fb2bc | 1 | static void qdev_print_devinfos(bool show_no_user)
{
static const char *cat_name[DEVICE_CATEGORY_MAX + 1] = {
[DEVICE_CATEGORY_BRIDGE] = "Controller/Bridge/Hub",
[DEVICE_CATEGORY_USB] = "USB",
[DEVICE_CATEGORY_STORAGE] = "Storage",
[DEVICE_CATEGORY_NETWORK] = "Network",
... | 21,834 |
qemu | f8f48b6957bf182339495e6be429f7bdc7ef1981 | 1 | static void uhci_ioport_writew(void *opaque, uint32_t addr, uint32_t val)
{
UHCIState *s = opaque;
addr &= 0x1f;
trace_usb_uhci_mmio_writew(addr, val);
switch(addr) {
case 0x00:
if ((val & UHCI_CMD_RS) && !(s->cmd & UHCI_CMD_RS)) {
/* start frame processing */
... | 21,835 |
FFmpeg | 91767360d86ac786571593ab11c7291010ab3829 | 0 | static void to_meta_with_crop(AVCodecContext *avctx, AVFrame *p, int *dest)
{
int blockx, blocky, x, y;
int luma = 0;
int height = FFMIN(avctx->height, C64YRES);
int width = FFMIN(avctx->width , C64XRES);
uint8_t *src = p->data[0];
for (blocky = 0; blocky < C64YRES; blocky += 8) {
... | 21,837 |
FFmpeg | 4bfdd967a6b2908c9562f9a0ec731e5745cfa796 | 0 | static int jpeg2000_read_bitstream_packets(Jpeg2000DecoderContext *s)
{
int ret = 0;
int tileno;
for (tileno = 0; tileno < s->numXtiles * s->numYtiles; tileno++) {
Jpeg2000Tile *tile = s->tile + tileno;
if (ret = init_tile(s, tileno))
return ret;
s->g = tile... | 21,838 |
FFmpeg | 13a099799e89a76eb921ca452e1b04a7a28a9855 | 0 | static void RENAME(yuv2yuvX_ar)(SwsContext *c, const int16_t *lumFilter,
const int16_t **lumSrc, int lumFilterSize,
const int16_t *chrFilter, const int16_t **chrUSrc,
const int16_t **chrVSrc,
... | 21,839 |
FFmpeg | 6369ba3c9cc74becfaad2a8882dff3dd3e7ae3c0 | 0 | av_cold void ff_dsputil_init_x86(DSPContext *c, AVCodecContext *avctx)
{
int cpu_flags = av_get_cpu_flags();
#if HAVE_7REGS && HAVE_INLINE_ASM
if (cpu_flags & AV_CPU_FLAG_CMOV)
c->add_hfyu_median_prediction = ff_add_hfyu_median_prediction_cmov;
#endif
if (cpu_flags & AV_CPU_FLAG_MMX)
... | 21,840 |
FFmpeg | ce99efc6ffedc7a8fbcc23690d9ff9f7e6f4bf44 | 0 | matroska_read_close (AVFormatContext *s)
{
MatroskaDemuxContext *matroska = s->priv_data;
int n = 0;
if (matroska->writing_app)
av_free(matroska->writing_app);
if (matroska->muxing_app)
av_free(matroska->muxing_app);
if (matroska->index)
av_free(matroska->index);
... | 21,842 |
FFmpeg | 1eaae7abb8f208fefb4e8b9e983e61b2499206a3 | 0 | av_cold int ff_intrax8_common_init(IntraX8Context *w, IDCTDSPContext *idsp,
MpegEncContext *const s)
{
int ret = x8_vlc_init();
if (ret < 0)
return ret;
w->idsp = *idsp;
w->s = s;
// two rows, 2 blocks per cannon mb
w->prediction_table = av... | 21,844 |
FFmpeg | b8551f8ea71b7d6ae39de121213860262d911001 | 1 | static int pcm_decode_frame(AVCodecContext *avctx, void *data,
int *got_frame_ptr, AVPacket *avpkt)
{
const uint8_t *src = avpkt->data;
int buf_size = avpkt->size;
PCMDecode *s = avctx->priv_data;
int sample_size, c, n, ret, samples_per_block;
uint8_t *samples... | 21,845 |
qemu | bdd81addf4033ce26e6cd180b060f63095f3ded9 | 1 | static void vfio_probe_rtl8168_bar2_quirk(VFIOPCIDevice *vdev, int nr)
{
VFIOQuirk *quirk;
VFIOrtl8168Quirk *rtl;
if (!vfio_pci_is(vdev, PCI_VENDOR_ID_REALTEK, 0x8168) || nr != 2) {
return;
}
quirk = g_malloc0(sizeof(*quirk));
quirk->mem = g_malloc0(sizeof(MemoryRegion) * 2);... | 21,846 |
FFmpeg | 0b54f3c0878a3acaa9142e4f24942e762d97e350 | 1 | static int gif_read_header1(GifState *s)
{
ByteIOContext *f = s->f;
uint8_t sig[6];
int ret, v, n;
int has_global_palette;
/* read gif signature */
ret = get_buffer(f, sig, 6);
if (ret != 6)
return -1;
if (memcmp(sig, gif87a_sig, 6) != 0 &&
memcmp(sig, gif89a... | 21,847 |
qemu | d26e445c80fddcc7483b83f3115e5067fef28fe6 | 1 | int tap_open(char *ifname, int ifname_size, int *vnet_hdr,
int vnet_hdr_required, int mq_required)
{
struct ifreq ifr;
int fd, ret;
int len = sizeof(struct virtio_net_hdr);
TFR(fd = open(PATH_NET_TUN, O_RDWR));
if (fd < 0) {
error_report("could not open %s: %m", PATH_N... | 21,848 |
FFmpeg | be28ce210d5674603838e67509fc597f30c1bb1c | 1 | static int mkv_write_attachments(AVFormatContext *s)
{
MatroskaMuxContext *mkv = s->priv_data;
AVIOContext *dyn_cp, *pb = s->pb;
ebml_master attachments;
AVLFG c;
int i, ret;
if (!mkv->have_attachments)
return 0;
mkv->attachments = av_mallocz(sizeof(*mkv->attachments));
... | 21,849 |
FFmpeg | 39975acc699c83af0a87a7318c0f41e189142938 | 0 | void ff_rtp_send_jpeg(AVFormatContext *s1, const uint8_t *buf, int size)
{
RTPMuxContext *s = s1->priv_data;
const uint8_t *qtables = NULL;
int nb_qtables = 0;
uint8_t type = 1; /* default pixel format is AV_PIX_FMT_YUVJ420P */
uint8_t w, h;
uint8_t *p;
int off = 0; /* fragment offse... | 21,850 |
FFmpeg | 954e2b3d34b7c2d82871254f07e2f8a39bc451cb | 0 | static int ffat_decode(AVCodecContext *avctx, void *data,
int *got_frame_ptr, AVPacket *avpkt)
{
ATDecodeContext *at = avctx->priv_data;
AVFrame *frame = data;
int pkt_size = avpkt->size;
AVPacket filtered_packet = {0};
OSStatus ret;
AudioBufferList out_buffers;
... | 21,852 |
qemu | 55b4e80b047300e1512df02887b7448ba3786b62 | 0 | static void phys_section_destroy(MemoryRegion *mr)
{
memory_region_unref(mr);
if (mr->subpage) {
subpage_t *subpage = container_of(mr, subpage_t, iomem);
object_unref(OBJECT(&subpage->iomem));
g_free(subpage);
}
}
| 21,853 |
qemu | c169998802505c244b8bcad562633f29de7d74a4 | 0 | static void usb_ohci_init(OHCIState *ohci, DeviceState *dev,
int num_ports, int devfn,
qemu_irq irq, enum ohci_type type,
const char *name, uint32_t localmem_base)
{
int i;
if (usb_frame_time == 0) {
#ifdef OHCI_TIME_WARP
... | 21,854 |
qemu | e33e94f92298c96e0928cefab00ea5bae0a1cd19 | 0 | void helper_float_check_status (void)
{
#ifdef CONFIG_SOFTFLOAT
if (env->exception_index == POWERPC_EXCP_PROGRAM &&
(env->error_code & POWERPC_EXCP_FP)) {
/* Differred floating-point exception after target FPR update */
if (msr_fe0 != 0 || msr_fe1 != 0)
helper_raise_except... | 21,855 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.