Projectname large_stringclasses 15
values | Filepath large_stringlengths 4 106 ⌀ | Function large_stringlengths 11 3.45k | Label list |
|---|---|---|---|
qemu | hw/usb/redirect.c | static int usbredir_handle_status(USBRedirDevice *dev,
int status, int actual_len)
{
switch (status) {
case usb_redir_success:
return actual_len;
case usb_redir_stall:
return USB_RET_STALL;
case usb_redir_cancelled:
WARNING("returning cancelled packet to HC... | [
0,
0
] |
qemu | hw/xen/xen_pt.h | static int xen_pt_exp_rom_bar_reg_write(XenPCIPassthroughState *s,
XenPTReg *cfg_entry, uint32_t *val,
uint32_t dev_value, uint32_t valid_mask)
{
XenPTRegInfo *reg = cfg_entry->reg;
XenPTRegion *base = NULL;
PCIDevice *d = (PCID... | [
0,
0
] |
FFmpeg | libavformat/rdt.c | static PayloadContext *vorbis_new_extradata(void)
{
return av_mallocz(sizeof(PayloadContext));
} | [
0,
0
] |
qemu | disas/s390.c | init_disasm(struct disassemble_info *info)
{
const struct s390_opcode *opcode;
const struct s390_opcode *opcode_end;
memset(opc_index, 0, sizeof(opc_index));
opcode_end = s390_opcodes + s390_num_opcodes;
for (opcode = s390_opcodes; opcode < opcode_end; opcode++)
{
opc_index[(int)opcode->opcode[0... | [
1,
0
] |
qemu | net/colo.c | void connection_destroy(void *opaque)
{
Connection *conn = opaque;
g_queue_foreach(&conn->primary_list, packet_destroy, NULL);
g_queue_free(&conn->primary_list);
g_queue_foreach(&conn->secondary_list, packet_destroy, NULL);
g_queue_free(&conn->secondary_list);
g_slice_free(Connection, conn);
} | [
1,
0
] |
qemu | hw/mcf5206.c | static void m5206_mbar_writel(void *opaque, target_phys_addr_t offset,
uint32_t value)
{
m5206_mbar_state *s = (m5206_mbar_state *)opaque;
int width;
offset &= 0x3ff;
if (offset > 0x200) {
hw_error("Bad MBAR write offset 0x%x", (int)offset);
}
width = m5206_mbar_wid... | [
1,
0
] |
FFmpeg | libavcodec/aacdec.c | static int decode_audio_specific_config(AACContext *ac,
AVCodecContext *avctx,
MPEG4AudioConfig *m4ac,
const uint8_t *data, int bit_size,
int sync_extension... | [
1,
0
] |
qemu | hw/pl050.c | static uint64_t pl050_read(void *opaque, hwaddr offset,
unsigned size)
{
pl050_state *s = (pl050_state *)opaque;
if (offset >= 0xfe0 && offset < 0x1000)
return pl050_id[(offset - 0xfe0) >> 2];
switch (offset >> 2) {
case 0: /* KMICR */
return s->cr;
case 1: /* KMIST... | [
1,
0
] |
qemu | block.c | BlockdevOnError bdrv_get_on_error(BlockDriverState *bs, bool is_read)
{
return is_read ? bs->on_read_error : bs->on_write_error;
} | [
0,
0
] |
qemu | block.c | static int openfile(char *name, int flags, int growable, QDict *opts)
{
Error *local_err = NULL;
if (qemuio_bs) {
fprintf(stderr, "file open already, try 'help close'\n");
return 1;
}
if (growable) {
if (bdrv_open(&qemuio_bs, name, NULL, opts, flags | BDRV_O_PROTOCOL,
NULL,... | [
0,
0
] |
qemu | target-ppc/fpu_helper.c | uint64_t helper_fctiw(CPUPPCState *env, uint64_t arg)
{
CPU_DoubleU farg;
farg.ll = arg;
if (unlikely(float64_is_signaling_nan(farg.d))) {
/* sNaN conversion */
farg.ll = fload_invalid_op_excp(env, POWERPC_EXCP_FP_VXSNAN |
POWERPC_EXCP_FP_VXCVI);
} el... | [
0,
1
] |
qemu | tcg/s390/tcg-target.h | bool tcg_target_deposit_valid(int ofs, int len)
{
return (facilities & FACILITY_GEN_INST_EXT) != 0;
} | [
1,
0
] |
qemu | net/colo-compare.c | static void colo_compare_finalize(Object *obj)
{
CompareState *s = COLO_COMPARE(obj);
qemu_chr_fe_deinit(&s->chr_pri_in, false);
qemu_chr_fe_deinit(&s->chr_sec_in, false);
qemu_chr_fe_deinit(&s->chr_out, false);
g_main_loop_quit(s->compare_loop);
qemu_thread_join(&s->thread);
/* Release all unhand... | [
0,
0
] |
qemu | HACKING | static int megasas_handle_abort(MegasasState *s, MegasasCmd *cmd)
{
uint64_t abort_ctx = le64_to_cpu(cmd->frame->abort.abort_context);
target_phys_addr_t abort_addr, addr_hi, addr_lo;
MegasasCmd *abort_cmd;
addr_hi = le32_to_cpu(cmd->frame->abort.abort_mfi_addr_hi);
addr_lo = le32_to_cpu(cmd->frame->abo... | [
1,
0
] |
qemu | Makefile.objs | static bool aio_epoll_enabled(AioContext *ctx)
{
/* Fall back to ppoll when external clients are disabled. */
return !aio_external_disabled(ctx) && ctx->epoll_enabled;
} | [
0,
0
] |
FFmpeg | libavformat/dv.c | int avpriv_dv_produce_packet(DVDemuxContext *c, AVPacket *pkt,
uint8_t *buf, int buf_size)
{
int size, i;
uint8_t *ppcm[4] = {0};
if (buf_size < DV_PROFILE_BYTES ||
!(c->sys = avpriv_dv_frame_profile(c->sys, buf, buf_size)) ||
buf_size < c->sys->frame_size) {
r... | [
1,
1
] |
qemu | cpu-exec.c | void arm_cpu_do_interrupt(CPUState *cs) {
ARMCPU *cpu = ARM_CPU(cs);
CPUARMState *env = &cpu->env;
unsigned int new_el = env->exception.target_el;
assert(!arm_feature(env, ARM_FEATURE_M));
arm_log_exception(cs->exception_index);
qemu_log_mask(CPU_LOG_INT, "...from EL%d to EL%d\n", arm_current_el(env),
... | [
1,
0
] |
qemu | block/quorum.c | static BlockDriverAIOCB *quorum_aio_readv(BlockDriverState *bs,
int64_t sector_num,
QEMUIOVector *qiov,
int nb_sectors,
BlockDriverCompletionFunc *c... | [
1,
0
] |
qemu | target/openrisc/cpu.h | void HELPER(ove)(CPUOpenRISCState *env, target_ulong test)
{
if (unlikely(test)) {
OpenRISCCPU *cpu = openrisc_env_get_cpu(env);
CPUState *cs = CPU(cpu);
cs->exception_index = EXCP_RANGE;
cpu_loop_exit_restore(cs, GETPC());
}
} | [
1,
0
] |
qemu | block/cloop.c | static int cloop_open(BlockDriverState *bs, QDict *options, int flags,
Error **errp) {
BDRVCloopState *s = bs->opaque;
uint32_t offsets_size, max_compressed_block_size = 1, i;
int ret;
bs->read_only = 1;
/* read header */
ret = bdrv_pread(bs->file, 128, &s->block_size, 4);
if (ret < ... | [
1,
0
] |
qemu | block-qcow.c | static BlockDriverAIOCB *
qcow_aio_readv(BlockDriverState *bs,
int64_t sector_num, QEMUIOVector *qiov, int nb_sectors,
BlockDriverCompletionFunc *cb, void *opaque)
{
QCowAIOCB *acb;
acb = qemu_aio_get(bs, cb, opaque);
if (!acb)
return NULL;
acb->hd_aiocb = NULL;
acb-... | [
0,
0
] |
qemu | hw/usb-hid.c | static int usb_hid_handle_data(USBDevice *dev, USBPacket *p)
{
USBHIDState *us = DO_UPCAST(USBHIDState, dev, dev);
HIDState *hs = &us->hid;
uint8_t buf[p->iov.size];
int ret = 0;
switch (p->pid) {
case USB_TOKEN_IN:
if (p->devep == 1) {
int64_t curtime = qemu_get_clock_ns(vm_clock);
... | [
1,
0
] |
qemu | Makefile.objs | static int tight_fill_palette(VncState *vs, int x, int y,
size_t count, uint32_t *bg, uint32_t *fg,
struct QDict **palette)
{
int max;
max = count / tight_conf[vs->tight_compression].idx_max_colors_divisor;
if (max < 2 &&
count >= tight_conf... | [
0,
0
] |
qemu | hw/ppc/spapr_iommu.c | void *kvmppc_create_spapr_tce(uint32_t liobn, uint32_t window_size, int *pfd,
bool vfio_accel)
{
struct kvm_create_spapr_tce args = {
.liobn = liobn,
.window_size = window_size,
};
long len;
int fd;
void *table;
/* Must set fd to -1 so we don't try to munm... | [
1,
1
] |
qemu | monitor.c | static int term_can_read(void *opaque)
{
return 128;
} | [
0,
0
] |
qemu | ui/vnc.c | static int vnc_display_listen_addr(VncDisplay *vd,
SocketAddress *addr,
const char *name,
QIOChannelSocket ***lsock,
guint **lsock_tag,
size... | [
0,
0
] |
qemu | hmp.c | static SpiceChannelList *qmp_query_spice_channels(void)
{
SpiceChannelList *cur_item = NULL, *head = NULL;
ChannelList *item;
QTAILQ_FOREACH(item, &channel_list, link) {
SpiceChannelList *chan;
char host[NI_MAXHOST], port[NI_MAXSERV];
struct sockaddr *paddr;
socklen_t plen;
assert(ite... | [
1,
1
] |
qemu | HACKING | static void bonito_ldma_writel(void *opaque, target_phys_addr_t addr,
uint64_t val, unsigned size)
{
PCIBonitoState *s = opaque;
((uint32_t *)(&s->bonldma))[addr / sizeof(uint32_t)] = val & 0xffffffff;
} | [
1,
0
] |
qemu | block/io.c | static int64_t coroutine_fn vpc_co_get_block_status(BlockDriverState *bs,
int64_t sector_num,
int nb_sectors, int *pnum)
{
BDRVVPCState *s = bs->opaque;
VHDFooter *footer = (VHDFooter *)s->footer_buf;
int6... | [
1,
0
] |
qemu | block/sheepdog.c | static coroutine_fn int sd_co_writev(BlockDriverState *bs, int64_t sector_num,
int nb_sectors, QEMUIOVector *qiov)
{
SheepdogAIOCB acb;
int ret;
int64_t offset = (sector_num + nb_sectors) * BDRV_SECTOR_SIZE;
BDRVSheepdogState *s = bs->opaque;
if (offset > s->inode.v... | [
0,
0
] |
qemu | linux-user/qemu.h | long do_rt_sigreturn(CPUS390XState *env)
{
rt_sigframe *frame;
abi_ulong frame_addr = env->regs[15];
qemu_log("%s: frame_addr 0x%llx\n", __FUNCTION__,
(unsigned long long)frame_addr);
sigset_t set;
if (!lock_user_struct(VERIFY_READ, frame, frame_addr, 1)) {
goto badframe;
}
target_... | [
0,
0
] |
FFmpeg | libavcodec/mpegvideo.h | static av_cold void init_mv_table(MVTable *tab)
{
int i, x, y;
tab->table_mv_index = av_malloc(sizeof(uint16_t) * 4096);
/* mark all entries as not used */
for (i = 0; i < 4096; i++)
tab->table_mv_index[i] = tab->n;
for (i = 0; i < tab->n; i++) {
x = tab->table_mvx[i];
y = tab->table_mvy[... | [
0,
0
] |
qemu | docs/qapi-code-gen.txt | static const QListEntry *qmp_input_push(QmpInputVisitor *qiv, QObject *obj,
void *qapi, Error **errp)
{
GHashTable *h;
StackObject *tos = g_new0(StackObject, 1);
assert(obj);
tos->obj = obj;
tos->qapi = qapi;
if (qiv->strict && qobject_type(obj) == QTYPE_QDICT... | [
0,
0
] |
qemu | Makefile.objs | int aio_bh_poll(AioContext *ctx)
{
QEMUBH *bh, **bhp, *next;
int ret;
bool deleted = false;
qemu_lockcnt_inc(&ctx->list_lock);
ret = 0;
for (bh = atomic_rcu_read(&ctx->first_bh); bh; bh = next) {
next = atomic_rcu_read(&bh->next);
/* The atomic_xchg is paired with the one in qemu_bh_schedul... | [
0,
0
] |
qemu | HACKING | static uint64_t dbdma_read(void *opaque, target_phys_addr_t addr,
unsigned size)
{
uint32_t value;
int channel = addr >> DBDMA_CHANNEL_SHIFT;
DBDMAState *s = opaque;
DBDMA_channel *ch = &s->channels[channel];
int reg = (addr - (channel << DBDMA_CHANNEL_SHIFT)) >> 2;
value ... | [
1,
0
] |
qemu | slirp/bootp.c | static void dhcp_decode(const uint8_t *buf, int size,
int *pmsg_type)
{
const uint8_t *p, *p_end;
int len, tag;
*pmsg_type = 0;
p = buf;
p_end = buf + size;
if (size < 5)
return;
if (memcmp(p, rfc1533_cookie, 4) != 0)
return;
p += 4;
while (p < p_end) {
... | [
0,
0
] |
qemu | hw/display/cirrus_vga.c | static bool blit_region_is_unsafe(struct CirrusVGAState *s,
int32_t pitch, int32_t addr)
{
if (!pitch) {
return true;
}
if (pitch < 0) {
int64_t min = addr
+ ((int64_t)s->cirrus_blt_height - 1) * pitch;
int32_t max = addr
+... | [
1,
0
] |
qemu | hw/intc/arm_gic.c | void armv7m_nvic_complete_irq(void *opaque, int irq)
{
nvic_state *s = (nvic_state *)opaque;
if (irq >= 16)
irq += 16;
gic_complete_irq(&s->gic, 0, irq);
} | [
0,
0
] |
qemu | hw/i386/amd_iommu.c | static void amdvi_iommu_notify_flag_changed(MemoryRegion *iommu,
IOMMUNotifierFlag old,
IOMMUNotifierFlag new)
{
AMDVIAddressSpace *as = container_of(iommu, AMDVIAddressSpace, iommu);
hw_error("device %02x.%02x.%x requires ... | [
0,
0
] |
qemu | HACKING | static void m5208_sys_write(void *opaque, target_phys_addr_t addr,
uint64_t value, unsigned size)
{
hw_error("m5208_sys_write: Bad offset 0x%x\n", (int)addr);
} | [
0,
0
] |
qemu | hw/sd.c | static void sd_response_r1_make(SDState *sd, uint8_t *response)
{
uint32_t status = sd->card_status;
/* Clear the "clear on read" status bits (except APP_CMD) */
sd->card_status &= ~CARD_STATUS_C | APP_CMD;
response[0] = (status >> 24) & 0xff;
response[1] = (status >> 16) & 0xff;
response[2] = (statu... | [
1,
0
] |
FFmpeg | libavcodec/simple_idct.c | void FUNC(ff_simple_idct_add)(uint8_t *dest_, int line_size, DCTELEM *block)
{
pixel *dest = (pixel *)dest_;
int i;
line_size /= sizeof(pixel);
for (i = 0; i < 8; i++)
FUNC(idctRowCondDC)(block + i * 8);
for (i = 0; i < 8; i++)
FUNC(idctSparseColAdd)(dest + i, line_size, block + i);
} | [
1,
0
] |
FFmpeg | libavcodec/aac_ac3_parser.h | int64_t av_get_channel_layout(const char *name)
{
int i = 0;
do {
if (!strcmp(channel_layout_map[i].name, name))
return channel_layout_map[i].layout;
i++;
} while (channel_layout_map[i].name);
return 0;
} | [
0,
0
] |
qemu | hw/core/qdev.c | static DevicePropertyInfo *make_device_property_info(ObjectClass *klass,
const char *name,
const char *default_type,
const char *description)
{
DeviceProp... | [
1,
1
] |
qemu | check-qdict.c | START_TEST(qdict_stress_test)
{
size_t lines;
char key[128];
FILE *test_file;
QDict *qdict;
QString *value;
const char *test_file_path = "qdict-test-data.txt";
test_file = fopen(test_file_path, "r");
fail_unless(test_file != NULL);
// Create the dict
qdict = qdict_new();
fail_unless(qd... | [
1,
0
] |
qemu | linux-user/mmap.c | static int mmap_frag(abi_ulong real_start,
abi_ulong start, abi_ulong end,
int prot, int flags, int fd, abi_ulong offset)
{
abi_ulong real_end, addr;
void *host_start;
int prot1, prot_new;
real_end = real_start + qemu_host_page_size;
host_start = g2h(real_star... | [
1,
0
] |
qemu | accel/tcg/cpu-exec.c | void tb_phys_invalidate(TranslationBlock *tb, tb_page_addr_t page_addr)
{
CPUState *cpu;
PageDesc *p;
uint32_t h;
tb_page_addr_t phys_pc;
assert_tb_locked();
atomic_set(&tb->invalid, true);
/* remove the TB from the hash list */
phys_pc = tb->page_addr[0] + (tb->pc & ~TARGET_PAGE_MASK);
h = ... | [
1,
0
] |
qemu | fsdev/virtfs-proxy-helper.c | static int v9fs_receive_status(V9fsProxy *proxy,
struct iovec *reply, int *status)
{
int retval;
ProxyHeader header;
*status = 0;
reply->iov_len = 0;
retval = socket_read(proxy->sockfd, reply->iov_base, PROXY_HDR_SZ);
if (retval < 0) {
return retval;
}
reply-... | [
1,
0
] |
qemu | block/iscsi.c | static unsigned long *iscsi_allocationmap_init(IscsiLun *iscsilun)
{
return bitmap_try_new(DIV_ROUND_UP(sector_lun2qemu(iscsilun->num_blocks,
iscsilun),
iscsilun->cluster_sectors));
} | [
0,
0
] |
qemu | acl.c | void unregister_savevm(const char *idstr, void *opaque)
{
SaveStateEntry *se, *new_se;
TAILQ_FOREACH_SAFE(se, &savevm_handlers, entry, new_se) {
if (strcmp(se->idstr, idstr) == 0 && se->opaque == opaque) {
TAILQ_REMOVE(&savevm_handlers, se, entry);
qemu_free(se);
}
}
} | [
1,
0
] |
qemu | block/sheepdog.c | static int coroutine_fn sd_co_flush_to_disk(BlockDriverState *bs)
{
BDRVSheepdogState *s = bs->opaque;
SheepdogObjReq hdr = {0};
SheepdogObjRsp *rsp = (SheepdogObjRsp *)&hdr;
SheepdogInode *inode = &s->inode;
int ret;
unsigned int wlen = 0, rlen = 0;
if (s->cache_flags != SD_FLAG_CMD_CACHE) {
... | [
1,
0
] |
FFmpeg | libavfilter/vf_spp.c | static void store_slice16_c(uint16_t *dst, const uint16_t *src,
int dst_linesize, int src_linesize,
int width, int height, int log2_scale,
const uint8_t dither[8][8])
{
int y, x;
#define STORE16(pos) do {
temp = ((src[x + y *... | [
1,
0
] |
qemu | bsd-user/strace.c | print_execve(const struct syscallname *name,
abi_long arg1, abi_long arg2, abi_long arg3,
abi_long arg4, abi_long arg5, abi_long arg6)
{
abi_ulong arg_ptr_addr;
char *s;
if (!(s = lock_user_string(arg1)))
return;
gemu_log("%s(\"%s\",{", name->name, s);
unlock_user(s, arg... | [
1,
0
] |
FFmpeg | libavcodec/indeo3.c | static int decode_plane(Indeo3DecodeContext *ctx, AVCodecContext *avctx,
Plane *plane, const uint8_t *data, int32_t data_size,
int32_t strip_width)
{
Cell curr_cell;
int num_vectors;
/* each plane data starts with mc_vector_count field, */
/* an optional ar... | [
1,
0
] |
qemu | Makefile.objs | int blk_mig_active(void)
{
return !QSIMPLEQ_EMPTY(&block_mig_state.bmds_list);
} | [
1,
0
] |
qemu | block/block-backend.c | static int scsi_disk_emulate_read_toc(SCSIRequest *req, uint8_t *outbuf)
{
SCSIDiskState *s = DO_UPCAST(SCSIDiskState, qdev, req->dev);
int start_track, format, msf, toclen;
uint64_t nb_sectors;
msf = req->cmd.buf[1] & 2;
format = req->cmd.buf[2] & 0xf;
start_track = req->cmd.buf[6];
bdrv_get_geom... | [
1,
0
] |
qemu | aio-posix.c | bool aio_dispatch(AioContext *ctx)
{
bool progress;
progress = aio_bh_poll(ctx);
progress |= aio_dispatch_handlers(ctx, INVALID_HANDLE_VALUE);
progress |= timerlistgroup_run_timers(&ctx->tlg);
return progress;
} | [
0,
0
] |
qemu | ui/gtk.c | static gboolean gd_motion_event(GtkWidget *widget, GdkEventMotion *motion,
void *opaque)
{
GtkDisplayState *s = opaque;
int dx, dy;
int x, y;
x = motion->x / s->scale_x;
y = motion->y / s->scale_y;
if (kbd_mouse_is_absolute()) {
dx = x * 0x7FFF / (ds_get_width(s-... | [
1,
0
] |
qemu | hw/i386/acpi-build.c | void pc_guest_info_init(PCMachineState *pcms)
{
int i, j;
pcms->apic_xrupt_override = kvm_allows_irq0_override();
pcms->numa_nodes = nb_numa_nodes;
pcms->node_mem = g_malloc0(pcms->numa_nodes *
sizeof *pcms->node_mem);
for (i = 0; i < nb_numa_nodes; i++) {
pcms->node_m... | [
1,
0
] |
qemu | block.c | void bdrv_invalidate_cache(BlockDriverState *bs, Error **errp)
{
Error *local_err = NULL;
int ret;
if (!bs->drv) {
return;
}
if (!(bs->open_flags & BDRV_O_INACTIVE)) {
return;
}
bs->open_flags &= ~BDRV_O_INACTIVE;
if (bs->drv->bdrv_invalidate_cache) {
bs->drv->bdrv_invalidate_cache... | [
0,
0
] |
qemu | hw/block/fdc.c | void DMA_schedule(int nchan) {} | [
0,
0
] |
qemu | block/qcow2-cluster.c | static int count_contiguous_clusters_unallocated(int nb_clusters,
uint64_t *l2_table,
QCow2ClusterType wanted_type)
{
int i;
assert(wanted_type == QCOW2_CLUSTER_ZERO ||
wanted_type == QCOW2_CLUSTER_UNALL... | [
1,
0
] |
qemu | arch_init.c | int qemu_show_nic_models(const char *arg, const char *const *models)
{
int i;
if (!arg || strcmp(arg, "?"))
return 0;
fprintf(stderr, "qemu: Supported NIC models: ");
for (i = 0; models[i]; i++)
fprintf(stderr, "%s%c", models[i], models[i + 1] ? ',' : '\n');
return 1;
} | [
1,
0
] |
qemu | hw/vfio/pci-quirks.c | static void vfio_vga_probe_nvidia_3d0_quirk(VFIOPCIDevice *vdev)
{
VFIOQuirk *quirk;
VFIONvidia3d0Quirk *data;
if (!vfio_pci_is(vdev, PCI_VENDOR_ID_NVIDIA, PCI_ANY_ID) ||
!vdev->bars[1].region.size) {
return;
}
quirk = g_malloc0(sizeof(*quirk));
quirk->data = data = g_malloc0(sizeof(*data)... | [
1,
0
] |
qemu | tests/check-qjson.c | static void float_number(void)
{
int i;
struct {
const char *encoded;
double decoded;
int skip;
} test_cases[] = {
{"32.43", 32.43},
{"0.222", 0.222},
{"-32.12313", -32.12313},
{"-32.20e-10", -32.20e-10, .skip = 1},
{},
};
for (i = 0; test_cases[i].encod... | [
1,
0
] |
qemu | tests/tcg/cris/check_abs.c | static inline int cris_abs(int n)
{
int r;
asm("abs\t%1, %0\n" : "=r"(r) : "r"(n));
return r;
} | [
1,
0
] |
qemu | hw/ide/ahci.c | static int bmdma_prepare_buf(IDEDMA *dma, int is_write)
{
BMDMAState *bm = DO_UPCAST(BMDMAState, dma, dma);
IDEState *s = bmdma_active_if(bm);
PCIDevice *pci_dev = PCI_DEVICE(bm->pci_dev);
struct {
uint32_t addr;
uint32_t size;
} prd;
int l, len;
pci_dma_sglist_init(&s->sg, pci_dev,
... | [
1,
0
] |
qemu | target-arm/cpu.c | static void xscale_cpar_write(CPUARMState *env, const ARMCPRegInfo *ri,
uint64_t value)
{
value &= 0x3fff;
if (env->cp15.c15_cpar != value) {
/* Changes cp0 to cp13 behavior, so needs a TB flush. */
tb_flush(env);
env->cp15.c15_cpar = value;
}
} | [
1,
0
] |
qemu | io/channel-websock.c | static char *qio_channel_websock_handshake_entry(const char *handshake,
size_t handshake_len,
const char *name)
{
char *begin, *end, *ret = NULL;
char *line = g_strdup_printf("%s%s: ",
... | [
1,
0
] |
qemu | block-migration.c | static int vhdx_create_new_headers(BlockDriverState *bs, uint64_t image_size,
uint32_t log_size)
{
int ret = 0;
VHDXHeader *hdr = NULL;
hdr = g_malloc0(sizeof(VHDXHeader));
hdr->signature = VHDX_HEADER_SIGNATURE;
hdr->sequence_number = g_random_int();
hdr->log_vers... | [
1,
0
] |
FFmpeg | libavutil/opt.c | const char *av_get_string(void *obj, const char *name, const AVOption **o_out,
char *buf, int buf_len)
{
const AVOption *o = av_opt_find(obj, name, NULL, 0, 0);
void *dst;
uint8_t *bin;
int len, i;
if (!o || o->offset <= 0)
return NULL;
if (o->type != FF_OPT_TYPE_STRING... | [
1,
0
] |
FFmpeg | libavcodec/mpegvideo.c | static void copy_context_before_encode(MpegEncContext *d, MpegEncContext *s,
int type) {
int i;
memcpy(d->last_mv, s->last_mv,
2 * 2 * 2 * sizeof(int)); // FIXME is memcpy faster then a loop?
/* mpeg1 */
d->mb_incr = s->mb_incr;
for (i = 0; i < 3; i++)
... | [
1,
1
] |
qemu | include/qapi/visitor.h | static void qobject_input_start_list(Visitor *v, const char *name,
GenericList **list, size_t size,
Error **errp)
{
QObjectInputVisitor *qiv = to_qiv(v);
QObject *qobj = qobject_input_get_object(qiv, name, true, errp);
const QListEntr... | [
1,
0
] |
FFmpeg | libavcodec/arm/h264idct_neon.S | static void FUNCC(pred16x16_vertical_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_vertical_add)(pix + block_offset[i],
... | [
1,
0
] |
qemu | block/raw-posix.c | static int net_socket_connect_init(VLANState *vlan,
const char *model,
const char *name,
const char *host_str)
{
NetSocketState *s;
int fd, connected, ret, err;
struct sockaddr_in saddr;
if (parse_ho... | [
1,
0
] |
qemu | hw/display/dpcd.c | static void aux_bus_class_init(ObjectClass *klass, void *data)
{
BusClass *k = BUS_CLASS(klass);
/* AUXSlave has an MMIO so we need to change the way we print information
* in monitor.
*/
k->print_dev = aux_slave_dev_print;
} | [
1,
0
] |
FFmpeg | libavformat/seek.c | static void free_packet_list(AVPacketList *pktl)
{
AVPacketList *cur;
while (pktl) {
cur = pktl;
pktl = cur->next;
av_free_packet(&cur->pkt);
av_free(cur);
}
} | [
0,
0
] |
FFmpeg | libavcodec/vorbis.c | void ff_vorbis_floor1_render_list(vorbis_floor1_entry *list, int values,
uint16_t *y_list, int *flag,
int multiplier, float *out, int samples)
{
int lx, ly, i;
lx = 0;
ly = y_list[0] * multiplier;
for (i = 1; i < values; i++) {
int ... | [
1,
0
] |
qemu | block/io.c | bool bdrv_requests_pending(BlockDriverState *bs)
{
BdrvChild *child;
BlockBackendPublic *blkp = bs->blk ? blk_get_public(bs->blk) : NULL;
if (!QLIST_EMPTY(&bs->tracked_requests)) {
return true;
}
if (blkp && !qemu_co_queue_empty(&blkp->throttled_reqs[0])) {
return true;
}
if (blkp && !qemu... | [
0,
0
] |
qemu | hw/acpi/aml-build.c | build_fadt(GArray *table_data, GArray *linker, AcpiPmInfo *pm,
unsigned facs, unsigned dsdt,
const char *oem_id, const char *oem_table_id)
{
AcpiFadtDescriptorRev1 *fadt = acpi_data_push(table_data, sizeof(*fadt));
fadt->firmware_ctrl = cpu_to_le32(facs);
/* FACS address to be filled b... | [
1,
0
] |
qemu | block/qapi.c | static void test_visitor_in_bool(TestInputVisitorData *data,
const void *unused)
{
bool res = false;
Visitor *v;
v = visitor_input_test_init(data, "true");
visit_type_bool(v, NULL, &res, &error_abort);
g_assert_cmpint(res, ==, true);
} | [
0,
0
] |
qemu | target-sparc/fop_helper.c | static inline void gen_op_fcmps(int fccno, TCGv_i32 r_rs1, TCGv_i32 r_rs2)
{
switch (fccno) {
case 0:
gen_helper_fcmps(cpu_env, r_rs1, r_rs2);
break;
case 1:
gen_helper_fcmps_fcc1(cpu_env, r_rs1, r_rs2);
break;
case 2:
gen_helper_fcmps_fcc2(cpu_env, r_rs1, r_rs2);
break;
ca... | [
1,
0
] |
qemu | gdbstub.c | static int gdb_breakpoint_remove(CPUState *env, target_ulong addr,
target_ulong len, int type)
{
switch (type) {
case GDB_BREAKPOINT_SW:
case GDB_BREAKPOINT_HW:
return cpu_breakpoint_remove(env, addr, BP_GDB);
#ifndef CONFIG_USER_ONLY
case GDB_WATCHPOINT_WRITE:
ca... | [
0,
0
] |
qemu | tcg/optimize.c | static void tcg_opt_gen_mov(TCGContext *s, TCGOp *op, TCGArg *args,
TCGArg dst, TCGArg src)
{
if (temps_are_copies(dst, src)) {
tcg_op_remove(s, op);
return;
}
if (temp_is_const(src)) {
tcg_opt_gen_movi(s, op, args, dst, temps[src].val);
return;
}
TCGOpcode... | [
1,
0
] |
FFmpeg | libavcodec/arm/fft_init_arm.c | av_cold void ff_fft_init_arm(FFTContext *s)
{
if (HAVE_NEON) {
s->fft_permute = ff_fft_permute_neon;
s->fft_calc = ff_fft_calc_neon;
s->imdct_calc = ff_imdct_calc_neon;
s->imdct_half = ff_imdct_half_neon;
s->mdct_calc = ff_mdct_calc_neon;
s->permutation = FF_MDCT_PERM_INTERLEAVE;
}
} | [
0,
0
] |
qemu | fsdev/virtio-9p-marshal.c | static void v9fs_getlock(void *opaque)
{
size_t offset = 7;
struct stat stbuf;
V9fsFidState *fidp;
V9fsGetlock *glock;
int32_t fid, err = 0;
V9fsPDU *pdu = opaque;
V9fsState *s = pdu->s;
glock = g_malloc(sizeof(*glock));
pdu_unmarshal(pdu, offset, "dbqqds", &fid, &glock->type,
... | [
1,
0
] |
qemu | buffered_file.c | static void usb_host_auto_check(void *unused)
{
struct USBHostDevice *s;
int unconnected = 0;
usb_host_scan(NULL, usb_host_auto_scan);
QTAILQ_FOREACH(s, &hostdevs, next) {
if (s->fd == -1) {
unconnected++;
}
}
if (unconnected == 0) {
/* nothing to watch */
if (usb_auto_timer)... | [
0,
0
] |
FFmpeg | libavcodec/avcodec.h | static void change_qscale(MpegEncContext *s, int dquant)
{
s->qscale += dquant;
if (s->qscale < 1)
s->qscale = 1;
else if (s->qscale > 31)
s->qscale = 31;
s->y_dc_scale = s->y_dc_scale_table[s->qscale];
s->c_dc_scale = s->c_dc_scale_table[s->qscale];
} | [
0,
0
] |
qemu | include/exec/gen-icount.h | static void gen_dozo(DisasContext *ctx)
{
int l1 = gen_new_label();
int l2 = gen_new_label();
TCGv t0 = tcg_temp_new();
TCGv t1 = tcg_temp_new();
TCGv t2 = tcg_temp_new();
/* Start with XER OV disabled, the most likely case */
tcg_gen_movi_tl(cpu_ov, 0);
tcg_gen_brcond_tl(TCG_COND_GE, cpu_gpr[r... | [
0,
0
] |
qemu | hw/qdev-properties.c | static void qdev_prop_cpy(DeviceState *dev, Property *props, void *src)
{
if (props->info->type == PROP_TYPE_BIT) {
bool *defval = src;
bit_prop_set(dev, props, *defval);
} else {
char *dst = qdev_get_prop_ptr(dev, props);
memcpy(dst, src, props->info->size);
}
} | [
1,
0
] |
qemu | cpus.c | int qemu_cpu_self(void *_env)
{
CPUState *env = _env;
QemuThread this;
qemu_thread_self(&this);
return qemu_thread_equal(&this, env->thread);
} | [
0,
0
] |
qemu | hw/qdev-properties.c | void qdev_prop_set_defaults(DeviceState *dev, Property *props)
{
if (!props)
return;
while (props->name) {
if (props->defval) {
qdev_prop_cpy(dev, props, props->defval);
}
props++;
}
} | [
0,
0
] |
qemu | hw/dp8393x.c | void net_cleanup(void)
{
#if !defined(_WIN32)
VLANState *vlan;
/* close network clients */
for (vlan = first_vlan; vlan != NULL; vlan = vlan->next) {
VLANClientState *vc;
for (vc = vlan->first_client; vc != NULL; vc = vc->next) {
if (vc->fd_read == tap_receive) {
TAPState *s = vc->o... | [
1,
0
] |
qemu | block/gluster.c | static coroutine_fn int qemu_gluster_co_flush_to_disk(BlockDriverState *bs)
{
int ret;
GlusterAIOCB acb;
BDRVGlusterState *s = bs->opaque;
acb.size = 0;
acb.ret = 0;
acb.coroutine = qemu_coroutine_self();
acb.aio_context = bdrv_get_aio_context(bs);
ret = glfs_fsync_async(s->fd, gluster_finish_a... | [
1,
0
] |
qemu | block-qcow.c | BlockDriverAIOCB *bdrv_aio_read(BlockDriverState *bs, int64_t sector_num,
uint8_t *buf, int nb_sectors,
BlockDriverCompletionFunc *cb, void *opaque)
{
BlockDriver *drv = bs->drv;
BlockDriverAIOCB *ret;
if (!drv)
return NULL;
if (bdrv_rd... | [
1,
1
] |
qemu | include/exec/memory.h | bool io_mem_write(MemoryRegion *mr, hwaddr addr,
uint64_t val, unsigned size)
{
return memory_region_dispatch_write(mr, addr, val, size);
} | [
1,
0
] |
qemu | HACKING | static uint64_t msix_table_mmio_read(void *opaque, target_phys_addr_t addr,
unsigned size)
{
PCIDevice *dev = opaque;
return pci_get_long(dev->msix_table + addr);
} | [
0,
0
] |
FFmpeg | libavformat/ftp.c | static int ftp_connect_data_connection(URLContext *h)
{
int err;
char buf[CONTROL_BUFFER_SIZE], opts_format[20];
AVDictionary *opts = NULL;
FTPContext *s = h->priv_data;
if (!s->conn_data) {
/* Enter passive mode */
if ((err = ftp_passive_mode(s)) < 0) {
av_dlog(h, "Set passive mode fai... | [
1,
0
] |
qemu | target-alpha/helper.h | void helper_ldl_kernel(uint64_t t0, uint64_t t1)
{
ldl_kernel(t1, t0);
} | [
0,
0
] |
qemu | fsdev/virtfs-proxy-helper.c | static int do_create(struct iovec *iovec)
{
int ret;
V9fsString path;
int flags, mode, uid, gid, cur_uid, cur_gid;
v9fs_string_init(&path);
ret = proxy_unmarshal(iovec, PROXY_HDR_SZ, "sdddd",
&path, &flags, &mode, &uid, &gid);
if (ret < 0) {
goto unmarshal_err_out;
}
... | [
0,
0
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.