project stringclasses 2
values | commit_id stringlengths 40 40 | target int64 0 1 | func stringlengths 26 142k | idx int64 0 27.3k |
|---|---|---|---|---|
FFmpeg | 86dfcfd0e30d6645eea2c63c1c60a0550e7c97ea | 1 | int ff_mov_read_esds(AVFormatContext *fc, AVIOContext *pb, MOVAtom atom)
{
AVStream *st;
int tag;
if (fc->nb_streams < 1)
return 0;
st = fc->streams[fc->nb_streams-1];
avio_rb32(pb); /* version + flags */
ff_mp4_read_descr(fc, pb, &tag);
if (tag == MP4ESDescrTag) {
... | 14,315 |
qemu | 6ab3fc32ea640026726bc5f9f4db622d0954fb8a | 1 | static void usb_serial_handle_data(USBDevice *dev, USBPacket *p)
{
USBSerialState *s = (USBSerialState *)dev;
uint8_t devep = p->ep->nr;
struct iovec *iov;
uint8_t header[2];
int i, first_len, len;
switch (p->pid) {
case USB_TOKEN_OUT:
if (devep != 2)
goto fai... | 14,316 |
FFmpeg | 4d33873c2990b8d6096f60fef384f0efc4482b55 | 1 | int ff_hevc_decode_nal_pps(HEVCContext *s)
{
GetBitContext *gb = &s->HEVClc.gb;
HEVCSPS *sps = NULL;
int pic_area_in_ctbs, pic_area_in_min_cbs, pic_area_in_min_tbs;
int log2_diff_ctb_min_tb_size;
int i, j, x, y, ctb_addr_rs, tile_id;
int ret = 0;
int pps_id = 0;
AVBuff... | 14,317 |
qemu | 80a15e3e2eed96926d886693663503985c9a98bb | 1 | static int raw_read_options(QDict *options, BlockDriverState *bs,
BDRVRawState *s, Error **errp)
{
Error *local_err = NULL;
QemuOpts *opts = NULL;
int64_t real_size = 0;
int ret;
real_size = bdrv_getlength(bs->file->bs);
if (real_size < 0) {
error_setg_errno(errp, -real_si... | 14,318 |
FFmpeg | 8b2fce0d3f5a56c40c28899c9237210ca8f9cf75 | 1 | inline static void RENAME(hcscale)(uint16_t *dst, long dstWidth, uint8_t *src1, uint8_t *src2,
int srcW, int xInc, int flags, int canMMX2BeUsed, int16_t *hChrFilter,
int16_t *hChrFilterPos, int hChrFilterSize, void *funnyUVCode,
... | 14,319 |
qemu | bf43330aa418908f7a5e2acda28ac1a8ed0d8ad6 | 1 | uint64_t cpu_tick_get_count(CPUTimer *timer)
{
uint64_t real_count = timer_to_cpu_ticks(
qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL) - timer->clock_offset,
timer->frequency);
TIMER_DPRINTF("%s get_count count=0x%016lx (%s) p=%p\n",
timer->name, real_count,
... | 14,320 |
FFmpeg | 5c720657c23afd798ae0db7c7362eb859a89ab3d | 1 | static int mov_read_colr(MOVContext *c, AVIOContext *pb, MOVAtom atom)
{
AVStream *st;
char color_parameter_type[5] = { 0 };
int color_primaries, color_trc, color_matrix;
if (c->fc->nb_streams < 1)
return 0;
st = c->fc->streams[c->fc->nb_streams - 1];
avio_read(pb, color_para... | 14,321 |
qemu | 0c53d7342b4e8412f3b81eed67f053304813dc5d | 1 | void gen_intermediate_code(CPUOpenRISCState *env, struct TranslationBlock *tb)
{
OpenRISCCPU *cpu = openrisc_env_get_cpu(env);
CPUState *cs = CPU(cpu);
struct DisasContext ctx, *dc = &ctx;
uint32_t pc_start;
uint32_t next_page_start;
int num_insns;
int max_insns;
pc_start = tb... | 14,322 |
FFmpeg | b6eaa3928e198554a3934dd5ad6eac4d16f27df2 | 1 | static int videotoolbox_common_end_frame(AVCodecContext *avctx, AVFrame *frame)
{
int status;
AVVideotoolboxContext *videotoolbox = avctx->hwaccel_context;
VTContext *vtctx = avctx->internal->hwaccel_priv_data;
av_buffer_unref(&frame->buf[0]);
if (!videotoolbox->session || !vtctx->bitstrea... | 14,323 |
qemu | e8a40bf71d606f9f87866fb2461eaed52814b38e | 1 | static void block_job_completed_single(BlockJob *job)
{
if (!job->ret) {
if (job->driver->commit) {
job->driver->commit(job);
} else {
if (job->driver->abort) {
job->driver->abort(job);
if (job->cb) {
job->cb(job->opaque, job->ret);
if (... | 14,325 |
qemu | 66a08cbe6ad1aebec8eecf58b3ba042e19dd1649 | 1 | static UHCIQueue *uhci_queue_get(UHCIState *s, UHCI_TD *td, USBEndpoint *ep)
{
uint32_t token = uhci_queue_token(td);
UHCIQueue *queue;
QTAILQ_FOREACH(queue, &s->queues, next) {
if (queue->token == token) {
return queue;
}
}
queue = g_new0(UHCIQueue, 1);
... | 14,326 |
qemu | e1cf5582644ef63528993fb2b88dd3b43b9914c6 | 1 | HBitmap *hbitmap_alloc(uint64_t size, int granularity)
{
HBitmap *hb = g_malloc0(sizeof (struct HBitmap));
unsigned i;
assert(granularity >= 0 && granularity < 64);
size = (size + (1ULL << granularity) - 1) >> granularity;
assert(size <= ((uint64_t)1 << HBITMAP_LOG_MAX_SIZE));
hb->siz... | 14,327 |
FFmpeg | 1c9215e580b6436d1aff3c0118ef01269712ebd9 | 0 | static int mp3_read_header(AVFormatContext *s)
{
MP3DecContext *mp3 = s->priv_data;
AVStream *st;
int64_t off;
int ret;
int i;
st = avformat_new_stream(s, NULL);
if (!st)
return AVERROR(ENOMEM);
st->codec->codec_type = AVMEDIA_TYPE_AUDIO;
st->codec->codec_id = ... | 14,328 |
FFmpeg | d150a147dac67faeaf6b1f25a523ae330168ee1e | 0 | static av_cold int close_decoder(AVCodecContext *avctx)
{
PGSSubContext *ctx = avctx->priv_data;
av_freep(&ctx->picture.rle);
ctx->picture.rle_buffer_size = 0;
return 0;
}
| 14,329 |
FFmpeg | 4d2f83f8acb6c6444c3b276e15c5369d28b7c037 | 0 | static int gsm_parse(AVCodecParserContext *s1, AVCodecContext *avctx,
const uint8_t **poutbuf, int *poutbuf_size,
const uint8_t *buf, int buf_size)
{
GSMParseContext *s = s1->priv_data;
ParseContext *pc = &s->pc;
int next;
if (!s->block_size) {
... | 14,330 |
FFmpeg | d597655f771979c70c08f8f8ed84c1319da121e8 | 0 | static void put_ebml_uint(ByteIOContext *pb, unsigned int elementid, uint64_t val)
{
int i, bytes = 1;
while (val >> bytes*8) bytes++;
put_ebml_id(pb, elementid);
put_ebml_num(pb, bytes, 0);
for (i = bytes - 1; i >= 0; i--)
put_byte(pb, val >> i*8);
}
| 14,331 |
FFmpeg | b2a8850969b89151677253be4d99e0ba29212749 | 0 | static void sdl_audio_callback(void *opaque, Uint8 *stream, int len)
{
VideoState *is = opaque;
int audio_size, len1;
int bytes_per_sec;
int frame_size = av_samples_get_buffer_size(NULL, is->audio_tgt.channels, 1, is->audio_tgt.fmt, 1);
double pts;
audio_callback_time = av_gettime();
... | 14,332 |
qemu | b8852e87d9d113096342c3e0977266cda0fe9ee5 | 1 | static int vmdk_write_cid(BlockDriverState *bs, uint32_t cid)
{
char desc[DESC_SIZE], tmp_desc[DESC_SIZE];
char *p_name, *tmp_str;
/* the descriptor offset = 0x200 */
if (bdrv_pread(bs->file, 0x200, desc, DESC_SIZE) != DESC_SIZE)
return -1;
tmp_str = strstr(desc,"parentCID");
... | 14,334 |
FFmpeg | 636ced8e1dc8248a1353b416240b93d70ad03edb | 1 | static int process_input(void)
{
InputFile *ifile;
AVFormatContext *is;
InputStream *ist;
AVPacket pkt;
int ret, i, j;
/* select the stream that we must read now */
ifile = select_input_file();
/* if none, if is finished */
if (!ifile) {
if (got_eagain()) {
... | 14,335 |
qemu | 60fe637bf0e4d7989e21e50f52526444765c63b4 | 1 | static int get_int32_le(QEMUFile *f, void *pv, size_t size)
{
int32_t *cur = pv;
int32_t loaded;
qemu_get_sbe32s(f, &loaded);
if (loaded >= 0 && loaded <= *cur) {
*cur = loaded;
return 0;
}
return -EINVAL;
}
| 14,336 |
FFmpeg | 9aebea0a4de1dc19c6309694cb1a5cd7554438cc | 1 | static int h264_decode_frame(AVCodecContext *avctx, void *data,
int *got_frame, AVPacket *avpkt)
{
const uint8_t *buf = avpkt->data;
int buf_size = avpkt->size;
H264Context *h = avctx->priv_data;
AVFrame *pict = data;
int buf_index = 0;
H2... | 14,337 |
FFmpeg | 4162ceea93684f3cd656dc21d30903e102a44e73 | 1 | static int mxf_read_partition_pack(void *arg, AVIOContext *pb, int tag, int size, UID uid, int64_t klv_offset)
{
MXFContext *mxf = arg;
MXFPartition *partition, *tmp_part;
UID op;
uint64_t footer_partition;
uint32_t nb_essence_containers;
tmp_part = av_realloc_array(mxf->partitions, mxf... | 14,338 |
qemu | 7f0317cfc8da620cdb38cb5cfec5f82b8dd05403 | 1 | void commit_start(BlockDriverState *bs, BlockDriverState *base,
BlockDriverState *top, int64_t speed,
BlockdevOnError on_error, BlockCompletionFunc *cb,
void *opaque, const char *backing_file_str, Error **errp)
{
CommitBlockJob *s;
BlockReopenQueue *re... | 14,339 |
qemu | ad0ebb91cd8b5fdc4a583b03645677771f420a46 | 1 | int spapr_tce_dma_read(VIOsPAPRDevice *dev, uint64_t taddr, void *buf,
uint32_t size)
{
#ifdef DEBUG_TCE
fprintf(stderr, "spapr_tce_dma_write taddr=0x%llx size=0x%x\n",
(unsigned long long)taddr, size);
#endif
/* Check for bypass */
if (dev->flags & VIO_PAPR_FLAG... | 14,340 |
FFmpeg | d6604b29ef544793479d7fb4e05ef6622bb3e534 | 0 | static av_cold int sunrast_encode_init(AVCodecContext *avctx)
{
SUNRASTContext *s = avctx->priv_data;
switch (avctx->coder_type) {
case FF_CODER_TYPE_RLE:
s->type = RT_BYTE_ENCODED;
break;
case FF_CODER_TYPE_RAW:
s->type = RT_STANDARD;
break;
default:
... | 14,341 |
FFmpeg | 99b823f0a1be42abc0f3a6a0da946c4464db5fb6 | 1 | static void frame_end(MpegEncContext *s)
{
if (s->unrestricted_mv &&
s->current_picture.reference &&
!s->intra_only) {
const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(s->avctx->pix_fmt);
int hshift = desc->log2_chroma_w;
int vshift = desc->log2_chroma_h;
... | 14,342 |
qemu | e2f0c49ffae8d3a00272c3cbc68850cc5aafbffa | 1 | static int scsi_disk_emulate_read_toc(SCSIRequest *req, uint8_t *outbuf)
{
SCSIDiskState *s = DO_UPCAST(SCSIDiskState, qdev, req->dev);
int start_track, format, msf, toclen;
uint64_t nb_sectors;
msf = req->cmd.buf[1] & 2;
format = req->cmd.buf[2] & 0xf;
start_track = req->cmd.buf[6];
... | 14,343 |
qemu | 2d528d45ecf5ee3c1a566a9f3d664464925ef830 | 1 | static CharDriverState *qemu_chr_open_win_file(HANDLE fd_out)
{
CharDriverState *chr;
WinCharState *s;
chr = qemu_chr_alloc();
s = g_malloc0(sizeof(WinCharState));
s->hcom = fd_out;
chr->opaque = s;
chr->chr_write = win_chr_write;
return chr;
}
| 14,344 |
FFmpeg | a0c624e299730c8c5800375c2f5f3c6c200053ff | 1 | static av_cold int v4l2_decode_init(AVCodecContext *avctx)
{
V4L2m2mContext *s = avctx->priv_data;
V4L2Context *capture = &s->capture;
V4L2Context *output = &s->output;
int ret;
/* if these dimensions are invalid (ie, 0 or too small) an event will be raised
* by the v4l2 driver; this e... | 14,345 |
FFmpeg | 014b178f84fd6c5766e6a626a83f15a0dc635c90 | 1 | static int16_t square_root(int val)
{
return (ff_sqrt(val << 1) >> 1) & (~1);
}
| 14,346 |
FFmpeg | 0d3a51e5d279dd2a56c81ba7a81a70128c5a7545 | 1 | static int process_audio_header_eacs(AVFormatContext *s)
{
EaDemuxContext *ea = s->priv_data;
AVIOContext *pb = s->pb;
int compression_type;
ea->sample_rate = ea->big_endian ? avio_rb32(pb) : avio_rl32(pb);
ea->bytes = avio_r8(pb); /* 1=8-bit, 2=16-bit */
ea->num_channels ... | 14,347 |
qemu | b946a1533209f61a93e34898aebb5b43154b99c3 | 1 | void isa_ne2000_init(int base, qemu_irq irq, NICInfo *nd)
{
NE2000State *s;
qemu_check_nic_model(nd, "ne2k_isa");
s = qemu_mallocz(sizeof(NE2000State));
register_ioport_write(base, 16, 1, ne2000_ioport_write, s);
register_ioport_read(base, 16, 1, ne2000_ioport_read, s);
register_i... | 14,348 |
FFmpeg | 786594184a1797cc4b573001f3eeb188d5912062 | 1 | static void add_pid_to_pmt(MpegTSContext *ts, unsigned int programid,
unsigned int pid)
{
struct Program *p = get_program(ts, programid);
int i;
if (!p)
return;
if (p->nb_pids >= MAX_PIDS_PER_PROGRAM)
return;
for (i = 0; i < MAX_PIDS_PER_PROGRA... | 14,349 |
qemu | dede4188cc817a039154ed2ecd7f3285f6b94056 | 1 | static int calculate_geometry(int64_t total_sectors, uint16_t* cyls,
uint8_t* heads, uint8_t* secs_per_cyl)
{
uint32_t cyls_times_heads;
if (total_sectors > 65535 * 16 * 255)
return -EFBIG;
if (total_sectors > 65535 * 16 * 63) {
*secs_per_cyl = 255;
*heads = 16;
... | 14,351 |
qemu | 7d1b0095bff7157e856d1d0e6c4295641ced2752 | 1 | static inline void gen_arm_shift_reg(TCGv var, int shiftop,
TCGv shift, int flags)
{
if (flags) {
switch (shiftop) {
case 0: gen_helper_shl_cc(var, var, shift); break;
case 1: gen_helper_shr_cc(var, var, shift); break;
case 2: gen_helper_sa... | 14,352 |
FFmpeg | 2da0d70d5eebe42f9fcd27ee554419ebe2a5da06 | 1 | static inline void RENAME(bgr15ToY)(uint8_t *dst, uint8_t *src, int width)
{
int i;
for(i=0; i<width; i++)
{
int d= ((uint16_t*)src)[i];
int b= d&0x1F;
int g= (d>>5)&0x1F;
int r= (d>>10)&0x1F;
dst[i]= ((RY*r + GY*g + BY*b)>>(RGB2YUV_SHIFT-3)) + 16;
}
}
| 14,353 |
FFmpeg | 65988b991659fea72365be53e17d10953c0f8f78 | 1 | static void decode_gain_info(GetBitContext *gb, int *gaininfo)
{
int i, n;
while (get_bits1(gb)) {
/* NOTHING */
}
n = get_bits_count(gb) - 1; // amount of elements*2 to update
i = 0;
while (n--) {
int index = get_bits(gb, 3);
int gain = get_bits1(gb) ... | 14,355 |
FFmpeg | 7cc84d241ba6ef8e27e4d057176a4ad385ad3d59 | 1 | static int decode_b_picture_primary_header(VC9Context *v)
{
GetBitContext *gb = &v->s.gb;
int pqindex;
/* Prolog common to all frametypes should be done in caller */
if (v->profile == PROFILE_SIMPLE)
{
av_log(v->s.avctx, AV_LOG_ERROR, "Found a B frame while in Simple Profile!\n");
... | 14,357 |
qemu | 8841d9dfc7f871cec7c3401a8a2d31ad34e881f7 | 1 | static inline void check_privileged(DisasContext *s)
{
if (s->tb->flags & (PSW_MASK_PSTATE >> 32)) {
gen_program_exception(s, PGM_PRIVILEGED);
}
}
| 14,358 |
FFmpeg | 7cc84d241ba6ef8e27e4d057176a4ad385ad3d59 | 1 | static int decode_p_mbs(VC9Context *v)
{
MpegEncContext *s = &v->s;
GetBitContext *gb = &v->s.gb;
int current_mb = 0, i; /* MB/Block Position info */
uint8_t cbpcy[4], previous_cbpcy[4], predicted_cbpcy,
*p_cbpcy /* Pointer to skip some math */;
int hybrid_pred; /* Prediction types */... | 14,361 |
qemu | 4c315c27661502a0813b129e41c0bf640c34a8d6 | 1 | static void fsl_imx25_class_init(ObjectClass *oc, void *data)
{
DeviceClass *dc = DEVICE_CLASS(oc);
dc->realize = fsl_imx25_realize;
} | 14,363 |
FFmpeg | 29ce0433743c8cb0bfa4b0e174437212d31730fb | 0 | SwsFunc ff_yuv2rgb_get_func_ptr(SwsContext *c)
{
SwsFunc t = NULL;
#if (HAVE_MMX2 || HAVE_MMX) && CONFIG_GPL
t = ff_yuv2rgb_init_mmx(c);
#endif
#if HAVE_VIS
t = ff_yuv2rgb_init_vis(c);
#endif
#if CONFIG_MLIB
t = ff_yuv2rgb_init_mlib(c);
#endif
#if HAVE_ALTIVEC && CONFIG_GPL
if (c->flag... | 14,364 |
FFmpeg | 67fa02ed794f9505bd9c3584c14bfb61c895f5bc | 0 | static inline void celt_encode_pulses(OpusRangeCoder *rc, int *y, uint32_t N, uint32_t K)
{
ff_opus_rc_enc_uint(rc, celt_icwrsi(N, y), CELT_PVQ_V(N, K));
}
| 14,365 |
qemu | 7372c2b926200db295412efbb53f93773b7f1754 | 1 | static void gen_partset_reg(int opsize, TCGv reg, TCGv val)
{
TCGv tmp;
switch (opsize) {
case OS_BYTE:
tcg_gen_andi_i32(reg, reg, 0xffffff00);
tmp = tcg_temp_new();
tcg_gen_ext8u_i32(tmp, val);
tcg_gen_or_i32(reg, reg, tmp);
break;
case OS_WORD:
... | 14,368 |
qemu | e23a1b33b53d25510320b26d9f154e19c6c99725 | 1 | PCIBus *pci_apb_init(target_phys_addr_t special_base,
target_phys_addr_t mem_base,
qemu_irq *pic, PCIBus **bus2, PCIBus **bus3)
{
DeviceState *dev;
SysBusDevice *s;
APBState *d;
/* Ultrasparc PBM main bus */
dev = qdev_create(NULL, "pbm");
qde... | 14,369 |
qemu | 5e39d89d20b17cf6fb7f09d181d34f17b2ae2160 | 1 | static void pc_numa_cpu(const void *data)
{
char *cli;
QDict *resp;
QList *cpus;
const QObject *e;
cli = make_cli(data, "-cpu pentium -smp 8,sockets=2,cores=2,threads=2 "
"-numa node,nodeid=0 -numa node,nodeid=1 "
"-numa cpu,node-id=1,socket-id=0 "
"-numa cpu,node-... | 14,370 |
qemu | 8d04fb55dec381bc5105cb47f29d918e579e8cbd | 1 | static void patch_instruction(VAPICROMState *s, X86CPU *cpu, target_ulong ip)
{
CPUState *cs = CPU(cpu);
CPUX86State *env = &cpu->env;
VAPICHandlers *handlers;
uint8_t opcode[2];
uint32_t imm32 = 0;
target_ulong current_pc = 0;
target_ulong current_cs_base = 0;
uint32_t current_... | 14,371 |
FFmpeg | 7cc84d241ba6ef8e27e4d057176a4ad385ad3d59 | 1 | static int vc9_decode_frame(AVCodecContext *avctx,
void *data, int *data_size,
uint8_t *buf, int buf_size)
{
VC9Context *v = avctx->priv_data;
MpegEncContext *s = &v->s;
int ret = FRAME_SKIPED, len, start_code;
AVFrame *pict = data;
uin... | 14,374 |
qemu | 4482e05cbbb7e50e476f6a9500cf0b38913bd939 | 1 | static void lm32_uclinux_init(MachineState *machine)
{
const char *cpu_model = machine->cpu_model;
const char *kernel_filename = machine->kernel_filename;
const char *kernel_cmdline = machine->kernel_cmdline;
const char *initrd_filename = machine->initrd_filename;
LM32CPU *cpu;
CPULM32Sta... | 14,375 |
qemu | 38ee14f4f33f8836fc0e209ca59c6ae8c6edf380 | 1 | static int vnc_update_client(VncState *vs, int has_dirty)
{
if (vs->need_update && vs->csock != -1) {
VncDisplay *vd = vs->vd;
VncJob *job;
int y;
int width, height;
int n = 0;
if (vs->output.offset && !vs->audio_cap && !vs->force_update)
/* k... | 14,377 |
qemu | 47d4be12c3997343e436c6cca89aefbbbeb70863 | 1 | static void test_qemu_strtol_empty(void)
{
const char *str = "";
char f = 'X';
const char *endptr = &f;
long res = 999;
int err;
err = qemu_strtol(str, &endptr, 0, &res);
g_assert_cmpint(err, ==, 0);
g_assert_cmpint(res, ==, 0);
g_assert(endptr == str);
}
| 14,378 |
qemu | 2ad645d2854746b55ddfd1d8e951f689cca5d78f | 1 | static void test_endianness(gconstpointer data)
{
const TestCase *test = data;
char *args;
args = g_strdup_printf("-display none -M %s%s%s -device pc-testdev",
test->machine,
test->superio ? " -device " : "",
test->sup... | 14,380 |
qemu | e8ede0a8bb5298a6979bcf7ed84ef64a64a4e3fe | 0 | float32 HELPER(ucf64_negs)(float32 a)
{
return float32_chs(a);
}
| 14,381 |
qemu | 8a5956ad6392f115521dad774055c737c49fb0dd | 0 | static void *rcu_read_perf_test(void *arg)
{
int i;
long long n_reads_local = 0;
rcu_register_thread();
*(struct rcu_reader_data **)arg = &rcu_reader;
atomic_inc(&nthreadsrunning);
while (goflag == GOFLAG_INIT) {
g_usleep(1000);
}
while (goflag == GOFLAG_RUN) {
... | 14,382 |
FFmpeg | bbd977162590db4b29a5532e3e7102e054ff3ae0 | 0 | static inline int coeff_unpack_golomb(GetBitContext *gb, int qfactor, int qoffset)
{
int sign, coeff;
uint32_t buf;
OPEN_READER(re, gb);
UPDATE_CACHE(re, gb);
buf = GET_CACHE(re, gb);
if (buf & 0xAA800000) {
buf >>= 32 - 8;
SKIP_BITS(re, gb, ff_interleaved_golomb_vlc... | 14,383 |
qemu | f07b6003b6cebaa5404d702ad8aca181580e4d6c | 0 | static CharDriverState *qemu_chr_open_tcp(const char *host_str,
int is_telnet,
int is_unix)
{
CharDriverState *chr = NULL;
TCPCharDriver *s = NULL;
int fd = -1, ret, err, val;
int is_listen = 0;
int is_waitconnect = 1;
int do_nodelay = 0;... | 14,384 |
qemu | 6e6efd612f58726189893fd4d948b7fc10acd872 | 0 | void define_one_arm_cp_reg_with_opaque(ARMCPU *cpu,
const ARMCPRegInfo *r, void *opaque)
{
/* Define implementations of coprocessor registers.
* We store these in a hashtable because typically
* there are less than 150 registers in a space which
* is 16*16... | 14,385 |
qemu | 241999bf4c0dd75d300ceee46f7ad28b3a39fe97 | 0 | static void sdhci_sdma_transfer_single_block(SDHCIState *s)
{
int n;
uint32_t datacnt = s->blksize & 0x0fff;
if (s->trnmod & SDHC_TRNS_READ) {
for (n = 0; n < datacnt; n++) {
s->fifo_buffer[n] = sdbus_read_data(&s->sdbus);
}
dma_memory_write(&address_space_memor... | 14,389 |
qemu | 245f7b51c0ea04fb2224b1127430a096c91aee70 | 0 | static int tight_compress_data(VncState *vs, int stream_id, size_t bytes,
int level, int strategy)
{
z_streamp zstream = &vs->tight_stream[stream_id];
int previous_out;
if (bytes < VNC_TIGHT_MIN_TO_COMPRESS) {
vnc_write(vs, vs->tight.buffer, vs->tight.offset);
... | 14,391 |
qemu | bec93d7283b635aabaf0bbff67b6da7fc99e020a | 0 | static void gen_compute_eflags_p(DisasContext *s, TCGv reg)
{
gen_compute_eflags(s);
tcg_gen_shri_tl(reg, cpu_cc_src, 2);
tcg_gen_andi_tl(reg, reg, 1);
}
| 14,392 |
FFmpeg | 40fbf3204208f89a0626f85ce6dd06ca0741583b | 0 | int attribute_align_arg avcodec_receive_frame(AVCodecContext *avctx, AVFrame *frame)
{
int ret;
av_frame_unref(frame);
if (!avcodec_is_open(avctx) || !av_codec_is_decoder(avctx->codec))
return AVERROR(EINVAL);
if (avctx->codec->receive_frame) {
if (avctx->internal->draining ... | 14,394 |
qemu | b3db211f3c80bb996a704d665fe275619f728bd4 | 0 | static void test_visitor_out_no_string(TestOutputVisitorData *data,
const void *unused)
{
char *string = NULL;
QObject *obj;
/* A null string should return "" */
visit_type_str(data->ov, NULL, &string, &error_abort);
obj = visitor_get(data);
g_a... | 14,395 |
qemu | 2a48d99335c572b0d3da59c1387ad131ea6ee590 | 0 | static int spapr_fixup_cpu_dt(void *fdt, sPAPREnvironment *spapr)
{
int ret = 0, offset, cpus_offset;
CPUState *cs;
char cpu_model[32];
int smt = kvmppc_smt_threads();
uint32_t pft_size_prop[] = {0, cpu_to_be32(spapr->htab_shift)};
CPU_FOREACH(cs) {
PowerPCCPU *cpu = POWERPC_CP... | 14,397 |
qemu | a7812ae412311d7d47f8aa85656faadac9d64b56 | 0 | static always_inline void gen_excp (DisasContext *ctx,
int exception, int error_code)
{
TCGv tmp1, tmp2;
tcg_gen_movi_i64(cpu_pc, ctx->pc);
tmp1 = tcg_const_i32(exception);
tmp2 = tcg_const_i32(error_code);
tcg_gen_helper_0_2(helper_excp, tmp1, tmp2);
... | 14,398 |
qemu | 42a268c241183877192c376d03bd9b6d527407c7 | 0 | static bool gen_check_loop_end(DisasContext *dc, int slot)
{
if (option_enabled(dc, XTENSA_OPTION_LOOP) &&
!(dc->tb->flags & XTENSA_TBFLAG_EXCM) &&
dc->next_pc == dc->lend) {
int label = gen_new_label();
gen_advance_ccount(dc);
tcg_gen_brcondi_i32(TCG_COND_EQ... | 14,399 |
qemu | 056fca7b51d949aa0e18e0eb647838874a53bcbe | 0 | int i2c_send(I2CBus *bus, uint8_t data)
{
I2CSlaveClass *sc;
I2CNode *node;
int ret = 0;
QLIST_FOREACH(node, &bus->current_devs, next) {
sc = I2C_SLAVE_GET_CLASS(node->elt);
if (sc->send) {
ret = ret || sc->send(node->elt, data);
} else {
ret =... | 14,400 |
FFmpeg | e9e87822022fc81f92866f870ecedfd2f6272ac9 | 0 | static int find_image_range(int *pfirst_index, int *plast_index,
const char *path, int start_index, int start_index_range)
{
char buf[1024];
int range, last_index, range1, first_index;
/* find the first image */
for (first_index = start_index; first_index < start_inde... | 14,401 |
qemu | a0efbf16604770b9d805bcf210ec29942321134f | 0 | start_list(Visitor *v, const char *name, GenericList **list, size_t size,
Error **errp)
{
StringInputVisitor *siv = to_siv(v);
/* We don't support visits without a list */
assert(list);
if (parse_str(siv, name, errp) < 0) {
*list = NULL;
return;
}
siv->... | 14,403 |
qemu | 3ec39b2d20a25505382619e31e6572e3d04f311e | 0 | static int xio3130_downstream_initfn(PCIDevice *d)
{
PCIBridge* br = DO_UPCAST(PCIBridge, dev, d);
PCIEPort *p = DO_UPCAST(PCIEPort, br, br);
PCIESlot *s = DO_UPCAST(PCIESlot, port, p);
int rc;
int tmp;
rc = pci_bridge_initfn(d);
if (rc < 0) {
return rc;
}
pcie... | 14,404 |
qemu | a8170e5e97ad17ca169c64ba87ae2f53850dab4c | 0 | void imx_timerg_create(const target_phys_addr_t addr,
qemu_irq irq,
DeviceState *ccm)
{
IMXTimerGState *pp;
DeviceState *dev;
dev = sysbus_create_simple("imx_timerg", addr, irq);
pp = container_of(dev, IMXTimerGState, busdev.qdev);
... | 14,406 |
qemu | 539de1246d355d3b8aa33fb7cde732352d8827c7 | 0 | static int mig_save_device_bulk(Monitor *mon, QEMUFile *f,
BlkMigDevState *bmds)
{
int64_t total_sectors = bmds->total_sectors;
int64_t cur_sector = bmds->cur_sector;
BlockDriverState *bs = bmds->bs;
BlkMigBlock *blk;
int nr_sectors;
if (bmds->shared_bas... | 14,407 |
qemu | fb1a3a051d89975f26296163066bb0745ecca49d | 0 | int64_t qemu_clock_get_ns(QEMUClockType type)
{
int64_t now, last;
QEMUClock *clock = qemu_clock_ptr(type);
switch (type) {
case QEMU_CLOCK_REALTIME:
return get_clock();
default:
case QEMU_CLOCK_VIRTUAL:
if (use_icount) {
return cpu_get_icount();
... | 14,408 |
qemu | fda4096fca83dcdc72e0fc0e4a1ae6e7724fb5e0 | 0 | static void test_acpi_q35_tcg_cphp(void)
{
test_data data;
memset(&data, 0, sizeof(data));
data.machine = MACHINE_Q35;
data.variant = ".cphp";
test_acpi_one(" -smp 2,cores=3,sockets=2,maxcpus=6"
" -numa node -numa node",
&data);
free_test_data(&data... | 14,409 |
qemu | 9e6636c72d8d6f0605e23ed820c8487686882b12 | 0 | int block_job_set_speed(BlockJob *job, int64_t value)
{
int rc;
if (!job->job_type->set_speed) {
return -ENOTSUP;
}
rc = job->job_type->set_speed(job, value);
if (rc == 0) {
job->speed = value;
}
return rc;
}
| 14,411 |
qemu | fda4096fca83dcdc72e0fc0e4a1ae6e7724fb5e0 | 0 | static void test_acpi_q35_tcg_memhp(void)
{
test_data data;
memset(&data, 0, sizeof(data));
data.machine = MACHINE_Q35;
data.variant = ".memhp";
test_acpi_one(" -m 128,slots=3,maxmem=1G -numa node", &data);
free_test_data(&data);
}
| 14,412 |
qemu | 81e3e75b6461c53724fe7c7918bc54468fcdaf9d | 0 | void pci_bus_reset(PCIBus *bus)
{
int i;
for (i = 0; i < bus->nirq; i++) {
bus->irq_count[i] = 0;
}
for (i = 0; i < ARRAY_SIZE(bus->devices); ++i) {
if (bus->devices[i]) {
pci_device_reset(bus->devices[i]);
}
}
}
| 14,414 |
qemu | 4086182fcd9b106345b5cc535d78bcc6d13a7683 | 0 | static bool invalid_qmp_mode(const Monitor *mon, const mon_cmd_t *cmd)
{
bool is_cap = cmd->mhandler.cmd_new == do_qmp_capabilities;
if (is_cap && qmp_cmd_mode(mon)) {
qerror_report(ERROR_CLASS_COMMAND_NOT_FOUND,
"Capabilities negotiation is already complete, command "
... | 14,415 |
FFmpeg | a8ff69ce2bad1c4bb043e88ea35f5ab5691d4f3c | 0 | static int encode_ext_header(Wmv2Context *w){
MpegEncContext * const s= &w->s;
PutBitContext pb;
int code;
init_put_bits(&pb, s->avctx->extradata, s->avctx->extradata_size);
put_bits(&pb, 5, s->avctx->time_base.den / s->avctx->time_base.num); //yes 29.97 -> 29
put_bits(&pb, 11, FFMIN(s... | 14,416 |
qemu | db78ef5b0a93b16ad56b70a70e21b1c5e7d06ba8 | 0 | static int sd_schedule_bh(QEMUBHFunc *cb, SheepdogAIOCB *acb)
{
if (acb->bh) {
error_report("bug: %d %d\n", acb->aiocb_type, acb->aiocb_type);
return -EIO;
}
acb->bh = qemu_bh_new(cb, acb);
if (!acb->bh) {
error_report("oom: %d %d\n", acb->aiocb_type, acb->aiocb_type);
... | 14,417 |
qemu | 8928c9c43df1a0eeda1ae2e9582beb34dce49330 | 0 | static int uhci_handle_td(UHCIState *s, UHCIQueue *q, uint32_t qh_addr,
UHCI_TD *td, uint32_t td_addr, uint32_t *int_mask)
{
int len = 0, max_len;
bool spd;
bool queuing = (q != NULL);
uint8_t pid = td->token & 0xff;
UHCIAsync *async = uhci_async_find_td(s, td_addr);... | 14,418 |
qemu | 079d0b7f1eedcc634c371fe05b617fdc55c8b762 | 0 | static int ccid_handle_data(USBDevice *dev, USBPacket *p)
{
USBCCIDState *s = DO_UPCAST(USBCCIDState, dev, dev);
int ret = 0;
uint8_t buf[2];
switch (p->pid) {
case USB_TOKEN_OUT:
ret = ccid_handle_bulk_out(s, p);
break;
case USB_TOKEN_IN:
switch (p->devep &... | 14,419 |
qemu | 7ad4c7200111d20eb97eed4f46b6026e3f0b0eef | 0 | char *g_strconcat(const char *s, ...)
{
char *s;
/*
* Can't model: last argument must be null, the others
* null-terminated strings
*/
s = __coverity_alloc_nosize__();
__coverity_writeall__(s);
__coverity_mark_as_afm_allocated__(s, AFM_free);
return s;
}
| 14,420 |
qemu | bc7c08a2c375acb7ae4d433054415588b176d34c | 0 | static void test_qemu_strtoul_max(void)
{
char *str = g_strdup_printf("%lu", ULONG_MAX);
char f = 'X';
const char *endptr = &f;
unsigned long res = 999;
int err;
err = qemu_strtoul(str, &endptr, 0, &res);
g_assert_cmpint(err, ==, 0);
g_assert_cmpint(res, ==, ULONG_MAX);
... | 14,421 |
qemu | fe52840c8760122257be7b7e4893dd951480a71f | 0 | static int coroutine_enter_func(void *arg)
{
Coroutine *co = arg;
qemu_coroutine_enter(co, NULL);
return 0;
}
| 14,422 |
qemu | ac531cb6e542b1e61d668604adf9dc5306a948c0 | 0 | START_TEST(qdict_new_test)
{
QDict *qdict;
qdict = qdict_new();
fail_unless(qdict != NULL);
fail_unless(qdict_size(qdict) == 0);
fail_unless(qdict->base.refcnt == 1);
fail_unless(qobject_type(QOBJECT(qdict)) == QTYPE_QDICT);
// destroy doesn't exit yet
free(qdict);
}
| 14,423 |
qemu | 847a6473206607bc6c84f6c537a0fe603ff7aaa6 | 0 | int print_insn_xtensa(bfd_vma memaddr, struct disassemble_info *info)
{
xtensa_isa isa = info->private_data;
xtensa_insnbuf insnbuf = xtensa_insnbuf_alloc(isa);
xtensa_insnbuf slotbuf = xtensa_insnbuf_alloc(isa);
bfd_byte *buffer = g_malloc(1);
int status = info->read_memory_func(memaddr, buff... | 14,424 |
qemu | ac4b0d0c4feb291643c0e8a07a92e449e13881b5 | 0 | char *qemu_strdup(const char *str)
{
char *ptr;
size_t len = strlen(str);
ptr = qemu_malloc(len + 1);
if (!ptr)
return NULL;
pstrcpy(ptr, len + 1, str);
return ptr;
}
| 14,425 |
qemu | 4be746345f13e99e468c60acbd3a355e8183e3ce | 0 | static inline void flash_sync_area(Flash *s, int64_t off, int64_t len)
{
int64_t start, end, nb_sectors;
QEMUIOVector iov;
if (!s->bdrv || bdrv_is_read_only(s->bdrv)) {
return;
}
assert(!(len % BDRV_SECTOR_SIZE));
start = off / BDRV_SECTOR_SIZE;
end = (off + len) / BDRV_... | 14,426 |
qemu | 375092332eeaa6e47561ce47fd36144cdaf964d0 | 0 | static ssize_t test_block_read_func(QCryptoBlock *block,
size_t offset,
uint8_t *buf,
size_t buflen,
Error **errp,
void *opaque)
{
... | 14,428 |
qemu | 7f6613cedc59fa849105668ae971dc31004bca1c | 0 | static void decode_micromips32_opc (CPUMIPSState *env, DisasContext *ctx,
uint16_t insn_hw1)
{
int32_t offset;
uint16_t insn;
int rt, rs, rd, rr;
int16_t imm;
uint32_t op, minor, mips32_op;
uint32_t cond, fmt, cc;
insn = cpu_lduw_code(env, ctx->... | 14,430 |
qemu | 1792d7d0a2dc18496e8fc52906163f9f73f3d931 | 0 | static void test_qga_guest_exec(gconstpointer fix)
{
const TestFixture *fixture = fix;
QDict *ret, *val;
const gchar *out;
guchar *decoded;
int64_t pid, now, exitcode;
gsize len;
bool exited;
/* exec 'echo foo bar' */
ret = qmp_fd(fixture->fd, "{'execute': 'guest-exec', '... | 14,431 |
qemu | 7df953bd456da45f761064974820ab5c3fd7b2aa | 0 | static void vtd_do_iommu_translate(VTDAddressSpace *vtd_as, uint8_t bus_num,
uint8_t devfn, hwaddr addr, bool is_write,
IOMMUTLBEntry *entry)
{
IntelIOMMUState *s = vtd_as->iommu_state;
VTDContextEntry ce;
VTDContextCacheEntry *cc_e... | 14,432 |
qemu | 363e13f86eb60bce1e112a35a4c107505a69c9fe | 0 | static void single_quote_string(void)
{
int i;
struct {
const char *encoded;
const char *decoded;
} test_cases[] = {
{ "'hello world'", "hello world" },
{ "'the quick brown fox \\' jumped over the fence'",
"the quick brown fox ' jumped over the fence" },
... | 14,433 |
qemu | 2795ecf681107d55e4113592b3045ece5f6e7b3b | 0 | static int alloc_refcount_block(BlockDriverState *bs,
int64_t cluster_index, uint16_t **refcount_block)
{
BDRVQcowState *s = bs->opaque;
unsigned int refcount_table_index;
int ret;
BLKDBG_EVENT(bs->file, BLKDBG_REFBLOCK_ALLOC);
/* Find the refcount block for the given cluster */
... | 14,434 |
qemu | a7812ae412311d7d47f8aa85656faadac9d64b56 | 0 | static always_inline void gen_qemu_stg (TCGv t0, TCGv t1, int flags)
{
TCGv tmp = tcg_temp_new(TCG_TYPE_I64);
tcg_gen_helper_1_1(helper_g_to_memory, tmp, t0);
tcg_gen_qemu_st64(tmp, t1, flags);
tcg_temp_free(tmp);
}
| 14,435 |
qemu | 0b742797aaada3a2e243175a69d542d2ed997aac | 0 | static void test_qemu_strtosz_erange(void)
{
const char *str = "10E";
char *endptr = NULL;
int64_t res;
res = qemu_strtosz(str, &endptr);
g_assert_cmpint(res, ==, -ERANGE);
g_assert(endptr == str + 3);
}
| 14,436 |
qemu | 7285477ab11831b1cf56e45878a89170dd06d9b9 | 0 | static uint32_t scsi_init_iovec(SCSIDiskReq *r)
{
r->iov.iov_len = MIN(r->sector_count * 512, SCSI_DMA_BUF_SIZE);
qemu_iovec_init_external(&r->qiov, &r->iov, 1);
return r->qiov.size / 512;
}
| 14,437 |
FFmpeg | fd92dafaff8844b5fedf94679b93d953939a7f7b | 0 | static int read_dct_coeffs(BitstreamContext *bc, int32_t block[64],
const uint8_t *scan,
const int32_t quant_matrices[16][64], int q)
{
int coef_list[128];
int mode_list[128];
int i, t, bits, ccoef, mode;
int list_start = 64, list_end = 64, li... | 14,438 |
qemu | 28f082469650a0f4c0e37b4ccd6f9514b1a0698d | 0 | bool qemu_co_queue_next(CoQueue *queue)
{
Coroutine *next;
next = QTAILQ_FIRST(&queue->entries);
if (next) {
QTAILQ_REMOVE(&queue->entries, next, co_queue_next);
QTAILQ_INSERT_TAIL(&unlock_bh_queue, next, co_queue_next);
trace_qemu_co_queue_next(next);
qemu_bh_sched... | 14,439 |
FFmpeg | ee9f36a88eb3e2706ea659acb0ca80c414fa5d8a | 0 | static int nut_write_packet(AVFormatContext *s, int stream_index,
const uint8_t *buf, int size, int64_t pts)
{
NUTContext *nut = s->priv_data;
StreamContext *stream= &nut->stream[stream_index];
ByteIOContext *bc = &s->pb;
int key_frame = 0, full_pts=0;
AVCodecContext *enc;
int64_... | 14,440 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.