Projectname
large_stringclasses
15 values
Filepath
large_stringlengths
4
106
Function
large_stringlengths
11
3.45k
Label
list
qemu
exec.c
static void openrisc_cpu_initfn(Object *obj) { CPUState *cs = CPU(obj); OpenRISCCPU *cpu = OPENRISC_CPU(obj); static int inited; cs->env_ptr = &cpu->env; cpu_exec_init(cs, &error_abort); #ifndef CONFIG_USER_ONLY cpu_openrisc_mmu_init(cpu); #endif if (tcg_enabled() && !inited) { inited = 1; ...
[ 1, 0 ]
qemu
blockdev.c
static int eject_device(Monitor *mon, BlockDriverState *bs, int force) { if (bdrv_is_inserted(bs)) { if (!force) { if (!bdrv_is_removable(bs)) { qerror_report(QERR_DEVICE_NOT_REMOVABLE, bdrv_get_device_name(bs)); return -1; } if (bdrv_is_locked(bs)) ...
[ 1, 0 ]
qemu
tests/e1000e-test.c
static void setup_vm_cmd(IVState *s, const char *cmd, bool msix) { uint64_t barsize; s->qtest = qtest_start(cmd); s->pcibus = qpci_init_pc(NULL); s->dev = get_device(s->pcibus); s->reg_base = qpci_iomap(s->dev, 0, &barsize); g_assert_nonnull(s->reg_base); g_assert_cmpuint(barsize, ==, 256); if ...
[ 1, 0 ]
qemu
block/bochs.c
static void nvme_init_sq(NvmeSQueue *sq, NvmeCtrl *n, uint64_t dma_addr, uint16_t sqid, uint16_t cqid, uint16_t size) { int i; NvmeCQueue *cq; sq->ctrl = n; sq->dma_addr = dma_addr; sq->sqid = sqid; sq->size = size; sq->cqid = cqid; sq->head = sq->tail = 0; sq->io_r...
[ 1, 0 ]
qemu
console.c
static int qemu_chr_open_pp(QemuOpts *opts, CharDriverState **_chr) { const char *filename = qemu_opt_get(opts, "path"); CharDriverState *chr; int fd; fd = qemu_open(filename, O_RDWR); if (fd < 0) { return -errno; } chr = g_malloc0(sizeof(CharDriverState)); chr->opaque = (void *)(intptr_t)f...
[ 1, 0 ]
qemu
target-i386/kvm.c
static int kvm_put_fpu(X86CPU *cpu) { CPUX86State *env = &cpu->env; struct kvm_fpu fpu; int i; memset(&fpu, 0, sizeof fpu); fpu.fsw = env->fpus & ~(7 << 11); fpu.fsw |= (env->fpstt & 7) << 11; fpu.fcw = env->fpuc; fpu.last_opcode = env->fpop; fpu.last_ip = env->fpip; fpu.last_dp = env->fp...
[ 1, 0 ]
qemu
tests/virtio-9p-test.c
static void v9fs_req_recv(P9Req *req, uint8_t id) { QVirtIO9P *v9p = req->v9p; P9Hdr hdr; int i; for (i = 0; i < 10; i++) { qvirtio_wait_queue_isr(v9p->dev, v9p->vq, 1000 * 1000); v9fs_memread(req, &hdr, 7); le32_to_cpus(&hdr.size); le16_to_cpus(&hdr.tag); if (hdr.size >= 7) { ...
[ 1, 0 ]
qemu
block/qcow2-cluster.c
static int count_contiguous_clusters(uint64_t nb_clusters, int cluster_size, uint64_t *l2_table, uint64_t stop_flags) { int i; uint64_t mask = stop_flags | L2E_OFFSET_MASK | QCOW_OFLAG_COMPRESSED; uint64_t first_entry = be64_to_cpu(l2_table[0]); uint64_t offset = first...
[ 1, 0 ]
qemu
check-qlist.c
START_TEST(qlist_iter_test) { int i; QList *qlist; qlist = qlist_new(); for (i = 0; i < iter_max; i++) qlist_append(qlist, qint_from_int(i)); iter_called = 0; qlist_iter(qlist, iter_func, NULL); fail_unless(iter_called == iter_max); QDECREF(qlist); }
[ 0, 0 ]
FFmpeg
libavcodec/mips/h264qpel_msa.c
void ff_avg_h264_qpel16_mc11_msa(uint8_t *dst, const uint8_t *src, ptrdiff_t stride) { avc_luma_hv_qrt_and_aver_dst_16x16_msa(src - 2, src - (stride * 2), stride, dst, stride); }
[ 0, 0 ]
qemu
target/m68k/cpu.c
static void m68k_cpu_reset(CPUState *s) { M68kCPU *cpu = M68K_CPU(s); M68kCPUClass *mcc = M68K_CPU_GET_CLASS(cpu); CPUM68KState *env = &cpu->env; mcc->parent_reset(s); memset(env, 0, offsetof(CPUM68KState, end_reset_fields)); #if !defined(CONFIG_USER_ONLY) env->sr = 0x2700; #endif m68k_switch_sp...
[ 1, 1 ]
qemu
hw/misc/vfio.c
static bool vfio_listener_skipped_section(MemoryRegionSection *section) { return !memory_region_is_ram(section->mr); }
[ 0, 0 ]
qemu
net.c
void net_slirp_redir(const char *redir_str) { int is_udp; char buf[256], *r; const char *p; struct in_addr guest_addr; int host_port, guest_port; if (!slirp_inited) { slirp_inited = 1; slirp_init(0, NULL); } p = redir_str; if (get_str_sep(buf, sizeof(buf), &p, ':') < 0) goto fa...
[ 1, 0 ]
qemu
block/nbd.c
int socket_dgram(SocketAddressLegacy *remote, SocketAddressLegacy *local, Error **errp) { int fd; /* * TODO SOCKET_ADDRESS_LEGACY_KIND_FD when fd is AF_INET or AF_INET6 * (although other address families can do SOCK_DGRAM, too) */ switch (remote->type) { case SOCKET_ADDRESS_LEG...
[ 0, 1 ]
FFmpeg
libavfilter/vf_yadif.c
static void filter_line_c(uint8_t *dst, uint8_t *prev, uint8_t *cur, uint8_t *next, int w, int refs, int parity, int mode) { int x; uint8_t *prev2 = parity ? prev : cur; uint8_t *next2 = parity ? cur : next; for (x = 0; x < w; x++) { int c = cur[-r...
[ 1, 0 ]
FFmpeg
libavformat/id3v1.c
static int parse_tag(AVFormatContext *s, const uint8_t *buf) { int genre; if (!(buf[0] == 'T' && buf[1] == 'A' && buf[2] == 'G')) return -1; get_string(s, "title", buf + 3, 30); get_string(s, "artist", buf + 33, 30); get_string(s, "album", buf + 63, 30); get_string(s, "date", b...
[ 1, 0 ]
qemu
block/raw-win32.c
int qemu_ftruncate64(int fd, int64_t length) { LARGE_INTEGER li; LONG high; HANDLE h; BOOL res; if ((GetVersion() & 0x80000000UL) && (length >> 32) != 0) return -1; h = (HANDLE)_get_osfhandle(fd); /* get current position, ftruncate do not change position */ li.HighPart = 0; li.LowPart =...
[ 1, 0 ]
FFmpeg
libavcodec/libmp3lame.c
static av_cold int MP3lame_encode_init(AVCodecContext *avctx) { Mp3AudioContext *s = avctx->priv_data; if (avctx->channels > 2) return -1; s->stereo = avctx->channels > 1 ? 1 : 0; if ((s->gfp = lame_init()) == NULL) goto err; lame_set_in_samplerate(s->gfp, avctx->sample_rate); lame_set_out_...
[ 1, 0 ]
qemu
hw/display/dpcd.c
I2CBus *aux_get_i2c_bus(AUXBus *bus) { return aux_bridge_get_i2c_bus(bus->bridge); }
[ 1, 0 ]
qemu
target-arm/helper.c
static int bad_mode_switch(CPUARMState *env, int mode, CPSRWriteType write_type) { /* Return true if it is not valid for us to switch to * this CPU mode (ie all the UNPREDICTABLE cases in * the ARM ARM CPSRWriteByInstr pseudocode). /* Changes to or from Hyp via MSR and CPS are illegal. */ ((e...
[ 1, 0 ]
qemu
migration/postcopy-ram.c
void *postcopy_get_tmp_page(MigrationIncomingState *mis) { if (!mis->postcopy_tmp_page) { mis->postcopy_tmp_page = mmap(NULL, getpagesize(), PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, ...
[ 1, 0 ]
qemu
cpu-exec.c
void cpu_interrupt(CPUState *s) { s->interrupt_request = 1; }
[ 0, 0 ]
qemu
Makefile.objs
static int send_palette_rect(VncState *vs, int w, int h, struct QDict *palette) { int stream = 2; int level = tight_conf[vs->tight_compression].idx_zlib_level; int colors; size_t bytes; colors = qdict_size(palette); vnc_write_u8(vs, (stream | VNC_TIGHT_EXPLICIT_FILTER) << 4); vnc_write_u8(vs, VNC_...
[ 1, 0 ]
qemu
hw/display/xenfb.c
static inline ioreq_t *xen_vcpu_ioreq(shared_iopage_t *shared_page, int vcpu) { return &shared_page->vcpu_iodata[vcpu].vp_ioreq; }
[ 0, 0 ]
qemu
hw/display/cirrus_vga.c
static void cirrus_bitblt_fill_nop(CirrusVGAState *s, uint8_t *dst, int dstpitch, int bltwidth, int bltheight) {}
[ 0, 0 ]
FFmpeg
libavcodec/dxva2_h264.c
static int copy_parameter_set(void **to, void **from, int count, int size) { int i; for (i = 0; i < count; i++) { if (to[i] && !from[i]) { av_freep(&to[i]); } else if (from[i] && !to[i]) { to[i] = av_malloc(size); if (!to[i]) return AVERROR(ENOMEM); } if (from[i])...
[ 1, 0 ]
qemu
hw/i386/intel_iommu.c
static void vtd_iommu_replay(MemoryRegion *mr, IOMMUNotifier *n) { VTDAddressSpace *vtd_as = container_of(mr, VTDAddressSpace, iommu); IntelIOMMUState *s = vtd_as->iommu_state; uint8_t bus_n = pci_bus_num(vtd_as->bus); VTDContextEntry ce; if (vtd_dev_to_context_entry(s, bus_n, vtd_as->devfn, &ce) == 0) ...
[ 0, 0 ]
qemu
hw/pci/msi.c
static int msi_msix_setup(XenPCIPassthroughState *s, uint64_t addr, uint32_t data, int *ppirq, bool is_msix, int msix_entry, bool is_not_mapped) { uint8_t...
[ 1, 0 ]
qemu
hw/i2c.c
SSIBus *ssi_create_bus(DeviceState *parent, const char *name) { BusState *bus; bus = qbus_create(BUS_TYPE_SSI, sizeof(SSIBus), parent, name); return FROM_QBUS(SSIBus, bus); }
[ 1, 0 ]
qemu
target-ppc/cpu.h
static uint64_t ppc_hash64_page_shift(ppc_slb_t *slb) { uint64_t epnshift; /* Page size according to the SLB, which we use to generate the * EPN for hash table lookup.. When we implement more recent MMU * extensions this might be different from the actual page size * encoded in the PTE */ if ((sl...
[ 1, 0 ]
FFmpeg
libavcodec/h264pred_template.c
static void FUNCC(pred4x4_dc)(uint8_t *_src, const uint8_t *topright, int _stride) { pixel *src = (pixel *)_src; int stride = _stride / sizeof(pixel); const int dc = (src[-stride] + src[1 - stride] + src[2 - stride] + src[3 - stride] + src[-1 + 0 * stride] + src[-1 +...
[ 1, 0 ]
qemu
hw/i2c.h
i2c_slave *twl92230_init(i2c_bus *bus, qemu_irq irq) { struct menelaus_s *s = (struct menelaus_s *) i2c_slave_init(bus, 0, sizeof(struct menelaus_s)); s->i2c.event = menelaus_event; s->i2c.recv = menelaus_rx; s->i2c.send = menelaus_tx; s->irq = irq; s->rtc.hz = qemu_new_timer(rt_clock, menelau...
[ 1, 0 ]
FFmpeg
libavfilter/avfilter.h
int ff_draw_slice(AVFilterLink *link, int y, int h, int slice_dir) { uint8_t *src[4], *dst[4]; int i, j, vsub, ret; int (*draw_slice)(AVFilterLink *, int, int, int); FF_TPRINTF_START(NULL, draw_slice); ff_tlog_link(NULL, link, 0); ff_tlog(NULL, " y:%d h:%d dir:%d\n", y, h, slice_dir); /* copy the sl...
[ 1, 0 ]
qemu
HACKING
static uint64_t cmd646_cmd_read(void *opaque, target_phys_addr_t addr, unsigned size) { CMD646BAR *cmd646bar = opaque; if (addr != 2 || size != 1) { return ((uint64_t)1 << (size * 8)) - 1; } return ide_status_read(cmd646bar->bus, addr + 2); }
[ 1, 0 ]
qemu
docs/specs/vhost-user.txt
int net_init_vhost_user(const NetClientOptions *opts, const char *name, NetClientState *peer, Error **errp) { const NetdevVhostUserOptions *vhost_user_opts; CharDriverState *chr; assert(opts->kind == NET_CLIENT_OPTIONS_KIND_VHOST_USER); vhost_user_opts = opts->vhost_user; chr = ...
[ 0, 0 ]
qemu
cpus.c
static void *tcg_cpu_thread_fn(void *arg) { CPUState *env = arg; qemu_tcg_init_cpu_signals(); qemu_thread_self(env->thread); /* signal CPU creation */ qemu_mutex_lock(&qemu_global_mutex); for (env = first_cpu; env != NULL; env = env->next_cpu) env->created = 1; qemu_cond_signal(&qemu_cpu_cond...
[ 0, 0 ]
qemu
target-sparc/translate.c
static inline void gen_op_mulscc(TCGv dst, TCGv src1, TCGv src2) { TCGv r_temp, zero; r_temp = tcg_temp_new(); /* old op: if (!(env->y & 1)) T1 = 0; */ zero = tcg_const_tl(0); tcg_gen_andi_tl(cpu_cc_src, src1, 0xffffffff); tcg_gen_andi_tl(r_temp, cpu_y, 0x1); tcg_gen_andi_tl(cpu_cc_sr...
[ 0, 0 ]
qemu
block/blkreplay.c
static int coroutine_fn blkreplay_co_pwrite_zeroes(BlockDriverState *bs, int64_t offset, int count, BdrvRequestFlags flags) { uint64_t reqid = request_id++; int ret = bdrv_co_pwrite_zeroes(bs->file->bs, offset,...
[ 0, 0 ]
qemu
hw/esp.c
SCSIRequest *scsi_req_new(SCSIDevice *d, uint32_t tag, uint32_t lun, void *hba_private) { return d->info->alloc_req(d, tag, lun, hba_private); }
[ 0, 0 ]
qemu
block/nbd.c
static int nbd_send_negotiate(int csock, off_t size, uint32_t flags) { char buf[8 + 8 + 8 + 128]; /* Negotiate [ 0 .. 7] passwd ("NBDMAGIC") [ 8 .. 15] magic (0x00420281861253) [16 .. 23] size [24 .. 27] flags [28 .. 151] reserved (0) */ TRACE("Beginn...
[ 1, 0 ]
qemu
hw/dp8393x.c
static void net_rx_packet(void *opaque, const uint8_t *buf, size_t size) { struct XenNetDev *netdev = opaque; netif_rx_request_t rxreq; RING_IDX rc, rp; void *page; if (netdev->xendev.be_state != XenbusStateConnected) return; rc = netdev->rx_ring.req_cons; rp = netdev->rx_ring.sring->req_prod...
[ 1, 0 ]
qemu
block/raw-posix.c
static BlockDriverAIOCB * paio_submit(BlockDriverState *bs, int fd, int64_t sector_num, QEMUIOVector *qiov, int nb_sectors, BlockDriverCompletionFunc *cb, void *opaque, int type) { RawPosixAIOData *acb = g_slice_new(RawPosixAIOData); acb->bs = bs; acb->aio_type = type; acb->aio_fi...
[ 0, 0 ]
qemu
linux-user/qemu.h
long do_rt_sigreturn(CPUX86State *env) { abi_ulong frame_addr; struct rt_sigframe *frame; sigset_t set; int eax; frame_addr = env->regs[R_ESP] - 4; if (!lock_user_struct(VERIFY_READ, frame, frame_addr, 1)) goto badframe; target_to_host_sigset(&set, &frame->uc.tuc_sigmask); sigprocmask(SIG_...
[ 1, 0 ]
qemu
hw/virtio-pci.c
static void virtio_init_pci(VirtIOPCIProxy *proxy, VirtIODevice *vdev, uint16_t vendor, uint16_t device, uint16_t class_code, uint8_t pif) { uint8_t *config; uint32_t size; proxy->vdev = vdev; config = proxy->pci_dev.config; pci_config_set_vendor...
[ 1, 0 ]
qemu
target-i386/cpu.c
static int check_features_against_host(x86_def_t *guest_def) { x86_def_t host_def; uint32_t mask; int rv, i; struct model_features_t ft[] = { {&guest_def->features, &host_def.features, ~0, feature_name, 0x00000000}, {&guest_def->ext_features, &host_def.ext_features, ~CPUID_EXT...
[ 1, 0 ]
qemu
hw/acpi/pcihp.c
static int pci_vpb_map_irq(PCIDevice *d, int irq_num) { PCIVPBState *s = container_of(d->bus, PCIVPBState, pci_bus); if (s->irq_mapping == PCI_VPB_IRQMAP_BROKEN) { /* Legacy broken IRQ mapping for compatibility with old and * buggy Linux guests */ return irq_num; } /* Slot to IRQ mappi...
[ 0, 0 ]
qemu
hw/char/virtio-serial-bus.c
static VirtIOSerialPort *find_port_by_name(char *name) { VirtIOSerial *vser; QLIST_FOREACH(vser, &vserdevices.devices, next) { VirtIOSerialPort *port; QTAILQ_FOREACH(port, &vser->ports, next) { if (!strcmp(port->name, name)) { return port; } } } return NULL; }
[ 0, 0 ]
qemu
target-mips/cpu.h
void op_mtc0_status(void) { uint32_t val, old; uint32_t mask = env->Status_rw_bitmask; /* No reverse endianness, no MDMX/DSP, no 64bit ops implemented. */ val = T0 & mask; old = env->CP0_Status; if (!(val & (1 << CP0St_EXL)) && !(val & (1 << CP0St_ERL)) && !(env->hflags & MIPS_HFL...
[ 1, 0 ]
qemu
backends/baum.c
static CharDriverState *qemu_chr_open_pty(const char *id, ChardevReturn *ret) { CharDriverState *chr; PtyCharDriver *s; int master_fd, slave_fd; char pty_name[PATH_MAX]; master_fd = qemu_openpty_raw(&slave_fd, pty_name); if (master_fd < 0) { return NULL...
[ 0, 0 ]
qemu
hw/s390x/css.c
static void css_init(void) { QTAILQ_INIT(&channel_subsys.pending_crws); channel_subsys.sei_pending = false; channel_subsys.do_crw_mchk = true; channel_subsys.crws_lost = false; channel_subsys.chnmon_active = false; QTAILQ_INIT(&channel_subsys.io_adapters); QTAILQ_INIT(&channel_subsys.indicator_add...
[ 0, 0 ]
qemu
block/qapi.c
static void test_validate_struct(TestInputVisitorData *data, const void *unused) { TestStruct *p = NULL; Visitor *v; v = validate_test_init( data, "{ 'integer': -42, 'boolean': true, 'string': 'foo' }"); visit_type_TestStruct(v, NULL, &p, &error_abort); g_free(p->...
[ 0, 0 ]
qemu
hw/acpi/aml-build.c
build_fadt(GArray *table_data, GArray *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((1 << ACPI_FA...
[ 1, 0 ]
FFmpeg
libavcodec/dvdsubdec.c
static int dvdsub_decode(AVCodecContext *avctx, void *data, int *data_size, AVPacket *avpkt) { DVDSubContext *ctx = avctx->priv_data; const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; AVSubtitle *sub = data; int is_menu; if (ctx->buf_siz...
[ 1, 0 ]
FFmpeg
libavformat/movenc.c
static int mov_write_moov_tag(ByteIOContext *pb, MOVContext *mov, AVFormatContext *s) { int i; offset_t pos = url_ftell(pb); put_be32(pb, 0); /* size placeholder*/ put_tag(pb, "moov"); mov->timescale = globalTimescale; for (i = 0; i < MAX_STREAMS; i++) { if (mov->t...
[ 1, 0 ]
qemu
vnc.c
static void send_framebuffer_update_raw(VncState *vs, int x, int y, int w, int h) { int i; uint8_t *row; row = ds_get_data(vs->ds) + y * ds_get_linesize(vs->ds) + x * ds_get_bytes_per_pixel(vs->ds); for (i = 0; i < h; i++) { vs->write_pixels(vs, row, w *...
[ 1, 0 ]
qemu
hw/ds1338.c
static int ds1338_recv(I2CSlave *i2c) { DS1338State *s = FROM_I2C_SLAVE(DS1338State, i2c); uint8_t res; res = s->nvram[s->ptr]; s->ptr = (s->ptr + 1) & 0xff; return res; }
[ 1, 0 ]
qemu
savevm.c
static int announce_self_create(uint8_t *buf, uint8_t *mac_addr) { uint32_t magic = EXPERIMENTAL_MAGIC; uint16_t proto = htons(ETH_P_EXPERIMENTAL); /* FIXME: should we send a different packet (arp/rarp/ping)? */ memset(buf, 0, 64); memset(buf, 0xff, 6); /* h_dst */ me...
[ 1, 1 ]
qemu
Makefile.objs
size_t qsb_get_length(const QEMUSizedBuffer *qsb) { return qsb->used; }
[ 1, 0 ]
FFmpeg
libavcodec/dxva2_mpeg2.c
static void x8_init_block_index(MpegEncContext *s) { // FIXME maybe merge with ff_* // not s->linesize as this would be wrong for field pics // not that IntraX8 has interlacing support ;) const int linesize = s->current_picture.f.linesize[0]; const int uvlinesize = s->current_picture.f.linesize[1]; s->de...
[ 1, 1 ]
qemu
accel/tcg/translator.c
static bool use_exit_tb(DisasContext *ctx) { return ((ctx->base.tb->cflags & CF_LAST_IO) || ctx->base.singlestep_enabled || singlestep); }
[ 1, 0 ]
qemu
target-ppc/translate.c
static int register_insn(opc_handler_t **ppc_opcodes, opcode_t *insn) { if (insn->opc2 != 0xFF) { if (insn->opc3 != 0xFF) { if (register_dblind_insn(ppc_opcodes, insn->opc1, insn->opc2, insn->opc3, &insn->handler) < 0) return -1; } else { if (register...
[ 1, 0 ]
qemu
hw/net/stellaris_enet.c
static ssize_t stellaris_enet_receive(NetClientState *nc, const uint8_t *buf, size_t size) { stellaris_enet_state *s = qemu_get_nic_opaque(nc); int n; uint8_t *p; uint32_t crc; if ((s->rctl & SE_RCTL_RXEN) == 0) return -1; if (s->np >= 31) { return 0; ...
[ 1, 1 ]
qemu
vl.c
static void dynticks_rearm_timer(struct qemu_alarm_timer *t) { timer_t host_timer = (timer_t)(long)t->priv; struct itimerspec timeout; int64_t nearest_delta_us = INT64_MAX; int64_t current_us; if (!active_timers[QEMU_TIMER_REALTIME] && !active_timers[QEMU_TIMER_VIRTUAL]) return; nearest_d...
[ 1, 0 ]
qemu
block/io.c
static int64_t coroutine_fn bdrv_co_get_block_status_above(BlockDriverState *bs, BlockDriverState *base, int64_t sector_num, int nb_sectors, int *pnum) { BlockDriverState *p; int64_t re...
[ 1, 0 ]
qemu
hw/timer/xilinx_timer.c
timer_write(void *opaque, hwaddr addr, uint64_t val64, unsigned int size) { struct timerblock *t = opaque; struct xlx_timer *xt; unsigned int timer; uint32_t value = val64; addr >>= 2; timer = timer_from_addr(addr); xt = &t->timers[timer]; D(fprintf(stderr, "%s addr=%x val=%x (time...
[ 1, 0 ]
qemu
target-xtensa/cpu.h
void cpu_dump_state(CPUState *env, FILE *f, fprintf_function cpu_fprintf, int flags) { int i; cpu_fprintf(f, "PC=%08x\n", env->pc); for (i = 0; i < 16; ++i) { cpu_fprintf(f, "A%02d=%08x%c", i, env->regs[i], (i % 4) == 3 ? '\n' : ' '); } }
[ 0, 0 ]
qemu
accel/kvm/kvm-all.c
int kvm_has_sync_mmu(void) { return kvm_check_extension(kvm_state, KVM_CAP_SYNC_MMU); }
[ 0, 0 ]
qemu
HACKING
static uint64_t pic_ioport_read(void *opaque, target_phys_addr_t addr, unsigned size) { PICCommonState *s = opaque; int ret; if (s->poll) { ret = pic_get_irq(s); if (ret >= 0) { pic_intack(s, ret); ret |= 0x80; } else { ret = 0; } s...
[ 1, 0 ]
qemu
hw/apb_pci.c
static int pbm_pci_host_init(PCIDevice *d) { pci_config_set_vendor_id(d->config, PCI_VENDOR_ID_SUN); pci_config_set_device_id(d->config, PCI_DEVICE_ID_SUN_SABRE); pci_set_word(d->config + PCI_COMMAND, PCI_COMMAND_MEMORY | PCI_COMMAND_MASTER); pci_set_word(d->config + PCI_STATUS, ...
[ 0, 0 ]
qemu
hw/i386/pc.c
static void pc_dimm_unplug(HotplugHandler *hotplug_dev, DeviceState *dev, Error **errp) { PCMachineState *pcms = PC_MACHINE(hotplug_dev); PCDIMMDevice *dimm = PC_DIMM(dev); PCDIMMDeviceClass *ddc = PC_DIMM_GET_CLASS(dimm); MemoryRegion *mr = ddc->get_memory_region(dimm); Hotp...
[ 1, 0 ]
qemu
hw/msix.c
static int msix_is_masked(PCIDevice *dev, int vector) { unsigned offset = vector * PCI_MSIX_ENTRY_SIZE + PCI_MSIX_ENTRY_VECTOR_CTRL; return dev->msix_function_masked || dev->msix_table_page[offset] & PCI_MSIX_ENTRY_CTRL_MASKBIT; }
[ 1, 0 ]
qemu
Makefile.objs
static void *qemu_rdma_data_init(const char *host_port, Error **errp) { RDMAContext *rdma = NULL; InetSocketAddress *addr; if (host_port) { rdma = g_malloc0(sizeof(RDMAContext)); memset(rdma, 0, sizeof(RDMAContext)); rdma->current_index = -1; rdma->current_chunk = -1; addr = inet_pars...
[ 1, 0 ]
qemu
tests/tco-test.c
static void test_tco_second_timeout_pause(void) { TestData td; const uint16_t ticks = TCO_SECS_TO_TICKS(32); QDict *ad; td.args = "-watchdog-action pause"; td.noreboot = false; test_init(&td); stop_tco(&td); clear_tco_status(&td); reset_on_second_timeout(true); set_tco_timeout(&td, TCO_SE...
[ 1, 0 ]
qemu
hw/arm_gic.c
qemu_irq *pxa2xx_pic_init(target_phys_addr_t base, CPUState *env) { struct pxa2xx_pic_state_s *s; int iomemtype; qemu_irq *qi; s = (struct pxa2xx_pic_state_s *) qemu_mallocz(sizeof(struct pxa2xx_pic_state_s)); if (!s) return NULL; s->cpu_env = env; s->base = base; s->int_pending[0] ...
[ 1, 0 ]
FFmpeg
libavcodec/h264_loopfilter.c
static void filter_mb_mbaff_edgev(H264Context *h, uint8_t *pix, int stride, const int16_t bS[7], int bsi, int qp) { const int qp_bd_offset = 6 * (h->sps.bit_depth_luma - 8); int index_a = qp - qp_bd_offset + h->slice_alpha_c0_offset; int alpha = alpha_table[index_a]; int be...
[ 0, 0 ]
FFmpeg
libavfilter/vf_hwupload_cuda.c
static int cudaupload_query_formats(AVFilterContext *ctx) { static const enum AVPixelFormat input_pix_fmts[] = { AV_PIX_FMT_NV12, AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV444P, AV_PIX_FMT_NONE, }; static const enum AVPixelFormat output_pix_fmts[] = { AV_PIX_FMT_CUDA, AV_PIX_FMT...
[ 0, 0 ]
FFmpeg
doc/APIchanges
static void seg_free_context(SegmentContext *seg) { avio_closep(&seg->pb); avformat_free_context(seg->avf); seg->avf = NULL; }
[ 0, 0 ]
FFmpeg
ffprobe.c
static void flat_print_str(WriterContext *wctx, const char *key, const char *value) { FlatContext *flat = wctx->priv; AVBPrint buf; flat_print_key_prefix(wctx); av_bprint_init(&buf, 1, AV_BPRINT_SIZE_UNLIMITED); printf("%s=", flat_escape_key_str(&buf, key, flat->sep)); av_b...
[ 0, 0 ]
qemu
include/monitor/monitor.h
static void user_async_cmd_handler(Monitor *mon, const mon_cmd_t *cmd, const QDict *params) { int ret; MonitorCompletionData *cb_data = g_malloc(sizeof(*cb_data)); cb_data->mon = mon; cb_data->user_print = cmd->user_print; monitor_suspend(mon); ret = cmd->mhandler....
[ 1, 0 ]
FFmpeg
libavformat/rmenc.c
static int rm_write_audio(AVFormatContext *s, const uint8_t *buf, int size, int flags) { uint8_t *buf1; RMMuxContext *rm = s->priv_data; AVIOContext *pb = s->pb; StreamInfo *stream = rm->audio_stream; int i; /* XXX: suppress this malloc */ buf1 = av_malloc(size * sizeof(u...
[ 1, 1 ]
FFmpeg
libavcodec/h264pred_template.c
static void FUNCC(pred4x4_vertical)(uint8_t *_src, const uint8_t *topright, int _stride) { pixel *src = (pixel *)_src; int stride = _stride / sizeof(pixel); const pixel4 a = ((pixel4 *)(src - stride))[0]; ((pixel4 *)(src + 0 * stride))[0] = a; ((pixel4 *)(src + 1 * str...
[ 1, 0 ]
qemu
hw/usb/hcd-xhci.c
static void xhci_er_reset(XHCIState *xhci, int v) { XHCIInterrupter *intr = &xhci->intr[v]; XHCIEvRingSeg seg; if (intr->erstsz == 0) { /* disabled */ intr->er_start = 0; intr->er_size = 0; return; } /* cache the (sole) event ring segment location */ if (intr->erstsz != 1) { D...
[ 1, 0 ]
FFmpeg
libavcodec/aacdec_template.c
static void push_output_configuration(AACContext *ac) { if (ac->oc[1].status == OC_LOCKED || ac->oc[0].status == OC_NONE) { ac->oc[0] = ac->oc[1]; } ac->oc[1].status = OC_NONE; }
[ 1, 0 ]
FFmpeg
libpostproc/postprocess.c
pp_context *pp_get_context(int width, int height, int cpuCaps) { PPContext *c = av_mallocz(sizeof(PPContext)); int stride = FFALIGN(width, 16); // assumed / will realloc if needed int qpStride = (width + 15) / 16 + 2; // assumed / will realloc if needed c->av_class = &av_codec_context_class; if (cpuCaps ...
[ 1, 0 ]
qemu
target-i386/op_helper.c
void helper_fxtract(void) { CPU86_LDoubleU temp; unsigned int expdif; temp.d = ST0; expdif = EXPD(temp) - EXPBIAS; /*DP exponent bias*/ ST0 = expdif; fpush(); BIASEXPONENT(temp); ST0 = temp.d; }
[ 1, 0 ]
FFmpeg
libavformat/utils.c
int av_append_packet(AVIOContext *s, AVPacket *pkt, int size) { int ret; int old_size; if (!pkt->size) return av_get_packet(s, pkt, size); old_size = pkt->size; ret = av_grow_packet(pkt, size); if (ret < 0) return ret; ret = avio_read(s, pkt->data + old_size, size); av_shrink_packet(p...
[ 1, 0 ]
qemu
hw/9pfs/virtio-9p-device.c
static int local_create_mapped_attr_dir(FsContext *ctx, const char *path) { int err; char attr_dir[PATH_MAX]; char *tmp_path = strdup(path); snprintf(attr_dir, PATH_MAX, "%s/%s/%s", ctx->fs_root, dirname(tmp_path), VIRTFS_META_DIR); err = mkdir(attr_dir, 0700); if (err < 0 && errno == EEX...
[ 1, 0 ]
qemu
hw/i386/kvm/i8254.c
static void kvm_pit_put(PITCommonState *pit) { KVMPITState *s = KVM_PIT(pit); struct kvm_pit_state2 kpit; struct kvm_pit_channel_state *kchan; struct PITChannelState *sc; int i, ret; /* The offset keeps changing as long as the VM is stopped. */ if (s->vm_stopped) { kvm_pit_update_clock_offset...
[ 1, 0 ]
qemu
target-ppc/mmu-hash32.c
static void hash32_bat_601_size(CPUPPCState *env, target_ulong *blp, int *validp, target_ulong batu, target_ulong batl) { target_ulong bl; int valid; bl = (batl & BATL32_601_BL) << 17; LOG_BATS("b %02x ==> bl " TARGET_FMT_lx " msk " TARGET_FM...
[ 0, 0 ]
qemu
Makefile.target
static inline TranslationBlock *tb_find_fast(void) { TranslationBlock *tb; target_ulong cs_base, pc; int flags; /* we record a subset of the CPU state. It will always be the same before a given translated block is executed. */ cpu_get_tb_cpu_state(env, &pc, &cs_base, &flags); tb = env->tb...
[ 1, 0 ]
qemu
acl.c
void qdev_free(DeviceState *dev) { #if 0 /* FIXME: need sane vmstate_unregister function */ if (dev->info->vmsd) vmstate_unregister(dev->info->vmsd, dev); #endif if (dev->info->reset) qemu_unregister_reset(dev->info->reset, dev); LIST_REMOVE(dev, sibling); qemu_free(dev); }
[ 0, 1 ]
qemu
libcacard/cac.c
cac_new_pki_applet(int i, const unsigned char *cert, int cert_len, VCardKey *key) { VCardAppletPrivate *applet_private = NULL; VCardApplet *applet = NULL; unsigned char pki_aid[] = {0xa0, 0x00, 0x00, 0x00, 0x79, 0x01, 0x00}; int pki_aid_len = sizeof(pki_aid); pki_aid[pki_aid_len - 1]...
[ 1, 0 ]
qemu
block/nbd-client.c
static void nbd_recv_coroutines_enter_all(BlockDriverState *bs) { NBDClientSession *s = nbd_get_client_session(bs); int i; for (i = 0; i < MAX_NBD_REQUESTS; i++) { if (s->recv_coroutine[i]) { qemu_coroutine_enter(s->recv_coroutine[i]); } } BDRV_POLL_WHILE(bs, s->read_reply_co); }
[ 0, 0 ]
qemu
hw/serial.c
static void serial_xmit(void *opaque) { SerialState *s = opaque; uint64_t new_xmit_ts = qemu_get_clock_ns(vm_clock); if (s->tsr_retry <= 0) { if (s->fcr & UART_FCR_FE) { s->tsr = fifo_get(s, XMIT_FIFO); if (!s->xmit_fifo.count) s->lsr |= UART_LSR_THRE; } else { s->tsr =...
[ 1, 0 ]
qemu
block/io.c
static int64_t coroutine_fn bdrv_co_get_block_status_above(BlockDriverState *bs, BlockDriverState *base, bool want_zero, int64_t sector_num, int nb_sectors, int...
[ 1, 0 ]
qemu
audio/audio.c
static int load_refcount_block(BlockDriverState *bs, int64_t refcount_block_offset, void **refcount_block) { BDRVQcow2State *s = bs->opaque; int ret; BLKDBG_EVENT(bs->file, BLKDBG_REFBLOCK_LOAD); ret = qcow2_cache_get(bs, s->refcount_block_cac...
[ 0, 0 ]
qemu
target-arm/translate-a64.c
static void handle_sys(DisasContext *s, uint32_t insn, unsigned int l, unsigned int op1, unsigned int op2, unsigned int crn, unsigned int crm, unsigned int rt) { unsupported_encoding(s, insn); }
[ 0, 0 ]
qemu
block.c
int monitor_read_bdrv_key(BlockDriverState *bs) { char password[256]; int i; if (!bdrv_is_encrypted(bs)) return 0; term_printf("%s (%s) is encrypted.\n", bdrv_get_device_name(bs), bdrv_get_encrypted_filename(bs)); for (i = 0; i < 3; i++) { monitor_readline("Password: ", 1, passw...
[ 1, 0 ]
qemu
backends/baum.c
static CharDriverState *qemu_chr_open_pp_fd(int fd) { CharDriverState *chr; ParallelCharDriver *drv; if (ioctl(fd, PPCLAIM) < 0) { close(fd); return NULL; } drv = g_malloc0(sizeof(ParallelCharDriver)); drv->fd = fd; drv->mode = IEEE1284_MODE_COMPAT; chr = g_malloc0(sizeof(CharDriverSta...
[ 0, 0 ]
qemu
cpu-exec.c
static inline void cris_alu_m_alloc_temps(TCGv *t) { t[0] = tcg_temp_new(TCG_TYPE_TL); t[1] = tcg_temp_new(TCG_TYPE_TL); }
[ 0, 0 ]