Projectname
large_stringclasses
15 values
Filepath
large_stringlengths
4
106
Function
large_stringlengths
11
3.45k
Label
list
FFmpeg
libavcodec/vaapi_encode.c
static av_cold int vaapi_encode_init_rate_control(AVCodecContext *avctx) { VAAPIEncodeContext *ctx = avctx->priv_data; int hrd_buffer_size; int hrd_initial_buffer_fullness; if (avctx->rc_buffer_size) hrd_buffer_size = avctx->rc_buffer_size; else hrd_buffer_size = avctx->bit_rate; if (avctx-...
[ 1, 0 ]
qemu
block.c
int bdrv_snapshot_list(BlockDriverState *bs, QEMUSnapshotInfo **psn_info) { BlockDriver *drv = bs->drv; if (!drv) return -ENOMEDIUM; if (drv->bdrv_snapshot_list) return drv->bdrv_snapshot_list(bs, psn_info); if (bs->file) return bdrv_snapshot_list(bs->file, psn_info);...
[ 0, 0 ]
qemu
target-ppc/cpu.h
int check_prot(int prot, int rw, int access_type) { int ret; if (access_type == ACCESS_CODE) { if (prot & PAGE_EXEC) { ret = 0; } else { ret = -2; } } else if (rw) { if (prot & PAGE_WRITE) { ret = 0; } else { ret = -2; } } else { if (prot & PAGE_...
[ 0, 0 ]
qemu
target-microblaze/op_helper.c
static void dec_store(DisasContext *dc) { TCGv t, *addr; unsigned int size; size = 1 << (dc->opcode & 3); if (size > 4 && (dc->tb_flags & MSR_EE_FLAG) && !(dc->env->pvr.regs[2] & PVR2_ILL_OPCODE_EXC_MASK)) { tcg_gen_movi_tl(cpu_SR[SR_ESR], ESR_EC_ILLEGAL_OP); t_gen_raise_exception(dc, EXCP...
[ 1, 0 ]
qemu
qapi-schema.json
void qmp_ringbuf_write(const char *device, const char *data, bool has_format, enum DataFormat format, Error **errp) { CharDriverState *chr; const uint8_t *write_data; int ret; gsize write_count; chr = qemu_chr_find(device); if (!chr) { error_setg(e...
[ 0, 0 ]
qemu
hmp-commands.hx
int do_migrate(Monitor *mon, const QDict *qdict, QObject **ret_data) { MigrationState *s = migrate_get_current(); const char *p; int detach = qdict_get_try_bool(qdict, "detach", 0); int blk = qdict_get_try_bool(qdict, "blk", 0); int inc = qdict_get_try_bool(qdict, "inc", 0); const char *uri = qdict_g...
[ 0, 0 ]
qemu
async.c
void *laio_init(void) { struct qemu_laio_state *s; s = qemu_mallocz(sizeof(*s)); QLIST_INIT(&s->completed_reqs); s->efd = eventfd(0, 0); if (s->efd == -1) goto out_free_state; fcntl(s->efd, F_SETFL, O_NONBLOCK); if (io_setup(MAX_EVENTS, &s->ctx) != 0) goto out_close_efd; qemu_aio_set_...
[ 0, 0 ]
FFmpeg
cmdutils.c
static int aasc_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; AascContext *s = avctx->priv_data; int compr, i, stride, ret; s->frame.reference = ...
[ 1, 0 ]
qemu
hw/9pfs/virtio-9p.c
static void complete_pdu(V9fsState *s, V9fsPDU *pdu, ssize_t len) { int8_t id = pdu->id + 1; /* Response */ if (len < 0) { int err = -len; len = 7; if (s->proto_version != V9FS_PROTO_2000L) { V9fsString str; str.data = strerror(err); str.size = strlen(str.data); len += ...
[ 1, 1 ]
qemu
target-s390x/op_helper.c
static inline uint64_t cksm_overflow(uint64_t cksm) { if (cksm > 0xffffffffULL) { cksm &= 0xffffffffULL; cksm++; } return cksm; }
[ 1, 0 ]
qemu
migration-tcp.c
int tcp_start_outgoing_migration(MigrationState *s, const char *host_port, Error **errp) { s->get_error = socket_errno; s->write = socket_write; s->close = tcp_close; s->fd = inet_connect(host_port, false, NULL, errp); if (!error_is_set(errp)) { migrate_fd_connect(...
[ 1, 0 ]
FFmpeg
libavformat/asfdec.c
static int asf_read_simple_index(AVFormatContext *s, const GUIDParseTable *g) { ASFContext *asf = s->priv_data; AVIOContext *pb = s->pb; AVStream *st = NULL; uint64_t interval; // index entry time interval in 100 ns units, usually it's 1s uint32_t pkt_num, nb_entries; int32_t prev_pkt_num = -1;...
[ 1, 0 ]
qemu
target-ppc/cpu.h
PPC_OP(subfeo) { do_subfeo(); RETURN(); }
[ 1, 0 ]
qemu
hw/pci/pci.c
static void pci_bus_init(PCIBus *bus, DeviceState *parent, const char *name, MemoryRegion *address_space_mem, MemoryRegion *address_space_io, uint8_t devfn_min) { assert(PCI_FUNC(devfn_min) == 0); bus->devfn_m...
[ 1, 0 ]
qemu
target-ppc/cpu.h
target_ulong do_load_msr(CPUPPCState *env) { return #if defined(TARGET_PPC64) ((target_ulong)msr_sf << MSR_SF) | ((target_ulong)msr_isf << MSR_ISF) | ((target_ulong)msr_hv << MSR_HV) | #endif ((target_ulong)msr_ucle << MSR_UCLE) | ((target_ulong)msr_vr << MSR_VR) | /* VR / SPE *...
[ 1, 0 ]
qemu
target-xtensa/cpu.h
static void gen_wsr_windowstart(DisasContext *dc, uint32_t sr, TCGv_i32 v) { tcg_gen_andi_i32(cpu_SR[sr], v, (1 << dc->config->nareg / 4) - 1); reset_used_window(dc); }
[ 1, 0 ]
FFmpeg
libavcodec/utils.c
int attribute_align_arg avcodec_send_packet(AVCodecContext *avctx, const AVPacket *avpkt) { int ret; if (!avcodec_is_open(avctx) || !av_codec_is_decoder(avctx->codec)) return AVERROR(EINVAL); if (avctx->internal->draining) return AVERROR_EOF; if (!avpkt...
[ 1, 0 ]
FFmpeg
Changelog
int check_tm_pred8x8_mode(int mode, int mb_x, int mb_y) { if (!mb_x) return mb_y ? VERT_PRED8x8 : DC_129_PRED8x8; else return mb_y ? mode : HOR_PRED8x8; }
[ 1, 0 ]
FFmpeg
libavformat/mxfdec.c
static int mxf_add_metadata_set(MXFContext *mxf, void *metadata_set) { int err; if (mxf->metadata_sets_count + 1 >= UINT_MAX / sizeof(*mxf->metadata_sets)) return AVERROR(ENOMEM); if ((err = av_reallocp_array(&mxf->metadata_sets, mxf->metadata_sets_count + 1, size...
[ 1, 0 ]
qemu
linux-user/signal.c
static int do_sigframe_return_v2(CPUState *env, target_ulong frame_addr, struct target_ucontext_v2 *uc) { sigset_t host_set; abi_ulong *regspace; target_to_host_sigset(&host_set, &uc->tuc_sigmask); sigprocmask(SIG_SETMASK, &host_set, NULL); if (restore_sigcontext(env, &uc->tuc...
[ 1, 0 ]
qemu
include/qapi/visitor.h
static void qobject_input_type_uint64(Visitor *v, const char *name, uint64_t *obj, Error **errp) { /* FIXME: qobject_to_qint mishandles values over INT64_MAX */ QObjectInputVisitor *qiv = to_qiv(v); QObject *qobj = qobject_input_get_object(qiv, name, true, errp); QInt...
[ 1, 1 ]
qemu
host-utils.c
void mulu64(uint64_t *phigh, uint64_t *plow, uint64_t a, uint64_t b) { #if defined(__x86_64__) __asm__("mul %0\n\t" : "=d"(*phigh), "=a"(*plow) : "a"(a), "0"(b) ); #else uint64_t ph, pm1, pm2, pl; pl = (uint64_t)((uint32_t)a) * (uint64_t)((uint32_t)b); pm1 = (a >> 32) * (uint32_t...
[ 1, 0 ]
qemu
target-mips/helper.h
HELPER_LD(lbu, ldub, uint8_t) HELPER_LD(lhu, lduw, uint16_t) HELPER_LD(lw, ldl, int32_t) HELPER_LD(ld, ldq, int64_t) #undef HELPER_LD #if defined(CONFIG_USER_ONLY) #define HELPER_ST(name, insn, type) static inline void do_##name(CPUMIPSState *env, target_ulong addr, type val, int me...
[ 1, 0 ]
qemu
hw/ipmi/ipmi_bmc_sim.c
static void clr_msg_flags(IPMIBmcSim *ibs, uint8_t *cmd, unsigned int cmd_len, uint8_t *rsp, unsigned int *rsp_len, unsigned int max_rsp_len) { IPMIInterface *s = ibs->parent.intf; IPMIInterfaceClass *k = IPMI_INTERFACE_GET_CLASS(s)...
[ 1, 0 ]
FFmpeg
libavformat/wtv.c
static void get_attachment(AVFormatContext *s, AVIOContext *pb, int length) { char mime[1024]; char description[1024]; unsigned int filesize; AVStream *st; int64_t pos = avio_tell(pb); avio_get_str16le(pb, INT_MAX, mime, sizeof(mime)); if (strcmp(mime, "image/jpeg")) goto done; avio_r8(pb)...
[ 1, 0 ]
FFmpeg
libavformat/webmdashenc.c
static int parse_filename(char *filename, char **representation_id, char **initialization_pattern, char **media_pattern) { char *underscore_pos = NULL; char *period_pos = NULL; char *temp_pos = NULL; char *filename_str = av_strdup(filename); if (!filename_str) return AVERRO...
[ 1, 0 ]
qemu
qga/commands-posix.c
struct GuestFileSeek *qmp_guest_file_seek(int64_t handle, int64_t offset, int64_t whence, Error **errp) { GuestFileHandle *gfh = guest_file_handle_find(handle, errp); GuestFileSeek *seek_data = NULL; FILE *fh; int ret; if (!gfh) { return NULL; fh = gf...
[ 1, 0 ]
qemu
hw/arm/armv7m.c
TC6393xbState *tc6393xb_init(MemoryRegion *sysmem, uint32_t base, qemu_irq irq) { TC6393xbState *s; DriveInfo *nand; static const MemoryRegionOps tc6393xb_ops = { .read = tc6393xb_readb, .write = tc6393xb_writeb, .endianness = DEVICE_NATIVE_ENDIAN, .impl = { ...
[ 1, 0 ]
qemu
aio-posix.c
void aio_set_event_notifier(AioContext *ctx, EventNotifier *e, EventNotifierHandler *io_notify, AioFlushEventNotifierHandler *io_flush) { AioHandler *node; QLIST_FOREACH(node, &ctx->aio_handlers, node) { if (node->e == e ...
[ 1, 0 ]
FFmpeg
tests/checkasm/checkasm.c
int float_near_ulp(float a, float b, unsigned max_ulp) { union av_intfloat32 x, y; x.f = a; y.f = b; if (is_negative(x) != is_negative(y)) { // handle -0.0 == +0.0 return a == b; } if (abs(x.i - y.i) <= max_ulp) return 1; return 0; }
[ 0, 0 ]
FFmpeg
libavcodec/libgsm.c
static av_cold int roq_dpcm_encode_init(AVCodecContext *avctx) { ROQDPCMContext *context = avctx->priv_data; if (avctx->channels > 2) { av_log(avctx, AV_LOG_ERROR, "Audio must be mono or stereo\n"); return -1; } if (avctx->sample_rate != 22050) { av_log(avctx, AV_LOG_ERROR, "Audio must be 220...
[ 1, 0 ]
qemu
hw/usb/dev-mtp.c
static MTPData *usb_mtp_get_object_info(MTPState *s, MTPControl *c, MTPObject *o) { MTPData *d = usb_mtp_data_alloc(c); trace_usb_mtp_op_get_object_info(s->dev.addr, o->handle, o->path); usb_mtp_add_u32(d, QEMU_STORAGE_ID); usb_mtp_add_u16(d, o->format); usb_mtp_...
[ 1, 0 ]
qemu
linux-user/strace.c
print_syscall_ret_addr(const struct syscallname *name, abi_long ret) { char *errstr = NULL; if (ret == -1) { errstr = target_strerror(errno); } if ((ret == -1) && errstr) { gemu_log(" = -1 errno=%d (%s)\n", errno, errstr); } else { gemu_log(" = 0x" TARGET_ABI_FMT_lx "\n", ret); } }
[ 1, 0 ]
qemu
hw/core/loader.c
static inline bool rom_order_compare(Rom *rom, Rom *item) { return (rom->as > item->as) || (rom->as == item->as && rom->addr >= item->addr); }
[ 1, 0 ]
FFmpeg
libavcodec/rv30.c
static int rv30_decode_mb_info(RV34DecContext *r) { static const int rv30_p_types[6] = { RV34_MB_SKIP, RV34_MB_P_16x16, RV34_MB_P_8x8, -1, RV34_MB_TYPE_INTRA, RV34_MB_TYPE_INTRA16x16}; static const int rv30_b_types[6] = { RV34_MB_SKIP, RV34_MB_B_DIRECT, RV34_MB_B_FORWARD, ...
[ 1, 0 ]
qemu
hw/arm/armv7m.c
static void ppc405_ocm_init(CPUPPCState *env) { ppc405_ocm_t *ocm; ocm = g_malloc0(sizeof(ppc405_ocm_t)); /* XXX: Size is 4096 or 0x04000000 */ memory_region_init_ram(&ocm->isarc_ram, NULL, "ppc405.ocm", 4096, &error_abort); vmstate_register_ram_global(&ocm->isarc_ram); memo...
[ 1, 1 ]
FFmpeg
libavcodec/h264.c
void ff_release_unused_pictures(MpegEncContext *s, int remove_current) { int i; /* release non reference frames */ for (i = 0; i < s->picture_count; i++) { if (s->picture[i].data[0] && !s->picture[i].reference && s->picture[i].owner2 == s && (remove_current || &s->picture[i] != s->curre...
[ 1, 0 ]
qemu
target-ppc/cpu.h
static int slb_lookup(CPUState *env, target_ulong eaddr, target_ulong *vsid, target_ulong *page_mask, int *attr) { target_phys_addr_t sr_base; target_ulong mask; uint64_t tmp64; uint32_t tmp; int n, ret; int slb_nr; ret = -5; sr_base = env->spr[SPR_ASR]; mask = 0x00000...
[ 1, 1 ]
qemu
blockdev.c
void qmp_block_resize(bool has_device, const char *device, bool has_node_name, const char *node_name, int64_t size, Error **errp) { Error *local_err = NULL; BlockBackend *blk = NULL; BlockDriverState *bs; AioContext *aio_context; int ret; bs = bdrv_lookup...
[ 1, 0 ]
FFmpeg
libavfilter/vf_framerate.c
static int blend_frames(AVFilterContext *ctx, int interpolate) { FrameRateContext *s = ctx->priv; AVFilterLink *outlink = ctx->outputs[0]; double interpolate_scene_score = 0; if ((s->flags & FRAMERATE_FLAG_SCD)) { if (s->score >= 0.0) interpolate_scene_score = s->score; else interpo...
[ 1, 0 ]
FFmpeg
libavcodec/mss3.c
static int rac_get_model256_sym(RangeCoder *c, Model256 *m) { int prob, prob2, helper, val; int start, end; int ssym; prob2 = c->range; c->range >>= MODEL_SCALE; helper = c->low / c->range; ssym = helper >> MODEL256_SEC_SCALE; val = m->secondary[ssym]; end = start = m->secondary[ssym + 1] + ...
[ 1, 0 ]
qemu
block/bochs.c
int qed_check(BDRVQEDState *s, BdrvCheckResult *result, bool fix) { QEDCheck check = { .s = s, .result = result, .nclusters = qed_bytes_to_clusters(s, s->file_size), .request = {.l2_table = NULL}, .fix = fix, }; int ret; check.used_clusters = g_try_malloc0(((check.ncluste...
[ 1, 0 ]
FFmpeg
libavcodec/h264.c
static void init_dequant4_coeff_table(H264Context *h) { int i, j, q, x; const int transpose = (h->h264dsp.h264_idct_add != ff_h264_idct_add_c); // FIXME ugly for (i = 0; i < 6; i++) { h->dequant4_coeff[i] = h->dequant4_buffer[i]; for (j = 0; j < i; j++) { if (!memcmp(h->pps.scaling_matri...
[ 1, 1 ]
qemu
cpu-exec.c
static always_inline void gen_farith2(void *helper, int rb, int rc) { if (unlikely(rc == 31)) return; if (rb != 31) tcg_gen_helper_1_1(helper, cpu_fir[rc], cpu_fir[rb]); else { TCGv tmp = tcg_const_i64(0); tcg_gen_helper_1_1(helper, cpu_fir[rc], tmp);...
[ 0, 0 ]
qemu
dump.c
static int write_elf32_load(DumpState *s, MemoryMapping *memory_mapping, int phdr_index, hwaddr offset) { Elf32_Phdr phdr; int ret; int endian = s->dump_info.d_endian; memset(&phdr, 0, sizeof(Elf32_Phdr)); phdr.p_type = cpu_convert_to_target32(PT_LOAD, endian); phdr.p_off...
[ 1, 0 ]
qemu
async.c
static void qemu_laio_enqueue_completed(struct qemu_laio_state *s, struct qemu_laiocb *laiocb) { if (laiocb->async_context_id == get_async_context_id()) { qemu_laio_process_completion(s, laiocb); } else { QLIST_INSERT_HEAD(&s->completed_reqs, laiocb, node); } ...
[ 0, 0 ]
qemu
HACKING
static void error_mem_write(void *opaque, target_phys_addr_t addr, uint64_t value, unsigned size) { abort(); }
[ 0, 0 ]
qemu
target/s390x/mem_helper.c
uint32_t HELPER(mvcle)(CPUS390XState *env, uint32_t r1, uint64_t a2, uint32_t r3) { uintptr_t ra = GETPC(); uint64_t destlen = get_length(env, r1 + 1); uint64_t dest = get_address(env, r1); uint64_t srclen = get_length(env, r3 + 1); uint64_t src = get_address(env, r3); uint8_t...
[ 1, 0 ]
qemu
linux-user/elfload.c
static inline void init_thread(struct target_pt_regs *regs, struct image_info *infop) { target_long *stack = (void *)infop->start_stack; memset(regs, 0, sizeof(*regs)); regs->ARM_cpsr = 0x10; regs->ARM_pc = infop->entry; regs->ARM_sp = infop->start_stack; regs->ARM_r2 =...
[ 1, 1 ]
FFmpeg
tests/checkasm/checkasm.c
static void check_cpu_flag(const char *name, int flag) { int old_cpu_flag = state.cpu_flag; flag |= old_cpu_flag; av_set_cpu_flags_mask(flag); state.cpu_flag = av_get_cpu_flags(); if (!flag || state.cpu_flag != old_cpu_flag) { int i; state.cpu_flag_name = name; for (i = 0; tests[i].func; ...
[ 1, 0 ]
FFmpeg
libavutil/Makefile
static void fill_double_array(AVLFG *lfg, double *a, int len) { int i; double bmg[2], stddev = 10.0, mean = 0.0; for (i = 0; i < len; i += 2) { av_bmg_get(lfg, bmg); a[i] = bmg[0] * stddev + mean; a[i + 1] = bmg[1] * stddev + mean; } }
[ 0, 0 ]
qemu
Makefile.objs
static int ccid_handle_data(USBDevice *dev, USBPacket *p) { USBCCIDState *s = DO_UPCAST(USBCCIDState, dev, dev); int ret = 0; uint8_t *data = p->data; int len = p->len; switch (p->pid) { case USB_TOKEN_OUT: ret = ccid_handle_bulk_out(s, p); break; case USB_TOKEN_IN: switch (p->devep...
[ 1, 0 ]
FFmpeg
libavformat/utils.c
static int has_duration(AVFormatContext *ic) { int i; AVStream *st; for (i = 0; i < ic->nb_streams; i++) { st = ic->streams[i]; if (st->duration != AV_NOPTS_VALUE) return 1; } if (ic->duration) return 1; return 0; }
[ 0, 0 ]
qemu
replay/replay-events.c
bool replay_checkpoint(ReplayCheckpoint checkpoint) { bool res = false; assert(EVENT_CHECKPOINT + checkpoint <= EVENT_CHECKPOINT_LAST); replay_save_instructions(); if (!replay_file) { return true; } replay_mutex_lock(); if (replay_mode == REPLAY_MODE_PLAY) { if (replay_next_event_is(EVENT...
[ 0, 0 ]
qemu
hmp.c
static void migrate_params_apply(MigrateSetParameters *params) { MigrationState *s = migrate_get_current(); /* TODO use QAPI_CLONE() instead of duplicating it inline */ if (params->has_compress_level) { s->parameters.compress_level = params->compress_level; } if (params->has_compress_threads) { ...
[ 0, 1 ]
qemu
hw/openrisc/openrisc_sim.c
static void openrisc_sim_machine_init(MachineClass *mc) { mc->desc = "or1k simulation"; mc->init = openrisc_sim_init; mc->max_cpus = 1; mc->is_default = 1; }
[ 0, 0 ]
qemu
block.c
static int multiwrite_req_compare(const void *a, const void *b) { const BlockRequest *req1 = a, *req2 = b; /* * Note that we can't simply subtract req2->sector from req1->sector * here as that could overflow the return value. */ if (req1->sector > req2->sector) { return 1; } else if (req1-...
[ 0, 0 ]
qemu
hw/9pfs/virtio-9p.c
static void put_fid(V9fsPDU *pdu, V9fsFidState *fidp) { BUG_ON(!fidp->ref); fidp->ref--; /* * Don't free the fid if it is in reclaim list */ if (!fidp->ref && fidp->clunked) { if (fidp->fid == pdu->s->root_fid) { /* * if the clunked fid is root fid then we * have unmount...
[ 1, 0 ]
qemu
block/vvfat.c
static void write_target_close(BlockDriverState *bs) { BDRVVVFATState *s = *((BDRVVVFATState **)bs->opaque); bdrv_delete(s->qcow); free(s->qcow_filename); }
[ 1, 0 ]
qemu
qga/commands-posix.c
static void build_guest_fsinfo_for_virtual_device(char const *syspath, GuestFilesystemInfo *fs, Error **errp) { DIR *dir; char *dirpath; struct dirent entry, *result; dirpath = g_strdup_printf("%s/slaves",...
[ 1, 0 ]
FFmpeg
output_example.c
void write_video_frame(AVFormatContext *oc, AVStream *st) { int x, y, i, out_size; AVCodecContext *c; c = &st->codec; /* prepare a dummy image */ /* Y */ i = frame_count++; for (y = 0; y < c->height; y++) { for (x = 0; x < c->width; x++) { picture->data[0][y * picture->linesize[0] + x]...
[ 1, 0 ]
qemu
target-ppc/op.c
void do_subfzeo_64(void) { T1 = T0; T0 = ~T0 + xer_ca; if (likely(!(((uint64_t)~T1 ^ UINT64_MAX) & ((uint64_t)(~T1) ^ (uint64_t)T0) & (1ULL << 63)))) { xer_ov = 0; } else { xer_ov = 1; xer_so = 1; } if (likely((uint64_t)T0 >= (uint64_t)~T1)) { xer_ca = 0; } else ...
[ 1, 0 ]
qemu
include/block/nbd.h
static void combine_addr(char *buf, size_t len, const char *address, uint16_t port) { /* If the address-part contains a colon, it's an IPv6 IP so needs [] */ if (strstr(address, ":")) { snprintf(buf, len, "[%s]:%u", address, port); } else { snprintf(buf, len, "%s:%u", addre...
[ 0, 0 ]
FFmpeg
libavcodec/motion_est.c
static int inline get_mb_score(MpegEncContext *s, int mx, int my, int src_index, int ref_index) { // const int check_luma= s->dsp.me_sub_cmp != s->dsp.mb_cmp; MotionEstContext *const c = &s->me; const int size = 0; const int h = 16; const int penalty_factor = c->mb_pen...
[ 1, 1 ]
qemu
block.c
bool bdrv_can_write_zeroes_with_unmap(BlockDriverState *bs) { BlockDriverInfo bdi; if (bs->backing_hd || !(bs->open_flags & BDRV_O_UNMAP)) { return false; } if (bdrv_get_info(bs, &bdi) == 0) { return bdi.can_write_zeroes_with_unmap; } return false; }
[ 0, 0 ]
qemu
Makefile.target
void pal_init(CPUState *env) {}
[ 0, 0 ]
qemu
hw/acpi/pcihp.c
static int acpi_pcihp_get_bsel(PCIBus *bus) { QObject *o = object_property_get_qobject(OBJECT(bus), ACPI_PCIHP_PROP_BSEL, NULL); int64_t bsel = -1; if (o) { bsel = qint_get_int(qobject_to_qint(o)); } if (bsel < 0) { return -1; } return bsel; }
[ 1, 0 ]
qemu
hw/net/vhost_net.c
bool vhost_dev_query(struct vhost_dev *hdev, VirtIODevice *vdev) { BusState *qbus = BUS(qdev_get_parent_bus(DEVICE(vdev))); VirtioBusState *vbus = VIRTIO_BUS(qbus); VirtioBusClass *k = VIRTIO_BUS_GET_CLASS(vbus); return !k->query_guest_notifiers || k->query_guest_notifiers(qbus->parent) || ...
[ 1, 0 ]
qemu
hw/block/pc_sysfw.c
static void pc_init_pci_1_3(QEMUMachineInitArgs *args) { enable_compat_apic_id_mode(); pc_sysfw_flash_vs_rom_bug_compatible = true; has_pvpanic = false; pc_init_pci(args); }
[ 1, 0 ]
qemu
arch_init.c
void kvm_setup_guest_memory(void *start, size_t size) { if (!kvm_has_sync_mmu()) { #ifdef MADV_DONTFORK int ret = madvise(start, size, MADV_DONTFORK); if (ret) { perror("madvice"); exit(1); } #else fprintf(stderr, "Need MADV_DONTFORK in absence of synchronous KVM MMU\...
[ 1, 0 ]
FFmpeg
libavformat/assdec.c
static int read_packet(AVFormatContext *s, AVPacket *pkt) { ASSContext *ass = s->priv_data; uint8_t *p, *end; if (ass->event_index >= ass->event_count) return AVERROR(EIO); p = ass->event[ass->event_index]; end = strchr(p, '\n'); av_new_packet(pkt, end ? end - p + 1 : strlen(p)); pkt->flags |...
[ 1, 0 ]
FFmpeg
libavformat/utils.c
static int64_t wrap_timestamp(AVStream *st, int64_t timestamp) { if (st->pts_wrap_behavior != AV_PTS_WRAP_IGNORE && st->pts_wrap_bits < 64 && st->pts_wrap_reference != AV_NOPTS_VALUE && timestamp != AV_NOPTS_VALUE) { if (st->pts_wrap_behavior == AV_PTS_WRAP_ADD_OFFSET && timestamp < st->pts_wra...
[ 1, 0 ]
FFmpeg
libavformat/mpegts.c
static void write_section_data(AVFormatContext *s, MpegTSFilter *tss1, const uint8_t *buf, int buf_size, int is_start) { MpegTSContext *ts = s->priv_data; MpegTSSectionFilter *tss = &tss1->u.section_filter; int len; if (is_start) { memcpy(tss->section_buf, buf, buf_size...
[ 1, 0 ]
FFmpeg
libavcodec/vaapi.c
static void *alloc_buffer(FFVAContext *vactx, int type, unsigned int size, uint32_t *buf_id) { void *data = NULL; *buf_id = 0; if (vaCreateBuffer(vactx->display, vactx->context_id, type, size, 1, NULL, buf_id) == VA_STATUS_SUCCESS) vaMapBuffer(vactx->displa...
[ 1, 0 ]
FFmpeg
libavcodec/aacenc.c
static av_cold int aac_encode_end(AVCodecContext *avctx) { AACEncContext *s = avctx->priv_data; ff_mdct_end(&s->mdct1024); ff_mdct_end(&s->mdct128); ff_psy_end(&s->psy); ff_psy_preprocess_end(s->psypp); av_freep(&s->samples); av_freep(&s->cpe); return 0; }
[ 1, 0 ]
qemu
configure
static uint64_t boston_lcd_read(void *opaque, hwaddr addr, unsigned size) { BostonState *s = opaque; uint64_t val = 0; switch (size) { case 8: val |= (uint64_t)s->lcd_content[(addr + 7) & 0x7] << 56; val |= (uint64_t)s->lcd_content[(addr + 6) & 0x7] << 48; va...
[ 1, 0 ]
qemu
linux-user/elfload.c
static unsigned long copy_elf_strings(int argc, char **argv, void **page, unsigned long p) { char *tmp, *tmp1, *pag = NULL; int len, offset = 0; if (!p) { return 0; /* bullet-proofing */ } while (argc-- > 0) { tmp = argv[argc]; if (!tmp) { fpri...
[ 1, 0 ]
qemu
ui/gtk.c
static GSList *gd_vc_gfx_init(GtkDisplayState *s, VirtualConsole *vc, QemuConsole *con, int idx, GSList *group, GtkWidget *view_menu) { Error *local_err = NULL; Object *obj; obj = object_property_get_link(OBJECT(con), "device", &local_err); if (...
[ 1, 0 ]
FFmpeg
libavformat/tls.c
int ff_tls_open_underlying(TLSShared *c, URLContext *parent, const char *uri, AVDictionary **options) { int port; const char *p; char buf[200], opts[50] = ""; struct addrinfo hints = {0}, *ai = NULL; const char *proxy_path; int use_proxy; set_options(c, uri); if (c->l...
[ 1, 0 ]
qemu
Makefile.objs
int64_t qemu_clock_deadline_ns_all(QEMUClockType type) { int64_t deadline = -1; QEMUTimerList *timer_list; QEMUClock *clock = qemu_clock_ptr(type); QLIST_FOREACH(timer_list, &clock->timerlists, list) { deadline = qemu_soonest_timeout(deadline, timerlist_deadline_ns...
[ 0, 0 ]
qemu
target-arm/helper.c
static void vmsa_ttbcr_raw_write(CPUARMState *env, const ARMCPRegInfo *ri, uint64_t value) { int maskshift = extract32(value, 0, 3); if (arm_feature(env, ARM_FEATURE_LPAE) && (value & (1 << 31))) { value &= ~((7 << 19) | (3 << 14) | (0xf << 3)); } else { value &= 7;...
[ 0, 0 ]
qemu
target-mips/helper.h
void helper_ctc1(CPUMIPSState *env, target_ulong arg1, uint32_t reg) { switch (reg) { case 25: if (arg1 & 0xffffff00) return; env->active_fpu.fcr31 = (env->active_fpu.fcr31 & 0x017fffff) | ((arg1 & 0xfe) << 24) | ((arg1 & 0x1) << 23); ...
[ 1, 0 ]
qemu
hw/ppc.c
static void cpu_set_irq(void *opaque, int irq, int level) { CPUState *env = opaque; if (level) { CPUIRQ_DPRINTF("Raise CPU IRQ %d\n", irq); env->halted = 0; env->pil_in |= 1 << irq; cpu_check_irqs(env); } else { CPUIRQ_DPRINTF("Lower CPU IRQ %d\n", irq); env->pil_in &= ~(1 << irq...
[ 0, 0 ]
qemu
block/block-backend.c
static int get_stream_blocksize(BlockDriverState *bdrv) { uint8_t cmd[6]; uint8_t buf[12]; uint8_t sensebuf[8]; sg_io_hdr_t io_header; int ret; memset(cmd, 0, sizeof(cmd)); memset(buf, 0, sizeof(buf)); cmd[0] = MODE_SENSE; cmd[4] = sizeof(buf); memset(&io_header, 0, sizeof(io_header)); ...
[ 1, 1 ]
qemu
bsd-user/mmap.c
void *qemu_vmalloc(size_t size) { void *p; unsigned long addr; mmap_lock(); /* Use map and mark the pages as used. */ p = mmap(NULL, size, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANON, -1, 0); addr = (unsigned long)p; if (addr == (target_ulong)addr) { /* Allocated region overla...
[ 0, 0 ]
qemu
hw/vmware_vga.c
static inline void vmsvga_update_rect_flush(struct vmsvga_state_s *s) { struct vmsvga_rect_s *rect; if (s->invalidated) { s->redraw_fifo_first = s->redraw_fifo_last; return; } /* Overlapping region updates can be optimised out here - if someone * knows a smart algorithm to do that, please shar...
[ 1, 0 ]
qemu
hw/file-op-9p.h
static int local_fsync(FsContext *ctx, int fd) { if (0) /* Just to supress the warning. Will be removed in next patch. */ (void)local_set_xattr(NULL, NULL); return fsync(fd); }
[ 0, 0 ]
qemu
hw/vfio/pci.c
static void vfio_platform_realize(DeviceState *dev, Error **errp) { VFIOPlatformDevice *vdev = VFIO_PLATFORM_DEVICE(dev); SysBusDevice *sbdev = SYS_BUS_DEVICE(dev); VFIODevice *vbasedev = &vdev->vbasedev; int i, ret; vbasedev->type = VFIO_DEVICE_TYPE_PLATFORM; vbasedev->ops = &vfio_platform_ops; t...
[ 0, 0 ]
qemu
hw/pcnet-pci.c
static void pcnet_ioport_write(void *opaque, target_phys_addr_t addr, uint64_t data, unsigned size) { PCNetState *d = opaque; if (addr < 16 && size == 1) { return pcnet_aprom_writeb(d, addr, data); } else if (addr >= 0x10 && addr < 0x20 && size == 2) { return pcnet_io...
[ 1, 0 ]
qemu
backends/hostmem-file.c
build_hash_table(const sparc_opcode **opcode_table, sparc_opcode_hash **hash_table, int num_opcodes) { int i; int hash_count[HASH_SIZE]; static sparc_opcode_hash *hash_buf = NULL; /* Start at the end of the table and work backwards so that each chain is sorted. */...
[ 1, 0 ]
qemu
target/ppc/helper.h
static void gen_spr_power8_book4(CPUPPCState *env) { /* Add a number of P8 book4 registers */ #if !defined(CONFIG_USER_ONLY) spr_register_kvm(env, SPR_ACOP, "ACOP", SPR_NOACCESS, SPR_NOACCESS, &spr_read_generic, &spr_write_generic, KVM_REG_PPC_ACOP, 0)...
[ 0, 0 ]
qemu
target-i386/exec.h
void helper_movl_crN_T0(int reg) { env->cr[reg] = T0; switch (reg) { case 0: cpu_x86_update_cr0(env); break; case 3: cpu_x86_update_cr3(env); break; } }
[ 1, 0 ]
FFmpeg
libavcodec/options.c
void avcodec_free_context(AVCodecContext **pavctx) { AVCodecContext *avctx = *pavctx; if (!avctx) return; avcodec_close(avctx); av_freep(&avctx->extradata); av_freep(&avctx->subtitle_header); av_freep(pavctx); }
[ 1, 0 ]
qemu
linux-user/signal.c
long do_rt_sigreturn(CPUM68KState *env) { struct target_rt_sigframe *frame; abi_ulong frame_addr = env->aregs[7] - 4; target_sigset_t target_set; sigset_t set; trace_user_do_rt_sigreturn(env, frame_addr); if (!lock_user_struct(VERIFY_READ, frame, frame_addr, 1)) goto badframe; target_to_host_...
[ 1, 0 ]
qemu
block.c
static void co_write_request(void *opaque) { BDRVSheepdogState *s = opaque; qemu_coroutine_enter(s->co_send, NULL); }
[ 1, 0 ]
FFmpeg
ffmpeg.c
static int opt_input_ts_scale(const char *opt, const char *arg) { unsigned int stream; double scale; char *p; stream = strtol(arg, &p, 0); if (*p) p++; scale = strtod(p, &p); if (stream >= MAX_STREAMS) ffmpeg_exit(1); ts_scale = grow_array(ts_scale, sizeof(*ts_scale), &nb_ts_scale, st...
[ 1, 0 ]
FFmpeg
libavcodec/ppc/dsputil_ppc.c
int sws_setColorspaceDetails(struct SwsContext *c, const int inv_table[4], int srcRange, const int table[4], int dstRange, int brightness, int contrast, int saturation) { const AVPixFmtDescriptor *desc_dst = av_pix_fmt_desc_get(c->dstFormat); const AVPi...
[ 1, 1 ]
qemu
exec.c
static void alpha_cpu_class_init(ObjectClass *oc, void *data) { DeviceClass *dc = DEVICE_CLASS(oc); CPUClass *cc = CPU_CLASS(oc); AlphaCPUClass *acc = ALPHA_CPU_CLASS(oc); acc->parent_realize = dc->realize; dc->realize = alpha_cpu_realizefn; cc->class_by_name = alpha_cpu_class_by_name; cc->has_wor...
[ 1, 0 ]
qemu
target-ppc/cpu.h
static void init_proc_601(CPUPPCState *env) { gen_spr_ne_601(env); gen_spr_601(env); /* Hardware implementation registers */ /* XXX : not implemented */ spr_register(env, SPR_HID0, "HID0", SPR_NOACCESS, SPR_NOACCESS, &spr_read_generic, &spr_write_generic, ...
[ 1, 1 ]
qemu
block/qcow2-cluster.c
static int zero_single_l2(BlockDriverState *bs, uint64_t offset, uint64_t nb_clusters, int flags) { BDRVQcow2State *s = bs->opaque; uint64_t *l2_table; int l2_index; int ret; int i; ret = get_cluster_table(bs, offset, &l2_table, &l2_index); if (ret < 0) { return ret...
[ 1, 0 ]