label
int64
0
1
func1
stringlengths
23
97k
id
int64
0
27.3k
0
static void qemu_laio_process_completion(struct qemu_laiocb *laiocb) { int ret; ret = laiocb->ret; if (ret != -ECANCELED) { if (ret == laiocb->nbytes) { ret = 0; } else if (ret >= 0) { /* Short reads mean EOF, pad with zeros. */ if (laiocb->is_read) { qemu_iovec_memset(laiocb->qiov, ret, 0, laiocb->qiov->size - ret); }...
14,937
0
static void aio_epoll_disable(AioContext *ctx) { ctx->epoll_available = false; if (!ctx->epoll_enabled) { return; } ctx->epoll_enabled = false; close(ctx->epollfd); }
14,938
0
static void pc_machine_initfn(Object *obj) { PCMachineState *pcms = PC_MACHINE(obj); object_property_add(obj, PC_MACHINE_MEMHP_REGION_SIZE, "int", pc_machine_get_hotplug_memory_region_size, NULL, NULL, NULL, &error_abort); pcms->max_ram_below_4g = 0xe0000000; /* 3.5G */ object_property_add(obj, PC_MACHINE_MAX_RAM_BELOW...
14,940
0
static unsigned int dec_move_rs(DisasContext *dc) { DIS(fprintf (logfile, "move $r%u, $s%u\n", dc->op1, dc->op2)); cris_cc_mask(dc, 0); tcg_gen_helper_0_2(helper_movl_sreg_reg, tcg_const_tl(dc->op2), tcg_const_tl(dc->op1)); return 2; }
14,941
1
int ff_qsv_encode(AVCodecContext *avctx, QSVEncContext *q, AVPacket *pkt, const AVFrame *frame, int *got_packet) { mfxBitstream bs = { { { 0 } } }; mfxFrameSurface1 *surf = NULL; mfxSyncPoint sync = NULL; int ret; if (frame) { ret = submit_frame(q, frame, &surf); if (ret < 0) { av_log(avctx, AV_LOG_ERROR, "Error submit...
14,944
1
static void nvram_writeb (void *opaque, target_phys_addr_t addr, uint32_t value) { ds1225y_t *NVRAM = opaque; int64_t pos; pos = addr - NVRAM->mem_base; if (ds1225y_set_to_mode(NVRAM, writemode, "wb")) { qemu_fseek(NVRAM->file, pos, SEEK_SET); qemu_put_byte(NVRAM->file, (int)value); } }
14,945
1
static av_cold int xvid_encode_close(AVCodecContext *avctx) { struct xvid_context *x = avctx->priv_data; xvid_encore(x->encoder_handle, XVID_ENC_DESTROY, NULL, NULL); if( avctx->extradata != NULL ) av_free(avctx->extradata); if( x->twopassbuffer != NULL ) { av_free(x->twopassbuffer); av_free(x->old_twopassbuffer); } if...
14,946
0
int attribute_align_arg avcodec_open2(AVCodecContext *avctx, const AVCodec *codec, AVDictionary **options) { int ret = 0; AVDictionary *tmp = NULL; if (avcodec_is_open(avctx)) return 0; if ((!codec && !avctx->codec)) { av_log(avctx, AV_LOG_ERROR, "No codec provided to avcodec_open2()\n"); return AVERROR(EINVAL); } if (...
14,948
0
unsigned long av_adler32_update(unsigned long adler, const uint8_t * buf, unsigned int len) { unsigned long s1 = adler & 0xffff; unsigned long s2 = adler >> 16; while (len > 0) { #if CONFIG_SMALL while (len > 4 && s2 < (1U << 31)) { DO4(buf); len -= 4; } #else while (len > 16 && s2 < (1U << 31)) { DO16(buf); len -= 16;...
14,949
0
static int mpc_read_seek(AVFormatContext *s, int stream_index, int64_t timestamp, int flags) { AVStream *st = s->streams[stream_index]; MPCContext *c = s->priv_data; AVPacket pkt1, *pkt = &pkt1; int ret; int index = av_index_search_timestamp(st, timestamp - DELAY_FRAMES, flags); uint32_t lastframe; /* if found, seek th...
14,950
0
av_cold void ff_gradfun_init_x86(GradFunContext *gf) { int cpu_flags = av_get_cpu_flags(); if (HAVE_MMX2 && cpu_flags & AV_CPU_FLAG_MMX2) gf->filter_line = gradfun_filter_line_mmx2; if (HAVE_SSSE3 && cpu_flags & AV_CPU_FLAG_SSSE3) gf->filter_line = gradfun_filter_line_ssse3; if (HAVE_SSE && cpu_flags & AV_CPU_FLAG_SSE2...
14,952
0
static int ioreq_map(struct ioreq *ioreq) { int gnt = ioreq->blkdev->xendev.gnttabdev; int i; if (ioreq->v.niov == 0) { return 0; } if (batch_maps) { ioreq->pages = xc_gnttab_map_grant_refs (gnt, ioreq->v.niov, ioreq->domids, ioreq->refs, ioreq->prot); if (ioreq->pages == NULL) { xen_be_printf(&ioreq->blkdev->xendev, 0...
14,953
0
static CharDriverState *qemu_chr_open_ringbuf(ChardevRingbuf *opts, Error **errp) { CharDriverState *chr; RingBufCharDriver *d; chr = g_malloc0(sizeof(CharDriverState)); d = g_malloc(sizeof(*d)); d->size = opts->has_size ? opts->size : 65536; /* The size must be power of 2 */ if (d->size & (d->size - 1)) { error_setg(e...
14,954
0
static void mcf_fec_write(void *opaque, hwaddr addr, uint64_t value, unsigned size) { mcf_fec_state *s = (mcf_fec_state *)opaque; switch (addr & 0x3ff) { case 0x004: s->eir &= ~value; break; case 0x008: s->eimr = value; break; case 0x010: /* RDAR */ if ((s->ecr & FEC_EN) && !s->rx_enabled) { DPRINTF("RX enable\n"); mcf...
14,955
0
static int vmdk_open_vmdk4(BlockDriverState *bs, BlockDriverState *file, int flags) { int ret; uint32_t magic; uint32_t l1_size, l1_entry_sectors; VMDK4Header header; VmdkExtent *extent; int64_t l1_backup_offset = 0; ret = bdrv_pread(file, sizeof(magic), &header, sizeof(header)); if (ret < 0) { return ret; } if (header...
14,956
0
int bdrv_write_zeroes(BlockDriverState *bs, int64_t sector_num, int nb_sectors, BdrvRequestFlags flags) { return bdrv_rw_co(bs, sector_num, NULL, nb_sectors, true, BDRV_REQ_ZERO_WRITE | flags); }
14,957
0
static char *usb_get_fw_dev_path(DeviceState *qdev) { USBDevice *dev = DO_UPCAST(USBDevice, qdev, qdev); char *fw_path, *in; int pos = 0; long nr; fw_path = qemu_malloc(32 + strlen(dev->port->path) * 6); in = dev->port->path; while (true) { nr = strtol(in, &in, 10); if (in[0] == '.') { /* some hub between root port and...
14,959
0
static void arm_sysctl_write(void *opaque, target_phys_addr_t offset, uint64_t val, unsigned size) { arm_sysctl_state *s = (arm_sysctl_state *)opaque; switch (offset) { case 0x08: /* LED */ s->leds = val; case 0x0c: /* OSC0 */ case 0x10: /* OSC1 */ case 0x14: /* OSC2 */ case 0x18: /* OSC3 */ case 0x1c: /* OSC4 */ /* ??...
14,960
0
uint32_t HELPER(msa)(CPUS390XState *env, uint32_t r1, uint32_t r2, uint32_t r3, uint32_t type) { const uintptr_t ra = GETPC(); const uint8_t mod = env->regs[0] & 0x80ULL; const uint8_t fc = env->regs[0] & 0x7fULL; CPUState *cs = CPU(s390_env_get_cpu(env)); uint8_t subfunc[16] = { 0 }; uint64_t param_addr; int i; switch...
14,961
0
void usb_desc_attach(USBDevice *dev) { const USBDesc *desc = usb_device_get_usb_desc(dev); assert(desc != NULL); if (desc->super && (dev->port->speedmask & USB_SPEED_MASK_SUPER)) { dev->speed = USB_SPEED_SUPER; } else if (desc->high && (dev->port->speedmask & USB_SPEED_MASK_HIGH)) { dev->speed = USB_SPEED_HIGH; } else ...
14,964
0
void register_displaychangelistener(DisplayChangeListener *dcl) { static DisplaySurface *dummy; QemuConsole *con; trace_displaychangelistener_register(dcl, dcl->ops->dpy_name); dcl->ds = get_alloc_displaystate(); QLIST_INSERT_HEAD(&dcl->ds->listeners, dcl, next); gui_setup_refresh(dcl->ds); if (dcl->con) { dcl->con->dc...
14,966
0
void bdrv_set_io_limits(BlockDriverState *bs, ThrottleConfig *cfg) { int i; throttle_config(&bs->throttle_state, cfg); for (i = 0; i < 2; i++) { qemu_co_enter_next(&bs->throttled_reqs[i]); } }
14,967
0
void s390_init_cpus(MachineState *machine) { int i; gchar *name; if (machine->cpu_model == NULL) { machine->cpu_model = "host"; } cpu_states = g_malloc0(sizeof(S390CPU *) * max_cpus); for (i = 0; i < max_cpus; i++) { name = g_strdup_printf("cpu[%i]", i); object_property_add_link(OBJECT(machine), name, TYPE_S390_CPU, (O...
14,969
0
static int qemu_rbd_create(const char *filename, QEMUOptionParameter *options) { int64_t bytes = 0; int64_t objsize; int obj_order = 0; char pool[RBD_MAX_POOL_NAME_SIZE]; char name[RBD_MAX_IMAGE_NAME_SIZE]; char snap_buf[RBD_MAX_SNAP_NAME_SIZE]; char conf[RBD_MAX_CONF_SIZE]; rados_t cluster; rados_ioctx_t io_ctx; int r...
14,970
0
static void init_proc_401x2 (CPUPPCState *env) { }
14,972
0
static int check_pow_970FX (CPUPPCState *env) { if (env->spr[SPR_HID0] & 0x00600000) return 1; return 0; }
14,973
0
int ff_listen_bind(int fd, const struct sockaddr *addr, socklen_t addrlen, int timeout) { int ret; int reuse = 1; struct pollfd lp = { fd, POLLIN, 0 }; setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &reuse, sizeof(reuse)); ret = bind(fd, addr, addrlen); if (ret) return ff_neterrno(); ret = listen(fd, 1); if (ret) return ff_n...
14,974
0
void qmp_x_blockdev_insert_medium(const char *device, const char *node_name, Error **errp) { BlockDriverState *bs; bs = bdrv_find_node(node_name); if (!bs) { error_setg(errp, "Node '%s' not found", node_name); return; } if (bs->blk) { error_setg(errp, "Node '%s' is already in use by '%s'", node_name, blk_name(bs->blk))...
14,975
0
int bdrv_pwritev(BlockDriverState *bs, int64_t offset, QEMUIOVector *qiov) { int ret; ret = bdrv_prwv_co(bs, offset, qiov, true, 0); if (ret < 0) { return ret; } return qiov->size; }
14,977
0
void qemu_input_event_send(QemuConsole *src, InputEvent *evt) { QemuInputHandlerState *s; if (!runstate_is_running() && !runstate_check(RUN_STATE_SUSPENDED)) { return; } qemu_input_event_trace(src, evt); /* pre processing */ if (graphic_rotate && (evt->type == INPUT_EVENT_KIND_ABS)) { qemu_input_transform_abs_rotate(ev...
14,978
0
static void omap_wd_timer_write(void *opaque, target_phys_addr_t addr, uint64_t value, unsigned size) { struct omap_watchdog_timer_s *s = (struct omap_watchdog_timer_s *) opaque; if (size != 2) { return omap_badwidth_write16(opaque, addr, value); } switch (addr) { case 0x00: /* CNTL_TIMER */ omap_timer_sync(&s->timer);...
14,979
0
static void nested_struct_compare(UserDefNested *udnp1, UserDefNested *udnp2) { g_assert(udnp1); g_assert(udnp2); g_assert_cmpstr(udnp1->string0, ==, udnp2->string0); g_assert_cmpstr(udnp1->dict1.string1, ==, udnp2->dict1.string1); g_assert_cmpint(udnp1->dict1.dict2.userdef1->base->integer, ==, udnp2->dict1.dict2.userd...
14,981
0
static void s390_cpu_realizefn(DeviceState *dev, Error **errp) { CPUState *cs = CPU(dev); S390CPUClass *scc = S390_CPU_GET_CLASS(dev); S390CPU *cpu = S390_CPU(dev); CPUS390XState *env = &cpu->env; Error *err = NULL; cpu_exec_init(cs, &err); if (err != NULL) { error_propagate(errp, err); return; } #if !defined(CONFIG_US...
14,983
0
static uint64_t musicpal_lcd_read(void *opaque, target_phys_addr_t offset, unsigned size) { musicpal_lcd_state *s = opaque; switch (offset) { case MP_LCD_IRQCTRL: return s->irqctrl; default: return 0; } }
14,984
0
static void cmd_seek(IDEState *s, uint8_t* buf) { unsigned int lba; uint64_t total_sectors = s->nb_sectors >> 2; if (total_sectors == 0) { ide_atapi_cmd_error(s, SENSE_NOT_READY, ASC_MEDIUM_NOT_PRESENT); return; } lba = ube32_to_cpu(buf + 2); if (lba >= total_sectors) { ide_atapi_cmd_error(s, SENSE_ILLEGAL_REQUEST, ASC...
14,986
0
static void test_visitor_in_alternate(TestInputVisitorData *data, const void *unused) { Visitor *v; Error *err = NULL; UserDefAlternate *tmp; WrapAlternate *wrap; v = visitor_input_test_init(data, "42"); visit_type_UserDefAlternate(v, NULL, &tmp, &error_abort); g_assert_cmpint(tmp->type, ==, QTYPE_QINT); g_assert_cmpin...
14,987
0
static int hls_read_header(AVFormatContext *s) { void *u = (s->flags & AVFMT_FLAG_CUSTOM_IO) ? NULL : s->pb; HLSContext *c = s->priv_data; int ret = 0, i; int highest_cur_seq_no = 0; c->ctx = s; c->interrupt_callback = &s->interrupt_callback; c->strict_std_compliance = s->strict_std_compliance; c->first_packet = 1; c->...
14,989
1
void spapr_register_hypercall(target_ulong opcode, spapr_hcall_fn fn) { spapr_hcall_fn old_fn; assert(opcode <= MAX_HCALL_OPCODE); assert((opcode & 0x3) == 0); old_fn = hypercall_table[opcode / 4]; assert(!old_fn || (fn == old_fn)); hypercall_table[opcode / 4] = fn; }
14,990
1
static av_cold int init_subtitles(AVFilterContext *ctx, const char *args) { int ret, sid; AVFormatContext *fmt = NULL; AVCodecContext *dec_ctx = NULL; AVCodec *dec = NULL; AVStream *st; AVPacket pkt; AssContext *ass = ctx->priv; /* Init libass */ ret = init(ctx, args, &subtitles_class); if (ret < 0) return ret; ass->tr...
14,991
1
static void start_ahci_device(AHCIQState *ahci) { /* Map AHCI's ABAR (BAR5) */ ahci->hba_base = qpci_iomap(ahci->dev, 5, &ahci->barsize); /* turns on pci.cmd.iose, pci.cmd.mse and pci.cmd.bme */ qpci_device_enable(ahci->dev); }
14,992
1
static void rv30_loop_filter(RV34DecContext *r, int row) { MpegEncContext *s = &r->s; int mb_pos, mb_x; int i, j, k; uint8_t *Y, *C; int loc_lim, cur_lim, left_lim = 0, top_lim = 0; mb_pos = row * s->mb_stride; for(mb_x = 0; mb_x < s->mb_width; mb_x++, mb_pos++){ int mbtype = s->current_picture_ptr->mb_type[mb_pos]; if...
14,993
1
static void alac_linear_predictor(AlacEncodeContext *s, int ch) { int i; LPCContext lpc = s->lpc[ch]; if(lpc.lpc_order == 31) { s->predictor_buf[0] = s->sample_buf[ch][0]; for(i=1; i<s->avctx->frame_size; i++) s->predictor_buf[i] = s->sample_buf[ch][i] - s->sample_buf[ch][i-1]; return; } // generalised linear predictor...
14,994
1
static void decode_opc_special3(CPUMIPSState *env, DisasContext *ctx) { int rs, rt, rd, sa; uint32_t op1, op2; rs = (ctx->opcode >> 21) & 0x1f; rt = (ctx->opcode >> 16) & 0x1f; rd = (ctx->opcode >> 11) & 0x1f; sa = (ctx->opcode >> 6) & 0x1f; op1 = MASK_SPECIAL3(ctx->opcode); case OPC_EXT: case OPC_INS: check_insn(ctx, ...
14,995
1
static int parse_psfile(AVFilterContext *ctx, const char *fname) { CurvesContext *curves = ctx->priv; uint8_t *buf; size_t size; int i, ret, av_unused(version), nb_curves; AVBPrint ptstr; static const int comp_ids[] = {3, 0, 1, 2}; av_bprint_init(&ptstr, 0, AV_BPRINT_SIZE_AUTOMATIC); ret = av_file_map(fname, &buf, &siz...
14,996
1
static int svq3_decode_slice_header(AVCodecContext *avctx) { SVQ3Context *svq3 = avctx->priv_data; H264Context *h = &svq3->h; MpegEncContext *s = &h->s; const int mb_xy = h->mb_xy; int i, header; header = get_bits(&s->gb, 8); if (((header & 0x9F) != 1 && (header & 0x9F) != 2) || (header & 0x60) == 0) { /* TODO: what? *...
14,997
1
static int blk_send_response_one(struct ioreq *ioreq) { struct XenBlkDev *blkdev = ioreq->blkdev; int send_notify = 0; int have_requests = 0; blkif_response_t resp; void *dst; resp.id = ioreq->req.id; resp.operation = ioreq->req.operation; resp.status = ioreq->status; /* Place on the response ring for the relevant doma...
14,998
1
void s390_ipl_prepare_cpu(S390CPU *cpu) { S390IPLState *ipl = get_ipl_device(); cpu->env.psw.addr = ipl->start_addr; cpu->env.psw.mask = IPL_PSW_MASK; if (!ipl->kernel || ipl->iplb_valid) { cpu->env.psw.addr = ipl->bios_start_addr; if (!ipl->iplb_valid) { ipl->iplb_valid = s390_gen_initial_iplb(ipl); } } if (ipl->netbo...
14,999
1
static void rtas_ibm_os_term(PowerPCCPU *cpu, sPAPRMachineState *spapr, uint32_t token, uint32_t nargs, target_ulong args, uint32_t nret, target_ulong rets) { target_ulong ret = 0; qapi_event_send_guest_panicked(GUEST_PANIC_ACTION_PAUSE, &error_abort); rtas_st(rets, 0, ret); }
15,003
1
int av_probe_input_buffer(AVIOContext *pb, AVInputFormat **fmt, const char *filename, void *logctx, unsigned int offset, unsigned int max_probe_size) { AVProbeData pd = { filename ? filename : "", NULL, -offset }; unsigned char *buf = NULL; int ret = 0, probe_size; if (!max_probe_size) { max_probe_size = PROBE_BUF_MAX;...
15,004
1
static int mov_read_stsz(MOVContext *c, AVIOContext *pb, MOVAtom atom) { AVStream *st; MOVStreamContext *sc; unsigned int i, entries, sample_size, field_size, num_bytes; GetBitContext gb; unsigned char* buf; if (c->fc->nb_streams < 1) return 0; st = c->fc->streams[c->fc->nb_streams-1]; sc = st->priv_data; avio_r8(pb); ...
15,005
0
static inline void writer_print_string(WriterContext *wctx, const char *key, const char *val, int opt) { const struct section *section = wctx->section[wctx->level]; if (opt && !(wctx->writer->flags & WRITER_FLAG_DISPLAY_OPTIONAL_FIELDS)) return; if (section->show_all_entries || av_dict_get(section->entries_to_show, key...
15,006
0
static int verify_expr(AVExpr *e) { if (!e) return 0; switch (e->type) { case e_value: case e_const: return 1; case e_func0: case e_func1: case e_squish: case e_ld: case e_gauss: case e_isnan: case e_floor: case e_ceil: case e_trunc: case e_sqrt: case e_not: case e_random: return verify_expr(e->param[0]) && !e->param[2...
15,007
0
void ff_put_h264_qpel4_mc10_msa(uint8_t *dst, const uint8_t *src, ptrdiff_t stride) { avc_luma_hz_qrt_4w_msa(src - 2, stride, dst, stride, 4, 0); }
15,008
0
static int mov_read_stco(MOVContext *c, ByteIOContext *pb, MOVAtom atom) { AVStream *st = c->fc->streams[c->fc->nb_streams-1]; MOVStreamContext *sc = st->priv_data; unsigned int i, entries; get_byte(pb); /* version */ get_be24(pb); /* flags */ entries = get_be32(pb); if(entries >= UINT_MAX/sizeof(int64_t)) return -1; s...
15,009
0
void ff_acelp_lspd2lpc(const double *lsp, float *lpc) { double pa[6], qa[6]; int i; lsp2polyf(lsp, pa, 5); lsp2polyf(lsp + 1, qa, 5); for (i=4; i>=0; i--) { double paf = pa[i+1] + pa[i]; double qaf = qa[i+1] - qa[i]; lpc[i ] = 0.5*(paf+qaf); lpc[9-i] = 0.5*(paf-qaf); } }
15,010
0
void ff_put_h264_qpel8_mc33_msa(uint8_t *dst, const uint8_t *src, ptrdiff_t stride) { avc_luma_hv_qrt_8w_msa(src + stride - 2, src - (stride * 2) + sizeof(uint8_t), stride, dst, stride, 8); }
15,011
0
static void gen_load_store_alignment(DisasContext *dc, int shift, TCGv_i32 addr, bool no_hw_alignment) { if (!option_enabled(dc, XTENSA_OPTION_UNALIGNED_EXCEPTION)) { tcg_gen_andi_i32(addr, addr, ~0 << shift); } else if (option_enabled(dc, XTENSA_OPTION_HW_ALIGNMENT) && no_hw_alignment) { int label = gen_new_label(); T...
15,012
0
DISAS_INSN(cas2w) { uint16_t ext1, ext2; TCGv addr1, addr2; TCGv regs; /* cas2 Dc1:Dc2,Du1:Du2,(Rn1):(Rn2) */ ext1 = read_im16(env, s); if (ext1 & 0x8000) { /* Address Register */ addr1 = AREG(ext1, 12); } else { /* Data Register */ addr1 = DREG(ext1, 12); } ext2 = read_im16(env, s); if (ext2 & 0x8000) { /* Address Reg...
15,013
0
bool timerlist_run_timers(QEMUTimerList *timer_list) { QEMUTimer *ts; int64_t current_time; bool progress = false; QEMUTimerCB *cb; void *opaque; if (!atomic_read(&timer_list->active_timers)) { return false; } qemu_event_reset(&timer_list->timers_done_ev); if (!timer_list->clock->enabled) { goto out; } switch (timer_li...
15,014
0
static int qemu_rdma_broken_ipv6_kernel(Error **errp, struct ibv_context *verbs) { struct ibv_port_attr port_attr; /* This bug only exists in linux, to our knowledge. */ #ifdef CONFIG_LINUX /* * Verbs are only NULL if management has bound to '[::]'. * * Let's iterate through all the devices and see if there any pure IB...
15,015
0
static void slavio_set_irq(void *opaque, int irq, int level) { SLAVIO_INTCTLState *s = opaque; DPRINTF("Set cpu %d irq %d level %d\n", s->target_cpu, irq, level); if (irq < 32) { uint32_t mask = 1 << irq; uint32_t pil = s->intbit_to_level[irq]; if (pil > 0) { if (level) { s->intregm_pending |= mask; s->intreg_pending[s...
15,017
0
int css_register_io_adapter(CssIoAdapterType type, uint8_t isc, bool swap, bool maskable, uint32_t *id) { IoAdapter *adapter; bool found = false; int ret; S390FLICState *fs = s390_get_flic(); S390FLICStateClass *fsc = S390_FLIC_COMMON_GET_CLASS(fs); *id = 0; QTAILQ_FOREACH(adapter, &channel_subsys.io_adapters, sibling)...
15,018
0
static int ppce500_load_device_tree(CPUPPCState *env, QEMUMachineInitArgs *args, PPCE500Params *params, hwaddr addr, hwaddr initrd_base, hwaddr initrd_size) { int ret = -1; uint64_t mem_reg_property[] = { 0, cpu_to_be64(args->ram_size) }; int fdt_size; void *fdt; uint8_t hypercall[16]; uint32_t clock_freq = 400000000; ...
15,019
0
static void acpi_get_pci_holes(Range *hole, Range *hole64) { Object *pci_host; pci_host = acpi_get_i386_pci_host(); g_assert(pci_host); hole->begin = object_property_get_int(pci_host, PCI_HOST_PROP_PCI_HOLE_START, NULL); hole->end = object_property_get_int(pci_host, PCI_HOST_PROP_PCI_HOLE_END, NULL); hole64->begin = ob...
15,020
0
static void colo_compare_complete(UserCreatable *uc, Error **errp) { CompareState *s = COLO_COMPARE(uc); Chardev *chr; char thread_name[64]; static int compare_id; if (!s->pri_indev || !s->sec_indev || !s->outdev) { error_setg(errp, "colo compare needs 'primary_in' ," "'secondary_in','outdev' property set"); return; } ...
15,021
0
ram_addr_t qemu_ram_alloc_from_ptr(ram_addr_t size, void *host, MemoryRegion *mr) { RAMBlock *new_block; size = TARGET_PAGE_ALIGN(size); new_block = g_malloc0(sizeof(*new_block)); new_block->mr = mr; new_block->offset = find_ram_offset(size); if (host) { new_block->host = host; new_block->flags |= RAM_PREALLOC_MASK; } ...
15,024
0
static void x86_iommu_realize(DeviceState *dev, Error **errp) { X86IOMMUState *x86_iommu = X86_IOMMU_DEVICE(dev); X86IOMMUClass *x86_class = X86_IOMMU_GET_CLASS(dev); MachineState *ms = MACHINE(qdev_get_machine()); MachineClass *mc = MACHINE_GET_CLASS(ms); PCMachineState *pcms = PC_MACHINE(object_dynamic_cast(OBJECT(ms...
15,025
0
static uint64_t cs_read (void *opaque, target_phys_addr_t addr, unsigned size) { CSState *s = opaque; uint32_t saddr, iaddr, ret; saddr = addr; iaddr = ~0U; switch (saddr) { case Index_Address: ret = s->regs[saddr] & ~0x80; break; case Index_Data: if (!(s->dregs[MODE_And_ID] & MODE2)) iaddr = s->regs[Index_Address] & 0...
15,028
0
static int mmu_translate_region(CPUS390XState *env, target_ulong vaddr, uint64_t asc, uint64_t entry, int level, target_ulong *raddr, int *flags, int rw) { CPUState *cs = CPU(s390_env_get_cpu(env)); uint64_t origin, offs, new_entry; const int pchks[4] = { PGM_SEGMENT_TRANS, PGM_REG_THIRD_TRANS, PGM_REG_SEC_TRANS, PGM_R...
15,029
0
static void sunkbd_handle_event(DeviceState *dev, QemuConsole *src, InputEvent *evt) { ChannelState *s = (ChannelState *)dev; int qcode, keycode; InputKeyEvent *key; assert(evt->type == INPUT_EVENT_KIND_KEY); key = evt->u.key; qcode = qemu_input_key_value_to_qcode(key->key); trace_escc_sunkbd_event_in(qcode, QKeyCode_l...
15,030
0
static void fmod_write_sample (HWVoiceOut *hw, uint8_t *dst, int dst_len) { int src_len1 = dst_len; int src_len2 = 0; int pos = hw->rpos + dst_len; st_sample_t *src1 = hw->mix_buf + hw->rpos; st_sample_t *src2 = NULL; if (pos > hw->samples) { src_len1 = hw->samples - hw->rpos; src2 = hw->mix_buf; src_len2 = dst_len - s...
15,031
0
static void dealloc_helper(void *native_in, VisitorFunc visit, Error **errp) { QapiDeallocVisitor *qdv = qapi_dealloc_visitor_new(); visit(qapi_dealloc_get_visitor(qdv), &native_in, errp); qapi_dealloc_visitor_cleanup(qdv); }
15,032
0
static void deinterlace_bottom_field_inplace(uint8_t *src1, int src_wrap, int width, int height) { uint8_t *src_m1, *src_0, *src_p1, *src_p2; int y; uint8_t *buf; buf = av_malloc(width); src_m1 = src1; memcpy(buf,src_m1,width); src_0=&src_m1[src_wrap]; src_p1=&src_0[src_wrap]; src_p2=&src_p1[src_wrap]; for(y=0;y<(heigh...
15,033
0
bool net_tx_pkt_parse(struct NetTxPkt *pkt) { return net_tx_pkt_parse_headers(pkt) && net_tx_pkt_rebuild_payload(pkt); }
15,034
0
CPUState *ppc405ep_init (target_phys_addr_t ram_bases[2], target_phys_addr_t ram_sizes[2], uint32_t sysclk, qemu_irq **picp, int do_init) { clk_setup_t clk_setup[PPC405EP_CLK_NB], tlb_clk_setup; qemu_irq dma_irqs[4], gpt_irqs[5], mal_irqs[4]; CPUState *env; qemu_irq *pic, *irqs; memset(clk_setup, 0, sizeof(clk_setup));...
15,035
0
void address_space_sync_dirty_bitmap(AddressSpace *as) { FlatView *view; FlatRange *fr; view = as->current_map; FOR_EACH_FLAT_RANGE(fr, view) { MEMORY_LISTENER_UPDATE_REGION(fr, as, Forward, log_sync); } }
15,036
0
static uint32_t nam_readb (void *opaque, uint32_t addr) { PCIAC97LinkState *d = opaque; AC97LinkState *s = &d->ac97; dolog ("U nam readb %#x\n", addr); s->cas = 0; return ~0U; }
15,037
0
static target_ulong h_client_architecture_support(PowerPCCPU *cpu, sPAPRMachineState *spapr, target_ulong opcode, target_ulong *args) { /* Working address in data buffer */ target_ulong addr = ppc64_phys_to_real(args[0]); target_ulong ov_table; uint32_t cas_pvr; sPAPROptionVector *ov1_guest, *ov5_guest, *ov5_cas_old, *...
15,038
0
static int mode_sense_page(SCSIDiskState *s, int page, uint8_t **p_outbuf, int page_control) { static const int mode_sense_valid[0x3f] = { [MODE_PAGE_HD_GEOMETRY] = (1 << TYPE_DISK), [MODE_PAGE_FLEXIBLE_DISK_GEOMETRY] = (1 << TYPE_DISK), [MODE_PAGE_CACHING] = (1 << TYPE_DISK) | (1 << TYPE_ROM), [MODE_PAGE_CAPABILITIES]...
15,039
0
int cpu_get_memory_mapping(MemoryMappingList *list, CPUArchState *env) { if (!(env->cr[0] & CR0_PG_MASK)) { /* paging is disabled */ return 0; } if (env->cr[4] & CR4_PAE_MASK) { #ifdef TARGET_X86_64 if (env->hflags & HF_LMA_MASK) { target_phys_addr_t pml4e_addr; pml4e_addr = (env->cr[3] & ~0xfff) & env->a20_mask; walk_...
15,040
0
void ff_h264_filter_mb_fast( H264Context *h, int mb_x, int mb_y, uint8_t *img_y, uint8_t *img_cb, uint8_t *img_cr, unsigned int linesize, unsigned int uvlinesize) { MpegEncContext * const s = &h->s; int mb_xy; int mb_type, left_type, top_type; int qp, qp0, qp1, qpc, qpc0, qpc1, qp_thresh; int chroma = !(CONFIG_GRAY && ...
15,042
0
static inline void downmix_2f_1r_to_mono(float *samples) { int i; for (i = 0; i < 256; i++) { samples[i] += (samples[i + 256] + samples[i + 512]); samples[i + 256] = samples[i + 512] = 0; } }
15,043
0
static void do_bit_allocation1(AC3DecodeContext *ctx, int chnl) { ac3_audio_block *ab = &ctx->audio_block; int sdecay, fdecay, sgain, dbknee, floor; int lowcomp = 0, fgain = 0, snroffset = 0, fastleak = 0, slowleak = 0; int psd[256], bndpsd[50], excite[50], mask[50], delta; int start = 0, end = 0, bin = 0, i = 0, j = 0...
15,044
0
static int add_shorts_metadata(int count, const char *name, const char *sep, TiffContext *s) { char *ap; int i; int16_t *sp; if (bytestream2_get_bytes_left(&s->gb) < count * sizeof(int16_t)) return -1; sp = av_malloc(count * sizeof(int16_t)); if (!sp) return AVERROR(ENOMEM); for (i = 0; i < count; i++) sp[i] = tget_sho...
15,045
0
int av_open_input_file(AVFormatContext **ic_ptr, const char *filename, AVInputFormat *fmt, int buf_size, AVFormatParameters *ap) { int err; AVProbeData probe_data, *pd = &probe_data; ByteIOContext *pb = NULL; void *logctx= ap && ap->prealloced_context ? *ic_ptr : NULL; pd->filename = ""; if (filename) pd->filename = fi...
15,046
0
static int amr_probe(AVProbeData *p) { //Only check for "#!AMR" which could be amr-wb, amr-nb. //This will also trigger multichannel files: "#!AMR_MC1.0\n" and //"#!AMR-WB_MC1.0\n" (not supported) if (p->buf_size < 5) return 0; if(memcmp(p->buf,AMR_header,5)==0) return AVPROBE_SCORE_MAX; else return 0; }
15,047
0
static int http_read_stream(URLContext *h, uint8_t *buf, int size) { HTTPContext *s = h->priv_data; int err, new_location, read_ret; int64_t seek_ret; int reconnect_delay = 0; if (!s->hd) return AVERROR_EOF; if (s->end_chunked_post && !s->end_header) { err = http_read_header(h, &new_location); if (err < 0) return err; ...
15,048
0
static int yuv4_probe(AVProbeData *pd) { /* check file header */ if (pd->buf_size <= sizeof(Y4M_MAGIC)) return 0; if (strncmp(pd->buf, Y4M_MAGIC, sizeof(Y4M_MAGIC)-1)==0) return AVPROBE_SCORE_MAX; else return 0; }
15,049
0
static rwpipe *rwpipe_open( int argc, char *argv[] ) { rwpipe *this = av_mallocz( sizeof( rwpipe ) ); if ( this != NULL ) { int input[ 2 ]; int output[ 2 ]; pipe( input ); pipe( output ); this->pid = fork(); if ( this->pid == 0 ) { #define COMMAND_SIZE 10240 char *command = av_mallocz( COMMAND_SIZE ); int i; strcpy( co...
15,050
0
static int validate_codec_tag(AVFormatContext *s, AVStream *st) { const AVCodecTag *avctag; int n; enum AVCodecID id = AV_CODEC_ID_NONE; unsigned int tag = 0; /** * Check that tag + id is in the table * If neither is in the table -> OK * If tag is in the table with another id -> FAIL * If id is in the table with anothe...
15,052
0
int coroutine_fn bdrv_co_preadv(BdrvChild *child, int64_t offset, unsigned int bytes, QEMUIOVector *qiov, BdrvRequestFlags flags) { BlockDriverState *bs = child->bs; BlockDriver *drv = bs->drv; BdrvTrackedRequest req; uint64_t align = bs->bl.request_alignment; uint8_t *head_buf = NULL; uint8_t *tail_buf = NULL; QEMUIOV...
15,053
0
static coroutine_fn int qcow2_co_flush_to_os(BlockDriverState *bs) { BDRVQcow2State *s = bs->opaque; int ret; qemu_co_mutex_lock(&s->lock); ret = qcow2_cache_flush(bs, s->l2_table_cache); if (ret < 0) { qemu_co_mutex_unlock(&s->lock); return ret; } if (qcow2_need_accurate_refcounts(s)) { ret = qcow2_cache_flush(bs, s->...
15,054
0
static void test_submit_many(void) { WorkerTestData data[100]; int i; /* Start more work items than there will be threads. */ for (i = 0; i < 100; i++) { data[i].n = 0; data[i].ret = -EINPROGRESS; thread_pool_submit_aio(worker_cb, &data[i], done_cb, &data[i]); } active = 100; while (active > 0) { qemu_aio_wait(); } for...
15,056
0
static inline void gen_op_jnz_ecx(TCGMemOp size, int label1) { tcg_gen_mov_tl(cpu_tmp0, cpu_regs[R_ECX]); gen_extu(size, cpu_tmp0); tcg_gen_brcondi_tl(TCG_COND_NE, cpu_tmp0, 0, label1); }
15,057
0
static int local_opendir(FsContext *ctx, V9fsPath *fs_path, V9fsFidOpenState *fs) { char buffer[PATH_MAX]; char *path = fs_path->data; fs->dir = opendir(rpath(ctx, path, buffer)); if (!fs->dir) { return -1; } return 0; }
15,058
0
void cpu_outw(CPUState *env, pio_addr_t addr, uint16_t val) { LOG_IOPORT("outw: %04"FMT_pioaddr" %04"PRIx16"\n", addr, val); ioport_write(1, addr, val); #ifdef CONFIG_KQEMU if (env) env->last_io_time = cpu_get_time_fast(); #endif }
15,060
0
static void virtio_blk_device_realize(DeviceState *dev, Error **errp) { VirtIODevice *vdev = VIRTIO_DEVICE(dev); VirtIOBlock *s = VIRTIO_BLK(dev); VirtIOBlkConf *conf = &s->conf; Error *err = NULL; static int virtio_blk_id; if (!conf->conf.bs) { error_setg(errp, "drive property not set"); return; } if (!bdrv_is_inserte...
15,062
0
yuv2gray16_2_c_template(SwsContext *c, const uint16_t *buf0, const uint16_t *buf1, const uint16_t *ubuf0, const uint16_t *ubuf1, const uint16_t *vbuf0, const uint16_t *vbuf1, const uint16_t *abuf0, const uint16_t *abuf1, uint8_t *dest, int dstW, int yalpha, int uvalpha, int y, enum PixelFormat target) { int yalpha1 = 4...
15,063
0
dma_winvalid (void *opaque, target_phys_addr_t addr, uint32_t value) { hw_error("Unsupported short waccess. reg=" TARGET_FMT_plx "\n", addr); }
15,064
0
set_interrupt_cause(E1000State *s, int index, uint32_t val) { if (val) val |= E1000_ICR_INT_ASSERTED; s->mac_reg[ICR] = val; s->mac_reg[ICS] = val; qemu_set_irq(s->dev.irq[0], (s->mac_reg[IMS] & s->mac_reg[ICR]) != 0); }
15,065