label int64 0 1 | func1 stringlengths 23 97k | id int64 0 27.3k |
|---|---|---|
0 | uint32_t HELPER(mvcl)(CPUS390XState *env, uint32_t r1, uint32_t r2) { uintptr_t ra = GETPC(); uint64_t destlen = env->regs[r1 + 1] & 0xffffff; uint64_t dest = get_address(env, r1); uint64_t srclen = env->regs[r2 + 1] & 0xffffff; uint64_t src = get_address(env, r2); uint8_t pad = env->regs[r2 + 1] >> 24; uint8_t v; uint... | 6,834 |
0 | static int do_compress_ram_page(CompressParam *param) { int bytes_sent, blen; uint8_t *p; RAMBlock *block = param->block; ram_addr_t offset = param->offset; p = block->host + (offset & TARGET_PAGE_MASK); bytes_sent = save_page_header(param->file, block, offset | RAM_SAVE_FLAG_COMPRESS_PAGE); blen = qemu_put_compression... | 6,836 |
0 | static int get_fw_cfg_order(FWCfgState *s, const char *name) { int i; if (s->fw_cfg_order_override > 0) { return s->fw_cfg_order_override; } for (i = 0; i < ARRAY_SIZE(fw_cfg_order); i++) { if (fw_cfg_order[i].name == NULL) { continue; } if (strcmp(name, fw_cfg_order[i].name) == 0) { return fw_cfg_order[i].order; } } /... | 6,837 |
0 | int qemu_strtol(const char *nptr, const char **endptr, int base, long *result) { char *ep; int err = 0; if (!nptr) { if (endptr) { *endptr = nptr; } err = -EINVAL; } else { errno = 0; *result = strtol(nptr, &ep, base); err = check_strtox_error(nptr, ep, endptr, errno); } return err; } | 6,840 |
0 | void ff_sbr_apply(AACContext *ac, SpectralBandReplication *sbr, int id_aac, float* L, float* R) { int downsampled = ac->m4ac.ext_sample_rate < sbr->sample_rate; int ch; int nch = (id_aac == TYPE_CPE) ? 2 : 1; if (sbr->start) { sbr_dequant(sbr, id_aac); } for (ch = 0; ch < nch; ch++) { /* decode channel */ sbr_qmf_analy... | 6,841 |
0 | static void stellaris_enet_receive(void *opaque, const uint8_t *buf, size_t size) { stellaris_enet_state *s = (stellaris_enet_state *)opaque; int n; uint8_t *p; uint32_t crc; if ((s->rctl & SE_RCTL_RXEN) == 0) return; if (s->np >= 31) { DPRINTF("Packet dropped\n"); return; } DPRINTF("Received packet len=%d\n", size); n... | 6,842 |
0 | static void virtio_blk_class_init(ObjectClass *klass, void *data) { DeviceClass *dc = DEVICE_CLASS(klass); PCIDeviceClass *k = PCI_DEVICE_CLASS(klass); k->init = virtio_blk_init_pci; k->exit = virtio_blk_exit_pci; k->vendor_id = PCI_VENDOR_ID_REDHAT_QUMRANET; k->device_id = PCI_DEVICE_ID_VIRTIO_BLOCK; k->revision = VIR... | 6,843 |
0 | static void qxl_dirty_surfaces(PCIQXLDevice *qxl) { uintptr_t vram_start; int i; if (qxl->mode != QXL_MODE_NATIVE && qxl->mode != QXL_MODE_COMPAT) { return; } /* dirty the primary surface */ qxl_set_dirty(&qxl->vga.vram, qxl->shadow_rom.draw_area_offset, qxl->shadow_rom.surface0_area_size); vram_start = (uintptr_t)memo... | 6,845 |
0 | static void xics_reset(DeviceState *d) { XICSState *icp = XICS(d); int i; for (i = 0; i < icp->nr_servers; i++) { device_reset(DEVICE(&icp->ss[i])); } device_reset(DEVICE(icp->ics)); } | 6,846 |
0 | void spapr_drc_attach(sPAPRDRConnector *drc, DeviceState *d, void *fdt, int fdt_start_offset, bool coldplug, Error **errp) { trace_spapr_drc_attach(spapr_drc_index(drc)); if (drc->isolation_state != SPAPR_DR_ISOLATION_STATE_ISOLATED) { error_setg(errp, "an attached device is still awaiting release"); return; } if (spap... | 6,847 |
0 | static void openpic_src_write(void *opaque, hwaddr addr, uint64_t val, unsigned len) { OpenPICState *opp = opaque; int idx; DPRINTF("%s: addr %#" HWADDR_PRIx " <= %08" PRIx64 "\n", __func__, addr, val); if (addr & 0xF) { return; } addr = addr & 0xFFF0; idx = addr >> 5; if (addr & 0x10) { /* EXDE / IFEDE / IEEDE */ writ... | 6,848 |
0 | static void gen_exception_internal_insn(DisasContext *s, int offset, int excp) { gen_set_condexec(s); gen_set_pc_im(s, s->pc - offset); gen_exception_internal(excp); s->is_jmp = DISAS_JUMP; } | 6,849 |
0 | static void gen_thumb2_parallel_addsub(int op1, int op2, TCGv a, TCGv b) { TCGv tmp; switch (op1) { #define gen_pas_helper(name) glue(gen_helper_,name)(a, a, b, tmp) case 0: tmp = tcg_temp_new(TCG_TYPE_PTR); tcg_gen_addi_ptr(tmp, cpu_env, offsetof(CPUState, GE)); PAS_OP(s) break; case 4: tmp = tcg_temp_new(TCG_TYPE_PTR... | 6,850 |
0 | static void test_io_rw_interface(enum AddrMode lba48, enum IOMode dma, unsigned bufsize, uint64_t sector) { AHCIQState *ahci; ahci = ahci_boot_and_enable(); ahci_test_io_rw_simple(ahci, bufsize, sector, io_cmds[dma][lba48][IO_READ], io_cmds[dma][lba48][IO_WRITE]); ahci_shutdown(ahci); } | 6,851 |
0 | static void aio_write_done(void *opaque, int ret) { struct aio_ctx *ctx = opaque; struct timeval t2; gettimeofday(&t2, NULL); if (ret < 0) { printf("aio_write failed: %s\n", strerror(-ret)); goto out; } if (ctx->qflag) { goto out; } /* Finally, report back -- -C gives a parsable format */ t2 = tsub(t2, ctx->t1); print_... | 6,853 |
0 | uint64_t helper_fres (uint64_t arg) { CPU_DoubleU fone, farg; float32 f32; fone.ll = 0x3FF0000000000000ULL; /* 1.0 */ farg.ll = arg; if (unlikely(float64_is_signaling_nan(farg.d))) { /* sNaN reciprocal */ farg.ll = fload_invalid_op_excp(POWERPC_EXCP_FP_VXSNAN); } else if (unlikely(float64_is_zero(farg.d))) { /* Zero re... | 6,854 |
0 | static uint64_t uart_read(void *opaque, target_phys_addr_t addr, unsigned size) { LM32UartState *s = opaque; uint32_t r = 0; addr >>= 2; switch (addr) { case R_RXTX: r = s->regs[R_RXTX]; s->regs[R_LSR] &= ~LSR_DR; uart_update_irq(s); break; case R_IIR: case R_LSR: case R_MSR: r = s->regs[addr]; break; case R_IER: case ... | 6,855 |
0 | static int disas_thumb2_insn(CPUARMState *env, DisasContext *s, uint16_t insn_hw1) { uint32_t insn, imm, shift, offset; uint32_t rd, rn, rm, rs; TCGv_i32 tmp; TCGv_i32 tmp2; TCGv_i32 tmp3; TCGv_i32 addr; TCGv_i64 tmp64; int op; int shiftop; int conds; int logic_cc; if (!(arm_dc_feature(s, ARM_FEATURE_THUMB2) || arm_dc_... | 6,857 |
0 | static QIOChannelSocket *nbd_establish_connection(SocketAddress *saddr_flat, Error **errp) { SocketAddressLegacy *saddr = socket_address_crumple(saddr_flat); QIOChannelSocket *sioc; Error *local_err = NULL; sioc = qio_channel_socket_new(); qio_channel_set_name(QIO_CHANNEL(sioc), "nbd-client"); qio_channel_socket_connec... | 6,858 |
0 | void helper_lcall_protected(CPUX86State *env, int new_cs, target_ulong new_eip, int shift, int next_eip_addend) { int new_stack, i; uint32_t e1, e2, cpl, dpl, rpl, selector, offset, param_count; uint32_t ss = 0, ss_e1 = 0, ss_e2 = 0, sp, type, ss_dpl, sp_mask; uint32_t val, limit, old_sp_mask; target_ulong ssp, old_ssp... | 6,859 |
0 | static void tile_codeblocks(Jpeg2000DecoderContext *s, Jpeg2000Tile *tile) { Jpeg2000T1Context t1; int compno, reslevelno, bandno; /* Loop on tile components */ for (compno = 0; compno < s->ncomponents; compno++) { Jpeg2000Component *comp = tile->comp + compno; Jpeg2000CodingStyle *codsty = tile->codsty + compno; /* Lo... | 6,860 |
0 | static PCIDevice *do_pci_register_device(PCIDevice *pci_dev, PCIBus *bus, const char *name, int devfn) { PCIDeviceClass *pc = PCI_DEVICE_GET_CLASS(pci_dev); PCIConfigReadFunc *config_read = pc->config_read; PCIConfigWriteFunc *config_write = pc->config_write; AddressSpace *dma_as; if (devfn < 0) { for(devfn = bus->devf... | 6,861 |
0 | static int bdrv_inherited_flags(int flags) { /* Enable protocol handling, disable format probing for bs->file */ flags |= BDRV_O_PROTOCOL; /* Our block drivers take care to send flushes and respect unmap policy, * so we can enable both unconditionally on lower layers. */ flags |= BDRV_O_CACHE_WB | BDRV_O_UNMAP; /* The ... | 6,862 |
0 | static inline void gen_movcf_ps(DisasContext *ctx, int fs, int fd, int cc, int tf) { int cond; TCGv_i32 t0 = tcg_temp_new_i32(); int l1 = gen_new_label(); int l2 = gen_new_label(); if (tf) cond = TCG_COND_EQ; else cond = TCG_COND_NE; tcg_gen_andi_i32(t0, fpu_fcr31, 1 << get_fp_bit(cc)); tcg_gen_brcondi_i32(cond, t0, 0,... | 6,863 |
0 | QEMUFile *qemu_fopen(const char *filename, const char *mode) { QEMUFile *f; f = qemu_mallocz(sizeof(QEMUFile)); if (!f) return NULL; if (!strcmp(mode, "wb")) { f->is_writable = 1; } else if (!strcmp(mode, "rb")) { f->is_writable = 0; } else { goto fail; } f->outfile = fopen(filename, mode); if (!f->outfile) goto fail; ... | 6,865 |
0 | void mips_cpu_do_unaligned_access(CPUState *cs, vaddr addr, int is_write, int is_user, uintptr_t retaddr) { MIPSCPU *cpu = MIPS_CPU(cs); CPUMIPSState *env = &cpu->env; env->CP0_BadVAddr = addr; do_raise_exception(env, (is_write == 1) ? EXCP_AdES : EXCP_AdEL, retaddr); } | 6,868 |
0 | void block_job_cancel(BlockJob *job) { job->cancelled = true; block_job_resume(job); } | 6,869 |
0 | PCIBus *pci_pmac_init(qemu_irq *pic, MemoryRegion *address_space_mem, MemoryRegion *address_space_io) { DeviceState *dev; SysBusDevice *s; PCIHostState *h; UNINState *d; /* Use values found on a real PowerMac */ /* Uninorth main bus */ dev = qdev_create(NULL, TYPE_UNI_NORTH_PCI_HOST_BRIDGE); qdev_init_nofail(dev); s = ... | 6,870 |
0 | static inline void downmix_3f_2r_to_dolby(float *samples) { int i; for (i = 0; i < 256; i++) { samples[i] += (samples[i + 256] - samples[i + 768]); samples[i + 256] = (samples[i + 512] + samples[i + 1024]); samples[i + 512] = samples[i + 768] = samples[i + 1024] = 0; } } | 6,871 |
0 | int qemu_paio_ioctl(struct qemu_paiocb *aiocb) { return qemu_paio_submit(aiocb, QEMU_PAIO_IOCTL); } | 6,872 |
0 | int rtsp_next_attr_and_value(const char **p, char *attr, int attr_size, char *value, int value_size) { skip_spaces(p); if(**p) { get_word_sep(attr, attr_size, "=", p); if (**p == '=') (*p)++; get_word_sep(value, value_size, ";", p); if (**p == ';') (*p)++; return 1; } return 0; } | 6,873 |
0 | int av_opencl_init(AVDictionary *options, AVOpenCLExternalEnv *ext_opencl_env) { int ret = 0; AVDictionaryEntry *opt_build_entry; AVDictionaryEntry *opt_platform_entry; AVDictionaryEntry *opt_device_entry; LOCK_OPENCL if (!gpu_env.init_count) { opt_platform_entry = av_dict_get(options, "platform_idx", NULL, 0); opt_dev... | 6,874 |
0 | static CodeBook unpack_codebook(GetBitContext* gb, unsigned depth, unsigned size) { unsigned i, j; CodeBook cb = { 0 }; if (!can_safely_read(gb, (uint64_t)size * 34)) return cb; if (size >= INT_MAX / sizeof(MacroBlock)) return cb; cb.blocks = av_malloc(size ? size * sizeof(MacroBlock) : 1); if (!cb.blocks) return cb; c... | 6,875 |
0 | static void hybrid4_8_12_cx(float (*in)[2], float (*out)[32][2], const float (*filter)[7][2], int N, int len) { int i, j, ssb; for (i = 0; i < len; i++, in++) { for (ssb = 0; ssb < N; ssb++) { float sum_re = filter[ssb][6][0] * in[6][0], sum_im = filter[ssb][6][0] * in[6][1]; for (j = 0; j < 6; j++) { float in0_re = in... | 6,876 |
0 | static int add_metadata(const uint8_t **buf, int count, int type, const char *name, const char *sep, TiffContext *s) { switch(type) { case TIFF_DOUBLE: return add_doubles_metadata(buf, count, name, sep, s); case TIFF_SHORT : return add_shorts_metadata(buf, count, name, sep, s); default : return AVERROR_INVALIDDATA; }; ... | 6,877 |
0 | static int opt_recording_timestamp(void *optctx, const char *opt, const char *arg) { OptionsContext *o = optctx; char buf[128]; int64_t recording_timestamp = parse_time_or_die(opt, arg, 0) / 1E6; struct tm time = *gmtime((time_t*)&recording_timestamp); strftime(buf, sizeof(buf), "creation_time=%FT%T%z", &time); parse_o... | 6,878 |
1 | static void tcp_chr_tls_init(CharDriverState *chr) { TCPCharDriver *s = chr->opaque; QIOChannelTLS *tioc; Error *err = NULL; if (s->is_listen) { tioc = qio_channel_tls_new_server( s->ioc, s->tls_creds, NULL, /* XXX Use an ACL */ &err); } else { tioc = qio_channel_tls_new_client( s->ioc, s->tls_creds, s->addr->u.inet.da... | 6,880 |
1 | rdt_free_extradata (PayloadContext *rdt) { ff_rm_free_rmstream(rdt->rmst[0]); if (rdt->rmctx) av_close_input_stream(rdt->rmctx); av_freep(&rdt->mlti_data); av_free(rdt); } | 6,881 |
1 | static int h263_decode_gob_header(MpegEncContext *s) { unsigned int val, gob_number; int left; /* Check for GOB Start Code */ val = show_bits(&s->gb, 16); if(val) return -1; /* We have a GBSC probably with GSTUFF */ skip_bits(&s->gb, 16); /* Drop the zeros */ left= get_bits_left(&s->gb); //MN: we must check the bits le... | 6,882 |
1 | static int mov_read_wide(MOVContext *c, ByteIOContext *pb, MOV_atom_t atom) { int err; uint32_t type; #ifdef DEBUG print_atom("wide", atom); debug_indent++; #endif if (atom.size < 8) return 0; /* continue */ if (get_be32(pb) != 0) { /* 0 sized mdat atom... use the 'wide' atom size */ url_fskip(pb, atom.size - 4); retur... | 6,883 |
1 | static void net_socket_send(void *opaque) { NetSocketState *s = opaque; int l, size, err; uint8_t buf1[4096]; const uint8_t *buf; size = recv(s->fd, buf1, sizeof(buf1), 0); if (size < 0) { err = socket_error(); if (err != EWOULDBLOCK) goto eoc; } else if (size == 0) { /* end of connection */ eoc: qemu_set_fd_handler(s-... | 6,884 |
1 | static void stellaris_enet_write(void *opaque, hwaddr offset, uint64_t value, unsigned size) { stellaris_enet_state *s = (stellaris_enet_state *)opaque; switch (offset) { case 0x00: /* IACK */ s->ris &= ~value; DPRINTF("IRQ ack %02x/%02x\n", value, s->ris); stellaris_enet_update(s); /* Clearing TXER also resets the TX ... | 6,885 |
0 | void *av_malloc(unsigned int size) { void *ptr; #if defined (HAVE_MEMALIGN) ptr = memalign(16,size); /* Why 64? Indeed, we should align it: on 4 for 386 on 16 for 486 on 32 for 586, PPro - k6-III on 64 for K7 (maybe for P3 too). Because L1 and L2 caches are aligned on those values. But I don't want to code such logic h... | 6,887 |
1 | static int posix_aio_process_queue(void *opaque) { PosixAioState *s = opaque; struct qemu_paiocb *acb, **pacb; int ret; int result = 0; for(;;) { pacb = &s->first_aio; for(;;) { acb = *pacb; if (!acb) return result; ret = qemu_paio_error(acb); if (ret == ECANCELED) { /* remove the request */ *pacb = acb->next; qemu_aio... | 6,888 |
1 | static int protocol_client_auth(VncState *vs, uint8_t *data, size_t len) { /* We only advertise 1 auth scheme at a time, so client * must pick the one we sent. Verify this */ if (data[0] != vs->auth) { /* Reject auth */ VNC_DEBUG("Reject auth %d because it didn't match advertized\n", (int)data[0]); vnc_write_u32(vs, 1)... | 6,889 |
1 | static int ehci_process_itd(EHCIState *ehci, EHCIitd *itd, uint32_t addr) { USBDevice *dev; USBEndpoint *ep; uint32_t i, len, pid, dir, devaddr, endp; uint32_t pg, off, ptr1, ptr2, max, mult; ehci->periodic_sched_active = PERIODIC_ACTIVE; dir =(itd->bufptr[1] & ITD_BUFPTR_DIRECTION); devaddr = get_field(itd->bufptr[0],... | 6,890 |
1 | void *g_try_malloc0(size_t n_bytes) { __coverity_negative_sink__(n_bytes); return calloc(1, n_bytes == 0 ? 1 : n_bytes); } | 6,892 |
1 | void gdb_register_coprocessor(CPUState * env, gdb_reg_cb get_reg, gdb_reg_cb set_reg, int num_regs, const char *xml, int g_pos) { GDBRegisterState *s; GDBRegisterState **p; static int last_reg = NUM_CORE_REGS; s = (GDBRegisterState *)g_malloc0(sizeof(GDBRegisterState)); s->base_reg = last_reg; s->num_regs = num_regs; s... | 6,893 |
1 | static int check_refcounts_l1(BlockDriverState *bs, uint16_t *refcount_table, int refcount_table_size, int64_t l1_table_offset, int l1_size, int check_copied) { BDRVQcowState *s = bs->opaque; uint64_t *l1_table, l2_offset, l1_size2; int i, refcount, ret; int errors = 0; l1_size2 = l1_size * sizeof(uint64_t); /* Mark L1... | 6,894 |
1 | static int alloc_refcount_block(BlockDriverState *bs, int64_t cluster_index, void **refcount_block) { BDRVQcow2State *s = bs->opaque; unsigned int refcount_table_index; int ret; BLKDBG_EVENT(bs->file, BLKDBG_REFBLOCK_ALLOC); /* Find the refcount block for the given cluster */ refcount_table_index = cluster_index >> s->... | 6,895 |
1 | void ppc6xx_irq_init (CPUState *env) { env->irq_inputs = (void **)qemu_allocate_irqs(&ppc6xx_set_irq, env, 6); } | 6,896 |
1 | static void coroutine_fn v9fs_create(void *opaque) { int32_t fid; int err = 0; size_t offset = 7; V9fsFidState *fidp; V9fsQID qid; int32_t perm; int8_t mode; V9fsPath path; struct stat stbuf; V9fsString name; V9fsString extension; int iounit; V9fsPDU *pdu = opaque; v9fs_path_init(&path); v9fs_string_init(&name); v9fs_s... | 6,897 |
1 | static int copy_cell(Indeo3DecodeContext *ctx, Plane *plane, Cell *cell) { int h, w, mv_x, mv_y, offset, offset_dst; uint8_t *src, *dst; /* setup output and reference pointers */ offset_dst = (cell->ypos << 2) * plane->pitch + (cell->xpos << 2); dst = plane->pixels[ctx->buf_sel] + offset_dst; mv_y = cell->mv_ptr[0]; mv... | 6,898 |
1 | static int serial_can_receive(SerialState *s) { return !(s->lsr & UART_LSR_DR); } | 6,899 |
1 | static void mov_parse_stsd_subtitle(MOVContext *c, AVIOContext *pb, AVStream *st, MOVStreamContext *sc, int size) { // ttxt stsd contains display flags, justification, background // color, fonts, and default styles, so fake an atom to read it MOVAtom fake_atom = { .size = size }; // mp4s contains a regular esds atom if... | 6,900 |
1 | static void virgl_cmd_get_capset_info(VirtIOGPU *g, struct virtio_gpu_ctrl_command *cmd) { struct virtio_gpu_get_capset_info info; struct virtio_gpu_resp_capset_info resp; VIRTIO_GPU_FILL_CMD(info); if (info.capset_index == 0) { resp.capset_id = VIRTIO_GPU_CAPSET_VIRGL; virgl_renderer_get_cap_set(resp.capset_id, &resp.... | 6,901 |
1 | static int virtio_rng_pci_init(VirtIOPCIProxy *vpci_dev) { VirtIORngPCI *vrng = VIRTIO_RNG_PCI(vpci_dev); DeviceState *vdev = DEVICE(&vrng->vdev); qdev_set_parent_bus(vdev, BUS(&vpci_dev->bus)); if (qdev_init(vdev) < 0) { return -1; } object_property_set_link(OBJECT(vrng), OBJECT(vrng->vdev.conf.default_backend), "rng"... | 6,902 |
1 | static int usb_linux_update_endp_table(USBHostDevice *s) { uint8_t *descriptors; uint8_t devep, type, configuration, alt_interface; struct usb_ctrltransfer ct; int interface, ret, length, i; ct.bRequestType = USB_DIR_IN; ct.bRequest = USB_REQ_GET_CONFIGURATION; ct.wValue = 0; ct.wIndex = 0; ct.wLength = 1; ct.data = &c... | 6,903 |
1 | AVStream *add_av_stream1(FFStream *stream, AVCodecContext *codec) { AVStream *fst; fst = av_mallocz(sizeof(AVStream)); if (!fst) return NULL; fst->priv_data = av_mallocz(sizeof(FeedData)); memcpy(&fst->codec, codec, sizeof(AVCodecContext)); stream->streams[stream->nb_streams++] = fst; return fst; } | 6,904 |
1 | static av_cold int ljpeg_encode_init(AVCodecContext *avctx) { LJpegEncContext *s = avctx->priv_data; if ((avctx->pix_fmt == AV_PIX_FMT_YUV420P || avctx->pix_fmt == AV_PIX_FMT_YUV422P || avctx->pix_fmt == AV_PIX_FMT_YUV444P || avctx->color_range == AVCOL_RANGE_MPEG) && avctx->strict_std_compliance > FF_COMPLIANCE_UNOFFI... | 6,905 |
1 | void net_host_device_remove(Monitor *mon, int vlan_id, const char *device) { VLANState *vlan; VLANClientState *vc; vlan = qemu_find_vlan(vlan_id); if (!vlan) { monitor_printf(mon, "can't find vlan %d\n", vlan_id); return; } for(vc = vlan->first_client; vc != NULL; vc = vc->next) if (!strcmp(vc->name, device)) break; if... | 6,906 |
1 | static inline PageDesc *page_find_alloc(target_ulong index) { PageDesc **lp, *p; #if TARGET_LONG_BITS > 32 /* Host memory outside guest VM. For 32-bit targets we have already excluded high addresses. */ if (index > ((target_ulong)L2_SIZE * L1_SIZE)) return NULL; #endif lp = &l1_map[index >> L2_BITS]; p = *lp; if (!p) {... | 6,907 |
0 | static int asf_write_trailer(AVFormatContext *s) { ASFContext *asf = s->priv_data; int64_t file_size, data_size; /* flush the current packet */ if (asf->pb.buf_ptr > asf->pb.buffer) flush_packet(s); /* write index */ data_size = avio_tell(s->pb); if ((!asf->is_streamed) && (asf->nb_index_count != 0)) asf_write_index(s,... | 6,908 |
0 | static void dvbsub_parse_display_definition_segment(AVCodecContext *avctx, const uint8_t *buf, int buf_size) { DVBSubContext *ctx = avctx->priv_data; DVBSubDisplayDefinition *display_def = ctx->display_definition; int dds_version, info_byte; if (buf_size < 5) return; info_byte = bytestream_get_byte(&buf); dds_version =... | 6,909 |
0 | static int synchronize_audio(VideoState *is, int nb_samples) { int wanted_nb_samples = nb_samples; /* if not master, then we try to remove or add samples to correct the clock */ if (get_master_sync_type(is) != AV_SYNC_AUDIO_MASTER) { double diff, avg_diff; int min_nb_samples, max_nb_samples; diff = get_audio_clock(is) ... | 6,910 |
0 | int ff_alloc_packet(AVPacket *avpkt, int size) { if (size > INT_MAX - FF_INPUT_BUFFER_PADDING_SIZE) return AVERROR(EINVAL); if (avpkt->data) { void *destruct = avpkt->destruct; if (avpkt->size < size) return AVERROR(EINVAL); av_init_packet(avpkt); avpkt->destruct = destruct; avpkt->size = size; return 0; } else { retur... | 6,911 |
0 | static int ast_write_trailer(AVFormatContext *s) { AVIOContext *pb = s->pb; ASTMuxContext *ast = s->priv_data; AVCodecContext *enc = s->streams[0]->codec; int64_t file_size = avio_tell(pb); int64_t samples = (file_size - 64 - (32 * enc->frame_number)) / enc->block_align; /* PCM_S16BE_PLANAR */ av_log(s, AV_LOG_DEBUG, "... | 6,912 |
0 | int ff_h264_field_end(H264Context *h, H264SliceContext *sl, int in_setup) { AVCodecContext *const avctx = h->avctx; int err = 0; h->mb_y = 0; if (!in_setup && !h->droppable) ff_thread_report_progress(&h->cur_pic_ptr->tf, INT_MAX, h->picture_structure == PICT_BOTTOM_FIELD); if (in_setup || !(avctx->active_thread_type & ... | 6,913 |
0 | static int audio_read_packet(AVFormatContext *s1, AVPacket *pkt) { AlsaData *s = s1->priv_data; AVStream *st = s1->streams[0]; int res; snd_htimestamp_t timestamp; snd_pcm_uframes_t ts_delay; if (av_new_packet(pkt, s->period_size) < 0) { return AVERROR(EIO); } while ((res = snd_pcm_readi(s->h, pkt->data, pkt->size / s-... | 6,914 |
0 | static void RENAME(uyvytoyuv422)(uint8_t *ydst, uint8_t *udst, uint8_t *vdst, const uint8_t *src, long width, long height, long lumStride, long chromStride, long srcStride) { long y; const long chromWidth= -((-width)>>1); for (y=0; y<height; y++) { RENAME(extract_even)(src+1, ydst, width); RENAME(extract_even2)(src, ud... | 6,915 |
0 | static int mpc8_decode_init(AVCodecContext * avctx) { int i; MPCContext *c = avctx->priv_data; GetBitContext gb; static int vlc_inited = 0; if(avctx->extradata_size < 2){ av_log(avctx, AV_LOG_ERROR, "Too small extradata size (%i)!\n", avctx->extradata_size); return -1; } memset(c->oldDSCF, 0, sizeof(c->oldDSCF)); av_in... | 6,916 |
0 | static int raw_pwrite_aligned(BlockDriverState *bs, int64_t offset, const uint8_t *buf, int count) { BDRVRawState *s = bs->opaque; int ret; ret = fd_open(bs); if (ret < 0) return -errno; ret = pwrite(s->fd, buf, count, offset); if (ret == count) goto label__raw_write__success; DEBUG_BLOCK_PRINT("raw_pwrite(%d:%s, %" PR... | 6,918 |
0 | void bdrv_release_dirty_bitmap(BlockDriverState *bs, BdrvDirtyBitmap *bitmap) { BdrvDirtyBitmap *bm, *next; QLIST_FOREACH_SAFE(bm, &bs->dirty_bitmaps, list, next) { if (bm == bitmap) { assert(!bdrv_dirty_bitmap_frozen(bm)); QLIST_REMOVE(bitmap, list); hbitmap_free(bitmap->bitmap); g_free(bitmap->name); g_free(bitmap); ... | 6,920 |
0 | void memory_region_init_ram(MemoryRegion *mr, Object *owner, const char *name, uint64_t size) { memory_region_init(mr, owner, name, size); mr->ram = true; mr->terminates = true; mr->destructor = memory_region_destructor_ram; mr->ram_addr = qemu_ram_alloc(size, mr); } | 6,922 |
0 | int ff_h264_decode_slice_header(H264Context *h, H264Context *h0) { unsigned int first_mb_in_slice; unsigned int pps_id; int ret; unsigned int slice_type, tmp, i, j; int last_pic_structure, last_pic_droppable; int must_reinit; int needs_reinit = 0; int field_pic_flag, bottom_field_flag; h->qpel_put = h->h264qpel.put_h26... | 6,923 |
0 | static void virtio_scsi_request_cancelled(SCSIRequest *r) { VirtIOSCSIReq *req = r->hba_private; if (!req) { return; } if (req->dev->resetting) { req->resp.cmd->response = VIRTIO_SCSI_S_RESET; } else { req->resp.cmd->response = VIRTIO_SCSI_S_ABORTED; } virtio_scsi_complete_cmd_req(req); } | 6,924 |
0 | void HELPER(access_check_cp_reg)(CPUARMState *env, void *rip, uint32_t syndrome) { const ARMCPRegInfo *ri = rip; int target_el; if (arm_feature(env, ARM_FEATURE_XSCALE) && ri->cp < 14 && extract32(env->cp15.c15_cpar, ri->cp, 1) == 0) { raise_exception(env, EXCP_UDEF, syndrome, exception_target_el(env)); } if (!ri->acce... | 6,925 |
0 | static void notify_event_cb(void *opaque) { /* No need to do anything; this bottom half is only used to * kick the kernel out of ppoll/poll/WaitForMultipleObjects. */ } | 6,926 |
0 | static int m25p80_init(SSISlave *ss) { DriveInfo *dinfo; Flash *s = M25P80(ss); M25P80Class *mc = M25P80_GET_CLASS(s); s->pi = mc->pi; s->size = s->pi->sector_size * s->pi->n_sectors; s->dirty_page = -1; s->storage = qemu_blockalign(s->bdrv, s->size); dinfo = drive_get_next(IF_MTD); if (dinfo) { DB_PRINT_L(0, "Binding ... | 6,928 |
0 | static void sdl_mouse_warp(int x, int y, int on) { if (on) { if (!guest_cursor) sdl_show_cursor(); if (gui_grab || kbd_mouse_is_absolute() || absolute_enabled) { SDL_SetCursor(guest_sprite); SDL_WarpMouse(x, y); } } else if (gui_grab) sdl_hide_cursor(); guest_cursor = on; guest_x = x, guest_y = y; } | 6,929 |
0 | static int qcow2_cache_do_get(BlockDriverState *bs, Qcow2Cache *c, uint64_t offset, void **table, bool read_from_disk) { BDRVQcowState *s = bs->opaque; int i; int ret; int lookup_index; uint64_t min_lru_counter = UINT64_MAX; int min_lru_index = -1; trace_qcow2_cache_get(qemu_coroutine_self(), c == s->l2_table_cache, of... | 6,930 |
0 | int net_init_socket(QemuOpts *opts, Monitor *mon, const char *name, VLANState *vlan) { if (qemu_opt_get(opts, "fd")) { int fd; if (qemu_opt_get(opts, "listen") || qemu_opt_get(opts, "connect") || qemu_opt_get(opts, "mcast")) { qemu_error("listen=, connect= and mcast= is invalid with fd=\n"); return -1; } fd = net_handl... | 6,932 |
0 | int ff_init_filters(SwsContext * c) { int i; int index; int num_ydesc; int num_cdesc; int num_vdesc = isPlanarYUV(c->dstFormat) && !isGray(c->dstFormat) ? 2 : 1; int need_lum_conv = c->lumToYV12 || c->readLumPlanar || c->alpToYV12 || c->readAlpPlanar; int need_chr_conv = c->chrToYV12 || c->readChrPlanar; int srcIdx, ds... | 6,934 |
0 | void commit_start(const char *job_id, BlockDriverState *bs, BlockDriverState *base, BlockDriverState *top, int64_t speed, BlockdevOnError on_error, const char *backing_file_str, Error **errp) { CommitBlockJob *s; BlockReopenQueue *reopen_queue = NULL; int orig_overlay_flags; int orig_base_flags; BlockDriverState *iter;... | 6,936 |
0 | int load_elf(const char *filename, int64_t virt_to_phys_addend, uint64_t *pentry) { int fd, data_order, must_swab, ret; uint8_t e_ident[EI_NIDENT]; fd = open(filename, O_RDONLY | O_BINARY); if (fd < 0) { perror(filename); return -1; } if (read(fd, e_ident, sizeof(e_ident)) != sizeof(e_ident)) goto fail; if (e_ident[0] ... | 6,937 |
0 | qemu_inject_x86_mce(CPUState *cenv, int bank, uint64_t status, uint64_t mcg_status, uint64_t addr, uint64_t misc) { uint64_t mcg_cap = cenv->mcg_cap; uint64_t *banks = cenv->mce_banks; /* * if MSR_MCG_CTL is not all 1s, the uncorrected error * reporting is disabled */ if ((status & MCI_STATUS_UC) && (mcg_cap & MCG_CTL_... | 6,938 |
0 | static USBDevice *usb_msd_init(const char *filename) { static int nr=0; char id[8]; QemuOpts *opts; DriveInfo *dinfo; USBDevice *dev; int fatal_error; const char *p1; char fmt[32]; /* parse -usbdevice disk: syntax into drive opts */ snprintf(id, sizeof(id), "usb%d", nr++); opts = qemu_opts_create(&qemu_drive_opts, id, ... | 6,939 |
0 | static inline void gen_evmergelo(DisasContext *ctx) { if (unlikely(!ctx->spe_enabled)) { gen_exception(ctx, POWERPC_EXCP_APU); return; } #if defined(TARGET_PPC64) TCGv t0 = tcg_temp_new(); TCGv t1 = tcg_temp_new(); tcg_gen_ext32u_tl(t0, cpu_gpr[rB(ctx->opcode)]); tcg_gen_shli_tl(t1, cpu_gpr[rA(ctx->opcode)], 32); tcg_g... | 6,940 |
0 | static int64_t cache_seek(URLContext *h, int64_t pos, int whence) { Context *c= h->priv_data; if (whence == AVSEEK_SIZE) { pos= ffurl_seek(c->inner, pos, whence); if(pos <= 0){ pos= ffurl_seek(c->inner, -1, SEEK_END); ffurl_seek(c->inner, c->end, SEEK_SET); if(pos <= 0) return c->end; } return pos; } pos= lseek(c->fd, ... | 6,942 |
0 | static int sonic_encode_frame(AVCodecContext *avctx, AVPacket *avpkt, const AVFrame *frame, int *got_packet_ptr) { SonicContext *s = avctx->priv_data; RangeCoder c; int i, j, ch, quant = 0, x = 0; int ret; const short *samples = (const int16_t*)frame->data[0]; uint8_t state[32]; if ((ret = ff_alloc_packet2(avctx, avpkt... | 6,943 |
1 | int tpm_register_driver(const TPMDriverOps *tdo) { int i; for (i = 0; i < TPM_MAX_DRIVERS; i++) { if (!be_drivers[i]) { be_drivers[i] = tdo; return 0; } } error_report("Could not register TPM driver"); return 1; } | 6,944 |
1 | static void xilinx_axidma_init(Object *obj) { XilinxAXIDMA *s = XILINX_AXI_DMA(obj); SysBusDevice *sbd = SYS_BUS_DEVICE(obj); object_property_add_link(obj, "axistream-connected", TYPE_STREAM_SLAVE, (Object **)&s->tx_data_dev, &error_abort); object_property_add_link(obj, "axistream-control-connected", TYPE_STREAM_SLAVE,... | 6,945 |
1 | static int count_contiguous_free_clusters(int nb_clusters, uint64_t *l2_table) { int i; for (i = 0; i < nb_clusters; i++) { int type = qcow2_get_cluster_type(be64_to_cpu(l2_table[i])); if (type != QCOW2_CLUSTER_UNALLOCATED) { break; } } return i; } | 6,947 |
1 | void ide_init_ioport(IDEBus *bus, ISADevice *dev, int iobase, int iobase2) { /* ??? Assume only ISA and PCI configurations, and that the PCI-ISA bridge has been setup properly to always register with ISA. */ isa_register_portio_list(dev, iobase, ide_portio_list, bus, "ide"); if (iobase2) { isa_register_portio_list(dev,... | 6,948 |
1 | static int read_huffman_tables(HYuvContext *s, uint8_t *src, int length){ GetBitContext gb; int i; init_get_bits(&gb, src, length*8); for(i=0; i<3; i++){ read_len_table(s->len[i], &gb); if(generate_bits_table(s->bits[i], s->len[i])<0){ return -1; } #if 0 for(j=0; j<256; j++){ printf("%6X, %2d, %3d\n", s->bits[i][j], s-... | 6,949 |
1 | static int parse_bit(DeviceState *dev, Property *prop, const char *str) { if (!strcasecmp(str, "on")) bit_prop_set(dev, prop, true); else if (!strcasecmp(str, "off")) bit_prop_set(dev, prop, false); else return -EINVAL; return 0; } | 6,950 |
1 | int ff_hevc_cu_qp_delta_abs(HEVCContext *s) { int prefix_val = 0; int suffix_val = 0; int inc = 0; while (prefix_val < 5 && GET_CABAC(elem_offset[CU_QP_DELTA] + inc)) { prefix_val++; inc = 1; } if (prefix_val >= 5) { int k = 0; while (k < CABAC_MAX_BIN && get_cabac_bypass(&s->HEVClc->cc)) { suffix_val += 1 << k; k++; }... | 6,952 |
1 | static inline void gdb_continue(GDBState *s) { #ifdef CONFIG_USER_ONLY s->running_state = 1; #else vm_start(); #endif } | 6,954 |
1 | av_cold int ff_nvenc_encode_close(AVCodecContext *avctx) { NVENCContext *ctx = avctx->priv_data; NV_ENCODE_API_FUNCTION_LIST *nv = &ctx->nvel.nvenc_funcs; int i; av_fifo_free(ctx->timestamps); av_fifo_free(ctx->pending); av_fifo_free(ctx->ready); if (ctx->in) { for (i = 0; i < ctx->nb_surfaces; ++i) { nv->nvEncDestroyI... | 6,955 |
1 | static void trigger_console_data(void *opaque, int n, int level) { sclp_service_interrupt(0); } | 6,957 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.