project stringclasses 2
values | commit_id stringlengths 40 40 | target int64 0 1 | func stringlengths 26 142k | idx int64 0 27.3k |
|---|---|---|---|---|
qemu | a8170e5e97ad17ca169c64ba87ae2f53850dab4c | 0 | static void isa_mmio_writeb (void *opaque, target_phys_addr_t addr,
uint32_t val)
{
cpu_outb(addr & IOPORTS_MASK, val);
}
| 4,545 |
qemu | ad674e53b5cce265fadafbde2c6a4f190345cd00 | 0 | static void kill_channel(DBDMA_channel *ch)
{
DBDMA_DPRINTF("kill_channel\n");
ch->regs[DBDMA_STATUS] |= cpu_to_be32(DEAD);
ch->regs[DBDMA_STATUS] &= cpu_to_be32(~ACTIVE);
qemu_irq_raise(ch->irq);
}
| 4,546 |
qemu | 5b956f415a356449a4171d5e0c7d9a25bbc84b5a | 0 | static void scsi_do_read(SCSIDiskReq *r, int ret)
{
SCSIDiskState *s = DO_UPCAST(SCSIDiskState, qdev, r->req.dev);
SCSIDiskClass *sdc = (SCSIDiskClass *) object_get_class(OBJECT(s));
assert (r->req.aiocb == NULL);
if (r->req.io_canceled) {
scsi_req_cancel_complete(&r->req);
go... | 4,547 |
qemu | e81a982aa5398269a2cc344091ffa4930bdd242f | 0 | static inline void _cpu_ppc_store_hdecr(PowerPCCPU *cpu, uint32_t hdecr,
uint32_t value, int is_excp)
{
ppc_tb_t *tb_env = cpu->env.tb_env;
if (tb_env->hdecr_timer != NULL) {
__cpu_ppc_store_decr(cpu, &tb_env->hdecr_next, tb_env->hdecr_timer,
... | 4,548 |
qemu | d5d1507b347b7cd6c3b82459b96f1889b29939ef | 0 | static void readline_printf_func(void *opaque, const char *fmt, ...)
{
va_list ap;
va_start(ap, fmt);
vprintf(fmt, ap);
va_end(ap);
}
| 4,549 |
qemu | cdd5cc12ba8cf0c068da319370bdd3ba45eaf7ac | 0 | static ssize_t virtio_net_receive(VLANClientState *vc, const uint8_t *buf, size_t size)
{
VirtIONet *n = vc->opaque;
struct virtio_net_hdr_mrg_rxbuf *mhdr = NULL;
size_t hdr_len, offset, i;
if (!do_virtio_net_can_receive(n, size))
return 0;
if (!receive_filter(n, buf, size))
... | 4,550 |
qemu | d0d7708ba29cbcc343364a46bff981e0ff88366f | 0 | static CharDriverState *text_console_init(ChardevVC *vc, Error **errp)
{
CharDriverState *chr;
QemuConsole *s;
unsigned width = 0;
unsigned height = 0;
chr = qemu_chr_alloc();
if (vc->has_width) {
width = vc->width;
} else if (vc->has_cols) {
width = vc->cols * ... | 4,552 |
qemu | 95d729835f3ceeed977eaf326a7ebb92788dee6d | 0 | static int vhdx_log_flush(BlockDriverState *bs, BDRVVHDXState *s,
VHDXLogSequence *logs)
{
int ret = 0;
int i;
uint32_t cnt, sectors_read;
uint64_t new_file_size;
void *data = NULL;
int64_t file_length;
VHDXLogDescEntries *desc_entries = NULL;
VHDXLogE... | 4,553 |
FFmpeg | cc229d4e83889d1298f1a0863b55feec6c5c339a | 0 | int ff_intel_h263_decode_picture_header(MpegEncContext *s)
{
int format;
/* picture header */
if (get_bits_long(&s->gb, 22) != 0x20) {
av_log(s->avctx, AV_LOG_ERROR, "Bad picture start code\n");
return -1;
}
s->picture_number = get_bits(&s->gb, 8); /* picture timestamp */
... | 4,554 |
qemu | 958c717df97ea9ca47a2253b8371130fe5f22980 | 0 | static ssize_t nbd_co_send_reply(NBDRequest *req, struct nbd_reply *reply,
int len)
{
NBDClient *client = req->client;
int csock = client->sock;
ssize_t rc, ret;
qemu_co_mutex_lock(&client->send_lock);
qemu_set_fd_handler2(csock, nbd_can_read, nbd_read,
... | 4,558 |
qemu | 1964a397063967acc5ce71a2a24ed26e74824ee1 | 0 | int64_t qemu_file_set_rate_limit(QEMUFile *f, int64_t new_rate)
{
/* any failed or completed migration keeps its state to allow probing of
* migration data, but has no associated file anymore */
if (f && f->ops->set_rate_limit)
return f->ops->set_rate_limit(f->opaque, new_rate);
return ... | 4,559 |
qemu | a8170e5e97ad17ca169c64ba87ae2f53850dab4c | 0 | static uint64_t lance_mem_read(void *opaque, target_phys_addr_t addr,
unsigned size)
{
SysBusPCNetState *d = opaque;
uint32_t val;
val = pcnet_ioport_readw(&d->state, addr);
trace_lance_mem_readw(addr, val & 0xffff);
return val & 0xffff;
}
| 4,560 |
qemu | 77e8b9ca64e85d3d309f322410964b7852ec091e | 0 | int tcp_socket_outgoing_opts(QemuOpts *opts)
{
Error *local_err = NULL;
int fd = inet_connect_opts(opts, &local_err, NULL, NULL);
if (local_err != NULL) {
qerror_report_err(local_err);
error_free(local_err);
}
return fd;
}
| 4,561 |
qemu | 4be746345f13e99e468c60acbd3a355e8183e3ce | 0 | static inline int onenand_prog_spare(OneNANDState *s, int sec, int secn,
void *src)
{
int result = 0;
if (secn > 0) {
const uint8_t *sp = (const uint8_t *)src;
uint8_t *dp = 0, *dpp = 0;
if (s->bdrv_cur) {
dp = g_malloc(512);
if (!dp || bd... | 4,562 |
qemu | b0fd8d18683f0d77a8e6b482771ebea82234d727 | 0 | static void setup_rt_frame(int sig, struct target_sigaction *ka,
target_siginfo_t *info,
target_sigset_t *set, CPUM68KState *env)
{
struct target_rt_sigframe *frame;
abi_ulong frame_addr;
abi_ulong retcode_addr;
abi_ulong info_addr;
abi_u... | 4,564 |
FFmpeg | 9888ffb1ce5e0a17f711b01933d504c72ea29d3b | 0 | static int mov_read_stsz(MOVContext *c, AVIOContext *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->n... | 4,565 |
qemu | 5dafc53f1fb091d242f2179ffcb43bb28af36d1e | 0 | static QEMUFile *qemu_fopen_bdrv(BlockDriverState *bs, int64_t offset, int is_writable)
{
QEMUFile *f;
f = qemu_mallocz(sizeof(QEMUFile));
if (!f)
return NULL;
f->is_file = 0;
f->bs = bs;
f->is_writable = is_writable;
f->base_offset = offset;
return f;
}
| 4,566 |
qemu | 22d67ab55aad82383a0e5628b902a1a0556b2fc9 | 0 | static void virtio_setup(void)
{
struct irb irb;
int i;
int r;
bool found = false;
blk_schid.one = 1;
for (i = 0; i < 0x10000; i++) {
blk_schid.sch_no = i;
r = tsch(blk_schid, &irb);
if (r != 3) {
if (virtio_is_blk(blk_schid)) {
... | 4,567 |
qemu | 0d6ff71ae3c7ac3a446d295ef71884a05093b37c | 0 | int if_encap(Slirp *slirp, struct mbuf *ifm)
{
uint8_t buf[1600];
struct ethhdr *eh = (struct ethhdr *)buf;
uint8_t ethaddr[ETH_ALEN];
const struct ip *iph = (const struct ip *)ifm->m_data;
int ret;
if (ifm->m_len + ETH_HLEN > sizeof(buf)) {
return 1;
}
switch (iph-... | 4,568 |
qemu | 72cf2d4f0e181d0d3a3122e04129c58a95da713e | 0 | static void fill_thread_info(struct elf_note_info *info, const CPUState *env)
{
TaskState *ts = (TaskState *)env->opaque;
struct elf_thread_status *ets;
ets = qemu_mallocz(sizeof (*ets));
ets->num_notes = 1; /* only prstatus is dumped */
fill_prstatus(&ets->prstatus, ts, 0);
elf_core_co... | 4,572 |
qemu | 2c62f08ddbf3fa80dc7202eb9a2ea60ae44e2cc5 | 0 | static void omap_screen_dump(void *opaque, const char *filename, bool cswitch,
Error **errp)
{
struct omap_lcd_panel_s *omap_lcd = opaque;
DisplaySurface *surface = qemu_console_surface(omap_lcd->con);
omap_update_display(opaque);
if (omap_lcd && surface_data(surface... | 4,573 |
qemu | 549e9bcabc2f5b37b0be8c24257e0b527bffb49a | 0 | static void con_disconnect(struct XenDevice *xendev)
{
struct XenConsole *con = container_of(xendev, struct XenConsole, xendev);
if (!xendev->dev) {
return;
}
if (con->chr) {
qemu_chr_add_handlers(con->chr, NULL, NULL, NULL, NULL);
qemu_chr_fe_release(con->chr);
}
... | 4,574 |
FFmpeg | 488a0fa68973d48e264d54f1722f7afb18afbea7 | 0 | static int configure_input_video_filter(FilterGraph *fg, InputFilter *ifilter,
AVFilterInOut *in)
{
AVFilterContext *last_filter;
const AVFilter *buffer_filt = avfilter_get_by_name("buffer");
InputStream *ist = ifilter->ist;
InputFile *f = input_files[is... | 4,576 |
FFmpeg | 2aab7c2dfaca4386c38e5d565cd2bf73096bcc86 | 0 | void ff_put_h264_qpel16_mc33_msa(uint8_t *dst, const uint8_t *src,
ptrdiff_t stride)
{
avc_luma_hv_qrt_16w_msa(src + stride - 2,
src - (stride * 2) +
sizeof(uint8_t), stride, dst, stride, 16);
}
| 4,577 |
qemu | 546a7dc40e8b8b6440a052e2b5cdfe9aadcaccf6 | 1 | int qcow2_backing_read1(BlockDriverState *bs, QEMUIOVector *qiov,
int64_t offset, int bytes)
{
uint64_t bs_size = bs->total_sectors * BDRV_SECTOR_SIZE;
int n1;
if ((offset + bytes) <= bs_size) {
return bytes;
}
if (offset >= bs_size) {
n1 = 0;
... | 4,579 |
qemu | 4715d42efe8632b0f9d2594a80e917de45e4ef88 | 1 | static void property_get_bool(Object *obj, Visitor *v, void *opaque,
const char *name, Error **errp)
{
BoolProperty *prop = opaque;
bool value;
value = prop->get(obj, errp);
visit_type_bool(v, &value, name, errp);
}
| 4,581 |
FFmpeg | e77ddd31a8e14bcf5eccd6008d866ae90b4b0d4c | 1 | static int read_header(ShortenContext *s)
{
int i, ret;
int maxnlpc = 0;
/* shorten signature */
if (get_bits_long(&s->gb, 32) != AV_RB32("ajkg")) {
av_log(s->avctx, AV_LOG_ERROR, "missing shorten magic 'ajkg'\n");
s->lpcqoffset = 0;
s->blocksize = DEFAULT_BLOCK_SIZE... | 4,582 |
FFmpeg | d7e14c0d103a2c9cca6c50568e09b40d6f48ea19 | 0 | int avcodec_get_pix_fmt_loss(enum PixelFormat dst_pix_fmt, enum PixelFormat src_pix_fmt,
int has_alpha)
{
const PixFmtInfo *pf, *ps;
const AVPixFmtDescriptor *src_desc = &av_pix_fmt_descriptors[src_pix_fmt];
const AVPixFmtDescriptor *dst_desc = &av_pix_fmt_descriptors[dst_p... | 4,584 |
FFmpeg | e91ba2efa949470e9157b652535d207a101f91e0 | 0 | static void svq1_parse_string(GetBitContext *bitbuf, uint8_t *out)
{
uint8_t seed;
int i;
out[0] = get_bits(bitbuf, 8);
seed = string_table[out[0]];
for (i = 1; i <= out[0]; i++) {
out[i] = get_bits(bitbuf, 8) ^ seed;
seed = string_table[out[i] ^ seed];
}
}
| 4,585 |
FFmpeg | 80f955c90867561dcce769216bc497e13281eb38 | 0 | static int vda_h264_end_frame(AVCodecContext *avctx)
{
H264Context *h = avctx->priv_data;
VDAContext *vda = avctx->internal->hwaccel_priv_data;
AVVDAContext *vda_ctx = avctx->hwaccel_context;
AVFrame *frame = h->cur_pic_ptr->f;
uint32_t flush_flags = 1 << 0; ///< kVDADecod... | 4,586 |
FFmpeg | 79acfb0e133317c3a38c55b73c3b80f3212af2f9 | 0 | int img_pad(AVPicture *dst, const AVPicture *src, int height, int width,
int pix_fmt, int padtop, int padbottom, int padleft, int padright,
int *color)
{
uint8_t *optr, *iptr;
int y_shift;
int x_shift;
int yheight;
int i, y;
if (pix_fmt < 0 || pix_fmt >= PIX_FM... | 4,587 |
FFmpeg | 19dc71045d2833d2b3b77648608687eb687b4af1 | 0 | void avfilter_draw_slice(AVFilterLink *link, int y, int h)
{
uint8_t *src[4], *dst[4];
int i, j, hsub, vsub;
/* copy the slice if needed for permission reasons */
if(link->srcpic) {
avcodec_get_chroma_sub_sample(link->format, &hsub, &vsub);
src[0] = link->srcpic-> data[0] + y ... | 4,588 |
FFmpeg | 8ef98855d25e457094468e2e1a79d9b10d6445b2 | 0 | static int ff_sctp_send(int s, const void *msg, size_t len,
const struct sctp_sndrcvinfo *sinfo, int flags)
{
struct msghdr outmsg;
struct iovec iov;
outmsg.msg_name = NULL;
outmsg.msg_namelen = 0;
outmsg.msg_iov = &iov;
iov.iov_base = m... | 4,589 |
FFmpeg | 9caa9414ccf2dcf8aee2695377dee830a5024c82 | 0 | static int dxtory_decode_v1_420(AVCodecContext *avctx, AVFrame *pic,
const uint8_t *src, int src_size)
{
int h, w;
uint8_t *Y1, *Y2, *U, *V;
int ret;
if (src_size < avctx->width * avctx->height * 3LL / 2) {
av_log(avctx, AV_LOG_ERROR, "packet too small\n"... | 4,590 |
FFmpeg | 1181d93231e9b807965724587d363c1cfd5a1d0d | 0 | void ff_avg_h264_qpel16_mc13_msa(uint8_t *dst, const uint8_t *src,
ptrdiff_t stride)
{
avc_luma_hv_qrt_and_aver_dst_16x16_msa(src + stride - 2,
src - (stride * 2),
stride, dst, stride);
}
| 4,591 |
FFmpeg | 9a3653c9ecc4bbbbb502513a70bccd4090ed12b0 | 0 | void ff_hevc_hls_residual_coding(HEVCContext *s, int x0, int y0,
int log2_trafo_size, enum ScanType scan_idx,
int c_idx)
{
#define GET_COORD(offset, n) \
do { ... | 4,592 |
FFmpeg | 8e34089e265a6b01e1e3301e8864439d26793753 | 1 | static int mov_write_sidx_tag(AVIOContext *pb,
MOVTrack *track, int ref_size, int total_sidx_size)
{
int64_t pos = avio_tell(pb), offset_pos, end_pos;
int64_t presentation_time, duration, offset;
int starts_with_SAP, i, entries;
if (track->entry) {
entries ... | 4,593 |
qemu | d451008e0fdf7fb817c791397e7999d5f3687e58 | 1 | static uint64_t vfio_rtl8168_window_quirk_read(void *opaque,
hwaddr addr, unsigned size)
{
VFIOQuirk *quirk = opaque;
VFIOPCIDevice *vdev = quirk->vdev;
switch (addr) {
case 4: /* address */
if (quirk->data.flags) {
trace_vfio_... | 4,595 |
FFmpeg | 085ca7dcdbf9ab6c23e3a5397b1f6d4aa23f763d | 1 | static int teletext_decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPacket *pkt)
{
TeletextContext *ctx = avctx->priv_data;
AVSubtitle *sub = data;
const uint8_t *buf = pkt->data;
int left = pkt->size;
uint8_t pesheader[45] = {0x00, 0x00, 0x01, 0xbd... | 4,596 |
qemu | a8a4d15c1c34d3cec704fb64eba4a3745a140a97 | 1 | static int enable_write_target(BlockDriverState *bs, Error **errp)
{
BDRVVVFATState *s = bs->opaque;
BlockDriver *bdrv_qcow = NULL;
BlockDriverState *backing;
QemuOpts *opts = NULL;
int ret;
int size = sector2cluster(s, s->sector_count);
QDict *options;
s->used_clusters = call... | 4,597 |
FFmpeg | 16c429166ddf1736972b6ccce84bd3509ec16a34 | 1 | static int apng_read_header(AVFormatContext *s)
{
APNGDemuxContext *ctx = s->priv_data;
AVIOContext *pb = s->pb;
uint32_t len, tag;
AVStream *st;
int acTL_found = 0;
int64_t ret = AVERROR_INVALIDDATA;
/* verify PNGSIG */
if (avio_rb64(pb) != PNGSIG)
return ret;
... | 4,601 |
qemu | 31e51d1c15b35dc98b88a301812914b70a2b55dc | 1 | static int local_statfs(FsContext *s, V9fsPath *fs_path, struct statfs *stbuf)
{
char *buffer;
int ret;
char *path = fs_path->data;
buffer = rpath(s, path);
ret = statfs(buffer, stbuf);
g_free(buffer);
return ret;
}
| 4,602 |
FFmpeg | 0f5576a22b11ef726a01b14d1eaae2fa780c2f52 | 1 | int av_image_fill_black(uint8_t *dst_data[4], const ptrdiff_t dst_linesize[4],
enum AVPixelFormat pix_fmt, enum AVColorRange range,
int width, int height)
{
const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt);
int nb_planes = av_pix_fmt_count_planes... | 4,603 |
qemu | 27af7d6ea5015e5ef1f7985eab94a8a218267a2b | 1 | bool cache_is_cached(const PageCache *cache, uint64_t addr)
{
size_t pos;
g_assert(cache);
g_assert(cache->page_cache);
pos = cache_get_cache_pos(cache, addr);
return (cache->page_cache[pos].it_addr == addr);
}
| 4,604 |
qemu | b196d969efa3987148994f0f8da79a10ebda7641 | 1 | static void superio_ioport_writeb(void *opaque, hwaddr addr, uint64_t data,
unsigned size)
{
int can_write;
SuperIOConfig *superio_conf = opaque;
DPRINTF("superio_ioport_writeb address 0x%x val 0x%x\n", addr, data);
if (addr == 0x3f0) {
superio_conf->... | 4,605 |
qemu | 1f001dc7bc9e435bf231a5b0edcad1c7c2bd6214 | 0 | static int default_fdset_get_fd(int64_t fdset_id, int flags)
{
return -1;
}
| 4,608 |
qemu | 3eff1f46f08a360a4ae9f834ce9fef4c45bf6f0f | 0 | static void virtio_scsi_fail_cmd_req(VirtIOSCSIReq *req)
{
req->resp.cmd->response = VIRTIO_SCSI_S_FAILURE;
virtio_scsi_complete_cmd_req(req);
}
| 4,613 |
qemu | 43ae8fb10c5f6ca78f242624c1f446e0050a9d43 | 0 | static int iscsi_open(BlockDriverState *bs, QDict *options, int flags,
Error **errp)
{
IscsiLun *iscsilun = bs->opaque;
struct iscsi_context *iscsi = NULL;
struct iscsi_url *iscsi_url = NULL;
struct scsi_task *task = NULL;
struct scsi_inquiry_standard *inq = NULL;
s... | 4,614 |
qemu | a0efbf16604770b9d805bcf210ec29942321134f | 0 | static void string_output_append_range(StringOutputVisitor *sov,
int64_t s, int64_t e)
{
Range *r = g_malloc0(sizeof(*r));
r->begin = s;
r->end = e + 1;
sov->ranges = range_list_insert(sov->ranges, r);
}
| 4,616 |
qemu | e1123a3b40a1a9a625a29c8ed4debb7e206ea690 | 0 | static int coroutine_fn iscsi_co_readv(BlockDriverState *bs,
int64_t sector_num, int nb_sectors,
QEMUIOVector *iov)
{
IscsiLun *iscsilun = bs->opaque;
struct IscsiTask iTask;
uint64_t lba;
uint32_t num_sectors;
i... | 4,617 |
qemu | f6b5319d412cda360695e2005737f91ca8201af0 | 0 | static DeviceClass *qdev_get_device_class(const char **driver, Error **errp)
{
ObjectClass *oc;
DeviceClass *dc;
oc = object_class_by_name(*driver);
if (!oc) {
const char *typename = find_typename_by_alias(*driver);
if (typename) {
*driver = typename;
... | 4,618 |
qemu | d59f8ba938afd837182e666cce777dfb860559e4 | 0 | static int usb_net_handle_control(USBDevice *dev, int request, int value,
int index, int length, uint8_t *data)
{
USBNetState *s = (USBNetState *) dev;
int ret = 0;
switch(request) {
case DeviceRequest | USB_REQ_GET_STATUS:
data[0] = (1 << USB_DEVICE_SELF_POWERED) |
... | 4,619 |
qemu | 364031f17932814484657e5551ba12957d993d7e | 0 | static void v9fs_synth_rewinddir(FsContext *ctx, V9fsFidOpenState *fs)
{
v9fs_synth_seekdir(ctx, fs, 0);
}
| 4,620 |
FFmpeg | 28f9ab7029bd1a02f659995919f899f84ee7361b | 0 | void ff_vp3_h_loop_filter_c(uint8_t *first_pixel, int stride, int *bounding_values)
{
unsigned char *end;
int filter_value;
for (end= first_pixel + 8*stride; first_pixel != end; first_pixel += stride) {
filter_value =
(first_pixel[-2] - first_pixel[ 1])
+3*(first_pixel[... | 4,621 |
FFmpeg | d2a0041c2075a553bb8d4f94591f8556680190c8 | 0 | static int huffman_decode(MPADecodeContext *s, GranuleDef *g,
int16_t *exponents, int end_pos2)
{
int s_index;
int i;
int last_pos, bits_left;
VLC *vlc;
int end_pos = FFMIN(end_pos2, s->gb.size_in_bits);
/* low frequencies (called big values) */
s_index =... | 4,622 |
qemu | 897fa7cff21a98b260a5b3e73eae39273fa60272 | 0 | static void memory_region_write_thunk_n(void *_mr,
target_phys_addr_t addr,
unsigned size,
uint64_t data)
{
MemoryRegion *mr = _mr;
if (!memory_region_access_valid(mr, addr, size)) {
... | 4,623 |
qemu | abd696e4f74a9d30801c6ae2693efe4e5979c2f2 | 0 | static int zipl_load_segment(struct component_entry *entry)
{
const int max_entries = (SECTOR_SIZE / sizeof(struct scsi_blockptr));
struct scsi_blockptr *bprs = (void*)sec;
const int bprs_size = sizeof(sec);
uint64_t blockno;
long address;
int i;
blockno = entry->data.blockno;
... | 4,624 |
qemu | d0cc2fbfa607678866475383c508be84818ceb64 | 0 | int event_notifier_set(EventNotifier *e)
{
uint64_t value = 1;
int r = write(e->fd, &value, sizeof(value));
return r == sizeof(value);
}
| 4,625 |
qemu | c0bea68f9ea48f0dea7a06a259a613bfd3a7e35e | 0 | long do_sigreturn(CPUSPARCState *env)
{
abi_ulong sf_addr;
struct target_signal_frame *sf;
uint32_t up_psr, pc, npc;
target_sigset_t set;
sigset_t host_set;
int err=0, i;
sf_addr = env->regwptr[UREG_FP];
trace_user_do_sigreturn(env, sf_addr);
if (!lock_user_struct(VERIFY_... | 4,626 |
qemu | fdfab37dfeffefbd4533b4158055c9b82d7c3e69 | 0 | void qcow2_free_any_clusters(BlockDriverState *bs, uint64_t l2_entry,
int nb_clusters, enum qcow2_discard_type type)
{
BDRVQcow2State *s = bs->opaque;
switch (qcow2_get_cluster_type(l2_entry)) {
case QCOW2_CLUSTER_COMPRESSED:
{
int nb_csectors;
... | 4,627 |
qemu | c10682cb031525a8bdf3999ef6a033777929d304 | 0 | void qemu_put_byte(QEMUFile *f, int v)
{
if (!f->last_error && f->is_write == 0 && f->buf_index > 0) {
fprintf(stderr,
"Attempted to write to buffer while read buffer is not empty\n");
abort();
}
f->buf[f->buf_index++] = v;
f->is_write = 1;
if (f->buf_index... | 4,628 |
qemu | 0919ac787641db11024912651f3bc5764d4f1286 | 0 | static void n8x0_i2c_setup(struct n800_s *s)
{
DeviceState *dev;
qemu_irq tmp_irq = qdev_get_gpio_in(s->cpu->gpio, N8X0_TMP105_GPIO);
/* Attach the CPU on one end of our I2C bus. */
s->i2c = omap_i2c_bus(s->cpu->i2c[0]);
/* Attach a menelaus PM chip */
dev = i2c_create_slave(s->i2c, ... | 4,629 |
qemu | 72cf2d4f0e181d0d3a3122e04129c58a95da713e | 0 | void destroy_bdrvs(dev_match_fn *match_fn, void *arg)
{
DriveInfo *dinfo;
struct BlockDriverState *bs;
TAILQ_FOREACH(dinfo, &drives, next) {
bs = dinfo->bdrv;
if (bs) {
if (bs->private && match_fn(bs->private, arg)) {
drive_uninit(bs);
b... | 4,630 |
qemu | 56c0269a9ec105d3848d9f900b5e38e6b35e2478 | 0 | TranslationBlock *tb_gen_code(CPUState *cpu,
target_ulong pc, target_ulong cs_base,
int flags, int cflags)
{
CPUArchState *env = cpu->env_ptr;
TranslationBlock *tb;
tb_page_addr_t phys_pc, phys_page2;
target_ulong virt_page2;
tcg_in... | 4,631 |
qemu | 4be746345f13e99e468c60acbd3a355e8183e3ce | 0 | static void virtio_blk_handle_write(VirtIOBlockReq *req, MultiReqBuffer *mrb)
{
BlockRequest *blkreq;
uint64_t sector;
sector = virtio_ldq_p(VIRTIO_DEVICE(req->dev), &req->out.sector);
trace_virtio_blk_handle_write(req, sector, req->qiov.size / 512);
if (!virtio_blk_sect_range_ok(req->de... | 4,632 |
FFmpeg | ff771f79b55a346b4163d814b58ee4c98114745e | 0 | static int vc1_parse(AVCodecParserContext *s,
AVCodecContext *avctx,
const uint8_t **poutbuf, int *poutbuf_size,
const uint8_t *buf, int buf_size)
{
/* Here we do the searching for frame boundaries and headers at
* the same ... | 4,633 |
qemu | 61007b316cd71ee7333ff7a0a749a8949527575f | 0 | static void bdrv_co_complete(BlockAIOCBCoroutine *acb)
{
if (!acb->need_bh) {
acb->common.cb(acb->common.opaque, acb->req.error);
qemu_aio_unref(acb);
}
}
| 4,634 |
qemu | 56a6f02b8ce1fe41a2a9077593e46eca7d98267d | 0 | QObject *qmp_output_get_qobject(QmpOutputVisitor *qov)
{
/* FIXME: we should require that a visit occurred, and that it is
* complete (no starts without a matching end) */
QObject *obj = qov->root;
if (obj) {
qobject_incref(obj);
} else {
obj = qnull();
}
return ob... | 4,635 |
qemu | 6fedcaa1c5419fa89c31fd34dabbd71861c615d2 | 0 | eeprom_t *eeprom93xx_new(DeviceState *dev, uint16_t nwords)
{
/* Add a new EEPROM (with 16, 64 or 256 words). */
eeprom_t *eeprom;
uint8_t addrbits;
switch (nwords) {
case 16:
case 64:
addrbits = 6;
break;
case 128:
case 256:
... | 4,637 |
qemu | 9118e7f08f39001c92d595090b41305ef45c200a | 0 | static void cdrom_change_cb(void *opaque)
{
IDEState *s = opaque;
uint64_t nb_sectors;
/* XXX: send interrupt too */
bdrv_get_geometry(s->bs, &nb_sectors);
s->nb_sectors = nb_sectors;
}
| 4,638 |
qemu | b4ba67d9a702507793c2724e56f98e9b0f7be02b | 1 | void *qpci_legacy_iomap(QPCIDevice *dev, uint16_t addr)
{
return (void *)(uintptr_t)addr;
}
| 4,641 |
qemu | 0b5538c300a56c3cfb33022840fe0b4968147e7a | 1 | static void trace(TraceEventID event, uint64_t x1, uint64_t x2, uint64_t x3,
uint64_t x4, uint64_t x5, uint64_t x6)
{
TraceRecord *rec = &trace_buf[trace_idx];
if (!trace_list[event].state) {
return;
}
rec->event = event;
rec->timestamp_ns = get_clock();
re... | 4,642 |
qemu | 632314c49ce20ee9c974f07544d9125fbbbfbe1b | 1 | static void gen_intermediate_code_internal(CPULM32State *env,
TranslationBlock *tb, int search_pc)
{
struct DisasContext ctx, *dc = &ctx;
uint16_t *gen_opc_end;
uint32_t pc_start;
int j, lj;
uint32_t next_page_start;
int num_insns;
int max_insns;
qemu_log_try_set_file... | 4,643 |
qemu | d9a3b33d2c9f996537b7f1d0246dee2d0120cefb | 1 | void acpi_gpe_init(ACPIREGS *ar, uint8_t len)
{
ar->gpe.len = len;
ar->gpe.sts = g_malloc0(len / 2);
ar->gpe.en = g_malloc0(len / 2);
}
| 4,644 |
qemu | ce5b1bbf624b977a55ff7f85bb3871682d03baff | 1 | static void xtensa_cpu_initfn(Object *obj)
{
CPUState *cs = CPU(obj);
XtensaCPU *cpu = XTENSA_CPU(obj);
XtensaCPUClass *xcc = XTENSA_CPU_GET_CLASS(obj);
CPUXtensaState *env = &cpu->env;
static bool tcg_inited;
cs->env_ptr = env;
env->config = xcc->config;
cpu_exec_init(cs, &er... | 4,646 |
qemu | f6351288b65130deb8102b17143f5d84f817a02a | 1 | static void dp8393x_class_init(ObjectClass *klass, void *data)
{
DeviceClass *dc = DEVICE_CLASS(klass);
set_bit(DEVICE_CATEGORY_NETWORK, dc->categories);
dc->realize = dp8393x_realize;
dc->reset = dp8393x_reset;
dc->vmsd = &vmstate_dp8393x;
dc->props = dp8393x_properties;
} | 4,648 |
FFmpeg | af289048d8f720743ed82a4e674cff01ab02a836 | 1 | static int mjpeg_decode_sof0(MJpegDecodeContext *s,
UINT8 *buf, int buf_size)
{
int len, nb_components, i, width, height;
init_get_bits(&s->gb, buf, buf_size);
/* XXX: verify len field validity */
len = get_bits(&s->gb, 16);
/* only 8 bits/component accepted *... | 4,649 |
FFmpeg | 63736fe48c30c5db313c3a25d1462ad31b2a1671 | 0 | int ff_avfilter_graph_config_formats(AVFilterGraph *graph, AVClass *log_ctx)
{
int ret;
/* find supported formats from sub-filters, and merge along links */
if ((ret = query_formats(graph, log_ctx)) < 0)
return ret;
/* Once everything is merged, it's possible that we'll still have
... | 4,651 |
FFmpeg | e549933a270dd2cfc36f2cf9bb6b29acf3dc6d08 | 0 | static void avc_luma_midh_qrt_8w_msa(const uint8_t *src, int32_t src_stride,
uint8_t *dst, int32_t dst_stride,
int32_t height, uint8_t horiz_offset)
{
uint32_t multiple8_cnt;
for (multiple8_cnt = 2; multiple8_cnt--;) {
avc... | 4,652 |
qemu | 3debbb5af5f63440b170b71bf3aecc0e778f5691 | 1 | target_ulong helper_msub32_suov(CPUTriCoreState *env, target_ulong r1,
target_ulong r2, target_ulong r3)
{
int64_t t1 = extract64(r1, 0, 32);
int64_t t2 = extract64(r2, 0, 32);
int64_t t3 = extract64(r3, 0, 32);
int64_t result;
result = t2 - (t1 * t3);
r... | 4,653 |
qemu | 2d528d45ecf5ee3c1a566a9f3d664464925ef830 | 1 | static CharDriverState *qemu_chr_open_fd(int fd_in, int fd_out)
{
CharDriverState *chr;
FDCharDriver *s;
chr = qemu_chr_alloc();
s = g_malloc0(sizeof(FDCharDriver));
s->fd_in = io_channel_from_fd(fd_in);
s->fd_out = io_channel_from_fd(fd_out);
qemu_set_nonblock(fd_out);
s->chr... | 4,655 |
FFmpeg | 127a362630e11fe724e2e63fc871791fdcbcfa64 | 1 | static void mpeg_er_decode_mb(void *opaque, int ref, int mv_dir, int mv_type,
int (*mv)[2][4][2], int mb_x, int mb_y,
int mb_intra, int mb_skipped)
{
MpegEncContext *s = opaque;
s->mv_dir = mv_dir;
s->mv_type = mv_type;
s->mb_in... | 4,656 |
FFmpeg | 1e26a48fa23ef8e1cbc424667d387184d8155f15 | 1 | static int field_end(H264Context *h, int in_setup)
{
MpegEncContext *const s = &h->s;
AVCodecContext *const avctx = s->avctx;
int err = 0;
s->mb_y = 0;
if (!in_setup && !s->dropable)
ff_thread_report_progress(&s->current_picture_ptr->f,
(16 * s... | 4,657 |
qemu | c29c1dd312f39ec18a3c6177c6da09a75e095d70 | 1 | static void coroutine_fn backup_run(void *opaque)
{
BackupBlockJob *job = opaque;
BackupCompleteData *data;
BlockDriverState *bs = job->common.bs;
BlockDriverState *target = job->target;
BlockdevOnError on_target_error = job->on_target_error;
NotifierWithReturn before_write = {
.... | 4,658 |
qemu | c599d4d6d6e9bfdb64e54c33a22cb26e3496b96d | 1 | static void force_sigsegv(int oldsig)
{
CPUState *cpu = thread_cpu;
CPUArchState *env = cpu->env_ptr;
target_siginfo_t info;
if (oldsig == SIGSEGV) {
/* Make sure we don't try to deliver the signal again; this will
* end up with handle_pending_signal() calling force_sig().
... | 4,659 |
qemu | 6baebed7698a37a0ac5168faf26023426b0ac940 | 1 | static void vnc_update_client(void *opaque)
{
VncState *vs = opaque;
if (vs->need_update && vs->csock != -1) {
int y;
uint8_t *row;
char *old_row;
uint32_t width_mask[VNC_DIRTY_WORDS];
int n_rectangles;
int saved_offset;
int has_dirty = 0;
... | 4,660 |
FFmpeg | 15d7e31dcb68f30ebd725c495a191d5917a3b602 | 1 | static int video_open(VideoState *is)
{
int w,h;
if (screen_width) {
w = screen_width;
h = screen_height;
} else {
w = default_width;
h = default_height;
}
if (!window) {
int flags = SDL_WINDOW_SHOWN | SDL_WINDOW_RESIZABLE;
if (!window_... | 4,661 |
FFmpeg | 2caf19e90f270abe1e80a3e85acaf0eb5c9d0aac | 1 | static void FUNCC(pred4x4_129_dc)(uint8_t *_src, const uint8_t *topright, int _stride){
pixel *src = (pixel*)_src;
int stride = _stride/sizeof(pixel);
((pixel4*)(src+0*stride))[0]=
((pixel4*)(src+1*stride))[0]=
((pixel4*)(src+2*stride))[0]=
((pixel4*)(src+3*stride))[0]= PIXEL_SPLAT_X4((1<<... | 4,662 |
qemu | bbbc39ccacf66ef58261c155f9eed503947c3023 | 1 | static int ehci_reset_queue(EHCIQueue *q)
{
int packets;
trace_usb_ehci_queue_action(q, "reset");
packets = ehci_cancel_queue(q);
q->dev = NULL;
q->qtdaddr = 0;
return packets;
} | 4,663 |
FFmpeg | 0281d32550639c806b7eccd2b17cc5d125e4253d | 1 | static void fill_caches(H264Context *h, int mb_type, int for_deblock){
MpegEncContext * const s = &h->s;
const int mb_xy= h->mb_xy;
int topleft_xy, top_xy, topright_xy, left_xy[2];
int topleft_type, top_type, topright_type, left_type[2];
int * left_block;
int topleft_partition= -1;
in... | 4,664 |
qemu | 777aec7ac91b1306d77897aafc8097a87bf4a672 | 1 | static void lsi_scsi_init(PCIDevice *dev)
{
LSIState *s = (LSIState *)dev;
uint8_t *pci_conf;
pci_conf = s->pci_dev.config;
/* PCI Vendor ID (word) */
pci_config_set_vendor_id(pci_conf, PCI_VENDOR_ID_LSI_LOGIC);
/* PCI device ID (word) */
pci_config_set_device_id(pci_conf, PCI_DEVICE_ID_LSI_... | 4,666 |
FFmpeg | 45ae9a8fc903d5b5041a5d34015aa98ab2bc12be | 1 | int ff_j2k_init_component(J2kComponent *comp, J2kCodingStyle *codsty, J2kQuantStyle *qntsty, int cbps, int dx, int dy)
{
int reslevelno, bandno, gbandno = 0, ret, i, j, csize = 1;
if (ret=ff_j2k_dwt_init(&comp->dwt, comp->coord, codsty->nreslevels-1, codsty->transform))
return ret;
for (i = 0... | 4,667 |
qemu | 3e305e4a4752f70c0b5c3cf5b43ec957881714f7 | 1 | void vncws_tls_handshake_io(void *opaque)
{
VncState *vs = (VncState *)opaque;
if (!vs->tls.session) {
VNC_DEBUG("TLS Websocket setup\n");
if (vnc_tls_client_setup(vs, vs->vd->tls.x509cert != NULL) < 0) {
return;
}
}
VNC_DEBUG("Handshake IO continue\n");
... | 4,669 |
qemu | 66dc50f7057b9a0191f54e55764412202306858d | 1 | int css_do_rsch(SubchDev *sch)
{
SCSW *s = &sch->curr_status.scsw;
PMCW *p = &sch->curr_status.pmcw;
int ret;
if (~(p->flags) & (PMCW_FLAGS_MASK_DNV | PMCW_FLAGS_MASK_ENA)) {
ret = -ENODEV;
goto out;
}
if (s->ctrl & SCSW_STCTL_STATUS_PEND) {
ret = -EINPROGRE... | 4,670 |
qemu | e206ad48333c50373663945746828fc893b50700 | 1 | ram_addr_t ppc4xx_sdram_adjust(ram_addr_t ram_size, int nr_banks,
MemoryRegion ram_memories[],
hwaddr ram_bases[],
hwaddr ram_sizes[],
const unsigned int sdram_bank_sizes[])
{
ram_addr_t... | 4,671 |
FFmpeg | fd34dbea58e097609ff09cf7dcc59f74930195d3 | 1 | static int mxf_read_cryptographic_context(void *arg, AVIOContext *pb, int tag, int size, UID uid)
{
MXFCryptoContext *cryptocontext = arg;
if (size != 16)
return -1;
if (IS_KLV_KEY(uid, mxf_crypto_source_container_ul))
avio_read(pb, cryptocontext->source_container_ul, 16);
return ... | 4,672 |
FFmpeg | 7b05b5093ea67a3397b0c37cf398bab471e1ce2b | 1 | void ff_eac3_decode_transform_coeffs_aht_ch(AC3DecodeContext *s, int ch)
{
int bin, blk, gs;
int end_bap, gaq_mode;
GetBitContext *gbc = &s->gbc;
int gaq_gain[AC3_MAX_COEFS];
gaq_mode = get_bits(gbc, 2);
end_bap = (gaq_mode < 2) ? 12 : 17;
/* if GAQ gain is used, decode gain code... | 4,673 |
qemu | 777c5f1e436d334a57b650b6951c13d8d2799df0 | 1 | void unregister_displaychangelistener(DisplayChangeListener *dcl)
{
DisplayState *ds = dcl->ds;
trace_displaychangelistener_unregister(dcl, dcl->ops->dpy_name);
if (dcl->con) {
dcl->con->dcls--;
}
QLIST_REMOVE(dcl, next);
gui_setup_refresh(ds);
} | 4,675 |
FFmpeg | e2ad0b66fa273c5c823978e8f601f2c0d9ee42f8 | 0 | int avpicture_layout(const AVPicture* src, enum AVPixelFormat pix_fmt,
int width, int height,
unsigned char *dest, int dest_size)
{
int i, j, nb_planes = 0, linesizes[4];
const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt);
int size = avpicture_get_s... | 4,677 |
FFmpeg | 05d00e953f4cc08273fbb5f795f4fdc307140108 | 0 | static int pipe_open(URLContext *h, const char *filename, int flags)
{
int fd;
if (flags & URL_WRONLY) {
fd = 1;
} else {
fd = 0;
}
#if defined(__MINGW32__) || defined(CONFIG_OS2) || defined(__CYGWIN__)
setmode(fd, O_BINARY);
#endif
h->priv_data = (void *)(size_t)fd;... | 4,678 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.