project stringclasses 2
values | commit_id stringlengths 40 40 | target int64 0 1 | func stringlengths 26 142k | idx int64 0 27.3k |
|---|---|---|---|---|
FFmpeg | 6e42e6c4b410dbef8b593c2d796a5dad95f89ee4 | 1 | void rgb15tobgr32(const uint8_t *src, uint8_t *dst, long src_size)
{
const uint16_t *end;
uint8_t *d = (uint8_t *)dst;
const uint16_t *s = (const uint16_t *)src;
end = s + src_size/2;
while(s < end)
{
register uint16_t bgr;
bgr = *s++;
#ifdef WORDS_BIGENDIAN
*d++ = 0;
*d++ = (bgr&0x1F)<<3;... | 8,820 |
FFmpeg | b3415e4c5f9205820fd6c9211ad50a4df2692a36 | 1 | static inline int ff_fast_malloc(void *ptr, unsigned int *size, size_t min_size, int zero_realloc)
{
void *val;
if (min_size < *size)
return 0;
min_size = FFMAX(17 * min_size / 16 + 32, min_size);
av_freep(ptr);
val = zero_realloc ? av_mallocz(min_size) : av_malloc(min_size);
m... | 8,821 |
qemu | 69c98726537627e708abb8fcb33e3a2b10e40bf1 | 1 | int qcow2_update_header(BlockDriverState *bs)
BDRVQcowState *s = bs->opaque;
QCowHeader *header;
char *buf;
size_t buflen = s->cluster_size;
int ret;
uint64_t total_size;
uint32_t refcount_table_clusters;
size_t header_length;
Qcow2UnknownHeaderExtension *uext;
buf =... | 8,822 |
FFmpeg | e0c6cce44729d94e2a5507a4b6d031f23e8bd7b6 | 0 | void ff_float_dsp_init_x86(AVFloatDSPContext *fdsp)
{
#if HAVE_YASM
int mm_flags = av_get_cpu_flags();
if (mm_flags & AV_CPU_FLAG_SSE && HAVE_SSE) {
fdsp->vector_fmul = ff_vector_fmul_sse;
fdsp->vector_fmac_scalar = ff_vector_fmac_scalar_sse;
}
if (mm_flags & AV_CPU_FLAG_AVX &&... | 8,823 |
FFmpeg | f1e173049ecc9de03817385ba8962d14cba779db | 0 | static void dequantization_float(int x, int y, Jpeg2000Cblk *cblk,
Jpeg2000Component *comp,
Jpeg2000T1Context *t1, Jpeg2000Band *band)
{
int i, j;
int w = cblk->coord[0][1] - cblk->coord[0][0];
for (j = 0; j < (cblk->coord[1][1] - cblk-... | 8,824 |
FFmpeg | eac161451d248fdd375d403f9bb7d0bec68bc40b | 0 | static int read_extra_header(FFV1Context *f)
{
RangeCoder *const c = &f->c;
uint8_t state[CONTEXT_SIZE];
int i, j, k, ret;
uint8_t state2[32][CONTEXT_SIZE];
memset(state2, 128, sizeof(state2));
memset(state, 128, sizeof(state));
ff_init_range_decoder(c, f->avctx->extradata, f->av... | 8,826 |
FFmpeg | a0c624e299730c8c5800375c2f5f3c6c200053ff | 1 | int ff_v4l2_m2m_codec_end(AVCodecContext *avctx)
{
V4L2m2mContext* s = avctx->priv_data;
int ret;
ret = ff_v4l2_context_set_status(&s->output, VIDIOC_STREAMOFF);
if (ret)
av_log(avctx, AV_LOG_ERROR, "VIDIOC_STREAMOFF %s\n", s->output.name);
ret = ff_v4l2_context_set_status(&s-... | 8,828 |
qemu | c5a49c63fa26e8825ad101dfe86339ae4c216539 | 1 | static void spr_read_tbl(DisasContext *ctx, int gprn, int sprn)
{
if (ctx->tb->cflags & CF_USE_ICOUNT) {
gen_io_start();
}
gen_helper_load_tbl(cpu_gpr[gprn], cpu_env);
if (ctx->tb->cflags & CF_USE_ICOUNT) {
gen_io_end();
gen_stop_exception(ctx);
}
}
| 8,829 |
qemu | 2f9606b3736c3be4dbd606c46525c7b770ced119 | 1 | void vnc_client_read(void *opaque)
{
VncState *vs = opaque;
long ret;
buffer_reserve(&vs->input, 4096);
#ifdef CONFIG_VNC_TLS
if (vs->tls.session) {
ret = gnutls_read(vs->tls.session, buffer_end(&vs->input), 4096);
if (ret < 0) {
if (ret == GNUTLS_E_AGAIN)
errno = EAGAIN;
el... | 8,830 |
qemu | f5aa4bdc766190b95d18be27d5cdf4d80c35b33c | 1 | static void test_bmdma_short_prdt(void)
{
QPCIDevice *dev;
QPCIBar bmdma_bar, ide_bar;
uint8_t status;
PrdtEntry prdt[] = {
{
.addr = 0,
.size = cpu_to_le32(0x10 | PRDT_EOT),
},
};
dev = get_pci_device(&bmdma_bar, &ide_bar);
/* Normal... | 8,831 |
FFmpeg | 63d33cf4390a9280b1ba42ee722f3140cf1cad3e | 1 | int ff_mpeg4_decode_picture_header(MpegEncContext * s, GetBitContext *gb)
{
int startcode, v;
/* search next start code */
align_get_bits(gb);
if(s->avctx->codec_tag == ff_get_fourcc("WV1F") && show_bits(gb, 24) == 0x575630){
skip_bits(gb, 24);
if(get_bits(gb, 8) == 0xF0)
... | 8,832 |
FFmpeg | 428098165de4c3edfe42c1b7f00627d287015863 | 1 | SwsFunc yuv2rgb_init_altivec (SwsContext *c)
{
if (!(c->flags & SWS_CPU_CAPS_ALTIVEC))
return NULL;
/*
and this seems not to matter too much I tried a bunch of
videos with abnormal widths and mplayer crashes else where.
mplayer -vo x11 -rawvideo on:w=350:h=240 raw-350x240.eyuv
boom wit... | 8,833 |
qemu | 7c47959d0cb05db43014141a156ada0b6d53a750 | 1 | static void string_output_append(StringOutputVisitor *sov, int64_t a)
{
Range *r = g_malloc0(sizeof(*r));
r->begin = a;
r->end = a + 1;
sov->ranges = g_list_insert_sorted_merged(sov->ranges, r, range_compare);
}
| 8,834 |
FFmpeg | 6eb2505855fa832ba7d0a1c2fb9f92c41c5446e3 | 0 | static void run_postproc(AVCodecContext *avctx, AVFrame *frame)
{
DDSContext *ctx = avctx->priv_data;
int i, x_off;
switch (ctx->postproc) {
case DDS_ALPHA_EXP:
/* Alpha-exponential mode divides each channel by the maximum
* R, G or B value, and stores the multiplying factor in... | 8,836 |
FFmpeg | f0edab6e63ecee29cb68230100f0c2fb5468284c | 0 | static void ipvideo_decode_format_10_opcodes(IpvideoContext *s, AVFrame *frame)
{
int pass, x, y, changed_block;
int16_t opcode, skip;
GetByteContext decoding_map_ptr;
GetByteContext skip_map_ptr;
bytestream2_skip(&s->stream_ptr, 14); /* data starts 14 bytes in */
/* this is PAL8, so ... | 8,839 |
qemu | a8170e5e97ad17ca169c64ba87ae2f53850dab4c | 0 | static uint64_t omap_clkm_read(void *opaque, target_phys_addr_t addr,
unsigned size)
{
struct omap_mpu_state_s *s = (struct omap_mpu_state_s *) opaque;
if (size != 2) {
return omap_badwidth_read16(opaque, addr);
}
switch (addr) {
case 0x00: /* ARM_C... | 8,840 |
qemu | e2779de053b64f023de382fd87b3596613d47d1e | 0 | static int xen_pt_msgaddr32_reg_write(XenPCIPassthroughState *s,
XenPTReg *cfg_entry, uint32_t *val,
uint32_t dev_value, uint32_t valid_mask)
{
XenPTRegInfo *reg = cfg_entry->reg;
uint32_t writable_mask = 0;
uint32_t old_addr ... | 8,841 |
qemu | cf081fca4e3cc02a309659b571ab0c5b225ea4cf | 0 | static void bdrv_qed_refresh_limits(BlockDriverState *bs, Error **errp)
{
BDRVQEDState *s = bs->opaque;
bs->bl.write_zeroes_alignment = s->header.cluster_size >> BDRV_SECTOR_BITS;
}
| 8,842 |
qemu | 9be385980d37e8f4fd33f605f5fb1c3d144170a8 | 0 | int block_signals(void)
{
TaskState *ts = (TaskState *)thread_cpu->opaque;
sigset_t set;
int pending;
/* It's OK to block everything including SIGSEGV, because we won't
* run any further guest code before unblocking signals in
* process_pending_signals().
*/
sigfillset(&set... | 8,843 |
qemu | c2b38b277a7882a592f4f2ec955084b2b756daaa | 0 | static void poll_set_started(AioContext *ctx, bool started)
{
AioHandler *node;
if (started == ctx->poll_started) {
return;
}
ctx->poll_started = started;
qemu_lockcnt_inc(&ctx->list_lock);
QLIST_FOREACH_RCU(node, &ctx->aio_handlers, node) {
IOHandler *fn;
... | 8,844 |
qemu | 6484e422479c93f28e3f8a68258b0eacd3b31e6d | 0 | void qemu_iohandler_fill(GArray *pollfds)
{
IOHandlerRecord *ioh;
QLIST_FOREACH(ioh, &io_handlers, next) {
int events = 0;
if (ioh->deleted)
continue;
if (ioh->fd_read &&
(!ioh->fd_read_poll ||
ioh->fd_read_poll(ioh->opaque) != 0)) {
... | 8,845 |
qemu | 3dc6f8693694a649a9c83f1e2746565b47683923 | 0 | static void powernv_create_core_node(PnvChip *chip, PnvCore *pc, void *fdt)
{
CPUState *cs = CPU(DEVICE(pc->threads));
DeviceClass *dc = DEVICE_GET_CLASS(cs);
PowerPCCPU *cpu = POWERPC_CPU(cs);
int smt_threads = CPU_CORE(pc)->nr_threads;
CPUPPCState *env = &cpu->env;
PowerPCCPUClass *pcc ... | 8,847 |
qemu | acfb23ad3dd8d0ab385a10e483776ba7dcf927ad | 0 | static void test_bh_flush(void)
{
BHTestData data = { .n = 0 };
data.bh = aio_bh_new(ctx, bh_test_cb, &data);
qemu_bh_schedule(data.bh);
g_assert_cmpint(data.n, ==, 0);
wait_for_aio();
g_assert_cmpint(data.n, ==, 1);
g_assert(!aio_poll(ctx, false));
g_assert_cmpint(data.n,... | 8,848 |
qemu | cca7fad5765251fece44cd230156a101867522dd | 0 | static int spapr_tce_table_realize(DeviceState *dev)
{
sPAPRTCETable *tcet = SPAPR_TCE_TABLE(dev);
if (kvm_enabled()) {
tcet->table = kvmppc_create_spapr_tce(tcet->liobn,
tcet->window_size,
&tcet->fd);
... | 8,849 |
FFmpeg | c3311d472a7528c67f76d0d061704ae70a99b32e | 0 | static int avi_write_header(AVFormatContext *s)
{
AVIContext *avi = s->priv_data;
AVIOContext *pb = s->pb;
int bitrate, n, i, nb_frames, au_byterate, au_ssize, au_scale;
AVCodecContext *stream, *video_enc;
int64_t list1, list2, strh, strf;
AVDictionaryEntry *t = NULL;
if (s->nb_str... | 8,850 |
qemu | 4be746345f13e99e468c60acbd3a355e8183e3ce | 0 | void ide_dma_cb(void *opaque, int ret)
{
IDEState *s = opaque;
int n;
int64_t sector_num;
bool stay_active = false;
if (ret == -ECANCELED) {
return;
}
if (ret < 0) {
int op = IDE_RETRY_DMA;
if (s->dma_cmd == IDE_DMA_READ)
op |= IDE_RETRY_RE... | 8,851 |
qemu | 45a50b1668822c23afc2a89f724654e176518bc4 | 0 | int load_elf(const char *filename, int64_t address_offset,
uint64_t *pentry, uint64_t *lowaddr, uint64_t *highaddr,
int big_endian, int elf_machine, int clear_lsb)
{
int fd, data_order, target_data_order, must_swab, ret;
uint8_t e_ident[EI_NIDENT];
fd = open(filename, O_RDO... | 8,852 |
qemu | d0d7708ba29cbcc343364a46bff981e0ff88366f | 0 | static CharDriverState *qemu_chr_open_pty(const char *id,
ChardevBackend *backend,
ChardevReturn *ret,
Error **errp)
{
CharDriverState *chr;
PtyCharDriver *s;
int master_fd, s... | 8,854 |
qemu | a8170e5e97ad17ca169c64ba87ae2f53850dab4c | 0 | static uint64_t cirrus_linear_read(void *opaque, target_phys_addr_t addr,
unsigned size)
{
CirrusVGAState *s = opaque;
uint32_t ret;
addr &= s->cirrus_addr_mask;
if (((s->vga.sr[0x17] & 0x44) == 0x44) &&
((addr & s->linear_mmio_mask) == s->linear_mmi... | 8,856 |
qemu | df3a429ae82c0f45becdfab105617701d75e0f05 | 0 | static int qemu_gluster_create(const char *filename,
QemuOpts *opts, Error **errp)
{
BlockdevOptionsGluster *gconf;
struct glfs *glfs;
struct glfs_fd *fd;
int ret = 0;
int prealloc = 0;
int64_t total_size = 0;
char *tmp = NULL;
gconf = g_new0(Bl... | 8,857 |
qemu | 3a130f4ef07f4532500473aeab43c86a3c2991c8 | 0 | static void memory_region_iorange_read(IORange *iorange,
uint64_t offset,
unsigned width,
uint64_t *data)
{
MemoryRegion *mr = container_of(iorange, MemoryRegion, iorange);
if (mr->ops->o... | 8,859 |
qemu | 95b5edcd92d64c7b8fe9f2e3e0725fdf84be0dfa | 0 | static int ide_drive_initfn(IDEDevice *dev)
{
return ide_dev_initfn(dev,
bdrv_get_type_hint(dev->conf.bs) == BDRV_TYPE_CDROM
? IDE_CD : IDE_HD);
}
| 8,860 |
FFmpeg | f9f9ae1b77e4fb1bffa6b23be7bd20e514b8ba7b | 0 | static av_cold void h264dsp_init_neon(H264DSPContext *c, const int bit_depth,
const int chroma_format_idc)
{
#if HAVE_NEON
if (bit_depth == 8) {
c->h264_v_loop_filter_luma = ff_h264_v_loop_filter_luma_neon;
c->h264_h_loop_filter_luma = ff_h264_h_loop_f... | 8,861 |
qemu | 72cf2d4f0e181d0d3a3122e04129c58a95da713e | 0 | int load_vmstate(Monitor *mon, const char *name)
{
DriveInfo *dinfo;
BlockDriverState *bs, *bs1;
QEMUSnapshotInfo sn;
QEMUFile *f;
int ret;
bs = get_bs_snapshots();
if (!bs) {
monitor_printf(mon, "No block device supports snapshots\n");
return -EINVAL;
}
... | 8,863 |
qemu | ee9a569ab88edd0755402aaf31ec0c69decf7756 | 0 | static void spapr_tce_reset(DeviceState *dev)
{
sPAPRTCETable *tcet = SPAPR_TCE_TABLE(dev);
size_t table_size = tcet->nb_table * sizeof(uint64_t);
tcet->bypass = false;
memset(tcet->table, 0, table_size);
}
| 8,865 |
FFmpeg | 9e2dabed4a7bf21e3e0c0f4ddc895f8ed90fa839 | 1 | AVIOContext *avio_alloc_context(
unsigned char *buffer,
int buffer_size,
int write_flag,
void *opaque,
int (*read_packet)(void *opaque, uint8_t *buf, int buf_size),
int (*write_packet)(void *opaque, uint8_t... | 8,867 |
qemu | 0752706de257b38763006ff5bb6b39a97e669ba2 | 1 | static void slirp_guestfwd(SlirpState *s, Monitor *mon, const char *config_str,
int legacy_format)
{
struct in_addr server = { .s_addr = 0 };
struct GuestFwd *fwd;
const char *p;
char buf[128];
char *end;
int port;
p = config_str;
if (legacy_format)... | 8,868 |
qemu | e9d86b760cca52dc35c7716873c342eb03c22b61 | 1 | int s390_virtio_hypercall(CPUState *env, uint64_t mem, uint64_t hypercall)
{
int r = 0, i;
dprintf("KVM hypercall: %ld\n", hypercall);
switch (hypercall) {
case KVM_S390_VIRTIO_NOTIFY:
if (mem > ram_size) {
VirtIOS390Device *dev = s390_virtio_bus_find_vring(s390_bus,
... | 8,869 |
qemu | 7797a73947d5c0e63dd5552b348cf66c384b4555 | 1 | PXA2xxPCMCIAState *pxa2xx_pcmcia_init(MemoryRegion *sysmem,
hwaddr base)
{
DeviceState *dev;
PXA2xxPCMCIAState *s;
dev = qdev_create(NULL, TYPE_PXA2XX_PCMCIA);
sysbus_mmio_map(SYS_BUS_DEVICE(dev), 0, base);
s = PXA2XX_PCMCIA(dev);
if (base == 0x3... | 8,870 |
qemu | 0f7bfd8198ffad58a5095ac5d7a46288ea7f5c6e | 1 | static void qxl_exit_vga_mode(PCIQXLDevice *d)
{
if (d->mode != QXL_MODE_VGA) {
return;
}
trace_qxl_exit_vga_mode(d->id);
qxl_destroy_primary(d, QXL_SYNC);
} | 8,871 |
FFmpeg | 96a08d8627301dae41a7697ea4346cc9981df17c | 1 | static int synth_frame(AVCodecContext *ctx, GetBitContext *gb, int frame_idx,
float *samples,
const double *lsps, const double *prev_lsps,
float *excitation, float *synth)
{
WMAVoiceContext *s = ctx->priv_data;
int n, n_blocks_x2, log_n_... | 8,872 |
FFmpeg | 25e37f5ea92d4201976a59ae306ce848d257a7e6 | 0 | int64_t av_rescale_rnd(int64_t a, int64_t b, int64_t c, enum AVRounding rnd)
{
int64_t r = 0;
av_assert2(c > 0);
av_assert2(b >=0);
av_assert2((unsigned)(rnd&~AV_ROUND_PASS_MINMAX)<=5 && (rnd&~AV_ROUND_PASS_MINMAX)!=4);
if (c <= 0 || b < 0 || !((unsigned)(rnd&~AV_ROUND_PASS_MINMAX)<=5 && (rn... | 8,875 |
FFmpeg | d1adad3cca407f493c3637e20ecd4f7124e69212 | 0 | static inline void RENAME(rgb24tobgr32)(const uint8_t *src, uint8_t *dst, long src_size)
{
uint8_t *dest = dst;
const uint8_t *s = src;
const uint8_t *end;
#if COMPILE_TEMPLATE_MMX
const uint8_t *mm_end;
#endif
end = s + src_size;
#if COMPILE_TEMPLATE_MMX
__asm__ volatile(PREFETCH" ... | 8,876 |
FFmpeg | c9fe0caf7a1abde7ca0b1a359f551103064867b1 | 0 | static void FUNC(transquant_bypass16x16)(uint8_t *_dst, int16_t *coeffs,
ptrdiff_t stride)
{
int x, y;
pixel *dst = (pixel *)_dst;
stride /= sizeof(pixel);
for (y = 0; y < 16; y++) {
for (x = 0; x < 16; x++) {
dst[x] += *coeffs;
... | 8,877 |
FFmpeg | ce79410bba776d4121685654056f2b4e39bbd3f7 | 0 | static int CUDAAPI cuvid_handle_video_sequence(void *opaque, CUVIDEOFORMAT* format)
{
AVCodecContext *avctx = opaque;
CuvidContext *ctx = avctx->priv_data;
AVHWFramesContext *hwframe_ctx = (AVHWFramesContext*)ctx->hwframe->data;
CUVIDDECODECREATEINFO cuinfo;
int surface_fmt;
enum AVPixe... | 8,879 |
FFmpeg | e2193b53eab9f207544a75ebaf51871b7a1a7931 | 0 | static void set_stream_info_from_input_stream(AVStream *st, struct playlist *pls, AVStream *ist)
{
avcodec_parameters_copy(st->codecpar, ist->codecpar);
if (pls->is_id3_timestamped) /* custom timestamps via id3 */
avpriv_set_pts_info(st, 33, 1, MPEG_TIME_BASE);
else
avpriv_set_pts_in... | 8,880 |
FFmpeg | c82bf15dca00f67a701d126e47ea9075fc9459cb | 1 | void ff_rtp_send_h264(AVFormatContext *s1, const uint8_t *buf1, int size)
{
const uint8_t *r, *end = buf1 + size;
RTPMuxContext *s = s1->priv_data;
s->timestamp = s->cur_timestamp;
s->buf_ptr = s->buf;
if (s->nal_length_size)
r = ff_avc_mp4_find_startcode(buf1, end, s->nal_length_... | 8,882 |
FFmpeg | c23acbaed40101c677dfcfbbfe0d2c230a8e8f44 | 1 | static inline void idct4col_put(uint8_t *dest, int line_size, const DCTELEM *col)
{
int c0, c1, c2, c3, a0, a1, a2, a3;
const uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;
a0 = col[8*0];
a1 = col[8*2];
a2 = col[8*4];
a3 = col[8*6];
c0 = ((a0 + a2) << (CN_SHIFT - 1)) + (1 << (C_SHIFT - 1... | 8,883 |
qemu | 6a9b110d54b885dbb29872a142cc4d2a402fada8 | 1 | static ExitStatus gen_fbcond(DisasContext *ctx, TCGCond cond, int ra,
int32_t disp)
{
TCGv cmp_tmp = tcg_temp_new();
gen_fold_mzero(cond, cmp_tmp, load_fpr(ctx, ra));
return gen_bcond_internal(ctx, cond, cmp_tmp, disp);
}
| 8,884 |
qemu | 12de9a396acbc95e25c5d60ed097cc55777eaaed | 1 | int cpu_ppc_handle_mmu_fault (CPUState *env, target_ulong address, int rw,
int is_user, int is_softmmu)
{
mmu_ctx_t ctx;
int access_type;
int ret = 0;
if (rw == 2) {
/* code access */
rw = 0;
access_type = ACCESS_CODE;
} else {
... | 8,885 |
FFmpeg | 0491a2a07a44f6e5e6f34081835e402c07025fd2 | 0 | static inline void writer_print_string(WriterContext *wctx,
const char *key, const char *val)
{
wctx->writer->print_string(wctx, key, val);
wctx->nb_item++;
}
| 8,886 |
FFmpeg | 3b199d29cd597a3518136d78860e172060b9e83d | 0 | static av_cold int cinvideo_decode_init(AVCodecContext *avctx)
{
CinVideoContext *cin = avctx->priv_data;
unsigned int i;
cin->avctx = avctx;
avctx->pix_fmt = AV_PIX_FMT_PAL8;
cin->frame.data[0] = NULL;
cin->bitmap_size = avctx->width * avctx->height;
for (i = 0; i < 3; ++i) {
... | 8,887 |
FFmpeg | 8976ef7aec4c62e41a0abb50d2bf4dbfa3508e2a | 0 | static int add_file(AVFormatContext *avf, char *filename, ConcatFile **rfile,
unsigned *nb_files_alloc)
{
ConcatContext *cat = avf->priv_data;
ConcatFile *file;
char *url;
size_t url_len;
url_len = strlen(avf->filename) + strlen(filename) + 16;
if (!(url = av_malloc... | 8,888 |
qemu | 88365d17d586bcf0d9f4432447db345f72278a2a | 1 | int kvm_arch_remove_hw_breakpoint(target_ulong addr, target_ulong len, int type)
{
return -EINVAL;
}
| 8,889 |
FFmpeg | 06f4b1e37a08f3fd269ecbfeb0181129e5bfc86e | 1 | static double compute_target_time(double frame_current_pts, VideoState *is)
{
double delay, sync_threshold, diff;
/* compute nominal delay */
delay = frame_current_pts - is->frame_last_pts;
if (delay <= 0 || delay >= 10.0) {
/* if incorrect delay, use previous one */
delay = is-... | 8,890 |
qemu | 4118a97030aa9bd1d520d1d06bbe0655d829df04 | 1 | long target_mmap(target_ulong start, target_ulong len, int prot,
int flags, int fd, target_ulong offset)
{
target_ulong ret, end, real_start, real_end, retaddr, host_offset, host_len;
long host_start;
#if defined(__alpha__) || defined(__sparc__) || defined(__x86_64__) || \
defined... | 8,891 |
qemu | 7d8abfcb50a33aed369bbd267852cf04009c49e9 | 1 | read_f(int argc, char **argv)
{
struct timeval t1, t2;
int Cflag = 0, pflag = 0, qflag = 0, vflag = 0;
int Pflag = 0, sflag = 0, lflag = 0;
int c, cnt;
char *buf;
int64_t offset;
int count;
/* Some compilers get confused and warn if this is not initialized. */
int total = 0;
int patt... | 8,892 |
qemu | 322fd48afbed1ef7b834ac343a0c8687bcb33695 | 1 | e1000_receive(VLANClientState *nc, const uint8_t *buf, size_t size)
{
E1000State *s = DO_UPCAST(NICState, nc, nc)->opaque;
struct e1000_rx_desc desc;
target_phys_addr_t base;
unsigned int n, rdt;
uint32_t rdh_start;
uint16_t vlan_special = 0;
uint8_t vlan_status = 0, vlan_offset = 0;... | 8,893 |
qemu | 72aa364b1d9daa889bb5898ea4aded9d27fd1c96 | 1 | static void ehci_update_frindex(EHCIState *ehci, int uframes)
{
int i;
if (!ehci_enabled(ehci) && ehci->pstate == EST_INACTIVE) {
return;
}
for (i = 0; i < uframes; i++) {
ehci->frindex++;
if (ehci->frindex == 0x00002000) {
ehci_raise_irq(ehci, USBSTS_F... | 8,894 |
FFmpeg | f9d7e9feec2a0fd7f7930d01876a70a9b8a4a3b9 | 1 | static int tee_write_header(AVFormatContext *avf)
{
TeeContext *tee = avf->priv_data;
unsigned nb_slaves = 0, i;
const char *filename = avf->filename;
char *slaves[MAX_SLAVES];
int ret;
while (*filename) {
if (nb_slaves == MAX_SLAVES) {
av_log(avf, AV_LOG_ERROR, "M... | 8,895 |
qemu | 882b3b97697affb36ca3d174f42f846232008979 | 1 | static int css_add_virtual_chpid(uint8_t cssid, uint8_t chpid, uint8_t type)
{
CssImage *css;
trace_css_chpid_add(cssid, chpid, type);
if (cssid > MAX_CSSID) {
return -EINVAL;
}
css = channel_subsys.css[cssid];
if (!css) {
return -EINVAL;
}
if (css->chpids[ch... | 8,896 |
qemu | e829b0bb054ed3389e5b22dad61875e51674e629 | 1 | iscsi_readcapacity10_cb(struct iscsi_context *iscsi, int status,
void *command_data, void *opaque)
{
struct IscsiTask *itask = opaque;
struct scsi_readcapacity10 *rc10;
struct scsi_task *task = command_data;
if (status != 0) {
error_report("iSCSI: Failed to read ... | 8,897 |
qemu | 7d91ddd25e3a4e5008a2ac16127d51a34fd56bf1 | 1 | bool qemu_net_queue_flush(NetQueue *queue)
{
while (!QTAILQ_EMPTY(&queue->packets)) {
NetPacket *packet;
int ret;
packet = QTAILQ_FIRST(&queue->packets);
QTAILQ_REMOVE(&queue->packets, packet, entry);
ret = qemu_net_queue_deliver(queue,
... | 8,898 |
FFmpeg | f9315ea984efc1a58499664e27b75c37295381db | 1 | void ffserver_parse_acl_row(FFServerStream *stream, FFServerStream* feed,
FFServerIPAddressACL *ext_acl,
const char *p, const char *filename, int line_num)
{
char arg[1024];
FFServerIPAddressACL acl;
FFServerIPAddressACL *nacl;
FFServerIPAddressACL... | 8,899 |
qemu | f307b2558f61e068ce514f2dde2cad74c62036d6 | 1 | static int check_refblocks(BlockDriverState *bs, BdrvCheckResult *res,
BdrvCheckMode fix, uint16_t **refcount_table,
int64_t *nb_clusters)
{
BDRVQcowState *s = bs->opaque;
int64_t i, size;
int ret;
for(i = 0; i < s->refcount_table_size; i++)... | 8,902 |
qemu | 8bcbf37caa87ba89bc391bad70039f942a98c7e3 | 1 | static void handle_sys(DisasContext *s, uint32_t insn, bool isread,
unsigned int op0, unsigned int op1, unsigned int op2,
unsigned int crn, unsigned int crm, unsigned int rt)
{
const ARMCPRegInfo *ri;
TCGv_i64 tcg_rt;
ri = get_arm_cp_reginfo(s->cp_regs,
... | 8,904 |
qemu | 66029f6a2f717873f2d170681f0250801a6d0d39 | 1 | soread(so)
struct socket *so;
{
int n, nn, lss, total;
struct sbuf *sb = &so->so_snd;
int len = sb->sb_datalen - sb->sb_cc;
struct iovec iov[2];
int mss = so->so_tcpcb->t_maxseg;
DEBUG_CALL("soread");
DEBUG_ARG("so = %lx", (long )so);
/*
* No need to check if there's enough room to read.
* ... | 8,905 |
FFmpeg | 42b6805cc1989f759f19e9d253527311741cbd3a | 1 | static void decode_422_bitstream(HYuvContext *s, int count)
{
int i;
count /= 2;
if (count >= (get_bits_left(&s->gb)) / (31 * 4)) {
for (i = 0; i < count && get_bits_left(&s->gb) > 0; i++) {
READ_2PIX(s->temp[0][2 * i ], s->temp[1][i], 1);
READ_2PIX(s->temp[0][2... | 8,907 |
FFmpeg | 3669915e93b3df63034857534245c3f2575d78ff | 1 | static int dv_extract_audio(uint8_t* frame, uint8_t* ppcm[4],
const DVprofile *sys)
{
int size, chan, i, j, d, of, smpls, freq, quant, half_ch;
uint16_t lc, rc;
const uint8_t* as_pack;
uint8_t *pcm, ipcm;
as_pack = dv_extract_pack(frame, dv_audio_source);
if (!as_pack... | 8,908 |
FFmpeg | 7c97946d6131b31340954a3f603b6bf92590a9a5 | 1 | void ff_mpeg4_encode_picture_header(MpegEncContext *s, int picture_number)
{
int time_incr;
int time_div, time_mod;
if (s->pict_type == AV_PICTURE_TYPE_I) {
if (!(s->avctx->flags & AV_CODEC_FLAG_GLOBAL_HEADER)) {
if (s->strict_std_compliance < FF_COMPLIANCE_VERY_STRICT) // HACK,... | 8,909 |
FFmpeg | 214085852491448631dcecb008b5d172c11b8892 | 1 | static int hls_slice_data_wpp(HEVCContext *s, const HEVCNAL *nal)
{
const uint8_t *data = nal->data;
int length = nal->size;
HEVCLocalContext *lc = s->HEVClc;
int *ret = av_malloc_array(s->sh.num_entry_point_offsets + 1, sizeof(int));
int *arg = av_malloc_array(s->sh.num_entry_point_o... | 8,910 |
qemu | 60fe637bf0e4d7989e21e50f52526444765c63b4 | 1 | void qemu_file_reset_rate_limit(QEMUFile *f)
{
f->bytes_xfer = 0;
}
| 8,911 |
qemu | 58889fe50a7c5b8776cf3096a8fe611fb66c4e5c | 1 | static struct mmsghdr *build_l2tpv3_vector(NetL2TPV3State *s, int count)
{
int i;
struct iovec *iov;
struct mmsghdr *msgvec, *result;
msgvec = g_malloc(sizeof(struct mmsghdr) * count);
result = msgvec;
for (i = 0; i < count ; i++) {
msgvec->msg_hdr.msg_name = NULL;
msg... | 8,912 |
qemu | 2572b37a4751cc967582d7d04f21d9bf97187ae5 | 0 | int64_t bdrv_get_block_status(BlockDriverState *bs, int64_t sector_num,
int nb_sectors, int *pnum)
{
Coroutine *co;
BdrvCoGetBlockStatusData data = {
.bs = bs,
.sector_num = sector_num,
.nb_sectors = nb_sectors,
.pnum = pnum,
.done =... | 8,913 |
qemu | 98522f63f40adaebc412481e1d2e9170160d4539 | 0 | static BlockDriverState *bdrv_new_open(const char *filename,
const char *fmt,
int flags,
bool require_io,
bool quiet)
{
BlockDriverState *bs;
BlockDr... | 8,914 |
qemu | 396f929762d10ba2c7b38f7e8a2276dd066be2d7 | 0 | void monitor_init(CharDriverState *hd, int show_banner)
{
int i;
if (is_first_init) {
key_timer = qemu_new_timer(vm_clock, release_keys, NULL);
if (!key_timer)
return;
for (i = 0; i < MAX_MON; i++) {
monitor_hd[i] = NULL;
}
is_first_ini... | 8,916 |
qemu | 6e0d8677cb443e7408c0b7a25a93c6596d7fa380 | 0 | void OPPROTO op_jz_T0_label(void)
{
if (!T0)
GOTO_LABEL_PARAM(1);
FORCE_RET();
}
| 8,917 |
qemu | 2c62f08ddbf3fa80dc7202eb9a2ea60ae44e2cc5 | 0 | struct omap_lcd_panel_s *omap_lcdc_init(MemoryRegion *sysmem,
hwaddr base,
qemu_irq irq,
struct omap_dma_lcd_channel_s *dma,
omap_clk clk)
{
struct om... | 8,918 |
FFmpeg | 6919e54c00b750cd3d9d756258d3677df52f96a9 | 0 | int av_interleave_packet_per_dts(AVFormatContext *s, AVPacket *out, AVPacket *pkt, int flush){
AVPacketList *pktl, **next_point, *this_pktl;
int stream_count=0;
int streams[MAX_STREAMS];
if(pkt){
AVStream *st= s->streams[ pkt->stream_index];
// assert(pkt->destruct != av_destruc... | 8,919 |
qemu | d4c430a80f000d722bb70287af4d4c184a8d7006 | 0 | int cpu_mb_handle_mmu_fault (CPUState *env, target_ulong address, int rw,
int mmu_idx, int is_softmmu)
{
unsigned int hit;
unsigned int mmu_available;
int r = 1;
int prot;
mmu_available = 0;
if (env->pvr.regs[0] & PVR0_USE_MMU) {
mmu_available = ... | 8,920 |
qemu | a8170e5e97ad17ca169c64ba87ae2f53850dab4c | 0 | static uint64_t grlib_irqmp_read(void *opaque, target_phys_addr_t addr,
unsigned size)
{
IRQMP *irqmp = opaque;
IRQMPState *state;
assert(irqmp != NULL);
state = irqmp->state;
assert(state != NULL);
addr &= 0xff;
/* global registers */
... | 8,921 |
qemu | 621ff94d5074d88253a5818c6b9c4db718fbfc65 | 0 | Object *object_new_with_propv(const char *typename,
Object *parent,
const char *id,
Error **errp,
va_list vargs)
{
Object *obj;
ObjectClass *klass;
Error *local_err = NULL;
... | 8,922 |
qemu | 7e7e2ebc942da8285931ceabf12823e165dced8b | 0 | void start_auth_sasl(VncState *vs)
{
const char *mechlist = NULL;
sasl_security_properties_t secprops;
int err;
char *localAddr, *remoteAddr;
int mechlistlen;
VNC_DEBUG("Initialize SASL auth %d\n", vs->csock);
/* Get local & remote client addresses in form IPADDR;PORT */
if... | 8,923 |
qemu | 3b098d56979d2f7fd707c5be85555d114353a28d | 0 | static void visitor_output_teardown(TestOutputVisitorData *data,
const void *unused)
{
visit_free(data->ov);
data->sov = NULL;
data->ov = NULL;
g_free(data->str);
data->str = NULL;
}
| 8,924 |
qemu | a8170e5e97ad17ca169c64ba87ae2f53850dab4c | 0 | static void megasas_port_write(void *opaque, target_phys_addr_t addr,
uint64_t val, unsigned size)
{
megasas_mmio_write(opaque, addr & 0xff, val, size);
}
| 8,925 |
qemu | 15455536df5ef652759ccf465d5e6f73acb493df | 0 | static inline void os_host_main_loop_wait(int *timeout)
{
}
| 8,926 |
qemu | e8ede0a8bb5298a6979bcf7ed84ef64a64a4e3fe | 0 | uint32_t HELPER(ucf64_get_fpscr)(CPUUniCore32State *env)
{
int i;
uint32_t fpscr;
fpscr = (env->ucf64.xregs[UC32_UCF64_FPSCR] & UCF64_FPSCR_MASK);
i = get_float_exception_flags(&env->ucf64.fp_status);
fpscr |= ucf64_exceptbits_from_host(i);
return fpscr;
}
| 8,928 |
qemu | f0536bb848ad6eb2709a7dc675f261bd160c751b | 0 | static int img_resize(int argc, char **argv)
{
int c, ret, relative;
const char *filename, *fmt, *size;
int64_t n, total_size;
BlockDriverState *bs = NULL;
QemuOpts *param;
static QemuOptsList resize_options = {
.name = "resize_options",
.head = QTAILQ_HEAD_INITIALIZER(r... | 8,929 |
qemu | d40d3da00c10f0169a26985ecb65033bff536f2c | 0 | void dump_exec_info(FILE *f, fprintf_function cpu_fprintf)
{
int i, target_code_size, max_target_code_size;
int direct_jmp_count, direct_jmp2_count, cross_page;
TranslationBlock *tb;
struct qht_stats hst;
tb_lock();
if (!tcg_enabled()) {
cpu_fprintf(f, "TCG not enabled\n");
... | 8,932 |
qemu | 4678124bb9bfb49e93b83f95c4d2feeb443ea38b | 0 | build_fadt(GArray *table_data, BIOSLinker *linker, AcpiPmInfo *pm,
unsigned facs, unsigned dsdt,
const char *oem_id, const char *oem_table_id)
{
AcpiFadtDescriptorRev1 *fadt = acpi_data_push(table_data, sizeof(*fadt));
fadt->firmware_ctrl = cpu_to_le32(facs);
/* FACS address to... | 8,933 |
qemu | deb2db996cbb9470b39ae1e383791ef34c4eb3c2 | 0 | void arm_cpu_do_unaligned_access(CPUState *cs, vaddr vaddr, int is_write,
int is_user, uintptr_t retaddr)
{
ARMCPU *cpu = ARM_CPU(cs);
CPUARMState *env = &cpu->env;
int target_el;
bool same_el;
if (retaddr) {
/* now we have a real cpu fault */
... | 8,934 |
qemu | 4be746345f13e99e468c60acbd3a355e8183e3ce | 0 | static void flash_sync_page(Flash *s, int page)
{
int bdrv_sector, nb_sectors;
QEMUIOVector iov;
if (!s->bdrv || bdrv_is_read_only(s->bdrv)) {
return;
}
bdrv_sector = (page * s->pi->page_size) / BDRV_SECTOR_SIZE;
nb_sectors = DIV_ROUND_UP(s->pi->page_size, BDRV_SECTOR_SIZE);
... | 8,935 |
qemu | 494a8ebe713055d3946183f4b395f85a18b43e9e | 0 | static int proxy_lstat(FsContext *fs_ctx, V9fsPath *fs_path, struct stat *stbuf)
{
int retval;
retval = v9fs_request(fs_ctx->private, T_LSTAT, stbuf, "s", fs_path);
if (retval < 0) {
errno = -retval;
return -1;
}
return retval;
}
| 8,936 |
qemu | 0e9b9edae7bebfd31fdbead4ccbbce03876a7edd | 0 | void bios_linker_loader_add_checksum(GArray *linker, const char *file,
GArray *table,
void *start, unsigned size,
uint8_t *checksum)
{
BiosLinkerLoaderEntry entry;
ptrdiff_t checksum_offset = (gc... | 8,937 |
qemu | a193b0f0a8d7735f4eb2ff863fd0902a5fa5eec6 | 0 | void backup_do_checkpoint(BlockJob *job, Error **errp)
{
BackupBlockJob *backup_job = container_of(job, BackupBlockJob, common);
int64_t len;
assert(job->driver->job_type == BLOCK_JOB_TYPE_BACKUP);
if (backup_job->sync_mode != MIRROR_SYNC_MODE_NONE) {
error_setg(errp, "The backup job o... | 8,938 |
qemu | 185698715dfb18c82ad2a5dbc169908602d43e81 | 0 | int floatx80_is_nan( floatx80 a1 )
{
floatx80u u;
u.f = a1;
return ( ( u.i.high & 0x7FFF ) == 0x7FFF ) && (bits64) ( u.i.low<<1 );
}
| 8,939 |
qemu | e2a176dfda32f5cf80703c2921a19fe75850c38c | 0 | static void taihu_cpld_writel (void *opaque,
hwaddr addr, uint32_t value)
{
taihu_cpld_writel(opaque, addr, (value >> 24) & 0xFF);
taihu_cpld_writel(opaque, addr + 1, (value >> 16) & 0xFF);
taihu_cpld_writel(opaque, addr + 2, (value >> 8) & 0xFF);
taihu_cpld_writeb(o... | 8,940 |
FFmpeg | 95165f7c1b533c121b890fa1e82e8ed596cfc108 | 0 | static int mov_write_stts_tag(AVIOContext *pb, MOVTrack *track)
{
MOVStts *stts_entries;
uint32_t entries = -1;
uint32_t atom_size;
int i;
if (track->enc->codec_type == AVMEDIA_TYPE_AUDIO && !track->audio_vbr) {
stts_entries = av_malloc(sizeof(*stts_entries)); /* one entry */
... | 8,941 |
qemu | 4f4f6976d80614e2d81cea4385885876f24bb257 | 0 | void qcrypto_cipher_free(QCryptoCipher *cipher)
{
QCryptoCipherBuiltin *ctxt = cipher->opaque;
if (!cipher) {
return;
}
ctxt->free(cipher);
g_free(cipher);
}
| 8,942 |
qemu | a8170e5e97ad17ca169c64ba87ae2f53850dab4c | 0 | static uint64_t omap_wd_timer_read(void *opaque, target_phys_addr_t addr,
unsigned size)
{
struct omap_watchdog_timer_s *s = (struct omap_watchdog_timer_s *) opaque;
if (size != 2) {
return omap_badwidth_read16(opaque, addr);
}
switch (addr) {
c... | 8,943 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.