project stringclasses 2
values | commit_id stringlengths 40 40 | target int64 0 1 | func stringlengths 26 142k | idx int64 0 27.3k |
|---|---|---|---|---|
qemu | 338c858c946017cd3ec8c2be06d817e001d94bc3 | 0 | long do_sigreturn(CPUAlphaState *env)
{
struct target_sigcontext *sc;
abi_ulong sc_addr = env->ir[IR_A0];
target_sigset_t target_set;
sigset_t set;
if (!lock_user_struct(VERIFY_READ, sc, sc_addr, 1)) {
goto badframe;
}
target_sigemptyset(&target_set);
__get_user(tar... | 26,253 |
qemu | 4be746345f13e99e468c60acbd3a355e8183e3ce | 0 | static bool ide_sect_range_ok(IDEState *s,
uint64_t sector, uint64_t nb_sectors)
{
uint64_t total_sectors;
bdrv_get_geometry(s->bs, &total_sectors);
if (sector > total_sectors || nb_sectors > total_sectors - sector) {
return false;
}
return true;
}
| 26,254 |
qemu | 384acbf46b70edf0d2c1648aa1a92a90bcf7057d | 0 | int qed_write_l1_table_sync(BDRVQEDState *s, unsigned int index,
unsigned int n)
{
int ret = -EINPROGRESS;
async_context_push();
qed_write_l1_table(s, index, n, qed_sync_cb, &ret);
while (ret == -EINPROGRESS) {
qemu_aio_wait();
}
async_context_p... | 26,255 |
qemu | ec05ec26f940564b1e07bf88857035ec27e21dd8 | 0 | bool memory_region_get_dirty(MemoryRegion *mr, hwaddr addr,
hwaddr size, unsigned client)
{
assert(mr->terminates);
return cpu_physical_memory_get_dirty(mr->ram_addr + addr, size, client);
}
| 26,256 |
qemu | 52cfcb464255b4da5115408e2a6ce3327bbcb9df | 0 | static void filter_mirror_setup(NetFilterState *nf, Error **errp)
{
MirrorState *s = FILTER_MIRROR(nf);
if (!s->outdev) {
error_setg(errp, "filter filter mirror needs 'outdev' "
"property set");
return;
}
s->chr_out = qemu_chr_find(s->outdev);
if (s->c... | 26,258 |
qemu | 8297be80f7cf71e09617669a8bd8b2836dcfd4c3 | 0 | static void generate_eeprom_spd(uint8_t *eeprom, ram_addr_t ram_size)
{
enum { SDR = 0x4, DDR2 = 0x8 } type;
uint8_t *spd = spd_eeprom.contents;
uint8_t nbanks = 0;
uint16_t density = 0;
int i;
/* work in terms of MB */
ram_size >>= 20;
while ((ram_size >= 4) && (nbanks <= 2... | 26,260 |
qemu | a0efbf16604770b9d805bcf210ec29942321134f | 0 | static GenericList *next_list(Visitor *v, GenericList *tail, size_t size)
{
StringInputVisitor *siv = to_siv(v);
Range *r;
if (!siv->ranges || !siv->cur_range) {
return NULL;
}
r = siv->cur_range->data;
if (!r) {
return NULL;
}
if (siv->cur < r->begin || ... | 26,261 |
FFmpeg | aff01de6415f1ba022f1a58e354ad6e4d0796e97 | 0 | static int link_filter_inouts(AVFilterContext *filt_ctx,
AVFilterInOut **curr_inputs,
AVFilterInOut **open_inputs, void *log_ctx)
{
int pad, ret;
for (pad = 0; pad < filt_ctx->input_count; pad++) {
AVFilterInOut *p = *curr_inputs;
... | 26,262 |
qemu | 49dfcec40349245ad365964468b67e132c3cedc7 | 0 | static void invalidate_and_set_dirty(hwaddr addr,
hwaddr length)
{
if (cpu_physical_memory_range_includes_clean(addr, length)) {
tb_invalidate_phys_range(addr, addr + length, 0);
cpu_physical_memory_set_dirty_range_nocode(addr, length);
}
xen_modif... | 26,263 |
qemu | 494a8ebe713055d3946183f4b395f85a18b43e9e | 0 | static int proxy_unlinkat(FsContext *ctx, V9fsPath *dir,
const char *name, int flags)
{
int ret;
V9fsString fullname;
v9fs_string_init(&fullname);
v9fs_string_sprintf(&fullname, "%s/%s", dir->data, name);
ret = proxy_remove(ctx, fullname.data);
v9fs_string_fre... | 26,264 |
qemu | ad07cd69ecaffbaa015459a46975ab32e50df805 | 0 | void virtio_scsi_common_realize(DeviceState *dev, Error **errp,
VirtIOHandleOutput ctrl,
VirtIOHandleOutput evt,
VirtIOHandleOutput cmd)
{
VirtIODevice *vdev = VIRTIO_DEVICE(dev);
VirtIOSCSICommon *s = VIRTIO_S... | 26,265 |
qemu | cd42d5b23691ad73edfd6dbcfc935a960a9c5a65 | 0 | static inline void gen_intermediate_code_internal(SPARCCPU *cpu,
TranslationBlock *tb,
bool spc)
{
CPUState *cs = CPU(cpu);
CPUSPARCState *env = &cpu->env;
target_ulong pc_start, last_pc;
uint16_t ... | 26,266 |
qemu | ef1e1e0782e99c9dcf2b35e5310cdd8ca9211374 | 0 | static int load_uboot_image(const char *filename, hwaddr *ep, hwaddr *loadaddr,
int *is_linux, uint8_t image_type,
uint64_t (*translate_fn)(void *, uint64_t),
void *translate_opaque)
{
int fd;
int size;
hwaddr address... | 26,267 |
qemu | 0ae18ceeaaa2c1749e742c4b112f6c3bf0896408 | 0 | static void stellaris_init(const char *kernel_filename, const char *cpu_model,
DisplayState *ds, stellaris_board_info *board)
{
static const int uart_irq[] = {5, 6, 33, 34};
static const int timer_irq[] = {19, 21, 23, 35};
static const uint32_t gpio_addr[7] =
{ 0x40004... | 26,268 |
qemu | e3f5ec2b5e92706e3b807059f79b1fb5d936e567 | 0 | static int pcnet_can_receive(void *opaque)
{
PCNetState *s = opaque;
if (CSR_STOP(s) || CSR_SPND(s))
return 0;
if (s->recv_pos > 0)
return 0;
return sizeof(s->buffer)-16;
}
| 26,269 |
qemu | 0e7106d8b5f7ef4f9df10baf1dfb3db482bcd046 | 0 | static int write_object(int fd, char *buf, uint64_t oid, int copies,
unsigned int datalen, uint64_t offset, bool create,
bool cache)
{
return read_write_object(fd, buf, oid, copies, datalen, offset, true,
create, cache);
}
| 26,270 |
qemu | a8170e5e97ad17ca169c64ba87ae2f53850dab4c | 0 | static uint32_t cuda_readw (void *opaque, target_phys_addr_t addr)
{
return 0;
}
| 26,271 |
qemu | 4a1418e07bdcfaa3177739e04707ecaec75d89e1 | 0 | void helper_iret_protected(int shift, int next_eip)
{
int tss_selector, type;
uint32_t e1, e2;
/* specific case for TSS */
if (env->eflags & NT_MASK) {
#ifdef TARGET_X86_64
if (env->hflags & HF_LMA_MASK)
raise_exception_err(EXCP0D_GPF, 0);
#endif
tss_selector = ld... | 26,272 |
FFmpeg | 6260ab60a80fd8baebf79f9ce9299b0db72333b5 | 0 | static void blend_image_rgba(AVFilterContext *ctx, AVFrame *dst, const AVFrame *src, int x, int y)
{
blend_image_packed_rgb(ctx, dst, src, 1, x, y, 0);
}
| 26,273 |
qemu | a8170e5e97ad17ca169c64ba87ae2f53850dab4c | 0 | static void bonito_spciconf_writeb(void *opaque, target_phys_addr_t addr,
uint32_t val)
{
PCIBonitoState *s = opaque;
PCIDevice *d = PCI_DEVICE(s);
PCIHostState *phb = PCI_HOST_BRIDGE(s->pcihost);
uint32_t pciaddr;
uint16_t status;
DPRINTF("bonito_spc... | 26,274 |
qemu | b0f49d138777fb6609aa2ea96d2c59fb872d2c2d | 0 | pvscsi_command_complete(SCSIRequest *req, uint32_t status, size_t resid)
{
PVSCSIRequest *pvscsi_req = req->hba_private;
PVSCSIState *s = pvscsi_req->dev;
if (!pvscsi_req) {
trace_pvscsi_command_complete_not_found(req->tag);
return;
}
if (resid) {
/* Short transf... | 26,276 |
qemu | 494a8ebe713055d3946183f4b395f85a18b43e9e | 0 | static int proxy_open(FsContext *ctx, V9fsPath *fs_path,
int flags, V9fsFidOpenState *fs)
{
fs->fd = v9fs_request(ctx->private, T_OPEN, NULL, "sd", fs_path, flags);
if (fs->fd < 0) {
errno = -fs->fd;
fs->fd = -1;
}
return fs->fd;
}
| 26,277 |
qemu | 0ae18ceeaaa2c1749e742c4b112f6c3bf0896408 | 0 | void mips_r4k_init (ram_addr_t ram_size, int vga_ram_size,
const char *boot_device, DisplayState *ds,
const char *kernel_filename, const char *kernel_cmdline,
const char *initrd_filename, const char *cpu_model)
{
char buf[1024];
unsigned long bio... | 26,278 |
qemu | f1c52354e5bdab6983d13a4c174759c585e834b3 | 0 | static bool spapr_drc_needed(void *opaque)
{
sPAPRDRConnector *drc = (sPAPRDRConnector *)opaque;
sPAPRDRConnectorClass *drck = SPAPR_DR_CONNECTOR_GET_CLASS(drc);
bool rc = false;
sPAPRDREntitySense value = drck->dr_entity_sense(drc);
/* If no dev is plugged in there is no need to migrate the... | 26,279 |
FFmpeg | 9bcbb250e23959075765edd3cb4c1fcb46736d7d | 0 | static inline void RENAME(yuv2yuv1)(SwsContext *c, const int16_t *lumSrc,
const int16_t *chrUSrc, const int16_t *chrVSrc,
const int16_t *alpSrc,
uint8_t *dest, uint8_t *uDest, uint8_t *vDest,
... | 26,280 |
FFmpeg | d1adad3cca407f493c3637e20ecd4f7124e69212 | 0 | static inline void RENAME(rgb15to16)(const uint8_t *src, uint8_t *dst, long src_size)
{
register const uint8_t* s=src;
register uint8_t* d=dst;
register const uint8_t *end;
const uint8_t *mm_end;
end = s + src_size;
#if COMPILE_TEMPLATE_MMX
__asm__ volatile(PREFETCH" %0"::"m"(*s));
... | 26,281 |
qemu | 4482e05cbbb7e50e476f6a9500cf0b38913bd939 | 1 | PowerPCCPU *ppc4xx_init(const char *cpu_model,
clk_setup_t *cpu_clk, clk_setup_t *tb_clk,
uint32_t sysclk)
{
PowerPCCPU *cpu;
CPUPPCState *env;
/* init CPUs */
cpu = POWERPC_CPU(cpu_generic_init(TYPE_POWERPC_CPU, cpu_model));
if (cpu == NULL)... | 26,282 |
FFmpeg | 9bbf1a5c232cffb64e5f8cf071d1626cc0d033e1 | 1 | void ff_vdpau_mpeg_picture_complete(MpegEncContext *s, const uint8_t *buf,
int buf_size, int slice_count)
{
struct vdpau_render_state *render, *last, *next;
int i;
render = (struct vdpau_render_state *)s->current_picture_ptr->data[0];
assert(render);
/* fill VdpPi... | 26,283 |
FFmpeg | bc9eb0467a52828d6be48de5e60f042bf3b62d1f | 1 | static int open_input_stream(HTTPContext *c, const char *info)
{
char buf[128];
char input_filename[1024];
AVFormatContext *s = NULL;
int buf_size, i, ret;
int64_t stream_pos;
/* find file name */
if (c->stream->feed) {
strcpy(input_filename, c->stream->feed->feed_filename... | 26,284 |
qemu | b46578555c4bce64e3daba4591334aba2d12c156 | 1 | static int close_f(int argc, char **argv)
{
bdrv_close(bs);
bs = NULL;
return 0;
}
| 26,285 |
qemu | 3a3567d337d3ee6fb2e2fcc1d27cd045ed97ae9b | 1 | static void pty_chr_state(CharDriverState *chr, int connected)
{
PtyCharDriver *s = chr->opaque;
if (!connected) {
if (s->fd_tag) {
io_remove_watch_poll(s->fd_tag);
s->fd_tag = 0;
}
s->connected = 0;
/* (re-)connect poll interval for idle guests... | 26,286 |
qemu | 4a94fc9bf2dac5965acb8e264d55a356737a2aa6 | 1 | static void zynq_xadc_write(void *opaque, hwaddr offset, uint64_t val,
unsigned size)
{
ZynqXADCState *s = (ZynqXADCState *)opaque;
int reg = offset / 4;
int xadc_reg;
int xadc_cmd;
int xadc_data;
if (!zynq_xadc_check_offset(reg, false)) {
qemu_log_... | 26,287 |
qemu | d9bce9d99f4656ae0b0127f7472db9067b8f84ab | 1 | static inline void gen_set_Rc0 (DisasContext *ctx)
{
gen_op_cmpi(0);
gen_op_set_Rc0();
}
| 26,288 |
qemu | a01672d3968cf91208666d371784110bfde9d4f8 | 1 | static int kvm_log_start(CPUPhysMemoryClient *client,
target_phys_addr_t phys_addr, ram_addr_t size)
{
return kvm_dirty_pages_log_change(phys_addr, size, true);
}
| 26,289 |
qemu | fa617181839741727d0067ea68807133f498f29b | 1 | static int megasas_scsi_init(PCIDevice *dev)
{
DeviceState *d = DEVICE(dev);
MegasasState *s = MEGASAS(dev);
MegasasBaseClass *b = MEGASAS_DEVICE_GET_CLASS(s);
uint8_t *pci_conf;
int i, bar_type;
Error *err = NULL;
pci_conf = dev->config;
/* PCI latency timer = 0 */
pci... | 26,290 |
qemu | 98f28ad7a7d26e5e77c5cb37b262d76d6ccd963d | 1 | VirtIODevice *virtio_blk_init(DeviceState *dev, BlockConf *conf)
{
VirtIOBlock *s;
int cylinders, heads, secs;
static int virtio_blk_id;
DriveInfo *dinfo;
if (!conf->bs) {
error_report("virtio-blk-pci: drive property not set");
s = (VirtIOBlock *)virtio_common_init("vir... | 26,292 |
qemu | 5839e53bbc0fec56021d758aab7610df421ed8c8 | 1 | int qcow2_snapshot_list(BlockDriverState *bs, QEMUSnapshotInfo **psn_tab)
{
BDRVQcowState *s = bs->opaque;
QEMUSnapshotInfo *sn_tab, *sn_info;
QCowSnapshot *sn;
int i;
if (!s->nb_snapshots) {
*psn_tab = NULL;
return s->nb_snapshots;
}
sn_tab = g_malloc0(s->nb_sn... | 26,293 |
FFmpeg | c23acbaed40101c677dfcfbbfe0d2c230a8e8f44 | 1 | static void vc1_inv_trans_4x8_c(uint8_t *dest, int linesize, DCTELEM *block)
{
int i;
register int t1,t2,t3,t4,t5,t6,t7,t8;
DCTELEM *src, *dst;
const uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;
src = block;
dst = block;
for(i = 0; i < 8; i++){
t1 = 17 * (src[0] + src[2]) + 4;... | 26,295 |
qemu | 367790cce8e14131426f5190dfd7d1bdbf656e4d | 1 | DISAS_INSN(shift_reg)
{
TCGv reg;
TCGv shift;
reg = DREG(insn, 0);
shift = DREG(insn, 9);
if (insn & 0x100) {
gen_helper_shl_cc(reg, cpu_env, reg, shift);
} else {
if (insn & 8) {
gen_helper_shr_cc(reg, cpu_env, reg, shift);
} else {
... | 26,297 |
FFmpeg | 9ccc6cecd2d0645f5073382360509eb278b239b1 | 1 | static av_cold int decode_init(WMAProDecodeCtx *s, AVCodecContext *avctx)
{
uint8_t *edata_ptr = avctx->extradata;
unsigned int channel_mask;
int i, bits;
int log2_max_num_subframes;
int num_possible_block_sizes;
if (avctx->codec_id == AV_CODEC_ID_XMA1 || avctx->codec_id == AV_CODEC_ID_... | 26,298 |
qemu | b4ba67d9a702507793c2724e56f98e9b0f7be02b | 1 | static uint16_t qvirtio_pci_get_queue_size(QVirtioDevice *d)
{
QVirtioPCIDevice *dev = (QVirtioPCIDevice *)d;
return qpci_io_readw(dev->pdev, dev->addr + VIRTIO_PCI_QUEUE_NUM);
}
| 26,299 |
qemu | 92196b2f5664d5defa778b1b24df56e2239b5e93 | 1 | int bdrv_pwrite_sync(BlockDriverState *bs, int64_t offset,
const void *buf, int count)
{
int ret;
ret = bdrv_pwrite(bs, offset, buf, count);
if (ret < 0) {
return ret;
}
/* No flush needed for cache=writethrough, it uses O_DSYNC */
if ((bs->open_flags & BDRV_O_CACHE_MASK... | 26,301 |
FFmpeg | b8b8e82ea14016b2cb04b49ecea57f836e6ee7f8 | 1 | static void dnxhd_decode_dct_block_8(const DNXHDContext *ctx,
RowContext *row, int n)
{
dnxhd_decode_dct_block(ctx, row, n, 4, 32, 6);
}
| 26,302 |
FFmpeg | 386601286fed2dff5e1955bc21a0256f6f35ab19 | 1 | int ff_h264_decode_slice_header(H264Context *h, H264SliceContext *sl)
{
unsigned int first_mb_in_slice;
unsigned int pps_id;
int ret;
unsigned int slice_type, tmp, i, j;
int last_pic_structure, last_pic_droppable;
int must_reinit;
int needs_reinit = 0;
int field_pic_flag, bottom... | 26,303 |
FFmpeg | c6831e2a70f734c71f483d69d46d0635963530c7 | 1 | static int wv_get_value(WavpackFrameContext *ctx, GetBitContext *gb,
int channel, int *last)
{
int t, t2;
int sign, base, add, ret;
WvChannel *c = &ctx->ch[channel];
*last = 0;
if ((ctx->ch[0].median[0] < 2U) && (ctx->ch[1].median[0] < 2U) &&
!ctx->zero &&... | 26,304 |
qemu | 187337f8b0ec0813dd3876d1efe37d415fb81c2e | 1 | static pxa2xx_timer_info *pxa2xx_timer_init(target_phys_addr_t base,
qemu_irq *irqs)
{
int i;
int iomemtype;
pxa2xx_timer_info *s;
s = (pxa2xx_timer_info *) qemu_mallocz(sizeof(pxa2xx_timer_info));
s->base = base;
s->irq_enabled = 0;
s->oldclock = 0;
s->clock ... | 26,305 |
FFmpeg | ec3b22326dc07fb8300a577bd6b17c19a0f1bcf7 | 1 | static void http_write_packet(void *opaque,
unsigned char *buf, int size)
{
HTTPContext *c = opaque;
if (c->buffer_ptr == c->buffer_end || !c->buffer_ptr)
c->buffer_ptr = c->buffer_end = c->buffer;
if (c->buffer_end - c->buffer + size > IOBUFFER_MAX_SIZE)
... | 26,307 |
qemu | df8bf7a7fe75eb5d5caffa55f5cd4292b757aea6 | 1 | void net_rx_pkt_attach_iovec_ex(struct NetRxPkt *pkt,
const struct iovec *iov, int iovcnt,
size_t iovoff, bool strip_vlan,
uint16_t vet)
{
uint16_t tci = 0;
uint16_t ploff = iovoff;
assert(pkt);
pkt->... | 26,308 |
FFmpeg | 131644677970a3c4a0096270ea2a5b5d437c2e63 | 1 | static int http_read_stream(URLContext *h, uint8_t *buf, int size)
{
HTTPContext *s = h->priv_data;
int err, new_location;
if (!s->hd)
return AVERROR_EOF;
if (s->end_chunked_post && !s->end_header) {
err = http_read_header(h, &new_location);
if (err < 0)
... | 26,309 |
FFmpeg | ed3c9b5b0dd5abb545c48e930e1c32c187b0776a | 1 | static int lag_read_prob_header(lag_rac *rac, GetBitContext *gb)
{
int i, j, scale_factor;
unsigned prob, cumulative_target;
unsigned cumul_prob = 0;
unsigned scaled_cumul_prob = 0;
rac->prob[0] = 0;
rac->prob[257] = UINT_MAX;
/* Read probabilities from bitstream */
for (i = 1... | 26,310 |
qemu | d83c951cce14dd3c7600c386d3791c4993744622 | 1 | static int ata_passthrough_12_xfer_size(SCSIDevice *dev, uint8_t *buf)
{
int length = buf[2] & 0x3;
int xfer;
int unit = ata_passthrough_xfer_unit(dev, buf);
switch (length) {
case 0:
case 3: /* USB-specific. */
xfer = 0;
break;
case 1:
xfer = buf[3];
... | 26,311 |
FFmpeg | 0058584580b87feb47898e60e4b80c7f425882ad | 0 | static inline void downmix_2f_2r_to_stereo(float *samples)
{
int i;
for (i = 0; i < 256; i++) {
samples[i] += samples[i + 512];
samples[i + 256] = samples[i + 768];
samples[i + 512] = samples[i + 768] = 0;
}
}
| 26,312 |
FFmpeg | c04c3282b4334ff64cfd69d40fea010602e830fd | 0 | static int video_read_header(AVFormatContext *s,
AVFormatParameters *ap)
{
AVStream *st;
st = av_new_stream(s, 0);
if (!st)
return AVERROR_NOMEM;
st->codec->codec_type = CODEC_TYPE_VIDEO;
st->codec->codec_id = s->iformat->value;
st->need_parsing ... | 26,313 |
FFmpeg | e278056fbad7405fc47901faea7de98db003a0fa | 0 | static int vp3_decode_frame(AVCodecContext *avctx,
void *data, int *data_size,
uint8_t *buf, int buf_size)
{
Vp3DecodeContext *s = avctx->priv_data;
GetBitContext gb;
static int counter = 0;
int i;
init_get_bits(&gb, buf, buf_size * 8... | 26,314 |
qemu | 2466119c9551d606a0f92f9832e0c865bc04b488 | 1 | static inline int host_to_target_errno(int err)
{
if(host_to_target_errno_table[err])
return host_to_target_errno_table[err];
return err;
}
| 26,316 |
qemu | e8a40bf71d606f9f87866fb2461eaed52814b38e | 1 | void backup_start(const char *job_id, BlockDriverState *bs,
BlockDriverState *target, int64_t speed,
MirrorSyncMode sync_mode, BdrvDirtyBitmap *sync_bitmap,
bool compress,
BlockdevOnError on_source_error,
BlockdevOnError on_t... | 26,317 |
qemu | 0b8b8753e4d94901627b3e86431230f2319215c4 | 1 | static void restart_co_req(void *opaque)
{
Coroutine *co = opaque;
qemu_coroutine_enter(co, NULL);
}
| 26,318 |
qemu | 6bdcc018a6ed760b9dfe43539124e420aed83092 | 1 | static void nbd_coroutine_start(NBDClientSession *s,
NBDRequest *request)
{
/* Poor man semaphore. The free_sema is locked when no other request
* can be accepted, and unlocked after receiving one reply. */
if (s->in_flight == MAX_NBD_REQUESTS) {
qemu_co_queu... | 26,319 |
FFmpeg | c39059bea3adebcd888571d1181db215eee54495 | 0 | void ff_h264_direct_dist_scale_factor(H264Context *const h)
{
const int poc = h->cur_pic_ptr->field_poc[h->picture_structure == PICT_BOTTOM_FIELD];
const int poc1 = h->ref_list[1][0].poc;
int i, field;
if (FRAME_MBAFF(h))
for (field = 0; field < 2; field++) {
const int poc ... | 26,322 |
qemu | 456736710df19c2275192269fe67a3f0b2583835 | 1 | static int bdrv_open_common(BlockDriverState *bs, BlockDriverState *file,
QDict *options, int flags, BlockDriver *drv)
{
int ret, open_flags;
const char *filename;
assert(drv != NULL);
assert(bs->file == NULL);
assert(options != NULL && bs->options != options);
trace_bdrv_open_co... | 26,323 |
qemu | b35278f75450e57c134a153e6da9744c1db8382f | 1 | static int qcow2_open(BlockDriverState *bs, int flags)
{
BDRVQcowState *s = bs->opaque;
int len, i, ret = 0;
QCowHeader header;
uint64_t ext_end;
ret = bdrv_pread(bs->file, 0, &header, sizeof(header));
if (ret < 0) {
goto fail;
}
be32_to_cpus(&header.magic);
be32... | 26,324 |
FFmpeg | f58cd2867a8af2eed13acdd21d067b48249b14a1 | 1 | static int read_packet(AVFormatContext *s, AVPacket *pkt)
{
PAFDemuxContext *p = s->priv_data;
AVIOContext *pb = s->pb;
uint32_t count, offset;
int size, i;
if (p->current_frame >= p->nb_frames)
return AVERROR_EOF;
if (url_feof(pb))
return AVER... | 26,325 |
qemu | 962b289ef35087fcd8764e4e29808d8ac90157f7 | 1 | char *target_strerror(int err)
{
return strerror(target_to_host_errno(err));
| 26,326 |
FFmpeg | ce41c51b0c71c87f623914ba0786aef325d818fe | 1 | AVFormatContext *ff_rtp_chain_mux_open(AVFormatContext *s, AVStream *st,
URLContext *handle, int packet_size)
{
AVFormatContext *rtpctx;
int ret;
AVOutputFormat *rtp_format = av_guess_format("rtp", NULL, NULL);
if (!rtp_format)
return NULL;
... | 26,327 |
qemu | f61d82c2dfe02a60642a76e8f0034a0244eef2bf | 1 | static int pci_cirrus_vga_initfn(PCIDevice *dev)
{
PCICirrusVGAState *d = DO_UPCAST(PCICirrusVGAState, dev, dev);
CirrusVGAState *s = &d->cirrus_vga;
PCIDeviceClass *pc = PCI_DEVICE_GET_CLASS(dev);
int16_t device_id = pc->device_id;
/* setup VGA */
vga_common_init(&s->vga,... | 26,328 |
FFmpeg | a443a2530d00b7019269202ac0f5ca8ba0a021c7 | 1 | static void rm_read_audio_stream_info(AVFormatContext *s, AVStream *st,
int read_all)
{
RMContext *rm = s->priv_data;
ByteIOContext *pb = &s->pb;
char buf[256];
uint32_t version;
int i;
/* ra type header */
version = get_be32(pb); /* version */
if ((... | 26,329 |
FFmpeg | aba232cfa9b193604ed98f3fa505378d006b1b3b | 1 | static int vc1test_write_header(AVFormatContext *s)
{
AVCodecContext *avc = s->streams[0]->codec;
AVIOContext *pb = s->pb;
if (avc->codec_id != CODEC_ID_WMV3) {
av_log(s, AV_LOG_ERROR, "Only WMV3 is accepted!\n");
return -1;
}
avio_wl24(pb, 0); //frames count will be here
... | 26,332 |
FFmpeg | c0b91348fe4aec7d2245d95ccabb460a6971e361 | 1 | static int caca_write_trailer(AVFormatContext *s)
{
CACAContext *c = s->priv_data;
av_freep(&c->window_title);
caca_free_dither(c->dither);
caca_free_display(c->display);
caca_free_canvas(c->canvas);
return 0;
}
| 26,334 |
qemu | 02b33596d09bafed5d58366403a2d369f0d1047e | 1 | static void dec_null(DisasContext *dc)
{
qemu_log ("unknown insn pc=%x opc=%x\n", dc->pc, dc->opcode);
dc->abort_at_next_insn = 1;
| 26,335 |
FFmpeg | e2710e790c09e49e86baa58c6063af0097cc8cb0 | 1 | int av_parse_cpu_flags(const char *s)
{
#define CPUFLAG_MMXEXT (AV_CPU_FLAG_MMX | AV_CPU_FLAG_MMXEXT | AV_CPU_FLAG_CMOV)
#define CPUFLAG_3DNOW (AV_CPU_FLAG_3DNOW | AV_CPU_FLAG_MMX)
#define CPUFLAG_3DNOWEXT (AV_CPU_FLAG_3DNOWEXT | CPUFLAG_3DNOW)
#define CPUFLAG_SSE (AV_CPU_FLAG_SSE | CPUFLAG_... | 26,336 |
FFmpeg | 915bbac6815eddd911fb5cb8a23517b3cac3a84b | 1 | void mpeg1_init_vlc(MpegEncContext *s)
{
static int done = 0;
if (!done) {
init_vlc(&dc_lum_vlc, 9, 12,
vlc_dc_lum_bits, 1, 1,
vlc_dc_lum_code, 2, 2);
init_vlc(&dc_chroma_vlc, 9, 12,
vlc_dc_chroma_bits, 1, 1,
vlc... | 26,337 |
FFmpeg | 50833c9f7b4e1922197a8955669f8ab3589c8cef | 1 | static int encode_bitstream(FlashSVContext *s, const AVFrame *p, uint8_t *buf,
int buf_size, int block_width, int block_height,
uint8_t *previous_frame, int *I_frame)
{
PutBitContext pb;
int h_blocks, v_blocks, h_part, v_part, i, j;
int buf_pos... | 26,338 |
qemu | 3453f9a0dfa58578e6dadf0905ff4528b428ec73 | 1 | static void usb_uas_task(UASDevice *uas, uas_ui *ui)
{
uint16_t tag = be16_to_cpu(ui->hdr.tag);
uint64_t lun64 = be64_to_cpu(ui->task.lun);
SCSIDevice *dev = usb_uas_get_dev(uas, lun64);
int lun = usb_uas_get_lun(lun64);
UASRequest *req;
uint16_t task_tag;
req = usb_uas_find_req... | 26,339 |
qemu | 66dc50f7057b9a0191f54e55764412202306858d | 1 | static int sch_handle_start_func_passthrough(SubchDev *sch)
{
PMCW *p = &sch->curr_status.pmcw;
SCSW *s = &sch->curr_status.scsw;
int ret;
ORB *orb = &sch->orb;
if (!(s->ctrl & SCSW_ACTL_SUSP)) {
assert(orb != NULL);
p->intparm = orb->intparm;
}
/*
* Onl... | 26,340 |
qemu | 1d06cb7ab93f879ac25c9f5ef1d1ac8d97a42dfc | 1 | static int cmd_valid_while_locked(SDState *sd, SDRequest *req)
{
/* Valid commands in locked state:
* basic class (0)
* lock card class (7)
* CMD16
* implicitly, the ACMD prefix CMD55
* ACMD41 and ACMD42
* Anything else provokes an "illegal command" response.
*/
if (... | 26,341 |
FFmpeg | 32c3047cac9294bb56d23c89a40a22409db5cc70 | 0 | static int smc_decode_init(AVCodecContext *avctx)
{
SmcContext *s = avctx->priv_data;
s->avctx = avctx;
avctx->pix_fmt = PIX_FMT_PAL8;
dsputil_init(&s->dsp, avctx);
s->frame.data[0] = NULL;
return 0;
}
| 26,342 |
FFmpeg | 403ee835e7913eb9536b22c2b22edfdd700166a9 | 0 | int ff_mov_add_hinted_packet(AVFormatContext *s, AVPacket *pkt,
int track_index, int sample)
{
MOVMuxContext *mov = s->priv_data;
MOVTrack *trk = &mov->tracks[track_index];
AVFormatContext *rtp_ctx = trk->rtp_ctx;
uint8_t *buf = NULL;
int size;
AVIOContext *h... | 26,343 |
FFmpeg | a4d3cf10b2ece441ae25849a66b1c11d838f9381 | 0 | static void decode_lowdelay(DiracContext *s)
{
AVCodecContext *avctx = s->avctx;
int slice_x, slice_y, bytes, bufsize;
const uint8_t *buf;
struct lowdelay_slice *slices;
int slice_num = 0;
slices = av_mallocz_array(s->lowdelay.num_x, s->lowdelay.num_y * sizeof(struct lowdelay_slice));
... | 26,344 |
FFmpeg | b7e7ee6231bc1f3608ed4005c3e7550ec4815296 | 1 | static void copy_video_props(AVFilterBufferRefVideoProps *dst, AVFilterBufferRefVideoProps *src) {
*dst = *src;
if (src->qp_table) {
int qsize = src->qp_table_size;
dst->qp_table = av_malloc(qsize);
memcpy(dst->qp_table, src->qp_table, qsize);
}
}
| 26,345 |
qemu | 111049a4ecefc9cf1ac75c773f4c5c165f27fe63 | 1 | void qmp_blockdev_backup(BlockdevBackup *arg, Error **errp)
{
do_blockdev_backup(arg, NULL, errp);
}
| 26,347 |
FFmpeg | 3c6607eb6f946ed3e108db3f0694cab7e5a5df7e | 1 | int attribute_align_arg avcodec_encode_audio2(AVCodecContext *avctx,
AVPacket *avpkt,
const AVFrame *frame,
int *got_packet_ptr)
{
int ret;
int user_packet = !!avpkt->d... | 26,348 |
qemu | 70fbd3c4bf9850fce733eea2c910c397905fb9a3 | 1 | static void fsl_imx6_class_init(ObjectClass *oc, void *data)
{
DeviceClass *dc = DEVICE_CLASS(oc);
dc->realize = fsl_imx6_realize;
dc->desc = "i.MX6 SOC";
}
| 26,349 |
qemu | 2ad645d2854746b55ddfd1d8e951f689cca5d78f | 1 | static void test_endianness_split(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 " : "",
tes... | 26,350 |
qemu | 47d4be12c3997343e436c6cca89aefbbbeb70863 | 1 | static void test_qemu_strtoull_whitespace(void)
{
const char *str = " \t ";
char f = 'X';
const char *endptr = &f;
uint64_t res = 999;
int err;
err = qemu_strtoull(str, &endptr, 0, &res);
g_assert_cmpint(err, ==, 0);
g_assert_cmpint(res, ==, 0);
g_assert(endptr == str... | 26,351 |
FFmpeg | 3c1199c3c4cbdb4ffff0de89f06d5a08acefe356 | 1 | static int matroska_parse_frame(MatroskaDemuxContext *matroska,
MatroskaTrack *track, AVStream *st,
uint8_t *data, int pkt_size,
uint64_t timecode, uint64_t duration,
int64_t pos, int is_k... | 26,352 |
FFmpeg | 0ecca7a49f8e254c12a3a1de048d738bfbb614c6 | 1 | void *av_fast_realloc(void *ptr, unsigned int *size, unsigned int min_size)
{
if(min_size < *size)
return ptr;
*size= 17*min_size/16 + 32;
return av_realloc(ptr, *size);
}
| 26,353 |
FFmpeg | 26c208cf0ff59efd7786528884a64d35fc42e9bf | 0 | static int get_video_frame(VideoState *is, AVFrame *frame, int64_t *pts, AVPacket *pkt, int *serial)
{
int got_picture;
if (packet_queue_get(&is->videoq, pkt, 1, serial) < 0)
return -1;
if (pkt->data == flush_pkt.data) {
avcodec_flush_buffers(is->video_st->codec);
SDL_Lo... | 26,354 |
qemu | 9a93b61730e3b46ef1c01ca522c6abe80ec13832 | 1 | static void msix_mmio_write(void *opaque, target_phys_addr_t addr,
uint64_t val, unsigned size)
{
PCIDevice *dev = opaque;
unsigned int offset = addr & (MSIX_PAGE_SIZE - 1) & ~0x3;
int vector = offset / PCI_MSIX_ENTRY_SIZE;
pci_set_long(dev->msix_table_page + offset, val);
... | 26,355 |
qemu | bdd81addf4033ce26e6cd180b060f63095f3ded9 | 1 | static void vfio_msix_enable(VFIOPCIDevice *vdev)
{
vfio_disable_interrupts(vdev);
vdev->msi_vectors = g_malloc0(vdev->msix->entries * sizeof(VFIOMSIVector));
vdev->interrupt = VFIO_INT_MSIX;
/*
* Some communication channels between VF & PF or PF & fw rely on the
* physical state ... | 26,356 |
qemu | cfd47a71df51047833d182e9e97244e7816b57da | 1 | static int check_bind(struct sockaddr *sa, socklen_t salen, bool *has_proto)
{
int fd;
fd = socket(sa->sa_family, SOCK_STREAM, 0);
if (fd < 0) {
return -1;
}
if (bind(fd, sa, salen) < 0) {
close(fd);
if (errno == EADDRNOTAVAIL) {
*has_proto = false;
... | 26,357 |
FFmpeg | b9fa32082c71013e90eab9e9997967d2939cf4a6 | 1 | int ff_fft_init(FFTContext *s, int nbits, int inverse)
{
int i, j, m, n;
float alpha, c1, s1, s2;
int shuffle = 0;
int av_unused has_vectors;
s->nbits = nbits;
n = 1 << nbits;
s->exptab = av_malloc((n / 2) * sizeof(FFTComplex));
if (!s->exptab)
goto fail;
s->re... | 26,358 |
FFmpeg | 45daae06fd6f05baddb897686a6fa90cda3abb49 | 0 | static void write_mainheader(NUTContext *nut, AVIOContext *bc)
{
int i, j, tmp_pts, tmp_flags, tmp_stream, tmp_mul, tmp_size, tmp_fields,
tmp_head_idx;
int64_t tmp_match;
ff_put_v(bc, nut->version);
if (nut->version > 3)
ff_put_v(bc, nut->minor_version);
ff_put_v(bc, nut->a... | 26,359 |
qemu | a1f7f97b950a46393b0e55a9a0082e70f540cbbd | 1 | static void mmubooke_create_initial_mapping(CPUPPCState *env,
target_ulong va,
hwaddr pa)
{
ppcemb_tlb_t *tlb = &env->tlb.tlbe[0];
tlb->attr = 0;
tlb->prot = PAGE_VALID | ((PAGE_READ | PAGE_WRITE | PAGE_EXEC) << 4);
tlb->... | 26,361 |
qemu | 187337f8b0ec0813dd3876d1efe37d415fb81c2e | 1 | struct pxa2xx_pcmcia_s *pxa2xx_pcmcia_init(target_phys_addr_t base)
{
int iomemtype;
struct pxa2xx_pcmcia_s *s;
s = (struct pxa2xx_pcmcia_s *)
qemu_mallocz(sizeof(struct pxa2xx_pcmcia_s));
/* Socket I/O Memory Space */
s->io_base = base | 0x00000000;
iomemtype = cpu_regis... | 26,362 |
FFmpeg | bac9c03ed9328c63aba46e280ba408431b53fcb4 | 1 | static int mov_text_decode_frame(AVCodecContext *avctx,
void *data, int *got_sub_ptr, AVPacket *avpkt)
{
AVSubtitle *sub = data;
MovTextContext *m = avctx->priv_data;
int ret;
AVBPrint buf;
char *ptr = avpkt->data;
char *end;
int text_length, tsmb_type, ret_tsmb;
... | 26,363 |
FFmpeg | 53c0c637d36c1de9ea461a8d863e8703da090894 | 1 | static int ra144_decode_frame(AVCodecContext * avctx, void *data,
int *got_frame_ptr, AVPacket *avpkt)
{
AVFrame *frame = data;
const uint8_t *buf = avpkt->data;
int buf_size = avpkt->size;
static const uint8_t sizes[LPC_ORDER] = {6, 5, 5, 4, 4, 3, 3, 3, 3, 2};
... | 26,364 |
qemu | 5dd7a535b71a0f2f8e7af75c5d694174359ce323 | 1 | static void iscsi_timed_set_events(void *opaque)
{
IscsiLun *iscsilun = opaque;
iscsi_set_events(iscsilun);
}
| 26,365 |
qemu | b307446e04232b3a87e9da04886895a8e5a4a407 | 1 | void mips_cpu_dump_state(CPUState *cs, FILE *f, fprintf_function cpu_fprintf,
int flags)
{
MIPSCPU *cpu = MIPS_CPU(cs);
CPUMIPSState *env = &cpu->env;
int i;
cpu_fprintf(f, "pc=0x" TARGET_FMT_lx " HI=0x" TARGET_FMT_lx
" LO=0x" TARGET_FMT_lx " ds %04x "
... | 26,366 |
qemu | 0d931d706266d6ada3bf22d3afca1afdc8d12fa9 | 1 | static gboolean serial_xmit(GIOChannel *chan, GIOCondition cond, void *opaque)
{
SerialState *s = opaque;
do {
if (s->tsr_retry <= 0) {
if (s->fcr & UART_FCR_FE) {
if (fifo8_is_empty(&s->xmit_fifo)) {
return FALSE;
}
... | 26,369 |
FFmpeg | 95b192de5d05f3e1542e7b2378cdefbc195f5185 | 0 | static int decode_sequence_header_adv(VC1Context *v, GetBitContext *gb)
{
v->res_rtm_flag = 1;
v->level = get_bits(gb, 3);
if (v->level >= 5) {
av_log(v->s.avctx, AV_LOG_ERROR, "Reserved LEVEL %i\n",v->level);
}
v->chromaformat = get_bits(gb, 2);
if (v->chromaformat != 1) {
... | 26,370 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.