Projectname large_stringclasses 15
values | Filepath large_stringlengths 4 106 ⌀ | Function large_stringlengths 11 3.45k | Label list |
|---|---|---|---|
qemu | linux-user/mmap.c | static abi_ulong mmap_find_vma_reserved(abi_ulong start, abi_ulong size)
{
abi_ulong addr;
abi_ulong end_addr;
int prot;
int looped = 0;
if (size > reserved_va) {
return (abi_ulong)-1;
}
size = HOST_PAGE_ALIGN(size);
end_addr = start + size;
if (end_addr > reserved_va) {
end_addr = ... | [
1,
0
] |
FFmpeg | ffprobe.c | static av_always_inline int process_frame(WriterContext *w,
InputFile *ifile,
AVFrame *frame, AVPacket *pkt)
{
AVFormatContext *fmt_ctx = ifile->fmt_ctx;
AVCodecContext *dec_ctx = ifile->streams[pkt->stream_index].dec_ctx;
A... | [
1,
0
] |
FFmpeg | libavcodec/h264.c | static void implicit_weight_table(H264Context *h) {
MpegEncContext *const s = &h->s;
int ref0, ref1, i;
int cur_poc = s->current_picture_ptr->poc;
if (h->ref_count[0] == 1 && h->ref_count[1] == 1
&& h->ref_list[0][0].poc + h->ref_list[1][0].poc == 2 * cur_poc) {
h->use_weight = 0;
h->use_we... | [
1,
0
] |
FFmpeg | doc/APIchanges | static av_cold int ra144_encode_init(AVCodecContext *avctx)
{
RA144Context *ractx;
int ret;
if (avctx->channels != 1) {
av_log(avctx, AV_LOG_ERROR, "invalid number of channels: %d\n",
avctx->channels);
return -1;
}
avctx->frame_size = NBLOCKS * BLOCKSIZE;
avctx->delay = avctx->fr... | [
0,
0
] |
FFmpeg | libavfilter/pthread.c | static void *attribute_align_arg worker(void *v)
{
ThreadContext *c = v;
int our_job = c->nb_jobs;
int nb_threads = c->nb_threads;
unsigned int last_execute = 0;
int self_id;
pthread_mutex_lock(&c->current_job_lock);
self_id = c->current_job++;
for (;;) {
while (our_job >= c->nb_jobs) {
... | [
1,
0
] |
qemu | disas.c | void monitor_disas(Monitor *mon, CPUState *cpu,
target_ulong pc, int nb_insn, int is_physical)
{
CPUClass *cc = CPU_GET_CLASS(cpu);
int count, i;
CPUDebug s;
INIT_DISASSEMBLE_INFO(s.info, (FILE *)mon, monitor_fprintf);
s.cpu = cpu;
monitor_disas_is_physical = is_physical;
s.inf... | [
1,
0
] |
qemu | kvm-all.c | static int kvm_set_user_memory_region(KVMState *s, KVMSlot *slot)
{
struct kvm_userspace_memory_region mem;
mem.slot = slot->slot;
mem.guest_phys_addr = slot->start_addr;
mem.userspace_addr = (unsigned long)slot->ram;
mem.flags = slot->flags;
if (s->migration_log) {
mem.flags |= KVM_MEM_LOG_DIRT... | [
1,
0
] |
qemu | hw/display/cirrus_vga.c | static bool blit_region_is_unsafe(struct CirrusVGAState *s,
int32_t pitch, int32_t addr)
{
if (pitch < 0) {
int64_t min = addr
+ ((int64_t)s->cirrus_blt_height - 1) * pitch;
int32_t max = addr
+ s->cirrus_blt_width;
if (min < 0 ... | [
1,
0
] |
FFmpeg | libavcodec/lossless_audiodsp.c | static void mclms_predict(WmallDecodeCtx *s, int icoef, int *pred)
{
int ich, i;
int order = s->mclms_order;
int num_channels = s->num_channels;
for (ich = 0; ich < num_channels; ich++) {
pred[ich] = 0;
if (!s->is_channel_coded[ich])
continue;
for (i = 0; i < order * num_channels; i++... | [
1,
0
] |
qemu | vnc.c | static void vnc_dpy_copy(DisplayState *ds, int src_x, int src_y, int dst_x,
int dst_y, int w, int h)
{
VncDisplay *vd = ds->opaque;
VncState *vs = vd->clients;
while (vs != NULL) {
if (vnc_has_feature(vs, VNC_FEATURE_COPYRECT))
vnc_copy(vs, src_x, src_y, dst_x, dst_y, w, h... | [
1,
1
] |
qemu | hw/ccid-card-emulated.c | static int emulated_exitfn(CCIDCardState *base)
{
EmulatedState *card = DO_UPCAST(EmulatedState, base, base);
VEvent *vevent = vevent_new(VEVENT_LAST, NULL, NULL);
vevent_queue_vevent(vevent); /* stop vevent thread */
qemu_mutex_lock(&card->apdu_thread_quit_mutex);
card->quit_apdu_thread = 1; /* stop ha... | [
1,
0
] |
FFmpeg | libavcodec/h264.c | static inline int get_chroma_qp(H264Context *h, int qscale) {
return h->pps.chroma_qp_table[qscale & 0xff];
} | [
1,
0
] |
FFmpeg | libavcodec/mpegvideo.c | static void MPV_encode_defaults(MpegEncContext *s) {
static int done = 0;
MPV_common_defaults(s);
if (!done) {
int i;
done = 1;
for (i = -16; i < 16; i++) {
default_fcode_tab[i + MAX_MV] = 1;
}
}
s->me.mv_penalty = default_mv_penalty;
s->fcode_tab = default_fcode_tab;
} | [
1,
0
] |
FFmpeg | ffmpeg.c | static int ftp_get_file_handle(URLContext *h)
{
FTPContext *s = h->priv_data;
av_dlog(h, "ftp protocol get_file_handle\n");
if (s->conn_data)
return ffurl_get_file_handle(s->conn_data);
return AVERROR(EIO);
} | [
0,
0
] |
FFmpeg | libavformat/sdp.c | static void sdp_write_header(char *buff, int size, struct sdp_session_level *s)
{
av_strlcatf(buff, size,
"v=%d\r\n"
"o=- %d %d IN IPV4 %s\r\n"
"t=%d %d\r\n"
"s=%s\r\n"
"a=tool:libavformat " AV_STRINGIFY(LIBAVFORMAT_VERSION) "\r\n",
... | [
1,
0
] |
FFmpeg | cmdutils.c | static int print_device_sources(AVInputFormat *fmt, AVDictionary *opts)
{
int ret, i;
AVFormatContext *dev = NULL;
AVDeviceInfoList *device_list = NULL;
AVDictionary *tmp_opts = NULL;
if (!fmt || !fmt->priv_class ||
!AV_IS_INPUT_DEVICE(fmt->priv_class->category))
return AVERROR(EINVAL);
pr... | [
1,
1
] |
FFmpeg | libavcodec/common.h | int mjpeg_init(MpegEncContext *s) {
MJpegContext *m;
m = malloc(sizeof(MJpegContext));
if (!m)
return -1;
/* build all the huffman tables */
build_huffman_codes(m->huff_size_dc_luminance, m->huff_code_dc_luminance,
bits_dc_luminance, val_dc_luminance);
build_huffman_codes(m->huff_s... | [
1,
0
] |
FFmpeg | libavfilter/parseutils.c | int av_parse_color(uint8_t *rgba_color, const char *color_string, void *log_ctx)
{
if (!strcasecmp(color_string, "random") ||
!strcasecmp(color_string, "bikeshed")) {
int rgba = ff_random_get_seed();
rgba_color[0] = rgba >> 24;
rgba_color[1] = rgba >> 16;
rgba_color[2] = rgba >> 8;
rg... | [
1,
0
] |
qemu | aio-posix.c | static bool aio_dispatch(AioContext *ctx)
{
AioHandler *node;
bool progress = false;
/*
* We have to walk very carefully in case qemu_aio_set_fd_handler is
* called while we're walking.
*/
node = QLIST_FIRST(&ctx->aio_handlers);
while (node) {
AioHandler *tmp;
int revents;
ctx... | [
1,
0
] |
FFmpeg | libavformat/epafdec.c | static int epaf_read_header(AVFormatContext *s)
{
int le, sample_rate, codec, channels;
AVStream *st;
avio_skip(s->pb, 4);
if (avio_rl32(s->pb))
return AVERROR_INVALIDDATA;
le = avio_rl32(s->pb);
if (le && le != 1)
return AVERROR_INVALIDDATA;
if (le) {
sample_rate = avio_rl32(s->pb)... | [
1,
0
] |
qemu | hw/acpi/piix4.c | static void piix4_ide_class_init(ObjectClass *klass, void *data)
{
DeviceClass *dc = DEVICE_CLASS(klass);
PCIDeviceClass *k = PCI_DEVICE_CLASS(klass);
k->no_hotplug = 1;
k->init = pci_piix_ide_initfn;
k->exit = pci_piix_ide_exitfn;
k->vendor_id = PCI_VENDOR_ID_INTEL;
k->device_id = PCI_DEVICE_ID_I... | [
1,
0
] |
qemu | qapi/qmp-input-visitor.c | static void qmp_input_type_any(Visitor *v, const char *name, QObject **obj,
Error **errp) {
QmpInputVisitor *qiv = to_qiv(v);
QObject *qobj = qmp_input_get_object(qiv, name, true);
qobject_incref(qobj);
*obj = qobj; | [
1,
0
] |
qemu | target-ppc/exec.h | PPC_OP(clear_xer_cr)
{
xer_so = 0;
xer_ov = 0;
xer_ca = 0;
RETURN();
} | [
1,
0
] |
qemu | migration/ram.c | static int ram_save_target_page(RAMState *rs, PageSearchStatus *pss,
bool last_stage, ram_addr_t dirty_ram_abs)
{
int res = 0;
/* Check the pages is dirty and if it is send it */
if (migration_bitmap_clear_dirty(rs, dirty_ram_abs)) {
unsigned long *unsentmap;
/*
... | [
1,
0
] |
FFmpeg | libavcodec/mips/h264qpel_msa.c | void ff_put_h264_qpel8_mc31_msa(uint8_t *dst, const uint8_t *src,
ptrdiff_t stride)
{
avc_luma_hv_qrt_8w_msa(src - 2,
src - (stride * 2) +
sizeof(uint8_t),
stride, dst, stride, 8);
} | [
1,
0
] |
qemu | cutils.c | static int is_allocated_sectors(const uint8_t *buf, int n, int *pnum)
{
int v, i;
if (n <= 0) {
*pnum = 0;
return 0;
}
v = is_not_zero(buf, 512);
for (i = 1; i < n; i++) {
buf += 512;
if (v != is_not_zero(buf, 512))
break;
}
*pnum = i;
return v;
} | [
0,
0
] |
qemu | hw/ide/ich.c | static void s390_virtio_blk_class_init(ObjectClass *klass, void *data)
{
DeviceClass *dc = DEVICE_CLASS(klass);
VirtIOS390DeviceClass *k = VIRTIO_S390_DEVICE_CLASS(klass);
k->init = s390_virtio_blk_init;
dc->props = s390_virtio_blk_properties;
dc->alias = "virtio-blk";
} | [
0,
0
] |
qemu | exec-all.h | static void breakpoint_invalidate(CPUArchState *env, target_ulong pc)
{
target_phys_addr_t addr;
ram_addr_t ram_addr;
MemoryRegionSection *section;
addr = cpu_get_phys_page_debug(env, pc);
section = phys_page_find(addr >> TARGET_PAGE_BITS);
if (!(memory_region_is_ram(section->mr)
|| (section... | [
1,
0
] |
qemu | HACKING | static void isa_mmio_writel(void *opaque, target_phys_addr_t addr,
uint32_t val)
{
cpu_outl(addr & IOPORTS_MASK, val);
} | [
0,
0
] |
qemu | block-migration.c | static void eject_device(BlockDriverState *bs, int force, Error **errp)
{
if (bdrv_in_use(bs)) {
error_set(errp, QERR_DEVICE_IN_USE, bdrv_get_device_name(bs));
return;
}
if (!bdrv_dev_has_removable_media(bs)) {
error_setg(errp, "Device '%s' is not removable",
bdrv_get_device_name... | [
0,
0
] |
qemu | hw/sd/Makefile.objs | static void sd_cardchange(void *opaque, bool load)
{
SDState *sd = opaque;
qemu_set_irq(sd->inserted_cb, blk_is_inserted(sd->blk));
if (blk_is_inserted(sd->blk)) {
sd_reset(DEVICE(sd));
qemu_set_irq(sd->readonly_cb, sd->wp_switch);
}
} | [
0,
0
] |
qemu | include/sysemu/char.h | 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(C... | [
0,
0
] |
FFmpeg | libavformat/ftp.c | 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)
... | [
1,
0
] |
qemu | hw/ppc/spapr.c | static bool spapr_drc_needed(void *opaque)
{
sPAPRDRConnector *drc = (sPAPRDRConnector *)opaque;
sPAPRDRConnectorClass *drck = SPAPR_DR_CONNECTOR_GET_CLASS(drc);
/* If no dev is plugged in there is no need to migrate the DRC state */
if (!drc->dev) {
return false;
}
/*
* We need to migrate th... | [
1,
0
] |
qemu | blockdev.c | 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_... | [
1,
0
] |
qemu | Makefile.objs | 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
... | [
1,
0
] |
qemu | HACKING | 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... | [
1,
1
] |
FFmpeg | libavutil/random_seed.c | 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, ... | [
1,
0
] |
qemu | monitor.c | static void expr_error(Monitor *mon, const char *msg)
{
monitor_printf(mon, "%s\n", msg);
siglongjmp(expr_env, 1);
} | [
0,
0
] |
qemu | block/block-backend.c | 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 ge... | [
0,
0
] |
qemu | hw/i386/pc.c | 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... | [
1,
0
] |
qemu | Makefile.objs | static void usb_msd_send_status(MSDState *s, USBPacket *p)
{
struct usb_msd_csw csw;
int len;
csw.sig = cpu_to_le32(0x53425355);
csw.tag = cpu_to_le32(s->tag);
csw.residue = s->residue;
csw.status = s->result;
len = MIN(sizeof(csw), p->len);
memcpy(p->data, &csw, len);
} | [
1,
0
] |
qemu | configure | 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... | [
1,
0
] |
qemu | Makefile.objs | void qemu_bh_schedule(QEMUBH *bh)
{
AioContext *ctx;
ctx = bh->ctx;
bh->idle = 0;
/* The memory barrier implicit in atomic_xchg makes sure that:
* 1. idle & any writes needed by the callback are done before the
* locations are read in the aio_bh_poll.
* 2. ctx is loaded before scheduled is s... | [
0,
0
] |
qemu | hw/s390x/s390-pci-inst.c | 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);
... | [
1,
0
] |
qemu | net.c | static NetSocketState *net_socket_fd_init(VLANState *vlan,
const char *model, const char *name,
int fd, int is_connected)
{
int so_type = -1, optlen = sizeof(so_type);
if (getsockopt(fd, SOL_SOCKET, SO_TYPE, (char *)&so_type,
... | [
0,
0
] |
qemu | hw/i386/acpi-build.c | 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_a... | [
1,
0
] |
qemu | cpu-exec.c | static inline void iwmmxt_load_reg(TCGv var, int reg)
{
tcg_gen_ld_i64(var, cpu_env, offsetof(CPUState, iwmmxt.regs[reg]));
} | [
0,
0
] |
qemu | include/migration/qemu-file.h | static void qemu_file_set_error(QEMUFile *f, int ret)
{
if (f->last_error == 0) {
f->last_error = ret;
}
} | [
0,
0
] |
qemu | hw/spapr_vty.c | 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 ... | [
1,
0
] |
qemu | arch_init.c | int audio_available(void)
{
#ifdef HAS_AUDIO
return 1;
#else
return 0;
#endif
} | [
0,
0
] |
qemu | hw/ide/ich.c | static void ich_ahci_class_init(ObjectClass *klass, void *data)
{
DeviceClass *dc = DEVICE_CLASS(klass);
PCIDeviceClass *k = PCI_DEVICE_CLASS(klass);
k->init = pci_ich9_ahci_init;
k->exit = pci_ich9_uninit;
k->config_write = pci_ich9_write_config;
k->vendor_id = PCI_VENDOR_ID_INTEL;
k->device_id =... | [
1,
0
] |
FFmpeg | libavcodec/h264dec.c | 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
* whic... | [
1,
0
] |
qemu | monitor.c | static target_long monitor_get_psr(const struct MonitorDef *md, int val)
{
CPUState *env = mon_get_cpu();
if (!env)
return 0;
return GET_PSR(env);
} | [
1,
0
] |
qemu | hw/block/fdc.c | 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;
} | [
1,
0
] |
qemu | migration/ram.c | 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
... | [
1,
0
] |
qemu | hw/pci/pci.c | 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 h... | [
1,
0
] |
FFmpeg | libavcodec/vorbis_dec.c | 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) {
... | [
1,
1
] |
qemu | hw/i386/pc.c | 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)... | [
1,
0
] |
FFmpeg | avconv_opt.c | 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 - grou... | [
1,
0
] |
qemu | hw/pc_piix.c | static uint32_t virtio_blk_get_features(VirtIODevice *vdev, uint32_t features)
{
VirtIOBlock *s = to_virtio_blk(vdev);
features |= (1 << VIRTIO_BLK_F_SEG_MAX);
features |= (1 << VIRTIO_BLK_F_GEOMETRY);
features |= (1 << VIRTIO_BLK_F_TOPOLOGY);
features |= (1 << VIRTIO_BLK_F_BLK_SIZE);
features |= (1 ... | [
0,
0
] |
FFmpeg | libavcodec/h264.c | static inline void write_back_non_zero_count(H264Context *h) {
MpegEncContext *const s = &h->s;
const int mb_xy = s->mb_x + s->mb_y * s->mb_stride;
int n;
for (n = 0; n < 16 + 4 + 4; n++)
h->non_zero_count[mb_xy][n] = h->non_zero_count_cache[scan8[n]];
} | [
1,
0
] |
qemu | hmp.c | static void test_qemu_strtosz_trailing(void)
{
const char *str;
char *endptr = NULL;
int64_t res;
str = "123xxx";
res = qemu_strtosz_MiB(str, &endptr);
g_assert_cmpint(res, ==, 123 * M_BYTE);
g_assert(endptr == str + 3);
res = qemu_strtosz(str, NULL);
g_assert_cmpint(res, ==, -EINVAL);
st... | [
0,
0
] |
qemu | hw/ppc/spapr.c | int spapr_allocate_irq_block(int num, bool lsi)
{
int first = -1;
int i;
for (i = 0; i < num; ++i) {
int irq;
irq = spapr_allocate_irq(0, lsi);
if (!irq) {
return -1;
}
if (0 == i) {
first = irq;
}
/* If the above doesn't create a consecutive block then that's
... | [
0,
0
] |
qemu | HACKING | static uint64_t fw_cfg_data_mem_read(void *opaque, target_phys_addr_t addr,
unsigned size)
{
return fw_cfg_read(opaque);
} | [
0,
0
] |
qemu | hw/arm/pxa2xx.c | static void pxa2xx_i2c_slave_class_init(ObjectClass *klass, void *data)
{
I2CSlaveClass *k = I2C_SLAVE_CLASS(klass);
k->init = pxa2xx_i2c_slave_init;
k->event = pxa2xx_i2c_event;
k->recv = pxa2xx_i2c_rx;
k->send = pxa2xx_i2c_tx;
} | [
0,
0
] |
qemu | exec-i386.c | static inline int handle_cpu_signal(unsigned long pc,
unsigned long address,
int is_write,
sigset_t *old_set)
{
#if defined(DEBUG_SIGNAL)
printf("qemu: SIGSEGV pc=0x%08lx address=%08lx wr=%d oldset=0x%08l... | [
0,
1
] |
qemu | block/blkdebug.c | create_iovec(QEMUIOVector *qiov, char **argv, int nr_iov, int pattern)
{
size_t *sizes = calloc(nr_iov, sizeof(size_t));
size_t count = 0;
void *buf = NULL;
void *p;
int i;
for (i = 0; i < nr_iov; i++) {
char *arg = argv[i];
int64_t len;
len = cvtnum(arg);
if (len < 0) {
pr... | [
1,
0
] |
qemu | hw/net/net_rx_pkt.c | void net_tx_pkt_reset(struct NetTxPkt *pkt)
{
int i;
/* no assert, as reset can be called before tx_pkt_init */
if (!pkt) {
return;
}
memset(&pkt->virt_hdr, 0, sizeof(pkt->virt_hdr));
g_free(pkt->vec[NET_TX_PKT_L3HDR_FRAG].iov_base);
pkt->vec[NET_TX_PKT_L3HDR_FRAG].iov_base = NULL;
assert(p... | [
1,
0
] |
qemu | block.c | static bool append_open_options(QDict *d, BlockDriverState *bs)
{
const QDictEntry *entry;
QemuOptDesc *desc;
bool found_any = false;
for (entry = qdict_first(bs->options); entry;
entry = qdict_next(bs->options, entry))
{
/* Only take options for this level */
if (strchr(qdict_entry_ke... | [
0,
0
] |
qemu | target-sparc/fop_helper.c | void helper_fdmulq(CPUSPARCState *env, float64 src1, float64 src2)
{
clear_float_exceptions(env);
QT0 = float128_mul(float64_to_float128(src1, &env->fp_status),
float64_to_float128(src2, &env->fp_status),
&env->fp_status);
check_ieee_exceptions(env);
} | [
0,
0
] |
qemu | target/i386/bpt_helper.c | static void gen_eob(DisasContext *s)
{
gen_eob_inhibit_irq(s, false);
} | [
0,
0
] |
qemu | hw/omap.h | static void omap_l4_io_writeh(void *opaque, target_phys_addr_t addr,
uint32_t value)
{
unsigned int i = (addr - OMAP2_L4_BASE) >> TARGET_PAGE_BITS;
return omap_l4_io_writeh_fn[i](omap_l4_io_opaque[i], addr, value);
} | [
1,
0
] |
FFmpeg | libavcodec/x86/hpeldsp.h | av_cold void ff_hpeldsp_init_x86(HpelDSPContext *c, int flags)
{
int cpu_flags = av_get_cpu_flags();
if (INLINE_MMX(cpu_flags))
hpeldsp_init_mmx(c, flags);
if (EXTERNAL_AMD3DNOW(cpu_flags))
hpeldsp_init_3dnow(c, flags);
if (EXTERNAL_MMXEXT(cpu_flags))
hpeldsp_init_mmxext(c, flags);
if (EX... | [
0,
0
] |
FFmpeg | libavutil/opencl.c | int av_opencl_buffer_read_image(uint8_t **dst_data, int *plane_size,
int plane_num,
cl_mem src_cl_buf, size_t cl_buffer_size)
{
int i, buffer_size = 0, ret = 0;
uint8_t *temp;
void *mapped;
cl_int status;
if ((unsigned int)plane_num > 8) {... | [
1,
0
] |
FFmpeg | ffserver.c | static void rtsp_cmd_describe(HTTPContext *c, const char *url)
{
FFStream *stream;
char path1[1024];
const char *path;
uint8_t *content;
int content_length, len;
struct sockaddr_in my_addr;
/* find which url is asked */
url_split(NULL, 0, NULL, 0, NULL, path1, sizeof(path1), url);
path = pat... | [
1,
1
] |
FFmpeg | libavcodec/tiff.c | static char *shorts2str(int *sp, int count, const char *sep)
{
int i;
char *ap, *ap0;
if (!sep)
sep = ", ";
ap = av_malloc((5 + strlen(sep)) * count);
if (!ap)
return NULL;
ap0 = ap;
ap[0] = '\0';
for (i = 0; i < count; i++) {
int l = snprintf(ap, 5 + strlen(sep), "%d%s", sp[i], s... | [
0,
0
] |
FFmpeg | libavcodec/assdec.c | static int ass_decode_frame(AVCodecContext *avctx, void *data, int *got_sub_ptr,
AVPacket *avpkt)
{
const char *ptr = avpkt->data;
int len, size = avpkt->size;
while (size > 0) {
ASSDialog *dialog = ff_ass_split_dialog(avctx->priv_data, ptr, 0, NULL);
int duration = dial... | [
1,
0
] |
qemu | hw/pci-hotplug.c | USBDevice *usb_msd_init(const char *filename)
{
static int nr = 0;
char id[8];
QemuOpts *opts;
DriveInfo *dinfo;
USBDevice *dev;
int fatal_error;
const char *p1;
char fmt[32];
/* parse -usbdevice disk: syntax into drive opts */
snprintf(id, sizeof(id), "usb%d", nr++);
opts = qemu_opts_... | [
1,
1
] |
FFmpeg | libav/jpeg.c | static int jpeg_read_close(AVFormatContext *s1)
{
JpegContext *s = s1->priv_data;
av_free(s);
return 0;
} | [
1,
0
] |
FFmpeg | libavformat/avformat.h | static void add_index_entry(AVStream *st,
int64_t pos, int64_t timestamp, int flags)
{
AVIndexEntry *entries, *ie;
entries = av_fast_realloc(st->index_entries,
&st->index_entries_allocated_size,
(st->nb_index_entries + 1) *
... | [
1,
0
] |
qemu | linux-user/qemu.h | int do_sigprocmask(int how, const sigset_t *set, sigset_t *oldset)
{
int ret;
sigset_t val;
sigset_t *temp = NULL;
CPUState *cpu = thread_cpu;
TaskState *ts = (TaskState *)cpu->opaque;
bool segv_was_blocked = ts->sigsegv_blocked;
if (set) {
bool has_sigsegv = sigismember(set, SIGSEGV);
v... | [
1,
0
] |
FFmpeg | libavfilter/vf_framerate.c | static int process_work_frame(AVFilterContext *ctx)
{
FrameRateContext *s = ctx->priv;
int64_t work_pts;
int interpolate;
int ret;
if (!s->f1)
return 0;
if (!s->f0 && !s->flush)
return 0;
work_pts = s->start_pts + av_rescale_q(s->n, av_inv_q(s->dest_frame_rate),
... | [
1,
0
] |
qemu | Makefile.objs | static void put_buffer(QEMUFile *f, void *pv, size_t size)
{
uint8_t *v = pv;
qemu_put_buffer(f, v, size);
} | [
1,
0
] |
qemu | blockdev.c | int inet_connect(const char *str, bool block, Error **errp)
{
QemuOpts *opts;
int sock = -1;
opts = qemu_opts_create(&dummy_opts, NULL, 0);
if (inet_parse(opts, str) == 0) {
if (block) {
qemu_opt_set(opts, "block", "on");
}
sock = inet_connect_opts(opts, errp);
} else {
error_s... | [
1,
0
] |
qemu | block/blkverify.c | static void blkverify_verify_readv(BlkverifyAIOCB *acb)
{
ssize_t offset = qemu_iovec_compare(acb->qiov, &acb->raw_qiov);
if (offset != -1) {
blkverify_err(acb, "contents mismatch in sector %" PRId64,
acb->sector_num + (int64_t)(offset / BDRV_SECTOR_SIZE));
}
} | [
1,
0
] |
qemu | hw/9pfs/virtio-9p-device.c | static void handle_9p_output(VirtIODevice *vdev, VirtQueue *vq)
{
V9fsVirtioState *v = (V9fsVirtioState *)vdev;
V9fsState *s = &v->state;
V9fsPDU *pdu;
ssize_t len;
while ((pdu = pdu_alloc(s))) {
struct {
uint32_t size_le;
uint8_t id;
uint16_t tag_le;
} QEMU_PACKED out;
... | [
1,
0
] |
qemu | MAINTAINERS | void kqemu_record_dump(void)
{
PCRecord **pr, *r;
int i, h;
FILE *f;
int64_t total, sum;
pr = malloc(sizeof(PCRecord *) * nb_pc_records);
i = 0;
total = 0;
for (h = 0; h < PC_REC_HASH_SIZE; h++) {
for (r = pc_rec_hash[h]; r != NULL; r = r->next) {
pr[i++] = r;
total += r->cou... | [
1,
0
] |
qemu | hw/i386/acpi-build.c | static inline uint64_t vtd_get_slpte_addr(uint64_t slpte)
{
return slpte & VTD_SL_PT_BASE_ADDR_MASK(VTD_HOST_ADDRESS_WIDTH);
} | [
0,
0
] |
qemu | accel.c | int configure_accelerator(MachineState *ms)
{
const char *p;
char buf[10];
int ret;
bool accel_initialised = false;
bool init_failed = false;
AccelClass *acc = NULL;
p = qemu_opt_get(qemu_get_machine_opts(), "accel");
if (p == NULL) {
/* Use the default "accelerator", tcg */
p = "tcg"... | [
1,
0
] |
qemu | tests/test-cutils.c | static void test_qemu_strtoull_negative(void)
{
const char *str = " \t -321";
char f = 'X';
const char *endptr = &f;
uint64_t res = 999;
int err;
err = qemu_strtoull(str, &endptr, 0, &res);
g_assert_cmpint(err, ==, 0);
g_assert_cmpint(res, ==, -321);
g_assert(endptr == str + strlen(str));
} | [
0,
0
] |
qemu | target-ppc/op_helper.c | uint64_t helper_frsqrte(uint64_t arg)
{
CPU_DoubleU fone, farg;
fone.ll = 0x3FF0000000000000ULL; /* 1.0 */
farg.ll = arg;
if (unlikely(float64_is_signaling_nan(farg.d))) {
/* sNaN reciprocal square root */
farg.ll = fload_invalid_op_excp(POWERPC_EXCP_FP_VXSNAN);
} else if (unlikely(float64_is_... | [
1,
0
] |
qemu | configure | static void vnc_client_write_locked(void *opaque)
{
VncState *vs = opaque;
#ifdef CONFIG_VNC_SASL
if (vs->sasl.conn &&
vs->sasl.runSSF &&
!vs->sasl.waitWriteSSF) {
vnc_client_write_sasl(vs);
} else
#endif /* CONFIG_VNC_SASL */
{
#ifdef CONFIG_VNC_WS
if (vs->encode_ws) {
vn... | [
0,
0
] |
qemu | block/iscsi.c | iscsi_aio_write16_cb(struct iscsi_context *iscsi, int status,
void *command_data, void *opaque)
{
IscsiAIOCB *acb = opaque;
trace_iscsi_aio_write16_cb(iscsi, status, acb, acb->canceled);
g_free(acb->buf);
acb->buf = NULL;
if (acb->canceled != 0) {
return;
}
acb->status = ... | [
0,
0
] |
qemu | hw/s390x/s390-pci-bus.c | static void sclp_execute(SCLPDevice *sclp, SCCB *sccb, uint32_t code)
{
SCLPDeviceClass *sclp_c = SCLP_GET_CLASS(sclp);
SCLPEventFacility *ef = sclp->event_facility;
SCLPEventFacilityClass *efc = EVENT_FACILITY_GET_CLASS(ef);
switch (code & SCLP_CMD_CODE_MASK) {
case SCLP_CMDW_READ_SCP_INFO:
case SCL... | [
0,
0
] |
qemu | qemu-io.c | truncate_f(int argc, char **argv)
{
int64_t offset;
int ret;
offset = cvtnum(argv[1]);
if (offset < 0) {
printf("non-numeric truncate argument -- %s\n", argv[1]);
return 0;
}
ret = bdrv_truncate(bs, offset);
if (ret < 0) {
printf("truncate: %s", strerror(ret));
return 0;
}
... | [
1,
0
] |
qemu | hw/vmware_vga.c | static inline void vmsvga_cursor_define(struct vmsvga_state_s *s,
struct vmsvga_cursor_definition_s *c)
{
QEMUCursor *qc;
int i, pixels;
qc = cursor_alloc(c->width, c->height);
qc->hot_x = c->hot_x;
qc->hot_y = c->hot_y;
switch (c->bpp) {
case 1:
curso... | [
1,
0
] |
qemu | HACKING | static uint64_t pfpu_read(void *opaque, target_phys_addr_t addr,
unsigned size)
{
MilkymistPFPUState *s = opaque;
uint32_t r = 0;
addr >>= 2;
switch (addr) {
case R_CTL:
case R_MESHBASE:
case R_HMESHLAST:
case R_VMESHLAST:
case R_CODEPAGE:
case R_VERTICES:
ca... | [
1,
0
] |
qemu | hw/qdev.c | static void qdev_reset(void *opaque)
{
DeviceState *dev = opaque;
if (dev->info->reset)
dev->info->reset(dev);
} | [
0,
0
] |
FFmpeg | libavcodec/arm/h264idct_neon.S | static void FUNCC(pred4x4_horizontal_add)(uint8_t *_pix, const int16_t *_block,
ptrdiff_t stride)
{
int i;
pixel *pix = (pixel *)_pix;
const dctcoef *block = (const dctcoef *)_block;
stride >>= sizeof(pixel) - 1;
for (i = 0; i < 4; i++) {
pixel v = pix[-1]... | [
1,
0
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.