project stringclasses 2
values | commit_id stringlengths 40 40 | target int64 0 1 | func stringlengths 26 142k | idx int64 0 27.3k |
|---|---|---|---|---|
qemu | eb700029c7836798046191d62d595363d92c84d4 | 0 | void net_tx_pkt_build_vheader(struct NetTxPkt *pkt, bool tso_enable,
bool csum_enable, uint32_t gso_size)
{
struct tcp_hdr l4hdr;
assert(pkt);
/* csum has to be enabled if tso is. */
assert(csum_enable || !tso_enable);
pkt->virt_hdr.gso_type = net_tx_pkt_get_gso_type(pkt, tso_enable);... | 16,957 |
qemu | df6126a7f21a1a032e41b15899ca29777399d5a2 | 0 | static void gen_mipsdsp_add_cmp_pick(DisasContext *ctx,
uint32_t op1, uint32_t op2,
int ret, int v1, int v2, int check_ret)
{
const char *opn = "mipsdsp add compare pick";
TCGv_i32 t0;
TCGv t1;
TCGv v1_t;
TCGv v2_t;
... | 16,958 |
qemu | e69a17f65e9f12f33c48b04a789e49d40a8993f5 | 0 | static inline int IRQ_testbit(IRQQueue *q, int n_IRQ)
{
return test_bit(q->queue, n_IRQ);
}
| 16,959 |
FFmpeg | 4db81f081743aeed366e8af7a748667818a27e0f | 0 | static int pic_arrays_init(HEVCContext *s)
{
int log2_min_cb_size = s->sps->log2_min_cb_size;
int width = s->sps->width;
int height = s->sps->height;
int pic_size = width * height;
int pic_size_in_ctb = ((width >> log2_min_cb_size) + 1) *
... | 16,960 |
qemu | 72cf2d4f0e181d0d3a3122e04129c58a95da713e | 0 | static void ioreq_finish(struct ioreq *ioreq)
{
struct XenBlkDev *blkdev = ioreq->blkdev;
LIST_REMOVE(ioreq, list);
LIST_INSERT_HEAD(&blkdev->finished, ioreq, list);
blkdev->requests_inflight--;
blkdev->requests_finished++;
}
| 16,961 |
qemu | f17fd4fdf0df3d2f3444399d04c38d22b9a3e1b7 | 0 | static void test_qemu_strtosz_invalid(void)
{
const char *str;
char *endptr = NULL;
int64_t res;
str = "";
res = qemu_strtosz(str, &endptr);
g_assert_cmpint(res, ==, -EINVAL);
g_assert(endptr == str);
str = " \t ";
res = qemu_strtosz(str, &endptr);
g_assert_cmpint(... | 16,962 |
qemu | 51b19ebe4320f3dcd93cea71235c1219318ddfd2 | 0 | static void virtio_gpu_handle_ctrl(VirtIODevice *vdev, VirtQueue *vq)
{
VirtIOGPU *g = VIRTIO_GPU(vdev);
struct virtio_gpu_ctrl_command *cmd;
if (!virtio_queue_ready(vq)) {
return;
}
#ifdef CONFIG_VIRGL
if (!g->renderer_inited && g->use_virgl_renderer) {
virtio_gpu_virgl... | 16,963 |
qemu | 85f94f868fcd868f0f605e9d3c1ad6351c557190 | 0 | static void handle_mousemotion(DisplayState *ds, SDL_Event *ev)
{
int max_x, max_y;
if (is_graphic_console() &&
(kbd_mouse_is_absolute() || absolute_enabled)) {
max_x = real_screen->w - 1;
max_y = real_screen->h - 1;
if (gui_grab && (ev->motion.x == 0 || ev->motion.y == ... | 16,964 |
qemu | 81f3053b77f7d3a4d9100c425cd8cec99ee7a3d4 | 0 | void helper_mwait(CPUX86State *env, int next_eip_addend)
{
CPUState *cs;
X86CPU *cpu;
if ((uint32_t)env->regs[R_ECX] != 0) {
raise_exception(env, EXCP0D_GPF);
}
cpu_svm_check_intercept_param(env, SVM_EXIT_MWAIT, 0);
env->eip += next_eip_addend;
cpu = x86_env_get_cpu(env)... | 16,965 |
qemu | afff2b15e89ac81c113f2ebfd729aaa02b40edb6 | 1 | QemuConsole *graphic_console_init(DeviceState *dev, uint32_t head,
const GraphicHwOps *hw_ops,
void *opaque)
{
Error *local_err = NULL;
int width = 640;
int height = 480;
QemuConsole *s;
DisplayState *ds;
ds = get_all... | 16,968 |
qemu | e30d1d8c7195848abb28a8c734a82b845b8b456a | 1 | static int ram_save_setup(QEMUFile *f, void *opaque)
{
RAMBlock *block;
int64_t ram_pages = last_ram_offset() >> TARGET_PAGE_BITS;
migration_bitmap = bitmap_new(ram_pages);
bitmap_set(migration_bitmap, 0, ram_pages);
migration_dirty_pages = ram_pages;
mig_throttle_on = false;
dirty... | 16,970 |
FFmpeg | a68a6a4fb19caecc91d5f7fe3ef4f83f6d3c4586 | 1 | static int xan_decode_chroma(AVCodecContext *avctx, AVPacket *avpkt)
{
const uint8_t *buf = avpkt->data;
XanContext *s = avctx->priv_data;
uint8_t *U, *V;
unsigned chroma_off;
int val, uval, vval;
int i, j;
const uint8_t *src, *src_end;
const uint8_t *table;
int mode, offse... | 16,971 |
FFmpeg | bd5c860fdbc33d19d2ff0f6d1f06de07c17560dd | 1 | static int av_thread_message_queue_send_locked(AVThreadMessageQueue *mq,
void *msg,
unsigned flags)
{
while (!mq->err_send && av_fifo_space(mq->fifo) < mq->elsize) {
if ((flags & AV_THREAD_MESSAGE_NONBLOCK))
... | 16,972 |
FFmpeg | 50a3c4c5d2634b5d4076a5b7c099729cbd59ac45 | 1 | static int rsd_probe(AVProbeData *p)
{
if (!memcmp(p->buf, "RSD", 3) &&
p->buf[3] - '0' >= 2 && p->buf[3] - '0' <= 6)
return AVPROBE_SCORE_EXTENSION;
return 0;
}
| 16,973 |
qemu | 60fe637bf0e4d7989e21e50f52526444765c63b4 | 1 | static uint64_t ntohll(uint64_t v) {
union { uint32_t lv[2]; uint64_t llv; } u;
u.llv = v;
return ((uint64_t)ntohl(u.lv[0]) << 32) | (uint64_t) ntohl(u.lv[1]);
}
| 16,974 |
FFmpeg | ac4b32df71bd932838043a4838b86d11e169707f | 1 | static av_always_inline int simple_limit(uint8_t *p, ptrdiff_t stride, int flim)
{
LOAD_PIXELS
return 2 * FFABS(p0 - q0) + (FFABS(p1 - q1) >> 1) <= flim;
}
| 16,975 |
FFmpeg | 8155233413540c63e53a620ff5734fb4b0635611 | 1 | void sample_dump(int fnum, INT32 *tab, int n)
{
static FILE *files[16], *f;
char buf[512];
f = files[fnum];
if (!f) {
sprintf(buf, "/tmp/out%d.pcm", fnum);
f = fopen(buf, "w");
if (!f)
return;
files[fnum] = f;
}
if (fnum == 0) {
... | 16,976 |
qemu | 14a10fc39923b3af07c8c46d22cb20843bee3a72 | 1 | static void mb_cpu_realizefn(DeviceState *dev, Error **errp)
{
MicroBlazeCPU *cpu = MICROBLAZE_CPU(dev);
MicroBlazeCPUClass *mcc = MICROBLAZE_CPU_GET_CLASS(dev);
cpu_reset(CPU(cpu));
mcc->parent_realize(dev, errp);
}
| 16,978 |
FFmpeg | 70143a3954e1c4412efb2bf1a3a818adea2d3abf | 0 | static int dxva2_create_decoder(AVCodecContext *s)
{
InputStream *ist = s->opaque;
int loglevel = (ist->hwaccel_id == HWACCEL_AUTO) ? AV_LOG_VERBOSE : AV_LOG_ERROR;
DXVA2Context *ctx = ist->hwaccel_ctx;
struct dxva_context *dxva_ctx = s->hwaccel_context;
GUID *guid_list = NULL;
unsigned ... | 16,979 |
FFmpeg | 8d2e0e2c7058a3eaf7f45d740be6e93972bbfd68 | 0 | const uint8_t *ff_h263_find_resync_marker(MpegEncContext *s, const uint8_t *av_restrict p, const uint8_t *av_restrict end)
{
av_assert2(p < end);
end-=2;
p++;
if(s->resync_marker){
for(;p<end; p+=2){
if(!*p){
if (!p[-1] && p[1]) return p - 1;
... | 16,980 |
FFmpeg | eabbc64728c2fdb74f565aededec2ab023d20699 | 0 | static int start_ebml_master_crc32(AVIOContext *pb, AVIOContext **dyn_cp, ebml_master *master,
unsigned int elementid, uint64_t expectedsize)
{
int ret;
if ((ret = avio_open_dyn_buf(dyn_cp)) < 0)
return ret;
if (pb->seekable)
*master = start_ebml... | 16,982 |
FFmpeg | 64250d94b74d3fd47cc8b1611f48daf6a6ed804a | 0 | static int decode_pic_hdr(IVI45DecContext *ctx, AVCodecContext *avctx)
{
int pic_size_indx, i, p;
IVIPicConfig pic_conf;
if (get_bits(&ctx->gb, 18) != 0x3FFF8) {
av_log(avctx, AV_LOG_ERROR, "Invalid picture start code!\n");
return AVERROR_INVALIDDATA;
}
ctx... | 16,983 |
FFmpeg | e6c90ce94f1b07f50cea2babf7471af455cca0ff | 0 | static void decode_finish_row(H264Context *h, H264SliceContext *sl)
{
int top = 16 * (h->mb_y >> FIELD_PICTURE(h));
int pic_height = 16 * h->mb_height >> FIELD_PICTURE(h);
int height = 16 << FRAME_MBAFF(h);
int deblock_border = (16 + 4) << FRAME_MBAFF(h);
i... | 16,985 |
FFmpeg | e87190f5d20d380608f792ceb14d0def1d80e24b | 0 | static inline void show_tags(WriterContext *wctx, AVDictionary *tags, int section_id)
{
AVDictionaryEntry *tag = NULL;
if (!tags)
return;
writer_print_section_header(wctx, section_id);
while ((tag = av_dict_get(tags, "", tag, AV_DICT_IGNORE_SUFFIX)))
writer_print_string(wctx, ta... | 16,987 |
qemu | 7466bc49107fbd84336ba680f860d5eadd6def13 | 0 | void qemu_spice_display_update(SimpleSpiceDisplay *ssd,
int x, int y, int w, int h)
{
QXLRect update_area;
dprint(2, "%s: x %d y %d w %d h %d\n", __FUNCTION__, x, y, w, h);
update_area.left = x,
update_area.right = x + w;
update_area.top = y;
update_area.... | 16,989 |
qemu | 72cf2d4f0e181d0d3a3122e04129c58a95da713e | 0 | static void blk_alloc(struct XenDevice *xendev)
{
struct XenBlkDev *blkdev = container_of(xendev, struct XenBlkDev, xendev);
LIST_INIT(&blkdev->inflight);
LIST_INIT(&blkdev->finished);
LIST_INIT(&blkdev->freelist);
blkdev->bh = qemu_bh_new(blk_bh, blkdev);
if (xen_mode != XEN_EMULATE)
... | 16,990 |
qemu | 0ac7cc2af500b948510f2481c22e84a57b0a2447 | 0 | static Suite *qstring_suite(void)
{
Suite *s;
TCase *qstring_public_tcase;
s = suite_create("QString test-suite");
qstring_public_tcase = tcase_create("Public Interface");
suite_add_tcase(s, qstring_public_tcase);
tcase_add_test(qstring_public_tcase, qstring_from_str_test);
tcase... | 16,991 |
qemu | 9b990ee5a3cc6aa38f81266fb0c6ef37a36c45b9 | 0 | static inline TranslationBlock *tb_find(CPUState *cpu,
TranslationBlock *last_tb,
int tb_exit)
{
TranslationBlock *tb;
target_ulong cs_base, pc;
uint32_t flags;
bool acquired_tb_lock = false;
uint32_t cf_mask = c... | 16,992 |
qemu | dfd100f242370886bb6732f70f1f7cbd8eb9fedc | 0 | static VncServerInfo2List *qmp_query_server_entry(QIOChannelSocket *ioc,
bool websocket,
int auth,
int subauth,
VncS... | 16,993 |
qemu | 973945804d95878375b487c0c5c9b2556c5e4543 | 0 | static void tcx_invalidate_cursor_position(TCXState *s)
{
int ymin, ymax, start, end;
/* invalidate only near the cursor */
ymin = s->cursy;
if (ymin >= s->height) {
return;
}
ymax = MIN(s->height, ymin + 32);
start = ymin * 1024;
end = ymax * 1024;
memory_re... | 16,994 |
qemu | 4ff927cc62ea79092e21827f17d19a3d85973e84 | 0 | static int pxa2xx_timer_init(SysBusDevice *dev)
{
int i;
int iomemtype;
PXA2xxTimerInfo *s;
qemu_irq irq4;
s = FROM_SYSBUS(PXA2xxTimerInfo, dev);
s->irq_enabled = 0;
s->oldclock = 0;
s->clock = 0;
s->lastload = qemu_get_clock(vm_clock);
s->reset3 = 0;
for (i =... | 16,995 |
qemu | 9f2130f58d5dd4e1fcb435cca08bf77e7c32e6c6 | 0 | static void xenfb_mouse_event(void *opaque,
int dx, int dy, int dz, int button_state)
{
struct XenInput *xenfb = opaque;
DisplaySurface *surface = qemu_console_surface(xenfb->c.con);
int dw = surface_width(surface);
int dh = surface_height(surface);
int i;
trace_xenfb_mouse_ev... | 16,996 |
qemu | d5e6f437c5508614803d11e59ee16a758dde09ef | 0 | BdrvChild *bdrv_root_attach_child(BlockDriverState *child_bs,
const char *child_name,
const BdrvChildRole *child_role,
void *opaque)
{
BdrvChild *child = g_new(BdrvChild, 1);
*child = (BdrvChild) {
... | 16,997 |
FFmpeg | c679a1c358c30ec38ae3b1ac3ee2c62efc2f32e2 | 0 | static av_cold int movie_common_init(AVFilterContext *ctx)
{
MovieContext *movie = ctx->priv;
AVInputFormat *iformat = NULL;
int64_t timestamp;
int nb_streams, ret, i;
char default_streams[16], *stream_specs, *spec, *cursor;
char name[16];
AVStream *st;
if (!*movie->file_name)... | 16,998 |
qemu | 494a8ebe713055d3946183f4b395f85a18b43e9e | 0 | static ssize_t proxy_llistxattr(FsContext *ctx, V9fsPath *fs_path,
void *value, size_t size)
{
int retval;
retval = v9fs_request(ctx->private, T_LLISTXATTR, value, "ds", size,
fs_path);
if (retval < 0) {
errno = -retval;
}
retu... | 17,000 |
qemu | 9ef91a677110ec200d7b2904fc4bcae5a77329ad | 0 | int qemu_paio_read(struct qemu_paiocb *aiocb)
{
return qemu_paio_submit(aiocb, QEMU_PAIO_READ);
}
| 17,001 |
qemu | 91b0a8f33419573c1d741e49559bfb666fd8b1f0 | 0 | static void do_io_interrupt(CPUS390XState *env)
{
LowCore *lowcore;
IOIntQueue *q;
uint8_t isc;
int disable = 1;
int found = 0;
if (!(env->psw.mask & PSW_MASK_IO)) {
cpu_abort(env, "I/O int w/o I/O mask\n");
}
for (isc = 0; isc < ARRAY_SIZE(env->io_index); isc++) {
... | 17,002 |
qemu | 6eab3de16d36c48a983366b09d0a0029a5260bc3 | 0 | static int piix3_initfn(PCIDevice *dev)
{
PIIX3State *d = DO_UPCAST(PIIX3State, dev, dev);
uint8_t *pci_conf;
isa_bus_new(&d->dev.qdev);
pci_conf = d->dev.config;
pci_config_set_vendor_id(pci_conf, PCI_VENDOR_ID_INTEL);
pci_config_set_device_id(pci_conf, PCI_DEVICE_ID_INTEL_82371SB_0)... | 17,003 |
qemu | c2b38b277a7882a592f4f2ec955084b2b756daaa | 0 | static bool event_notifier_poll(void *opaque)
{
EventNotifier *e = opaque;
AioContext *ctx = container_of(e, AioContext, notifier);
return atomic_read(&ctx->notified);
}
| 17,005 |
qemu | 27898a5daa4c6d28adb32b401a011d7198494482 | 0 | coroutine_fn iscsi_co_write_zeroes(BlockDriverState *bs, int64_t sector_num,
int nb_sectors, BdrvRequestFlags flags)
{
IscsiLun *iscsilun = bs->opaque;
struct IscsiTask iTask;
uint64_t lba;
uint32_t nb_blocks;
if (!is_request_lun_aligned(sector_num, nb_sec... | 17,007 |
qemu | 7197fb4058bcb68986bae2bb2c04d6370f3e7218 | 0 | static size_t fd_getpagesize(int fd)
{
#ifdef CONFIG_LINUX
struct statfs fs;
int ret;
if (fd != -1) {
do {
ret = fstatfs(fd, &fs);
} while (ret != 0 && errno == EINTR);
if (ret == 0 && fs.f_type == HUGETLBFS_MAGIC) {
return fs.f_bsize;
}... | 17,008 |
qemu | a8170e5e97ad17ca169c64ba87ae2f53850dab4c | 0 | static void m5206_mbar_writel(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);
}
widt... | 17,010 |
qemu | a980f7f2c2f4d7e9a1eba4f804cd66dbd458b6d4 | 0 | static QVirtIO9P *qvirtio_9p_pci_init(void)
{
QVirtIO9P *v9p;
QVirtioPCIDevice *dev;
v9p = g_new0(QVirtIO9P, 1);
v9p->alloc = pc_alloc_init();
v9p->bus = qpci_init_pc(NULL);
dev = qvirtio_pci_device_find(v9p->bus, VIRTIO_ID_9P);
g_assert_nonnull(dev);
g_assert_cmphex(dev->vd... | 17,011 |
qemu | 72cf2d4f0e181d0d3a3122e04129c58a95da713e | 0 | void drive_uninit(BlockDriverState *bdrv)
{
DriveInfo *dinfo;
TAILQ_FOREACH(dinfo, &drives, next) {
if (dinfo->bdrv != bdrv)
continue;
qemu_opts_del(dinfo->opts);
TAILQ_REMOVE(&drives, dinfo, next);
qemu_free(dinfo);
break;
}
}
| 17,013 |
qemu | bd269ebc82fbaa5fe7ce5bc7c1770ac8acecd884 | 0 | static void qio_dns_resolver_lookup_data_free(gpointer opaque)
{
struct QIODNSResolverLookupData *data = opaque;
size_t i;
qapi_free_SocketAddressLegacy(data->addr);
for (i = 0; i < data->naddrs; i++) {
qapi_free_SocketAddressLegacy(data->addrs[i]);
}
g_free(data->addrs);
... | 17,014 |
qemu | 5fb6c7a8b26eab1a22207d24b4784bd2b39ab54b | 0 | static void vnc_write(VncState *vs, const void *data, size_t len)
{
buffer_reserve(&vs->output, len);
if (buffer_empty(&vs->output)) {
qemu_set_fd_handler2(vs->csock, NULL, vnc_client_read, vnc_client_write, vs);
}
buffer_append(&vs->output, data, len);
}
| 17,015 |
qemu | 973945804d95878375b487c0c5c9b2556c5e4543 | 0 | static void tcx_stip_writel(void *opaque, hwaddr addr,
uint64_t val, unsigned size)
{
TCXState *s = opaque;
int i;
uint32_t col;
if (!(addr & 4)) {
s->tmpblit = val;
} else {
addr = (addr >> 3) & 0xfffff;
col = cpu_to_be32(s->tmpblit);
... | 17,016 |
qemu | 53687348813196551874409fecb49c94d20b1ae6 | 0 | int main(int argc, char *argv[])
{
const char *sparc_machines[] = { "SPARCbook", "Voyager", "SS-20", NULL };
const char *sparc64_machines[] = { "sun4u", "sun4v", NULL };
const char *mac_machines[] = { "mac99", "g3beige", NULL };
const char *arch = qtest_get_arch();
g_test_init(&argc, &argv, ... | 17,017 |
qemu | 4a1418e07bdcfaa3177739e04707ecaec75d89e1 | 0 | ram_addr_t qemu_ram_alloc(ram_addr_t size)
{
RAMBlock *new_block;
#ifdef CONFIG_KQEMU
if (kqemu_phys_ram_base) {
return kqemu_ram_alloc(size);
}
#endif
size = TARGET_PAGE_ALIGN(size);
new_block = qemu_malloc(sizeof(*new_block));
new_block->host = qemu_vmalloc(size);
... | 17,018 |
qemu | 203d65a4706be345c209f3408d3a011a3e48f0c9 | 0 | static void imx_gpt_write(void *opaque, hwaddr offset, uint64_t value,
unsigned size)
{
IMXGPTState *s = IMX_GPT(opaque);
uint32_t oldreg;
uint32_t reg = offset >> 2;
DPRINTF("(%s, value = 0x%08x)\n", imx_gpt_reg_name(reg),
(uint32_t)value);
switch (... | 17,019 |
qemu | 9ffe337c08388d5c587eae1d77db1b0d1a47c7b1 | 0 | void virtio_blk_data_plane_destroy(VirtIOBlockDataPlane *s)
{
if (!s) {
return;
}
virtio_blk_data_plane_stop(s);
g_free(s->batch_notify_vqs);
qemu_bh_delete(s->bh);
object_unref(OBJECT(s->iothread));
g_free(s);
}
| 17,022 |
qemu | c2b38b277a7882a592f4f2ec955084b2b756daaa | 0 | int qemu_poll_ns(GPollFD *fds, guint nfds, int64_t timeout)
{
#ifdef CONFIG_PPOLL
if (timeout < 0) {
return ppoll((struct pollfd *)fds, nfds, NULL, NULL);
} else {
struct timespec ts;
int64_t tvsec = timeout / 1000000000LL;
/* Avoid possibly overflowing and specifying a n... | 17,023 |
qemu | 1687a089f103f9b7a1b4a1555068054cb46ee9e9 | 0 | vreader_get_reader_by_name(const char *name)
{
VReader *reader = NULL;
VReaderListEntry *current_entry = NULL;
vreader_list_lock();
for (current_entry = vreader_list_get_first(vreader_list); current_entry;
current_entry = vreader_list_get_next(current_entry)) {
VReader *crea... | 17,025 |
qemu | 72cf2d4f0e181d0d3a3122e04129c58a95da713e | 0 | static BlockDriverState *get_bs_snapshots(void)
{
BlockDriverState *bs;
DriveInfo *dinfo;
if (bs_snapshots)
return bs_snapshots;
TAILQ_FOREACH(dinfo, &drives, next) {
bs = dinfo->bdrv;
if (bdrv_can_snapshot(bs))
goto ok;
}
return NULL;
ok:
... | 17,026 |
qemu | dc38852aaa4ac187d8b44201f75fc2835241912d | 0 | static void print_report(const char *op, struct timeval *t, int64_t offset,
int64_t count, int64_t total, int cnt, int Cflag)
{
char s1[64], s2[64], ts[64];
timestr(t, ts, sizeof(ts), Cflag ? VERBOSE_FIXED_TIME : 0);
if (!Cflag) {
cvtstr((double)total, s1, sizeof(s1)... | 17,027 |
qemu | ef1e1e0782e99c9dcf2b35e5310cdd8ca9211374 | 0 | static int tcp_set_msgfds(CharDriverState *chr, int *fds, int num)
{
TCPCharDriver *s = chr->opaque;
/* clear old pending fd array */
if (s->write_msgfds) {
g_free(s->write_msgfds);
}
if (num) {
s->write_msgfds = g_malloc(num * sizeof(int));
memcpy(s->write_msgfd... | 17,029 |
FFmpeg | b8664c929437d6d079e16979c496a2db40cf2324 | 0 | static av_always_inline int normal_limit(uint8_t *p, ptrdiff_t stride, int E, int I)
{
LOAD_PIXELS
return simple_limit(p, stride, E)
&& FFABS(p3-p2) <= I && FFABS(p2-p1) <= I && FFABS(p1-p0) <= I
&& FFABS(q3-q2) <= I && FFABS(q2-q1) <= I && FFABS(q1-q0) <= I;
}
| 17,031 |
qemu | 0e9b9edae7bebfd31fdbead4ccbbce03876a7edd | 0 | static void nvdimm_build_nfit(GSList *device_list, GArray *table_offsets,
GArray *table_data, GArray *linker)
{
GArray *structures = nvdimm_build_device_structure(device_list);
unsigned int header;
acpi_add_table(table_offsets, table_data);
/* NFIT header. */
... | 17,032 |
qemu | 9c605cb13547a5faa5cb1092e3e44ac8b0d0b841 | 0 | long disas_insn(DisasContext *s, uint8_t *pc_start)
{
int b, prefixes, aflag, dflag;
int shift, ot;
int modrm, reg, rm, mod, reg_addr, op, opreg, offset_addr, val;
unsigned int next_eip;
s->pc = pc_start;
prefixes = 0;
aflag = s->code32;
dflag = s->code32;
// cur_pc = ... | 17,034 |
qemu | 273a2142176098fe2c27f263d86ad66b133b43cb | 0 | static void pci_mmio_map(PCIDevice * pci_dev, int region_num,
uint32_t addr, uint32_t size, int type)
{
PCIEEPRO100State *d = DO_UPCAST(PCIEEPRO100State, dev, pci_dev);
logout("region %d, addr=0x%08x, size=0x%08x, type=%d\n",
region_num, addr, size, type);
if (r... | 17,035 |
qemu | a8170e5e97ad17ca169c64ba87ae2f53850dab4c | 0 | uint32_t ldl_le_phys(target_phys_addr_t addr)
{
return ldl_phys_internal(addr, DEVICE_LITTLE_ENDIAN);
}
| 17,037 |
qemu | e9cb190ad4cea8e6fd24afb973c5007b9a439bc9 | 0 | static void ivshmem_check_memdev_is_busy(const Object *obj, const char *name,
Object *val, Error **errp)
{
if (host_memory_backend_is_mapped(MEMORY_BACKEND(val))) {
char *path = object_get_canonical_path_component(val);
error_setg(errp, "can't use alread... | 17,038 |
qemu | 4618e658e6dadd1ba53585157984eac71cb706c6 | 0 | static int connect_to_ssh(BDRVSSHState *s, QDict *options,
int ssh_flags, int creat_mode)
{
int r, ret;
Error *err = NULL;
const char *host, *user, *path, *host_key_check;
int port;
host = qdict_get_str(options, "host");
if (qdict_haskey(options, "port")) {
... | 17,039 |
qemu | b131c74a0e485b084ddaffc8214c8a19af492be7 | 0 | int kvm_irqchip_add_irq_notifier(KVMState *s, EventNotifier *n, int virq)
{
return -ENOSYS;
}
| 17,040 |
qemu | 7ec1e5ea4bd0700fa48da86bffa2fcc6146c410a | 0 | static void gen_st_asi(DisasContext *dc, TCGv src, TCGv addr,
int insn, int size)
{
TCGv_i32 r_asi, r_size;
r_asi = gen_get_asi(dc, insn);
r_size = tcg_const_i32(size);
#ifdef TARGET_SPARC64
gen_helper_st_asi(cpu_env, addr, src, r_asi, r_size);
#else
{
TCGv... | 17,041 |
FFmpeg | 1ec83d9a9e472f485897ac92bad9631d551a8c5b | 0 | static double tget_double(const uint8_t **p, int le)
{
av_alias64 i = { .u64 = le ? AV_RL64(*p) : AV_RB64(*p)};
*p += 8;
return i.f64;
}
| 17,042 |
qemu | a8170e5e97ad17ca169c64ba87ae2f53850dab4c | 0 | void empty_slot_init(target_phys_addr_t addr, uint64_t slot_size)
{
if (slot_size > 0) {
/* Only empty slots larger than 0 byte need handling. */
DeviceState *dev;
SysBusDevice *s;
EmptySlot *e;
dev = qdev_create(NULL, "empty_slot");
s = sysbus_from_qdev(dev... | 17,044 |
qemu | 4678124bb9bfb49e93b83f95c4d2feeb443ea38b | 0 | build_fadt(GArray *table_data, BIOSLinker *linker, unsigned dsdt)
{
AcpiFadtDescriptorRev5_1 *fadt = acpi_data_push(table_data, sizeof(*fadt));
/* Hardware Reduced = 1 and use PSCI 0.2+ and with HVC */
fadt->flags = cpu_to_le32(1 << ACPI_FADT_F_HW_REDUCED_ACPI);
fadt->arm_boot_flags = cpu_to_le16... | 17,045 |
qemu | a8170e5e97ad17ca169c64ba87ae2f53850dab4c | 0 | void apic_enable_vapic(DeviceState *d, target_phys_addr_t paddr)
{
APICCommonState *s = DO_UPCAST(APICCommonState, busdev.qdev, d);
APICCommonClass *info = APIC_COMMON_GET_CLASS(s);
s->vapic_paddr = paddr;
info->vapic_base_update(s);
}
| 17,046 |
qemu | 32bafa8fdd098d52fbf1102d5a5e48d29398c0aa | 0 | void qmp_blockdev_snapshot_internal_sync(const char *device,
const char *name,
Error **errp)
{
BlockdevSnapshotInternal snapshot = {
.device = (char *) device,
.name = (char *) name
};
TransactionAction... | 17,047 |
qemu | 284197e41f0fe98d58ce5e8acd4966c91f28c4bd | 0 | void nvdimm_acpi_hotplug(AcpiNVDIMMState *state)
{
nvdimm_build_fit_buffer(&state->fit_buf);
}
| 17,049 |
qemu | 6a042827b638dc73da6a72c72596f5be80bd4581 | 0 | int ppc_radix64_handle_mmu_fault(PowerPCCPU *cpu, vaddr eaddr, int rwx,
int mmu_idx)
{
CPUState *cs = CPU(cpu);
CPUPPCState *env = &cpu->env;
PPCVirtualHypervisorClass *vhc =
PPC_VIRTUAL_HYPERVISOR_GET_CLASS(cpu->vhyp);
hwaddr raddr, pte_addr;
uint64_... | 17,050 |
FFmpeg | 919f3554387e043bdfe10c6369356d1104882183 | 1 | static inline void dxt1_decode_pixels(const uint8_t *s, uint32_t *d,
unsigned int qstride, unsigned int flag,
uint64_t alpha) {
unsigned int x, y, c0, c1, a = (!flag * 255u) << 24;
unsigned int rb0, rb1, rb2, rb3, g0, g1, g2, g3;
... | 17,051 |
qemu | 2ba1eeb62c29d23238b95dc7e9ade3444b49f0a1 | 1 | int cpu_restore_state(TranslationBlock *tb,
CPUState *env, unsigned long searched_pc,
void *puc)
{
TCGContext *s = &tcg_ctx;
int j;
unsigned long tc_ptr;
#ifdef CONFIG_PROFILER
int64_t ti;
#endif
#ifdef CONFIG_PROFILER
ti = profile_getclock();... | 17,052 |
FFmpeg | 544286b3d39365b30298ae07e66a755200b0895c | 1 | void h263_encode_picture_header(MpegEncContext * s, int picture_number)
{
int format;
align_put_bits(&s->pb);
put_bits(&s->pb, 22, 0x20);
put_bits(&s->pb, 8, ((s->picture_number * 30 * FRAME_RATE_BASE) /
s->frame_rate) & 0xff);
put_bits(&s->pb, 1, 1); /* marker *... | 17,053 |
qemu | 0dacea92d26c31d453c58de2e99c178fee554166 | 1 | _net_rx_pkt_calc_l4_csum(struct NetRxPkt *pkt)
{
uint32_t cntr;
uint16_t csum;
uint16_t csl;
uint32_t cso;
trace_net_rx_pkt_l4_csum_calc_entry();
if (pkt->isip4) {
if (pkt->isudp) {
csl = be16_to_cpu(pkt->l4hdr_info.hdr.udp.uh_ulen);
trace_net_rx_pkt... | 17,054 |
qemu | 3996e85c1822e05c50250f8d2d1e57b6bea1229d | 1 | int xen_hvm_init(ram_addr_t *below_4g_mem_size, ram_addr_t *above_4g_mem_size,
MemoryRegion **ram_memory)
{
int i, rc;
unsigned long ioreq_pfn;
unsigned long bufioreq_evtchn;
XenIOState *state;
state = g_malloc0(sizeof (XenIOState));
state->xce_handle = xen_xc_evtchn... | 17,055 |
FFmpeg | 8136f234445862c94d1c081606b2d1e3d44fccf3 | 1 | static void yop_paint_block(YopDecContext *s, int tag)
{
s->dstptr[0] = s->srcptr[0];
s->dstptr[1] = s->srcptr[paint_lut[tag][0]];
s->dstptr[s->frame.linesize[0]] = s->srcptr[paint_lut[tag][1]];
s->dstptr[s->frame.linesize[0] + 1] = s->srcptr[paint_... | 17,057 |
FFmpeg | fdbd924b84e85ac5c80f01ee059ed5c81d3cc205 | 1 | av_cold int ff_rv34_decode_init(AVCodecContext *avctx)
{
RV34DecContext *r = avctx->priv_data;
MpegEncContext *s = &r->s;
int ret;
ff_MPV_decode_defaults(s);
s->avctx = avctx;
s->out_format = FMT_H263;
s->codec_id = avctx->codec_id;
s->width = avctx->width;
s->h... | 17,058 |
FFmpeg | 90e8317b3b33dcb54ae01e419d85cbbfbd874963 | 1 | static int flic_decode_frame_24BPP(AVCodecContext *avctx,
void *data, int *got_frame,
const uint8_t *buf, int buf_size)
{
FlicDecodeContext *s = avctx->priv_data;
GetByteContext g2;
int pixel_ptr;
unsigned char palette_idx1;
... | 17,059 |
FFmpeg | 02dd3666c2944a3db44ba13916ba40dbdd41f9b1 | 1 | static int h264_mp4toannexb_filter(AVBitStreamFilterContext *bsfc,
AVCodecContext *avctx, const char *args,
uint8_t **poutbuf, int *poutbuf_size,
const uint8_t *buf, int buf_size,
... | 17,060 |
qemu | a8170e5e97ad17ca169c64ba87ae2f53850dab4c | 0 | static void dchip_write(void *opaque, target_phys_addr_t addr,
uint64_t val, unsigned size)
{
/* Skip this. It's all related to DRAM timing and setup. */
}
| 17,061 |
qemu | 19494f811a43c6bc226aa272d86300d9229224fe | 0 | qemu_irq get_cps_irq(MIPSCPSState *s, int pin_number)
{
MIPSCPU *cpu = MIPS_CPU(first_cpu);
CPUMIPSState *env = &cpu->env;
assert(pin_number < s->num_irq);
/* TODO: return GIC pins once implemented */
return env->irq[pin_number];
}
| 17,062 |
qemu | 455aa1e0818653c41fd794435b982426ce21ba2f | 0 | static int tcp_chr_write(CharDriverState *chr, const uint8_t *buf, int len)
{
TCPCharDriver *s = chr->opaque;
if (s->connected) {
return send_all(s->fd, buf, len);
} else {
/* (Re-)connect for unconnected writing */
tcp_chr_connect(chr);
return 0;
}
}
| 17,063 |
qemu | 9f56640c8536a8dfb78fc05a39c1bf9921483b12 | 0 | static int img_create(int argc, char **argv)
{
int c, ret, flags;
const char *fmt = "raw";
const char *base_fmt = NULL;
const char *filename;
const char *base_filename = NULL;
BlockDriver *drv;
QEMUOptionParameter *param = NULL;
char *options = NULL;
flags = 0;
for(;... | 17,064 |
FFmpeg | cb5469462d427ea38625e255306f07b37d75280f | 0 | static int fill_filter_caches(H264Context *h, int mb_type){
MpegEncContext * const s = &h->s;
const int mb_xy= h->mb_xy;
int top_xy, left_xy[2];
int top_type, left_type[2];
top_xy = mb_xy - (s->mb_stride << MB_FIELD);
//FIXME deblocking could skip the intra and nnz parts.
/... | 17,065 |
qemu | ddf21908961073199f3d186204da4810f2ea150b | 0 | static void test_visitor_in_list(TestInputVisitorData *data,
const void *unused)
{
UserDefOneList *item, *head = NULL;
Error *err = NULL;
Visitor *v;
int i;
v = visitor_input_test_init(data, "[ { 'string': 'string0', 'integer': 42 }, { 'string': 'string1', '... | 17,066 |
qemu | eabb7b91b36b202b4dac2df2d59d698e3aff197a | 0 | static inline void tcg_out_ext8u(TCGContext *s, int dest, int src)
{
/* movzbl */
assert(src < 4 || TCG_TARGET_REG_BITS == 64);
tcg_out_modrm(s, OPC_MOVZBL + P_REXB_RM, dest, src);
}
| 17,067 |
qemu | 4b7a6bf402bd064605c287eecadc493ccf2d4897 | 0 | static int cpu_post_load(void *opaque, int version_id)
{
ARMCPU *cpu = opaque;
int i, v;
/* Update the values list from the incoming migration data.
* Anything in the incoming data which we don't know about is
* a migration failure; anything we know about but the incoming
* data does... | 17,068 |
qemu | e58481234ef9c132554cc529d9981ebd78fb6903 | 0 | static void vhost_virtqueue_stop(struct vhost_dev *dev,
struct VirtIODevice *vdev,
struct vhost_virtqueue *vq,
unsigned idx)
{
int vhost_vq_index = dev->vhost_ops->vhost_get_vq_index(dev, idx);
stru... | 17,069 |
qemu | 273a2142176098fe2c27f263d86ad66b133b43cb | 0 | static void pci_map(PCIDevice * pci_dev, int region_num,
uint32_t addr, uint32_t size, int type)
{
PCIEEPRO100State *d = DO_UPCAST(PCIEEPRO100State, dev, pci_dev);
EEPRO100State *s = &d->eepro100;
logout("region %d, addr=0x%08x, size=0x%08x, type=%d\n",
region_num, add... | 17,070 |
qemu | 3098dba01c7daab60762b6f6624ea88c0d6cb65a | 0 | static void host_signal_handler(int host_signum, siginfo_t *info,
void *puc)
{
int sig;
target_siginfo_t tinfo;
/* the CPU emulator uses some host signals to detect exceptions,
we forward to it some signals */
if ((host_signum == SIGSEGV || host_signum == ... | 17,071 |
qemu | a5cf8262e4eb9c4646434e2c6211ef8608db3233 | 0 | static char *scsibus_get_fw_dev_path(DeviceState *dev)
{
SCSIDevice *d = SCSI_DEVICE(dev);
char path[100];
snprintf(path, sizeof(path), "channel@%x/%s@%x,%x", d->channel,
qdev_fw_name(dev), d->id, d->lun);
return strdup(path);
}
| 17,073 |
qemu | c39ce112b60ffafbaf700853e32bea74cbb2c148 | 0 | static void lsi_do_command(LSIState *s)
{
SCSIDevice *dev;
uint8_t buf[16];
uint32_t id;
int n;
DPRINTF("Send command len=%d\n", s->dbc);
if (s->dbc > 16)
s->dbc = 16;
cpu_physical_memory_read(s->dnad, buf, s->dbc);
s->sfbr = buf[0];
s->command_complete = 0;
... | 17,074 |
qemu | 7e01376daea75e888c370aab521a7d4aeaf2ffd1 | 0 | void ioinst_handle_chsc(S390CPU *cpu, uint32_t ipb)
{
ChscReq *req;
ChscResp *res;
uint64_t addr;
int reg;
uint16_t len;
uint16_t command;
CPUS390XState *env = &cpu->env;
uint8_t buf[TARGET_PAGE_SIZE];
trace_ioinst("chsc");
reg = (ipb >> 20) & 0x00f;
addr = env-... | 17,075 |
FFmpeg | ebbcdc9ac0ea190748a1605bda86ce84466c8b4e | 0 | static int ff_estimate_motion_b(MpegEncContext * s,
int mb_x, int mb_y, int16_t (*mv_table)[2], Picture *picture, int f_code)
{
int mx, my, range, dmin;
int xmin, ymin, xmax, ymax;
int rel_xmin, rel_ymin, rel_xmax, rel_ymax;
int pred_x=0, pred_y=0;
int P[10][2];
co... | 17,076 |
qemu | 3f9286b7214fbc7135d4fc223f07b0b30b91e2f1 | 0 | int inet_connect_opts(QemuOpts *opts, Error **errp,
NonBlockingConnectHandler *callback, void *opaque)
{
struct addrinfo *res, *e;
int sock = -1;
bool in_progress;
ConnectState *connect_state = NULL;
res = inet_parse_connect_opts(opts, errp);
if (!res) {
... | 17,077 |
qemu | ad674e53b5cce265fadafbde2c6a4f190345cd00 | 0 | static void channel_run(DBDMA_channel *ch)
{
dbdma_cmd *current = &ch->current;
uint16_t cmd, key;
uint16_t req_count;
uint32_t phy_addr;
DBDMA_DPRINTF("channel_run\n");
dump_dbdma_cmd(current);
/* clear WAKE flag at command fetch */
ch->regs[DBDMA_STATUS] &= cpu_to_be32(~... | 17,078 |
qemu | 8b7968f7c4ac8c07cad6a1a0891d38cf239a2839 | 0 | static void error(const char *fmt, ...)
{
va_list ap;
va_start(ap, fmt);
fprintf(stderr, "qemu-img: ");
vfprintf(stderr, fmt, ap);
fprintf(stderr, "\n");
va_end(ap);
}
| 17,079 |
qemu | 3ba235a02284c39b34a68a2a588508ffb52a7b55 | 0 | void aio_set_fd_handler(AioContext *ctx,
int fd,
IOHandler *io_read,
IOHandler *io_write,
void *opaque)
{
/* fd is a SOCKET in our case */
AioHandler *node;
QLIST_FOREACH(node, &ctx->aio_handlers, node)... | 17,080 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.