label
int64
0
1
func1
stringlengths
23
97k
id
int64
0
27.3k
0
static void channel_event(int event, SpiceChannelEventInfo *info) { SpiceServerInfo *server = g_malloc0(sizeof(*server)); SpiceChannel *client = g_malloc0(sizeof(*client)); server->base = g_malloc0(sizeof(*server->base)); client->base = g_malloc0(sizeof(*client->base)); /* * Spice server might have called us from spice...
17,978
0
static void qemu_chr_parse_spice_vmc(QemuOpts *opts, ChardevBackend *backend, Error **errp) { const char *name = qemu_opt_get(opts, "name"); if (name == NULL) { error_setg(errp, "chardev: spice channel: no name given"); return; } backend->u.spicevmc = g_new0(ChardevSpiceChannel, 1); backend->u.spicevmc->type = g_strdup...
17,979
0
void msix_unuse_all_vectors(PCIDevice *dev) { if (!(dev->cap_present & QEMU_PCI_CAP_MSIX)) return; msix_free_irq_entries(dev); }
17,980
0
static void pc_system_flash_init(MemoryRegion *rom_memory) { int unit; DriveInfo *pflash_drv; BlockDriverState *bdrv; int64_t size; char *fatal_errmsg = NULL; hwaddr phys_addr = 0x100000000ULL; int sector_bits, sector_size; pflash_t *system_flash; MemoryRegion *flash_mem; char name[64]; sector_bits = 12; sector_size = ...
17,982
1
static int load_textfile(AVFilterContext *ctx) { DrawTextContext *s = ctx->priv; int err; uint8_t *textbuf; size_t textbuf_size; if ((err = av_file_map(s->textfile, &textbuf, &textbuf_size, 0, ctx)) < 0) { av_log(ctx, AV_LOG_ERROR, "The text file '%s' could not be read or is empty\n", s->textfile); return err; } if (!(...
17,983
1
static int ftp_send_command(FTPContext *s, const char *command, const int response_codes[], char **response) { int err; ff_dlog(s, "%s", command); if (response) *response = NULL; if ((err = ffurl_write(s->conn_control, command, strlen(command))) < 0) return err; if (!err) return -1; /* return status */ if (response_cod...
17,985
1
static void sun4c_hw_init(const struct hwdef *hwdef, ram_addr_t RAM_size, const char *boot_device, DisplayState *ds, const char *kernel_filename, const char *kernel_cmdline, const char *initrd_filename, const char *cpu_model) { CPUState *env; unsigned int i; void *iommu, *espdma, *ledma, *main_esp, *nvram; qemu_irq *cp...
17,987
1
static void pflash_cfi01_realize(DeviceState *dev, Error **errp) { pflash_t *pfl = CFI_PFLASH01(dev); uint64_t total_len; int ret; uint64_t blocks_per_device, device_len; int num_devices; Error *local_err = NULL; total_len = pfl->sector_len * pfl->nb_blocs; /* These are only used to expose the parameters of each device...
17,988
1
static int vaapi_mpeg2_start_frame(AVCodecContext *avctx, av_unused const uint8_t *buffer, av_unused uint32_t size) { struct MpegEncContext * const s = avctx->priv_data; struct vaapi_context * const vactx = avctx->hwaccel_context; VAPictureParameterBufferMPEG2 *pic_param; VAIQMatrixBufferMPEG2 *iq_matrix; int i; av_dlo...
17,990
1
int qemu_config_parse(FILE *fp, QemuOptsList **lists, const char *fname) { char line[1024], group[64], id[64], arg[64], value[1024]; Location loc; QemuOptsList *list = NULL; QemuOpts *opts = NULL; int res = -1, lno = 0; loc_push_none(&loc); while (fgets(line, sizeof(line), fp) != NULL) { loc_set_file(fname, ++lno); if ...
17,991
1
static int udp_socket_create(UDPContext *s, struct sockaddr_storage *addr, socklen_t *addr_len, const char *localaddr) { int udp_fd = -1; struct addrinfo *res0 = NULL, *res = NULL; int family = AF_UNSPEC; if (((struct sockaddr *) &s->dest_addr)->sa_family) family = ((struct sockaddr *) &s->dest_addr)->sa_family; res0 =...
17,992
1
static inline void RENAME(yuv2yuv1)(int16_t *lumSrc, int16_t *chrSrc, uint8_t *dest, uint8_t *uDest, uint8_t *vDest, long dstW, long chrDstW) { #ifdef HAVE_MMX if (uDest) { asm volatile( YSCALEYUV2YV121 :: "r" (chrSrc + chrDstW), "r" (uDest + chrDstW), "g" (-chrDstW) : "%"REG_a ); asm volatile( YSCALEYUV2YV121 :: "r" (...
17,994
1
static ssize_t qsb_grow(QEMUSizedBuffer *qsb, size_t new_size) { size_t needed_chunks, i; if (qsb->size < new_size) { struct iovec *new_iov; size_t size_diff = new_size - qsb->size; size_t chunk_size = (size_diff > QSB_MAX_CHUNK_SIZE) ? QSB_MAX_CHUNK_SIZE : QSB_CHUNK_SIZE; needed_chunks = DIV_ROUND_UP(size_diff, chunk_...
17,995
1
vmxnet3_init_msix(VMXNET3State *s) { PCIDevice *d = PCI_DEVICE(s); int res = msix_init(d, VMXNET3_MAX_INTRS, &s->msix_bar, VMXNET3_MSIX_BAR_IDX, VMXNET3_OFF_MSIX_TABLE, &s->msix_bar, VMXNET3_MSIX_BAR_IDX, VMXNET3_OFF_MSIX_PBA(s), VMXNET3_MSIX_OFFSET(s)); if (0 > res) { VMW_WRPRN("Failed to initialize MSI-X, error %d", ...
17,996
0
static int build_feed_streams(void) { FFServerStream *stream, *feed; int i; /* gather all streams */ for(stream = config.first_stream; stream; stream = stream->next) { feed = stream->feed; if (!feed) continue; if (stream->is_feed) { for(i=0;i<stream->nb_streams;i++) stream->feed_streams[i] = i; } else { /* we handle a ...
17,997
0
static always_inline void dv_encode_ac(EncBlockInfo* bi, PutBitContext* pb_pool, int pb_size) { int run; int bits_left; PutBitContext* pb = pb_pool; int size = bi->partial_bit_count; uint32_t vlc = bi->partial_bit_buffer; bi->partial_bit_count = bi->partial_bit_buffer = 0; vlc_loop: /* Find suitable storage space */ fo...
17,999
0
static uint64_t mipsnet_ioport_read(void *opaque, target_phys_addr_t addr, unsigned int size) { MIPSnetState *s = opaque; int ret = 0; addr &= 0x3f; switch (addr) { case MIPSNET_DEV_ID: ret = be32_to_cpu(0x4d495053); /* MIPS */ break; case MIPSNET_DEV_ID + 4: ret = be32_to_cpu(0x4e455430); /* NET0 */ break; case MIPSNE...
18,000
0
static uint32_t get_generic_seed(void) { uint8_t tmp[120]; struct AVSHA *sha = (void*)tmp; clock_t last_t = 0; static uint64_t i = 0; static uint32_t buffer[512] = { 0 }; unsigned char digest[20]; uint64_t last_i = i; av_assert0(sizeof(tmp) >= av_sha_size); if(TEST){ memset(buffer, 0, sizeof(buffer)); last_i = i = 0; }...
18,001
0
int nbd_receive_negotiate(QIOChannel *ioc, const char *name, uint32_t *flags, off_t *size, Error **errp) { char buf[256]; uint64_t magic, s; int rc; TRACE("Receiving negotiation."); rc = -EINVAL; if (read_sync(ioc, buf, 8) != 8) { error_setg(errp, "Failed to read data"); goto fail; } buf[8] = '\0'; if (strlen(buf) == 0...
18,002
0
static inline void gen_op_evsrws(TCGv_i32 ret, TCGv_i32 arg1, TCGv_i32 arg2) { TCGv_i32 t0; int l1, l2; l1 = gen_new_label(); l2 = gen_new_label(); t0 = tcg_temp_local_new_i32(); /* No error here: 6 bits are used */ tcg_gen_andi_i32(t0, arg2, 0x3F); tcg_gen_brcondi_i32(TCG_COND_GE, t0, 32, l1); tcg_gen_sar_i32(ret, arg...
18,004
0
void hd_geometry_guess(BlockDriverState *bs, uint32_t *pcyls, uint32_t *pheads, uint32_t *psecs, int *ptrans) { int cylinders, heads, secs, translation; if (guess_disk_lchs(bs, &cylinders, &heads, &secs) < 0) { /* no LCHS guess: use a standard physical disk geometry */ guess_chs_for_size(bs, pcyls, pheads, psecs); tran...
18,006
0
static MemoryRegion *acpi_add_rom_blob(AcpiBuildState *build_state, GArray *blob, const char *name, uint64_t max_size) { return rom_add_blob(name, blob->data, acpi_data_len(blob), max_size, -1, name, virt_acpi_build_update, build_state); }
18,007
0
static int versatile_pci_host_init(PCIDevice *d) { pci_config_set_vendor_id(d->config, PCI_VENDOR_ID_XILINX); /* Both boards have the same device ID. Oh well. */ pci_config_set_device_id(d->config, PCI_DEVICE_ID_XILINX_XC2VP30); pci_set_word(d->config + PCI_STATUS, PCI_STATUS_66MHZ | PCI_STATUS_DEVSEL_MEDIUM); pci_conf...
18,008
0
vcard_emul_replay_insertion_events(void) { VReaderListEntry *current_entry; VReaderListEntry *next_entry = NULL; VReaderList *list = vreader_get_reader_list(); for (current_entry = vreader_list_get_first(list); current_entry; current_entry = next_entry) { VReader *vreader = vreader_list_get_reader(current_entry); next_...
18,009
0
static int read_config(BDRVBlkdebugState *s, const char *filename, Error **errp) { FILE *f; int ret; struct add_rule_data d; f = fopen(filename, "r"); if (f == NULL) { error_setg_errno(errp, errno, "Could not read blkdebug config file"); return -errno; } ret = qemu_config_parse(f, config_groups, filename); if (ret < 0)...
18,010
0
static int vnc_update_client(VncState *vs, int has_dirty) { if (vs->need_update && vs->csock != -1) { VncDisplay *vd = vs->vd; int y; int n_rectangles; int saved_offset; int n; if (vs->output.offset && !vs->audio_cap && !vs->force_update) /* kernel send buffers are full -> drop frames to throttle */ return 0; if (!has_...
18,011
0
int ff_vorbiscomment_write(uint8_t **p, AVDictionary **m, const char *vendor_string) { bytestream_put_le32(p, strlen(vendor_string)); bytestream_put_buffer(p, vendor_string, strlen(vendor_string)); if (*m) { int count = av_dict_count(*m); AVDictionaryEntry *tag = NULL; bytestream_put_le32(p, count); while ((tag = av_di...
18,012
0
void qemu_input_event_send_key_qcode(QemuConsole *src, QKeyCode q, bool down) { KeyValue *key = g_new0(KeyValue, 1); key->kind = KEY_VALUE_KIND_QCODE; key->qcode = q; qemu_input_event_send_key(src, key, down); }
18,013
0
static void t_gen_lz_i32(TCGv d, TCGv x) { TCGv y, m, n; y = tcg_temp_new(TCG_TYPE_I32); m = tcg_temp_new(TCG_TYPE_I32); n = tcg_temp_new(TCG_TYPE_I32); /* y = -(x >> 16) */ tcg_gen_shri_i32(y, x, 16); tcg_gen_neg_i32(y, y); /* m = (y >> 16) & 16 */ tcg_gen_sari_i32(m, y, 16); tcg_gen_andi_i32(m, m, 16); /* n = 16 - m ...
18,014
0
static QVirtIOSCSI *qvirtio_scsi_pci_init(int slot) { QVirtIOSCSI *vs; QVirtioPCIDevice *dev; void *addr; int i; vs = g_new0(QVirtIOSCSI, 1); vs->alloc = pc_alloc_init(); vs->bus = qpci_init_pc(); dev = qvirtio_pci_device_find(vs->bus, QVIRTIO_SCSI_DEVICE_ID); vs->dev = (QVirtioDevice *)dev; g_assert(dev != NULL); g_as...
18,016
0
static MachineClass *machine_parse(const char *name) { MachineClass *mc = NULL; GSList *el, *machines = object_class_get_list(TYPE_MACHINE, false); if (name) { mc = find_machine(name); } if (mc) { return mc; } if (name && !is_help_option(name)) { error_report("Unsupported machine type"); error_printf("Use -machine help...
18,017
0
M48t59State *m48t59_init(qemu_irq IRQ, target_phys_addr_t mem_base, uint32_t io_base, uint16_t size, int model) { DeviceState *dev; SysBusDevice *s; M48t59SysBusState *d; M48t59State *state; dev = qdev_create(NULL, "m48t59"); qdev_prop_set_uint32(dev, "model", model); qdev_prop_set_uint32(dev, "size", size); qdev_prop_...
18,018
0
static void virtio_gpu_pci_realize(VirtIOPCIProxy *vpci_dev, Error **errp) { VirtIOGPUPCI *vgpu = VIRTIO_GPU_PCI(vpci_dev); VirtIOGPU *g = &vgpu->vdev; DeviceState *vdev = DEVICE(&vgpu->vdev); int i; qdev_set_parent_bus(vdev, BUS(&vpci_dev->bus)); /* force virtio-1.0 */ vpci_dev->flags &= ~VIRTIO_PCI_FLAG_DISABLE_MODER...
18,019
0
void program_interrupt(CPUS390XState *env, uint32_t code, int ilen) { S390CPU *cpu = s390_env_get_cpu(env); qemu_log_mask(CPU_LOG_INT, "program interrupt at %#" PRIx64 "\n", env->psw.addr); if (kvm_enabled()) { kvm_s390_program_interrupt(cpu, code); } else if (tcg_enabled()) { tcg_s390_program_interrupt(env, code, ilen...
18,021
0
static void address_space_update_ioeventfds(AddressSpace *as) { FlatView *view; FlatRange *fr; unsigned ioeventfd_nb = 0; MemoryRegionIoeventfd *ioeventfds = NULL; AddrRange tmp; unsigned i; view = as->current_map; FOR_EACH_FLAT_RANGE(fr, view) { for (i = 0; i < fr->mr->ioeventfd_nb; ++i) { tmp = addrrange_shift(fr->mr...
18,022
0
static int configure_filters(AVInputStream *ist, AVOutputStream *ost) { AVFilterContext *curr_filter; /** filter graph containing all filters including input & output */ AVCodecContext *codec = ost->st->codec; AVCodecContext *icodec = ist->st->codec; char args[255]; filt_graph_all = av_mallocz(sizeof(AVFilterGraph)); i...
18,023
0
void hmp_pcie_aer_inject_error(Monitor *mon, const QDict *qdict) { QObject *data; int devfn; if (do_pcie_aer_inject_error(mon, qdict, &data) < 0) { return; } assert(qobject_type(data) == QTYPE_QDICT); qdict = qobject_to_qdict(data); devfn = (int)qdict_get_int(qdict, "devfn"); monitor_printf(mon, "OK id: %s root bus: %s...
18,024
0
static void spapr_reallocate_hpt(sPAPRMachineState *spapr, int shift, Error **errp) { long rc; /* Clean up any HPT info from a previous boot */ g_free(spapr->htab); spapr->htab = NULL; spapr->htab_shift = 0; close_htab_fd(spapr); rc = kvmppc_reset_htab(shift); if (rc < 0) { /* kernel-side HPT needed, but couldn't alloc...
18,025
0
static av_cold int atrac3_decode_init(AVCodecContext *avctx) { int i, ret; int version, delay, samples_per_frame, frame_factor; const uint8_t *edata_ptr = avctx->extradata; ATRAC3Context *q = avctx->priv_data; if (avctx->channels <= 0 || avctx->channels > 2) { av_log(avctx, AV_LOG_ERROR, "Channel configuration error!\n...
18,026
0
static OutputStream *new_output_stream(OptionsContext *o, AVFormatContext *oc, enum AVMediaType type, int source_index) { OutputStream *ost; AVStream *st = avformat_new_stream(oc, NULL); int idx = oc->nb_streams - 1, ret = 0; const char *bsfs = NULL, *time_base = NULL; char *next, *codec_tag = NULL; double qscale = -1;...
18,027
1
static int flic_decode_frame_15_16BPP(AVCodecContext *avctx, void *data, int *data_size, uint8_t *buf, int buf_size) { /* Note, the only difference between the 15Bpp and 16Bpp */ /* Format is the pixel format, the packets are processed the same. */ FlicDecodeContext *s = (FlicDecodeContext *)avctx->priv_data; int strea...
18,029
1
static void *qemu_tcg_rr_cpu_thread_fn(void *arg) { CPUState *cpu = arg; rcu_register_thread(); qemu_thread_get_self(cpu->thread); CPU_FOREACH(cpu) { cpu->thread_id = qemu_get_thread_id(); cpu->created = true; cpu->can_do_io = 1; } qemu_cond_signal(&qemu_cpu_cond); /* wait for initial kick-off after machine start */ wh...
18,030
1
static int decode_slice_header(H264Context *h){ MpegEncContext * const s = &h->s; int first_mb_in_slice, pps_id; int num_ref_idx_active_override_flag; static const uint8_t slice_type_map[5]= {P_TYPE, B_TYPE, I_TYPE, SP_TYPE, SI_TYPE}; int slice_type; int default_ref_list_done = 0; s->current_picture.reference= h->nal_r...
18,031
1
static int output_packet(AVInputStream *ist, int ist_index, AVOutputStream **ost_table, int nb_ostreams, const AVPacket *pkt) { AVFormatContext *os; AVOutputStream *ost; uint8_t *ptr; int len, ret, i; uint8_t *data_buf; int data_size, got_picture; AVFrame picture; short samples[pkt && pkt->size > AVCODEC_MAX_AUDIO_FRAM...
18,033
0
static void yuv2yuv1_c(SwsContext *c, const int16_t *lumSrc, const int16_t *chrUSrc, const int16_t *chrVSrc, const int16_t *alpSrc, uint8_t *dest, uint8_t *uDest, uint8_t *vDest, uint8_t *aDest, int dstW, int chrDstW) { int i; for (i=0; i<dstW; i++) { int val= (lumSrc[i]+64)>>7; dest[i]= av_clip_uint8(val); } if (uDest...
18,035
0
static int teletext_close_decoder(AVCodecContext *avctx) { TeletextContext *ctx = avctx->priv_data; av_dlog(avctx, "lines_total=%u\n", ctx->lines_processed); while (ctx->nb_pages) subtitle_rect_free(&ctx->pages[--ctx->nb_pages].sub_rect); av_freep(&ctx->pages); vbi_decoder_delete(ctx->vbi); ctx->vbi = NULL; ctx->pts = ...
18,036
0
MigrationState *tcp_start_outgoing_migration(const char *host_port, int64_t bandwidth_limit, int async) { struct sockaddr_in addr; FdMigrationState *s; int ret; if (parse_host_port(&addr, host_port) < 0) return NULL; s = qemu_mallocz(sizeof(*s)); if (s == NULL) return NULL; s->mig_state.cancel = tcp_cancel; s->mig_stat...
18,037
0
static void tcx_screen_dump(void *opaque, const char *filename, bool cswitch, Error **errp) { TCXState *s = opaque; FILE *f; uint8_t *d, *d1, v; int ret, y, x; f = fopen(filename, "wb"); if (!f) { error_setg(errp, "failed to open file '%s': %s", filename, strerror(errno)); return; } ret = fprintf(f, "P6\n%d %d\n%d\n", ...
18,039
0
static void icp_pic_write(void *opaque, target_phys_addr_t offset, uint64_t value, unsigned size) { icp_pic_state *s = (icp_pic_state *)opaque; switch (offset >> 2) { case 2: /* IRQ_ENABLESET */ s->irq_enabled |= value; break; case 3: /* IRQ_ENABLECLR */ s->irq_enabled &= ~value; break; case 4: /* INT_SOFTSET */ if (va...
18,040
0
static void monitor_readline_cb(void *opaque, const char *input) { pstrcpy(monitor_readline_buf, monitor_readline_buf_size, input); monitor_readline_started = 0; }
18,041
0
static void fill_picture_parameters(const AVCodecContext *avctx, AVDXVAContext *ctx, const H264Context *h, DXVA_PicParams_H264 *pp) { const H264Picture *current_picture = h->cur_pic_ptr; const SPS *sps = h->ps.sps; const PPS *pps = h->ps.pps; int i, j; memset(pp, 0, sizeof(*pp)); /* Configure current picture */ fill_pi...
18,042
0
static int reg_irqs(CPUS390XState *env, S390PCIBusDevice *pbdev, ZpciFib fib) { int ret, len; ret = css_register_io_adapter(S390_PCIPT_ADAPTER, FIB_DATA_ISC(ldl_p(&fib.data)), true, false, &pbdev->routes.adapter.adapter_id); assert(ret == 0); pbdev->summary_ind = get_indicator(ldq_p(&fib.aisb), sizeof(uint64_t)); len =...
18,043
0
static void finish_write_pci_config(sPAPREnvironment *spapr, uint64_t buid, uint32_t addr, uint32_t size, uint32_t val, target_ulong rets) { PCIDevice *pci_dev; if ((size != 1) && (size != 2) && (size != 4)) { /* access must be 1, 2 or 4 bytes */ rtas_st(rets, 0, RTAS_OUT_HW_ERROR); return; } pci_dev = find_dev(spapr, ...
18,046
0
static int mpc8544_load_device_tree(CPUPPCState *env, target_phys_addr_t addr, target_phys_addr_t ramsize, target_phys_addr_t initrd_base, target_phys_addr_t initrd_size, const char *kernel_cmdline) { int ret = -1; uint32_t mem_reg_property[] = {0, cpu_to_be32(ramsize)}; int fdt_size; void *fdt; uint8_t hypercall[16]; ...
18,047
0
static void format_string(StringOutputVisitor *sov, Range *r, bool next, bool human) { if (r->end - r->begin > 1) { if (human) { g_string_append_printf(sov->string, "0x%" PRIx64 "-0x%" PRIx64, r->begin, r->end - 1); } else { g_string_append_printf(sov->string, "%" PRId64 "-%" PRId64, r->begin, r->end - 1); } } else { i...
18,048
0
static void v9fs_setattr(void *opaque) { int err = 0; int32_t fid; V9fsFidState *fidp; size_t offset = 7; V9fsIattr v9iattr; V9fsPDU *pdu = opaque; V9fsState *s = pdu->s; pdu_unmarshal(pdu, offset, "dI", &fid, &v9iattr); fidp = get_fid(pdu, fid); if (fidp == NULL) { err = -EINVAL; goto out_nofid; } if (v9iattr.valid & ...
18,049
0
static inline void iwmmxt_load_reg(TCGv var, int reg) { tcg_gen_ld_i64(var, cpu_env, offsetof(CPUState, iwmmxt.regs[reg])); }
18,050
0
static void process_command(GAState *s, QDict *req) { QObject *rsp = NULL; int ret; g_assert(req); g_debug("processing command"); rsp = qmp_dispatch(QOBJECT(req)); if (rsp) { ret = send_response(s, rsp); if (ret) { g_warning("error sending response: %s", strerror(ret)); } qobject_decref(rsp); } else { g_warning("error ...
18,051
0
static void qemu_file_set_error(QEMUFile *f, int ret) { if (f->last_error == 0) { f->last_error = ret; } }
18,052
0
int split_commandline(OptionParseContext *octx, int argc, char *argv[], const OptionDef *options, const OptionGroupDef *groups) { int optindex = 1; /* perform system-dependent conversions for arguments list */ prepare_app_arguments(&argc, &argv); init_parse_context(octx, groups); av_log(NULL, AV_LOG_DEBUG, "Splitting t...
18,053
0
static target_ulong h_get_term_char(CPUState *env, sPAPREnvironment *spapr, target_ulong opcode, target_ulong *args) { target_ulong reg = args[0]; target_ulong *len = args + 0; target_ulong *char0_7 = args + 1; target_ulong *char8_15 = args + 2; VIOsPAPRDevice *sdev = spapr_vio_find_by_reg(spapr->vio_bus, reg); uint8_t...
18,054
0
static void qdev_print_devinfo(ObjectClass *klass, void *opaque) { DeviceClass *dc; bool *show_no_user = opaque; dc = (DeviceClass *)object_class_dynamic_cast(klass, TYPE_DEVICE); if (!dc || (show_no_user && !*show_no_user && dc->no_user)) { return; } error_printf("name \"%s\"", object_class_get_name(klass)); if (dc->b...
18,055
0
static void keyword_literal(void) { QObject *obj; QBool *qbool; QObject *null; QString *str; obj = qobject_from_json("true"); g_assert(obj != NULL); g_assert(qobject_type(obj) == QTYPE_QBOOL); qbool = qobject_to_qbool(obj); g_assert(qbool_get_bool(qbool) == true); str = qobject_to_json(obj); g_assert(strcmp(qstring_get...
18,056
0
int audio_available(void) { #ifdef HAS_AUDIO return 1; #else return 0; #endif }
18,057
0
int kvm_irqchip_remove_irq_notifier(KVMState *s, EventNotifier *n, int virq) { return kvm_irqchip_remove_irqfd(s, event_notifier_get_fd(n), virq); }
18,058
0
static void vapic_reset(DeviceState *dev) { VAPICROMState *s = VAPIC(dev); if (s->state == VAPIC_ACTIVE) { s->state = VAPIC_STANDBY; } vapic_enable_tpr_reporting(false); }
18,059
0
static int kvm_get_sregs(CPUState *env) { struct kvm_sregs sregs; uint32_t hflags; int bit, i, ret; ret = kvm_vcpu_ioctl(env, KVM_GET_SREGS, &sregs); if (ret < 0) return ret; /* There can only be one pending IRQ set in the bitmap at a time, so try to find it and save its number instead (-1 for none). */ env->interrupt_...
18,060
0
static void tm_get(QEMUFile *f, struct tm *tm) { tm->tm_sec = qemu_get_be16(f); tm->tm_min = qemu_get_be16(f); tm->tm_hour = qemu_get_be16(f); tm->tm_mday = qemu_get_be16(f); tm->tm_min = qemu_get_be16(f); tm->tm_year = qemu_get_be16(f); }
18,062
0
int net_init_vhost_user(const NetClientOptions *opts, const char *name, NetClientState *peer) { return net_vhost_user_init(peer, "vhost_user", 0, 0, 0); }
18,063
0
static void net_socket_send(void *opaque) { NetSocketState *s = opaque; int size, err; unsigned l; uint8_t buf1[NET_BUFSIZE]; const uint8_t *buf; size = qemu_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: n...
18,065
0
void spapr_tce_table_enable(sPAPRTCETable *tcet, uint32_t page_shift, uint64_t bus_offset, uint32_t nb_table) { if (tcet->nb_table) { error_report("Warning: trying to enable already enabled TCE table"); return; } tcet->bus_offset = bus_offset; tcet->page_shift = page_shift; tcet->nb_table = nb_table; tcet->table = spap...
18,066
0
static void lcd_refresh(void *opaque) { musicpal_lcd_state *s = opaque; int x, y; for (x = 0; x < 128; x++) for (y = 0; y < 64; y++) if (s->video_ram[x + (y/8)*128] & (1 << (y % 8))) set_lcd_pixel(s, x, y, MP_LCD_TEXTCOLOR); else set_lcd_pixel(s, x, y, 0); dpy_update(s->ds, 0, 0, 128*3, 64*3); }
18,068
0
static inline int fs_channel(target_phys_addr_t addr) { /* Every channel has a 0x2000 ctrl register map. */ return addr >> 13; }
18,069
1
static int ffm_write_packet(AVFormatContext *s, int stream_index, UINT8 *buf, int size, int force_pts) { AVStream *st = s->streams[stream_index]; FFMStream *fst = st->priv_data; INT64 pts; UINT8 header[FRAME_HEADER_SIZE]; int duration; if (st->codec.codec_type == CODEC_TYPE_AUDIO) { duration = ((float)st->codec.frame_s...
18,070
1
static void v9fs_lock(void *opaque) { int8_t status; V9fsFlock *flock; size_t offset = 7; struct stat stbuf; V9fsFidState *fidp; int32_t fid, err = 0; V9fsPDU *pdu = opaque; V9fsState *s = pdu->s; flock = g_malloc(sizeof(*flock)); pdu_unmarshal(pdu, offset, "dbdqqds", &fid, &flock->type, &flock->flags, &flock->start, &...
18,071
1
static int get_last_needed_nal(H264Context *h) { int nals_needed = 0; int i; for (i = 0; i < h->pkt.nb_nals; i++) { H2645NAL *nal = &h->pkt.nals[i]; GetBitContext gb; /* packets can sometimes contain multiple PPS/SPS, * e.g. two PAFF field pictures in one packet, or a demuxer * which splits NALs strangely if so, when f...
18,073
1
int MPV_frame_start(MpegEncContext *s, AVCodecContext *avctx) { int i; Picture *pic; s->mb_skipped = 0; assert(s->last_picture_ptr==NULL || s->out_format != FMT_H264 || s->codec_id == CODEC_ID_SVQ3); /* mark&release old frames */ if (s->pict_type != AV_PICTURE_TYPE_B && s->last_picture_ptr && s->last_picture_ptr != s->...
18,075
1
long vnc_client_write_sasl(VncState *vs) { long ret; VNC_DEBUG("Write SASL: Pending output %p size %zd offset %zd " "Encoded: %p size %d offset %d\n", vs->output.buffer, vs->output.capacity, vs->output.offset, vs->sasl.encoded, vs->sasl.encodedLength, vs->sasl.encodedOffset); if (!vs->sasl.encoded) { int err; err = sas...
18,076
1
static void unassigned_mem_writeb(void *opaque, target_phys_addr_t addr, uint32_t val) { #ifdef DEBUG_UNASSIGNED printf("Unassigned mem write " TARGET_FMT_plx " = 0x%x\n", addr, val); #endif #if defined(TARGET_ALPHA) || defined(TARGET_SPARC) || defined(TARGET_MICROBLAZE) do_unassigned_access(addr, 1, 0, 0, 1); #endif }
18,079
1
static void virtio_mmio_class_init(ObjectClass *klass, void *data) { DeviceClass *dc = DEVICE_CLASS(klass); dc->realize = virtio_mmio_realizefn; dc->reset = virtio_mmio_reset; set_bit(DEVICE_CATEGORY_MISC, dc->categories); dc->props = virtio_mmio_properties; }
18,080
1
void prepare_play(void) { AVOutputFormat *ofmt; ofmt = guess_format("audio_device", NULL, NULL); if (!ofmt) { fprintf(stderr, "Could not find audio device\n"); exit(1); } opt_output_file(audio_device); }
18,082
1
static bool get_queued_page(RAMState *rs, PageSearchStatus *pss, ram_addr_t *ram_addr_abs) { RAMBlock *block; ram_addr_t offset; bool dirty; do { block = unqueue_page(rs, &offset, ram_addr_abs); /* * We're sending this page, and since it's postcopy nothing else * will dirty it, and we must make sure it doesn't get sent...
18,083
1
static int sp5x_decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; AVPacket avpkt_recoded; const int qscale = 5; const uint8_t *buf_ptr; uint8_t *recoded; int i = 0, j = 0; if (!avctx->width || !avctx->height) return -1; buf_p...
18,084
1
int kvm_arch_add_msi_route_post(struct kvm_irq_routing_entry *route, int vector, PCIDevice *dev) { static bool notify_list_inited = false; MSIRouteEntry *entry; if (!dev) { /* These are (possibly) IOAPIC routes only used for split * kernel irqchip mode, while what we are housekeeping are * PCI devices only. */ return 0...
18,085
1
static int vorbis_parse_setup_hdr_modes(vorbis_context *vc) { GetBitContext *gb=&vc->gb; uint_fast8_t i; vc->mode_count=get_bits(gb, 6)+1; vc->modes=av_mallocz(vc->mode_count * sizeof(vorbis_mode)); AV_DEBUG(" There are %d modes.\n", vc->mode_count); for(i=0;i<vc->mode_count;++i) { vorbis_mode *mode_setup=&vc->modes[i]...
18,086
1
static int smka_decode_frame(AVCodecContext *avctx, void *data, int *got_frame_ptr, AVPacket *avpkt) { AVFrame *frame = data; const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; GetBitContext gb; HuffContext h[4] = { { 0 } }; VLC vlc[4] = { { 0 } }; int16_t *samples; uint8_t *samples8; int val; int i, res, re...
18,087
1
static void ppc_hw_interrupt(CPUPPCState *env) { PowerPCCPU *cpu = ppc_env_get_cpu(env); int hdice; #if 0 CPUState *cs = CPU(cpu); qemu_log_mask(CPU_LOG_INT, "%s: %p pending %08x req %08x me %d ee %d\n", __func__, env, env->pending_interrupts, cs->interrupt_request, (int)msr_me, (int)msr_ee); #endif /* External reset *...
18,088
1
static void dct_error(const struct algo *dct, int test, int is_idct, int speed) { int it, i, scale; int err_inf, v; int64_t err2, ti, ti1, it1; int64_t sysErr[64], sysErrMax = 0; int maxout = 0; int blockSumErrMax = 0, blockSumErr; AVLFG prng; av_lfg_init(&prng, 1); err_inf = 0; err2 = 0; for (i = 0; i < 64; i++) sysEr...
18,089
1
static int msrle_decode_8_16_24_32(AVCodecContext *avctx, AVPicture *pic, int depth, GetByteContext *gb) { uint8_t *output, *output_end; int p1, p2, line=avctx->height - 1, pos=0, i; uint16_t pix16; uint32_t pix32; unsigned int width= FFABS(pic->linesize[0]) / (depth >> 3); output = pic->data[0] + (avctx->height - 1) *...
18,090
1
static void spapr_memory_unplug_request(HotplugHandler *hotplug_dev, DeviceState *dev, Error **errp) { sPAPRMachineState *spapr = SPAPR_MACHINE(hotplug_dev); Error *local_err = NULL; PCDIMMDevice *dimm = PC_DIMM(dev); PCDIMMDeviceClass *ddc = PC_DIMM_GET_CLASS(dimm); MemoryRegion *mr = ddc->get_memory_region(dimm); uin...
18,091
0
av_cold void ff_cavsdsp_init_x86(CAVSDSPContext *c, AVCodecContext *avctx) { int cpu_flags = av_get_cpu_flags(); cavsdsp_init_mmx(c, avctx); #if HAVE_AMD3DNOW_INLINE if (INLINE_AMD3DNOW(cpu_flags)) cavsdsp_init_3dnow(c, avctx); #endif /* HAVE_AMD3DNOW_INLINE */ #if HAVE_MMXEXT_INLINE if (INLINE_MMXEXT(cpu_flags)) { DSP...
18,092
0
static int finish_frame(AVCodecContext *avctx, AVFrame *pict) { RV34DecContext *r = avctx->priv_data; MpegEncContext *s = &r->s; int got_picture = 0, ret; ff_er_frame_end(&s->er); ff_mpv_frame_end(s); s->mb_num_left = 0; if (HAVE_THREADS && (s->avctx->active_thread_type & FF_THREAD_FRAME)) ff_thread_report_progress(&s-...
18,093
0
static void init_parse_context(OptionParseContext *octx, const OptionGroupDef *groups) { static const OptionGroupDef global_group = { "global" }; const OptionGroupDef *g = groups; int i; memset(octx, 0, sizeof(*octx)); while (g->name) g++; octx->nb_groups = g - groups; octx->groups = av_mallocz(sizeof(*octx->groups) * ...
18,094
0
void timerlist_notify(QEMUTimerList *timer_list) { if (timer_list->notify_cb) { timer_list->notify_cb(timer_list->notify_opaque); } else { qemu_notify_event(); } }
18,096
0
static char *isabus_get_fw_dev_path(DeviceState *dev) { ISADevice *d = (ISADevice*)dev; char path[40]; int off; off = snprintf(path, sizeof(path), "%s", qdev_fw_name(dev)); if (d->ioport_id) { snprintf(path + off, sizeof(path) - off, "@%04x", d->ioport_id); } return strdup(path); }
18,097
0
static void sigp_cpu_reset(void *arg) { CPUState *cpu = arg; S390CPUClass *scc = S390_CPU_GET_CLASS(cpu); cpu_synchronize_state(cpu); scc->cpu_reset(cpu); cpu_synchronize_post_reset(cpu); }
18,098
0
ram_addr_t qemu_ram_alloc_from_ptr(DeviceState *dev, const char *name, ram_addr_t size, void *host) { RAMBlock *new_block, *block; size = TARGET_PAGE_ALIGN(size); new_block = qemu_mallocz(sizeof(*new_block)); if (dev && dev->parent_bus && dev->parent_bus->info->get_dev_path) { char *id = dev->parent_bus->info->get_dev_...
18,099
0
static void usb_host_handle_control(USBDevice *udev, USBPacket *p, int request, int value, int index, int length, uint8_t *data) { USBHostDevice *s = USB_HOST_DEVICE(udev); USBHostRequest *r; int rc; trace_usb_host_req_control(s->bus_num, s->addr, p, request, value, index); if (s->dh == NULL) { p->status = USB_RET_NODE...
18,100
0
float32 helper_fabs_FT(float32 t0) { return float32_abs(t0); }
18,101
0
static int i440fx_pcihost_initfn(SysBusDevice *dev) { I440FXState *s = FROM_SYSBUS(I440FXState, dev); register_ioport_write(0xcf8, 4, 4, i440fx_addr_writel, s); register_ioport_read(0xcf8, 4, 4, i440fx_addr_readl, s); register_ioport_write(0xcfc, 4, 1, pci_host_data_writeb, s); register_ioport_write(0xcfc, 4, 2, pci_ho...
18,103