Projectname
large_stringclasses
15 values
Filepath
large_stringlengths
4
106
Function
large_stringlengths
11
3.45k
Label
list
FFmpeg
libavformat/concatdec.c
static int open_next_file(AVFormatContext *avf) { ConcatContext *cat = avf->priv_data; unsigned fileno = cat->cur_file - cat->files; if (cat->cur_file->duration == AV_NOPTS_VALUE) cat->cur_file->duration = cat->avf->duration - (cat->cur_file->file_inpoint - cat->cur_file->file_start_time)...
[ 1, 0 ]
qemu
hw/acpi/ich9.c
static void pm_reset(void *opaque) { ICH9LPCPMRegs *pm = opaque; ich9_pm_iospace_update(pm, 0); acpi_pm1_evt_reset(&pm->acpi_regs); acpi_pm1_cnt_reset(&pm->acpi_regs); acpi_pm_tmr_reset(&pm->acpi_regs); acpi_gpe_reset(&pm->acpi_regs); if (kvm_enabled()) { /* Mark SMM as already inited to prev...
[ 0, 0 ]
qemu
block.c
int bdrv_read_unthrottled(BlockDriverState *bs, int64_t sector_num, uint8_t *buf, int nb_sectors) { bool enabled; int ret; enabled = bs->io_limits_enabled; bs->io_limits_enabled = false; ret = bdrv_read(bs, sector_num, buf, nb_sectors); bs->io_limits_enabled = enabled; r...
[ 0, 0 ]
qemu
migration.c
static int do_cont(Monitor *mon, const QDict *qdict, QObject **ret_data) { struct bdrv_iterate_context context = {mon, 0}; if (incoming_expected) { qerror_report(QERR_MIGRATION_EXPECTED); return -1; } bdrv_iterate(encrypted_bdrv_it, &context); /* only resume the vm if all keys are set and valid...
[ 0, 0 ]
qemu
HACKING
static void channel_store_c(struct fs_dma_ctrl *ctrl, int c) { target_phys_addr_t addr = channel_reg(ctrl, c, RW_GROUP_DOWN); /* Encode and store. FIXME: handle endianness. */ D(printf("%s ch=%d addr=" TARGET_FMT_plx "\n", __func__, c, addr)); D(dump_d(c, &ctrl->channels[c].current_d)); cpu_physical_me...
[ 0, 1 ]
qemu
target/i386/machine.c
static bool version_is_5(void *opaque, int version_id) { return version_id == 5; }
[ 0, 0 ]
qemu
target-s390x/kvm.c
static int kvm_s390_check_clear_cmma(KVMState *s) { struct kvm_device_attr attr = { .group = KVM_S390_VM_MEM_CTRL, .attr = KVM_S390_VM_MEM_CLR_CMMA, }; return kvm_vm_ioctl(s, KVM_HAS_DEVICE_ATTR, &attr); }
[ 0, 0 ]
qemu
default-configs/mips-softmmu-common.mak
void ich9_pm_device_plug_cb(HotplugHandler *hotplug_dev, DeviceState *dev, Error **errp) { ICH9LPCState *lpc = ICH9_LPC_DEVICE(hotplug_dev); if (lpc->pm.acpi_memory_hotplug.is_enabled && object_dynamic_cast(OBJECT(dev), TYPE_PC_DIMM)) { acpi_memory_plug_cb(hotplug_dev, &l...
[ 0, 0 ]
qemu
linux-user/main.c
static void gen_mfsri(DisasContext *ctx) { #if defined(CONFIG_USER_ONLY) gen_inval_exception(ctx, POWERPC_EXCP_PRIV_OPC); #else int ra = rA(ctx->opcode); int rd = rD(ctx->opcode); TCGv t0; if (unlikely(ctx->pr)) { gen_inval_exception(ctx, POWERPC_EXCP_PRIV_OPC); return; } t0 = tcg_temp_...
[ 1, 0 ]
FFmpeg
doc/APIchanges
static void close_file(OutputStream *os) { int64_t pos = avio_tell(os->out); avio_seek(os->out, 0, SEEK_SET); avio_wb32(os->out, pos); avio_flush(os->out); avio_close(os->out); os->out = NULL; }
[ 0, 0 ]
FFmpeg
libavcodec/aacenc.c
static int g726_encode_frame(AVCodecContext *avctx, AVPacket *avpkt, const AVFrame *frame, int *got_packet_ptr) { G726Context *c = avctx->priv_data; const int16_t *samples = (const int16_t *)frame->data[0]; PutBitContext pb; int i, ret, out_size; out_size = (frame->nb_sampl...
[ 1, 0 ]
FFmpeg
ffmpeg_opt.c
static int opt_vstats(void *optctx, const char *opt, const char *arg) { char filename[40]; time_t today2 = time(NULL); struct tm *today = localtime(&today2); snprintf(filename, sizeof(filename), "vstats_%02d%02d%02d.log", today->tm_hour, today->tm_min, today->tm_sec); return opt_vstats_file(NULL, o...
[ 1, 0 ]
qemu
target-xtensa/cpu.h
static void gen_brcond(DisasContext *dc, TCGCond cond, TCGv_i32 t0, TCGv_i32 t1, uint32_t offset) { int label = gen_new_label(); tcg_gen_brcond_i32(cond, t0, t1, label); gen_jumpi(dc, dc->next_pc, 0); gen_set_label(label); gen_jumpi(dc, dc->pc + offset, 1); }
[ 1, 0 ]
FFmpeg
postproc/rgb2rgb.c
void palette8tobgr24(const uint8_t *src, uint8_t *dst, unsigned num_pixels, const uint8_t *palette) { unsigned i; /* writes 1 byte o much and might cause alignment issues on some architectures? for(i=0; i<num_pixels; i++) ((unsigned *)(&dst[i*3])...
[ 1, 1 ]
qemu
target-arm/translate.c
static void dead_tmp(TCGv tmp) { tcg_temp_free(tmp); num_temps--; }
[ 1, 0 ]
qemu
target-ppc/translate_init.c
static void init_proc_750cx(CPUPPCState *env) { gen_spr_ne_601(env); gen_spr_7xx(env); /* XXX : not implemented */ spr_register(env, SPR_L2CR, "L2CR", SPR_NOACCESS, SPR_NOACCESS, &spr_read_generic, NULL, 0x00000000); /* Time base */ gen_tbl(env); /* ...
[ 1, 1 ]
FFmpeg
libavcodec/interplayvideo.c
static int ipvideo_decode_block_opcode_0xF(IpvideoContext *s) { int x, y; unsigned char sample[2]; /* dithered encoding */ CHECK_STREAM_PTR(2); sample[0] = *s->stream_ptr++; sample[1] = *s->stream_ptr++; for (y = 0; y < 8; y++) { for (x = 0; x < 8; x += 2) { *s->pixel_ptr++ = sample[y ...
[ 1, 0 ]
FFmpeg
libswscale/bfin/internal_bfin.S
static inline void RENAME(hyscale)(SwsContext *c, uint16_t *dst, int dstWidth, const uint8_t *src, int srcW, int xInc, const int16_t *hLumFilter, const int16_t *hLumFilterPos, in...
[ 1, 0 ]
qemu
block.c
int bdrv_has_zero_init(BlockDriverState *bs) { assert(bs->drv); if (bs->drv->bdrv_has_zero_init) { return bs->drv->bdrv_has_zero_init(bs); } return 1; }
[ 1, 0 ]
qemu
backends/testdev.c
static CharDriverState *qemu_chr_open_mux(CharDriverState *drv) { CharDriverState *chr; MuxDriver *d; chr = qemu_chr_alloc(); d = g_malloc0(sizeof(MuxDriver)); chr->opaque = d; d->drv = drv; d->focus = -1; chr->chr_write = mux_chr_write; chr->chr_update_read_handler = mux_chr_update_read_han...
[ 1, 0 ]
FFmpeg
ffmpeg.c
static int read_ffserver_streams(AVFormatContext *s, const char *filename) { int i, err; AVFormatContext *ic; int nopts = 0; err = av_open_input_file(&ic, filename, NULL, FFM_PACKET_SIZE, NULL); if (err < 0) return err; /* copy stream format */ s->nb_streams = ic->nb_streams; for (i = 0; i...
[ 1, 1 ]
FFmpeg
libavutil/channel_layout.c
static uint64_t get_channel_layout_single(const char *name, int name_len) { int i; char *end; int64_t layout; for (i = 0; i < FF_ARRAY_ELEMS(channel_layout_map); i++) { if (strlen(channel_layout_map[i].name) == name_len && !memcmp(channel_layout_map[i].name, name, name_len)) return cha...
[ 1, 0 ]
qemu
cpus.c
static bool qemu_vmstop_requested(RunState *r) { if (vmstop_requested < RUN_STATE_MAX) { *r = vmstop_requested; vmstop_requested = RUN_STATE_MAX; return true; } return false; }
[ 1, 0 ]
FFmpeg
libavformat/mov.c
static int mov_parse_stsd_data(MOVContext *c, AVIOContext *pb, AVStream *st, MOVStreamContext *sc, int size) { if (st->codec->codec_tag == MKTAG('t', 'm', 'c', 'd')) { st->codec->extradata_size = size; st->codec->extradata = av_malloc(size + ...
[ 1, 0 ]
qemu
hw/scsi-generic.c
static int get_blocksize(BlockDriverState *bdrv) { uint8_t cmd[10]; uint8_t buf[8]; uint8_t sensebuf[8]; sg_io_hdr_t io_header; int ret; memset(cmd, 0, sizeof(cmd)); memset(buf, 0, sizeof(buf)); cmd[0] = READ_CAPACITY_10; memset(&io_header, 0, sizeof(io_header)); io_header.interface_id = ...
[ 1, 1 ]
qemu
hw/usb-hid.c
static void usb_mouse_class_initfn(ObjectClass *klass, void *data) { USBDeviceClass *uc = USB_DEVICE_CLASS(klass); uc->init = usb_mouse_initfn; uc->product_desc = "QEMU USB Mouse"; uc->usb_desc = &desc_mouse; uc->handle_packet = usb_generic_handle_packet; uc->handle_reset = usb_hid_handle_reset; u...
[ 0, 0 ]
qemu
acl.c
void cpu_watchpoint_remove_by_ref(CPUState *env, CPUWatchpoint *watchpoint) { TAILQ_REMOVE(&env->watchpoints, watchpoint, entry); tlb_flush_page(env, watchpoint->vaddr); qemu_free(watchpoint); }
[ 0, 0 ]
qemu
include/sysemu/replay.h
void replay_shutdown_request(void) { if (replay_mode == REPLAY_MODE_RECORD) { replay_mutex_lock(); replay_put_event(EVENT_SHUTDOWN); replay_mutex_unlock(); } }
[ 0, 0 ]
qemu
HACKING
target_phys_addr_t memory_region_section_get_iotlb(CPUArchState *env, MemoryRegionSection *section, target_ulong vaddr, target_phys_addr_t paddr, ...
[ 1, 0 ]
FFmpeg
libavformat/mpjpegdec.c
static int mpjpeg_read_probe(AVProbeData *p) { AVIOContext *pb; char line[128] = {0}; int ret = 0; pb = avio_alloc_context(p->buf, p->buf_size, 0, NULL, NULL, NULL, NULL); if (!pb) return AVERROR(ENOMEM); if (p->buf_size < 2 || p->buf[0] != '-' || p->buf[1] != '-') return 0; while (!pb->...
[ 1, 0 ]
qemu
linux-user/main.c
static void gen_mtsr(DisasContext *ctx) { #if defined(CONFIG_USER_ONLY) gen_inval_exception(ctx, POWERPC_EXCP_PRIV_REG); #else TCGv t0; if (unlikely(ctx->pr)) { gen_inval_exception(ctx, POWERPC_EXCP_PRIV_REG); return; } t0 = tcg_const_tl(SR(ctx->opcode)); gen_helper_store_sr(cpu_env, t0, c...
[ 1, 0 ]
FFmpeg
libavfilter/vf_pullup.c
static PullupField *make_field_queue(PullupContext *s, int len) { PullupField *head, *f; f = head = av_mallocz(sizeof(*head)); if (!f) return NULL; if (alloc_metrics(s, f) < 0) { av_free(f); return NULL; } for (; len > 0; len--) { f->next = av_mallocz(sizeof(*f->next)); if (!f...
[ 1, 0 ]
qemu
tests/libqos/virtio-mmio.c
static void pci_basic(gconstpointer data) { QVirtioPCIDevice *dev; QPCIBus *bus; QVirtQueuePCI *tx, *rx; QGuestAllocator *alloc; void (*func)(const QVirtioBus *bus, QVirtioDevice *dev, QGuestAllocator *alloc, QVirtQueue *rvq, QVirtQueue *tv...
[ 1, 0 ]
FFmpeg
libavcodec/pthread.c
static void frame_thread_free(AVCodecContext *avctx, int thread_count) { FrameThreadContext *fctx = avctx->thread_opaque; AVCodec *codec = avctx->codec; int i; park_frame_worker_threads(fctx, thread_count); if (fctx->prev_thread && fctx->prev_thread != fctx->threads) update_context_from_thread(fctx...
[ 1, 0 ]
qemu
block/nbd.c
int qio_dns_resolver_lookup_sync(QIODNSResolver *resolver, SocketAddress *addr, size_t *naddrs, SocketAddress ***addrs, Error **errp) { switch (addr->type) { case SOCKET_ADDRESS...
[ 0, 0 ]
qemu
hw/fw_cfg.c
int fw_cfg_add_file(FWCfgState *s, const char *dir, const char *filename, uint8_t *data, uint32_t len) { const char *basename; int index; if (!s->files) { int dsize = sizeof(uint32_t) + sizeof(FWCfgFile) * FW_CFG_FILE_SLOTS; s->files = qemu_mallocz(dsize); fw_cfg_add_bytes(...
[ 1, 0 ]
qemu
hw/block/virtio-blk.c
static bool virtio_device_endian_needed(void *opaque) { VirtIODevice *vdev = opaque; assert(vdev->device_endian != VIRTIO_DEVICE_ENDIAN_UNKNOWN); if (!virtio_has_feature(vdev, VIRTIO_F_VERSION_1)) { return vdev->device_endian != virtio_default_endian(); } /* Devices conforming to VIRTIO 1.0 or later...
[ 0, 0 ]
qemu
hw/arm/nseries.c
static void omap_pwt_write(void *opaque, hwaddr addr, uint64_t value, unsigned size) { struct omap_pwt_s *s = (struct omap_pwt_s *)opaque; int offset = addr & OMAP_MPUI_REG_MASK; if (size != 1) { omap_badwidth_write8(opaque, addr, value); return; } switch (offset) { ...
[ 1, 0 ]
qemu
curses.c
void curses_display_init(DisplayState *ds, int full_screen) { #ifndef _WIN32 if (!isatty(1)) { fprintf(stderr, "We need a terminal output\n"); exit(1); } #endif curses_setup(); curses_keyboard_setup(); atexit(curses_atexit); #ifndef _WIN32 signal(SIGINT, SIG_DFL); signal(SIGQUIT, SIG_D...
[ 0, 0 ]
qemu
hw/ppc/spapr.c
static uint32_t set_allocation_state(sPAPRDRConnector *drc, sPAPRDRAllocationState state) { sPAPRDRConnectorClass *drck = SPAPR_DR_CONNECTOR_GET_CLASS(drc); trace_spapr_drc_set_allocation_state(get_index(drc), state); if (state == SPAPR_DR_ALLOCATION_STATE_USABLE) { ...
[ 1, 0 ]
qemu
hw/xtensa/xtfpga.c
static void xtensa_lx60_init(MachineState *machine) { static const LxBoardDesc lx60_board = { .flash_base = 0xf8000000, .flash_size = 0x00400000, .flash_sector_size = 0x10000, .sram_size = 0x20000, }; lx_init(&lx60_board, machine); }
[ 0, 0 ]
qemu
slirp/bootp.c
int udp_output2(struct socket *so, struct mbuf *m, struct sockaddr_in *saddr, struct sockaddr_in *daddr, int iptos) { register struct udpiphdr *ui; int error = 0; DEBUG_CALL("udp_output"); DEBUG_ARG("so = %p", so); DEBUG_ARG("m = %p", m); DEBUG_ARG("saddr = %lx", (lo...
[ 1, 0 ]
qemu
MAINTAINERS
static void sigp_initial_cpu_reset(CPUState *cs, run_on_cpu_data arg) { S390CPU *cpu = S390_CPU(cs); S390CPUClass *scc = S390_CPU_GET_CLASS(cpu); SigpInfo *si = arg.host_ptr; cpu_synchronize_state(cs); scc->initial_cpu_reset(cs); cpu_synchronize_post_reset(cs); si->cc = SIGP_CC_ORDER_CODE_ACCEPTED...
[ 0, 0 ]
qemu
tests/test-cutils.c
static void test_qemu_strtoul_full_negative(void) { const char *str = " \t -321"; unsigned long res = 999; int err; err = qemu_strtoul(str, NULL, 0, &res); g_assert_cmpint(err, ==, 0); g_assert_cmpint(res, ==, -321ul); }
[ 1, 0 ]
qemu
hw/mac_dbdma.c
dbdma_control_write(DBDMA_channel *ch) { uint16_t mask, value; uint32_t status; mask = (ch->regs[DBDMA_CONTROL] >> 16) & 0xffff; value = ch->regs[DBDMA_CONTROL] & 0xffff; value &= (RUN | PAUSE | FLUSH | WAKE | DEVSTAT); status = ch->regs[DBDMA_STATUS]; status = (value & mask) | (status & ~mask); ...
[ 1, 0 ]
qemu
hw/fw_cfg.c
int fw_cfg_add_callback(void *opaque, uint16_t key, FWCfgCallback callback, void *callback_opaque, uint8_t *data, size_t len) { FWCfgState *s = opaque; int arch = !!(key & FW_CFG_ARCH_LOCAL); key &= FW_CFG_ENTRY_MASK; if (key >= FW_CFG_MAX_ENTRY || !(key & FW_CFG_WRITE_CHANNEL) ...
[ 1, 0 ]
qemu
monitor.c
static void term_backward_char(void) { if (term_cmd_buf_index > 0) { term_cmd_buf_index--; } }
[ 0, 0 ]
qemu
docs/qapi-code-gen.txt
void visit_type_int32(Visitor *v, int32_t *obj, const char *name, Error **errp) { int64_t value; if (!error_is_set(errp)) { if (v->type_int32) { v->type_int32(v, obj, name, errp); } else { value = *obj; v->type_int(v, &value, name, errp); if (value < INT32_MIN || value > INT...
[ 1, 0 ]
qemu
include/migration/qemu-file.h
int qemu_get_buffer(QEMUFile *f, uint8_t *buf, int size) { int pending = size; int done = 0; while (pending > 0) { int res; res = qemu_peek_buffer(f, buf, pending, 0); if (res == 0) { return done; } qemu_file_skip(f, res); buf += res; pending -= res; done += res; ...
[ 1, 0 ]
FFmpeg
libavcodec/flacdec.c
static void lpc_analyze_remodulate(int32_t *decoded, const int coeffs[32], int order, int qlevel, int len, int bps) { int i, j; int ebps = 1 << (bps - 1); unsigned sigma = 0; for (i = order; i < len; i++) sigma |= decoded[i] + ebps; if (sigma < 2 * ebps) ret...
[ 1, 0 ]
qemu
hw/xen/xen_pt.h
static int xen_pt_msixctrl_reg_write(XenPCIPassthroughState *s, XenPTReg *cfg_entry, uint16_t *val, uint16_t dev_value, uint16_t valid_mask) { XenPTRegInfo *reg = cfg_entry->reg; uint16_t writable_mask = 0; uint16_t throughable_mask =...
[ 1, 0 ]
qemu
cpu-exec.c
static inline TranslationBlock *tb_find_fast(CPUState *cpu, TranslationBlock *last_tb, int tb_exit) { CPUArchState *env = (CPUArchState *)cpu->env_ptr; TranslationBlock *tb; target_ulong cs_base, pc; uint32_t flags;...
[ 1, 0 ]
qemu
block/block-backend.c
int64_t bdrv_get_block_status_above(BlockDriverState *bs, BlockDriverState *base, int64_t sector_num, int nb_sectors, int *pnum, BlockDriverState **file) { Coroutine *c...
[ 0, 0 ]
qemu
hw/9pfs/virtio-9p-proxy.c
static int proxy_init(FsContext *ctx) { V9fsProxy *proxy = g_malloc(sizeof(V9fsProxy)); int sock_id; if (ctx->export_flags & V9FS_PROXY_SOCK_NAME) { sock_id = connect_namedsocket(ctx->fs_root); } else { sock_id = atoi(ctx->fs_root); if (sock_id < 0) { fprintf(stderr, "socket descripto...
[ 1, 0 ]
qemu
target-ppc/kvm.c
int kvm_arch_remove_sw_breakpoint(CPUState *cpu, struct kvm_sw_breakpoint *bp) { return -EINVAL; }
[ 1, 0 ]
FFmpeg
libavformat/tcp.c
static int unix_open(URLContext *h, const char *filename, int flags) { UnixContext *s = h->priv_data; int fd, ret; av_strstart(filename, "unix:", &filename); s->addr.sun_family = AF_UNIX; av_strlcpy(s->addr.sun_path, filename, sizeof(s->addr.sun_path)); if ((fd = ff_socket(AF_UNIX, s->type, 0)) < 0) ...
[ 1, 0 ]
FFmpeg
libswscale/swscale_template.c
static inline void RENAME(rgb16ToUV)(uint8_t *dstU, uint8_t *dstV, uint8_t *src1, uint8_t *src2, int width) { int i; assert(src1 == src2); for (i = 0; i < width; i++) { int d0 = ((uint32_t *)src1)[i]; int dl = (d0 & 0x07E0F81F); int dh = ((d0 >> 5) & 0x07...
[ 1, 0 ]
FFmpeg
libavcodec/dxva2_h264.c
static int dxva2_h264_start_frame(AVCodecContext *avctx, av_unused const uint8_t *buffer, av_unused uint32_t size) { const H264Context *h = avctx->priv_data; AVDXVAContext *ctx = avctx->hwaccel_context; struct dxva2_picture_context *ctx_pic...
[ 1, 0 ]
FFmpeg
libswscale/swscale.c
static inline void RENAME(yuv2yuvX)(SwsContext *c, int16_t *lumFilter, int16_t **lumSrc, int lumFilterSize, int16_t *chrFilter, int16_t **chrSrc, int chrFilterSize, uint8_t *...
[ 0, 0 ]
FFmpeg
ffserver.c
static AVStream *add_av_stream1(FFStream *stream, AVCodecContext *codec, int copy) { AVStream *fst; fst = av_mallocz(sizeof(AVStream)); if (!fst) return NULL; if (copy) { fst->codec = avcodec_alloc_context(); memcpy(fst->codec, codec, sizeof(AVCodecContext)); ...
[ 1, 0 ]
qemu
Makefile
static void buffer_reserve(Buffer *buffer, size_t len) { if ((buffer->capacity - buffer->offset) < len) { buffer->capacity += (len + 1024); buffer->buffer = qemu_realloc(buffer->buffer, buffer->capacity); if (buffer->buffer == NULL) { fprintf(stderr, "vnc: out of memory\n"); exit(1); ...
[ 1, 0 ]
qemu
block/crypto.c
static void qmp_input_end_struct(Visitor *v, Error **errp) { QmpInputVisitor *qiv = to_qiv(v); qmp_input_pop(qiv, errp); }
[ 1, 0 ]
qemu
target-arm/translate.c
static inline void gen_st16(TCGv val, TCGv addr, int index) { tcg_gen_qemu_st16(val, addr, index); dead_tmp(val); }
[ 1, 0 ]
qemu
block/vvfat.c
static void init_mbr(BDRVVVFATState *s) { /* TODO: if the files mbr.img and bootsect.img exist, use them */ mbr_t *real_mbr = (mbr_t *)s->first_sectors; partition_t *partition = &(real_mbr->partition[0]); int lba; memset(s->first_sectors, 0, 512); /* Win NT Disk Signature */ real_mbr->nt_id = cpu_...
[ 1, 1 ]
FFmpeg
libavcodec/hevcdsp_template.c
static void FUNC(put_hevc_qpel_bi_w_hv)(uint8_t *_dst, ptrdiff_t _dststride, uint8_t *_src, ptrdiff_t _srcstride, int16_t *src2, int height, int denom, int wx0, int wx1, ...
[ 1, 0 ]
qemu
block/block-backend.c
int bdrv_flush(BlockDriverState *bs) { Coroutine *co; FlushCo flush_co = { .bs = bs, .ret = NOT_DONE, }; if (qemu_in_coroutine()) { /* Fast-path if already in coroutine context */ bdrv_flush_co_entry(&flush_co); } else { co = qemu_coroutine_create(bdrv_flush_co_entry, &flush...
[ 1, 0 ]
qemu
tests/vhost-user-test.c
static void test_server_free(TestServer *server) { int i; qemu_chr_delete(server->chr); for (i = 0; i < server->fds_num; i++) { close(server->fds[i]); } if (server->log_fd != -1) { close(server->log_fd); } unlink(server->socket_path); g_free(server->socket_path); g_free(server->chr_n...
[ 1, 0 ]
qemu
hw/ppc/spapr.c
static HotpluggableCPUList *spapr_query_hotpluggable_cpus(MachineState *machine) { int i; HotpluggableCPUList *head = NULL; sPAPRMachineState *spapr = SPAPR_MACHINE(machine); sPAPRMachineClass *smc = SPAPR_MACHINE_GET_CLASS(machine); int spapr_max_cores = max_cpus / smp_threads; g_assert(smc->dr_cpu_...
[ 1, 1 ]
FFmpeg
libavformat/matroskadec.c
static int matroska_ebmlnum_uint(MatroskaDemuxContext *matroska, uint8_t *data, uint32_t size, uint64_t *num) { ByteIOContext pb; init_put_byte(&pb, data, size, 0, NULL, NULL, NULL, NULL); return ebml_read_num(matroska, &pb, 8, num); }
[ 1, 0 ]
qemu
hw/slavio_timer.c
static void slavio_timer_get_out(SLAVIO_TIMERState *s) { uint64_t count; count = s->limit - PERIODS_TO_LIMIT(ptimer_get_count(s->timer)); DPRINTF("get_out: limit %" PRIx64 " count %x%08x\n", s->limit, s->counthigh, s->count); s->count = count & TIMER_COUNT_MASK32; s->counthigh = count >> 32; ...
[ 0, 0 ]
qemu
HACKING
static struct omap_mpuio_s *omap_mpuio_init(MemoryRegion *memory, target_phys_addr_t base, qemu_irq kbd_int, qemu_irq gpio_int, qemu_irq wakeup, ...
[ 0, 0 ]
qemu
hw/ppc/spapr.c
static target_ulong h_read(PowerPCCPU *cpu, sPAPRMachineState *spapr, target_ulong opcode, target_ulong *args) { CPUPPCState *env = &cpu->env; target_ulong flags = args[0]; target_ulong ptex = args[1]; uint8_t *hpte; int i, ridx, n_entries = 1; if (!valid_ptex(cpu, ptex)) ...
[ 0, 0 ]
qemu
HACKING
static void a9_scu_write(void *opaque, target_phys_addr_t offset, uint64_t value, unsigned size) { a9mp_priv_state *s = (a9mp_priv_state *)opaque; uint32_t mask; uint32_t shift; switch (size) { case 1: mask = 0xff; break; case 2: mask = 0xffff; break; ...
[ 1, 0 ]
qemu
hw/ide/ich.c
static void s390_virtio_net_class_init(ObjectClass *klass, void *data) { DeviceClass *dc = DEVICE_CLASS(klass); VirtIOS390DeviceClass *k = VIRTIO_S390_DEVICE_CLASS(klass); k->init = s390_virtio_net_init; dc->props = s390_virtio_net_properties; dc->alias = "virtio-net"; }
[ 0, 0 ]
qemu
hw/arm/nseries.c
static void bt_dummy_lmp_acl_resp(struct bt_link_s *link, const uint8_t *data, int start, int len) { fprintf(stderr, "%s: stray ACL response PDU, fixme\n", __FUNCTION__); exit(-1); }
[ 0, 0 ]
qemu
hw/pci/msix.c
static bool msix_vector_masked(PCIDevice *dev, int vector, bool fmask) { unsigned offset = vector * PCI_MSIX_ENTRY_SIZE + PCI_MSIX_ENTRY_VECTOR_CTRL; return fmask || dev->msix_table[offset] & PCI_MSIX_ENTRY_CTRL_MASKBIT; }
[ 1, 0 ]
qemu
hw/virtio-blk.c
static void virtio_blk_dma_restart_bh(void *opaque) { VirtIOBlock *s = opaque; VirtIOBlockReq *req = s->rq; MultiReqBuffer mrb = { .num_writes = 0, }; qemu_bh_delete(s->bh); s->bh = NULL; s->rq = NULL; while (req) { virtio_blk_handle_request(req, &mrb); req = req->next; } ...
[ 0, 0 ]
qemu
target/s390x/helper.h
void HELPER(stpq)(CPUS390XState *env, uint64_t addr, uint64_t low, uint64_t high) { uintptr_t ra = GETPC(); if (parallel_cpus) { #ifndef CONFIG_ATOMIC128 cpu_loop_exit_atomic(ENV_GET_CPU(env), ra); #else int mem_idx = cpu_mmu_index(env, false); TCGMemOpIdx oi = make_memop_idx(...
[ 0, 0 ]
qemu
hw/vmware_vga.c
static void vmsvga_reset(struct vmsvga_state_s *s) { s->index = 0; s->enable = 0; s->config = 0; s->width = -1; s->height = -1; s->svgaid = SVGA_ID; s->depth = 24; s->bypp = (s->depth + 7) >> 3; s->cursor.on = 0; s->redraw_fifo_first = 0; s->redraw_fifo_last = 0; switch (s->depth) {...
[ 1, 0 ]
FFmpeg
libavformat/mpegtsenc.c
static MpegTSService *mpegts_add_service(MpegTSWrite *ts, int sid, const char *provider_name, const char *name) { MpegTSService *service; service = av_mallocz(sizeof(MpegTSService)); if (!service) return NULL; service-...
[ 1, 0 ]
qemu
configure
void qemu_cpu_kick(void *env) {}
[ 1, 0 ]
qemu
hw/arm_gic.c
static void gic_cpu_write(gic_state *s, int cpu, int offset, uint32_t value) { switch (offset) { case 0x00: /* Control */ s->cpu_enabled[cpu] = (value & 1); DPRINTF("CPU %d %sabled\n", cpu, s->cpu_enabled ? "En" : "Dis"); break; case 0x04: /* Priority mask */ s->priority_mask[cpu] = (value...
[ 1, 0 ]
qemu
target-ppc/cpu.h
void OPPROTO op_POWER_srea(void) { T1 &= 0x1FUL; env->spr[SPR_MQ] = T0 >> T1; T0 = Ts0 >> T1; RETURN(); }
[ 1, 0 ]
FFmpeg
libavcodec/dv.c
static always_inline void dv_set_class_number(DCTELEM *blk, EncBlockInfo *bi, const uint8_t *zigzag_scan, int bias) { int i, area; int run; int classes[] = {12, 24, 36, 0xffff}; run = 0; bi->mb[0] = blk[0]; b...
[ 1, 1 ]
qemu
net/dump.c
int net_init_dump(const NetClientOptions *opts, const char *name, NetClientState *peer, Error **errp) { /* FIXME error_setg(errp, ...) on failure */ int len; const char *file; char def_file[128]; const NetdevDumpOptions *dump; assert(opts->kind == NET_CLIENT_OPTIONS_KIND_DUMP); ...
[ 1, 1 ]
qemu
hw/sun4u.c
pci_ebus_init1(PCIDevice *s) { isa_bus_new(&s->qdev); s->config[0x04] = 0x06; // command = bus master, pci mem s->config[0x05] = 0x00; s->config[0x06] = 0xa0; // status = fast back-to-back, 66MHz, no error s->config[0x07] = 0x03; // status = medium devsel s->config[0x09] = 0x00; // programming i/f ...
[ 1, 0 ]
FFmpeg
libavcodec/j2kenc.c
void ff_jpeg2000_set_significance(Jpeg2000T1Context *t1, int x, int y, int negative) { x++; y++; t1->flags[y][x] |= JPEG2000_T1_SIG; if (negative) { t1->flags[y][x + 1] |= JPEG2000_T1_SIG_W | JPEG2000_T1_SGN_W; t1->flags[y][x - 1] |= JPEG2000_T1_SIG_E | JPEG2000...
[ 1, 0 ]
qemu
hw/qdev-properties.c
static int print_uint32(DeviceState *dev, Property *prop, char *dest, size_t len) { uint32_t *ptr = qdev_get_prop_ptr(dev, prop); return snprintf(dest, len, "%" PRIu32, *ptr); }
[ 1, 0 ]
FFmpeg
libavformat/hlsenc.c
static int hls_mux_init(AVFormatContext *s) { HLSContext *hls = s->priv_data; AVFormatContext *oc; AVFormatContext *vtt_oc; int i, ret; ret = avformat_alloc_output_context2(&hls->avf, hls->oformat, NULL, NULL); if (ret < 0) return ret; oc = hls->avf; oc->oformat = hls->oformat; oc->inte...
[ 1, 0 ]
qemu
configure
static int64_t qemu_icount_delta(void) { if (!use_icount) { return 5000 * (int64_t)1000000; } else if (use_icount == 1) { /* When not using an adaptive execution frequency we tend to get badly out of sync with real time, so just delay for a reasonable amount of time. */ return 0; ...
[ 1, 0 ]
FFmpeg
libavcodec/dirac_parser.c
static int unpack_parse_unit(DiracParseUnit *pu, DiracParseContext *pc, int offset) { uint8_t *start = pc->buffer + offset; uint8_t *end = pc->buffer + pc->index; if (start < pc->buffer || (start + 13 > end)) return 0; pu->pu_type = start[4]; pu->next_pu_offset = AV_RB...
[ 1, 0 ]
qemu
tests/test-cutils.c
static void test_qemu_strtoll_empty(void) { const char *str = ""; char f = 'X'; const char *endptr = &f; int64_t res = 999; int err; err = qemu_strtoll(str, &endptr, 0, &res); g_assert_cmpint(err, ==, 0); g_assert_cmpint(res, ==, 0); g_assert(endptr == str); }
[ 1, 0 ]
qemu
hw/input/Makefile.objs
static void adb_kbd_realizefn(DeviceState *dev, Error **errp) { ADBKeyboardClass *akc = ADB_KEYBOARD_GET_CLASS(dev); akc->parent_realize(dev, errp); qemu_input_handler_register(dev, &adb_keyboard_handler); }
[ 1, 0 ]
FFmpeg
libavdevice/xcbgrab.c
static int xcbgrab_reposition(AVFormatContext *s, xcb_query_pointer_reply_t *p, xcb_get_geometry_reply_t *geo) { XCBGrabContext *c = s->priv_data; int x = c->x, y = c->y, p_x = p->win_x, p_y = p->win_y; int w = c->width, h = c->height, f = c->follo...
[ 1, 0 ]
qemu
hw/ppc/ppc.c
clk_setup_cb cpu_ppc_tb_init(CPUPPCState *env, uint32_t freq) { PowerPCCPU *cpu = ppc_env_get_cpu(env); ppc_tb_t *tb_env; tb_env = g_malloc0(sizeof(ppc_tb_t)); env->tb_env = tb_env; tb_env->flags = PPC_DECR_UNDERFLOW_TRIGGERED; if (env->insns_flags & PPC_SEGMENT_64B) { /* All Book3S 64bit CPUs i...
[ 1, 1 ]
qemu
Makefile.objs
static int usbredir_handle_bulk_data(USBRedirDevice *dev, USBPacket *p, uint8_t ep) { AsyncURB *aurb = async_alloc(dev, p); struct usb_redir_bulk_packet_header bulk_packet; DPRINTF("bulk-out ep %02X len %d id %u\n", ep, p->len, aurb->packet_id); bulk_packet.endpoint = ...
[ 1, 0 ]
FFmpeg
libavcodec/motion_est.c
int ff_get_best_fcode(MpegEncContext *s, int16_t (*mv_table)[2], int type) { int f_code; if (s->me_method >= ME_EPZS) { int mv_num[8]; int i, y; int loose = 0; UINT8 *fcode_tab = s->fcode_tab; for (i = 0; i < 8; i++) mv_num[i] = 0; for (y = 0; y < s->mb_height; y++) { i...
[ 0, 1 ]
FFmpeg
libavfilter/vf_crop.c
static void start_frame(AVFilterLink *link, AVFilterPicRef *picref) { CropContext *crop = link->dst->priv; AVFilterPicRef *ref2 = avfilter_ref_pic(picref, ~0); int i; ref2->w = crop->w; ref2->h = crop->h; ref2->data[0] += crop->y * ref2->linesize[0]; ref2->data[0] += (crop->x * crop->bpp) >> 3; ...
[ 1, 0 ]
FFmpeg
libavutil/Makefile
static int test_vector_fmul_window(AVFloatDSPContext *fdsp, AVFloatDSPContext *cdsp, const float *v1, const float *v2, const float *v3) { LOCAL_ALIGNED(32, float, cdst, [LEN]); LOCAL_ALIGNED(32, float, odst, [LEN]); int ret; cdsp->vector_fmul_window(cdst, v1, v2, v3, LEN / 2); f...
[ 0, 0 ]
FFmpeg
libavcodec/libgsm.c
static av_cold int pcm_encode_init(AVCodecContext *avctx) { avctx->frame_size = 0; switch (avctx->codec->id) { case CODEC_ID_PCM_ALAW: pcm_alaw_tableinit(); break; case CODEC_ID_PCM_MULAW: pcm_ulaw_tableinit(); break; default: break; } avctx->bits_per_coded_sample = av_get_...
[ 1, 0 ]