Projectname
large_stringclasses
15 values
Filepath
large_stringlengths
4
106
Function
large_stringlengths
11
3.45k
Label
list
qemu
cputlb.c
void stq_phys_notdirty(target_phys_addr_t addr, uint64_t val) { uint8_t *ptr; MemoryRegionSection *section; section = phys_page_find(addr >> TARGET_PAGE_BITS); if (!memory_region_is_ram(section->mr) || section->readonly) { addr = memory_region_section_addr(section, addr); if (memory_region_is_ram...
[ 1, 0 ]
qemu
hw/ppc/spapr_hcall.c
static void hypercall_register_types(void) { /* hcall-pft */ spapr_register_hypercall(H_ENTER, h_enter); spapr_register_hypercall(H_REMOVE, h_remove); spapr_register_hypercall(H_PROTECT, h_protect); spapr_register_hypercall(H_READ, h_read); /* hcall-bulk */ spapr_register_hypercall(H_BULK_REMOVE, ...
[ 0, 0 ]
qemu
HACKING
static uint32_t bitband_readw(void *opaque, target_phys_addr_t offset) { uint32_t addr; uint16_t mask; uint16_t v; addr = bitband_addr(opaque, offset) & ~1; mask = (1 << ((offset >> 2) & 15)); mask = tswap16(mask); cpu_physical_memory_read(addr, (uint8_t *)&v, 2); return (v & mask) != 0; }
[ 1, 0 ]
qemu
buffered_file.c
static uint32_t pxa2xx_rtc_read(void *opaque, target_phys_addr_t addr) { PXA2xxRTCState *s = (PXA2xxRTCState *)opaque; switch (addr) { case RTTR: return s->rttr; case RTSR: return s->rtsr; case RTAR: return s->rtar; case RDAR1: return s->rdar1; case RDAR2: return s->rdar2;...
[ 0, 0 ]
qemu
tests/acpi-test-data/pc/SRAT.memhp
static void test_acpi_piix4_tcg_memhp(void) { test_data data; memset(&data, 0, sizeof(data)); data.machine = MACHINE_PC; data.variant = ".memhp"; test_acpi_one(" -m 128,slots=3,maxmem=1G -numa node", &data); free_test_data(&data); }
[ 1, 0 ]
FFmpeg
libavcodec/tdsc.c
static av_cold int tdsc_init(AVCodecContext *avctx) { TDSCContext *ctx = avctx->priv_data; const AVCodec *codec; int ret; avctx->pix_fmt = AV_PIX_FMT_BGR24; /* These needs to be set to estimate buffer and frame size */ if (!(avctx->width && avctx->height)) { av_log(avctx, AV_LOG_ERROR, "Video si...
[ 1, 0 ]
qemu
cpus.c
static void kvm_do_inject_x86_mce(void *_data) { struct kvm_x86_mce_data *data = _data; int r; r = kvm_set_mce(data->env, data->mce); if (r < 0) perror("kvm_set_mce FAILED"); }
[ 1, 0 ]
FFmpeg
libavcodec/v4l2_buffers.c
static int v4l2_receive_packet(AVCodecContext *avctx, AVPacket *avpkt) { V4L2m2mContext *s = avctx->priv_data; V4L2Context *const capture = &s->capture; V4L2Context *const output = &s->output; int ret; if (s->draining) goto dequeue; if (!output->streamon) { ret = ff_v4l2_context_set_status(...
[ 1, 0 ]
qemu
block/Makefile.objs
static coroutine_fn int cow_co_read(BlockDriverState *bs, int64_t sector_num, uint8_t *buf, int nb_sectors) { int ret; BDRVCowState *s = bs->opaque; qemu_co_mutex_lock(&s->lock); ret = cow_read(bs, sector_num, buf, nb_sectors); qemu_co_mutex_unlock(&s->lock); retu...
[ 0, 0 ]
qemu
acl.c
void qdict_put_obj(QDict *qdict, const char *key, QObject *value) { unsigned int hash; QDictEntry *entry; hash = tdb_hash(key) % QDICT_HASH_SIZE; entry = qdict_find(qdict, key, hash); if (entry) { /* replace key's value */ qobject_decref(entry->value); entry->value = value; } else { ...
[ 0, 0 ]
qemu
hw/dp8393x.c
static int usbnet_can_receive(void *opaque) { USBNetState *s = opaque; if (s->rndis && !s->rndis_state == RNDIS_DATA_INITIALIZED) return 1; return !s->in_len; }
[ 1, 0 ]
qemu
target/arm/helper-a64.c
void HELPER(yield)(CPUARMState *env) { ARMCPU *cpu = arm_env_get_cpu(env); CPUState *cs = CPU(cpu); /* When running in MTTCG we don't generate jumps to the yield and * WFE helpers as it won't affect the scheduling of other vCPUs. * If we wanted to more completely model WFE/SEV so we don't busy * s...
[ 0, 0 ]
FFmpeg
libavformat/dv.c
static int dv_read_timecode(AVFormatContext *s) { int ret; char timecode[AV_TIMECODE_STR_SIZE]; int64_t pos = avio_tell(s->pb); // Read 3 DIF blocks: Header block and 2 Subcode blocks. int partial_frame_size = 3 * 80; uint8_t *partial_frame = av_mallocz(sizeof(*partial_frame) * ...
[ 0, 0 ]
qemu
hw/hpet.c
static void vt82c686b_init_ports(PCIIDEState *d) { int i; struct { int iobase; int iobase2; int isairq; } port_info[] = { {0x1f0, 0x3f6, 14}, {0x170, 0x376, 15}, }; for (i = 0; i < 2; i++) { ide_bus_new(&d->bus[i], &d->dev.qdev, i); ide_init_ioport(&d->bus[i], port_...
[ 0, 0 ]
qemu
monitor.c
static void monitor_control_read(void *opaque, const uint8_t *buf, int size) { Monitor *old_mon = cur_mon; cur_mon = opaque; // TODO: read QMP input cur_mon = old_mon; }
[ 0, 1 ]
qemu
target-ppc/STATUS
static void gen_spr_403(CPUPPCState *env) { /* MMU */ spr_register(env, SPR_403_PBL1, "PBL1", SPR_NOACCESS, SPR_NOACCESS, &spr_read_403_pbr, &spr_write_403_pbr, 0x00000000); spr_register(env, SPR_403_PBU1, "PBU1", SPR_NOACCESS, SPR_NOACCESS, ...
[ 0, 1 ]
qemu
tests/ide-test.c
static void test_flush(void) { QPCIDevice *dev; QPCIBar bmdma_bar, ide_bar; uint8_t data; ide_test_start( "-drive file=blkdebug::%s,if=ide,cache=writeback,format=raw", tmp_path); dev = get_pci_device(&bmdma_bar, &ide_bar); qtest_irq_intercept_in(global_qtest, "ioapic"); /* Dirty medi...
[ 1, 0 ]
FFmpeg
libavdevice/v4l2-common.c
enum AVCodecID avpriv_fmt_v4l2codec(uint32_t v4l2_fmt) { int i; for (i = 0; avpriv_fmt_conversion_table[i].codec_id != AV_CODEC_ID_NONE; i++) { if (avpriv_fmt_conversion_table[i].v4l2_fmt == v4l2_fmt) { return avpriv_fmt_conversion_table[i].codec_id; } } return AV_CODEC_ID_NONE; }
[ 0, 0 ]
FFmpeg
libavcodec/a64multienc.c
static av_cold int alac_encode_close(AVCodecContext *avctx) { AlacEncodeContext *s = avctx->priv_data; ff_lpc_end(&s->lpc_ctx); av_freep(&avctx->extradata); avctx->extradata_size = 0; av_freep(&avctx->coded_frame); return 0; }
[ 0, 0 ]
qemu
target-arm/translate-a64.c
static void disas_simd_across_lanes(DisasContext *s, uint32_t insn) { unsupported_encoding(s, insn); }
[ 0, 0 ]
qemu
hw/misc/vfio.c
static void vfio_probe_nvidia_bar0_88000_quirk(VFIODevice *vdev, int nr) { PCIDevice *pdev = &vdev->pdev; VFIOQuirk *quirk; if (!vdev->has_vga || nr != 0 || pci_get_word(pdev->config + PCI_VENDOR_ID) != PCI_VENDOR_ID_NVIDIA) { return; } quirk = g_malloc0(sizeof(*quirk)); quirk->vdev = vdev...
[ 1, 0 ]
qemu
fsdev/virtfs-proxy-helper.c
static ssize_t proxy_readlink(FsContext *fs_ctx, V9fsPath *fs_path, char *buf, size_t bufsz) { int retval; retval = v9fs_request(fs_ctx->private, T_READLINK, buf, "sd", fs_path, bufsz); if (retval < 0) { errno = -retval; return -1; } retur...
[ 0, 0 ]
qemu
HACKING
static subpage_t *subpage_init(target_phys_addr_t base) { subpage_t *mmio; mmio = g_malloc0(sizeof(subpage_t)); mmio->base = base; memory_region_init_io(&mmio->iomem, &subpage_ops, mmio, "subpage", TARGET_PAGE_SIZE); mmio->iomem.subpage = true; #if defined(DEBUG_SUBPAGE) pri...
[ 0, 0 ]
qemu
linux-user/syscall.c
static abi_long do_bind(int sockfd, abi_ulong target_addr, socklen_t addrlen) { void *addr; abi_long ret; if (addrlen < 0) return -TARGET_EINVAL; addr = alloca(addrlen + 1); ret = target_to_host_sockaddr(addr, target_addr, addrlen); if (ret) return ret; return ge...
[ 1, 0 ]
qemu
cpu-exec.c
static unsigned int dec_rfe_etc(DisasContext *dc) { cris_cc_mask(dc, 0); if (dc->op2 == 15) /* ignore halt. */ return 2; switch (dc->op2 & 7) { case 2: /* rfe. */ DIS(fprintf(logfile, "rfe\n")); cris_evaluate_flags(dc); tcg_gen_helper_0_0(helper_rfe); dc->is_jmp = DISAS_UPDA...
[ 0, 0 ]
qemu
configure
static ssize_t fd_put_buffer(void *opaque, const void *data, size_t size) { FdMigrationState *s = opaque; ssize_t ret; do { ret = write(s->fd, data, size); } while (ret == -1 && errno == EINTR); if (ret == -1) ret = -errno; if (ret == -EAGAIN) qemu_set_fd_handler2(s->fd, NULL, NULL, fd...
[ 0, 0 ]
qemu
MAINTAINERS
static void sigp_set_prefix(CPUState *cs, run_on_cpu_data arg) { S390CPU *cpu = S390_CPU(cs); SigpInfo *si = arg.host_ptr; uint32_t addr = si->param & 0x7fffe000u; cpu_synchronize_state(cs); if (!address_space_access_valid(&address_space_memory, addr, sizeof(struct Low...
[ 1, 0 ]
qemu
hmp.c
static void hmp_cont_cb(void *opaque, int err) { if (!err) { qmp_cont(NULL); } }
[ 1, 0 ]
qemu
exec.c
static void memory_map_init(void) { system_memory = qemu_malloc(sizeof(*system_memory)); memory_region_init(system_memory, "system", UINT64_MAX); set_system_memory_map(system_memory); }
[ 1, 0 ]
qemu
hw/display/qxl.c
static void qxl_realize_primary(PCIDevice *dev, Error **errp) { PCIQXLDevice *qxl = PCI_QXL(dev); VGACommonState *vga = &qxl->vga; Error *local_err = NULL; qxl->id = 0; qxl_init_ramsize(qxl); vga->vbe_size = qxl->vgamem_size; vga->vram_size_mb = qxl->vga.vram_size >> 20; vga_common_init(vga, OB...
[ 1, 0 ]
qemu
block/qcow2.c
static ImageInfoSpecific *qcow2_get_specific_info(BlockDriverState *bs) { BDRVQcow2State *s = bs->opaque; ImageInfoSpecific *spec_info = g_new(ImageInfoSpecific, 1); *spec_info = (ImageInfoSpecific){ .type = IMAGE_INFO_SPECIFIC_KIND_QCOW2, .u.qcow2.data = g_new(ImageInfoSpecificQCow2, 1), }; ...
[ 1, 0 ]
qemu
Makefile.objs
static int get_int32(QEMUFile *f, void *pv, size_t size) { int32_t *v = pv; qemu_get_sbe32s(f, v); return 0; }
[ 1, 0 ]
qemu
linux-user/signal.c
static long do_rt_sigreturn_v1(CPUARMState *env) { abi_ulong frame_addr; struct rt_sigframe_v1 *frame = NULL; sigset_t host_set; /* * Since we stacked the signal on a 64-bit boundary, * then 'sp' should be word aligned here. If it's * not, then the user is trying to mess with us. */ fra...
[ 1, 0 ]
FFmpeg
libavcodec/vp9.c
static int vp9_decode_update_thread_context(AVCodecContext *dst, const AVCodecContext *src) { int i, res; VP9Context *s = dst->priv_data, *ssrc = src->priv_data; // FIXME scalability, size, etc. for (i = 0; i < 2; i++) { if (s->frames[i].tf.f->data[0]) ...
[ 1, 1 ]
qemu
block/raw-posix.c
static int hdev_open(BlockDriverState *bs, const char *filename, int flags) { BDRVRawState *s = bs->opaque; #if defined(__APPLE__) && defined(__MACH__) if (strstart(filename, "/dev/cdrom", NULL)) { kern_return_t kernResult; io_iterator_t mediaIterator; char bsdPath[MAXPATHLEN]; int fd; ...
[ 1, 0 ]
qemu
qemu-char.c
static CharDriverState *qemu_chr_open_stdio(ChardevStdio *opts) { CharDriverState *chr; if (is_daemonized()) { error_report("cannot use stdio with -daemonize"); return NULL; } old_fd0_flags = fcntl(0, F_GETFL); tcgetattr(0, &oldtty); qemu_set_nonblock(0); atexit(term_exit); chr = qemu_...
[ 1, 0 ]
FFmpeg
libavcodec/ra144.c
static void eval_coefs(int *coefs, const int *refl) { int buffer[10]; int *b1 = buffer; int *b2 = coefs; int x, y; for (x = 0; x < 10; x++) { b1[x] = refl[x] << 4; for (y = 0; y < x; y++) b1[y] = ((refl[x] * b2[x - y - 1]) >> 12) + b2[y]; FFSWAP(int *, b1, b2); } for (x = 0; x...
[ 1, 0 ]
qemu
block/block-backend.c
static void ide_cd_change_cb(void *opaque, bool load) { IDEState *s = opaque; uint64_t nb_sectors; s->tray_open = !load; bdrv_get_geometry(s->bs, &nb_sectors); s->nb_sectors = nb_sectors; /* * First indicate to the guest that a CD has been removed. That's * done on the next command the guest...
[ 0, 0 ]
qemu
block/nbd.c
static int nbd_open(BlockDriverState *bs, QDict *options, int flags, Error **errp) { BDRVNBDState *s = bs->opaque; char *export = NULL; int result, sock; /* Pop the config into our state object. Exit if invalid. */ result = nbd_config(s, options, &export); if (result != 0) { ...
[ 0, 1 ]
qemu
hw/acpi/core.c
void acpi_pm1_cnt_init(ACPIREGS *ar, MemoryRegion *parent, uint8_t s4_val) { ar->pm1.cnt.s4_val = s4_val; ar->wakeup.notify = acpi_notify_wakeup; qemu_register_wakeup_notifier(&ar->wakeup); memory_region_init_io(&ar->pm1.cnt.io, memory_region_owner(parent), &acpi_pm_cnt_ops, ar, "a...
[ 0, 0 ]
qemu
block/crypto.c
static int64_t coroutine_fn qcow_co_get_block_status(BlockDriverState *bs, int64_t sector_num, int nb_sectors, int *pnum, BlockDriverState **file) { BDRVQco...
[ 1, 0 ]
qemu
block/io.c
static void raw_aio_flush_io_queue(BlockDriverState *bs) { #ifdef CONFIG_LINUX_AIO BDRVRawState *s = bs->opaque; if (s->use_aio) { laio_io_unplug(bs, s->aio_ctx, false); } #endif }
[ 0, 0 ]
FFmpeg
ffmpeg.c
static void opt_new_stream(const char *opt, const char *arg) { AVFormatContext *oc; if (nb_output_files <= 0) { fprintf(stderr, "At least one output file must be specified\n"); ffmpeg_exit(1); } oc = output_files[nb_output_files - 1]; if (!strcmp(opt, "newvideo")) new_video_stream(oc); e...
[ 0, 0 ]
FFmpeg
configure
static int url_alloc_for_protocol(URLContext **puc, struct URLProtocol *up, const char *filename, int flags, const AVIOInterruptCB *int_cb) { URLContext *uc; int err; #if CONFIG_NETWORK if (up->flags & URL_PROTOCOL_FLAG_NETWORK && !ff_netw...
[ 1, 0 ]
qemu
hw/vhost.c
static void vhost_region_del(MemoryListener *listener, MemoryRegionSection *section) { struct vhost_dev *dev = container_of(listener, struct vhost_dev, memory_listener); int i; vhost_set_memory(listener, section, false); for (i = 0; i < ...
[ 1, 0 ]
qemu
kvm-all.c
static void dummy_signal(int sig) {}
[ 1, 0 ]
FFmpeg
libavcodec/g726.c
static av_cold int g726_init(AVCodecContext *avctx) { G726Context *c = avctx->priv_data; unsigned int index = (avctx->bit_rate + avctx->sample_rate / 2) / avctx->sample_rate - 2; if (avctx->bit_rate % avctx->sample_rate && avctx->codec->encode) { av_log(avctx, AV_LOG_ERROR, "Bitrate - Sa...
[ 1, 0 ]
FFmpeg
libavcodec/qdm2.c
static void fix_coding_method_array(int sb, int channels, sb_int8_array coding_method) { int j, k; int ch; int run, case_val; int switchtable[23] = {0, 5, 1, 5, 5, 5, 5, 5, 2, 5, 5, 5, 5, 5, 5, 5, 3, 5, 5, 5, 5, 5, 4}; for (ch = 0; ch < channe...
[ 1, 0 ]
qemu
hw/usb.h
int usb_packet_map(USBPacket *p, QEMUSGList *sgl) { int is_write = (p->pid == USB_TOKEN_IN); target_phys_addr_t len; void *mem; int i; for (i = 0; i < sgl->nsg; i++) { len = sgl->sg[i].len; mem = cpu_physical_memory_map(sgl->sg[i].base, &len, is_write); ...
[ 1, 0 ]
FFmpeg
libavcodec/avpacket.c
uint8_t *av_packet_new_side_data(AVPacket *pkt, enum AVPacketSideDataType type, int size) { int ret; uint8_t *data; if ((unsigned)size > INT_MAX - AV_INPUT_BUFFER_PADDING_SIZE) return NULL; data = av_malloc(size + AV_INPUT_BUFFER_PADDING_SIZE); if (!data) retu...
[ 0, 0 ]
qemu
backends/baum.c
static void tcp_chr_tls_init(CharDriverState *chr) { TCPCharDriver *s = chr->opaque; QIOChannelTLS *tioc; Error *err = NULL; if (s->is_listen) { tioc = qio_channel_tls_new_server( s->ioc, s->tls_creds, NULL, /* XXX Use an ACL */ &err); } else { tioc = qio_channel_tls...
[ 0, 1 ]
qemu
cpu-exec.c
int pic_read_irq(DeviceState *d) { PICCommonState *s = DO_UPCAST(PICCommonState, dev.qdev, d); int irq, irq2, intno; irq = pic_get_irq(s); if (irq >= 0) { if (irq == 2) { irq2 = pic_get_irq(slave_pic); if (irq2 >= 0) { pic_intack(slave_pic, irq2); } else { /* spu...
[ 0, 0 ]
qemu
hw/net/mipsnet.c
static void mipsnet_ioport_write(void *opaque, hwaddr addr, uint64_t val, unsigned int size) { MIPSnetState *s = opaque; addr &= 0x3f; trace_mipsnet_write(addr, val); switch (addr) { case MIPSNET_TX_DATA_COUNT: s->tx_count = (val <= MAX_ETH_FRAME_SIZE) ? val : 0; ...
[ 1, 0 ]
qemu
hw/s390x/s390-pci-inst.c
void ioinst_handle_stcrw(S390CPU *cpu, uint32_t ipb, uintptr_t ra) { CRW crw; uint64_t addr; int cc; CPUS390XState *env = &cpu->env; uint8_t ar; addr = decode_basedisp_s(env, ipb, &ar); if (addr & 3) { s390_program_interrupt(env, PGM_SPECIFICATION, 4, ra); return; } cc = css_do_stcr...
[ 1, 0 ]
qemu
hw/sd/sdhci.c
static bool sdhci_can_issue_command(SDHCIState *s) { if (!SDHC_CLOCK_IS_ON(s->clkcon) || !(s->pwrcon & SDHC_POWER_ON) || (((s->prnsts & SDHC_DATA_INHIBIT) || s->stopped_state) && ((s->cmdreg & SDHC_CMD_DATA_PRESENT) || ((s->cmdreg & SDHC_CMD_RESPONSE) == SDHC_CMD_RSP_WITH_BUSY && !...
[ 1, 0 ]
FFmpeg
libavcodec/libopenh264dec.c
static int svc_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt) { SVCContext *s = avctx->priv_data; SBufferInfo info = {0}; uint8_t *ptrs[3]; int linesize[3]; AVFrame *avframe = data; DECODING_STATE state; state = (*s->decoder) ...
[ 1, 0 ]
qemu
block.c
void bdrv_get_geometry(BlockDriverState *bs, uint64_t *nb_sectors_ptr) { int64_t nb_sectors = bdrv_nb_sectors(bs); *nb_sectors_ptr = nb_sectors < 0 ? 0 : nb_sectors; }
[ 0, 0 ]
qemu
linux-user/signal.c
static int setup_sigcontext(struct target_sigcontext *sc, CPUSH4State *regs, unsigned long mask) { int err = 0; int i; #define COPY(x) __put_user(regs->x, &sc->sc_##x) COPY(gregs[0]); COPY(gregs[1]); COPY(gregs[2]); COPY(gregs[3]); COPY(gregs[4]); COPY(gregs[5]); C...
[ 0, 0 ]
FFmpeg
libavcodec/vp9dsp_template.c
static av_always_inline void iadst4_1d(const dctcoef *in, ptrdiff_t stride, dctcoef *out, int pass) { int t0, t1, t2, t3; t0 = 5283 * IN(0) + 15212 * IN(2) + 9929 * IN(3); t1 = 9929 * IN(0) - 5283 * IN(2) - 15212 * IN(3); t2 = 13377 * (IN(0) - IN(2) + IN(3)); t3 =...
[ 1, 0 ]
qemu
hw/block/virtio-blk.c
static void virtqueue_map_iovec(struct iovec *sg, hwaddr *addr, unsigned int *num_sg, unsigned int max_size, int is_write) { unsigned int i; hwaddr len; /* Note: this function MUST validate input, some callers * are passing in num_sg values...
[ 0, 1 ]
FFmpeg
libavcodec/aac.c
static void apply_dependent_coupling(AACContext *ac, SingleChannelElement *target, ChannelElement *cce, int index) { IndividualChannelStream *ics = &cce->ch[0].ics; const uint16_t *offsets = ics->swb_offset; float *dest = target->coeffs;...
[ 1, 1 ]
qemu
hw/arm/nseries.c
static void omap_mcbsp_source_tick(void *opaque) { struct omap_mcbsp_s *s = (struct omap_mcbsp_s *)opaque; static const int bps[8] = {0, 1, 1, 2, 2, 2, -255, -255}; if (!s->rx_rate) return; if (s->rx_req) printf("%s: Rx FIFO overrun\n", __FUNCTION__); s->rx_req = s->rx_rate << bps[(s->rcr[0] >...
[ 0, 0 ]
qemu
exec.c
static void phys_sections_clear(PhysPageMap *map) { while (map->sections_nb > 0) { MemoryRegionSection *section = &map->sections[--map->sections_nb]; phys_section_destroy(section->mr); } g_free(map->sections); g_free(map->nodes); }
[ 0, 0 ]
qemu
tests/test-cutils.c
static void test_qemu_strtoull_correct(void) { const char *str = "12345 foo"; char f = 'X'; const char *endptr = &f; uint64_t res = 999; int err; err = qemu_strtoull(str, &endptr, 0, &res); g_assert_cmpint(err, ==, 0); g_assert_cmpint(res, ==, 12345); g_assert(endptr == str + 5); }
[ 0, 0 ]
qemu
hw/arm/musicpal.c
static void blizzard_screen_dump(void *opaque, const char *filename, bool cswitch, Error **errp) { BlizzardState *s = (BlizzardState *)opaque; DisplaySurface *surface = qemu_console_surface(s->con); blizzard_update_display(opaque); if (s && surface_data(surface)) { pp...
[ 0, 0 ]
qemu
block/iscsi.c
static void iscsi_close(BlockDriverState *bs) { IscsiLun *iscsilun = bs->opaque; struct iscsi_context *iscsi = iscsilun->iscsi; iscsi_detach_aio_context(bs); if (iscsi_is_logged_in(iscsi)) { iscsi_logout_sync(iscsi); } iscsi_destroy_context(iscsi); g_free(iscsilun->zeroblock); g_free(iscsil...
[ 1, 0 ]
qemu
hw/i2c.c
void i2c_register_slave(I2CSlaveInfo *info) { assert(info->qdev.size >= sizeof(i2c_slave)); info->qdev.init = i2c_slave_qdev_init; info->qdev.bus_type = BUS_TYPE_I2C; qdev_register(&info->qdev); }
[ 1, 0 ]
FFmpeg
libavcodec/ra144.c
static void add_wav(int16_t *dest, int n, int skip_first, int *m, const int16_t *s1, const int8_t *s2, const int8_t *s3) { int i; int v[3]; v[0] = 0; for (i = !skip_first; i < 3; i++) v[i] = (gain_val_tab[n][i] * m[i]) >> gain_exp_tab[n]; dest[i] = (s1[i] * v[0] + s2[i] * v[1] ...
[ 1, 0 ]
qemu
tests/libqtest.c
void qtest_qmp(QTestState *s, const char *fmt, ...) { va_list ap; bool has_reply = false; int nesting = 0; /* Send QMP request */ va_start(ap, fmt); socket_sendf(s->qmp_fd, fmt, ap); va_end(ap); /* Receive reply */ while (!has_reply || nesting > 0) { ssize_t len; char c; len = read(s->qmp_...
[ 1, 0 ]
qemu
hw/9pfs/virtio-9p.c
static void v9fs_fsync(void *opaque) { int err; int32_t fid; int datasync; size_t offset = 7; V9fsFidState *fidp; V9fsPDU *pdu = opaque; V9fsState *s = pdu->s; pdu_unmarshal(pdu, offset, "dd", &fid, &datasync); fidp = get_fid(pdu, fid); if (fidp == NULL) { err = -ENOENT; goto out_nofid; } ...
[ 1, 0 ]
qemu
qemu-timer.c
int qemu_calculate_timeout(void) { #ifndef CONFIG_IOTHREAD int timeout; if (!vm_running) timeout = 5000; else { /* XXX: use timeout computed from timers */ int64_t add; int64_t delta; /* Advance virtual time to the next event. */ delta = qemu_icount_delta(); if (delta > 0)...
[ 1, 1 ]
qemu
block/nbd.c
static SocketAddress *nbd_config(BDRVNBDState *s, QDict *options, char **export, Error **errp) { SocketAddress *saddr; if (qdict_haskey(options, "path") == qdict_haskey(options, "host")) { if (qdict_haskey(options, "path")) { error_setg(errp, "path and host may not b...
[ 1, 0 ]
qemu
scripts/qapi-visit.py
static void test_visitor_in_errors(TestInputVisitorData *data, const void *unused) { TestStruct *p = NULL; Error *err = NULL; Visitor *v; strList *q = NULL; UserDefTwo *r = NULL; WrapAlternate *s = NULL; v = visitor_input_test_init(data, "{ 'integer': false, 'boolean': '...
[ 1, 0 ]
qemu
backends/hostmem-file.c
static void bt_hci_done(struct HCIInfo *info) { struct bt_hci_s *hci = hci_from_info(info); int handle; bt_device_done(&hci->device); if (hci->device.lmp_name) g_free((void *)hci->device.lmp_name); /* Be gentle and send DISCONNECT to all connected peers and those * currently waiting for us to a...
[ 1, 1 ]
FFmpeg
doc/APIchanges
int avformat_network_deinit(void) { #if CONFIG_NETWORK ff_network_close(); ff_tls_deinit(); ff_network_inited_globally = 0; #endif return 0; }
[ 0, 0 ]
qemu
qapi/qmp-output-visitor.c
static void qmp_output_add_obj(QmpOutputVisitor *qov, const char *name, QObject *value) { QStackEntry *e = QTAILQ_FIRST(&qov->stack); QObject *cur = e ? e->value : NULL; if (!cur) { /* FIXME we should require the user to reset the visitor, rather * than throwing away...
[ 0, 1 ]
qemu
block/nbd.c
static int nbd_co_discard(BlockDriverState *bs, int64_t sector_num, int nb_sectors) { BDRVNBDState *s = bs->opaque; struct nbd_request request; struct nbd_reply reply; if (!(s->nbdflags & NBD_FLAG_SEND_TRIM)) { return 0; } request.type = NBD_CMD_TRIM; request.from = ...
[ 0, 0 ]
qemu
memory.c
static bool memory_region_access_valid(MemoryRegion *mr, target_phys_addr_t addr, unsigned size) { if (!mr->ops->valid.unaligned && (addr & (size - 1))) { return false; } /* Treat zero as compatibility all valid */ if (!mr-...
[ 1, 0 ]
qemu
include/block/aio.h
static void *iothread_run(void *opaque) { IOThread *iothread = opaque; qemu_mutex_lock(&iothread->init_done_lock); iothread->thread_id = qemu_get_thread_id(); qemu_cond_signal(&iothread->init_done_cond); qemu_mutex_unlock(&iothread->init_done_lock); while (!iothread->stopping) { aio_context_acqu...
[ 1, 0 ]
qemu
block/raw-posix.c
static void thread_pool_init(void) { thread_pool_init_one(&global_pool, NULL); }
[ 0, 0 ]
qemu
net/netmap.c
static void netmap_send(void *opaque) { NetmapState *s = opaque; struct netmap_ring *ring = s->me.rx; /* Keep sending while there are available packets into the netmap RX ring and the forwarding path towards the peer is open. */ while (!nm_ring_empty(ring) && qemu_can_send_packet(&s->nc)) { uint...
[ 0, 0 ]
qemu
qapi/qobject-input-visitor.c
static void test_qga_invalid_args(gconstpointer fix) { const TestFixture *fixture = fix; QDict *ret, *error; const gchar *class, *desc; ret = qmp_fd(fixture->fd, "{'execute': 'guest-ping', " "'arguments': {'foo': 42 }}"); g_assert_nonnull(ret); error = qdict_get_qdict(ret...
[ 1, 0 ]
qemu
block.c
int bdrv_all_create_snapshot(QEMUSnapshotInfo *sn, BlockDriverState *vm_state_bs, uint64_t vm_state_size, BlockDriverState **first_bad_bs) { int err = 0; BlockDriverState *bs; BdrvNextIterator it; for (bs = bdrv_first...
[ 1, 0 ]
FFmpeg
libavcodec/dxva2_mpeg2.c
void ff_xvmc_field_end(MpegEncContext *s) { struct xvmc_pix_fmt *render = (struct xvmc_pix_fmt *)s->current_picture.f.data[2]; assert(render); if (render->filled_mv_blocks_num > 0) ff_mpeg_draw_horiz_band(s, 0, 0); }
[ 1, 0 ]
qemu
tests/test-qht.c
static void qht_do_test(unsigned int mode, size_t init_entries) { qht_init(&ht, 0, mode); insert(0, N); check(0, N, true); check_n(N); check(-N, -1, false); iter_check(N); rm(101, 102); check_n(N - 1); insert(N, N * 2); check_n(N + N - 1); rm(N, N * 2); check_n(N - 1); insert(101, 102); chec...
[ 1, 0 ]
FFmpeg
Changelog
static void quantize_and_encode_band_cost_NONE_mips( struct AACEncContext *s, PutBitContext *pb, const float *in, float *out, const float *scaled, int size, int scale_idx, int cb, const float lambda, const float uplim, int *bits, const float ROUNDING) { av_assert0(0); }
[ 1, 0 ]
qemu
crypto/cipher-builtin.c
int qcrypto_cipher_setiv(QCryptoCipher *cipher, const uint8_t *iv, size_t niv, Error **errp) { QCryptoCipherNettle *ctx = cipher->opaque; if (niv != ctx->niv) { error_setg(errp, "Expected IV size %zu not %zu", ctx->niv, niv); return -1...
[ 1, 0 ]
qemu
memory.c
void set_system_memory_map(MemoryRegion *mr) { memory_region_transaction_begin(); address_space_memory.root = mr; memory_region_transaction_commit(); }
[ 1, 0 ]
FFmpeg
libavcodec/cook.c
static int cook_decode_close(AVCodecContext *avctx) { int i; COOKContext *q = avctx->priv_data; av_log(NULL, AV_LOG_DEBUG, "Deallocating memory.\n"); /* Free allocated memory buffers. */ av_free(q->mlt_window); av_free(q->mlt_precos); av_free(q->mlt_presin); av_free(q->mlt_postcos); av_free(...
[ 1, 0 ]
qemu
monitor.c
static void monitor_fdset_cleanup(MonFdset *mon_fdset) { MonFdsetFd *mon_fdset_fd; MonFdsetFd *mon_fdset_fd_next; QLIST_FOREACH_SAFE(mon_fdset_fd, &mon_fdset->fds, next, mon_fdset_fd_next) { if (mon_fdset_fd->removed) { close(mon_fdset_fd->fd); g_free(mon_fdset_fd->opaque); QLIST_REM...
[ 1, 0 ]
qemu
cpu-exec.c
void qemu_cpu_kick(CPUState *cpu) { qemu_cond_broadcast(cpu->halt_cond); if (tcg_enabled()) { cpu_exit(cpu); /* Also ensure current RR cpu is kicked */ qemu_cpu_kick_rr_cpu(); } else { if (hax_enabled()) { /* * FIXME: race condition with the exit_request check in * h...
[ 1, 1 ]
FFmpeg
libavcodec/acelp_pitch_delay.c
float ff_amr_set_fixed_gain(float fixed_gain_factor, float fixed_mean_energy, float *prediction_error, float energy_mean, const float *pred_table) { // Equations 66-69: // ^g_c = ^gamma_gc * 100.05 (predicted dB + mean dB - dB of fixed vector) // Note ...
[ 1, 0 ]
FFmpeg
configure
static int file_open_dir(URLContext *h) { #if HAVE_DIRENT_H FileContext *c = h->priv_data; c->dir = opendir(h->filename); if (!c->dir) return AVERROR(errno); return 0; #else return AVERROR(ENOSYS); #endif /* HAVE_DIRENT_H */ }
[ 0, 0 ]
FFmpeg
libavfilter/af_apad.c
static int filter_frame(AVFilterLink *inlink, AVFrame *frame) { AVFilterContext *ctx = inlink->dst; APadContext *apad = ctx->priv; if (apad->whole_len) apad->whole_len -= frame->nb_samples; apad->next_pts = frame->pts + av_rescale_q(frame->nb_samples, (AVRational)...
[ 1, 0 ]
FFmpeg
avconv.c
static void free_duplicate_context(MpegEncContext *s) { if (s == NULL) return; av_freep(&s->edge_emu_buffer); av_freep(&s->me.scratchpad); s->me.temp = s->rd_scratchpad = s->b_scratchpad = s->obmc_scratchpad = NULL; av_freep(&s->dct_error_sum); av_freep(&s->me.ma...
[ 0, 0 ]
qemu
target-i386/op.c
void OPPROTO op_decq_ECX(void) { ECX--; }
[ 0, 0 ]
qemu
nbd/nbd-internal.h
static int nbd_negotiate_handle_export_name(NBDClient *client, uint32_t length, uint16_t myflags, bool no_zeroes, Error **errp) { char name[NBD_MAX_NAME_SIZE + 1]; char buf[8 + 4 + 124] = ""; size_t len; int ret; /...
[ 1, 0 ]
qemu
block.c
static void cloop_refresh_limits(BlockDriverState *bs, Error **errp) { bs->request_alignment = BDRV_SECTOR_SIZE; /* No sub-sector I/O supported */ }
[ 0, 0 ]
qemu
fsdev/virtio-9p-marshal.c
static size_t v9fs_packunpack(void *addr, struct iovec *sg, int sg_count, size_t offset, size_t size, int pack) { int i = 0; size_t copied = 0; for (i = 0; size && i < sg_count; i++) { size_t len; if (offset >= sg[i].iov_len) { /* skip this sg */ offset -...
[ 1, 0 ]
qemu
HACKING
static void gt64120_isd_mapping(GT64120State *s) { target_phys_addr_t start = s->regs[GT_ISD] << 21; target_phys_addr_t length = 0x1000; if (s->ISD_length) { memory_region_del_subregion(get_system_memory(), &s->ISD_mem); } check_reserved_space(&start, &length); length = 0x1000; /* Map new addr...
[ 1, 0 ]