Projectname
large_stringclasses
15 values
Filepath
large_stringlengths
4
106
Function
large_stringlengths
11
3.45k
Label
list
qemu
hw/scsi/scsi-bus.c
static int32_t scsi_target_send_command(SCSIRequest *req, uint8_t *buf) { SCSITargetReq *r = DO_UPCAST(SCSITargetReq, req, req); switch (buf[0]) { case REPORT_LUNS: if (!scsi_target_emulate_report_luns(r)) { goto illegal_request; } break; case INQUIRY: if (!scsi_target_emulate_inq...
[ 1, 0 ]
FFmpeg
libavcodec/bink.c
static av_cold int init_bundles(BinkContext *c) { int bw, bh, blocks; int i; bw = (c->avctx->width + 7) >> 3; bh = (c->avctx->height + 7) >> 3; blocks = bw * bh; for (i = 0; i < BINKB_NB_SRC; i++) { c->bundle[i].data = av_malloc(blocks * 64); if (!c->bundle[i].data) return AVERROR(EN...
[ 1, 0 ]
qemu
backends/rng-egd.c
void vty_putchars(VIOsPAPRDevice *sdev, uint8_t *buf, int len) { VIOsPAPRVTYDevice *dev = VIO_SPAPR_VTY_DEVICE(sdev); /* FIXME: should check the qemu_chr_fe_write() return value */ qemu_chr_fe_write(dev->chardev, buf, len); }
[ 1, 1 ]
qemu
tests/tcg/cris/check_abs.c
static inline int cris_addc_m(int a, const int *b) { asm volatile("addc [%1], %0\n" : "+r"(a) : "r"(b)); return a; }
[ 1, 0 ]
qemu
cpu-all.h
void cpu_exec_init(CPUState *env) { CPUState **penv; int cpu_index; if (!code_gen_ptr) { code_gen_ptr = code_gen_buffer; page_init(); io_mem_init(); } env->next_cpu = NULL; penv = &first_cpu; cpu_index = 0; while (*penv != NULL) { penv = (CPUState **)&(*penv)->next_cpu; ...
[ 1, 0 ]
qemu
block/nbd-client.c
int nbd_client_co_pwrite_zeroes(BlockDriverState *bs, int64_t offset, int bytes, BdrvRequestFlags flags) { NBDClientSession *client = nbd_get_client_session(bs); NBDRequest request = { .type = NBD_CMD_WRITE_ZEROES, .from = offset, .len = bytes, }; if (!...
[ 1, 0 ]
qemu
include/monitor/monitor.h
static inline bool handler_is_async(const mon_cmd_t *cmd) { return cmd->flags & MONITOR_CMD_ASYNC; }
[ 1, 0 ]
FFmpeg
libswscale/yuv2rgb.c
SwsFunc yuv2rgb_init_mlib(SwsContext *c) { switch (c->dstFormat) { case PIX_FMT_RGB24: return mlib_YUV2RGB420_24; case PIX_FMT_BGR32: return mlib_YUV2ARGB420_32; case PIX_FMT_RGB32: return mlib_YUV2ABGR420_32; default: return NULL; } }
[ 1, 0 ]
qemu
monitor.c
static void monitor_event(void *opaque, int event) { Monitor *mon = opaque; switch (event) { case CHR_EVENT_MUX_IN: qemu_mutex_lock(&mon->out_lock); mon->mux_out = 0; qemu_mutex_unlock(&mon->out_lock); if (mon->reset_seen) { monitor_resume(mon); monitor_flush(mon); } els...
[ 1, 0 ]
qemu
hw/misc/ivshmem.c
static int64_t ivshmem_recv_msg(IVShmemState *s, int *pfd, Error **errp) { int64_t msg; int n, ret; n = 0; do { ret = qemu_chr_fe_read_all(&s->server_chr, (uint8_t *)&msg + n, sizeof(msg) - n); if (ret < 0) { if (ret == -EINTR) { continue; } ...
[ 1, 0 ]
FFmpeg
ffmpeg.c
static void pre_process_video_frame(InputStream *ist, AVPicture *picture, void **bufp) { AVCodecContext *dec; AVPicture *picture2; AVPicture picture_tmp; uint8_t *buf = 0; dec = ist->st->codec; /* deinterlace : must be done before any resize */ if (FF_API_DEINTE...
[ 1, 0 ]
qemu
hw/scsi/virtio-scsi-dataplane.c
static bool virtio_scsi_data_plane_handle_ctrl(VirtIODevice *vdev, VirtQueue *vq) { VirtIOSCSI *s = VIRTIO_SCSI(vdev); assert(s->ctx && s->dataplane_started); return virtio_scsi_handle_ctrl_vq(s, vq); }
[ 1, 0 ]
qemu
hw/mc146818rtc.c
static void rtc_periodic_timer(void *opaque) { RTCState *s = opaque; rtc_timer_update(s, s->next_periodic_time); #ifdef TARGET_I386 if ((s->cmos_data[RTC_REG_C] & 0xc0) && rtc_td_hack) { s->irq_coalesced++; return; } #endif if (s->cmos_data[RTC_REG_B] & REG_B_PIE) { s->cmos_data[RTC_REG_...
[ 1, 0 ]
qemu
console.c
static int qemu_chr_open_win_pipe(QemuOpts *opts, CharDriverState **_chr) { const char *filename = qemu_opt_get(opts, "path"); CharDriverState *chr; WinCharState *s; chr = g_malloc0(sizeof(CharDriverState)); s = g_malloc0(sizeof(WinCharState)); chr->opaque = s; chr->chr_write = win_chr_write; c...
[ 1, 0 ]
qemu
qapi/string-input-visitor.c
start_list(Visitor *v, const char *name, Error **errp) { StringInputVisitor *siv = to_siv(v); parse_str(siv, errp); siv->cur_range = g_list_first(siv->ranges); if (siv->cur_range) { Range *r = siv->cur_range->data; if (r) { siv->cur = r->begin; } } }
[ 1, 0 ]
FFmpeg
libavfilter/vf_drawtext.c
static int draw_glyphs(DrawTextContext *s, AVFrame *frame, int width, int height, const uint8_t rgbcolor[4], const uint8_t yuvcolor[4], int x, int y) { char *text = HAVE_LOCALTIME_R ? s->expanded_text : s->text; uint32_t code = 0; int i; ...
[ 1, 0 ]
qemu
target-ppc/cpu.h
void do_store_xer(void) { xer_so = (T0 >> XER_SO) & 0x01; xer_ov = (T0 >> XER_OV) & 0x01; xer_ca = (T0 >> XER_CA) & 0x01; xer_cmp = (T0 >> XER_CMP) & 0xFF; xer_bc = (T0 >> XER_BC) & 0x3F; }
[ 1, 0 ]
qemu
tests/e1000e-test.c
void *qpci_iomap(QPCIDevice *dev, int barno, uint64_t *sizeptr) { QPCIBus *bus = dev->bus; static const int bar_reg_map[] = { PCI_BASE_ADDRESS_0, PCI_BASE_ADDRESS_1, PCI_BASE_ADDRESS_2, PCI_BASE_ADDRESS_3, PCI_BASE_ADDRESS_4, PCI_BASE_ADDRESS_5, }; int bar_reg; uint32_t addr, size; uint...
[ 1, 0 ]
qemu
tests/check-qjson.c
static void unterminated_array(void) { QObject *obj = qobject_from_json("[32", NULL); g_assert(obj == NULL); }
[ 1, 0 ]
FFmpeg
libavcodec/avs.c
static av_cold int decode_init(AVCodecContext *avctx) { KmvcContext *const c = avctx->priv_data; int i; c->avctx = avctx; if (avctx->width > 320 || avctx->height > 200) { av_log(avctx, AV_LOG_ERROR, "KMVC supports frames <= 320x200\n"); return -1; } c->frm0 = av_mallocz(320 * 200); c->frm...
[ 1, 0 ]
qemu
tcg/i386/tcg-target.c
static void patch_reloc(uint8_t *code_ptr, int type, intptr_t value, intptr_t addend) { value += addend; switch (type) { case R_386_PC32: value -= (uintptr_t)code_ptr; if (value != (int32_t)value) { tcg_abort(); } *(uint32_t *)code_ptr = value; break; ...
[ 1, 0 ]
FFmpeg
libavfilter/vf_noise.c
static void noise(uint8_t *dst, const uint8_t *src, int dst_linesize, int src_linesize, int width, int start, int end, NoiseContext *n, int comp) { FilterParams *p = &n->param[comp]; int8_t *noise = p->noise; const int flags = p->flags; AVLFG *lfg = &p->lfg; int shi...
[ 0, 0 ]
FFmpeg
libavcodec/h264_refs.c
void ff_generate_sliding_window_mmcos(H264Context *h) { MpegEncContext *const s = &h->s; assert(h->long_ref_count + h->short_ref_count <= h->sps.ref_frame_count); h->mmco_index = 0; if (h->short_ref_count && h->long_ref_count + h->short_ref_count == h->sps.ref_frame_count && !(FIELD_PICTURE && ...
[ 1, 0 ]
FFmpeg
libavformat/4xm.c
static int probe(AVProbeData *p) { if (p->buf_size < 13) return 0; if (p->buf[0] == 0x01 && p->buf[1] == 0x00 && p->buf[4] == 0x01 + p->buf[2] && p->buf[8] == p->buf[4] + p->buf[6] && p->buf[12] == p->buf[8] + p->buf[10]) return AVPROBE_SCORE_MAX; return 0; }
[ 1, 0 ]
FFmpeg
avplay.c
static int opt_debug(void *optctx, const char *opt, const char *arg) { av_log_set_level(99); debug = parse_number_or_die(opt, arg, OPT_INT64, 0, INT_MAX); return 0; }
[ 0, 0 ]
FFmpeg
libavcodec/vp56.c
static void vp6_build_huff_tree(VP56Context *s, uint8_t coeff_model[], const uint8_t *map, unsigned size, VLC *vlc) { Node nodes[2 * size], *tmp = &nodes[size]; int a, b, i; /* first compute probabilities from model */ tmp[0].count = 256; for (i = 0; i < size - 1; i++) {...
[ 1, 0 ]
qemu
Makefile.objs
static int qemu_rdma_post_recv_control(RDMAContext *rdma, int idx) { struct ibv_recv_wr *bad_wr; struct ibv_sge sge = { .addr = (uint64_t)(rdma->wr_data[idx].control), .length = RDMA_CONTROL_MAX_BUFFER, .lkey = rdma->wr_data[idx].control_mr->lkey, }; struct ibv_recv_wr recv_wr = { ...
[ 1, 0 ]
qemu
hw/virtio/virtio.c
void virtqueue_fill(VirtQueue *vq, const VirtQueueElement *elem, unsigned int len, unsigned int idx) { VRingUsedElem uelem; trace_virtqueue_fill(vq, elem, len, idx); virtqueue_unmap_sg(vq, elem, len); idx = (idx + vq->used_idx) % vq->vring.num; uelem.id = elem->index; uelem.len = len; ...
[ 1, 0 ]
qemu
tests/e1000e-test.c
static QPCIDevice *get_pci_device(void **bmdma_base, void **ide_base) { QPCIDevice *dev; uint16_t vendor_id, device_id; if (!pcibus) { pcibus = qpci_init_pc(NULL); } /* Find PCI device and verify it's the right one */ dev = qpci_device_find(pcibus, QPCI_DEVFN(IDE_PCI_DEV, IDE_PCI_FUNC)); g_ass...
[ 1, 0 ]
FFmpeg
libavformat/img2dec.c
static int qdraw_probe(AVProbeData *p) { const uint8_t *b = p->buf; if (!b[10] && AV_RB32(b + 11) == 0x1102ff0c && !b[15] || p->buf_size >= 528 && !b[522] && AV_RB32(b + 523) == 0x1102ff0c && !b[527]) return AVPROBE_SCORE_EXTENSION + 1; return 0; }
[ 1, 0 ]
FFmpeg
libavformat/oggparsetheora.c
static int theora_packet(AVFormatContext *s, int idx) { struct ogg *ogg = s->priv_data; struct ogg_stream *os = ogg->streams + idx; int duration; /* first packet handling here we parse the duration of each packet in the first page and compare the total duration to the page granule to find the e...
[ 1, 0 ]
FFmpeg
libavfilter/vf_hqdn3d.c
static void denoise_depth(HQDN3DContext *s, uint8_t *src, uint8_t *dst, uint16_t *line_ant, uint16_t **frame_ant_ptr, int w, int h, int sstride, int dstride, int16_t *spatial, int16_t *temporal, int depth) { ...
[ 1, 1 ]
FFmpeg
libavcodec/hevcdsp_template.c
static void FUNC(transquant_bypass8x8)(uint8_t *_dst, int16_t *coeffs, ptrdiff_t stride) { int x, y; pixel *dst = (pixel *)_dst; stride /= sizeof(pixel); for (y = 0; y < 8; y++) { for (x = 0; x < 8; x++) { dst[x] += *coeffs; coeffs++; } ds...
[ 1, 0 ]
qemu
hw/core/ptimer.c
uint64_t ptimer_get_count(ptimer_state *s) { int64_t now; uint64_t counter; if (s->enabled) { now = qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL); /* Figure out the current counter value. */ if (now - s->next_event > 0 || s->period == 0) { /* Prevent timer underflowing if it should alr...
[ 1, 0 ]
qemu
hw/e1000.c
set_rdt(E1000State *s, int index, uint32_t val) { s->check_rxov = 0; s->mac_reg[index] = val & 0xffff; if (e1000_has_rxbufs(s, 1)) { qemu_flush_queued_packets(&s->nic->nc); } }
[ 1, 0 ]
qemu
pc-bios/s390-ccw/virtio.c
bool virtio_disk_is_scsi(void) { if (guessed_disk_nature) { return (blk_cfg.blk_size == 512); } return (blk_cfg.geometry.heads == 255) && (blk_cfg.geometry.sectors == 63) && (blk_cfg.blk_size == 512); }
[ 0, 0 ]
qemu
hw/core/stream.c
static void stream_desc_store(struct Stream *s, hwaddr addr) { struct SDesc *d = &s->desc; int i; /* Convert from host endianness into LE. */ d->buffer_address = cpu_to_le64(d->buffer_address); d->nxtdesc = cpu_to_le64(d->nxtdesc); d->control = cpu_to_le32(d->control); d->status = cpu_to_le32(d->...
[ 0, 0 ]
qemu
HACKING
static void cs_mem_write(void *opaque, target_phys_addr_t addr, uint64_t val, unsigned size) { CSState *s = opaque; uint32_t saddr; saddr = addr >> 2; trace_cs4231_mem_writel_reg(saddr, s->regs[saddr], val); switch (saddr) { case 1: trace_cs4231_mem_writel_dreg(CS_RAP(s...
[ 1, 0 ]
qemu
hw/esp.c
static SCSIDiskReq *scsi_new_request(SCSIDiskState *s, uint32_t tag, uint32_t lun) { SCSIRequest *req; SCSIDiskReq *r; req = scsi_req_alloc(sizeof(SCSIDiskReq), &s->qdev, tag, lun); r = DO_UPCAST(SCSIDiskReq, req, req); r->iov.iov_base = qemu_blockalign(s->bs, SCSI_...
[ 1, 0 ]
FFmpeg
libavformat/v4l2.c
static int mmap_read_frame(struct video_data *s, void *frame, int64_t *ts) { struct v4l2_buffer buf; int res; memset(&buf, 0, sizeof(struct v4l2_buffer)); buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE; buf.memory = V4L2_MEMORY_MMAP; /* FIXME: Some special treatment might be needed in case of loss of signal....
[ 1, 1 ]
qemu
hw/virtio/virtio-pci.c
static void virtio_pci_reset(DeviceState *qdev) { VirtIOPCIProxy *proxy = VIRTIO_PCI(qdev); VirtioBusState *bus = VIRTIO_BUS(&proxy->bus); virtio_pci_stop_ioeventfd(proxy); virtio_bus_reset(bus); msix_unuse_all_vectors(&proxy->pci_dev); proxy->flags &= ~VIRTIO_PCI_FLAG_BUS_MASTER_BUG; }
[ 0, 0 ]
qemu
block/dmg.c
static inline uint32_t search_chunk(BDRVDMGState *s, int sector_num) { /* binary search */ uint32_t chunk1 = 0, chunk2 = s->n_chunks, chunk3; while (chunk1 != chunk2) { chunk3 = (chunk1 + chunk2) / 2; if (s->sectors[chunk3] > sector_num) chunk2 = chunk3; else if (s->sectors[chunk3] + s->...
[ 0, 0 ]
qemu
block/vdi.c
static void vdi_close(BlockDriverState *bs) { BDRVVdiState *s = bs->opaque; g_free(s->bmap); migrate_del_blocker(s->migration_blocker); error_free(s->migration_blocker); }
[ 1, 0 ]
qemu
block/block-backend.c
BlockBackend *blk_new_open(const char *filename, const char *reference, QDict *options, int flags, Error **errp) { BlockBackend *blk; BlockDriverState *bs; uint64_t perm; /* blk_new_open() is mainly used in .bdrv_create implementations and the * tools where sharing isn't a c...
[ 1, 1 ]
qemu
Makefile.target
static int pci_dec_21154_init_device(SysBusDevice *dev) { UNINState *s; int pci_mem_config, pci_mem_data; /* Uninorth bridge */ s = FROM_SYSBUS(UNINState, dev); // XXX: s = &pci_bridge[2]; pci_mem_config = cpu_register_io_memory(pci_unin_config_read, pci_uni...
[ 0, 1 ]
qemu
hw/ppc/spapr_drc.c
static uint32_t rtas_set_isolation_state(uint32_t idx, uint32_t state) { sPAPRDRConnector *drc = spapr_drc_by_index(idx); sPAPRDRConnectorClass *drck; if (!drc) { return RTAS_OUT_PARAM_ERROR; } drck = SPAPR_DR_CONNECTOR_GET_CLASS(drc); return drck->set_isolation_state(drc, state); }
[ 0, 0 ]
qemu
qom/object_interfaces.c
Object *user_creatable_add_opts(QemuOpts *opts, Error **errp) { Visitor *v; QDict *pdict; Object *obj; const char *id = qemu_opts_id(opts); const char *type = qemu_opt_get(opts, "qom-type"); if (!type) { error_setg(errp, QERR_MISSING_PARAMETER, "qom-type"); return NULL; } if (!id) { ...
[ 0, 0 ]
qemu
hw/arm/musicpal.c
static void puv3_load_kernel(const char *kernel_filename) { int size; assert(kernel_filename != NULL); /* only zImage format supported */ size = load_image_targphys(kernel_filename, KERNEL_LOAD_ADDR, KERNEL_MAX_SIZE); if (size < 0) { hw_error("Load kernel error: '%s'\n...
[ 0, 0 ]
FFmpeg
libavcodec/flacenc.c
void ff_flac_compute_autocorr(const int32_t *data, int len, int lag, double *autoc) { int i, j; double tmp[len + lag + 1]; double *data1 = tmp + lag; apply_welch_window(data, len, data1); for (j = 0; j < lag; j++) data1[j - lag] = 0.0; data1[len] = 0.0; for (j =...
[ 0, 0 ]
qemu
tests/tco-test.c
static void test_tco_ticks_counter(void) { TestData d; uint16_t ticks = TCO_SECS_TO_TICKS(8); uint16_t rld; d.args = NULL; d.noreboot = true; test_init(&d); stop_tco(&d); clear_tco_status(&d); reset_on_second_timeout(false); set_tco_timeout(&d, ticks); load_tco(&d); start_tco(&d); ...
[ 1, 0 ]
FFmpeg
libavutil/avutil.h
int av_set_options_string(void *ctx, const char *opts, const char *key_val_sep, const char *pairs_sep) { int ret, count = 0; while (*opts) { if ((ret = parse_key_value_pair(ctx, &opts, key_val_sep, pairs_sep)) < 0) return ret; count++; if (*opts) opts++; ...
[ 1, 0 ]
qemu
exec.c
static void kvm_reset_vcpu(void *opaque) { CPUState *env = opaque; kvm_arch_reset_vcpu(env); if (kvm_arch_put_registers(env)) { fprintf(stderr, "Fatal: kvm vcpu reset failed\n"); abort(); } }
[ 1, 0 ]
qemu
hw/vmware_vga.c
static int vmsvga_post_load(void *opaque, int version_id) { struct vmsvga_state_s *s = opaque; s->invalidated = 1; if (s->config) s->fifo = (uint32_t *)s->fifo_ptr; return 0; }
[ 0, 0 ]
qemu
block/qapi.c
static GenericList *qmp_output_next_list(Visitor *v, GenericList *tail, size_t size) { return tail->next; }
[ 0, 0 ]
qemu
target-xtensa/translate.c
static void gen_jumpi(DisasContext *dc, uint32_t dest, int slot) { TCGv_i32 tmp = tcg_const_i32(dest); if (((dc->pc ^ dest) & TARGET_PAGE_MASK) != 0) { slot = -1; } gen_jump_slot(dc, tmp, slot); tcg_temp_free(tmp); }
[ 0, 0 ]
qemu
block.c
BlockDeviceInfoList *bdrv_named_nodes_list(Error **errp) { BlockDeviceInfoList *list, *entry; BlockDriverState *bs; list = NULL; QTAILQ_FOREACH(bs, &graph_bdrv_states, node_list) { BlockDeviceInfo *info = bdrv_block_device_info(bs, errp); if (!info) { qapi_free_BlockDeviceInfoList(list); ...
[ 0, 0 ]
FFmpeg
libavcodec/aacdec.c
static int latm_decode_frame(AVCodecContext *avctx, void *out, int *got_frame_ptr, AVPacket *avpkt) { struct LATMContext *latmctx = avctx->priv_data; int muxlength, err; GetBitContext gb; init_get_bits(&gb, avpkt->data, avpkt->size * 8); // check for LOAS sync word if (g...
[ 1, 0 ]
FFmpeg
libavcodec/mips/h264qpel_msa.c
void ff_avg_h264_qpel4_mc33_msa(uint8_t *dst, const uint8_t *src, ptrdiff_t stride) { avc_luma_hv_qrt_and_aver_dst_4x4_msa(src + stride - 2, src - (stride * 2) + sizeof(uint8_t), ...
[ 1, 0 ]
qemu
hw/pci-bridge/pcie_pci_bridge.c
static void pcie_pci_bridge_reset(DeviceState *qdev) { PCIDevice *d = PCI_DEVICE(qdev); pci_bridge_reset(qdev); msi_reset(d); shpc_reset(d); }
[ 1, 0 ]
qemu
block/backup.c
void qmp_drive_backup(DriveBackup *arg, Error **errp) { return do_drive_backup(arg, NULL, errp); }
[ 1, 0 ]
qemu
fpu/softfloat-native.c
int float32_is_nan(float32 a1) { float32u u; uint64_t a; u.f = a1; a = u.i; return (0xFF800000 < (a << 1)); }
[ 0, 0 ]
qemu
HACKING
static void bitband_writel(void *opaque, target_phys_addr_t offset, uint32_t value) { uint32_t addr; uint32_t mask; uint32_t v; addr = bitband_addr(opaque, offset) & ~3; mask = (1 << ((offset >> 2) & 31)); mask = tswap32(mask); cpu_physical_memory_read(addr, (uint8_t *)...
[ 0, 0 ]
qemu
blockdev.c
int xen_config_dev_blk(DriveInfo *disk) { char fe[256], be[256]; int vdev = 202 * 256 + 16 * disk->unit; int cdrom = disk->bdrv->type == BDRV_TYPE_CDROM; const char *devtype = cdrom ? "cdrom" : "disk"; const char *mode = cdrom ? "r" : "w"; snprintf(disk->bdrv->device_name, sizeof(disk->bdrv->device_n...
[ 1, 0 ]
qemu
input.c
void kbd_put_keycode(int keycode) { if (!runstate_is_running()) { return; } if (qemu_put_kbd_event) { qemu_put_kbd_event(qemu_put_kbd_event_opaque, keycode); } }
[ 0, 0 ]
qemu
tcg/tcg.c
static inline void tcg_reg_sync(TCGContext *s, int reg) { TCGTemp *ts; int temp; temp = s->reg_to_temp[reg]; ts = &s->temps[temp]; assert(ts->val_type == TEMP_VAL_REG); if (!ts->mem_coherent && !ts->fixed_reg) { if (!ts->mem_allocated) { temp_allocate_frame(s, temp); } tcg_out_st...
[ 0, 0 ]
qemu
hw/qxl.c
static void qxl_hard_reset(PCIQXLDevice *d, int loadvm) { dprint(d, 1, "%s: start%s\n", __FUNCTION__, loadvm ? " (loadvm)" : ""); qemu_mutex_unlock_iothread(); d->ssd.worker->reset_cursor(d->ssd.worker); d->ssd.worker->reset_image_cache(d->ssd.worker); qemu_mutex_lock_iothread(); qxl_reset_...
[ 1, 0 ]
FFmpeg
libavformat/mov.c
static int mov_read_stts(MOVContext *c, AVIOContext *pb, MOVAtom atom) { AVStream *st; MOVStreamContext *sc; unsigned int i, entries; int64_t duration = 0; int64_t total_sample_count = 0; if (c->fc->nb_streams < 1) return 0; st = c->fc->streams[c->fc->nb_streams - 1]; sc = st->priv_data; ...
[ 1, 0 ]
FFmpeg
libavcodec/jpeg2000dec.c
static int get_coc(Jpeg2000DecoderContext *s, Jpeg2000CodingStyle *c, uint8_t *properties) { int compno; if (s->buf_end - s->buf < 2) return AVERROR(EINVAL); compno = bytestream_get_byte(&s->buf); c += compno; c->csty = bytestream_get_byte(&s->buf); get_cox(s, c); properti...
[ 0, 0 ]
qemu
qom/object.c
int object_property_get_enum(Object *obj, const char *name, const char *typename, Error **errp) { StringOutputVisitor *sov; StringInputVisitor *siv; char *str; int ret; ObjectProperty *prop = object_property_find(obj, name, errp); EnumProperty *enumprop; if (prop == N...
[ 1, 0 ]
qemu
block-migration.c
void ahci_init(AHCIState *s, DeviceState *qdev, AddressSpace *as, int ports) { qemu_irq *irqs; int i; s->as = as; s->ports = ports; s->dev = g_malloc0(sizeof(AHCIDevice) * ports); ahci_reg_init(s); /* XXX BAR size should be 1k, but that breaks, so bump it to 4k for now */ memory_region_init_io(...
[ 1, 1 ]
qemu
target-mips/op_helper.c
void do_ddiv(void) { if (T1 != 0) { lldiv_t res = lldiv((int64_t)T0, (int64_t)T1); env->LO[0][env->current_tc] = res.quot; env->HI[0][env->current_tc] = res.rem; } }
[ 1, 0 ]
FFmpeg
libavcodec/bytestream.h
static int read_uncompressed_sgi(unsigned char *out_buf, uint8_t *out_end, const uint8_t *in_buf, const uint8_t *in_end, SgiState *s) { int x, y, z; const uint8_t *ptr; unsigned int offset = s->height * s->width * s->bytes_per_channel; /* T...
[ 1, 0 ]
qemu
Makefile.objs
static int get_uint16_equal(QEMUFile *f, void *pv, size_t size) { uint16_t *v = pv; uint16_t v2; qemu_get_be16s(f, &v2); if (*v == v2) { return 0; } return -EINVAL; }
[ 1, 0 ]
FFmpeg
libavcodec/qdrw.c
static int decode_rle(AVCodecContext *avctx, AVFrame *p, GetByteContext *gbc, int step) { int i, j; int offset = avctx->width * step; uint8_t *outdata = p->data[0]; for (i = 0; i < avctx->height; i++) { int size, left, code, pix; uint8_t *out = outdata; int pos = 0; ...
[ 1, 0 ]
FFmpeg
libavcodec/wmalosslessdec.c
static void reset_codec(WmallDecodeCtx *s) { int ich, ilms; s->mclms_recent = s->mclms_order * s->num_channels; for (ich = 0; ich < s->num_channels; ich++) { for (ilms = 0; ilms < s->cdlms_ttl[ich]; ilms++) s->cdlms[ich][ilms].recent = s->cdlms[ich][ilms].order; /* first sample of a seekable ...
[ 1, 0 ]
qemu
fpu/softfloat.c
float64 float64_scalbn(float64 a, int n STATUS_PARAM) { flag aSign; int16 aExp; uint64_t aSig; a = float64_squash_input_denormal(a STATUS_VAR); aSig = extractFloat64Frac(a); aExp = extractFloat64Exp(a); aSign = extractFloat64Sign(a); if (aExp == 0x7FF) { return a; } if (aExp != 0) ...
[ 1, 0 ]
qemu
hw/virtio-net.c
static void virtio_net_handle_tx_bh(VirtIODevice *vdev, VirtQueue *vq) { VirtIONet *n = to_virtio_net(vdev); if (unlikely(n->tx_waiting)) { return; } virtio_queue_set_notification(vq, 0); qemu_bh_schedule(n->tx_bh); n->tx_waiting = 1; }
[ 1, 0 ]
qemu
net/dump.c
static int net_dump_init(NetClientState *peer, const char *device, const char *name, const char *filename, int len) { struct pcap_file_hdr hdr; NetClientState *nc; DumpState *s; struct tm tm; int fd; fd = open(filename, O_CREAT | O_TRUNC | O_WRONLY | O_BINARY, 0644); if (...
[ 1, 0 ]
qemu
target-ppc/kvm.c
void kvm_arch_update_guest_debug(CPUState *cpu, struct kvm_guest_debug *dbg) {}
[ 1, 0 ]
qemu
acl.c
static void cpu_handle_debug_exception(CPUState *env) { CPUWatchpoint *wp; if (!env->watchpoint_hit) TAILQ_FOREACH(wp, &env->watchpoints, entry) wp->flags &= ~BP_WATCHPOINT_HIT; if (debug_excp_handler) debug_excp_handler(env); }
[ 0, 0 ]
qemu
hw/ppc.c
static void cpu_4xx_pit_cb(void *opaque) { CPUState *env; ppc_tb_t *tb_env; ppcemb_timer_t *ppcemb_timer; env = opaque; tb_env = env->tb_env; ppcemb_timer = tb_env->opaque; env->spr[SPR_40x_TSR] |= 1 << 27; if ((env->spr[SPR_40x_TCR] >> 26) & 0x1) ppc_set_irq(env, PPC_INTERRUPT_PIT, 1); ...
[ 0, 0 ]
qemu
exec.c
CPUArchState *cpu_copy(CPUArchState *env) { CPUState *cpu = ENV_GET_CPU(env); CPUArchState *new_env = cpu_init(cpu_model); CPUState *new_cpu = ENV_GET_CPU(new_env); #if defined(TARGET_HAS_ICE) CPUBreakpoint *bp; CPUWatchpoint *wp; #endif /* Reset non arch specific state */ cpu_reset(new_cpu); ...
[ 1, 0 ]
qemu
block/backup.c
static void block_job_detach_aio_context(void *opaque) { BlockJob *job = opaque; /* In case the job terminates during aio_poll()... */ block_job_ref(job); block_job_pause(job); if (!job->paused) { /* If job is !job->busy this kicks it into the next pause point. */ block_job_enter(job); } ...
[ 0, 0 ]
qemu
hw/arm/virt-acpi-build.c
void numa_cpu_pre_plug(const CPUArchId *slot, DeviceState *dev, Error **errp) { int mapped_node_id; /* set by -numa option */ int node_id = object_property_get_int(OBJECT(dev), "node-id", &error_abort); /* by default CPUState::numa_node was 0 if it wasn't set explicitly * TODO: make it error when incomple...
[ 0, 1 ]
qemu
block.c
static void multiwrite_cb(void *opaque, int ret) { MultiwriteCB *mcb = opaque; trace_multiwrite_cb(mcb, ret); if (ret < 0 && !mcb->error) { mcb->error = ret; } mcb->num_requests--; if (mcb->num_requests == 0) { multiwrite_user_cb(mcb); g_free(mcb); } }
[ 1, 0 ]
qemu
include/qemu/timer.h
void qemu_unregister_clock_reset_notifier(QEMUClock *clock, Notifier *notifier) { qemu_clock_unregister_reset_notifier(clock->type, notifier); }
[ 0, 0 ]
qemu
HACKING
static uint64_t imx_serial_read(void *opaque, target_phys_addr_t offset, unsigned size) { IMXSerialState *s = (IMXSerialState *)opaque; uint32_t c; DPRINTF("read(offset=%x)\n", offset >> 2); switch (offset >> 2) { case 0x0: /* URXD */ c = s->readbuff; if (!(s->...
[ 0, 1 ]
qemu
hw/omap.h
static inline void omap_gp_timer_trigger(struct omap_gp_timer_s *timer) { if (timer->pt) /* TODO in overflow-and-match mode if the first event to * occurs is the match, don't toggle. */ omap_gp_timer_out(timer, !timer->out_val); else /* TODO inverted pulse on timer->out_val == 1? */ q...
[ 0, 1 ]
qemu
block/qapi.c
static void string_deserialize(void **native_out, void *datap, VisitorFunc visit, Error **errp) { StringSerializeData *d = datap; d->string = string_output_get_string(d->sov); d->siv = string_input_visitor_new(d->string); visit(d->siv, native_out, errp); }
[ 0, 0 ]
qemu
accel/tcg/cpu-exec.c
static inline bool cpu_handle_exception(CPUState *cpu, int *ret) { if (cpu->exception_index >= 0) { if (cpu->exception_index >= EXCP_INTERRUPT) { /* exit request from the cpu execution loop */ *ret = cpu->exception_index; if (*ret == EXCP_DEBUG) { cpu_handle_debug_exception(cpu); ...
[ 1, 0 ]
qemu
hw/exynos4210_mct.c
static void exynos4210_gfrc_event(void *opaque) { Exynos4210MCTState *s = (Exynos4210MCTState *)opaque; int i; uint64_t distance; DPRINTF("\n"); s->g_timer.reg.cnt += s->g_timer.count; /* Process all comparators */ for (i = 0; i < MCT_GT_CMP_NUM; i++) { if (s->g_timer.reg.cnt == s->g_timer.re...
[ 0, 0 ]
FFmpeg
libavcodec/dxva2_mpeg2.c
int ff_mpeg_ref_picture(MpegEncContext *s, Picture *dst, Picture *src) { int ret; av_assert0(!dst->f.buf[0]); av_assert0(src->f.buf[0]); src->tf.f = &src->f; dst->tf.f = &dst->f; ret = ff_thread_ref_frame(&dst->tf, &src->tf); if (ret < 0) goto fail; ret = update_picture_tables(dst, src); ...
[ 1, 0 ]
FFmpeg
avconv.c
int64_t parse_time_or_die(const char *context, const char *timestr, int is_duration) { int64_t us; if (av_parse_time(&us, timestr, is_duration) < 0) { av_log(NULL, AV_LOG_FATAL, "Invalid %s specification for %s: %s\n", is_duration ? "duration" : "date", context, timest...
[ 1, 0 ]
qemu
backends/rng-egd.c
static void stm32f2xx_usart_write(void *opaque, hwaddr addr, uint64_t val64, unsigned int size) { STM32F2XXUsartState *s = opaque; uint32_t value = val64; unsigned char ch; DB_PRINT("Write 0x%" PRIx32 ", 0x%" HWADDR_PRIx "\n", value, addr); switch (addr) { case USAR...
[ 1, 0 ]
FFmpeg
Changelog
static int dxva2_alloc(AVCodecContext *s) { InputStream *ist = s->opaque; int loglevel = (ist->hwaccel_id == HWACCEL_AUTO) ? AV_LOG_VERBOSE : AV_LOG_ERROR; DXVA2Context *ctx; HANDLE device_handle; HRESULT hr; AVHWDeviceContext *device_ctx; AVDXVA2DeviceContext *device_hwctx; int ret; c...
[ 0, 0 ]
FFmpeg
libavformat/avc.c
int ff_avc_parse_nal_units(AVIOContext *pb, const uint8_t *buf_in, int size) { const uint8_t *p = buf_in; const uint8_t *end = p + size; const uint8_t *nal_start, *nal_end; size = 0; nal_start = ff_avc_find_startcode(p, end); while (nal_start < end) { while (!*(nal_start++)) ; nal_end...
[ 0, 0 ]
qemu
hw/display/cirrus_vga.c
static void cirrus_bitblt_rop_nop(CirrusVGAState *s, uint8_t *dst, const uint8_t *src, int dstpitch, int srcpitch, int bltwidth, int bltheight) {}
[ 0, 0 ]
qemu
block/qcow2.c
static int qcow_create(const char *filename, QEMUOptionParameter *options) { const char *backing_file = NULL; const char *backing_fmt = NULL; uint64_t sectors = 0; int flags = 0; size_t cluster_size = 65536; int prealloc = 0; /* Read out options */ while (options && options->name) { if (!s...
[ 1, 0 ]
qemu
hw/cirrus_vga.c
static int pci_qdev_init(DeviceState *qdev, DeviceInfo *base) { PCIDevice *pci_dev = (PCIDevice *)qdev; PCIDeviceInfo *info = container_of(base, PCIDeviceInfo, qdev); PCIBus *bus; int devfn, rc; /* initialize cap_present for pci_is_express() and pci_config_size() */ if (info->is_express) { pci_d...
[ 0, 0 ]
qemu
target/sh4/helper.h
float64 helper_fabs_DT(float64 t0) { return float64_abs(t0); }
[ 0, 0 ]