project stringclasses 2
values | commit_id stringlengths 40 40 | target int64 0 1 | func stringlengths 26 142k | idx int64 0 27.3k |
|---|---|---|---|---|
FFmpeg | 05c36e0e5fbf0b75dbbbd327ad2f6a62992f9262 | 1 | static void formant_postfilter(G723_1_Context *p, int16_t *lpc, int16_t *buf)
{
int16_t filter_coef[2][LPC_ORDER], *buf_ptr;
int filter_signal[LPC_ORDER + FRAME_LEN], *signal_ptr;
int i, j, k;
memcpy(buf, p->fir_mem, LPC_ORDER * sizeof(*buf));
memcpy(filter_signal, p->iir_mem, LPC_ORDER * si... | 24,110 |
FFmpeg | 211ca69b13eb0a127a9ef7e70ddaccdab125d1c5 | 1 | int attribute_align_arg avresample_convert(AVAudioResampleContext *avr,
uint8_t **output, int out_plane_size,
int out_samples, uint8_t **input,
int in_plane_size, int in_samples)
{
A... | 24,111 |
FFmpeg | 568e18b15e2ddf494fd8926707d34ca08c8edce5 | 1 | static int ogg_read_header(AVFormatContext *avfcontext, AVFormatParameters *ap)
{
OggContext *context = avfcontext->priv_data;
ogg_packet op ;
char *buf ;
ogg_page og ;
AVStream *ast ;
AVCodecContext *codec;
uint8_t *p;
int i;
ogg_sync_init(&context->oy) ;
b... | 24,112 |
qemu | 27bfd83c336283d1f7a5345ee386c4cd7b80db61 | 1 | static inline int tcg_temp_new_internal(TCGType type, int temp_local)
{
TCGContext *s = &tcg_ctx;
TCGTemp *ts;
int idx, k;
k = type;
if (temp_local)
k += TCG_TYPE_COUNT;
idx = s->first_free_temp[k];
if (idx != -1) {
/* There is already an available temp with the
ri... | 24,113 |
FFmpeg | 6e913f212907048d7009cf2f15551781c69b9985 | 1 | static int vp56_size_changed(VP56Context *s)
{
AVCodecContext *avctx = s->avctx;
int stride = s->frames[VP56_FRAME_CURRENT]->linesize[0];
int i;
s->plane_width[0] = s->plane_width[3] = avctx->coded_width;
s->plane_width[1] = s->plane_width[2] = avctx->coded_width/2;
s->plane_height[0] = s->p... | 24,115 |
FFmpeg | b0b2faa70995caf710bf49c7c6eb6dc502a67672 | 1 | static void rtsp_cmd_teardown(HTTPContext *c, const char *url, RTSPHeader *h)
{
HTTPContext *rtp_c;
rtp_c = find_rtp_session_with_url(url, h->session_id);
if (!rtp_c) {
rtsp_reply_error(c, RTSP_STATUS_SESSION);
return;
}
/* abort the session */
close_connection(rtp_c... | 24,116 |
qemu | 2d528d45ecf5ee3c1a566a9f3d664464925ef830 | 1 | static CharDriverState *qemu_chr_open_win_path(const char *filename)
{
CharDriverState *chr;
WinCharState *s;
chr = qemu_chr_alloc();
s = g_malloc0(sizeof(WinCharState));
chr->opaque = s;
chr->chr_write = win_chr_write;
chr->chr_close = win_chr_close;
if (win_chr_init(chr, f... | 24,118 |
FFmpeg | 8cc72ce5a0d8ab6bc88d28cf55cd62674240121d | 1 | static av_cold int twin_decode_init(AVCodecContext *avctx)
{
int ret;
TwinContext *tctx = avctx->priv_data;
int isampf, ibps;
tctx->avctx = avctx;
avctx->sample_fmt = AV_SAMPLE_FMT_FLTP;
if (!avctx->extradata || avctx->extradata_size < 12) {
av_log(avctx, AV_LOG_ERROR, ... | 24,119 |
FFmpeg | bdddcb7b030d075dffa2989222d687106c06d50c | 1 | static int mov_read_sidx(MOVContext *c, AVIOContext *pb, MOVAtom atom)
{
int64_t offset = avio_tell(pb) + atom.size, pts, timestamp;
uint8_t version;
unsigned i, j, track_id, item_count;
AVStream *st = NULL;
AVStream *ref_st = NULL;
MOVStreamContext *sc, *ref_sc = NULL;
AVRational ti... | 24,120 |
qemu | 4482e05cbbb7e50e476f6a9500cf0b38913bd939 | 1 | static void shix_init(MachineState *machine)
{
const char *cpu_model = machine->cpu_model;
int ret;
SuperHCPU *cpu;
struct SH7750State *s;
MemoryRegion *sysmem = get_system_memory();
MemoryRegion *rom = g_new(MemoryRegion, 1);
MemoryRegion *sdram = g_new(MemoryRegion, 2);
... | 24,121 |
qemu | d9bce9d99f4656ae0b0127f7472db9067b8f84ab | 1 | static inline void gen_addr_imm_index (DisasContext *ctx)
{
target_long simm = SIMM(ctx->opcode);
if (rA(ctx->opcode) == 0) {
gen_op_set_T0(simm);
} else {
gen_op_load_gpr_T0(rA(ctx->opcode));
if (likely(simm != 0))
gen_op_addi(simm);
}
}
| 24,122 |
qemu | f3a06403b82c7f036564e4caf18b52ce6885fcfb | 1 | void qmp_guest_suspend_ram(Error **errp)
{
Error *local_err = NULL;
GuestSuspendMode *mode = g_malloc(sizeof(GuestSuspendMode));
*mode = GUEST_SUSPEND_MODE_RAM;
check_suspend_mode(*mode, &local_err);
acquire_privilege(SE_SHUTDOWN_NAME, &local_err);
execute_async(do_suspend, mode, &local... | 24,124 |
FFmpeg | 933aa91e31d5cbf9dbc0cf416a988e6011bc4a40 | 1 | void ff_hevc_cabac_init(HEVCContext *s, int ctb_addr_ts)
{
if (ctb_addr_ts == s->ps.pps->ctb_addr_rs_to_ts[s->sh.slice_ctb_addr_rs]) {
cabac_init_decoder(s);
if (s->sh.dependent_slice_segment_flag == 0 ||
(s->ps.pps->tiles_enabled_flag &&
s->ps.pps->tile_id[ctb_addr_ts... | 24,125 |
qemu | b946a1533209f61a93e34898aebb5b43154b99c3 | 1 | void lance_init(NICInfo *nd, target_phys_addr_t leaddr, void *dma_opaque,
qemu_irq irq, qemu_irq *reset)
{
PCNetState *d;
int lance_io_memory;
qemu_check_nic_model(nd, "lance");
d = qemu_mallocz(sizeof(PCNetState));
lance_io_memory =
cpu_register_io_memory(0, la... | 24,126 |
qemu | 7372c2b926200db295412efbb53f93773b7f1754 | 1 | static inline TCGv gen_load(DisasContext * s, int opsize, TCGv addr, int sign)
{
TCGv tmp;
int index = IS_USER(s);
s->is_mem = 1;
tmp = tcg_temp_new_i32();
switch(opsize) {
case OS_BYTE:
if (sign)
tcg_gen_qemu_ld8s(tmp, addr, index);
else
tcg_ge... | 24,127 |
FFmpeg | f13e733145132e39056027229ff954a798f58410 | 1 | int ff_snow_frame_start(SnowContext *s){
AVFrame tmp;
int i, ret;
int w= s->avctx->width; //FIXME round up to x16 ?
int h= s->avctx->height;
if (s->current_picture.data[0] && !(s->avctx->flags&CODEC_FLAG_EMU_EDGE)) {
s->dsp.draw_edges(s->current_picture.data[0],
... | 24,128 |
FFmpeg | 09096fb68713089a8f97c8fa24e9d7f3bb9231d5 | 1 | static int h264_slice_header_parse(const H264Context *h, H264SliceContext *sl,
const H2645NAL *nal)
{
const SPS *sps;
const PPS *pps;
int ret;
unsigned int slice_type, tmp, i;
int field_pic_flag, bottom_field_flag;
int first_slice = sl == h->slice_ctx &... | 24,129 |
FFmpeg | 009f829dde811af654af7110326aea3a72c05d5e | 1 | static inline void RENAME(yuv2rgb565_2)(SwsContext *c, const uint16_t *buf0,
const uint16_t *buf1, const uint16_t *ubuf0,
const uint16_t *ubuf1, const uint16_t *vbuf0,
const uint16_t *vbuf1, const ... | 24,130 |
qemu | 2034e324dabc55064553aaa07de1536ebf8ea497 | 1 | static int virtio_scsi_parse_req(VirtIOSCSIReq *req,
unsigned req_size, unsigned resp_size)
{
VirtIODevice *vdev = (VirtIODevice *) req->dev;
size_t in_size, out_size;
if (iov_to_buf(req->elem.out_sg, req->elem.out_num, 0,
&req->req, req_size) < re... | 24,131 |
FFmpeg | da048c6d24729d3bab6ccb0ac340ea129e3e88d5 | 1 | static int mov_write_moov_tag(AVIOContext *pb, MOVMuxContext *mov,
AVFormatContext *s)
{
int i;
int64_t pos = avio_tell(pb);
avio_wb32(pb, 0); /* size placeholder*/
ffio_wfourcc(pb, "moov");
for (i = 0; i < mov->nb_streams; i++) {
if (mov->tracks[i].en... | 24,132 |
qemu | 52c050236eaa4f0b5e1d160cd66dc18106445c4d | 1 | static void virtio_blk_handle_read(VirtIOBlockReq *req)
{
BlockDriverAIOCB *acb;
uint64_t sector;
sector = ldq_p(&req->out->sector);
if (sector & req->dev->sector_mask) {
acb = bdrv_aio_readv(req->dev->bs, sector, &req->qiov,
req->qiov.size / BDRV_SECTOR_... | 24,133 |
FFmpeg | f78cd0c243b9149c7f604ecf1006d78e344aa6ca | 1 | void FUNC(ff_simple_idct_put)(uint8_t *dest_, int line_size, DCTELEM *block)
{
pixel *dest = (pixel *)dest_;
int i;
line_size /= sizeof(pixel);
for (i = 0; i < 8; i++)
FUNC(idctRowCondDC)(block + i*8);
for (i = 0; i < 8; i++)
FUNC(idctSparseColPut)(dest + i, line_size, ... | 24,134 |
FFmpeg | 01ecb7172b684f1c4b3e748f95c5a9a494ca36ec | 1 | static void quantize_and_encode_band_cost_UPAIR7_mips(struct AACEncContext *s,
PutBitContext *pb, const float *in, float *out,
const float *scaled, int size, int scale_idx,
... | 24,135 |
FFmpeg | f21c263c8979aa8a71c1c10909efb991679045c1 | 1 | static int rtmp_packet_read_one_chunk(URLContext *h, RTMPPacket *p,
int chunk_size, RTMPPacket **prev_pkt_ptr,
int *nb_prev_pkt, uint8_t hdr)
{
uint8_t buf[16];
int channel_id, timestamp, size;
uint32_t ts_field; // non-exte... | 24,136 |
FFmpeg | 92002db3eb437414281ad4fb6e84e34862f7fc92 | 1 | int ff_h264_execute_ref_pic_marking(H264Context *h, MMCO *mmco, int mmco_count)
{
int i, av_uninit(j);
int current_ref_assigned = 0, err = 0;
Picture *av_uninit(pic);
if ((h->avctx->debug & FF_DEBUG_MMCO) && mmco_count == 0)
av_log(h->avctx, AV_LOG_DEBUG, "no mmco here\n");
for (i... | 24,137 |
qemu | e23a1b33b53d25510320b26d9f154e19c6c99725 | 1 | static void pc_init1(ram_addr_t ram_size,
const char *boot_device,
const char *kernel_filename,
const char *kernel_cmdline,
const char *initrd_filename,
const char *cpu_model,
int pci_enab... | 24,138 |
FFmpeg | eed36075645ecc3d3ef202c94badb66818114c2c | 1 | void *av_tree_insert(AVTreeNode **tp, void *key, int (*cmp)(void *key, const void *b), AVTreeNode **next){
AVTreeNode *t= *tp;
if(t){
unsigned int v= cmp(t->elem, key);
void *ret;
if(!v){
if(*next)
return t->elem;
else if(t->child[0]||t->ch... | 24,139 |
qemu | c2551b47c9b9465962c4000268eda1307f55614a | 1 | static size_t refcount_array_byte_size(BDRVQcow2State *s, uint64_t entries)
{
/* This assertion holds because there is no way we can address more than
* 2^(64 - 9) clusters at once (with cluster size 512 = 2^9, and because
* offsets have to be representable in bytes); due to every cluster
* corr... | 24,140 |
FFmpeg | aa13b0fc55f5aec58fce24d1a047271b3e5727f1 | 1 | static inline void RENAME(hyscale)(SwsContext *c, uint16_t *dst, long dstWidth, uint8_t *src, int srcW, int xInc,
int flags, int canMMX2BeUsed, int16_t *hLumFilter,
int16_t *hLumFilterPos, int hLumFilterSize, void *funnyYCode,
... | 24,142 |
FFmpeg | b79c3df08807c96a945d9cea21c5d923c464d622 | 1 | static int applehttp_read_header(AVFormatContext *s, AVFormatParameters *ap)
{
AppleHTTPContext *c = s->priv_data;
int ret = 0, i, j, stream_offset = 0;
if ((ret = parse_playlist(c, s->filename, NULL, s->pb)) < 0)
goto fail;
if (c->n_variants == 0) {
av_log(NULL, AV_LOG_WARNIN... | 24,143 |
FFmpeg | 82d705e245050c1040321022e200969f9c3ff9c3 | 1 | static int nvenc_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
const AVFrame *frame, int *got_packet)
{
NVENCSTATUS nv_status;
NvencOutputSurface *tmpoutsurf;
int res, i = 0;
NvencContext *ctx = avctx->priv_data;
NvencDynLoadFunctions *dl_fn = &ctx->nvenc_dload_funcs;
NV_ENCOD... | 24,144 |
FFmpeg | 6a63ff19b6a7fe3bc32c7fb4a62fca8f65786432 | 0 | static int mov_read_glbl(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
{
AVStream *st = c->fc->streams[c->fc->nb_streams-1];
if((uint64_t)atom.size > (1<<30))
return -1;
av_free(st->codec->extradata);
st->codec->extradata = av_mallocz(atom.size + FF_INPUT_BUFFER_PADDING_SIZE);
i... | 24,145 |
FFmpeg | 465e1dadbef7596a3eb87089a66bb4ecdc26d3c4 | 0 | static uint64_t find_any_startcode(ByteIOContext *bc, int64_t pos){
uint64_t state=0;
if(pos >= 0)
url_fseek(bc, pos, SEEK_SET); //note, this may fail if the stream isnt seekable, but that shouldnt matter, as in this case we simply start where we are currently
while(bytes_left(bc)){
... | 24,146 |
FFmpeg | b164d66e35d349de414e2f0d7365a147aba8a620 | 0 | static void ape_unpack_stereo(APEContext *ctx, int count)
{
int32_t left, right;
int32_t *decoded0 = ctx->decoded[0];
int32_t *decoded1 = ctx->decoded[1];
if (ctx->frameflags & APE_FRAMECODE_STEREO_SILENCE) {
/* We are pure silence, so we're done. */
av_log(ctx->avctx, AV_LOG_DE... | 24,147 |
qemu | 245f7b51c0ea04fb2224b1127430a096c91aee70 | 0 | static void jpeg_init_destination(j_compress_ptr cinfo)
{
VncState *vs = cinfo->client_data;
Buffer *buffer = &vs->tight_jpeg;
cinfo->dest->next_output_byte = (JOCTET *)buffer->buffer + buffer->offset;
cinfo->dest->free_in_buffer = (size_t)(buffer->capacity - buffer->offset);
}
| 24,149 |
qemu | b6dcbe086c77ec683f5ff0b693593cda1d61f3a1 | 0 | static void ref405ep_init (ram_addr_t ram_size,
const char *boot_device,
const char *kernel_filename,
const char *kernel_cmdline,
const char *initrd_filename,
const char *cpu_model... | 24,150 |
qemu | bb593904c18e22ea0671dfa1b02e24982f2bf0ea | 0 | void ppc_store_sdr1 (CPUPPCState *env, target_ulong value)
{
LOG_MMU("%s: " TARGET_FMT_lx "\n", __func__, value);
if (env->sdr1 != value) {
/* XXX: for PowerPC 64, should check that the HTABSIZE value
* is <= 28
*/
env->sdr1 = value;
tlb_flush(env, 1);
... | 24,151 |
qemu | b476c99d01519277e3494a10dc0329d07157ae02 | 0 | static void memory_region_finalize(Object *obj)
{
MemoryRegion *mr = MEMORY_REGION(obj);
assert(QTAILQ_EMPTY(&mr->subregions));
assert(memory_region_transaction_depth == 0);
mr->destructor(mr);
memory_region_clear_coalescing(mr);
g_free((char *)mr->name);
g_free(mr->ioeventfds);
}... | 24,152 |
qemu | b2c98d9d392c87c9b9e975d30f79924719d9cbbe | 0 | static void tgen64_ori(TCGContext *s, TCGReg dest, tcg_target_ulong val)
{
static const S390Opcode oi_insns[4] = {
RI_OILL, RI_OILH, RI_OIHL, RI_OIHH
};
static const S390Opcode nif_insns[2] = {
RIL_OILF, RIL_OIHF
};
int i;
/* Look for no-op. */
if (val == 0) {
... | 24,153 |
qemu | d5b93ddfefe63d5869a8eb97ea3474867d3b105b | 0 | int xen_be_init(void)
{
xenstore = xs_daemon_open();
if (!xenstore) {
xen_be_printf(NULL, 0, "can't connect to xenstored\n");
return -1;
}
if (qemu_set_fd_handler(xs_fileno(xenstore), xenstore_update, NULL, NULL) < 0) {
goto err;
}
xen_xc = xc_interface_open... | 24,154 |
qemu | 568c73a4783cd981e9aa6de4f15dcda7829643ad | 0 | static void virtio_input_handle_event(DeviceState *dev, QemuConsole *src,
InputEvent *evt)
{
VirtIOInput *vinput = VIRTIO_INPUT(dev);
virtio_input_event event;
int qcode;
switch (evt->kind) {
case INPUT_EVENT_KIND_KEY:
qcode = qemu_input_key_va... | 24,157 |
qemu | 883bca776daa43111e9c39008f0038f7c62ae723 | 0 | static int uhci_handle_td(UHCIState *s, uint32_t addr, UHCI_TD *td,
uint32_t *int_mask, bool queuing)
{
UHCIAsync *async;
int len = 0, max_len;
uint8_t pid;
USBDevice *dev;
USBEndpoint *ep;
/* Is active ? */
if (!(td->ctrl & TD_CTRL_ACTIVE))
retu... | 24,158 |
qemu | fd56e0612b6454a282fa6a953fdb09281a98c589 | 0 | static void xen_pt_region_update(XenPCIPassthroughState *s,
MemoryRegionSection *sec, bool adding)
{
PCIDevice *d = &s->dev;
MemoryRegion *mr = sec->mr;
int bar = -1;
int rc;
int op = adding ? DPCI_ADD_MAPPING : DPCI_REMOVE_MAPPING;
struct CheckBarArgs ar... | 24,159 |
qemu | 41074f3d3ff0e9a3c6f638627c12ebbf6d757cea | 0 | static void omap_inth_sir_update(struct omap_intr_handler_s *s, int is_fiq)
{
int i, j, sir_intr, p_intr, p, f;
uint32_t level;
sir_intr = 0;
p_intr = 255;
/* Find the interrupt line with the highest dynamic priority.
* Note: 0 denotes the hightest priority.
* If all interrupts h... | 24,163 |
qemu | a03ef88f77af045a2eb9629b5ce774a3fb973c5e | 0 | static int coroutine_fn bdrv_co_do_writev(BdrvChild *child,
int64_t sector_num, int nb_sectors, QEMUIOVector *qiov,
BdrvRequestFlags flags)
{
if (nb_sectors < 0 || nb_sectors > BDRV_REQUEST_MAX_SECTORS) {
return -EINVAL;
}
return bdrv_co_pwritev(child->bs, sector_num << BDRV_SECTOR_... | 24,165 |
FFmpeg | 08b520636e96ba6888b669b9b3f4c414631ea1d2 | 0 | static int decorrelate(TAKDecContext *s, int c1, int c2, int length)
{
GetBitContext *gb = &s->gb;
int32_t *p1 = s->decoded[c1] + (s->dmode > 5);
int32_t *p2 = s->decoded[c2] + (s->dmode > 5);
int32_t bp1 = p1[0];
int32_t bp2 = p2[0];
int i;
int dshift, dfacto... | 24,166 |
qemu | a8170e5e97ad17ca169c64ba87ae2f53850dab4c | 0 | static MegasasCmd *megasas_lookup_frame(MegasasState *s,
target_phys_addr_t frame)
{
MegasasCmd *cmd = NULL;
int num = 0, index;
index = s->reply_queue_head;
while (num < s->fw_cmds) {
if (s->frames[index].pa && s->frames[index].pa == frame) {
cmd = &s->frames[index];... | 24,167 |
FFmpeg | 77d2ef13a8fa630e5081f14bde3fd20f84c90aec | 1 | static int ebml_parse_elem(MatroskaDemuxContext *matroska,
EbmlSyntax *syntax, void *data)
{
static const uint64_t max_lengths[EBML_TYPE_COUNT] = {
[EBML_UINT] = 8,
[EBML_FLOAT] = 8,
// max. 16 MB for strings
[EBML_STR] = 0x1000000,
[EBML... | 24,169 |
qemu | 791f97758e223de3290592d169f8e6339c281714 | 1 | static int ehci_init_transfer(EHCIPacket *p)
{
uint32_t cpage, offset, bytes, plen;
dma_addr_t page;
cpage = get_field(p->qtd.token, QTD_TOKEN_CPAGE);
bytes = get_field(p->qtd.token, QTD_TOKEN_TBYTES);
offset = p->qtd.bufptr[0] & ~QTD_BUFPTR_MASK;
qemu_sglist_init(&p->sgl, p->queue->e... | 24,170 |
qemu | 09b9418c6d085a0728372aa760ebd10128a020b1 | 1 | static target_long monitor_get_pc (const struct MonitorDef *md, int val)
{
CPUState *env = mon_get_cpu();
if (!env)
return 0;
return env->eip + env->segs[R_CS].base;
}
| 24,171 |
qemu | e41029b378b4a65a0b89b5a8dc087aca6b5d012d | 1 | static void gen_stswi(DisasContext *ctx)
{
TCGv t0;
TCGv_i32 t1, t2;
int nb = NB(ctx->opcode);
gen_set_access_type(ctx, ACCESS_INT);
/* NIP cannot be restored if the memory exception comes from an helper */
gen_update_nip(ctx, ctx->nip - 4);
t0 = tcg_temp_new();
gen_addr_registe... | 24,172 |
qemu | b2d1fe67d09d2b6c7da647fbcea6ca0148c206d3 | 1 | static void bufp_alloc(USBRedirDevice *dev,
uint8_t *data, int len, int status, uint8_t ep)
{
struct buf_packet *bufp;
if (!dev->endpoint[EP2I(ep)].bufpq_dropping_packets &&
dev->endpoint[EP2I(ep)].bufpq_size >
2 * dev->endpoint[EP2I(ep)].bufpq_target_size) {
DPRINTF("bu... | 24,173 |
qemu | 7237aecd7e8fcc3ccf7fded77b6c127b4df5d3ac | 1 | static int vmdk_open_vmfs_sparse(BlockDriverState *bs,
BlockDriverState *file,
int flags, Error **errp)
{
int ret;
uint32_t magic;
VMDK3Header header;
VmdkExtent *extent;
ret = bdrv_pread(file, sizeof(magic), &header, sizeof... | 24,174 |
FFmpeg | 0dcfccaa691bf533b0f144b6d98b49eb59f1f3ab | 1 | static int au_write_header(AVFormatContext *s)
{
AVIOContext *pb = s->pb;
AVCodecContext *enc = s->streams[0]->codec;
if (!enc->codec_tag)
return AVERROR(EINVAL);
ffio_wfourcc(pb, ".snd"); /* magic number */
avio_wb32(pb, AU_HEADER_SIZE); /* header s... | 24,175 |
qemu | fc19f8a02e45c4d8ad24dd7eb374330b03dfc28e | 0 | static ssize_t nbd_co_receive_request(NBDRequest *req, struct nbd_request *request)
{
NBDClient *client = req->client;
int csock = client->sock;
ssize_t rc;
client->recv_coroutine = qemu_coroutine_self();
if (nbd_receive_request(csock, request) == -1) {
rc = -EIO;
goto out;... | 24,176 |
qemu | 32902772833dbe424f754d5b841d996b90be87b2 | 0 | static int pci_vga_initfn(PCIDevice *dev)
{
PCIVGAState *d = DO_UPCAST(PCIVGAState, dev, dev);
VGACommonState *s = &d->vga;
uint8_t *pci_conf = d->dev.config;
// vga + console init
vga_common_init(s, VGA_RAM_SIZE);
vga_init(s);
s->ds = graphic_console_init(s->update, s->in... | 24,177 |
qemu | 4080a13c11398d684668d286da27b6f8ee668e44 | 0 | void portio_list_add(PortioList *piolist,
MemoryRegion *address_space,
uint32_t start)
{
const MemoryRegionPortio *pio, *pio_start = piolist->ports;
unsigned int off_low, off_high, off_last, count;
piolist->address_space = address_space;
/* Handle the... | 24,178 |
qemu | 3bba22de7cb9631452dad492c907affce6a69a3b | 0 | void qemu_console_resize(QEMUConsole *console, int width, int height)
{
if (console->g_width != width || console->g_height != height) {
console->g_width = width;
console->g_height = height;
if (active_console == console) {
dpy_resize(console->ds, width, height);
}
... | 24,180 |
qemu | 61007b316cd71ee7333ff7a0a749a8949527575f | 0 | static void coroutine_fn bdrv_get_block_status_co_entry(void *opaque)
{
BdrvCoGetBlockStatusData *data = opaque;
BlockDriverState *bs = data->bs;
data->ret = bdrv_co_get_block_status(bs, data->sector_num, data->nb_sectors,
data->pnum);
data->done = true;
... | 24,181 |
FFmpeg | 229843aa359ae0c9519977d7fa952688db63f559 | 0 | static int process_cc608(CCaptionSubContext *ctx, int64_t pts, uint8_t hi, uint8_t lo)
{
int ret = 0;
#define COR3(var, with1, with2, with3) ( (var) == (with1) || (var) == (with2) || (var) == (with3) )
if ( hi == ctx->prev_cmd[0] && lo == ctx->prev_cmd[1]) {
/* ignore redundant command */
} else... | 24,182 |
qemu | 0d7937974cd0504f30ad483c3368b21da426ddf9 | 0 | static uint32_t vmsvga_value_read(void *opaque, uint32_t address)
{
uint32_t caps;
struct vmsvga_state_s *s = opaque;
switch (s->index) {
case SVGA_REG_ID:
return s->svgaid;
case SVGA_REG_ENABLE:
return s->enable;
case SVGA_REG_WIDTH:
return s->width;
... | 24,183 |
qemu | 32bafa8fdd098d52fbf1102d5a5e48d29398c0aa | 0 | static void qemu_chr_parse_file_out(QemuOpts *opts, ChardevBackend *backend,
Error **errp)
{
const char *path = qemu_opt_get(opts, "path");
ChardevFile *file;
if (path == NULL) {
error_setg(errp, "chardev: file: no filename given");
return;
}... | 24,184 |
qemu | c2fa30757a2ba1bb5b053883773a9a61fbdd7082 | 0 | nvdimm_dsm_write(void *opaque, hwaddr addr, uint64_t val, unsigned size)
{
AcpiNVDIMMState *state = opaque;
NvdimmDsmIn *in;
hwaddr dsm_mem_addr = val;
nvdimm_debug("dsm memory address %#" HWADDR_PRIx ".\n", dsm_mem_addr);
/*
* The DSM memory is mapped to guest address space so an ev... | 24,185 |
qemu | c208e8c2d88eea2bbafc2850d8856525637e495d | 0 | static BlockDriverAIOCB *hdev_aio_ioctl(BlockDriverState *bs,
unsigned long int req, void *buf,
BlockDriverCompletionFunc *cb, void *opaque)
{
BDRVRawState *s = bs->opaque;
if (fd_open(bs) < 0)
return NULL;
return paio_ioctl(bs, s->fd, req, buf, cb, opaque);
}
| 24,186 |
qemu | de1b9b85eff3dca42fe2cabe6e026cd2a2d5c769 | 0 | static void qxl_init_ramsize(PCIQXLDevice *qxl)
{
/* vga mode framebuffer / primary surface (bar 0, first part) */
if (qxl->vgamem_size_mb < 8) {
qxl->vgamem_size_mb = 8;
}
/* XXX: we round vgamem_size_mb up to a nearest power of two and it must be
* less than vga_common_init()'s max... | 24,187 |
qemu | eb46c5eda7d8b38c1407dd55f67cf4a6aa3b7b23 | 0 | static int rtl8139_config_writable(RTL8139State *s)
{
if (s->Cfg9346 & Cfg9346_Unlock)
{
return 1;
}
DPRINTF("Configuration registers are write-protected\n");
return 0;
}
| 24,188 |
qemu | 3356128cd13d7ec7689b7cddd3efbfbc5339a262 | 0 | static int vfio_container_do_ioctl(AddressSpace *as, int32_t groupid,
int req, void *param)
{
VFIOGroup *group;
VFIOContainer *container;
int ret = -1;
group = vfio_get_group(groupid, as);
if (!group) {
error_report("vfio: group %d not registered"... | 24,189 |
qemu | 8e9b0d24fb986d4241ae3b77752eca5dab4cb486 | 0 | void vnc_flush(VncState *vs)
{
vnc_lock_output(vs);
if (vs->csock != -1 && (vs->output.offset
#ifdef CONFIG_VNC_WS
|| vs->ws_output.offset
#endif
)) {
vnc_client_write_locked(vs);
}
vnc_unlock_output(vs);
}
| 24,190 |
qemu | f090c9d4ad5812fb92843d6470a1111c15190c4c | 0 | static float32 roundAndPackFloat32( flag zSign, int16 zExp, bits32 zSig STATUS_PARAM)
{
int8 roundingMode;
flag roundNearestEven;
int8 roundIncrement, roundBits;
flag isTiny;
roundingMode = STATUS(float_rounding_mode);
roundNearestEven = ( roundingMode == float_round_nearest_even );
... | 24,191 |
qemu | a8170e5e97ad17ca169c64ba87ae2f53850dab4c | 0 | static void omap_lpg_write(void *opaque, target_phys_addr_t addr,
uint64_t value, unsigned size)
{
struct omap_lpg_s *s = (struct omap_lpg_s *) opaque;
int offset = addr & OMAP_MPUI_REG_MASK;
if (size != 1) {
return omap_badwidth_write8(opaque, addr, value);
}... | 24,192 |
FFmpeg | 5c2fb561d94fc51d76ab21d6f7cc5b6cc3aa599c | 0 | static int h264_find_frame_end(H264ParseContext *p, const uint8_t *buf,
int buf_size)
{
int i;
uint32_t state;
ParseContext *pc = &p->pc;
// mb_addr= pc->mb_addr - 1;
state = pc->state;
if (state > 13)
state = 7;
for (i = 0; i < buf_size; i++... | 24,193 |
qemu | a8170e5e97ad17ca169c64ba87ae2f53850dab4c | 0 | static uint64_t omap_mpu_timer_read(void *opaque, target_phys_addr_t addr,
unsigned size)
{
struct omap_mpu_timer_s *s = (struct omap_mpu_timer_s *) opaque;
if (size != 4) {
return omap_badwidth_read32(opaque, addr);
}
switch (addr) {
case 0x00... | 24,194 |
qemu | b4d02820d95e025e57d82144f7b2ccd677ac2418 | 0 | void bdrv_close(BlockDriverState *bs)
{
BdrvAioNotifier *ban, *ban_next;
if (bs->job) {
block_job_cancel_sync(bs->job);
}
/* Disable I/O limits and drain all pending throttled requests */
if (bs->io_limits_enabled) {
bdrv_io_limits_disable(bs);
}
bdrv_drain(bs... | 24,195 |
qemu | 8917c3bdba37d6fe4393db0fad3fabbde9530d6b | 0 | void slirp_select_poll(fd_set *readfds, fd_set *writefds,
fd_set *xfds, int select_error)
{
}
| 24,196 |
qemu | 0919ac787641db11024912651f3bc5764d4f1286 | 0 | struct omap_mcbsp_s *omap_mcbsp_init(MemoryRegion *system_memory,
target_phys_addr_t base,
qemu_irq *irq, qemu_irq *dma, omap_clk clk)
{
struct omap_mcbsp_s *s = (struct omap_mcbsp_s *)
g_malloc0(sizeof(struct omap_mcbsp_s));
s->txirq = irq[0];
s->rxirq =... | 24,197 |
qemu | 210b580b106fa798149e28aa13c66b325a43204e | 0 | static target_ulong h_rtas(PowerPCCPU *cpu, sPAPREnvironment *spapr,
target_ulong opcode, target_ulong *args)
{
target_ulong rtas_r3 = args[0];
uint32_t token = ldl_be_phys(rtas_r3);
uint32_t nargs = ldl_be_phys(rtas_r3 + 4);
uint32_t nret = ldl_be_phys(rtas_r3 + 8);
... | 24,198 |
qemu | cfdf2c40577ed99bb19cdc05d0537e2808d77a78 | 0 | static void do_info_balloon(Monitor *mon, QObject **ret_data)
{
ram_addr_t actual;
actual = qemu_balloon_status();
if (kvm_enabled() && !kvm_has_sync_mmu())
qemu_error_new(QERR_KVM_MISSING_CAP, "synchronous MMU", "balloon");
else if (actual == 0)
qemu_error_new(QERR_DEVICE_NOT_A... | 24,202 |
qemu | cd41a671b370a3dd603963432d2b02f1e5990fb7 | 0 | static void virtio_scsi_hotplug(SCSIBus *bus, SCSIDevice *dev)
{
VirtIOSCSI *s = container_of(bus, VirtIOSCSI, bus);
if (((s->vdev.guest_features >> VIRTIO_SCSI_F_HOTPLUG) & 1) &&
(s->vdev.status & VIRTIO_CONFIG_S_DRIVER_OK)) {
virtio_scsi_push_event(s, dev, VIRTIO_SCSI_T_TRANSPORT_RESET,... | 24,203 |
qemu | bd269ebc82fbaa5fe7ce5bc7c1770ac8acecd884 | 0 | void qio_channel_socket_listen_async(QIOChannelSocket *ioc,
SocketAddressLegacy *addr,
QIOTaskFunc callback,
gpointer opaque,
GDestroyNotify destroy)
{
QIOTask *t... | 24,204 |
qemu | a8170e5e97ad17ca169c64ba87ae2f53850dab4c | 0 | static void bmdma_write(void *opaque, target_phys_addr_t addr,
uint64_t val, unsigned size)
{
BMDMAState *bm = opaque;
if (size != 1) {
return;
}
#ifdef DEBUG_IDE
printf("bmdma: writeb 0x%02x : 0x%02x\n", addr, val);
#endif
switch (addr & 3) {
case ... | 24,207 |
qemu | 84a12e6648444f517055138a7d7f25a22d7e1029 | 0 | int bdrv_open(BlockDriverState *bs, const char *filename, int flags,
BlockDriver *drv)
{
int ret, open_flags;
char tmp_filename[PATH_MAX];
char backing_filename[PATH_MAX];
bs->is_temporary = 0;
bs->encrypted = 0;
bs->valid_key = 0;
bs->open_flags = flags;
/* buf... | 24,208 |
qemu | 92c0bba9a95739c92e959fe478cb1acb92fa5446 | 0 | static uint32_t omap_l4_io_readw(void *opaque, target_phys_addr_t addr)
{
unsigned int i = (addr - OMAP2_L4_BASE) >> TARGET_PAGE_BITS;
return omap_l4_io_readw_fn[i](omap_l4_io_opaque[i], addr);
}
| 24,209 |
qemu | 3661049fec64ffd7ab008e57e396881c6a4b53a4 | 0 | PCIBus *typhoon_init(ram_addr_t ram_size, ISABus **isa_bus,
qemu_irq *p_rtc_irq,
AlphaCPU *cpus[4], pci_map_irq_fn sys_map_irq)
{
const uint64_t MB = 1024 * 1024;
const uint64_t GB = 1024 * MB;
MemoryRegion *addr_space = get_system_memory();
DeviceState *... | 24,210 |
qemu | 7d5e199ade76c53ec316ab6779800581bb47c50a | 0 | static void qmp_output_end_struct(Visitor *v, void **obj)
{
QmpOutputVisitor *qov = to_qov(v);
QObject *value = qmp_output_pop(qov, obj);
assert(qobject_type(value) == QTYPE_QDICT);
}
| 24,211 |
qemu | 6ecd0b6ba0591ef280ed984103924d4bdca5ac32 | 0 | static void pmuserenr_write(CPUARMState *env, const ARMCPRegInfo *ri,
uint64_t value)
{
env->cp15.c9_pmuserenr = value & 1;
}
| 24,214 |
qemu | f8b6cc0070aab8b75bd082582c829be1353f395f | 0 | static int parse_drive(DeviceState *dev, Property *prop, const char *str)
{
DriveInfo **ptr = qdev_get_prop_ptr(dev, prop);
*ptr = drive_get_by_id(str);
if (*ptr == NULL)
return -ENOENT;
return 0;
}
| 24,215 |
FFmpeg | e45a2872fafe631c14aee9f79d0963d68c4fc1fd | 0 | void put_pixels8_xy2_altivec(uint8_t *block, const uint8_t *pixels, int line_size, int h)
{
POWERPC_TBL_DECLARE(altivec_put_pixels8_xy2_num, 1);
#ifdef ALTIVEC_USE_REFERENCE_C_CODE
int j;
POWERPC_TBL_START_COUNT(altivec_put_pixels8_xy2_num, 1);
for (j = 0; j < 2; j++) {
int i;
const uint32_t... | 24,216 |
qemu | e4533c7a8cdcc79ccdf695f0aaa2e23a5b926ed0 | 0 | void cpu_x86_interrupt(CPUX86State *s)
{
s->interrupt_request = 1;
}
| 24,217 |
qemu | c83c66c3b58893a4dc056e272822beb88fe9ec7f | 0 | void hmp_block_stream(Monitor *mon, const QDict *qdict)
{
Error *error = NULL;
const char *device = qdict_get_str(qdict, "device");
const char *base = qdict_get_try_str(qdict, "base");
qmp_block_stream(device, base != NULL, base, &error);
hmp_handle_error(mon, &error);
}
| 24,220 |
FFmpeg | 0ecca7a49f8e254c12a3a1de048d738bfbb614c6 | 1 | static int flic_read_packet(AVFormatContext *s,
AVPacket *pkt)
{
FlicDemuxContext *flic = (FlicDemuxContext *)s->priv_data;
ByteIOContext *pb = &s->pb;
int packet_read = 0;
unsigned int size;
int magic;
int ret = 0;
unsigned char preamble[FLIC_PREAMBLE_SI... | 24,223 |
FFmpeg | 4c7b023d56e09a78a587d036db1b64bf7c493b3d | 0 | static int get_ref_idx(AVFrame *frame)
{
FrameDecodeData *fdd;
NVDECFrame *cf;
if (!frame || !frame->private_ref)
return -1;
fdd = (FrameDecodeData*)frame->private_ref->data;
cf = (NVDECFrame*)fdd->hwaccel_priv;
return cf->idx;
}
| 24,225 |
FFmpeg | a26e1d4c1f7c93d24250dd9c0786241f92fcdea4 | 0 | static int put_packetheader(NUTContext *nut, ByteIOContext *bc, int max_size, int calculate_checksum)
{
put_flush_packet(bc);
nut->packet_start[2]= url_ftell(bc) - 8;
nut->written_packet_size = max_size;
if(calculate_checksum)
init_checksum(bc, update_adler32, 0);
/* packet he... | 24,228 |
FFmpeg | 4bb9adcff1be7ccbb6b8fab40cd68b3808544edc | 0 | inline static void RENAME(hcscale)(SwsContext *c, 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,
... | 24,229 |
FFmpeg | a04c2c707de2ce850f79870e84ac9d7ec7aa9143 | 1 | int avpriv_unlock_avformat(void)
{
if (lockmgr_cb) {
if ((*lockmgr_cb)(&avformat_mutex, AV_LOCK_RELEASE))
return -1;
}
return 0;
}
| 24,232 |
qemu | e318a60b94b152c1e80125861a8917ae177d845e | 1 | static int disas_neon_ls_insn(CPUState * env, DisasContext *s, uint32_t insn)
{
int rd, rn, rm;
int op;
int nregs;
int interleave;
int spacing;
int stride;
int size;
int reg;
int pass;
int load;
int shift;
int n;
TCGv addr;
TCGv tmp;
TCGv tmp2;... | 24,233 |
qemu | 640601c7cb1b6b41d3e1a435b986266c2b71e9bc | 1 | vu_queue_empty(VuDev *dev, VuVirtq *vq)
{
if (vq->shadow_avail_idx != vq->last_avail_idx) {
return 0;
}
return vring_avail_idx(vq) == vq->last_avail_idx;
}
| 24,234 |
qemu | 3ce6a729b5d78b13283ddc6c529811f67519a62d | 1 | static CURLState *curl_init_state(BlockDriverState *bs, BDRVCURLState *s)
{
CURLState *state = NULL;
int i, j;
do {
for (i=0; i<CURL_NUM_STATES; i++) {
for (j=0; j<CURL_NUM_ACB; j++)
if (s->states[i].acb[j])
continue;
if (s->stat... | 24,236 |
qemu | a9c380db3b8c6af19546a68145c8d1438a09c92b | 1 | static int ssi_sd_load(QEMUFile *f, void *opaque, int version_id)
{
SSISlave *ss = SSI_SLAVE(opaque);
ssi_sd_state *s = (ssi_sd_state *)opaque;
int i;
if (version_id != 1)
s->mode = qemu_get_be32(f);
s->cmd = qemu_get_be32(f);
for (i = 0; i < 4; i++)
s->cmdarg[i] = qemu... | 24,237 |
qemu | 60fe637bf0e4d7989e21e50f52526444765c63b4 | 1 | static inline uint8_t *ram_chunk_end(const RDMALocalBlock *rdma_ram_block,
uint64_t i)
{
uint8_t *result = ram_chunk_start(rdma_ram_block, i) +
(1UL << RDMA_REG_CHUNK_SHIFT);
if (result > (rdma_ram_block->local_host_addr + rdma... | 24,238 |
FFmpeg | 073c2593c9f0aa4445a6fc1b9b24e6e52a8cc2c1 | 1 | static int build_vlc(VLC *vlc, const uint8_t *bits_table, const uint8_t *val_table,
int nb_codes)
{
uint8_t huff_size[256];
uint16_t huff_code[256];
memset(huff_size, 0, sizeof(huff_size));
build_huffman_codes(huff_size, huff_code, bits_table, val_table);
return... | 24,239 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.