Projectname large_stringclasses 15
values | Filepath large_stringlengths 4 106 ⌀ | Function large_stringlengths 11 3.45k | Label list |
|---|---|---|---|
FFmpeg | Changelog | static inline int writer_print_string(WriterContext *wctx,
const char *key, const char *val, int opt)
{
const struct section *section = wctx->section[wctx->level];
int ret = 0;
if (opt && !(wctx->writer->flags & WRITER_FLAG_DISPLAY_OPTIONAL_FIELDS))
return 0;
if ... | [
1,
0
] |
qemu | vl.c | static void configure_rtc_date_offset(const char *startdate, int legacy)
{
time_t rtc_start_date;
struct tm tm;
if (!strcmp(startdate, "now") && legacy) {
rtc_date_offset = -1;
} else {
if (sscanf(startdate, "%d-%d-%dT%d:%d:%d",
&tm.tm_year,
&tm.tm_mon,
... | [
1,
0
] |
FFmpeg | libavcodec/alac.c | static inline int decode_scalar(GetBitContext *gb, int k, int limit,
int readsamplesize) {
int x = get_unary_0_9(gb);
if (x > 8) { /* RICE THRESHOLD */
/* use alternative encoding */
x = get_bits(gb, readsamplesize);
} else {
if (k >= limit)
k = limit;
... | [
0,
0
] |
FFmpeg | ffmpeg.c | static void opt_b_frames(const char *arg)
{
b_frames = atoi(arg);
if (b_frames > FF_MAX_B_FRAMES) {
fprintf(stderr,
"\nCannot have more than %d B frames, increase FF_MAX_B_FRAMES.\n",
FF_MAX_B_FRAMES);
exit(1);
} else if (b_frames < 1) {
fprintf(stderr, "\nNumber of B fr... | [
0,
0
] |
qemu | monitor.c | static void monitor_protocol_event_init(void)
{
qemu_mutex_init(&monitor_event_state_lock);
/* Limit RTC & BALLOON events to 1 per second */
monitor_protocol_event_throttle(QEVENT_RTC_CHANGE, 1000);
monitor_protocol_event_throttle(QEVENT_BALLOON_CHANGE, 1000);
monitor_protocol_event_throttle(QEVENT_WATC... | [
1,
0
] |
FFmpeg | libavcodec/tiff.c | static char *shorts2str(int16_t *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... | [
0,
0
] |
qemu | Makefile.objs | QEMUSizedBuffer *qsb_create(const uint8_t *buffer, size_t len)
{
QEMUSizedBuffer *qsb;
size_t alloc_len, num_chunks, i, to_copy;
size_t chunk_size = (len > QSB_MAX_CHUNK_SIZE)
? QSB_MAX_CHUNK_SIZE
: QSB_CHUNK_SIZE;
num_chunks = DIV_ROUND_UP(len ? len : ... | [
1,
0
] |
qemu | hw/virtio/virtio.c | static void virtio_notify_vector(VirtIODevice *vdev, uint16_t vector) {
BusState *qbus = qdev_get_parent_bus(DEVICE(vdev));
VirtioBusClass *k = VIRTIO_BUS_GET_CLASS(qbus);
if (k->notify) {
k->notify(qbus->parent, vector); | [
1,
0
] |
qemu | include/io/task.h | static int qio_channel_socket_connect_worker(QIOTask *task,
Error **errp,
gpointer opaque)
{
QIOChannelSocket *ioc = QIO_CHANNEL_SOCKET(qio_task_get_source(task));
SocketAddress *addr = opaque;
int ret;
ret = qio_ch... | [
1,
0
] |
qemu | configure | static const void *boston_kernel_filter(void *opaque, const void *kernel,
hwaddr *load_addr, hwaddr *entry_addr)
{
BostonState *s = BOSTON(opaque);
s->kernel_entry = *entry_addr;
return kernel;
} | [
1,
0
] |
qemu | hw/net/e1000e_core.c | e1000e_set_icr(E1000ECore *core, int index, uint32_t val)
{
if ((core->mac[ICR] & E1000_ICR_ASSERTED) &&
(core->mac[CTRL_EXT] & E1000_CTRL_EXT_IAME)) {
trace_e1000e_irq_icr_process_iame();
e1000e_clear_ims_bits(core, core->mac[IAM]);
}
trace_e1000e_irq_icr_write(val, core->mac[ICR], core->mac[... | [
1,
0
] |
qemu | net/tap.c | static void tap_send(void *opaque)
{
TAPState *s = opaque;
int size;
do {
uint8_t *buf = s->buf;
size = tap_read_packet(s->fd, s->buf, sizeof(s->buf));
if (size <= 0) {
break;
}
if (s->host_vnet_hdr_len && !s->using_vnet_hdr) {
buf += s->host_vnet_hdr_len;
size -= ... | [
1,
0
] |
FFmpeg | ffserver.c | int check_codec_match(AVCodecContext *ccf, AVCodecContext *ccs, int stream)
{
int matches = 1;
#define CHECK_CODEC(x) (ccf->x != ccs->x)
if (CHECK_CODEC(codec_id) || CHECK_CODEC(codec_type)) {
http_log("Codecs do not match for stream %d\n", stream);
matches = 0;
} else if (CHECK_CODEC(bit_rate) || ... | [
0,
0
] |
qemu | check-qjson.c | START_TEST(float_number)
{
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].encoded; i+... | [
0,
0
] |
qemu | MAINTAINERS | static void qpi_mem_writel(void *opaque, target_phys_addr_t addr, uint32_t val)
{
CPUState *env;
env = cpu_single_env;
if (!env)
return;
env->eflags = (env->eflags & ~(IF_MASK | IOPL_MASK)) |
(val & (IF_MASK | IOPL_MASK));
} | [
0,
0
] |
qemu | util/qemu-option.c | static uint64_t qemu_opt_get_number_helper(QemuOpts *opts, const char *name,
uint64_t defval, bool del)
{
QemuOpt *opt = qemu_opt_find(opts, name);
uint64_t ret = defval;
if (opt == NULL) {
const QemuOptDesc *desc = find_desc_by_name(opts->list->desc, name);
... | [
1,
0
] |
qemu | exec.c | static void check_watchpoint(int offset, int len_mask, int flags)
{
CPUState *env = cpu_single_env;
target_ulong pc, cs_base;
TranslationBlock *tb;
target_ulong vaddr;
CPUWatchpoint *wp;
int cpu_flags;
if (env->watchpoint_hit) {
/* We re-entered the check after replacing the TB. Now raise
... | [
1,
0
] |
FFmpeg | libavformat/asfdec.c | static void get_tag(AVFormatContext *s, const char *key, int type, int len,
int type2_size)
{
char *value;
int64_t off = avio_tell(s->pb);
if ((unsigned)len >= (UINT_MAX - 1) / 2)
return;
value = av_malloc(2 * len + 1);
if (!value)
goto finish;
if (type == 0) { // UTF16-... | [
1,
0
] |
FFmpeg | libavcodec/dv.c | int 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 = dv_frame_profile(buf)) ||
buf_size < c->sys->frame_size) {
return -1; /* Broken frame, or not enoug... | [
1,
1
] |
qemu | scripts/coverity-model.c | void g_free(void *mem)
{
free(mem);
} | [
1,
0
] |
qemu | target-ppc/cpu.h | PPC_OP(cmpl)
{
if (T0 < T1) {
T0 = 0x08;
} else if (T0 > T1) {
T0 = 0x04;
} else {
T0 = 0x02;
}
RETURN();
} | [
1,
0
] |
FFmpeg | libavcodec/vmdav.c | static void vmdaudio_loadsound(VmdAudioContext *s, unsigned char *data,
uint8_t *buf, int silence)
{
if (s->channels == 2) {
if ((s->block_align & 0x01) == 0) {
if (silence)
memset(data, 0, s->block_align * 2);
else
vmdaudio_decode_audio(s, data, ... | [
1,
0
] |
qemu | linux-user/syscall.c | static int open_self_cmdline(void *cpu_env, int fd)
{
int fd_orig = -1;
bool word_skipped = false;
fd_orig = open("/proc/self/cmdline", O_RDONLY);
if (fd_orig < 0) {
return fd_orig;
}
while (true) {
ssize_t nb_read;
char buf[128];
char *cp_buf = buf;
nb_read = read(fd_orig, bu... | [
1,
0
] |
FFmpeg | libavfilter/vf_alphaextract.c | static int filter_frame(AVFilterLink *inlink, AVFilterBufferRef *cur_buf)
{
AlphaExtractContext *extract = inlink->dst->priv;
AVFilterLink *outlink = inlink->dst->outputs[0];
AVFilterBufferRef *out_buf =
ff_get_video_buffer(outlink, AV_PERM_WRITE, outlink->w, outlink->h);
int ret;
if (!out_buf) {... | [
1,
0
] |
FFmpeg | libavcodec/me_cmp.c | static int dct_max8x8_c(MpegEncContext *s, uint8_t *src1,
uint8_t *src2, ptrdiff_t stride, int h)
{
LOCAL_ALIGNED_16(int16_t, temp, [64]);
int sum = 0, i;
av_assert2(h == 8);
s->pdsp.diff_pixels(temp, src1, src2, stride);
s->fdsp.fdct(temp);
for (i = 0; i < 64; i++)
sum ... | [
1,
0
] |
FFmpeg | libavcodec/h264.c | static void copy_parameter_set(void **to, void **from, int count, int size)
{
int i;
for (i = 0; i < count; i++) {
if (to[i] && !from[i])
av_freep(&to[i]);
else if (from[i] && !to[i])
to[i] = av_malloc(size);
if (from[i])
memcpy(to[i], from[i], size);
}
} | [
1,
0
] |
FFmpeg | libavcodec/x86/dcadsp_init.c | av_cold void swri_resample_dsp_x86_init(ResampleContext *c)
{
int av_unused mm_flags = av_get_cpu_flags();
switch (c->format) {
case AV_SAMPLE_FMT_S16P:
if (ARCH_X86_32 && EXTERNAL_MMXEXT(mm_flags)) {
c->dsp.resample = c->linear ? ff_resample_linear_int16_mmxext
... | [
1,
0
] |
qemu | hw/i386/pc.c | static X86CPU *pc_new_cpu(const char *cpu_model, int64_t apic_id,
DeviceState *icc_bridge, Error **errp)
{
X86CPU *cpu = NULL;
Error *local_err = NULL;
if (icc_bridge == NULL) {
error_setg(&local_err, "Invalid icc-bridge value");
goto out;
}
cpu = cpu_x86_create(cpu_m... | [
0,
0
] |
qemu | hw/scsi/scsi-disk.c | static void scsi_write_same_complete(void *opaque, int ret)
{
WriteSameCBData *data = opaque;
SCSIDiskReq *r = data->r;
SCSIDiskState *s = DO_UPCAST(SCSIDiskState, qdev, r->req.dev);
assert(r->req.aiocb != NULL);
r->req.aiocb = NULL;
if (r->req.io_canceled) {
scsi_req_cancel_complete(&r->req);
... | [
1,
0
] |
qemu | hw/vfio/pci.c | static void vfio_exitfn(PCIDevice *pdev)
{
VFIOPCIDevice *vdev = DO_UPCAST(VFIOPCIDevice, pdev, pdev);
vfio_unregister_err_notifier(vdev);
pci_device_set_intx_routing_notifier(&vdev->pdev, NULL);
vfio_disable_interrupts(vdev);
if (vdev->intx.mmap_timer) {
timer_free(vdev->intx.mmap_timer);
}
v... | [
0,
0
] |
qemu | HACKING | static uint64_t vgafb_read(void *opaque, target_phys_addr_t addr,
unsigned size)
{
MilkymistVgafbState *s = opaque;
uint32_t r = 0;
addr >>= 2;
switch (addr) {
case R_CTRL:
case R_HRES:
case R_HSYNC_START:
case R_HSYNC_END:
case R_HSCAN:
case R_VRES:
case R_... | [
1,
0
] |
qemu | block/qcow2-cluster.c | static int realloc_refcount_array(BDRVQcow2State *s, void **array,
int64_t *size, int64_t new_size)
{
size_t old_byte_size, new_byte_size;
void *new_ptr;
/* Round to clusters so the array can be directly written to disk */
old_byte_size = size_to_clusters(s, refcount_arra... | [
1,
0
] |
qemu | fsdev/virtfs-proxy-helper.c | static int v9fs_receivefd(int sockfd, int *status)
{
struct iovec iov;
struct msghdr msg;
struct cmsghdr *cmsg;
int retval, data, fd;
union MsgControl msg_control;
iov.iov_base = &data;
iov.iov_len = sizeof(data);
memset(&msg, 0, sizeof(msg));
msg.msg_iov = &iov;
msg.msg_iovlen = 1;
ms... | [
1,
0
] |
qemu | vl.c | static uint64_t qemu_next_deadline_dyntick(void)
{
int64_t delta;
int64_t rtdelta;
if (use_icount)
delta = INT32_MAX;
else
delta = (qemu_next_deadline() + 999) / 1000;
if (active_timers[QEMU_TIMER_REALTIME]) {
rtdelta = (active_timers[QEMU_TIMER_REALTIME]->expire_time -
qe... | [
0,
0
] |
qemu | docs/qmp/qmp-events.txt | static void guest_panicked(void)
{
QObject *data;
data = qobject_from_jsonf("{ 'action': %s }", "pause");
monitor_protocol_event(QEVENT_GUEST_PANICKED, data);
qobject_decref(data);
vm_stop(RUN_STATE_GUEST_PANICKED);
} | [
1,
0
] |
qemu | Makefile.objs | static void init_blk_migration(QEMUFile *f)
{
BlockDriverState *bs;
BlkMigDevState *bmds;
int64_t sectors;
block_mig_state.submitted = 0;
block_mig_state.read_done = 0;
block_mig_state.transferred = 0;
block_mig_state.total_sector_sum = 0;
block_mig_state.prev_progress = -1;
block_mig_state.... | [
1,
0
] |
qemu | hw/vhost.c | static int vhost_sync_dirty_bitmap(struct vhost_dev *dev,
MemoryRegionSection *section,
hwaddr start_addr,
hwaddr end_addr)
{
int i;
if (!dev->log_enabled || !dev->started) {
return 0;
}
for (i =... | [
1,
0
] |
qemu | target-sparc/ldst_helper.c | void helper_ldqf(CPUSPARCState *env, target_ulong addr, int mem_idx)
{
/* XXX add 128 bit load */
CPU_QuadU u;
helper_check_align(env, addr, 7);
#if !defined(CONFIG_USER_ONLY)
switch (mem_idx) {
case MMU_USER_IDX:
u.ll.upper = cpu_ldq_user(env, addr);
u.ll.lower = cpu_ldq_user(env, addr + 8);... | [
1,
1
] |
FFmpeg | libavcodec/alac.c | static void allocate_buffers(ALACContext *alac)
{
int chan;
for (chan = 0; chan < alac->numchannels; chan++) {
alac->predicterror_buffer[chan] =
av_malloc(alac->setinfo_max_samples_per_frame * 4);
alac->outputsamples_buffer[chan] =
av_malloc(alac->setinfo_max_samples_per_frame * 4);
... | [
1,
0
] |
qemu | memory.c | static MemTxResult memory_region_write_accessor(MemoryRegion *mr,
hwaddr addr,
uint64_t *value,
unsigned size,
unsigned shif... | [
1,
0
] |
qemu | include/monitor/monitor.h | static void user_monitor_complete(void *opaque, QObject *ret_data)
{
MonitorCompletionData *data = (MonitorCompletionData *)opaque;
if (ret_data) {
data->user_print(data->mon, ret_data);
}
monitor_resume(data->mon);
g_free(data);
} | [
1,
0
] |
FFmpeg | libavfilter/af_atempo.c | static int filter_frame(AVFilterLink *inlink, AVFrame *src_buffer)
{
AVFilterContext *ctx = inlink->dst;
ATempoContext *atempo = ctx->priv;
AVFilterLink *outlink = ctx->outputs[0];
int ret = 0;
int n_in = src_buffer->nb_samples;
int n_out = (int)(0.5 + ((double)n_in) / atempo->tempo);
const uint8_... | [
1,
0
] |
qemu | hw/acpi/aml-build.c | void bios_linker_loader_add_checksum(BIOSLinker *linker, const char *file_name,
void *start, unsigned size,
uint8_t *checksum)
{
BiosLinkerLoaderEntry entry;
const BiosLinkerFileEntry *file = bios_linker_find_file(linker, file_name);
... | [
1,
0
] |
qemu | MAINTAINERS | static int64_t coroutine_fn raw_co_get_block_status(BlockDriverState *bs,
int64_t sector_num,
int nb_sectors, int *pnum,
BlockDriverState **file)
{
BDRVRawSt... | [
1,
0
] |
qemu | Makefile.target | static int pci_unin_internal_init_device(SysBusDevice *dev)
{
UNINState *s;
int pci_mem_config, pci_mem_data;
/* Uninorth internal bus */
s = FROM_SYSBUS(UNINState, dev);
pci_mem_config = cpu_register_io_memory(pci_unin_config_read,
pci_unin_config_write, s);
... | [
0,
0
] |
qemu | block/io.c | static int coroutine_fn bdrv_co_readv_em(BlockDriverState *bs,
int64_t sector_num, int nb_sectors,
QEMUIOVector *iov)
{
return bdrv_co_io_em(bs, sector_num, nb_sectors, iov, false);
} | [
0,
0
] |
qemu | qmp.c | static void iostatus_bdrv_it(void *opaque, BlockDriverState *bs)
{
bdrv_iostatus_reset(bs);
} | [
0,
0
] |
qemu | util/qht.c | void *qht_do_lookup(struct qht_bucket *head, qht_lookup_func_t func,
const void *userp, uint32_t hash)
{
struct qht_bucket *b = head;
int i;
do {
for (i = 0; i < QHT_BUCKET_ENTRIES; i++) {
if (b->hashes[i] == hash) {
/* The pointer is dereferenced before seqlock_read_... | [
1,
0
] |
qemu | tests/test-io-channel-command.c | static void test_io_channel_command_fifo(bool async)
{
#define TEST_FIFO "tests/test-io-channel-command.fifo"
QIOChannel *src, *dst;
QIOChannelTest *test;
char *srcfifo = g_strdup_printf("PIPE:%s,wronly", TEST_FIFO);
char *dstfifo = g_strdup_printf("PIPE:%s,rdonly", TEST_FIFO);
const char *srcargv[] = ... | [
1,
0
] |
qemu | hw/ide/ahci.c | static void sysbus_ahci_realize(DeviceState *dev, Error **errp)
{
SysBusDevice *sbd = SYS_BUS_DEVICE(dev);
SysbusAHCIState *s = SYSBUS_AHCI(dev);
ahci_init(&s->ahci, dev, NULL, s->num_ports);
sysbus_init_mmio(sbd, &s->ahci.mem);
sysbus_init_irq(sbd, &s->ahci.irq);
} | [
1,
0
] |
FFmpeg | libavcodec/dvbsubdec.c | static void png_save2(const char *filename, uint32_t *bitmap, int w, int h)
{
int x, y, v;
FILE *f;
char fname[40], fname2[40];
char command[1024];
snprintf(fname, 40, "%s.ppm", filename);
f = fopen(fname, "w");
if (!f) {
perror(fname);
exit(1);
}
fprintf(f,
"P6\n"
... | [
1,
0
] |
FFmpeg | libavutil/threadmessage.c | int av_thread_message_queue_alloc(AVThreadMessageQueue **mq,
unsigned nelem,
unsigned elsize)
{
#if HAVE_THREADS
AVThreadMessageQueue *rmq;
int ret = 0;
if (nelem > INT_MAX / elsize)
return AVERROR(EINVAL);
if (!(rmq = av_mallocz(s... | [
1,
0
] |
FFmpeg | libavcodec/utils.c | int attribute_align_arg avcodec_encode_video2(AVCodecContext *avctx,
AVPacket *avpkt,
const AVFrame *frame,
int *got_packet_ptr)
{
int ret;
int user_packet = !!avpkt->data;... | [
1,
0
] |
FFmpeg | libavcodec/jpeg2000dec.c | static int tag_tree_decode(Jpeg2000DecoderContext *s, Jpeg2000TgtNode *node,
int threshold) {
Jpeg2000TgtNode *stack[30];
int sp = -1, curval = 0;
while (node && !node->vis) {
stack[++sp] = node;
node = node->parent;
}
if (node)
curval = node->val;
else
curval = st... | [
1,
0
] |
qemu | hw/s390x/sclp.c | static void attach_storage_element(SCLPDevice *sclp, SCCB *sccb,
uint16_t element)
{
int i, assigned, subincrement_id;
AttachStorageElement *attach_info = (AttachStorageElement *)sccb;
sclpMemoryHotplugDev *mhd = get_sclp_memory_hotplug_dev();
assert(mhd);
if (element... | [
1,
0
] |
qemu | target-i386/op.c | static inline void gen_op_addl_ESP_im(int32_t val)
{
tcg_gen_ld_tl(cpu_tmp0, cpu_env, offsetof(CPUState, regs[R_ESP]));
tcg_gen_addi_tl(cpu_tmp0, cpu_tmp0, val);
#ifdef TARGET_X86_64
tcg_gen_andi_tl(cpu_tmp0, cpu_tmp0, 0xffffffff);
#endif
tcg_gen_st_tl(cpu_tmp0, cpu_env, offsetof(CPUState, regs[R_ESP]));... | [
0,
0
] |
qemu | hw/ide/ich.c | DeviceState *qdev_device_add(QemuOpts *opts)
{
DeviceClass *k;
const char *driver, *path, *id;
DeviceState *qdev;
BusState *bus;
driver = qemu_opt_get(opts, "driver");
if (!driver) {
qerror_report(QERR_MISSING_PARAMETER, "driver");
return NULL;
}
/* find driver */
k = DEVICE_CLASS(o... | [
0,
0
] |
qemu | check-qdict.c | static void qdict_teardown(void)
{
QDECREF(tests_dict);
tests_dict = NULL;
} | [
0,
0
] |
qemu | hw/qxl-logger.c | static void qxl_track_command(PCIQXLDevice *qxl, struct QXLCommandExt *ext)
{
switch (le32_to_cpu(ext->cmd.type)) {
case QXL_CMD_SURFACE:
{
QXLSurfaceCmd *cmd = qxl_phys2virt(qxl, ext->cmd.data, ext->group_id);
uint32_t id = le32_to_cpu(cmd->surface_id);
PANIC_ON(id >= NUM_SURFACES);
qemu_... | [
1,
0
] |
qemu | acl.c | int monitor_get_fd(Monitor *mon, const char *fdname)
{
mon_fd_t *monfd;
LIST_FOREACH(monfd, &mon->fds, next) {
int fd;
if (strcmp(monfd->name, fdname) != 0) {
continue;
}
fd = monfd->fd;
/* caller takes ownership of fd */
LIST_REMOVE(monfd, next);
qemu_free(monfd->name);
... | [
0,
0
] |
qemu | hw/mips_malta.c | static void network_init(void)
{
int i;
for (i = 0; i < nb_nics; i++) {
NICInfo *nd = &nd_table[i];
const char *default_devaddr = NULL;
if (i == 0 && (!nd->model || strcmp(nd->model, "pcnet") == 0))
/* The malta board has a PCNet card using PCI SLOT 11 */
default_devaddr = "0b";
... | [
1,
0
] |
FFmpeg | Makefile | const char *swscale_configuration(void)
{
return FFMPEG_CONFIGURATION;
} | [
0,
0
] |
FFmpeg | ffserver.c | static void load_module(const char *filename)
{
void *dll;
void (*init_func)(void);
dll = dlopen(filename, RTLD_NOW);
if (!dll) {
fprintf(stderr, "Could not load module '%s' - %s\n",
filename, dlerror());
}
init_func = dlsym(dll, "ffserver_module_init");
if (!init_func) {
fpr... | [
1,
0
] |
qemu | Makefile | void qemu_aio_poll(void)
{} | [
1,
0
] |
qemu | hw/virtio/virtio.c | void virtqueue_map_sg(struct iovec *sg, hwaddr *addr,
size_t num_sg, int is_write)
{
unsigned int i;
hwaddr len;
if (num_sg > VIRTQUEUE_MAX_SIZE) {
error_report("virtio: map attempt out of bounds: %zd > %d",
num_sg, VIRTQUEUE_MAX_SIZE);
exit(1);
}
for (i... | [
1,
0
] |
qemu | hw/virtio-pci.c | static int virtio_blk_init_pci(PCIDevice *pci_dev)
{
VirtIOPCIProxy *proxy = DO_UPCAST(VirtIOPCIProxy, pci_dev, pci_dev);
VirtIODevice *vdev;
if (proxy->class_code != PCI_CLASS_STORAGE_SCSI &&
proxy->class_code != PCI_CLASS_STORAGE_OTHER)
proxy->class_code = PCI_CLASS_STORAGE_SCSI;
if (!proxy->... | [
1,
0
] |
FFmpeg | libpostproc/postprocess_template.c | static inline void RENAME(duplicate)(uint8_t src[], int stride)
{
#if TEMPLATE_PP_MMX
__asm__ volatile(
"movq (%0), %%mm0 \n\t"
"add %1, %0 \n\t"
"movq %%mm0, (%0) \n\t"
"movq %%mm0, (%0, %1) \n\t"
"movq %%mm0, (%0, %1, 2)... | [
1,
0
] |
qemu | block/win32-aio.c | static void win32_aio_process_completion(QEMUWin32AIOState *s,
QEMUWin32AIOCB *waiocb, DWORD count)
{
int ret;
s->count--;
if (waiocb->ov.Internal != 0) {
ret = -EIO;
} else {
ret = 0;
if (count < waiocb->nbytes) {
/* Short reads mean EOF, pad... | [
1,
0
] |
FFmpeg | libavcodec/dxv.c | static int dxv_decompress_raw(AVCodecContext *avctx) {
DXVContext *ctx = avctx->priv_data;
GetByteContext *gbc = &ctx->gbc;
bytestream2_get_buffer(gbc, ctx->tex_data, ctx->tex_size);
return 0;
} | [
1,
0
] |
FFmpeg | libavcodec/x86/dsputil_init.c | static av_cold void dsputil_init_sse2(DSPContext *c, AVCodecContext *avctx,
int mm_flags)
{
#if HAVE_SSE2_INLINE
const int high_bit_depth = avctx->bits_per_raw_sample > 8;
if (!high_bit_depth && avctx->idct_algo == FF_IDCT_XVIDMMX) {
c->idct_put = ff_idct_xvid_sse2_pu... | [
1,
0
] |
FFmpeg | libavformat/4xm.c | static int au_probe(AVProbeData *p)
{
/* check file header */
if (p->buf_size <= 24)
return 0;
if (p->buf[0] == '.' && p->buf[1] == 's' &&
p->buf[2] == 'n' && p->buf[3] == 'd')
return AVPROBE_SCORE_MAX;
else
return 0;
} | [
1,
0
] |
FFmpeg | libavcodec/mpegvideo.h | void ff_write_pass1_stats(MpegEncContext *s)
{
snprintf(
s->avctx->stats_out, 256,
"in:%d out:%d type:%d q:%d itex:%d ptex:%d mv:%d misc:%d "
"fcode:%d bcode:%d mc-var:%d var:%d icount:%d skipcount:%d hbits:%d;\n",
s->current_picture_ptr->f.display_picture_number,
s->current_pictur... | [
1,
0
] |
qemu | tests/libqos/virtio-pci.c | static void pci_config(void)
{
QVirtioPCIDevice *dev;
QOSState *qs;
int n_size = TEST_IMAGE_SIZE / 2;
uint64_t capacity;
qs = pci_test_start();
dev = virtio_blk_pci_init(qs->pcibus, PCI_SLOT);
capacity = qvirtio_config_readq(&dev->vdev, 0);
g_assert_cmpint(capacity, ==, TEST_IMAGE_SIZE / 512);
... | [
1,
0
] |
qemu | hw/pc_sysfw.c | static void pc_fw_add_pflash_drv(void)
{
QemuOpts *opts;
QEMUMachine *machine;
char *filename;
if (bios_name == NULL) {
bios_name = BIOS_FILENAME;
}
filename = qemu_find_file(QEMU_FILE_TYPE_BIOS, bios_name);
opts = drive_add(IF_PFLASH, -1, filename, "readonly=on");
g_free(filename);
if (... | [
1,
0
] |
FFmpeg | libavcodec/ppc/dsputil_altivec.c | static int sad16_altivec(void *v, uint8_t *pix1, uint8_t *pix2, int line_size,
int h)
{
int i;
int s;
const vector unsigned int zero = (const vector unsigned int)vec_splat_u32(0);
vector unsigned char perm1, perm2, *pix1v, *pix2v;
vector unsigned char t1, t2, t3, t4, t5;
vect... | [
1,
0
] |
FFmpeg | postproc/rgb2rgb.c | void rgb8tobgr8(const uint8_t *src, uint8_t *dst, unsigned int src_size)
{
unsigned i;
unsigned num_pixels = src_size;
for (i = 0; i < num_pixels; i++)
{
unsigned b, g, r;
register uint8_t rgb;
rgb = src[i];
r = (rgb & 0x07);
g = (rgb & 0x38) >> 3;
b = (rgb & 0xC0) >> 6;
... | [
1,
0
] |
qemu | target-i386/cpu.h | void breakpoint_handler(CPUX86State *env)
{
CPUBreakpoint *bp;
if (env->watchpoint_hit) {
if (env->watchpoint_hit->flags & BP_CPU) {
env->watchpoint_hit = NULL;
if (check_hw_breakpoints(env, 0))
raise_exception(env, EXCP01_DB);
else
cpu_resume_from_signal(env, NULL);
... | [
1,
0
] |
qemu | hw/mcf5206.c | static uint32_t m5206_mbar_readl(void *opaque, target_phys_addr_t offset)
{
m5206_mbar_state *s = (m5206_mbar_state *)opaque;
int width;
offset &= 0x3ff;
if (offset > 0x200) {
hw_error("Bad MBAR read offset 0x%x", (int)offset);
}
width = m5206_mbar_width[offset >> 2];
if (width < 4) {
uin... | [
1,
0
] |
qemu | hw/display/cirrus_vga.c | static void vnc_copy(VncState *vs, int src_x, int src_y, int dst_x, int dst_y,
int w, int h)
{
/* send bitblit op to the vnc client */
vnc_lock_output(vs);
vnc_write_u8(vs, VNC_MSG_SERVER_FRAMEBUFFER_UPDATE);
vnc_write_u8(vs, 0);
vnc_write_u16(vs, 1); /* number of rects */
vnc_fr... | [
1,
0
] |
FFmpeg | doc/APIchanges | static int mov_read_close(AVFormatContext *s)
{
MOVContext *mov = s->priv_data;
int i, j;
for (i = 0; i < s->nb_streams; i++) {
AVStream *st = s->streams[i];
MOVStreamContext *sc = st->priv_data;
av_freep(&sc->ctts_data);
for (j = 0; j < sc->drefs_count; j++) {
av_freep(&sc->drefs[j... | [
1,
0
] |
FFmpeg | libavcodec/ffv1.c | int ffv1_init_slice_state(FFV1Context *f, FFV1Context *fs)
{
int j;
fs->plane_count = f->plane_count;
fs->transparency = f->transparency;
for (j = 0; j < f->plane_count; j++) {
PlaneContext *const p = &fs->plane[j];
if (fs->ac) {
if (!p->state)
p->state = av_malloc(CONTEXT_SIZE * ... | [
1,
1
] |
FFmpeg | libavcodec/audio_frame_queue.c | void ff_af_queue_remove(AudioFrameQueue *afq, int nb_samples, int64_t *pts,
int *duration)
{
int64_t out_pts = AV_NOPTS_VALUE;
int removed_samples = 0;
#ifdef DEBUG
ff_af_queue_log_state(afq);
#endif
/* get output pts from the next frame or generated pts */
if (afq->frame_queu... | [
1,
0
] |
FFmpeg | libavcodec/snow.c | av_cold void ff_snow_common_end(SnowContext *s)
{
int plane_index, level, orientation, i;
av_freep(&s->spatial_dwt_buffer);
av_freep(&s->temp_dwt_buffer);
av_freep(&s->spatial_idwt_buffer);
av_freep(&s->temp_idwt_buffer);
av_freep(&s->run_buffer);
s->m.me.temp = NULL;
av_freep(&s->m.me.scratchp... | [
1,
0
] |
qemu | hw/spapr_pci.c | static PCIDevice *find_dev(sPAPREnvironment *spapr,
uint64_t buid, uint32_t config_addr)
{
int devfn = (config_addr >> 8) & 0xFF;
sPAPRPHBState *phb;
QLIST_FOREACH(phb, &spapr->phbs, list) {
BusChild *kid;
if (phb->buid != buid) {
continue;
}
QTAILQ_FOREAC... | [
1,
0
] |
qemu | hw/intc/xics.c | int xics_alloc(XICSState *icp, int src, int irq_hint, bool lsi)
{
ICSState *ics = &icp->ics[src];
int irq;
if (irq_hint) {
assert(src == xics_find_source(icp, irq_hint));
if (!ICS_IRQ_FREE(ics, irq_hint - ics->offset)) {
trace_xics_alloc_failed_hint(src, irq_hint);
return -1;
}
... | [
1,
0
] |
FFmpeg | libavcodec/ratecontrol.c | static double get_diff_limited_q(MpegEncContext *s, RateControlEntry *rce,
double q) {
RateControlContext *rcc = &s->rc_context;
AVCodecContext *a = s->avctx;
const int pict_type = rce->new_pict_type;
const double last_p_q = rcc->last_qscale_for[P_TYPE];
const double last... | [
1,
0
] |
FFmpeg | libavformat/ftp.c | static int ftp_store(FTPContext *s)
{
char command[CONTROL_BUFFER_SIZE];
const int stor_codes[] = {150, 0};
snprintf(command, sizeof(command), "STOR %s\r\n", s->path);
if (!ftp_send_command(s, command, stor_codes, NULL))
return AVERROR(EIO);
s->state = UPLOADING;
return 0;
} | [
1,
0
] |
qemu | tests/e1000e-test.c | static void qvirtio_pci_set_queue_address(QVirtioDevice *d, uint32_t pfn)
{
QVirtioPCIDevice *dev = (QVirtioPCIDevice *)d;
qpci_io_writel(dev->pdev, dev->addr + VIRTIO_PCI_QUEUE_PFN, pfn);
} | [
1,
0
] |
qemu | hw/s390x/css.c | static int do_subchannel_work(SubchDev *sch)
{
if (!sch->do_subchannel_work) {
return -EINVAL;
}
g_assert(sch->curr_status.scsw.ctrl & SCSW_CTRL_MASK_FCTL);
return sch->do_subchannel_work(sch);
} | [
1,
0
] |
qemu | docs/qapi-code-gen.txt | void visit_type_uint8(Visitor *v, uint8_t *obj, const char *name, Error **errp)
{
int64_t value;
if (!error_is_set(errp)) {
if (v->type_uint8) {
v->type_uint8(v, obj, name, errp);
} else {
value = *obj;
v->type_int(v, &value, name, errp);
if (value < 0 || value > UINT8_MAX) ... | [
1,
0
] |
qemu | target-ppc/op.c | void do_addmeo_64(void)
{
T1 = T0;
T0 += xer_ca + (-1);
if (likely(!((uint64_t)T1 &
((uint64_t)T1 ^ (uint64_t)T0) & (1ULL << 63)))) {
xer_ov = 0;
} else {
xer_so = 1;
xer_ov = 1;
}
if (likely(T1 != 0))
xer_ca = 1;
} | [
1,
0
] |
FFmpeg | libavcodec/imgresample.c | ImgReSampleContext *
img_resample_full_init(int owidth, int oheight, int iwidth, int iheight,
int topBand, int bottomBand, int leftBand, int rightBand,
int padtop, int padbottom, int padleft, int padright) {
ImgReSampleContext *s;
s = av_mallocz(sizeof(ImgReSampleContex... | [
1,
0
] |
FFmpeg | libavcodec/arm/h264idct_neon.S | static void FUNCC(pred8x16_vertical_add)(uint8_t *pix, const int *block_offset,
const int16_t *block, ptrdiff_t stride)
{
int i;
for (i = 0; i < 4; i++)
FUNCC(pred4x4_vertical_add)(pix + block_offset[i],
block + i * 16 * sizeof(pixel)... | [
1,
0
] |
qemu | hw/arm/omap1.c | qemu_irq qemu_irq_split(qemu_irq irq1, qemu_irq irq2)
{
qemu_irq *s = g_malloc0(2 * sizeof(qemu_irq));
s[0] = irq1;
s[1] = irq2;
return qemu_allocate_irqs(qemu_splitirq, s, 1)[0];
} | [
1,
0
] |
FFmpeg | libavcodec/eacmv.c | static int cmv_decode_frame(AVCodecContext *avctx, void *data, int *data_size,
AVPacket *avpkt) {
const uint8_t *buf = avpkt->data;
int buf_size = avpkt->size;
CmvContext *s = avctx->priv_data;
const uint8_t *buf_end = buf + buf_size;
if (AV_RL32(buf) == MVIh_TAG || AV_RB32(buf) ==... | [
1,
0
] |
FFmpeg | libavfilter/vf_scale_npp.c | static int nppscale_query_formats(AVFilterContext *ctx)
{
static const enum AVPixelFormat pixel_formats[] = {
AV_PIX_FMT_CUDA,
AV_PIX_FMT_NONE,
};
AVFilterFormats *pix_fmts = ff_make_format_list(pixel_formats);
ff_set_common_formats(ctx, pix_fmts);
return 0;
} | [
0,
0
] |
FFmpeg | libavcodec/audio_frame_queue.c | static void delete_next_frame(AudioFrameQueue *afq)
{
AudioFrame *f = afq->frame_queue;
if (f) {
afq->frame_queue = f->next;
f->next = NULL;
av_freep(&f);
}
} | [
0,
0
] |
FFmpeg | libswscale/swscale.c | rgb16_32ToUV_half_c_template(uint8_t *dstU, uint8_t *dstV,
const uint8_t *src, int width,
enum PixelFormat origin,
int shr, int shg, int shb, int shp,
int maskr, int maskg, int maskb,
... | [
1,
0
] |
qemu | hw/virtio/virtio.c | static void virtio_vmstate_change(void *opaque, int running, RunState state)
{
VirtIODevice *vdev = opaque;
BusState *qbus = qdev_get_parent_bus(DEVICE(vdev));
VirtioBusClass *k = VIRTIO_BUS_GET_CLASS(qbus);
bool backend_run = running && (vdev->status & VIRTIO_CONFIG_S_DRIVER_OK);
if (running) {
vd... | [
1,
0
] |
qemu | crypto/cipher.c | size_t qcrypto_cipher_get_key_len(QCryptoCipherAlgorithm alg)
{
if (alg >= G_N_ELEMENTS(alg_key_len)) {
return 0;
}
return alg_key_len[alg];
} | [
0,
0
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.