Projectname large_stringclasses 15
values | Filepath large_stringlengths 4 106 ⌀ | Function large_stringlengths 11 3.45k | Label list |
|---|---|---|---|
qemu | hw/net/net_tx_pkt.c | void net_tx_pkt_init(struct NetTxPkt **pkt, PCIDevice *pci_dev,
uint32_t max_frags, bool has_virt_hdr)
{
struct NetTxPkt *p = g_malloc0(sizeof *p);
p->pci_dev = pci_dev;
p->vec = g_malloc((sizeof *p->vec) *
(max_frags + NET_TX_PKT_PL_START_FRAG));
p->raw = g_mallo... | [
1,
0
] |
qemu | hw/s390x/sclp.c | static void unassign_storage(SCLPDevice *sclp, SCCB *sccb)
{
MemoryRegion *mr = NULL;
AssignStorage *assign_info = (AssignStorage *)sccb;
sclpMemoryHotplugDev *mhd = get_sclp_memory_hotplug_dev();
ram_addr_t unassign_addr;
MemoryRegion *sysmem = get_system_memory();
if (!mhd) {
sccb->h.response_... | [
1,
0
] |
qemu | scripts/qapi-visit.py | static void test_visitor_in_errors(TestInputVisitorData *data,
const void *unused)
{
TestStruct *p = NULL;
Error *err = NULL;
Visitor *v;
v = visitor_input_test_init(
data, "{ 'integer': false, 'boolean': 'foo', 'string': -42 }");
visit_type_TestStruct(v, &p, NU... | [
1,
1
] |
FFmpeg | libavutil/Makefile | static int
test_vector_fmac_scalar(AVFloatDSPContext *fdsp, AVFloatDSPContext *cdsp,
const float *v1, const float *src0, float scale)
{
LOCAL_ALIGNED(32, float, cdst, [LEN]);
LOCAL_ALIGNED(32, float, odst, [LEN]);
int ret;
memcpy(cdst, v1, LEN * sizeof(*v1));
memcpy(odst, v1, LE... | [
1,
0
] |
FFmpeg | postproc/rgb2rgb.c | static inline void RENAME(yv12touyvy)(const uint8_t *ysrc, const uint8_t *usrc,
const uint8_t *vsrc, uint8_t *dst,
unsigned int width, unsigned int height,
int lumStride, int chromStride,
... | [
1,
1
] |
qemu | linux-user/main.c | static void gen_tlbilx_booke206(DisasContext *ctx)
{
#if defined(CONFIG_USER_ONLY)
gen_inval_exception(ctx, POWERPC_EXCP_PRIV_OPC);
#else
TCGv t0;
if (unlikely(ctx->pr)) {
gen_inval_exception(ctx, POWERPC_EXCP_PRIV_OPC);
return;
}
t0 = tcg_temp_new();
gen_addr_reg_index(ctx, t0);
switch... | [
1,
0
] |
FFmpeg | libavformat/utils.c | static void probe_codec(AVFormatContext *s, AVStream *st, const AVPacket *pkt)
{
if (st->request_probe > 0) {
AVProbeData *pd = &st->probe_data;
int end;
av_log(s, AV_LOG_DEBUG, "probing stream %d pp:%d\n", st->index,
st->probe_packets);
--st->probe_packets;
if (pkt) {
pd-... | [
1,
0
] |
qemu | tests/libqos/virtio-mmio.c | static void pci_basic(void)
{
QVirtioPCIDevice *dev;
QPCIBus *bus;
QVirtQueuePCI *vqpci;
QGuestAllocator *alloc;
void *addr;
bus = pci_test_start();
dev = virtio_blk_pci_init(bus, PCI_SLOT);
alloc = pc_alloc_init();
vqpci = (QVirtQueuePCI *)qvirtqueue_setup(&qvirtio_pci, &dev->vdev,
... | [
1,
0
] |
qemu | target-ppc/helper.c | static inline int ppcemb_tlb_check(CPUState *env, ppcemb_tlb_t *tlb,
target_phys_addr_t *raddrp,
target_ulong address, uint32_t pid, int ext,
int i)
{
target_ulong mask;
/* Check valid flag */
if (!(tlb... | [
1,
0
] |
qemu | block/nbd.c | static int find_partition(BlockDriverState *bs, int partition,
off_t *offset, off_t *size)
{
struct partition_record mbr[4];
uint8_t data[512];
int i;
int ext_partnum = 4;
int ret;
if ((ret = bdrv_read(bs, 0, data, 1)) < 0) {
errno = -ret;
err(EXIT_FAILURE, "error... | [
1,
0
] |
qemu | hw/hw.h | void qemu_fflush(QEMUFile *f)
{
if (!f->is_writable)
return;
if (f->buf_index > 0) {
if (f->is_file) {
fseek(f->outfile, f->buf_offset, SEEK_SET);
fwrite(f->buf, 1, f->buf_index, f->outfile);
} else {
bdrv_pwrite(f->bs, f->base_offset + f->buf_offset,
f->buf... | [
1,
0
] |
qemu | hw/s390x/s390-stattrib-kvm.c | static void kvm_s390_stattrib_synchronize(S390StAttribState *sa)
{
KVMS390StAttribState *sas = KVM_S390_STATTRIB(sa);
MachineState *machine = MACHINE(qdev_get_machine());
unsigned long max = machine->maxram_size / TARGET_PAGE_SIZE;
unsigned long cx, len = 1 << 19;
int r;
struct kvm_s390_cmma_log clog... | [
1,
0
] |
qemu | tests/test-replication.c | static void test_blk_read(BlockBackend *blk, long pattern,
int64_t pattern_offset, int64_t pattern_count,
int64_t offset, int64_t count,
bool expect_failed)
{
void *pattern_buf = NULL;
QEMUIOVector qiov;
void *cmp_buf = NULL;
... | [
1,
0
] |
qemu | linux-user/main.c | static void gen_tlbwe_440(DisasContext *ctx)
{
#if defined(CONFIG_USER_ONLY)
gen_inval_exception(ctx, POWERPC_EXCP_PRIV_OPC);
#else
if (unlikely(ctx->pr)) {
gen_inval_exception(ctx, POWERPC_EXCP_PRIV_OPC);
return;
}
switch (rB(ctx->opcode)) {
case 0:
case 1:
case 2:
{
TCGv_i32 t... | [
1,
0
] |
FFmpeg | libswscale/swscale.c | rgb48funcs(rgb, LE, PIX_FMT_RGB48LE)
rgb48funcs(rgb, BE, PIX_FMT_RGB48BE)
rgb48funcs(bgr, LE, PIX_FMT_BGR48LE)
rgb48funcs(bgr, BE, PIX_FMT_BGR48BE)
#define input_pixel(i) ((origin == PIX_FMT_RGBA || origin == PIX_FMT_BGRA || \
origin == PIX_FMT_ARGB || origin == PIX_FMT_ABGR) ? AV_RN32A(&s... | [
1,
0
] |
FFmpeg | libavcodec/bmp.c | static av_cold int msrle_decode_init(AVCodecContext *avctx)
{
MsrleContext *s = avctx->priv_data;
int i;
s->avctx = avctx;
switch (avctx->bits_per_coded_sample) {
case 1:
avctx->pix_fmt = AV_PIX_FMT_MONOWHITE;
break;
case 4:
case 8:
avctx->pix_fmt = AV_PIX_FMT_PAL8;
break;
c... | [
1,
0
] |
qemu | tcg/ppc/tcg-target.inc.c | static void patch_reloc(tcg_insn_unit *code_ptr, int type,
intptr_t value, intptr_t addend)
{
tcg_insn_unit *target;
tcg_insn_unit old;
value += addend;
target = (tcg_insn_unit *)value;
switch (type) {
case R_PPC_REL14:
reloc_pc14(code_ptr, target);
break;
case R... | [
1,
0
] |
FFmpeg | libavcodec/snow.h | static av_always_inline int check_block(SnowContext *s, int mb_x, int mb_y,
int p[3], int intra,
const uint8_t *obmc_edged,
int *best_rd) {
const int b_stride = s->b_width << s->block_max_depth;
... | [
1,
1
] |
FFmpeg | libavcodec/mmaldec.c | static void input_callback(MMAL_PORT_T *port, MMAL_BUFFER_HEADER_T *buffer)
{
if (!buffer->cmd) {
AVBufferRef *buf = buffer->user_data;
av_buffer_unref(&buf);
}
mmal_buffer_header_release(buffer);
} | [
1,
0
] |
FFmpeg | libavcodec/interplayvideo.c | static int ipvideo_decode_block_opcode_0xE(IpvideoContext *s)
{
int y;
unsigned char pix;
/* 1-color encoding: the whole block is 1 solid color */
CHECK_STREAM_PTR(1);
pix = *s->stream_ptr++;
for (y = 0; y < 8; y++) {
memset(s->pixel_ptr, pix, 8);
s->pixel_ptr += s->stride;
}
/* report... | [
1,
0
] |
qemu | block/nbd.c | static void socket_start_incoming_migration(SocketAddress *saddr,
Error **errp)
{
QIOChannelSocket *listen_ioc = qio_channel_socket_new();
qio_channel_set_name(QIO_CHANNEL(listen_ioc),
"migration-socket-listener");
if (qio_channel_socket_lis... | [
0,
0
] |
qemu | hw/block/virtio-blk.c | static int virtio_blk_load_device(VirtIODevice *vdev, QEMUFile *f,
int version_id)
{
VirtIOBlock *s = VIRTIO_BLK(vdev);
while (qemu_get_sbyte(f)) {
unsigned nvqs = s->conf.num_queues;
unsigned vq_idx = 0;
VirtIOBlockReq *req;
if (nvqs > 1) {
vq_idx = ... | [
1,
0
] |
qemu | block/block-backend.c | static void nvme_clear_ctrl(NvmeCtrl *n)
{
int i;
for (i = 0; i < n->num_queues; i++) {
if (n->sq[i] != NULL) {
nvme_free_sq(n->sq[i], n);
}
}
for (i = 0; i < n->num_queues; i++) {
if (n->cq[i] != NULL) {
nvme_free_cq(n->cq[i], n);
}
}
bdrv_flush(n->conf.bs);
n->bar.c... | [
0,
0
] |
qemu | block/qcow2.c | static int preallocate(BlockDriverState *bs)
{
uint64_t nb_sectors;
uint64_t offset;
uint64_t host_offset = 0;
int num;
int ret;
QCowL2Meta *meta;
nb_sectors = bdrv_getlength(bs) >> 9;
offset = 0;
while (nb_sectors) {
num = MIN(nb_sectors, INT_MAX >> 9);
ret = qcow2_alloc_cluster_o... | [
1,
1
] |
qemu | block.c | static void bdrv_co_em_bh(void *opaque)
{
BlockAIOCBCoroutine *acb = opaque;
acb->common.cb(acb->common.opaque, acb->req.error);
qemu_bh_delete(acb->bh);
qemu_aio_unref(acb);
} | [
0,
0
] |
qemu | target/sh4/op_helper.c | void helper_fcmp_eq_DT(CPUSH4State *env, float64 t0, float64 t1)
{
int relation;
set_float_exception_flags(0, &env->fp_status);
relation = float64_compare(t0, t1, &env->fp_status);
if (unlikely(relation == float_relation_unordered)) {
update_fpscr(env, GETPC());
} else {
env->sr_t = (relation ... | [
0,
0
] |
FFmpeg | libavcodec/imgconvert.c | static inline int is_yuv_planar(PixFmtInfo *ps)
{
return (ps->color_type == FF_COLOR_YUV ||
ps->color_type == FF_COLOR_YUV_JPEG) &&
!ps->is_packed;
} | [
0,
0
] |
FFmpeg | libavcodec/dxva2_h264.c | static int output_frame(H264Context *h, AVFrame *dst, AVFrame *src)
{
int i;
int ret = av_frame_ref(dst, src);
if (ret < 0)
return ret;
if (!h->sps.crop)
return 0;
for (i = 0; i < 3; i++) {
int hshift = (i > 0) ? h->chroma_x_shift : 0;
int vshift = (i > 0) ? h->chroma_y_shift : 0;
... | [
1,
0
] |
qemu | util/qemu-thread-posix.c | static inline void futex_wake(QemuEvent *ev, int n)
{
if (n == 1) {
pthread_cond_signal(&ev->cond);
} else {
pthread_cond_broadcast(&ev->cond);
}
} | [
1,
0
] |
qemu | tests/ide-test.c | static uint8_t ide_wait_clear(uint8_t flag)
{
QPCIDevice *dev;
QPCIBar bmdma_bar, ide_bar;
uint8_t data;
time_t st;
dev = get_pci_device(&bmdma_bar, &ide_bar);
/* Wait with a 5 second timeout */
time(&st);
while (true) {
data = qpci_io_readb(dev, ide_bar, reg_status);
if (!(data & fla... | [
1,
0
] |
qemu | target-mips/op_helper.c | static inline void check_hwrena(CPUMIPSState *env, int reg)
{
if ((env->hflags & MIPS_HFLAG_CP0) || (env->CP0_HWREna & (1 << reg))) {
return;
}
do_raise_exception(env, EXCP_RI, GETPC());
} | [
1,
0
] |
qemu | qga/commands.c | static gboolean guest_exec_output_watch(GIOChannel *ch,
GIOCondition cond, gpointer p_)
{
GuestExecIOData *p = (GuestExecIOData *)p_;
gsize bytes_read;
GIOStatus gstatus;
if (cond == G_IO_HUP || cond == G_IO_ERR) {
goto close;
}
if (p->size == p->length) {... | [
1,
0
] |
FFmpeg | libavcodec/hq_hqa.c | static int hq_decode_block(HQContext *c, GetBitContext *gb, int16_t block[64],
int qsel, int is_chroma, int is_hqa)
{
const int32_t *q;
int val, pos = 1;
memset(block, 0, 64 * sizeof(*block));
if (!is_hqa) {
block[0] = get_sbits(gb, 9) << 6;
q = ff_hq_quants[qsel][is_c... | [
1,
0
] |
qemu | target-i386/cpu.h | void helper_single_step(CPUX86State *env)
{
#ifndef CONFIG_USER_ONLY
check_hw_breakpoints(env, 1);
env->dr[6] |= DR6_BS;
#endif
raise_exception(env, EXCP01_DB);
} | [
1,
0
] |
qemu | hw/usb/dev-storage.c | static int usb_msd_initfn_storage(USBDevice *dev)
{
MSDState *s = DO_UPCAST(MSDState, dev, dev);
BlockDriverState *bs = s->conf.bs;
SCSIDevice *scsi_dev;
Error *err = NULL;
if (!bs) {
error_report("drive property not set");
return -1;
}
blkconf_serial(&s->conf, &dev->serial);
/*
* ... | [
1,
1
] |
FFmpeg | libavcodec/g723_1dec.c | static void residual_interp(int16_t *buf, int16_t *out, int lag,
int gain, int *rseed)
{
int i;
if (lag) { /* Voiced */
int16_t *vector_ptr = buf + PITCH_MAX;
/* Attenuate */
for (i = 0; i < lag; i++)
out[i] = vector_ptr[i - lag] * 3 >> 2;
av_memcpy_backptr... | [
1,
0
] |
FFmpeg | libavformat/aiffdec.c | static int aiff_write_trailer(AVFormatContext *s)
{
AVIOContext *pb = s->pb;
AIFFOutputContext *aiff = s->priv_data;
AVCodecParameters *par = s->streams[0]->codecpar;
/* Chunks sizes must be even */
int64_t file_size, end_size;
end_size = file_size = avio_tell(pb);
if (file_size & 1) {
avio_w... | [
1,
0
] |
FFmpeg | libavcodec/indeo3.c | static void copy_cell(Indeo3DecodeContext *ctx, Plane *plane, Cell *cell)
{
int h, w, mv_x, mv_y, offset, offset_dst;
uint8_t *src, *dst;
/* setup output and reference pointers */
offset_dst = (cell->ypos << 2) * plane->pitch + (cell->xpos << 2);
dst = plane->pixels[ctx->buf_sel] + offset_dst;
mv_y =... | [
1,
0
] |
qemu | target-xtensa/translate.c | static void gen_check_privilege(DisasContext *dc)
{
if (dc->cring) {
gen_exception_cause(dc, PRIVILEGED_CAUSE);
dc->is_jmp = DISAS_UPDATE;
}
} | [
1,
0
] |
qemu | block/raw-posix.c | MigrationState *unix_start_outgoing_migration(Monitor *mon,
const char *path,
int64_t bandwidth_limit,
int detach,
int blk,
... | [
1,
0
] |
FFmpeg | libavcodec/libfdk-aacdec.c | static int fdk_aac_decode_frame(AVCodecContext *avctx, void *data,
int *got_frame_ptr, AVPacket *avpkt)
{
FDKAACDecContext *s = avctx->priv_data;
AVFrame *frame = data;
int ret;
AAC_DECODER_ERROR err;
UINT valid = avpkt->size;
err = aacDecoder_Fill(s->handle, &avpkt->... | [
1,
0
] |
FFmpeg | libavcodec/tiff.c | static int tiff_unpack_fax(TiffContext *s, uint8_t *dst, int stride,
const uint8_t *src, int size, int width, int lines)
{
int i, ret = 0;
int line;
uint8_t *src2 = av_malloc((unsigned)size +
AV_INPUT_BUFFER_PADDING_SIZE);
if (!src2) {
av_log(s-... | [
1,
0
] |
qemu | hw/xen/xen_pt.c | static void xen_pci_passthrough_class_init(ObjectClass *klass, void *data)
{
DeviceClass *dc = DEVICE_CLASS(klass);
PCIDeviceClass *k = PCI_DEVICE_CLASS(klass);
k->realize = xen_pt_realize;
k->exit = xen_pt_unregister_device;
k->config_read = xen_pt_pci_read_config;
k->config_write = xen_pt_pci_write... | [
1,
0
] |
qemu | include/ui/console.h | static void vnc_dpy_setdata(DisplayChangeListener *dcl,
DisplayState *ds)
{
VncDisplay *vd = ds->opaque;
qemu_pixman_image_unref(vd->guest.fb);
vd->guest.fb = pixman_image_ref(ds->surface->image);
vd->guest.format = ds->surface->format;
vnc_dpy_update(dcl, ds, 0, 0, ds_get_w... | [
1,
0
] |
qemu | hw/i386/acpi-build.c | void acpi_setup(PcGuestInfo *guest_info)
{
AcpiBuildTables tables;
AcpiBuildState *build_state;
if (!guest_info->fw_cfg) {
ACPI_BUILD_DPRINTF("No fw cfg. Bailing out.\n");
return;
}
if (!guest_info->has_acpi_build) {
ACPI_BUILD_DPRINTF("ACPI build disabled. Bailing out.\n");
return;
... | [
1,
0
] |
qemu | hw/sparc/sun4m.c | void helper_done(CPUSPARCState *env)
{
trap_state *tsptr = cpu_tsptr(env);
env->pc = tsptr->tnpc;
env->npc = tsptr->tnpc + 4;
cpu_put_ccr(env, tsptr->tstate >> 32);
env->asi = (tsptr->tstate >> 24) & 0xff;
cpu_change_pstate(env, (tsptr->tstate >> 8) & 0xf3f);
cpu_put_cwp64(env, tsptr->tstate & 0xf... | [
1,
0
] |
FFmpeg | libavcodec/sanm.c | static int process_frame_obj(SANMVideoContext *ctx) {
uint16_t codec, top, left, w, h;
codec = bytestream2_get_le16u(&ctx->gb);
left = bytestream2_get_le16u(&ctx->gb);
top = bytestream2_get_le16u(&ctx->gb);
w = bytestream2_get_le16u(&ctx->gb);
h = bytestream2_get_le16u(&ctx->gb);
if (ctx->width < left + w... | [
1,
0
] |
FFmpeg | libavcodec/eatqi.c | static void tqi_calculate_qtable(TqiContext *t, int quant)
{
const int qscale = (215 - 2 * quant) * 5;
int i;
t->intra_matrix[0] =
(ff_inv_aanscales[0] * ff_mpeg1_default_intra_matrix[0]) >> 11;
for (i = 1; i < 64; i++)
t->intra_matrix[i] =
(ff_inv_aanscales[i] * ff_mpeg1_default_intra_m... | [
1,
0
] |
FFmpeg | libavformat/oggenc.c | static int ogg_write_trailer(AVFormatContext *s)
{
int i;
/* flush current page */
for (i = 0; i < s->nb_streams; i++)
ogg_buffer_page(s, s->streams[i]->priv_data);
ogg_write_pages(s, 1);
for (i = 0; i < s->nb_streams; i++) {
AVStream *st = s->streams[i];
OGGStreamContext *oggstream = st-... | [
1,
0
] |
FFmpeg | libavformat/4xm.c | static int roq_probe(AVProbeData *p)
{
if (p->buf_size < 6)
return 0;
if ((AV_RL16(&p->buf[0]) != RoQ_MAGIC_NUMBER) ||
(AV_RL32(&p->buf[2]) != 0xFFFFFFFF))
return 0;
return AVPROBE_SCORE_MAX;
} | [
1,
0
] |
qemu | nbd/server.c | 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_s... | [
1,
0
] |
qemu | tests/acpi-test.c | 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 = ... | [
1,
0
] |
qemu | block/iscsi.c | 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... | [
0,
0
] |
qemu | HACKING | static bool sys_ops_accepts(void *opaque, target_phys_addr_t addr,
unsigned size, bool is_write)
{
return is_write && size == 4;
} | [
0,
0
] |
qemu | hw/ppc/spapr_hcall.c | static target_ulong h_set_mode_resouce_addr_trans_mode(PowerPCCPU *cpu,
target_ulong mflags,
target_ulong value1,
target_ulong value2)
{
CPUState *c... | [
1,
0
] |
qemu | buffered_file.c | static inline void menelaus_rtc_stop(MenelausState *s)
{
qemu_del_timer(s->rtc.hz_tm);
s->rtc.next -= qemu_get_clock(rt_clock);
if (s->rtc.next < 1)
s->rtc.next = 1;
} | [
0,
0
] |
FFmpeg | libavformat/v210.c | 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, pk... | [
1,
0
] |
qemu | exec.c | 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... | [
0,
0
] |
qemu | target-arm/translate-a64.c | 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(... | [
1,
0
] |
qemu | block/block-backend.c | int ide_get_geometry(BusState *bus, int unit,
int16_t *cyls, int8_t *heads, int8_t *secs)
{
IDEState *s = &DO_UPCAST(IDEBus, qbus, bus)->ifs[unit];
if (s->drive_kind != IDE_HD || !s->bs) {
return -1;
}
*cyls = s->cylinders;
*heads = s->heads;
*secs = s->sectors;
return 0;... | [
1,
0
] |
qemu | target/ppc/Makefile.objs | int ppc64_v3_handle_mmu_fault(PowerPCCPU *cpu, vaddr eaddr, int rwx,
int mmu_idx)
{
if (ppc64_radix_guest(cpu)) { /* Guest uses radix */
/* TODO - Unsupported */
error_report("Guest Radix Support Unimplemented");
exit(1);
} else { /* Guest uses hash */
return pp... | [
0,
1
] |
qemu | include/qemu/osdep.h | 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;
... | [
0,
0
] |
FFmpeg | libavutil/cpu.c | 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 |... | [
1,
0
] |
qemu | Makefile.objs | static void put_uint32(QEMUFile *f, void *pv, size_t size)
{
uint32_t *v = pv;
qemu_put_be32s(f, v);
} | [
1,
0
] |
qemu | hw/ide/core.c | void ide_data_writew(void *opaque, uint32_t addr, uint32_t val)
{
IDEBus *bus = opaque;
IDEState *s = idebus_active_if(bus);
uint8_t *p;
/* PIO data access allowed only when DRQ bit is set */
if (!(s->status & DRQ_STAT))
return;
p = s->data_ptr;
*(uint16_t *)p = le16_to_cpu(val);
p += 2;
... | [
1,
0
] |
qemu | hw/spapr.c | 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]... | [
1,
0
] |
FFmpeg | libavcodec/flacenc.c | 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];
... | [
1,
0
] |
qemu | iohandler.c | 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->c... | [
1,
0
] |
qemu | include/ui/console.h | char *vnc_display_local_addr(DisplayState *ds)
{
VncDisplay *vs = ds ? (VncDisplay *)ds->opaque : vnc_display;
return vnc_socket_local_addr("%s:%s", vs->lsock);
} | [
1,
0
] |
FFmpeg | libavcodec/dxva2_h264.c | 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 i... | [
1,
0
] |
qemu | target-mips/dsp_helper.c | 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) |
... | [
1,
0
] |
qemu | net/dump.c | 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_... | [
1,
0
] |
qemu | Makefile.objs | 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;
} | [
1,
1
] |
qemu | target-sparc/translate.c | static inline void gen_op_multiply(TCGv dst, TCGv src1, TCGv src2, int sign_ext)
{
TCGv_i32 r_src1, r_src2;
TCGv_i64 r_temp, r_temp2;
r_src1 = tcg_temp_new_i32();
r_src2 = tcg_temp_new_i32();
tcg_gen_trunc_tl_i32(r_src1, src1);
tcg_gen_trunc_tl_i32(r_src2, src2);
r_temp = tcg_temp_new_i64();
r_... | [
0,
0
] |
qemu | migration/qemu-file.c | static int do_compress_ram_page(CompressParam *param)
{
int bytes_sent, blen;
uint8_t *p;
RAMBlock *block = param->block;
ram_addr_t offset = param->offset;
p = block->host + (offset & TARGET_PAGE_MASK);
bytes_sent = save_page_header(param->file, block,
offset |
... | [
0,
0
] |
qemu | block/backup.c | static int get_fw_cfg_order(FWCfgState *s, const char *name)
{
int i;
if (s->fw_cfg_order_override > 0) {
return s->fw_cfg_order_override;
}
for (i = 0; i < ARRAY_SIZE(fw_cfg_order); i++) {
if (fw_cfg_order[i].name == NULL) {
continue;
}
if (strcmp(name, fw_cfg_order[i].name) == 0)... | [
0,
0
] |
qemu | async.c | AioContext *aio_context_new(void)
{
return (AioContext *)g_source_new(&aio_source_funcs, sizeof(AioContext));
} | [
1,
0
] |
qemu | hw/ide/ich.c | static void virtio_blk_class_init(ObjectClass *klass, void *data)
{
DeviceClass *dc = DEVICE_CLASS(klass);
PCIDeviceClass *k = PCI_DEVICE_CLASS(klass);
k->init = virtio_blk_init_pci;
k->exit = virtio_blk_exit_pci;
k->vendor_id = PCI_VENDOR_ID_REDHAT_QUMRANET;
k->device_id = PCI_DEVICE_ID_VIRTIO_BLOCK... | [
0,
0
] |
qemu | hw/ppc/spapr_drc.c | void spapr_drc_attach(sPAPRDRConnector *drc, DeviceState *d, void *fdt,
int fdt_start_offset, bool coldplug, Error **errp)
{
trace_spapr_drc_attach(spapr_drc_index(drc));
if (drc->isolation_state != SPAPR_DR_ISOLATION_STATE_ISOLATED) {
error_setg(errp, "an attached device is still awa... | [
0,
0
] |
qemu | target/arm/translate.c | static void gen_exception_internal_insn(DisasContext *s, int offset, int excp)
{
gen_set_condexec(s);
gen_set_pc_im(s, s->pc - offset);
gen_exception_internal(excp);
s->is_jmp = DISAS_JUMP;
} | [
0,
0
] |
qemu | cpu-exec.c | static void gen_thumb2_parallel_addsub(int op1, int op2, TCGv a, TCGv b)
{
TCGv tmp;
switch (op1) {
#define gen_pas_helper(name) glue(gen_helper_, name)(a, a, b, tmp)
case 0:
tmp = tcg_temp_new(TCG_TYPE_PTR);
tcg_gen_addi_ptr(tmp, cpu_env, offsetof(CPUState, GE));
PAS_OP(s)
break;
case... | [
1,
0
] |
qemu | tests/ahci-test.c | static void test_io_rw_interface(enum AddrMode lba48, enum IOMode dma,
unsigned bufsize, uint64_t sector)
{
AHCIQState *ahci;
ahci = ahci_boot_and_enable();
ahci_test_io_rw_simple(ahci, bufsize, sector,
io_cmds[dma][lba48][IO_READ],
... | [
0,
0
] |
qemu | block.c | static int bdrv_inherited_flags(int flags)
{
/* Enable protocol handling, disable format probing for bs->file */
flags |= BDRV_O_PROTOCOL;
/* Our block drivers take care to send flushes and respect unmap policy,
* so we can enable both unconditionally on lower layers. */
flags |= BDRV_O_CACHE_WB | BDRV... | [
0,
0
] |
qemu | qemu-char.c | 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... | [
1,
1
] |
FFmpeg | libavcodec/ituh263dec.c | static int h263_decode_gob_header(MpegEncContext *s)
{
unsigned int val, gob_number;
int left;
/* Check for GOB Start Code */
val = show_bits(&s->gb, 16);
if (val)
return -1;
/* We have a GBSC probably with GSTUFF */
skip_bits(&s->gb, 16); /* Drop the zeros */
left = get_bits_left(&s->gb);... | [
1,
0
] |
FFmpeg | libavformat/mov.c | static int mov_read_wide(MOVContext *c, ByteIOContext *pb, MOV_atom_t atom)
{
int err;
uint32_t type;
#ifdef DEBUG
print_atom("wide", atom);
debug_indent++;
#endif
if (atom.size < 8)
return 0; /* continue */
if (get_be32(pb) != 0) { /* 0 sized mdat atom... use the 'wide' atom size */
url_... | [
1,
0
] |
qemu | net.c | static void net_socket_send(void *opaque)
{
NetSocketState *s = opaque;
int l, size, err;
uint8_t buf1[4096];
const uint8_t *buf;
size = recv(s->fd, buf1, sizeof(buf1), 0);
if (size < 0) {
err = socket_error();
if (err != EWOULDBLOCK)
goto eoc;
} else if (size == 0) {
/* end ... | [
1,
0
] |
qemu | posix-aio-compat.c | static int posix_aio_process_queue(void *opaque)
{
PosixAioState *s = opaque;
struct qemu_paiocb *acb, **pacb;
int ret;
int result = 0;
for (;;) {
pacb = &s->first_aio;
for (;;) {
acb = *pacb;
if (!acb)
return result;
ret = qemu_paio_error(acb);
if (ret == ... | [
1,
0
] |
qemu | ui/trace-events | static int protocol_client_auth(VncState *vs, uint8_t *data, size_t len)
{
/* We only advertise 1 auth scheme at a time, so client
* must pick the one we sent. Verify this */
if (data[0] != vs->auth) { /* Reject auth */
VNC_DEBUG("Reject auth %d because it didn't match advertized\n",
(int)... | [
1,
0
] |
qemu | scripts/coverity-model.c | void *g_try_malloc0(size_t n_bytes)
{
__coverity_negative_sink__(n_bytes);
return calloc(1, n_bytes == 0 ? 1 : n_bytes);
} | [
1,
0
] |
qemu | hw/display/virtio-gpu-3d.c | static void virgl_cmd_get_capset_info(VirtIOGPU *g,
struct virtio_gpu_ctrl_command *cmd)
{
struct virtio_gpu_get_capset_info info;
struct virtio_gpu_resp_capset_info resp;
VIRTIO_GPU_FILL_CMD(info);
if (info.capset_index == 0) {
resp.capset_id = VIRTIO_GPU_CAPSET... | [
1,
0
] |
qemu | hw/s390x/s390-virtio-bus.c | static int virtio_rng_pci_init(VirtIOPCIProxy *vpci_dev)
{
VirtIORngPCI *vrng = VIRTIO_RNG_PCI(vpci_dev);
DeviceState *vdev = DEVICE(&vrng->vdev);
qdev_set_parent_bus(vdev, BUS(&vpci_dev->bus));
if (qdev_init(vdev) < 0) {
return -1;
}
object_property_set_link(OBJECT(vrng),
... | [
1,
0
] |
FFmpeg | ffserver.c | AVStream *add_av_stream1(FFStream *stream, AVCodecContext *codec)
{
AVStream *fst;
fst = av_mallocz(sizeof(AVStream));
if (!fst)
return NULL;
fst->priv_data = av_mallocz(sizeof(FeedData));
memcpy(&fst->codec, codec, sizeof(AVCodecContext));
stream->streams[stream->nb_streams++] = fst;
return ... | [
1,
0
] |
FFmpeg | libavformat/aiffdec.c | static int asf_write_trailer(AVFormatContext *s)
{
ASFContext *asf = s->priv_data;
int64_t file_size, data_size;
/* flush the current packet */
if (asf->pb.buf_ptr > asf->pb.buffer)
flush_packet(s);
/* write index */
data_size = avio_tell(s->pb);
if ((!asf->is_streamed) && (asf->nb_index_coun... | [
1,
0
] |
FFmpeg | libavcodec/internal.h | int ff_alloc_packet(AVPacket *avpkt, int size)
{
if (size > INT_MAX - FF_INPUT_BUFFER_PADDING_SIZE)
return AVERROR(EINVAL);
if (avpkt->data) {
void *destruct = avpkt->destruct;
if (avpkt->size < size)
return AVERROR(EINVAL);
av_init_packet(avpkt);
avpkt->destruct = destruct;
... | [
0,
0
] |
FFmpeg | libavdevice/alsa-audio-dec.c | static int audio_read_packet(AVFormatContext *s1, AVPacket *pkt)
{
AlsaData *s = s1->priv_data;
AVStream *st = s1->streams[0];
int res;
snd_htimestamp_t timestamp;
snd_pcm_uframes_t ts_delay;
if (av_new_packet(pkt, s->period_size) < 0) {
return AVERROR(EIO);
}
while ((res = snd_pcm_readi(s-... | [
1,
0
] |
qemu | hw/scsi/virtio-scsi.c | static void virtio_scsi_request_cancelled(SCSIRequest *r)
{
VirtIOSCSIReq *req = r->hba_private;
if (!req) {
return;
}
if (req->dev->resetting) {
req->resp.cmd->response = VIRTIO_SCSI_S_RESET;
} else {
req->resp.cmd->response = VIRTIO_SCSI_S_ABORTED;
}
virtio_scsi_complete_cmd_req(req... | [
0,
0
] |
qemu | net/checksum.c | void net_checksum_calculate(uint8_t *data, int length)
{
int hlen, plen, proto, csum_offset;
uint16_t csum;
if ((data[14] & 0xf0) != 0x40)
return; /* not IPv4 */
hlen = (data[14] & 0x0f) * 4;
plen = (data[16] << 8 | data[17]) - hlen;
proto = data[23];
switch (proto) {
case PROTO_TCP:
... | [
1,
0
] |
qemu | block/block-backend.c | static int m25p80_init(SSISlave *ss)
{
DriveInfo *dinfo;
Flash *s = M25P80(ss);
M25P80Class *mc = M25P80_GET_CLASS(s);
s->pi = mc->pi;
s->size = s->pi->sector_size * s->pi->n_sectors;
s->dirty_page = -1;
s->storage = qemu_blockalign(s->bdrv, s->size);
dinfo = drive_get_next(IF_MTD);
if (dinf... | [
1,
1
] |
qemu | block/crypto.c | static ssize_t block_crypto_init_func(QCryptoBlock *block,
void *opaque,
size_t headerlen,
Error **errp)
{
struct BlockCryptoCreateData *data = opaque;
int ret;
/* User provided size should ref... | [
0,
0
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.