project stringclasses 2
values | commit_id stringlengths 40 40 | target int64 0 1 | func stringlengths 26 142k | idx int64 0 27.3k |
|---|---|---|---|---|
qemu | 9307c4c1d93939db9b04117b654253af5113dc21 | 0 | static void do_help(int argc, const char **argv)
{
help_cmd(argv[1]);
}
| 13,591 |
qemu | 99519f0a776797db8fbdbf828240333e5181a612 | 0 | int main(int argc, char **argv, char **envp)
{
const char *gdbstub_dev = NULL;
int i;
int snapshot, linux_boot;
const char *icount_option = NULL;
const char *initrd_filename;
const char *kernel_filename, *kernel_cmdline;
char boot_devices[33] = "cad"; /* default to HD->floppy->CD-ROM... | 13,593 |
FFmpeg | 9eef2b77b29189606148e1fdf5d6c8d7b52b08b0 | 0 | static int tcp_read(URLContext *h, uint8_t *buf, int size)
{
TCPContext *s = h->priv_data;
int size1, len, fd_max;
fd_set rfds;
struct timeval tv;
size1 = size;
while (size > 0) {
if (url_interrupt_cb())
return -EINTR;
fd_max = s->fd;
FD_ZERO(&rfd... | 13,594 |
qemu | 8ac55351459055f2faee585d9ba2f84707741815 | 0 | static int hda_codec_dev_exit(DeviceState *qdev)
{
HDACodecDevice *dev = HDA_CODEC_DEVICE(qdev);
HDACodecDeviceClass *cdc = HDA_CODEC_DEVICE_GET_CLASS(dev);
if (cdc->exit) {
cdc->exit(dev);
}
return 0;
}
| 13,596 |
qemu | 8607f5c3072caeebbe0217df28651fffd3a79fd9 | 0 | static bool virtqueue_map_desc(VirtIODevice *vdev, unsigned int *p_num_sg,
hwaddr *addr, struct iovec *iov,
unsigned int max_num_sg, bool is_write,
hwaddr pa, size_t sz)
{
bool ok = false;
unsigned num_sg = *p_num... | 13,597 |
qemu | 3115b9e2d286188a54d6f415186ae556046b68a3 | 0 | void i8042_setup_a20_line(ISADevice *dev, qemu_irq *a20_out)
{
ISAKBDState *isa = I8042(dev);
KBDState *s = &isa->kbd;
s->a20_out = a20_out;
}
| 13,598 |
FFmpeg | fa73604f61e9f067feb24078128a4a3f915d628c | 0 | static int swf_read_header(AVFormatContext *s, AVFormatParameters *ap)
{
SWFContext *swf = 0;
ByteIOContext *pb = &s->pb;
int nbits, len, frame_rate, tag, v;
offset_t firstTagOff;
AVStream *ast = 0;
AVStream *vst = 0;
swf = av_malloc(sizeof(SWFContext));
if (!swf)
ret... | 13,599 |
FFmpeg | bcd7bf7eeb09a395cc01698842d1b8be9af483fc | 0 | void ff_weight_h264_pixels16_8_msa(uint8_t *src, int stride,
int height, int log2_denom,
int weight_src, int offset)
{
avc_wgt_16width_msa(src, stride,
height, log2_denom, weight_src, offset);
}
| 13,600 |
FFmpeg | f929ab0569ff31ed5a59b0b0adb7ce09df3fca39 | 0 | static int decode_dvd_subtitles(DVDSubContext *ctx, AVSubtitle *sub_header,
const uint8_t *buf, int buf_size)
{
int cmd_pos, pos, cmd, x1, y1, x2, y2, offset1, offset2, next_cmd_pos;
int big_offsets, offset_size, is_8bit = 0;
const uint8_t *yuv_palette = 0;
uint8_t ... | 13,601 |
FFmpeg | dc5d1515681b57a257443ba72bb81fb3e6e6621b | 0 | static int format_name(char *buf, int buf_len, int index)
{
const char *proto, *dir;
char *orig_buf_dup = NULL, *mod_buf_dup = NULL;
int ret = 0;
if (!av_stristr(buf, "%v"))
return ret;
orig_buf_dup = av_strdup(buf);
if (!orig_buf_dup) {
ret = AVERROR(ENOMEM);
... | 13,602 |
qemu | 8194f35a0c71a3bf169459bf715bea53b7bbc904 | 1 | void cpu_reset(CPUSPARCState *env)
{
if (qemu_loglevel_mask(CPU_LOG_RESET)) {
qemu_log("CPU Reset (CPU %d)\n", env->cpu_index);
log_cpu_state(env, 0);
}
tlb_flush(env, 1);
env->cwp = 0;
#ifndef TARGET_SPARC64
env->wim = 1;
#endif
env->regwptr = env->regbase + (env->c... | 13,603 |
qemu | df8bf7a7fe75eb5d5caffa55f5cd4292b757aea6 | 1 | net_rx_pkt_pull_data(struct NetRxPkt *pkt,
const struct iovec *iov, int iovcnt,
size_t ploff)
{
if (pkt->vlan_stripped) {
net_rx_pkt_iovec_realloc(pkt, iovcnt + 1);
pkt->vec[0].iov_base = pkt->ehdr_buf;
pkt->vec[0].iov_len = sizeof(pkt... | 13,606 |
qemu | 40ff6d7e8dceca227e7f8a3e8e0d58b2c66d19b4 | 1 | MigrationState *tcp_start_outgoing_migration(Monitor *mon,
const char *host_port,
int64_t bandwidth_limit,
int detach,
int blk,
int inc)
{
struct sockaddr... | 13,607 |
qemu | 27c3f2cb9bf2112b82edac898094e0a39e6efca1 | 1 | int main_loop(void *opaque)
{
struct pollfd ufds[2], *pf, *serial_ufd, *net_ufd, *gdb_ufd;
int ret, n, timeout;
uint8_t ch;
CPUState *env = global_env;
if (!term_inited) {
/* initialize terminal only there so that the user has a
chance to stop QEMU with Ctrl-C before the... | 13,608 |
qemu | cae5d3f4b3fbe9b681c0c4046008af424bd1d6a5 | 1 | static int ehci_state_executing(EHCIQueue *q)
{
EHCIPacket *p = QTAILQ_FIRST(&q->packets);
assert(p != NULL);
assert(p->qtdaddr == q->qtdaddr);
ehci_execute_complete(q);
// 4.10.3
if (!q->async) {
int transactCtr = get_field(q->qh.epcap, QH_EPCAP_MULT);
transactCtr... | 13,609 |
FFmpeg | 80387f0e2568746dce4a68e2217297029a053dae | 1 | static int decode(MimicContext *ctx, int quality, int num_coeffs,
int is_iframe)
{
int y, x, plane, cur_row = 0;
for(plane = 0; plane < 3; plane++) {
const int is_chroma = !!plane;
const int qscale = av_clip(10000-quality,is_chroma?1000:2000,10000)<<2;
const in... | 13,610 |
FFmpeg | 6fae8c5443d4fa40fe65f67138f4dbb731f23d72 | 1 | static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque)
{
UnsharpContext *unsharp = ctx->priv;
int lmsize_x = 5, cmsize_x = 0;
int lmsize_y = 5, cmsize_y = 0;
double lamount = 1.0f, camount = 0.0f;
if (args)
sscanf(args, "%d:%d:%lf:%d:%d:%lf", &lmsize_x, &lmsiz... | 13,611 |
FFmpeg | 735e601be1b7731d256a41e942b31a96255a6bec | 0 | static int mxf_decrypt_triplet(AVFormatContext *s, AVPacket *pkt, KLVPacket *klv)
{
static const uint8_t checkv[16] = {0x43, 0x48, 0x55, 0x4b, 0x43, 0x48, 0x55, 0x4b, 0x43, 0x48, 0x55, 0x4b, 0x43, 0x48, 0x55, 0x4b};
MXFContext *mxf = s->priv_data;
AVIOContext *pb = s->pb;
int64_t end = avio_tell(pb... | 13,613 |
FFmpeg | 41836c4e306e572ecf80d5a714aaec532c7ece60 | 1 | static int libx265_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
const AVFrame *pic, int *got_packet)
{
libx265Context *ctx = avctx->priv_data;
x265_picture x265pic;
x265_picture x265pic_out = { { 0 } };
x265_nal *nal;
uint8_t *dst;
int payload = 0;
int n... | 13,614 |
qemu | 7d1b0095bff7157e856d1d0e6c4295641ced2752 | 1 | static inline TCGv gen_ld16u(TCGv addr, int index)
{
TCGv tmp = new_tmp();
tcg_gen_qemu_ld16u(tmp, addr, index);
return tmp;
}
| 13,615 |
FFmpeg | 1973079417e8701b52ba810a72cb6c7c6f7f9a56 | 1 | static int opus_decode_packet(AVCodecContext *avctx, void *data,
int *got_frame_ptr, AVPacket *avpkt)
{
OpusContext *c = avctx->priv_data;
AVFrame *frame = data;
const uint8_t *buf = avpkt->data;
int buf_size = avpkt->size;
int coded_samples = 0;
... | 13,616 |
qemu | cd7ccc83512a0cba5aa0c778e7507f267cfb1b16 | 1 | int page_check_range(target_ulong start, target_ulong len, int flags)
{
PageDesc *p;
target_ulong end;
target_ulong addr;
/* This function should never be called with addresses outside the
guest address space. If this assert fires, it probably indicates
a missing call to h2g_vali... | 13,617 |
FFmpeg | de1568a452d8348917fee533fe17517131dccf95 | 1 | 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;
if (cat->safe > 0 && !safe_filename(filename)) {
av_log(avf, AV_LOG_ERROR,... | 13,618 |
FFmpeg | 6fb2fd895e858ab93f46e656a322778ee181c307 | 1 | void avfilter_copy_buffer_ref_props(AVFilterBufferRef *dst, AVFilterBufferRef *src)
{
// copy common properties
dst->pts = src->pts;
dst->pos = src->pos;
switch (src->type) {
case AVMEDIA_TYPE_VIDEO: {
if (dst->video->qp_table)
av_freep(&dst->video->qp_tab... | 13,619 |
qemu | a12a5a1a0132527afe87c079e4aae4aad372bd94 | 1 | static void test_validate_fail_list(TestInputVisitorData *data,
const void *unused)
{
UserDefOneList *head = NULL;
Error *err = NULL;
Visitor *v;
v = validate_test_init(data, "[ { 'string': 'string0', 'integer': 42 }, { 'string': 'string1', 'integer': 43 }, {... | 13,620 |
FFmpeg | 3c11a27b440e27c3796592aa8fb7fed966386a21 | 1 | int ff_find_unused_picture(MpegEncContext *s, int shared){
int i;
if(shared){
for(i=0; i<MAX_PICTURE_COUNT; i++){
if(s->picture[i].data[0]==NULL && s->picture[i].type==0) return i;
}
}else{
for(i=0; i<MAX_PICTURE_COUNT; i++){
if(s->picture[i].data[0]... | 13,621 |
qemu | 0d9acba8fddbf970c7353083e6a60b47017ce3e4 | 1 | static void audio_init (PCIBus *pci_bus, qemu_irq *pic)
{
struct soundhw *c;
int audio_enabled = 0;
for (c = soundhw; !audio_enabled && c->name; ++c) {
audio_enabled = c->enabled;
}
if (audio_enabled) {
AudioState *s;
s = AUD_init ();
if (s) {
... | 13,622 |
FFmpeg | 8813d55fa5978660d9f4e7dbe1f50da9922be08d | 0 | static void destroy_buffers(VADisplay display, VABufferID *buffers, unsigned int n_buffers)
{
unsigned int i;
for (i = 0; i < n_buffers; i++) {
if (buffers[i]) {
vaDestroyBuffer(display, buffers[i]);
buffers[i] = 0;
}
}
}
| 13,624 |
qemu | c508277335e3b6b20cf18e6ea3a35c1fa835c64a | 1 | static void vmxnet3_activate_device(VMXNET3State *s)
{
int i;
static const uint32_t VMXNET3_DEF_TX_THRESHOLD = 1;
hwaddr qdescr_table_pa;
uint64_t pa;
uint32_t size;
/* Verify configuration consistency */
if (!vmxnet3_verify_driver_magic(s->drv_shmem)) {
VMW_ERPRN("Device ... | 13,625 |
qemu | 560f19f162529d691619ac69ed032321c7f5f1fb | 1 | bool object_property_get_bool(Object *obj, const char *name,
Error **errp)
{
QObject *ret = object_property_get_qobject(obj, name, errp);
QBool *qbool;
bool retval;
if (!ret) {
return false;
}
qbool = qobject_to_qbool(ret);
if (!qbool) {
... | 13,626 |
FFmpeg | a566c952f905639456966413fee0b5701867ddcd | 1 | static void mpegts_insert_pcr_only(AVFormatContext *s, AVStream *st)
{
MpegTSWrite *ts = s->priv_data;
MpegTSWriteStream *ts_st = st->priv_data;
uint8_t *q;
uint8_t buf[TS_PACKET_SIZE];
q = buf;
*q++ = 0x47;
*q++ = ts_st->pid >> 8;
*q++ = ts_st->pid;
*q++ = 0x20 | ts_s... | 13,627 |
qemu | e801de93d0155c0c14d6b4dea1b3577ca36e214b | 1 | static void disas_extract(DisasContext *s, uint32_t insn)
{
unsupported_encoding(s, insn);
}
| 13,628 |
FFmpeg | f6774f905fb3cfdc319523ac640be30b14c1bc55 | 1 | static int dxva2_mpeg2_end_frame(AVCodecContext *avctx)
{
struct MpegEncContext *s = avctx->priv_data;
struct dxva2_picture_context *ctx_pic =
s->current_picture_ptr->hwaccel_picture_private;
int ret;
if (ctx_pic->slice_count <= 0 || ctx_pic->bitstream_size <= 0)
return -1;
... | 13,629 |
FFmpeg | fb48f825e33c15146b8ce4e5258332ebc4a9b5ea | 1 | static int au_read_header(AVFormatContext *s)
{
int size;
unsigned int tag;
AVIOContext *pb = s->pb;
unsigned int id, channels, rate;
int bps;
enum AVCodecID codec;
AVStream *st;
/* check ".snd" header */
tag = avio_rl32(pb);
if (tag != MKTAG('.', 's', 'n', 'd'))
... | 13,630 |
FFmpeg | c3afa4db913668e50ac8ffc0bc66621664adc1f4 | 1 | static inline void bink_idct_col(DCTELEM *dest, const DCTELEM *src)
{
if ((src[8]|src[16]|src[24]|src[32]|src[40]|src[48]|src[56])==0) {
dest[0] =
dest[8] =
dest[16] =
dest[24] =
dest[32] =
dest[40] =
dest[48] =
dest[56] = src[0];
} el... | 13,631 |
FFmpeg | 96bfb677478514db73d1b63b4213c97ad4269e8f | 1 | static int decode_info_header(NUTContext *nut)
{
AVFormatContext *s = nut->avf;
AVIOContext *bc = s->pb;
uint64_t tmp, chapter_start, chapter_len;
unsigned int stream_id_plus1, count;
int chapter_id, i;
int64_t value, end;
char name[256], str_value[1024], type_str[256];
const... | 13,632 |
qemu | 04097f7c5957273c578f72b9bd603ba6b1d69e33 | 1 | static void vhost_client_set_memory(CPUPhysMemoryClient *client,
target_phys_addr_t start_addr,
ram_addr_t size,
ram_addr_t phys_offset,
bool log_dirty)
{
struct vhos... | 13,633 |
FFmpeg | bc488ec28aec4bc91ba47283c49c9f7f25696eaa | 1 | static int quant_psnr8x8_c(MpegEncContext *s, uint8_t *src1,
uint8_t *src2, ptrdiff_t stride, int h)
{
LOCAL_ALIGNED_16(int16_t, temp, [64 * 2]);
int16_t *const bak = temp + 64;
int sum = 0, i;
av_assert2(h == 8);
s->mb_intra = 0;
s->pdsp.diff_pixels(temp, ... | 13,634 |
qemu | 1d7678dec4761acdc43439da6ceda41a703ba1a6 | 1 | static int vhdx_parse_metadata(BlockDriverState *bs, BDRVVHDXState *s)
{
int ret = 0;
uint8_t *buffer;
int offset = 0;
uint32_t i = 0;
VHDXMetadataTableEntry md_entry;
buffer = qemu_blockalign(bs, VHDX_METADATA_TABLE_MAX_SIZE);
ret = bdrv_pread(bs->file, s->metadata_rt.file_offse... | 13,637 |
qemu | 661e32fb3cb71c7e019daee375be4bb487b9917c | 1 | void virtio_scsi_handle_cmd_vq(VirtIOSCSI *s, VirtQueue *vq)
{
VirtIOSCSIReq *req, *next;
QTAILQ_HEAD(, VirtIOSCSIReq) reqs = QTAILQ_HEAD_INITIALIZER(reqs);
while ((req = virtio_scsi_pop_req(s, vq))) {
if (virtio_scsi_handle_cmd_req_prepare(s, req)) {
QTAILQ_INSERT_TAIL(&reqs, re... | 13,638 |
qemu | 8caff63699a9bd6b82556bd527ff023c443ada2d | 1 | static void mch_realize(PCIDevice *d, Error **errp)
{
int i;
MCHPCIState *mch = MCH_PCI_DEVICE(d);
/* setup pci memory mapping */
pc_pci_as_mapping_init(OBJECT(mch), mch->system_memory,
mch->pci_address_space);
/* smram */
cpu_smm_register(&mch_set_smm, mch... | 13,639 |
FFmpeg | f5ba67ee1342b7741200ff637fc3ea3387b68a1b | 0 | static uint64_t calc_rice_params(RiceContext *rc, int pmin, int pmax,
int32_t *data, int n, int pred_order)
{
int i;
uint64_t bits[MAX_PARTITION_ORDER+1];
int opt_porder;
RiceContext tmp_rc;
uint32_t *udata;
uint64_t sums[MAX_PARTITION_ORDER + 1][MAX_PART... | 13,640 |
FFmpeg | 5eb765ef341c3ec1bea31914c897750f88476ede | 1 | static int handle_http(HTTPContext *c, long cur_time)
{
int len;
switch(c->state) {
case HTTPSTATE_WAIT_REQUEST:
/* timeout ? */
if ((c->timeout - cur_time) < 0)
return -1;
if (c->poll_entry->revents & (POLLERR | POLLHUP))
return -1;
... | 13,641 |
FFmpeg | ad5807f8aa883bee5431186dc1f24c5435d722d3 | 1 | static int bfi_read_header(AVFormatContext * s)
{
BFIContext *bfi = s->priv_data;
AVIOContext *pb = s->pb;
AVStream *vstream;
AVStream *astream;
int fps, chunk_header;
/* Initialize the video codec... */
vstream = avformat_new_stream(s, NULL);
if (!vstream)
return AVE... | 13,642 |
qemu | c804c2a71752dd1e150cde768d8c54b02fa8bad9 | 1 | static int event_qdev_init(DeviceState *qdev)
{
SCLPEvent *event = DO_UPCAST(SCLPEvent, qdev, qdev);
SCLPEventClass *child = SCLP_EVENT_GET_CLASS(event);
return child->init(event);
}
| 13,643 |
qemu | 697ab892786d47008807a49f57b2fd86adfcd098 | 1 | static void gen_rfid(DisasContext *ctx)
{
#if defined(CONFIG_USER_ONLY)
gen_inval_exception(ctx, POWERPC_EXCP_PRIV_OPC);
#else
/* Restore CPU state */
if (unlikely(!ctx->mem_idx)) {
gen_inval_exception(ctx, POWERPC_EXCP_PRIV_OPC);
return;
}
gen_helper_rfid();
gen_sync... | 13,644 |
qemu | e9a07334fb6ee08ddd61787c102d36e7e781efef | 1 | static void vga_update_text(void *opaque, console_ch_t *chardata)
{
VGACommonState *s = opaque;
int graphic_mode, i, cursor_offset, cursor_visible;
int cw, cheight, width, height, size, c_min, c_max;
uint32_t *src;
console_ch_t *dst, val;
char msg_buffer[80];
int full_update = 0;
if (!(... | 13,645 |
FFmpeg | b12d92efd6c0d48665383a9baecc13e7ebbd8a22 | 1 | static int decode_frame(AVCodecContext *avctx, void *data,
int *got_frame_ptr, AVPacket *pkt)
{
SANMVideoContext *ctx = avctx->priv_data;
int i, ret;
bytestream2_init(&ctx->gb, pkt->data, pkt->size);
if (ctx->output->data[0])
avctx->release_buffer(avctx, ctx->out... | 13,646 |
qemu | 06b106889a09277617fc8c542397a9f595ee605a | 1 | static RAMBlock *unqueue_page(RAMState *rs, ram_addr_t *offset,
ram_addr_t *ram_addr_abs)
{
RAMBlock *block = NULL;
qemu_mutex_lock(&rs->src_page_req_mutex);
if (!QSIMPLEQ_EMPTY(&rs->src_page_requests)) {
struct RAMSrcPageRequest *entry =
... | 13,647 |
FFmpeg | 7b46add7257628bffac96d3002308d1f9e1ed172 | 0 | static int bands_dist(OpusPsyContext *s, CeltFrame *f, float *total_dist)
{
int i, tdist = 0.0f;
OpusRangeCoder dump;
ff_opus_rc_enc_init(&dump);
ff_celt_enc_bitalloc(f, &dump);
for (i = 0; i < CELT_MAX_BANDS; i++) {
float bits = 0.0f;
float dist = f->pvq->band_cost(f->pv... | 13,650 |
FFmpeg | f929ab0569ff31ed5a59b0b0adb7ce09df3fca39 | 0 | static inline void apply_motion_generic(RoqContext *ri, int x, int y, int deltax,
int deltay, int sz)
{
int mx, my, cp;
mx = x + deltax;
my = y + deltay;
/* check MV against frame boundaries */
if ((mx < 0) || (mx > ri->width - sz) ||
(my <... | 13,651 |
qemu | f3cdcbaee16d32b52d5015a8b1e8ddf5a27f7089 | 1 | QGuestAllocator *pc_alloc_init(void)
{
PCAlloc *s = g_malloc0(sizeof(*s));
uint64_t ram_size;
QFWCFG *fw_cfg = pc_fw_cfg_init();
s->alloc.alloc = pc_alloc;
s->alloc.free = pc_free;
ram_size = qfw_cfg_get_u64(fw_cfg, FW_CFG_RAM_SIZE);
/* Start at 1MB */
s->start = 1 << 20;
/* Respect ... | 13,652 |
FFmpeg | ea71a48c7e8a76ee447fa518cca087df9288288d | 1 | static int update_error_limit(WavpackFrameContext *ctx)
{
int i, br[2], sl[2];
for (i = 0; i <= ctx->stereo_in; i++) {
if (ctx->ch[i].bitrate_acc > UINT_MAX - ctx->ch[i].bitrate_delta)
return AVERROR_INVALIDDATA;
ctx->ch[i].bitrate_acc += ctx->ch[i].bitrate_delta;
br... | 13,653 |
qemu | 0b8b8753e4d94901627b3e86431230f2319215c4 | 1 | static void bdrv_co_io_em_complete(void *opaque, int ret)
{
CoroutineIOCompletion *co = opaque;
co->ret = ret;
qemu_coroutine_enter(co->coroutine, NULL);
}
| 13,654 |
qemu | 7337c6eb98786372cdbfe7ebe7affbd166fdc7ca | 1 | void HELPER(diag)(CPUS390XState *env, uint32_t r1, uint32_t r3, uint32_t num)
{
uint64_t r;
switch (num) {
case 0x500:
/* KVM hypercall */
r = s390_virtio_hypercall(env);
break;
case 0x44:
/* yield */
r = 0;
break;
case 0x308:
... | 13,655 |
qemu | d6c1a327a94437f0ed74ba970b97fd962462bc77 | 1 | static uint32_t fdctrl_read_data (fdctrl_t *fdctrl)
{
fdrive_t *cur_drv;
uint32_t retval = 0;
int pos, len;
cur_drv = get_cur_drv(fdctrl);
fdctrl->state &= ~FD_CTRL_SLEEP;
if (FD_STATE(fdctrl->data_state) == FD_STATE_CMD) {
FLOPPY_ERROR("can't read data in CMD state\n");
... | 13,656 |
qemu | 46e3f30e3c81e23c07f16b2193dfb6928646c205 | 1 | static void scsi_dma_complete(void *opaque, int ret)
{
SCSIDiskReq *r = (SCSIDiskReq *)opaque;
SCSIDiskState *s = DO_UPCAST(SCSIDiskState, qdev, r->req.dev);
if (r->req.aiocb != NULL) {
r->req.aiocb = NULL;
bdrv_acct_done(s->qdev.conf.bs, &r->acct);
}
if (ret < 0) {
... | 13,657 |
qemu | cd072e01d86b3d7adab35de03d242e3938e798df | 1 | static inline void validate_seg(int seg_reg, int cpl)
{
int dpl;
uint32_t e2;
e2 = env->segs[seg_reg].flags;
dpl = (e2 >> DESC_DPL_SHIFT) & 3;
if (!(e2 & DESC_CS_MASK) || !(e2 & DESC_C_MASK)) {
/* data or non conforming code segment */
if (dpl < cpl) {
cpu_... | 13,658 |
qemu | 586d2142a9f1aa5a1dceb0941e7b3f0953974a8b | 1 | static void realize(DeviceState *d, Error **errp)
{
sPAPRDRConnector *drc = SPAPR_DR_CONNECTOR(d);
sPAPRDRConnectorClass *drck = SPAPR_DR_CONNECTOR_GET_CLASS(drc);
Object *root_container;
char link_name[256];
gchar *child_name;
Error *err = NULL;
DPRINTFN("drc realize: %x", drck->g... | 13,659 |
qemu | 581fe784c3adf85dc167a47a4a60fd1245a98217 | 1 | connect_to_qemu(
const char *host,
const char *port
) {
struct addrinfo hints;
struct addrinfo *server;
int ret, sock;
sock = qemu_socket(AF_INET, SOCK_STREAM, 0);
if (sock < 0) {
/* Error */
fprintf(stderr, "Error opening socket!\n");
return -1;
}
... | 13,661 |
FFmpeg | f6774f905fb3cfdc319523ac640be30b14c1bc55 | 1 | void ff_init_block_index(MpegEncContext *s){ //FIXME maybe rename
const int linesize = s->current_picture.f.linesize[0]; //not s->linesize as this would be wrong for field pics
const int uvlinesize = s->current_picture.f.linesize[1];
const int mb_size= 4;
s->block_index[0]= s->b8_stride*(s->mb_y... | 13,662 |
qemu | 3786cff5eb384d058395a2729af627fa3253d056 | 1 | static void virtio_net_class_init(ObjectClass *klass, void *data)
{
DeviceClass *dc = DEVICE_CLASS(klass);
VirtioDeviceClass *vdc = VIRTIO_DEVICE_CLASS(klass);
dc->exit = virtio_net_device_exit;
dc->props = virtio_net_properties;
set_bit(DEVICE_CATEGORY_NETWORK, dc->categories);
vdc->init... | 13,663 |
FFmpeg | 8bedbb82cee4463a43e60eb22674c8bf927280ef | 1 | static int decode_tile(Jpeg2000DecoderContext *s, Jpeg2000Tile *tile)
{
int compno, reslevelno, bandno;
int x, y;
uint8_t *line;
Jpeg2000T1Context t1;
/* Loop on tile components */
for (compno = 0; compno < s->ncomponents; compno++) {
Jpeg2000Component *comp = tile->comp + ... | 13,664 |
qemu | c6d2283068026035a6468aae9dcde953bd7521ac | 1 | int bdrv_write_compressed(BlockDriverState *bs, int64_t sector_num,
const uint8_t *buf, int nb_sectors)
{
BlockDriver *drv = bs->drv;
if (!drv)
return -ENOMEDIUM;
if (!drv->bdrv_write_compressed)
return -ENOTSUP;
if (bdrv_check_request(bs, sector_num, nb... | 13,665 |
qemu | ce5b1bbf624b977a55ff7f85bb3871682d03baff | 1 | static void moxie_cpu_class_init(ObjectClass *oc, void *data)
{
DeviceClass *dc = DEVICE_CLASS(oc);
CPUClass *cc = CPU_CLASS(oc);
MoxieCPUClass *mcc = MOXIE_CPU_CLASS(oc);
mcc->parent_realize = dc->realize;
dc->realize = moxie_cpu_realizefn;
mcc->parent_reset = cc->reset;
cc->res... | 13,666 |
FFmpeg | 30f680ee0a2707af9a649a0aa3fd951d18a25c05 | 1 | static int vc1_decode_sprites(VC1Context *v, GetBitContext* gb)
{
int ret;
MpegEncContext *s = &v->s;
AVCodecContext *avctx = s->avctx;
SpriteData sd;
memset(&sd, 0, sizeof(sd));
ret = vc1_parse_sprites(v, gb, &sd);
if (ret < 0)
return ret;
if (!s->current_pic... | 13,668 |
FFmpeg | 6e42e6c4b410dbef8b593c2d796a5dad95f89ee4 | 1 | yuv2yuvX_altivec_real(int16_t *lumFilter, int16_t **lumSrc, int lumFilterSize,
int16_t *chrFilter, int16_t **chrSrc, int chrFilterSize,
uint8_t *dest, uint8_t *uDest, uint8_t *vDest, int dstW, int chrDstW)
{
const vector signed int vini = {(1 << 18), (1 << 18), (1 << 18), (1 << 18)};
register i... | 13,669 |
qemu | a32354e206895400d17c3de9a8df1de96d3df289 | 1 | static void m5206_mbar_writeb(void *opaque, target_phys_addr_t offset,
uint32_t value)
{
m5206_mbar_state *s = (m5206_mbar_state *)opaque;
int width;
offset &= 0x3ff;
if (offset > 0x200) {
hw_error("Bad MBAR write offset 0x%x", (int)offset);
}
width... | 13,670 |
qemu | fbaa6bb3d3b4be71b7e234e908cb3c6bd280a222 | 1 | static bool is_zero_sectors(BlockDriverState *bs, int64_t start,
uint32_t count)
{
int nr;
BlockDriverState *file;
int64_t res;
if (!count) {
return true;
res = bdrv_get_block_status_above(bs, NULL, start, count,
&nr, &file);
... | 13,671 |
FFmpeg | e3ba817b95bbdc7c8aaf83b4a6804d1b49eb4de4 | 1 | static void mxf_write_multi_descriptor(AVFormatContext *s)
{
MXFContext *mxf = s->priv_data;
AVIOContext *pb = s->pb;
const uint8_t *ul;
int i;
mxf_write_metadata_key(pb, 0x014400);
PRINT_KEY(s, "multiple descriptor key", pb->buf_ptr - 16);
klv_encode_ber_length(pb, 64 + 16 * s->nb... | 13,674 |
qemu | d5a8ee60a0fbc20a2c2d02f3bda1bb1bd365f1ee | 1 | BlockDeviceInfo *bdrv_block_device_info(BlockDriverState *bs)
{
BlockDeviceInfo *info = g_malloc0(sizeof(*info));
info->file = g_strdup(bs->filename);
info->ro = bs->read_only;
info->drv = g_strdup(bs->drv->format_name);
info->encrypte... | 13,675 |
qemu | b310a2a6095ec927a42cc1aba520a316be0faf51 | 1 | void gtk_display_init(DisplayState *ds, bool full_screen, bool grab_on_hover)
{
GtkDisplayState *s = g_malloc0(sizeof(*s));
char *filename;
gtk_init(NULL, NULL);
s->window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
#if GTK_CHECK_VERSION(3, 2, 0)
s->vbox = gtk_box_new(GTK_ORIENTATION_VERTICAL,... | 13,676 |
FFmpeg | e01b19deceaafa2b7a9d59717484d8831b00cd71 | 0 | static int analyze(const uint8_t *buf, int size, int packet_size,
int probe)
{
int stat[TS_MAX_PACKET_SIZE];
int stat_all = 0;
int i;
int best_score = 0;
memset(stat, 0, packet_size * sizeof(*stat));
for (i = 0; i < size - 3; i++) {
if (buf[i] == 0x47 &&
... | 13,677 |
FFmpeg | 03a9e6ff303ad82e75b734edbe4917ca5fd60159 | 1 | static void get_tree_codes(uint32_t *bits, int16_t *lens, uint8_t *xlat,
Node *nodes, int node,
uint32_t pfx, int pl, int *pos)
{
int s;
s = nodes[node].sym;
if (s != -1) {
bits[*pos] = (~pfx) & ((1U << FFMAX(pl, 1)) - 1);
lens[... | 13,679 |
FFmpeg | fb45de779c8db142b44bf7b00c535ea2eee4f148 | 0 | static int nprobe(AVFormatContext *s, uint8_t *enc_header, unsigned size,
const uint8_t *n_val)
{
OMAContext *oc = s->priv_data;
uint64_t pos;
uint32_t taglen, datalen;
struct AVDES av_des;
if (!enc_header || !n_val ||
size < OMA_ENC_HEADER_SIZE + oc->k_size + 4)
... | 13,680 |
FFmpeg | 3b9dd906d18f4cd801ceedd20d800a7e53074be9 | 0 | static void fill_block(uint16_t *pdest, uint16_t color, int block_size, int pitch)
{
int x, y;
pitch -= block_size;
for (y = 0; y != block_size; y++, pdest += pitch)
for (x = 0; x != block_size; x++)
*pdest++ = color;
}
| 13,681 |
FFmpeg | 74bd0cf49c9c0bee8d4f3d3a98a7343c2ff5b94c | 0 | static void ini_print_section_header(WriterContext *wctx)
{
INIContext *ini = wctx->priv;
AVBPrint buf;
int i;
const struct section *section = wctx->section[wctx->level];
const struct section *parent_section = wctx->level ?
wctx->section[wctx->level-1] : NULL;
av_bprint_init(&b... | 13,682 |
qemu | 09cd058a2cf77bb7a3b10ff93c1f80ed88bca364 | 1 | static int vtd_interrupt_remap_msi(IntelIOMMUState *iommu,
MSIMessage *origin,
MSIMessage *translated)
{
int ret = 0;
VTD_IR_MSIAddress addr;
uint16_t index;
VTDIrq irq = {0};
assert(origin && translated);
if (!io... | 13,684 |
FFmpeg | 042ef4b720f5d3321d9b7eeeb2067c671d5aeefd | 1 | static int decode_mb_cabac(H264Context *h) {
MpegEncContext * const s = &h->s;
const int mb_xy= s->mb_x + s->mb_y*s->mb_stride;
int mb_type, partition_count, cbp = 0;
int dct8x8_allowed= h->pps.transform_8x8_mode;
s->dsp.clear_blocks(h->mb); //FIXME avoid if already clear (move after skip han... | 13,685 |
FFmpeg | 74699ac8c8b562e9f8d26e21482b89585365774a | 0 | static int mjpegb_decode_frame(AVCodecContext *avctx,
void *data, int *data_size,
AVPacket *avpkt)
{
const uint8_t *buf = avpkt->data;
int buf_size = avpkt->size;
MJpegDecodeContext *s = avctx->priv_data;
const uint8_t *buf_end, *buf_ptr... | 13,686 |
qemu | 1760048a5d21bacf0e4838da2f61b2d8db7d2866 | 1 | static void test_ivshmem_single(void)
{
IVState state, *s;
uint32_t data[1024];
int i;
setup_vm(&state);
s = &state;
/* valid io */
out_reg(s, INTRMASK, 0);
in_reg(s, INTRSTATUS);
in_reg(s, IVPOSITION);
out_reg(s, INTRMASK, 0xffffffff);
g_assert_cmpuint(in_r... | 13,687 |
FFmpeg | e4bc8af1e687efb2a2c41a469ac7b31f1c3d48cd | 1 | static int mov_read_stsz(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
{
AVStream *st;
MOVStreamContext *sc;
unsigned int i, entries, sample_size, field_size, num_bytes;
GetBitContext gb;
unsigned char* buf;
if (c->fc->nb_streams < 1)
return 0;
st = c->fc->streams[c->fc-... | 13,688 |
FFmpeg | 42868ca569f33b91b0e61ecc3065e7199e9ca58a | 1 | static void init_band_stepsize(AVCodecContext *avctx,
Jpeg2000Band *band,
Jpeg2000CodingStyle *codsty,
Jpeg2000QuantStyle *qntsty,
int bandno, int gbandno, int reslevelno,
... | 13,689 |
FFmpeg | 085ca7dcdbf9ab6c23e3a5397b1f6d4aa23f763d | 1 | static int teletext_init_decoder(AVCodecContext *avctx)
{
TeletextContext *ctx = avctx->priv_data;
unsigned int maj, min, rev;
vbi_version(&maj, &min, &rev);
if (!(maj > 0 || min > 2 || min == 2 && rev >= 26)) {
av_log(avctx, AV_LOG_ERROR, "decoder needs zvbi version >= 0.2.26.\n");
... | 13,690 |
qemu | 4172a00373b2c81374293becc02b16b7f8c76659 | 1 | static void block_job_ref(BlockJob *job)
{
++job->refcnt;
}
| 13,691 |
qemu | aec4b054ea36c53c8b887da99f20010133b84378 | 1 | static void empty_input(void)
{
const char *empty = "";
QObject *obj = qobject_from_json(empty, NULL);
g_assert(obj == NULL);
}
| 13,692 |
qemu | 8786db7cb96f8ce5c75c6e1e074319c9dca8d356 | 1 | static FlatRange *address_space_lookup(AddressSpace *as, AddrRange addr)
{
return bsearch(&addr, as->current_map.ranges, as->current_map.nr,
sizeof(FlatRange), cmp_flatrange_addr);
}
| 13,693 |
FFmpeg | ea3abcd58f83673bf2fe28170339f19ddf683442 | 1 | void ff_get_guid(AVIOContext *s, ff_asf_guid *g)
{
assert(sizeof(*g) == 16);
avio_read(s, *g, sizeof(*g));
}
| 13,694 |
qemu | 7453c96b78c2b09aa72924f933bb9616e5474194 | 1 | static int realloc_refcount_array(BDRVQcowState *s, uint16_t **array,
int64_t *size, int64_t new_size)
{
size_t old_byte_size, new_byte_size;
uint16_t *new_ptr;
/* Round to clusters so the array can be directly written to disk */
old_byte_size = size_to_clusters... | 13,695 |
FFmpeg | 44f1698a3824836d32708ae93e78ac1f2310a07e | 1 | static void imdct36(int *out, int *buf, int *in, int *win)
{
int i, j, t0, t1, t2, t3, s0, s1, s2, s3;
int tmp[18], *tmp1, *in1;
for(i=17;i>=1;i--)
in[i] += in[i-1];
for(i=17;i>=3;i-=2)
in[i] += in[i-2];
for(j=0;j<2;j++) {
tmp1 = tmp + j;
in1 = in + j;
... | 13,696 |
qemu | 34779e8c3991f7fcd74b2045478abcef67dbeb15 | 1 | static void test_tco_second_timeout_none(void)
{
TestData td;
const uint16_t ticks = TCO_SECS_TO_TICKS(256);
QDict *ad;
td.args = "-watchdog-action none";
td.noreboot = false;
test_init(&td);
stop_tco(&td);
clear_tco_status(&td);
reset_on_second_timeout(true);
set_... | 13,697 |
FFmpeg | 09b23786b3986502ee88d4907356979127169bdd | 1 | static void pcx_palette(const uint8_t **src, uint32_t *dst,
unsigned int pallen)
{
unsigned int i;
for (i = 0; i < pallen; i++)
*dst++ = bytestream_get_be24(src);
if (pallen < 256)
memset(dst, 0, (256 - pallen) * sizeof(*dst));
}
| 13,698 |
qemu | bbdd2ad0814ea0911076419ea21b7957505cf1cc | 1 | int qemu_set_fd_handler2(int fd,
IOCanReadHandler *fd_read_poll,
IOHandler *fd_read,
IOHandler *fd_write,
void *opaque)
{
IOHandlerRecord *ioh;
if (!fd_read && !fd_write) {
QLIST_FOREACH(ioh, &io_handlers... | 13,699 |
qemu | 0b8b8753e4d94901627b3e86431230f2319215c4 | 1 | static int bdrv_prwv_co(BdrvChild *child, int64_t offset,
QEMUIOVector *qiov, bool is_write,
BdrvRequestFlags flags)
{
Coroutine *co;
RwCo rwco = {
.child = child,
.offset = offset,
.qiov = qiov,
.is_write = is_write,
... | 13,700 |
qemu | 0188fadb7fe460d8c4c743372b1f7b25773e183e | 1 | static void setup_frame(int sig, struct target_sigaction *ka,
target_sigset_t *set, CPUM68KState *env)
{
struct target_sigframe *frame;
abi_ulong frame_addr;
abi_ulong retcode_addr;
abi_ulong sc_addr;
int err = 0;
int i;
frame_addr = get_sigframe(ka, env, s... | 13,701 |
qemu | 14a10fc39923b3af07c8c46d22cb20843bee3a72 | 1 | static void openrisc_cpu_realizefn(DeviceState *dev, Error **errp)
{
OpenRISCCPU *cpu = OPENRISC_CPU(dev);
OpenRISCCPUClass *occ = OPENRISC_CPU_GET_CLASS(dev);
cpu_reset(CPU(cpu));
occ->parent_realize(dev, errp);
}
| 13,702 |
qemu | df8bf7a7fe75eb5d5caffa55f5cd4292b757aea6 | 1 | void net_rx_pkt_attach_iovec(struct NetRxPkt *pkt,
const struct iovec *iov, int iovcnt,
size_t iovoff, bool strip_vlan)
{
uint16_t tci = 0;
uint16_t ploff = iovoff;
assert(pkt);
pkt->vlan_stripped = false;
if (strip_vlan) {
... | 13,703 |
FFmpeg | c3ab0004ae4dffc32494ae84dd15cfaa909a7884 | 1 | static inline void RENAME(yuy2ToUV)(uint8_t *dstU, uint8_t *dstV, const uint8_t *src1, const uint8_t *src2, int width, uint32_t *unused)
{
#if COMPILE_TEMPLATE_MMX
__asm__ volatile(
"movq "MANGLE(bm01010101)", %%mm4 \n\t"
"mov %0, %%"REG_a" \n\t"
"1: ... | 13,704 |
qemu | e04fb07fd1676e9facd7f3f878c1bbe03bccd26b | 1 | static void qemu_rbd_complete_aio(RADOSCB *rcb)
{
RBDAIOCB *acb = rcb->acb;
int64_t r;
r = rcb->ret;
if (acb->cmd != RBD_AIO_READ) {
if (r < 0) {
acb->ret = r;
acb->error = 1;
} else if (!acb->error) {
acb->ret = rcb->size;
}
... | 13,705 |
qemu | a1f0cce2ac0243572ff72aa561da67fe3766a395 | 1 | static void scsi_disk_set_sense(SCSIDiskState *s, uint8_t key)
{
s->sense.key = key;
}
| 13,707 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.