label
int64
0
1
func1
stringlengths
23
97k
id
int64
0
27.3k
1
static int do_pcie_aer_inject_error(Monitor *mon, const QDict *qdict, QObject **ret_data) { const char *id = qdict_get_str(qdict, "id"); const char *error_name; uint32_t error_status; bool correctable; PCIDevice *dev; PCIEAERErr err; int ret; ret = pci_qdev_find_device(id, &dev); if (ret < 0) { monitor_printf(mon, "id ...
6,714
1
static int bmp_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; AVFrame *p = data; unsigned int fsize, hsize; int width, height; unsigned int depth; BiCompression comp; unsigned int ihsize; int i, j, n, linesize, ret; uint32...
6,715
1
static QIOChannel *nbd_negotiate_handle_starttls(NBDClient *client, uint32_t length) { QIOChannel *ioc; QIOChannelTLS *tioc; struct NBDTLSHandshakeData data = { 0 }; TRACE("Setting up TLS"); ioc = client->ioc; if (length) { if (nbd_negotiate_drop_sync(ioc, length) != length) { return NULL; } nbd_negotiate_send_rep(ioc,...
6,716
1
static int shorten_decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; ShortenContext *s = avctx->priv_data; int i, input_buf_size = 0; int16_t *samples = data; if(s->max_framesize == 0){ s->max_framesize= 1024; // should hopef...
6,717
1
static int mm_decode_pal(MmContext *s) { int i; bytestream2_skip(&s->gb, 4); for (i = 0; i < 128; i++) { s->palette[i] = 0xFF << 24 | bytestream2_get_be24(&s->gb); s->palette[i+128] = s->palette[i]<<2; } return 0; }
6,718
1
static int img_snapshot(int argc, char **argv) { BlockDriverState *bs; QEMUSnapshotInfo sn; char *filename, *snapshot_name = NULL; int c, ret = 0, bdrv_oflags; int action = 0; qemu_timeval tv; bool quiet = false; bdrv_oflags = BDRV_O_FLAGS | BDRV_O_RDWR; /* Parse commandline parameters */ for(;;) { c = getopt(argc, arg...
6,719
0
static void FUNCC(pred16x16_horizontal_add)(uint8_t *pix, const int *block_offset, const int16_t *block, ptrdiff_t stride) { int i; for(i=0; i<16; i++) FUNCC(pred4x4_horizontal_add)(pix + block_offset[i], block + i*16*sizeof(pixel), stride); }
6,720
0
static void release_unused_pictures(H264Context *h, int remove_current) { int i; /* release non reference frames */ for (i = 0; i < MAX_PICTURE_COUNT; i++) { if (h->DPB[i].f.data[0] && !h->DPB[i].reference && (remove_current || &h->DPB[i] != h->cur_pic_ptr)) { unref_picture(h, &h->DPB[i]); } } }
6,721
1
static av_noinline void emulated_edge_mc_sse(uint8_t * buf,const uint8_t *src, ptrdiff_t buf_stride, ptrdiff_t src_stride, int block_w, int block_h, int src_x, int src_y, int w, int h) { emulated_edge_mc(buf, src, buf_stride, src_stride, block_w, block_h, src_x, src_y, w, h, vfixtbl_sse, &ff_emu_edge_vvar_sse, hfixtbl_...
6,722
1
static inline int lock_hpte(void *hpte, target_ulong bits) { uint64_t pteh; pteh = ldq_p(hpte); /* We're protected by qemu's global lock here */ if (pteh & bits) { return 0; } stq_p(hpte, pteh | HPTE_V_HVLOCK); return 1; }
6,723
1
static void iothread_set_poll_max_ns(Object *obj, Visitor *v, const char *name, void *opaque, Error **errp) { IOThread *iothread = IOTHREAD(obj); Error *local_err = NULL; int64_t value; visit_type_int64(v, name, &value, &local_err); if (local_err) { goto out; } if (value < 0) { error_setg(&local_err, "poll_max_ns value...
6,724
1
int queue_signal(CPUArchState *env, int sig, target_siginfo_t *info) { CPUState *cpu = ENV_GET_CPU(env); TaskState *ts = cpu->opaque; struct emulated_sigtable *k; struct sigqueue *q, **pq; abi_ulong handler; int queue; trace_user_queue_signal(env, sig); k = &ts->sigtab[sig - 1]; queue = gdb_queuesig (); handler = sigac...
6,725
1
static void dss_sp_shift_sq_sub(const int32_t *filter_buf, int32_t *error_buf, int32_t *dst) { int a; for (a = 0; a < 72; a++) { int i, tmp; tmp = dst[a] * filter_buf[0]; for (i = 14; i > 0; i--) tmp -= error_buf[i] * (unsigned)filter_buf[i]; for (i = 14; i > 0; i--) error_buf[i] = error_buf[i - 1]; tmp = (tmp + 4096) ...
6,726
1
static void gem_transmit(CadenceGEMState *s) { unsigned desc[2]; hwaddr packet_desc_addr; uint8_t tx_packet[2048]; uint8_t *p; unsigned total_bytes; /* Do nothing if transmit is not enabled. */ if (!(s->regs[GEM_NWCTRL] & GEM_NWCTRL_TXENA)) { return; DB_PRINT("\n"); /* The packet we will hand off to QEMU. * Packets sca...
6,728
0
int ff_interleave_add_packet(AVFormatContext *s, AVPacket *pkt, int (*compare)(AVFormatContext *, AVPacket *, AVPacket *)) { AVPacketList **next_point, *this_pktl; AVStream *st = s->streams[pkt->stream_index]; int chunked = s->max_chunk_size || s->max_chunk_duration; this_pktl = av_mallocz(sizeof(AVPacketList)); if (!t...
6,729
0
static void sbr_qmf_synthesis(DSPContext *dsp, FFTContext *mdct, float *out, float X[2][38][64], float mdct_buf[2][64], float *v0, int *v_off, const unsigned int div) { int i, n; const float *sbr_qmf_window = div ? sbr_qmf_window_ds : sbr_qmf_window_us; const int step = 128 >> div; float *v; for (i = 0; i < 32; i++) { ...
6,730
0
static int qdm2_decode(QDM2Context *q, const uint8_t *in, int16_t *out) { int ch, i; const int frame_size = (q->frame_size * q->channels); /* select input buffer */ q->compressed_data = in; q->compressed_size = q->checksum_size; /* copy old block, clear new block of output samples */ memmove(q->output_buffer, &q->outpu...
6,731
0
int rtp_check_and_send_back_rr(RTPDemuxContext *s, int count) { ByteIOContext pb; uint8_t *buf; int len; int rtcp_bytes; if (!s->rtp_ctx || (count < 1)) return -1; /* XXX: mpeg pts hardcoded. RTCP send every 0.5 seconds */ s->octet_count += count; rtcp_bytes = ((s->octet_count - s->last_octet_count) * RTCP_TX_RATIO_NUM...
6,732
0
int ff_h263_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; MpegEncContext *s = avctx->priv_data; int ret; int slice_ret = 0; AVFrame *pict = data; s->flags = avctx->flags; s->flags2 = avctx->flags2; /* no supplementary pic...
6,733
0
static void decorrelate_stereo_24(int32_t *buffer[MAX_CHANNELS], int32_t *buffer_out, int32_t *wasted_bits_buffer[MAX_CHANNELS], int wasted_bits, int numchannels, int numsamples, uint8_t interlacing_shift, uint8_t interlacing_leftweight) { int i; if (numsamples <= 0) return; /* weighted interlacing */ if (interlacing_l...
6,734
0
static int xwma_read_header(AVFormatContext *s) { int64_t size; int ret = 0; uint32_t dpds_table_size = 0; uint32_t *dpds_table = NULL; unsigned int tag; AVIOContext *pb = s->pb; AVStream *st; XWMAContext *xwma = s->priv_data; int i; /* The following code is mostly copied from wav.c, with some * minor alterations. */ /...
6,735
0
static void test_acpi_asl(test_data *data) { int i; AcpiSdtTable *sdt, *exp_sdt; test_data exp_data; memset(&exp_data, 0, sizeof(exp_data)); exp_data.ssdt_tables = load_expected_aml(data); dump_aml_files(data); for (i = 0; i < data->ssdt_tables->len; ++i) { GString *asl, *exp_asl; sdt = &g_array_index(data->ssdt_tables...
6,736
0
static void iscsi_nop_timed_event(void *opaque) { IscsiLun *iscsilun = opaque; aio_context_acquire(iscsilun->aio_context); if (iscsi_get_nops_in_flight(iscsilun->iscsi) >= MAX_NOP_FAILURES) { error_report("iSCSI: NOP timeout. Reconnecting..."); iscsilun->request_timed_out = true; } else if (iscsi_nop_out_async(iscsilun...
6,737
0
static bool sys_ops_accepts(void *opaque, target_phys_addr_t addr, unsigned size, bool is_write) { return is_write && size == 4; }
6,738
0
static target_ulong h_set_mode_resouce_addr_trans_mode(PowerPCCPU *cpu, target_ulong mflags, target_ulong value1, target_ulong value2) { CPUState *cs; PowerPCCPUClass *pcc = POWERPC_CPU_GET_CLASS(cpu); target_ulong prefix; if (!(pcc->insns_flags2 & PPC2_ISA207S)) { return H_P2; } if (value1) { return H_P3; } if (value2...
6,739
0
static int v210_read_packet(AVFormatContext *s, AVPacket *pkt) { int packet_size, ret, width, height; AVStream *st = s->streams[0]; width = st->codec->width; height = st->codec->height; packet_size = GET_PACKET_SIZE(width, height); if (packet_size < 0) return -1; ret = av_get_packet(s->pb, pkt, packet_size); pkt->pts =...
6,741
0
void op_dmtc0_ebase (void) { /* vectored interrupts not implemented */ /* Multi-CPU not implemented */ /* XXX: 64bit addressing broken */ env->CP0_EBase = (int32_t)0x80000000 | (T0 & 0x3FFFF000); RETURN(); }
6,742
0
static int vmdk_add_extent(BlockDriverState *bs, BlockDriverState *file, bool flat, int64_t sectors, int64_t l1_offset, int64_t l1_backup_offset, uint32_t l1_size, int l2_size, uint64_t cluster_sectors, VmdkExtent **new_extent, Error **errp) { VmdkExtent *extent; BDRVVmdkState *s = bs->opaque; if (cluster_sectors > 0x2...
6,743
0
static inline void tlb_protect_code1(CPUTLBEntry *tlb_entry, uint32_t addr) { if (addr == (tlb_entry->address & (TARGET_PAGE_MASK | TLB_INVALID_MASK)) && (tlb_entry->address & ~TARGET_PAGE_MASK) != IO_MEM_CODE) { tlb_entry->address |= IO_MEM_CODE; tlb_entry->addend -= (unsigned long)phys_ram_base; } }
6,744
0
static void disas_system(DisasContext *s, uint32_t insn) { unsigned int l, op0, op1, crn, crm, op2, rt; l = extract32(insn, 21, 1); op0 = extract32(insn, 19, 2); op1 = extract32(insn, 16, 3); crn = extract32(insn, 12, 4); crm = extract32(insn, 8, 4); op2 = extract32(insn, 5, 3); rt = extract32(insn, 0, 5); if (op0 == 0...
6,745
0
POWERPC_FAMILY(POWER7P)(ObjectClass *oc, void *data) { DeviceClass *dc = DEVICE_CLASS(oc); PowerPCCPUClass *pcc = POWERPC_CPU_CLASS(oc); dc->fw_name = "PowerPC,POWER7+"; dc->desc = "POWER7+"; dc->props = powerpc_servercpu_properties; pcc->pvr_match = ppc_pvr_match_power7; pcc->pcr_mask = PCR_COMPAT_2_05 | PCR_COMPAT_2_...
6,746
0
static ssize_t mp_dacl_getxattr(FsContext *ctx, const char *path, const char *name, void *value, size_t size) { char buffer[PATH_MAX]; return lgetxattr(rpath(ctx, path, buffer), MAP_ACL_DEFAULT, value, size); }
6,747
0
static void fdt_add_timer_nodes(const VirtBoardInfo *vbi) { /* Note that on A15 h/w these interrupts are level-triggered, * but for the GIC implementation provided by both QEMU and KVM * they are edge-triggered. */ uint32_t irqflags = GIC_FDT_IRQ_FLAGS_EDGE_LO_HI; irqflags = deposit32(irqflags, GIC_FDT_IRQ_PPI_CPU_STAR...
6,749
0
static void eeprom24c0x_write(int scl, int sda) { if (eeprom.scl && scl && (eeprom.sda != sda)) { logout("%u: scl = %u->%u, sda = %u->%u i2c %s\n", eeprom.tick, eeprom.scl, scl, eeprom.sda, sda, sda ? "stop" : "start"); if (!sda) { eeprom.tick = 1; eeprom.command = 0; } } else if (eeprom.tick == 0 && !eeprom.ack) { /* ...
6,750
0
static void cmd_mode_sense(IDEState *s, uint8_t *buf) { int action, code; int max_len; if (buf[0] == GPCMD_MODE_SENSE_10) { max_len = ube16_to_cpu(buf + 7); } else { max_len = buf[4]; } action = buf[2] >> 6; code = buf[2] & 0x3f; switch(action) { case 0: /* current values */ switch(code) { case MODE_PAGE_R_W_ERROR: /* ...
6,751
0
static inline void RENAME(rgb24tobgr16)(const uint8_t *src, uint8_t *dst, long src_size) { const uint8_t *s = src; const uint8_t *end; #if COMPILE_TEMPLATE_MMX const uint8_t *mm_end; #endif uint16_t *d = (uint16_t *)dst; end = s + src_size; #if COMPILE_TEMPLATE_MMX __asm__ volatile(PREFETCH" %0"::"m"(*src):"memory"); _...
6,752
0
int bdrv_append_temp_snapshot(BlockDriverState *bs, int flags, Error **errp) { /* TODO: extra byte is a hack to ensure MAX_PATH space on Windows. */ char *tmp_filename = g_malloc0(PATH_MAX + 1); int64_t total_size; QemuOpts *opts = NULL; QDict *snapshot_options; BlockDriverState *bs_snapshot; Error *local_err; int ret;...
6,754
0
void address_space_read(AddressSpace *as, target_phys_addr_t addr, uint8_t *buf, int len) { address_space_rw(as, addr, buf, len, false); }
6,755
0
static int ide_write_dma_cb(IDEState *s, target_phys_addr_t phys_addr, int transfer_size1) { int len, transfer_size, n; int64_t sector_num; transfer_size = transfer_size1; for(;;) { len = s->io_buffer_size - s->io_buffer_index; if (len == 0) { n = s->io_buffer_size >> 9; sector_num = ide_get_sector(s); bdrv_write(s->bs...
6,756
0
static void pty_chr_update_read_handler_locked(CharDriverState *chr) { PtyCharDriver *s = chr->opaque; GPollFD pfd; pfd.fd = g_io_channel_unix_get_fd(s->fd); pfd.events = G_IO_OUT; pfd.revents = 0; g_poll(&pfd, 1, 0); if (pfd.revents & G_IO_HUP) { pty_chr_state(chr, 0); } else { pty_chr_state(chr, 1); } }
6,757
0
QObject *json_parser_parse_err(QList *tokens, va_list *ap, Error **errp) { JSONParserContext ctxt = {}; QList *working; QObject *result; if (!tokens) { return NULL; } working = qlist_copy(tokens); result = parse_value(&ctxt, &working, ap); QDECREF(working); error_propagate(errp, ctxt.err); return result; }
6,758
0
int loader_exec(const char * filename, char ** argv, char ** envp, struct target_pt_regs * regs, struct image_info *infop, struct linux_binprm *bprm) { int retval; int i; bprm->p = TARGET_PAGE_SIZE*MAX_ARG_PAGES-sizeof(unsigned int); memset(bprm->page, 0, sizeof(bprm->page)); retval = open(filename, O_RDONLY); if (retv...
6,759
0
int qemu_lock_fd_test(int fd, int64_t start, int64_t len, bool exclusive) { int ret; struct flock fl = { .l_whence = SEEK_SET, .l_start = start, .l_len = len, .l_type = exclusive ? F_WRLCK : F_RDLCK, }; ret = fcntl(fd, QEMU_GETLK, &fl); if (ret == -1) { return -errno; } else { return fl.l_type == F_UNLCK ? 0 : -EAGAIN;...
6,760
0
static int swri_resample(ResampleContext *c, uint8_t *dst, const uint8_t *src, int *consumed, int src_size, int dst_size, int update_ctx) { int fn_idx = c->format - AV_SAMPLE_FMT_S16P; if (c->filter_length == 1 && c->phase_shift == 0) { int index= c->index; int frac= c->frac; int64_t index2= (1LL<<32)*c->frac/c->src_in...
6,761
0
static int dash_init(AVFormatContext *s) { DASHContext *c = s->priv_data; int ret = 0, i; char *ptr; char basename[1024]; if (c->single_file_name) c->single_file = 1; if (c->single_file) c->use_template = 0; av_strlcpy(c->dirname, s->filename, sizeof(c->dirname)); ptr = strrchr(c->dirname, '/'); if (ptr) { av_strlcpy(b...
6,762
1
static int lag_decode_zero_run_line(LagarithContext *l, uint8_t *dst, const uint8_t *src, int width, int esc_count) { int i = 0; int count; uint8_t zero_run = 0; const uint8_t *start = src; uint8_t mask1 = -(esc_count < 2); uint8_t mask2 = -(esc_count < 3); uint8_t *end = dst + (width - 2); output_zeros: if (l->zeros_r...
6,764
1
void av_force_cpu_flags(int arg){ if ( (arg & ( AV_CPU_FLAG_3DNOW | AV_CPU_FLAG_3DNOWEXT | AV_CPU_FLAG_MMXEXT | AV_CPU_FLAG_SSE | AV_CPU_FLAG_SSE2 | AV_CPU_FLAG_SSE2SLOW | AV_CPU_FLAG_SSE3 | AV_CPU_FLAG_SSE3SLOW | AV_CPU_FLAG_SSSE3 | AV_CPU_FLAG_SSE4 | AV_CPU_FLAG_SSE42 | AV_CPU_FLAG_AVX | AV_CPU_FLAG_AVXSLOW | AV_CPU_...
6,765
1
static void put_uint32(QEMUFile *f, void *pv, size_t size) { uint32_t *v = pv; qemu_put_be32s(f, v); }
6,766
1
static int net_bridge_run_helper(const char *helper, const char *bridge) { sigset_t oldmask, mask; int pid, status; char *args[5]; char **parg; int sv[2]; sigemptyset(&mask); sigaddset(&mask, SIGCHLD); sigprocmask(SIG_BLOCK, &mask, &oldmask); if (socketpair(PF_UNIX, SOCK_STREAM, 0, sv) == -1) { return -1; } /* try to l...
6,767
1
static BlockDriverAIOCB *curl_aio_readv(BlockDriverState *bs, int64_t sector_num, QEMUIOVector *qiov, int nb_sectors, BlockDriverCompletionFunc *cb, void *opaque) { BDRVCURLState *s = bs->opaque; CURLAIOCB *acb; size_t start = sector_num * SECTOR_SIZE; size_t end; CURLState *state; acb = qemu_aio_get(&curl_aio_pool, bs...
6,768
1
static int alloc_f(BlockDriverState *bs, int argc, char **argv) { int64_t offset, sector_num; int nb_sectors, remaining; char s1[64]; int num, sum_alloc; int ret; offset = cvtnum(argv[1]); if (offset < 0) { printf("non-numeric offset argument -- %s\n", argv[1]); } else if (offset & 0x1ff) { printf("offset %" PRId64 " i...
6,769
1
static void test_qga_fstrim(gconstpointer fix) { const TestFixture *fixture = fix; QDict *ret; QList *list; const QListEntry *entry; ret = qmp_fd(fixture->fd, "{'execute': 'guest-fstrim'," " arguments: { minimum: 4194304 } }"); g_assert_nonnull(ret); qmp_assert_no_error(ret); list = qdict_get_qlist(ret, "return"); entr...
6,770
1
static RemoveResult remove_hpte(CPUPPCState *env, target_ulong ptex, target_ulong avpn, target_ulong flags, target_ulong *vp, target_ulong *rp) { hwaddr hpte; target_ulong v, r, rb; if ((ptex * HASH_PTE_SIZE_64) & ~env->htab_mask) { return REMOVE_PARM; } hpte = ptex * HASH_PTE_SIZE_64; v = ppc_hash64_load_hpte0(env, hp...
6,771
1
static void pc_init1(MachineState *machine, int pci_enabled, int kvmclock_enabled) { PCMachineState *pc_machine = PC_MACHINE(machine); MemoryRegion *system_memory = get_system_memory(); MemoryRegion *system_io = get_system_io(); int i; ram_addr_t below_4g_mem_size, above_4g_mem_size; PCIBus *pci_bus; ISABus *isa_bus; P...
6,772
1
int ffio_rewind_with_probe_data(AVIOContext *s, unsigned char *buf, int buf_size) { int64_t buffer_start; int buffer_size; int overlap, new_size, alloc_size; if (s->write_flag) return AVERROR(EINVAL); buffer_size = s->buf_end - s->buffer; /* the buffers must touch or overlap */ if ((buffer_start = s->pos - buffer_size)...
6,773
1
static int url_connect(struct playlist *pls, AVDictionary *opts, AVDictionary *opts2) { AVDictionary *tmp = NULL; int ret; av_dict_copy(&tmp, opts, 0); av_dict_copy(&tmp, opts2, 0); av_opt_set_dict(pls->input, &tmp); if ((ret = ffurl_connect(pls->input, NULL)) < 0) { ffurl_close(pls->input); pls->input = NULL; } av_dic...
6,774
1
void ff_insert_pad(unsigned idx, unsigned *count, size_t padidx_off, AVFilterPad **pads, AVFilterLink ***links, AVFilterPad *newpad) { unsigned i; idx = FFMIN(idx, *count); *pads = av_realloc(*pads, sizeof(AVFilterPad) * (*count + 1)); *links = av_realloc(*links, sizeof(AVFilterLink*) * (*count + 1)); memmove(*pads + i...
6,776
1
static int spapr_cpu_core_realize_child(Object *child, void *opaque) { Error **errp = opaque, *local_err = NULL; sPAPRMachineState *spapr = SPAPR_MACHINE(qdev_get_machine()); CPUState *cs = CPU(child); PowerPCCPU *cpu = POWERPC_CPU(cs); object_property_set_bool(child, true, "realized", &local_err); if (local_err) { err...
6,777
1
static void blkverify_aio_cb(void *opaque, int ret) { BlkverifyAIOCB *acb = opaque; switch (++acb->done) { case 1: acb->ret = ret; break; case 2: if (acb->ret != ret) { blkverify_err(acb, "return value mismatch %d != %d", acb->ret, ret); } if (acb->verify) { acb->verify(acb); } aio_bh_schedule_oneshot(bdrv_get_aio_cont...
6,779
1
static void do_video_out(AVFormatContext *s, OutputStream *ost, AVFrame *in_picture, int *frame_size) { int ret, format_video_sync; AVPacket pkt; AVCodecContext *enc = ost->st->codec; *frame_size = 0; format_video_sync = video_sync_method; if (format_video_sync == VSYNC_AUTO) format_video_sync = (s->oformat->flags & AV...
6,780
1
static void pc_init_pci_1_4(QEMUMachineInitArgs *args) { pc_sysfw_flash_vs_rom_bug_compatible = true; has_pvpanic = false; x86_cpu_compat_set_features("n270", FEAT_1_ECX, 0, CPUID_EXT_MOVBE); pc_init_pci(args); }
6,781
1
void cpu_dump_state (CPUState *env, FILE *f, fprintf_function cpu_fprintf, int flags) { #define RGPL 4 #define RFPL 4 int i; cpu_fprintf(f, "NIP " TARGET_FMT_lx " LR " TARGET_FMT_lx " CTR " TARGET_FMT_lx " XER " TARGET_FMT_lx "\n", env->nip, env->lr, env->ctr, env->xer); cpu_fprintf(f, "MSR " TARGET_FMT_lx " HID0 " TAR...
6,782
1
static void tcg_out_setcond_i32(TCGContext *s, TCGCond cond, TCGReg ret, TCGReg c1, int32_t c2, int c2const) { /* For 32-bit comparisons, we can play games with ADDX/SUBX. */ switch (cond) { case TCG_COND_LTU: case TCG_COND_GEU: /* The result of the comparison is in the carry bit. */ break; case TCG_COND_EQ: case TCG_C...
6,783
1
static inline void RENAME(yuv2rgb1)(uint16_t *buf0, uint16_t *uvbuf0, uint16_t *uvbuf1, uint8_t *dest, int dstW, int uvalpha, int dstbpp) { int uvalpha1=uvalpha^4095; const int yalpha1=0; if(fullUVIpol || allwaysIpol) { RENAME(yuv2rgb2)(buf0, buf0, uvbuf0, uvbuf1, dest, dstW, 0, uvalpha, dstbpp); return; } #ifdef HAVE_...
6,784
1
static void receive_from_chr_layer(SCLPConsoleLM *scon, const uint8_t *buf, int size) { assert(size == 1); if (*buf == '\r' || *buf == '\n') { scon->event.event_pending = true; return; } scon->buf[scon->length] = *buf; scon->length += 1; if (scon->echo) { qemu_chr_fe_write(scon->chr, buf, size); } }
6,785
1
static void write_strip_header(CinepakEncContext *s, int y, int h, int keyframe, unsigned char *buf, int strip_size) { buf[0] = keyframe ? 0x11: 0x10; AV_WB24(&buf[1], strip_size + STRIP_HEADER_SIZE); AV_WB16(&buf[4], y); AV_WB16(&buf[6], 0); AV_WB16(&buf[8], h); AV_WB16(&buf[10], s->w); }
6,786
1
int kvm_arch_pre_run(CPUState *env, struct kvm_run *run) { int r; unsigned irq; /* PowerPC Qemu tracks the various core input pins (interrupt, critical * interrupt, reset, etc) in PPC-specific env->irq_input_state. */ if (run->ready_for_interrupt_injection && (env->interrupt_request & CPU_INTERRUPT_HARD) && (env->irq_i...
6,787
1
static void ppc_spapr_reset(void) { /* flush out the hash table */ memset(spapr->htab, 0, spapr->htab_size); qemu_devices_reset(); /* Load the fdt */ spapr_finalize_fdt(spapr, spapr->fdt_addr, spapr->rtas_addr, spapr->rtas_size); /* Set up the entry state */ first_cpu->gpr[3] = spapr->fdt_addr; first_cpu->gpr[5] = 0; f...
6,788
1
static uint32_t calc_rice_params(RiceContext *rc, int pmin, int pmax, int32_t *data, int n, int pred_order) { int i; uint32_t bits[MAX_PARTITION_ORDER+1]; int opt_porder; RiceContext tmp_rc; uint32_t *udata; uint32_t sums[MAX_PARTITION_ORDER+1][MAX_PARTITIONS]; assert(pmin >= 0 && pmin <= MAX_PARTITION_ORDER); assert(p...
6,789
1
static int decode_header(PSDContext * s) { int signature, version, color_mode, compression; int64_t len_section; int ret = 0; if (bytestream2_get_bytes_left(&s->gb) < 30) {/* File header section + color map data section length */ av_log(s->avctx, AV_LOG_ERROR, "Header too short to parse.\n"); return AVERROR_INVALIDDATA...
6,790
1
static void ff_id3v2_parse(AVFormatContext *s, int len, uint8_t version, uint8_t flags) { int isv34, unsync; unsigned tlen; char tag[5]; int64_t next, end = avio_tell(s->pb) + len; int taghdrlen; const char *reason = NULL; AVIOContext pb; unsigned char *buffer = NULL; int buffer_size = 0; switch (version) { case 2: if ...
6,791
1
static int mpeg_decode_frame(AVCodecContext *avctx, void *data, int *data_size, UINT8 *buf, int buf_size) { Mpeg1Context *s = avctx->priv_data; UINT8 *buf_end, *buf_ptr, *buf_start; int len, start_code_found, ret, code, start_code, input_size; AVPicture *picture = data; MpegEncContext *s2 = &s->mpeg_enc_ctx; dprintf("f...
6,792
1
static int mp_decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; MotionPixelsContext *mp = avctx->priv_data; GetBitContext gb; int i, count1, count2, sz; mp->frame.reference = 1; mp->frame.buffer_hints = FF_BUFFER_HINTS_VALID ...
6,793
1
static int bdrv_rw_co(BlockDriverState *bs, int64_t sector_num, uint8_t *buf, int nb_sectors, bool is_write, BdrvRequestFlags flags) { QEMUIOVector qiov; struct iovec iov = { .iov_base = (void *)buf, .iov_len = nb_sectors * BDRV_SECTOR_SIZE, }; qemu_iovec_init_external(&qiov, &iov, 1); return bdrv_prwv_co(bs, sector_nu...
6,794
1
int qemu_set_fd_handler(int fd, IOHandler *fd_read, IOHandler *fd_write, void *opaque) { static IOTrampoline fd_trampolines[FD_SETSIZE]; IOTrampoline *tramp = &fd_trampolines[fd]; if (tramp->tag != 0) { g_io_channel_unref(tramp->chan); g_source_remove(tramp->tag); } if (opaque) { GIOCondition cond = 0; tramp->fd_read =...
6,795
1
static void adb_register_types(void) { type_register_static(&adb_bus_type_info); type_register_static(&adb_device_type_info); type_register_static(&adb_kbd_type_info); type_register_static(&adb_mouse_type_info); }
6,796
1
uint32_t nand_getio(DeviceState *dev) { int offset; uint32_t x = 0; NANDFlashState *s = (NANDFlashState *) dev; /* Allow sequential reading */ if (!s->iolen && s->cmd == NAND_CMD_READ0) { offset = (int) (s->addr & ((1 << s->addr_shift) - 1)) + s->offset; s->offset = 0; s->blk_load(s, s->addr, offset); if (s->gnd) s->io...
6,797
1
char *vnc_display_local_addr(DisplayState *ds) { VncDisplay *vs = ds ? (VncDisplay *)ds->opaque : vnc_display; return vnc_socket_local_addr("%s:%s", vs->lsock); }
6,798
0
static void av_noinline filter_mb_edgech( uint8_t *pix, int stride, int16_t bS[4], unsigned int qp, H264Context *h ) { const unsigned int index_a = 52 + qp + h->slice_alpha_c0_offset; const int alpha = alpha_table[index_a]; const int beta = (beta_table+52)[qp + h->slice_beta_offset]; if (alpha ==0 || beta == 0) return;...
6,799
0
static inline void RENAME(dering)(uint8_t src[], int stride, PPContext *c) { #if HAVE_7REGS && (TEMPLATE_PP_MMXEXT || TEMPLATE_PP_3DNOW) DECLARE_ALIGNED(8, uint64_t, tmp)[3]; __asm__ volatile( "pxor %%mm6, %%mm6 \n\t" "pcmpeqb %%mm7, %%mm7 \n\t" "movq %2, %%mm0 \n\t" "punpcklbw %%mm6, %%mm0 \n\t" "psrlw $1, %%mm0 \n\t"...
6,800
0
static void sbr_gain_calc(AACContext *ac, SpectralBandReplication *sbr, SBRData *ch_data, const int e_a[2]) { int e, k, m; // max gain limits : -3dB, 0dB, 3dB, inf dB (limiter off) static const SoftFloat limgain[4] = { { 760155524, 0 }, { 0x20000000, 1 }, { 758351638, 1 }, { 625000000, 34 } }; for (e = 0; e < ch_data->...
6,803
0
x11grab_read_packet(AVFormatContext *s1, AVPacket *pkt) { struct x11_grab *s = s1->priv_data; Display *dpy = s->dpy; XImage *image = s->image; int x_off = s->x_off; int y_off = s->y_off; int64_t curtime, delay; struct timespec ts; /* Calculate the time of the next frame */ s->time_frame += INT64_C(1000000); /* wait bas...
6,804
0
static int svq3_decode_slice_header(H264Context *h) { MpegEncContext *const s = (MpegEncContext *) h; const int mb_xy = h->mb_xy; int i, header; header = get_bits(&s->gb, 8); if (((header & 0x9F) != 1 && (header & 0x9F) != 2) || (header & 0x60) == 0) { /* TODO: what? */ av_log(h->s.avctx, AV_LOG_ERROR, "unsupported sli...
6,805
1
POWERPC_FAMILY(POWER7P)(ObjectClass *oc, void *data) { DeviceClass *dc = DEVICE_CLASS(oc); PowerPCCPUClass *pcc = POWERPC_CPU_CLASS(oc); dc->fw_name = "PowerPC,POWER7+"; dc->desc = "POWER7+"; pcc->pvr = CPU_POWERPC_POWER7P_BASE; pcc->pvr_mask = CPU_POWERPC_POWER7P_MASK; pcc->init_proc = init_proc_POWER7; pcc->check_pow...
6,806
1
static uint16_t phys_section_add(MemoryRegionSection *section) { if (phys_sections_nb == phys_sections_nb_alloc) { phys_sections_nb_alloc = MAX(phys_sections_nb_alloc * 2, 16); phys_sections = g_renew(MemoryRegionSection, phys_sections, phys_sections_nb_alloc); } phys_sections[phys_sections_nb] = *section; return phys_...
6,807
0
static int tta_read_header(AVFormatContext *s) { TTAContext *c = s->priv_data; AVStream *st; int i, channels, bps, samplerate; uint64_t framepos, start_offset; uint32_t datalen; if (!av_dict_get(s->metadata, "", NULL, AV_DICT_IGNORE_SUFFIX)) ff_id3v1_read(s); start_offset = avio_tell(s->pb); if (avio_rl32(s->pb) != AV_...
6,808
1
static void sub2video_update(InputStream *ist, AVSubtitle *sub) { int w = ist->sub2video.w, h = ist->sub2video.h; AVFrame *frame = ist->sub2video.frame; int8_t *dst; int dst_linesize; int num_rects, i; int64_t pts, end_pts; if (!frame) return; if (sub) { pts = av_rescale_q(sub->pts + sub->start_display_time * 1000, AV_...
6,813
1
void helper_movcal(CPUSH4State *env, uint32_t address, uint32_t value) { if (cpu_sh4_is_cached (env, address)) { memory_content *r = malloc (sizeof(memory_content)); r->address = address; r->value = value; r->next = NULL; *(env->movcal_backup_tail) = r; env->movcal_backup_tail = &(r->next); } }
6,817
1
static inline uint16_t mipsdsp_lshift16(uint16_t a, uint8_t s, CPUMIPSState *env) { uint8_t sign; uint16_t discard; if (s == 0) { return a; } else { sign = (a >> 15) & 0x01; if (sign != 0) { discard = (((0x01 << (16 - s)) - 1) << s) | ((a >> (14 - (s - 1))) & ((0x01 << s) - 1)); } else { discard = a >> (14 - (s - 1)); ...
6,819
1
static ssize_t dump_receive(VLANClientState *vc, const uint8_t *buf, size_t size) { DumpState *s = vc->opaque; struct pcap_sf_pkthdr hdr; int64_t ts; int caplen; /* Early return in case of previous error. */ if (s->fd < 0) { return size; } ts = muldiv64(qemu_get_clock(vm_clock), 1000000, get_ticks_per_sec()); caplen = ...
6,820
1
static int openpic_load(QEMUFile* f, void *opaque, int version_id) { OpenPICState *opp = (OpenPICState *)opaque; unsigned int i; if (version_id != 1) { return -EINVAL; } qemu_get_be32s(f, &opp->gcr); qemu_get_be32s(f, &opp->vir); qemu_get_be32s(f, &opp->pir); qemu_get_be32s(f, &opp->spve); qemu_get_be32s(f, &opp->tfrr)...
6,821
0
int vnc_tight_send_framebuffer_update(VncState *vs, int x, int y, int w, int h) { int max_rows; if (vs->clientds.pf.bytes_per_pixel == 4 && vs->clientds.pf.rmax == 0xFF && vs->clientds.pf.bmax == 0xFF && vs->clientds.pf.gmax == 0xFF) { vs->tight_pixel24 = true; } else { vs->tight_pixel24 = false; } if (w * h < VNC_TIGH...
6,822
0
static uint64_t fw_cfg_data_mem_read(void *opaque, hwaddr addr, unsigned size) { return fw_cfg_read(opaque); }
6,823
0
static IOMMUTLBEntry amdvi_translate(MemoryRegion *iommu, hwaddr addr, bool is_write) { AMDVIAddressSpace *as = container_of(iommu, AMDVIAddressSpace, iommu); AMDVIState *s = as->iommu_state; IOMMUTLBEntry ret = { .target_as = &address_space_memory, .iova = addr, .translated_addr = 0, .addr_mask = ~(hwaddr)0, .perm = I...
6,824
0
void ahci_command_wait(AHCIQState *ahci, AHCICommand *cmd) { /* We can't rely on STS_BSY until the command has started processing. * Therefore, we also use the Command Issue bit as indication of * a command in-flight. */ while (BITSET(ahci_px_rreg(ahci, cmd->port, AHCI_PX_TFD), AHCI_PX_TFD_STS_BSY) || BITSET(ahci_px_rr...
6,825
0
static inline int gen_intermediate_code_internal(TranslationBlock * tb, int spc, CPUSPARCState *env) { target_ulong pc_start, last_pc; uint16_t *gen_opc_end; DisasContext dc1, *dc = &dc1; int j, lj = -1; memset(dc, 0, sizeof(DisasContext)); dc->tb = tb; pc_start = tb->pc; dc->pc = pc_start; dc->npc = (target_ulong) tb-...
6,827
0
static void term_hist_add(const char *cmdline) { char *hist_entry, *new_entry; int idx; if (cmdline[0] == '\0') return; new_entry = NULL; if (term_hist_entry != -1) { /* We were editing an existing history entry: replace it */ hist_entry = term_history[term_hist_entry]; idx = term_hist_entry; if (strcmp(hist_entry, cmd...
6,828
0
static av_cold int flic_decode_init(AVCodecContext *avctx) { FlicDecodeContext *s = avctx->priv_data; unsigned char *fli_header = (unsigned char *)avctx->extradata; int depth; if (avctx->extradata_size != 12 && avctx->extradata_size != 128) { av_log(avctx, AV_LOG_ERROR, "Expected extradata of 12 or 128 bytes\n"); retur...
6,830
0
static int mmu_translate_region(CPUS390XState *env, target_ulong vaddr, uint64_t asc, uint64_t entry, int level, target_ulong *raddr, int *flags, int rw, bool exc) { CPUState *cs = CPU(s390_env_get_cpu(env)); uint64_t origin, offs, new_entry; const int pchks[4] = { PGM_SEGMENT_TRANS, PGM_REG_THIRD_TRANS, PGM_REG_SEC_TR...
6,831
0
static const char *rpath(FsContext *ctx, const char *path) { /* FIXME: so wrong... */ static char buffer[4096]; snprintf(buffer, sizeof(buffer), "%s/%s", ctx->fs_root, path); return buffer; }
6,832