label int64 0 1 | func1 stringlengths 23 97k | id int64 0 27.3k |
|---|---|---|
1 | static int ptx_decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; const uint8_t *buf_end = avpkt->data + avpkt->size; PTXContext * const s = avctx->priv_data; AVFrame *picture = data; AVFrame * const p = &s->picture; unsigned int offset, w, h, y, stride,... | 16,181 |
1 | static int64_t alloc_clusters_noref(BlockDriverState *bs, uint64_t size) { BDRVQcowState *s = bs->opaque; uint64_t i, nb_clusters; int refcount; nb_clusters = size_to_clusters(s, size); retry: for(i = 0; i < nb_clusters; i++) { uint64_t next_cluster_index = s->free_cluster_index++; refcount = get_refcount(bs, next_clus... | 16,182 |
1 | static void vhost_region_del(MemoryListener *listener, MemoryRegionSection *section) { struct vhost_dev *dev = container_of(listener, struct vhost_dev, memory_listener); int i; vhost_set_memory(listener, section, false); for (i = 0; i < dev->n_mem_sections; ++i) { if (dev->mem_sections[i].offset_within_address_space ==... | 16,186 |
1 | static int wma_decode_block(WMADecodeContext *s) { int n, v, a, ch, code, bsize; int coef_nb_bits, total_gain, parse_exponents; DECLARE_ALIGNED_16(float, window[BLOCK_MAX_SIZE * 2]); int nb_coefs[MAX_CHANNELS]; float mdct_norm; #ifdef TRACE tprintf("***decode_block: %d:%d\n", s->frame_count - 1, s->block_num); #endif /... | 16,187 |
1 | static int swf_probe(AVProbeData *p) { if(p->buf_size < 15) return 0; /* check file header */ if ( AV_RB24(p->buf) != AV_RB24("CWS") && AV_RB24(p->buf) != AV_RB24("FWS")) return 0; if (p->buf[3] >= 20) return AVPROBE_SCORE_MAX / 4; return AVPROBE_SCORE_MAX; } | 16,188 |
1 | static void RENAME(yuv2yuyv422_1)(SwsContext *c, const int16_t *buf0, const int16_t *ubuf[2], const int16_t *bguf[2], const int16_t *abuf0, uint8_t *dest, int dstW, int uvalpha, int y) { const int16_t *ubuf0 = ubuf[0], *ubuf1 = ubuf[1]; const int16_t *buf1= buf0; //FIXME needed for RGB1/BGR1 if (uvalpha < 2048) { // no... | 16,189 |
1 | void command_loop(void) { int c, i, j = 0, done = 0, fetchable = 0, prompted = 0; char *input; char **v; const cmdinfo_t *ct; for (i = 0; !done && i < ncmdline; i++) { input = strdup(cmdline[i]); if (!input) { fprintf(stderr, _("cannot strdup command '%s': %s\n"), cmdline[i], strerror(errno)); exit(1); } v = breakline(... | 16,191 |
1 | static inline void gen_neon_mull(TCGv_i64 dest, TCGv a, TCGv b, int size, int u) { TCGv_i64 tmp; switch ((size << 1) | u) { case 0: gen_helper_neon_mull_s8(dest, a, b); break; case 1: gen_helper_neon_mull_u8(dest, a, b); break; case 2: gen_helper_neon_mull_s16(dest, a, b); break; case 3: gen_helper_neon_mull_u16(dest, ... | 16,192 |
1 | static void dummy_signal(int sig) { } | 16,193 |
1 | void mips_malta_init (ram_addr_t ram_size, const char *boot_device, const char *kernel_filename, const char *kernel_cmdline, const char *initrd_filename, const char *cpu_model) { char *filename; ram_addr_t ram_offset; ram_addr_t bios_offset; target_long bios_size; int64_t kernel_entry; PCIBus *pci_bus; ISADevice *isa_d... | 16,194 |
1 | void HELPER(set_cp15)(CPUState *env, uint32_t insn, uint32_t val) { int op1; int op2; int crm; op1 = (insn >> 21) & 7; op2 = (insn >> 5) & 7; crm = insn & 0xf; switch ((insn >> 16) & 0xf) { case 0: /* ID codes. */ if (arm_feature(env, ARM_FEATURE_XSCALE)) break; if (arm_feature(env, ARM_FEATURE_OMAPCP)) break; if (arm_... | 16,195 |
1 | S390CPU *s390x_new_cpu(const char *typename, uint32_t core_id, Error **errp) { S390CPU *cpu = S390_CPU(object_new(typename)); Error *err = NULL; object_property_set_int(OBJECT(cpu), core_id, "core-id", &err); if (err != NULL) { goto out; } object_property_set_bool(OBJECT(cpu), true, "realized", &err); out: if (err) { e... | 16,196 |
1 | static inline bool regime_is_user(CPUARMState *env, ARMMMUIdx mmu_idx) { switch (mmu_idx) { case ARMMMUIdx_S1SE0: case ARMMMUIdx_S1NSE0: return true; default: return false; case ARMMMUIdx_S12NSE0: case ARMMMUIdx_S12NSE1: g_assert_not_reached(); } } | 16,198 |
1 | int ff_fill_line_with_color(uint8_t *line[4], int pixel_step[4], int w, uint8_t dst_color[4], enum AVPixelFormat pix_fmt, uint8_t rgba_color[4], int *is_packed_rgba, uint8_t rgba_map_ptr[4]) { uint8_t rgba_map[4] = {0}; int i; const AVPixFmtDescriptor *pix_desc = av_pix_fmt_desc_get(pix_fmt); int hsub = pix_desc->log2_... | 16,199 |
1 | static int bfi_decode_frame(AVCodecContext * avctx, void *data, int *data_size, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; BFIContext *bfi = avctx->priv_data; uint8_t *dst = bfi->dst; uint8_t *src, *dst_offset, colour1, colour2; uint8_t *frame_end = bfi->dst + avctx->width * avctx-... | 16,200 |
1 | static void sysbus_device_class_init(ObjectClass *klass, void *data) { DeviceClass *k = DEVICE_CLASS(klass); k->init = sysbus_device_init; k->bus_type = TYPE_SYSTEM_BUS; } | 16,201 |
1 | static av_cold int g726_init(AVCodecContext * avctx) { G726Context* c = avctx->priv_data; unsigned int index= (avctx->bit_rate + avctx->sample_rate/2) / avctx->sample_rate - 2; if (avctx->bit_rate % avctx->sample_rate && avctx->codec->encode) { av_log(avctx, AV_LOG_ERROR, "Bitrate - Samplerate combination is invalid\n"... | 16,202 |
1 | static int yop_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt) { YopDecContext *s = avctx->priv_data; int tag, firstcolor, is_odd_frame; int ret, i, x, y; uint32_t *palette; if (s->frame.data[0]) avctx->release_buffer(avctx, &s->frame); ret = ff_get_buffer(avctx, &s->frame); if (ret < 0... | 16,206 |
1 | static int32_t scsi_send_command(SCSIDevice *d, uint32_t tag, uint8_t *buf, int lun) { SCSIDeviceState *s = d->state; uint64_t nb_sectors; uint32_t lba; uint32_t len; int cmdlen; int is_write; uint8_t command; uint8_t *outbuf; SCSIRequest *r; command = buf[0]; r = scsi_find_request(s, tag); if (r) { BADF("Tag 0x%x alre... | 16,208 |
1 | void cpu_dump_state (CPUCRISState *env, FILE *f, fprintf_function cpu_fprintf, int flags) { int i; uint32_t srs; if (!env || !f) return; cpu_fprintf(f, "PC=%x CCS=%x btaken=%d btarget=%x\n" "cc_op=%d cc_src=%d cc_dest=%d cc_result=%x cc_mask=%x\n", env->pc, env->pregs[PR_CCS], env->btaken, env->btarget, env->cc_op, env... | 16,209 |
1 | void ff_snow_horizontal_compose97i_sse2(IDWTELEM *b, int width){ const int w2= (width+1)>>1; // SSE2 code runs faster with pointers aligned on a 32-byte boundary. IDWTELEM temp_buf[(width>>1) + 4]; IDWTELEM * const temp = temp_buf + 4 - (((int)temp_buf & 0xF) >> 2); const int w_l= (width>>1); const int w_r= w2 - 1; int... | 16,210 |
1 | static int parse_meter(DBEContext *s) { if (s->meter_size) skip_input(s, s->key_present + s->meter_size + 1); return 0; } | 16,212 |
1 | static inline void gen_add_datah_offset(DisasContext *s, unsigned int insn, int extra, TCGv var) { int val, rm; TCGv offset; if (insn & (1 << 22)) { /* immediate */ val = (insn & 0xf) | ((insn >> 4) & 0xf0); if (!(insn & (1 << 23))) val = -val; val += extra; if (val != 0) tcg_gen_addi_i32(var, var, val); } else { /* re... | 16,213 |
1 | int kvm_cpu_exec(CPUState *env) { struct kvm_run *run = env->kvm_run; int ret; dprintf("kvm_cpu_exec()\n"); do { #ifndef CONFIG_IOTHREAD if (env->exit_request) { dprintf("interrupt exit requested\n"); ret = 0; break; } #endif if (env->kvm_vcpu_dirty) { kvm_arch_put_registers(env); env->kvm_vcpu_dirty = 0; } kvm_arch_pr... | 16,215 |
1 | static struct glfs *qemu_gluster_init(BlockdevOptionsGluster *gconf, const char *filename, QDict *options, Error **errp) { int ret; if (filename) { ret = qemu_gluster_parse_uri(gconf, filename); if (ret < 0) { error_setg(errp, "invalid URI"); error_append_hint(errp, "Usage: file=gluster[+transport]://" "[host[:port]]/v... | 16,217 |
1 | void visit_type_size(Visitor *v, uint64_t *obj, const char *name, Error **errp) { int64_t value; if (!error_is_set(errp)) { if (v->type_size) { v->type_size(v, obj, name, errp); } else if (v->type_uint64) { v->type_uint64(v, obj, name, errp); } else { value = *obj; v->type_int(v, &value, name, errp); *obj = value; } } ... | 16,218 |
1 | int ff_rtsp_send_cmd_with_content(AVFormatContext *s, const char *method, const char *url, const char *header, RTSPMessageHeader *reply, unsigned char **content_ptr, const unsigned char *send_content, int send_content_length) { RTSPState *rt = s->priv_data; HTTPAuthType cur_auth_type; int ret; retry: cur_auth_type = rt... | 16,219 |
1 | static void qmp_input_type_str(Visitor *v, char **obj, const char *name, Error **errp) { QmpInputVisitor *qiv = to_qiv(v); QObject *qobj = qmp_input_get_object(qiv, name, true); if (!qobj || qobject_type(qobj) != QTYPE_QSTRING) { error_setg(errp, QERR_INVALID_PARAMETER_TYPE, name ? name : "null", "string"); return; } *... | 16,220 |
1 | int ff_huff_build_tree(AVCodecContext *avctx, VLC *vlc, int nb_codes, Node *nodes, huff_cmp_t cmp, int hnode_first) { int i, j; int cur_node; int64_t sum = 0; for(i = 0; i < nb_codes; i++){ nodes[i].sym = i; nodes[i].n0 = -2; sum += nodes[i].count; } if(sum >> 31) { av_log(avctx, AV_LOG_ERROR, "Too high symbol frequenc... | 16,221 |
0 | uint8_t *av_packet_new_side_data(AVPacket *pkt, enum AVPacketSideDataType type, int size) { int ret; uint8_t *data; if ((unsigned)size > INT_MAX - AV_INPUT_BUFFER_PADDING_SIZE) return NULL; data = av_malloc(size + AV_INPUT_BUFFER_PADDING_SIZE); if (!data) return NULL; ret = av_packet_add_side_data(pkt, type, data, size... | 16,222 |
0 | static void jazz_led_text_update(void *opaque, console_ch_t *chardata) { LedState *s = opaque; char buf[2]; dpy_text_cursor(s->con, -1, -1); qemu_console_resize(s->con, 2, 1); /* TODO: draw the segments */ snprintf(buf, 2, "%02hhx\n", s->segments); console_write_ch(chardata++, 0x00200100 | buf[0]); console_write_ch(cha... | 16,223 |
0 | 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->h... | 16,224 |
0 | static int smacker_read_header(AVFormatContext *s) { AVIOContext *pb = s->pb; SmackerContext *smk = s->priv_data; AVStream *st, *ast[7]; int i, ret; int tbase; /* read and check header */ smk->magic = avio_rl32(pb); if (smk->magic != MKTAG('S', 'M', 'K', '2') && smk->magic != MKTAG('S', 'M', 'K', '4')) return AVERROR_I... | 16,225 |
0 | static int init_output_stream(OutputStream *ost, char *error, int error_len) { int ret = 0; if (ost->encoding_needed) { AVCodec *codec = ost->enc; AVCodecContext *dec = NULL; InputStream *ist; ret = init_output_stream_encode(ost); if (ret < 0) return ret; if ((ist = get_input_stream(ost))) dec = ist->dec_ctx; if (dec &... | 16,226 |
0 | static inline CopyRet receive_frame(AVCodecContext *avctx, void *data, int *got_frame) { BC_STATUS ret; BC_DTS_PROC_OUT output = { .PicInfo.width = avctx->width, .PicInfo.height = avctx->height, }; CHDContext *priv = avctx->priv_data; HANDLE dev = priv->dev; *got_frame = 0; // Request decoded data from the driver ret =... | 16,228 |
0 | void omap_mpuio_out_set(struct omap_mpuio_s *s, int line, qemu_irq handler) { if (line >= 16 || line < 0) hw_error("%s: No GPIO line %i\n", __FUNCTION__, line); s->handler[line] = handler; } | 16,229 |
0 | int pic_read_irq(DeviceState *d) { PICCommonState *s = DO_UPCAST(PICCommonState, dev.qdev, d); int irq, irq2, intno; irq = pic_get_irq(s); if (irq >= 0) { if (irq == 2) { irq2 = pic_get_irq(slave_pic); if (irq2 >= 0) { pic_intack(slave_pic, irq2); } else { /* spurious IRQ on slave controller */ if (no_spurious_interrup... | 16,230 |
0 | static inline void gen_bcond (DisasContext *ctx, int type) { target_ulong target = 0; target_ulong li; uint32_t bo = BO(ctx->opcode); uint32_t bi = BI(ctx->opcode); uint32_t mask; if ((bo & 0x4) == 0) gen_op_dec_ctr(); switch(type) { case BCOND_IM: li = (target_long)((int16_t)(BD(ctx->opcode))); if (likely(AA(ctx->opco... | 16,231 |
0 | DriveInfo *drive_get_by_id(const char *id) { DriveInfo *dinfo; TAILQ_FOREACH(dinfo, &drives, next) { if (strcmp(id, dinfo->id)) continue; return dinfo; } return NULL; } | 16,232 |
0 | static BlockDriverAIOCB *rbd_start_aio(BlockDriverState *bs, int64_t sector_num, QEMUIOVector *qiov, int nb_sectors, BlockDriverCompletionFunc *cb, void *opaque, RBDAIOCmd cmd) { RBDAIOCB *acb; RADOSCB *rcb; rbd_completion_t c; int64_t off, size; char *buf; int r; BDRVRBDState *s = bs->opaque; acb = qemu_aio_get(&rbd_a... | 16,233 |
0 | static int colo_packet_compare_udp(Packet *spkt, Packet *ppkt) { int ret; trace_colo_compare_main("compare udp"); ret = colo_packet_compare_common(ppkt, spkt); if (ret) { trace_colo_compare_udp_miscompare("primary pkt size", ppkt->size); qemu_hexdump((char *)ppkt->data, stderr, "colo-compare", ppkt->size); trace_colo_c... | 16,234 |
0 | void helper_msa_st_df(CPUMIPSState *env, uint32_t df, uint32_t wd, uint32_t rs, int32_t s10) { wr_t *pwd = &(env->active_fpu.fpr[wd].wr); target_ulong addr = env->active_tc.gpr[rs] + (s10 << df); int i; switch (df) { case DF_BYTE: for (i = 0; i < DF_ELEMENTS(DF_BYTE); i++) { do_sb(env, addr + (i << DF_BYTE), pwd->b[i],... | 16,236 |
0 | static void apic_common_class_init(ObjectClass *klass, void *data) { ICCDeviceClass *idc = ICC_DEVICE_CLASS(klass); DeviceClass *dc = DEVICE_CLASS(klass); dc->vmsd = &vmstate_apic_common; dc->reset = apic_reset_common; dc->props = apic_properties_common; idc->realize = apic_common_realize; /* * Reason: APIC and CPU nee... | 16,238 |
0 | static unsigned tget_short(const uint8_t **p, int le) { unsigned v = le ? AV_RL16(*p) : AV_RB16(*p); *p += 2; return v; } | 16,239 |
0 | static void s390_cpu_initial_reset(CPUState *s) { S390CPU *cpu = S390_CPU(s); CPUS390XState *env = &cpu->env; int i; s390_cpu_reset(s); /* initial reset does not clear everything! */ memset(&env->start_initial_reset_fields, 0, offsetof(CPUS390XState, end_reset_fields) - offsetof(CPUS390XState, start_initial_reset_field... | 16,240 |
0 | static void migrate_fd_cancel(MigrationState *s) { if (s->state != MIG_STATE_ACTIVE) return; DPRINTF("cancelling migration\n"); s->state = MIG_STATE_CANCELLED; notifier_list_notify(&migration_state_notifiers, s); migrate_fd_cleanup(s); } | 16,241 |
0 | static void test_dispatch_cmd(void) { QDict *req = qdict_new(); QObject *resp; qdict_put_obj(req, "execute", QOBJECT(qstring_from_str("user_def_cmd"))); resp = qmp_dispatch(QOBJECT(req)); assert(resp != NULL); assert(!qdict_haskey(qobject_to_qdict(resp), "error")); g_print("\nresp: %s\n", qstring_get_str(qobject_to_jso... | 16,242 |
0 | DriveInfo *drive_init(QemuOpts *opts, BlockInterfaceType block_default_type) { const char *buf; const char *file = NULL; const char *serial; const char *mediastr = ""; BlockInterfaceType type; enum { MEDIA_DISK, MEDIA_CDROM } media; int bus_id, unit_id; int cyls, heads, secs, translation; BlockDriver *drv = NULL; int m... | 16,244 |
0 | void hmp_sendkey(Monitor *mon, const QDict *qdict) { const char *keys = qdict_get_str(qdict, "keys"); KeyValueList *keylist, *head = NULL, *tmp = NULL; int has_hold_time = qdict_haskey(qdict, "hold-time"); int hold_time = qdict_get_try_int(qdict, "hold-time", -1); Error *err = NULL; char *separator; int keyname_len; wh... | 16,245 |
0 | SocketAddressLegacy *socket_remote_address(int fd, Error **errp) { struct sockaddr_storage ss; socklen_t sslen = sizeof(ss); if (getpeername(fd, (struct sockaddr *)&ss, &sslen) < 0) { error_setg_errno(errp, errno, "%s", "Unable to query remote socket address"); return NULL; } return socket_sockaddr_to_address(&ss, ssle... | 16,248 |
0 | static int megasas_ctrl_get_info(MegasasState *s, MegasasCmd *cmd) { PCIDevice *pci_dev = PCI_DEVICE(s); struct mfi_ctrl_info info; size_t dcmd_size = sizeof(info); BusChild *kid; int num_ld_disks = 0; uint16_t sdev_id; memset(&info, 0x0, cmd->iov_size); if (cmd->iov_size < dcmd_size) { trace_megasas_dcmd_invalid_xfer_... | 16,249 |
0 | static int dirac_combine_frame(AVCodecParserContext *s, AVCodecContext *avctx, int next, const uint8_t **buf, int *buf_size) { int parse_timing_info = (s->pts == AV_NOPTS_VALUE && s->dts == AV_NOPTS_VALUE); DiracParseContext *pc = s->priv_data; if (pc->overread_index) { memmove(pc->buffer, pc->buffer + pc->overread_ind... | 16,250 |
0 | static bool sdhci_can_issue_command(SDHCIState *s) { if (!SDHC_CLOCK_IS_ON(s->clkcon) || !(s->pwrcon & SDHC_POWER_ON) || (((s->prnsts & SDHC_DATA_INHIBIT) || s->stopped_state) && ((s->cmdreg & SDHC_CMD_DATA_PRESENT) || ((s->cmdreg & SDHC_CMD_RESPONSE) == SDHC_CMD_RSP_WITH_BUSY && !(SDHC_COMMAND_TYPE(s->cmdreg) == SDHC_... | 16,251 |
0 | target_ulong helper_rdhwr_ccres(CPUMIPSState *env) { if ((env->hflags & MIPS_HFLAG_CP0) || (env->CP0_HWREna & (1 << 3))) return env->CCRes; else do_raise_exception(env, EXCP_RI, GETPC()); return 0; } | 16,253 |
0 | static void vc1_decode_i_blocks(VC1Context *v) { int k, j; MpegEncContext *s = &v->s; int cbp, val; uint8_t *coded_val; int mb_pos; /* select codingmode used for VLC tables selection */ switch(v->y_ac_table_index){ case 0: v->codingset = (v->pqindex <= 8) ? CS_HIGH_RATE_INTRA : CS_LOW_MOT_INTRA; break; case 1: v->codin... | 16,258 |
0 | static int ac3_decode_frame(AVCodecContext * avctx, void *data, int *data_size, uint8_t * buf, int buf_size) { AC3DecodeContext *ctx = avctx->priv_data; int frame_start; int i, j, k, l; float tmp0[128], tmp1[128], tmp[512]; short *out_samples = (short *)data; float *samples = ctx->samples; //Synchronize the frame. fram... | 16,259 |
0 | build_srat(GArray *table_data, BIOSLinker *linker, MachineState *machine) { AcpiSystemResourceAffinityTable *srat; AcpiSratMemoryAffinity *numamem; int i; int srat_start, numa_start, slots; uint64_t mem_len, mem_base, next_base; MachineClass *mc = MACHINE_GET_CLASS(machine); const CPUArchIdList *apic_ids = mc->possible... | 16,260 |
0 | static int net_tap_init(VLANState *vlan, const char *model, const char *name, const char *ifname1, const char *setup_script, const char *down_script) { TAPState *s; int fd; char ifname[128]; if (ifname1 != NULL) pstrcpy(ifname, sizeof(ifname), ifname1); else ifname[0] = '\0'; TFR(fd = tap_open(ifname, sizeof(ifname)));... | 16,261 |
0 | void helper_icbi(target_ulong addr) { addr &= ~(env->dcache_line_size - 1); /* Invalidate one cache line : * PowerPC specification says this is to be treated like a load * (not a fetch) by the MMU. To be sure it will be so, * do the load "by hand". */ ldl(addr); tb_invalidate_page_range(addr, addr + env->icache_line_si... | 16,263 |
0 | static int get_packetheader(NUTContext *nut, ByteIOContext *bc, int prefix_length) { int64_t start, size, last_size; start= url_ftell(bc) - prefix_length; if(start != nut->packet_start + nut->written_packet_size){ av_log(nut->avf, AV_LOG_ERROR, "get_packetheader called at weird position\n"); return -1; } size= get_v(bc... | 16,264 |
0 | sdhci_write(void *opaque, hwaddr offset, uint64_t val, unsigned size) { SDHCIState *s = (SDHCIState *)opaque; unsigned shift = 8 * (offset & 0x3); uint32_t mask = ~(((1ULL << (size * 8)) - 1) << shift); uint32_t value = val; value <<= shift; switch (offset & ~0x3) { case SDHC_SYSAD: s->sdmasysad = (s->sdmasysad & mask)... | 16,265 |
0 | static void nbd_refresh_limits(BlockDriverState *bs, Error **errp) { bs->bl.max_pdiscard = NBD_MAX_BUFFER_SIZE; bs->bl.max_pwrite_zeroes = NBD_MAX_BUFFER_SIZE; bs->bl.max_transfer = NBD_MAX_BUFFER_SIZE; } | 16,266 |
0 | void bdrv_get_geometry(BlockDriverState *bs, uint64_t *nb_sectors_ptr) { int64_t nb_sectors = bdrv_nb_sectors(bs); *nb_sectors_ptr = nb_sectors < 0 ? 0 : nb_sectors; } | 16,267 |
0 | static void virt_acpi_get_cpu_info(VirtAcpiCpuInfo *cpuinfo) { CPUState *cpu; memset(cpuinfo->found_cpus, 0, sizeof cpuinfo->found_cpus); CPU_FOREACH(cpu) { set_bit(cpu->cpu_index, cpuinfo->found_cpus); } } | 16,268 |
0 | static void v9fs_wstat_post_utime(V9fsState *s, V9fsWstatState *vs, int err) { if (err < 0) { goto out; } if (vs->v9stat.n_gid != -1) { if (v9fs_do_chown(s, &vs->fidp->path, vs->v9stat.n_uid, vs->v9stat.n_gid)) { err = -errno; } } v9fs_wstat_post_chown(s, vs, err); return; out: v9fs_stat_free(&vs->v9stat); complete_pdu... | 16,269 |
0 | static int setfsugid(int uid, int gid) { /* * We still need DAC_OVERRIDE because we don't change * supplementary group ids, and hence may be subjected DAC rules */ cap_value_t cap_list[] = { CAP_DAC_OVERRIDE, }; setfsgid(gid); setfsuid(uid); if (uid != 0 || gid != 0) { return do_cap_set(cap_list, ARRAY_SIZE(cap_list), ... | 16,271 |
0 | static void target_setup_frame(int usig, struct target_sigaction *ka, target_siginfo_t *info, target_sigset_t *set, CPUARMState *env) { struct target_rt_sigframe *frame; abi_ulong frame_addr, return_addr; frame_addr = get_sigframe(ka, env); if (!lock_user_struct(VERIFY_WRITE, frame, frame_addr, 0)) { goto give_sigsegv;... | 16,272 |
0 | static bool check_solid_tile(VncState *vs, int x, int y, int w, int h, uint32_t* color, bool samecolor) { VncDisplay *vd = vs->vd; switch(vd->server->pf.bytes_per_pixel) { case 4: return check_solid_tile32(vs, x, y, w, h, color, samecolor); case 2: return check_solid_tile16(vs, x, y, w, h, color, samecolor); default: r... | 16,273 |
0 | static void avc_loopfilter_luma_inter_edge_hor_msa(uint8_t *data, uint8_t bs0, uint8_t bs1, uint8_t bs2, uint8_t bs3, uint8_t tc0, uint8_t tc1, uint8_t tc2, uint8_t tc3, uint8_t alpha_in, uint8_t beta_in, uint32_t image_width) { v16u8 p2_asub_p0, u8_q2asub_q0; v16u8 alpha, beta, is_less_than, is_less_than_beta; v16u8 p... | 16,275 |
0 | void x86_cpu_list (FILE *f, int (*cpu_fprintf)(FILE *f, const char *fmt, ...), const char *optarg) { unsigned char model = !strcmp("?model", optarg); unsigned char dump = !strcmp("?dump", optarg); unsigned char cpuid = !strcmp("?cpuid", optarg); x86_def_t *def; char buf[256]; if (cpuid) { (*cpu_fprintf)(f, "Recognized ... | 16,278 |
0 | static void dec_misc(DisasContext *dc, uint32_t insn) { uint32_t op0, op1; uint32_t ra, rb, rd; #ifdef OPENRISC_DISAS uint32_t L6, K5; #endif uint32_t I16, I5, I11, N26, tmp; TCGMemOp mop; op0 = extract32(insn, 26, 6); op1 = extract32(insn, 24, 2); ra = extract32(insn, 16, 5); rb = extract32(insn, 11, 5); rd = extract3... | 16,280 |
0 | int socket_connect(SocketAddress *addr, NonBlockingConnectHandler *callback, void *opaque, Error **errp) { int fd; switch (addr->type) { case SOCKET_ADDRESS_KIND_INET: fd = inet_connect_saddr(addr->u.inet.data, callback, opaque, errp); break; case SOCKET_ADDRESS_KIND_UNIX: fd = unix_connect_saddr(addr->u.q_unix.data, c... | 16,282 |
0 | static av_cold int init(AVFilterContext *ctx) { FormatContext *s = ctx->priv; char *cur, *sep; int nb_formats = 1; int i; int ret; /* count the formats */ cur = s->pix_fmts; while ((cur = strchr(cur, '|'))) { nb_formats++; if (*cur) cur++; } s->formats = av_malloc_array(nb_formats + 1, sizeof(*s->formats)); if (!s->for... | 16,284 |
1 | static void tcg_commit(MemoryListener *listener) { CPUAddressSpace *cpuas; AddressSpaceDispatch *d; /* since each CPU stores ram addresses in its TLB cache, we must reset the modified entries */ cpuas = container_of(listener, CPUAddressSpace, tcg_as_listener); cpu_reloading_memory_map(); /* The CPU and TLB are protecte... | 16,285 |
1 | static int qemu_chr_open_null(QemuOpts *opts, CharDriverState **_chr) { CharDriverState *chr; chr = g_malloc0(sizeof(CharDriverState)); chr->chr_write = null_chr_write; *_chr= chr; return 0; } | 16,286 |
1 | void host_net_remove_completion(ReadLineState *rs, int nb_args, const char *str) { NetClientState *ncs[MAX_QUEUE_NUM]; int count, i, len; len = strlen(str); readline_set_completion_index(rs, len); if (nb_args == 2) { count = qemu_find_net_clients_except(NULL, ncs, NET_CLIENT_OPTIONS_KIND_NONE, MAX_QUEUE_NUM); for (i = ... | 16,287 |
1 | int ff_mpeg_update_thread_context(AVCodecContext *dst, const AVCodecContext *src) { MpegEncContext *s = dst->priv_data, *s1 = src->priv_data; if (dst == src || !s1->context_initialized) return 0; // FIXME can parameters change on I-frames? // in that case dst may need a reinit if (!s->context_initialized) { memcpy(s, s... | 16,288 |
1 | static void init_proc_970FX (CPUPPCState *env) { gen_spr_ne_601(env); gen_spr_7xx(env); /* Time base */ gen_tbl(env); /* Hardware implementation registers */ /* XXX : not implemented */ spr_register(env, SPR_HID0, "HID0", SPR_NOACCESS, SPR_NOACCESS, &spr_read_generic, &spr_write_clear, 0x60000000); /* XXX : not impleme... | 16,289 |
1 | int av_fifo_generic_read(AVFifoBuffer *f, int buf_size, void (*func)(void*, void*, int), void* dest) { int size = av_fifo_size(f); if (size < buf_size) return -1; do { int len = FFMIN(f->end - f->rptr, buf_size); if(func) func(dest, f->rptr, len); else{ memcpy(dest, f->rptr, len); dest = (uint8_t*)dest + len; } av_fifo... | 16,291 |
1 | static int cmp_pkt_sub_ts_pos(const void *a, const void *b) { const AVPacket *s1 = a; const AVPacket *s2 = b; if (s1->pts == s2->pts) { if (s1->pos == s2->pos) return 0; return s1->pos > s2->pos ? 1 : -1; } return s1->pts > s2->pts ? 1 : -1; } | 16,292 |
1 | static void xics_kvm_realize(DeviceState *dev, Error **errp) { KVMXICSState *icpkvm = KVM_XICS(dev); XICSState *icp = XICS_COMMON(dev); int i, rc; Error *error = NULL; struct kvm_create_device xics_create_device = { .type = KVM_DEV_TYPE_XICS, .flags = 0, }; if (!kvm_enabled() || !kvm_check_extension(kvm_state, KVM_CAP_... | 16,295 |
1 | static int decode_lt_rps(HEVCContext *s, LongTermRPS *rps, GetBitContext *gb) { const HEVCSPS *sps = s->ps.sps; int max_poc_lsb = 1 << sps->log2_max_poc_lsb; int prev_delta_msb = 0; unsigned int nb_sps = 0, nb_sh; int i; rps->nb_refs = 0; if (!sps->long_term_ref_pics_present_flag) return 0; if (sps->num_long_term_ref_p... | 16,296 |
1 | static void xenstore_update_be(char *watch, char *type, int dom, struct XenDevOps *ops) { struct XenDevice *xendev; char path[XEN_BUFSIZE], *dom0, *bepath; unsigned int len, dev; dom0 = xs_get_domain_path(xenstore, 0); len = snprintf(path, sizeof(path), "%s/backend/%s/%d", dom0, type, dom); free(dom0); if (strncmp(path... | 16,297 |
1 | static int open_url(HLSContext *c, URLContext **uc, const char *url, AVDictionary *opts) { AVDictionary *tmp = NULL; int ret; const char *proto_name = avio_find_protocol_name(url); // only http(s) & file are allowed if (!av_strstart(proto_name, "http", NULL) && !av_strstart(proto_name, "file", NULL)) return AVERROR_INV... | 16,298 |
1 | static int rm_assemble_video_frame(AVFormatContext *s, RMContext *rm, AVPacket *pkt, int len) { ByteIOContext *pb = &s->pb; int hdr, seq, pic_num, len2, pos; int type; int ssize; hdr = get_byte(pb); len--; type = hdr >> 6; switch(type){ case 0: // slice case 2: // last slice seq = get_byte(pb); len--; len2 = get_num(pb... | 16,299 |
0 | static int sunrast_decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; const uint8_t *buf_end = avpkt->data + avpkt->size; SUNRASTContext * const s = avctx->priv_data; AVFrame *picture = data; AVFrame * const p = &s->picture; unsigned int w, h, depth, typ... | 16,300 |
0 | static void external_snapshot_prepare(BlkTransactionStates *common, Error **errp) { BlockDriver *proto_drv; BlockDriver *drv; int flags, ret; Error *local_err = NULL; const char *device; const char *new_image_file; const char *format = "qcow2"; enum NewImageMode mode = NEW_IMAGE_MODE_ABSOLUTE_PATHS; ExternalSnapshotSta... | 16,301 |
0 | static void virtqueue_map_iovec(struct iovec *sg, hwaddr *addr, unsigned int *num_sg, unsigned int max_size, int is_write) { unsigned int i; hwaddr len; /* Note: this function MUST validate input, some callers * are passing in num_sg values received over the network. */ /* TODO: teach all callers that this can fail, an... | 16,302 |
0 | static void bdrv_inherited_options(int *child_flags, QDict *child_options, int parent_flags, QDict *parent_options) { int flags = parent_flags; /* Enable protocol handling, disable format probing for bs->file */ flags |= BDRV_O_PROTOCOL; /* If the cache mode isn't explicitly set, inherit direct and no-flush from * the ... | 16,303 |
0 | static inline void tcg_out_st(TCGContext *s, TCGType type, TCGReg arg, TCGReg arg1, intptr_t arg2) { int opi, opx; assert(TCG_TARGET_REG_BITS == 64 || type == TCG_TYPE_I32); if (type == TCG_TYPE_I32) { opi = STW, opx = STWX; } else { opi = STD, opx = STDX; } tcg_out_mem_long(s, opi, opx, arg, arg1, arg2); } | 16,304 |
0 | static void IRQ_local_pipe(OpenPICState *opp, int n_CPU, int n_IRQ) { IRQDest *dst; IRQSource *src; int priority; dst = &opp->dst[n_CPU]; src = &opp->src[n_IRQ]; if (src->output != OPENPIC_OUTPUT_INT) { /* On Freescale MPIC, critical interrupts ignore priority, * IACK, EOI, etc. Before MPIC v4.1 they also ignore * mask... | 16,306 |
0 | static void test_acpi_dsdt_table(test_data *data) { AcpiSdtTable dsdt_table; uint32_t addr = le32_to_cpu(data->fadt_table.dsdt); test_dst_table(&dsdt_table, addr); ACPI_ASSERT_CMP(dsdt_table.header.signature, "DSDT"); /* Since DSDT isn't in RSDT, add DSDT to ASL test tables list manually */ g_array_append_val(data->tab... | 16,308 |
0 | static void vfio_err_notifier_handler(void *opaque) { VFIOPCIDevice *vdev = opaque; if (!event_notifier_test_and_clear(&vdev->err_notifier)) { return; } /* * TBD. Retrieve the error details and decide what action * needs to be taken. One of the actions could be to pass * the error to the guest and have the guest driver... | 16,309 |
0 | static int do_attach(USBDevice *dev) { USBBus *bus = usb_bus_from_device(dev); USBPort *port; if (dev->attached) { error_report("Error: tried to attach usb device %s twice\n", dev->product_desc); return -1; } if (bus->nfree == 0) { error_report("Error: tried to attach usb device %s to a bus with no free ports\n", dev->... | 16,310 |
0 | static void apply_dependent_coupling(AACContext * ac, SingleChannelElement * target, ChannelElement * cce, int index) { IndividualChannelStream * ics = &cce->ch[0].ics; const uint16_t * offsets = ics->swb_offset; float * dest = target->coeffs; const float * src = cce->ch[0].coeffs; int g, i, group, k, idx = 0; if(ac->m... | 16,311 |
0 | static inline void omap_timer_update(struct omap_mpu_timer_s *timer) { int64_t expires; if (timer->enable && timer->st && timer->rate) { timer->val = timer->reset_val; /* Should skip this on clk enable */ expires = timer->time + muldiv64(timer->val << (timer->ptv + 1), ticks_per_sec, timer->rate); qemu_mod_timer(timer-... | 16,312 |
0 | void cpu_save(QEMUFile *f, void *opaque) { CPUState *env = opaque; uint16_t fptag, fpus, fpuc, fpregs_format; uint32_t hflags; int32_t a20_mask; int i; for(i = 0; i < CPU_NB_REGS; i++) qemu_put_betls(f, &env->regs[i]); qemu_put_betls(f, &env->eip); qemu_put_betls(f, &env->eflags); hflags = env->hflags; /* XXX: suppress... | 16,313 |
0 | static void omap_mcbsp_source_tick(void *opaque) { struct omap_mcbsp_s *s = (struct omap_mcbsp_s *) opaque; static const int bps[8] = { 0, 1, 1, 2, 2, 2, -255, -255 }; if (!s->rx_rate) return; if (s->rx_req) printf("%s: Rx FIFO overrun\n", __FUNCTION__); s->rx_req = s->rx_rate << bps[(s->rcr[0] >> 5) & 7]; omap_mcbsp_r... | 16,314 |
0 | static int xen_9pfs_free(struct XenDevice *xendev) { return -1; } | 16,315 |
0 | static void phys_sections_clear(PhysPageMap *map) { while (map->sections_nb > 0) { MemoryRegionSection *section = &map->sections[--map->sections_nb]; phys_section_destroy(section->mr); } g_free(map->sections); g_free(map->nodes); } | 16,316 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.