Projectname large_stringclasses 15
values | Filepath large_stringlengths 4 106 ⌀ | Function large_stringlengths 11 3.45k | Label list |
|---|---|---|---|
qemu | exec.c | static RAMBlock *qemu_get_ram_block(ram_addr_t addr)
{
RAMBlock *block;
/* The list is protected by the iothread lock here. */
block = ram_list.mru_block;
if (block && addr - block->offset < block->max_length) {
goto found;
}
QTAILQ_FOREACH(block, &ram_list.blocks, next) {
if (addr - block-... | [
1,
0
] |
qemu | hw/9pfs/Makefile.objs | static int v9fs_synth_open(FsContext *ctx, V9fsPath *fs_path,
int flags, V9fsFidOpenState *fs)
{
V9fsSynthOpenState *synth_open;
V9fsSynthNode *node = *(V9fsSynthNode **)fs_path->data;
synth_open = g_malloc(sizeof(*synth_open));
synth_open->node = node;
node->open_count++;
... | [
0,
0
] |
FFmpeg | libavcodec/common.h | static void filter_mb_edgecv(H264Context *h, uint8_t *pix, int stride,
int bS[4], int qp) {
int i, d;
const int index_a = clip(qp + h->slice_alpha_c0_offset, 0, 51);
const int alpha = alpha_table[index_a];
const int beta = beta_table[clip(qp + h->slice_beta_offset, 0, 51)];
f... | [
1,
0
] |
qemu | hw/dp8393x.c | static void rtl8139_transfer_frame(RTL8139State *s, const uint8_t *buf,
int size, int do_interrupt)
{
if (!size)
{
DEBUG_PRINT(("RTL8139: +++ empty ethernet frame\n"));
return;
}
if (TxLoopBack == (s->TxConfig & TxLoopBack))
{
DEBUG_PRINT(("RTL8139: +++ t... | [
0,
0
] |
qemu | hw/s390x/sclp.c | static void sclp_execute(SCCB *sccb, uint64_t code)
{
S390SCLPDevice *sdev = get_event_facility();
switch (code & SCLP_CMD_CODE_MASK) {
case SCLP_CMDW_READ_SCP_INFO:
case SCLP_CMDW_READ_SCP_INFO_FORCED:
read_SCP_info(sccb);
break;
case SCLP_CMDW_READ_CPU_INFO:
sclp_read_cpu_info(sccb);
... | [
0,
0
] |
qemu | block/mirror.c | static void mirror_start_job(const char *job_id, BlockDriverState *bs,
BlockDriverState *target, const char *replaces,
int64_t speed, uint32_t granularity,
int64_t buf_size,
BlockMirrorBackingMode bac... | [
0,
0
] |
qemu | tests/test-cutils.c | static void test_qemu_strtoul_full_correct(void)
{
const char *str = "123";
unsigned long res = 999;
int err;
err = qemu_strtoul(str, NULL, 0, &res);
g_assert_cmpint(err, ==, 0);
g_assert_cmpint(res, ==, 123);
} | [
1,
0
] |
qemu | HACKING | static void omap_tcmi_write(void *opaque, target_phys_addr_t addr,
uint64_t value, unsigned size)
{
struct omap_mpu_state_s *s = (struct omap_mpu_state_s *)opaque;
if (size != 4) {
return omap_badwidth_write32(opaque, addr, value);
}
switch (addr) {
case 0x00: /* IMIF_PR... | [
0,
0
] |
FFmpeg | libavcodec/a64multienc.c | static av_cold int xbm_encode_init(AVCodecContext *avctx)
{
avctx->coded_frame = av_frame_alloc();
if (!avctx->coded_frame)
return AVERROR(ENOMEM);
avctx->coded_frame->pict_type = AV_PICTURE_TYPE_I;
return 0;
} | [
0,
0
] |
FFmpeg | libavcodec/dsputil.c | static void add_bytes_c(uint8_t *dst, uint8_t *src, int w) {
long i;
for (i = 0; i <= w - sizeof(long); i += sizeof(long)) {
long a = *(long *)(src + i);
long b = *(long *)(dst + i);
*(long *)(dst + i) = ((a & pb_7f) + (b & pb_7f)) ^ ((a ^ b) & pb_80);
}
for (; i < w; i++)
dst[i + 0] += s... | [
1,
0
] |
FFmpeg | libavcodec/dxva2_h264.c | static void av_noinline filter_mb_edgecv(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 | hw/net/vmxnet3.c | static void vmxnet3_complete_packet(VMXNET3State *s, int qidx, uint32_t tx_ridx)
{
struct Vmxnet3_TxCompDesc txcq_descr;
PCIDevice *d = PCI_DEVICE(s);
VMXNET3_RING_DUMP(VMW_RIPRN, "TXC", qidx, &s->txq_descr[qidx].comp_ring);
txcq_descr.txdIdx = tx_ridx;
txcq_descr.gen = vmxnet3_ring_curr_gen(&s->txq_des... | [
1,
0
] |
qemu | console.c | static int qemu_chr_open_pipe(QemuOpts *opts, CharDriverState **_chr)
{
int fd_in, fd_out;
char filename_in[256], filename_out[256];
const char *filename = qemu_opt_get(opts, "path");
if (filename == NULL) {
fprintf(stderr, "chardev: pipe: no filename given\n");
return -EINVAL;
}
snprintf(fi... | [
1,
0
] |
FFmpeg | libavcodec/huffyuvdec.c | static void decode_gray_bitstream(HYuvContext *s, int count)
{
int i;
count /= 2;
if (count >= (get_bits_left(&s->gb)) / (31 * 2)) {
for (i = 0; i < count && get_bits_left(&s->gb) > 0; i++) {
READ_2PIX(s->temp[0][2 * i], s->temp[0][2 * i + 1], 0);
}
} else {
for (i = 0; i < count; i++)... | [
1,
0
] |
qemu | cpu-exec.c | static always_inline void gen_qemu_lds(TCGv t0, TCGv t1, int flags)
{
TCGv tmp = tcg_temp_new(TCG_TYPE_I32);
tcg_gen_qemu_ld32u(tmp, t1, flags);
tcg_gen_helper_1_1(helper_memory_to_s, t0, tmp);
tcg_temp_free(tmp);
} | [
0,
0
] |
qemu | block/block-backend.c | static void pmac_ide_flush(DBDMA_io *io)
{
MACIOIDEState *m = io->opaque;
if (m->aiocb) {
bdrv_drain_all();
}
} | [
0,
0
] |
qemu | block/nbd.c | static void socket_start_outgoing_migration(MigrationState *s,
SocketAddress *saddr,
Error **errp)
{
QIOChannelSocket *sioc = qio_channel_socket_new();
struct SocketConnectData *data = g_new0(struct SocketConnectData, 1);
... | [
0,
0
] |
qemu | HACKING | static void gpio_write(void *opaque, target_phys_addr_t addr, uint64_t value,
unsigned size)
{
struct gpio_state_t *s = opaque;
D(printf("%s %x=%x\n", __func__, addr, (unsigned)value));
addr >>= 2;
switch (addr)
{
case RW_PA_DOUT:
/* Decode nand pins. */
s->nand->al... | [
1,
0
] |
qemu | pc-bios/s390-ccw/bootmap.c | static void virtio_notify(struct subchannel_id schid)
{
kvm_hypercall(KVM_S390_VIRTIO_CCW_NOTIFY, *(u32 *)&schid, 0);
} | [
0,
0
] |
qemu | target-i386/helper.c | static void kvm_mce_inj_srao_memscrub2(CPUState *env, target_phys_addr_t paddr)
{
struct kvm_x86_mce mce = {
.bank = 9,
.status = MCI_STATUS_VAL | MCI_STATUS_UC | MCI_STATUS_EN
| MCI_STATUS_MISCV | MCI_STATUS_ADDRV | MCI_STATUS_S
| 0xc0,
.mcg_status = MCG_STATU... | [
0,
0
] |
qemu | target-sparc/helper.c | static int get_physical_address_code(CPUState *env,
target_phys_addr_t *physical, int *prot,
target_ulong address, int mmu_idx)
{
unsigned int i;
uint64_t context;
int is_user = (mmu_idx == MMU_USER_IDX ||
mmu_idx ==... | [
1,
0
] |
qemu | hw/block/dataplane/virtio-blk.c | static void virtio_queue_guest_notifier_read(EventNotifier *n)
{
VirtQueue *vq = container_of(n, VirtQueue, guest_notifier);
if (event_notifier_test_and_clear(n)) {
virtio_irq(vq);
}
} | [
1,
0
] |
qemu | hw/ppc/Makefile.objs | int spapr_tce_dma_zero(VIOsPAPRDevice *dev, uint64_t taddr, uint32_t size)
{
/* FIXME: allocating a temp buffer is nasty, but just stepping
* through writing zeroes is awkward. This will do for now. */
uint8_t zeroes[size];
#ifdef DEBUG_TCE
fprintf(stderr, "spapr_tce_dma_zero taddr=0x%llx size=0x%x\n",
... | [
1,
1
] |
FFmpeg | libavfilter/graphparser.c | int avfilter_parse_graph(AVFilterGraph *graph, const char *filters,
AVFilterInOut *openLinks, AVClass *log_ctx)
{
int index = 0;
char chr = 0;
int pad = 0;
AVFilterInOut *currInputs = NULL;
do {
AVFilterContext *filter;
filters += consume_whitespace(filters);
pad... | [
1,
0
] |
FFmpeg | libavfilter/fifo.c | static int source_request_frame(AVFilterLink *outlink)
{
Frei0rContext *frei0r = outlink->src->priv;
AVFilterBufferRef *picref =
ff_get_video_buffer(outlink, AV_PERM_WRITE, outlink->w, outlink->h);
int ret;
picref->video->pixel_aspect = (AVRational){1, 1};
picref->pts = frei0r->pts++;
picref->p... | [
1,
0
] |
qemu | block-vmdk.c | static int vmdk_is_allocated(BlockDriverState *bs, int64_t sector_num,
int nb_sectors, int *pnum)
{
BDRVVmdkState *s = bs->opaque;
int index_in_cluster, n;
uint64_t cluster_offset;
cluster_offset = get_cluster_offset(bs, sector_num << 9, 0);
index_in_cluster = sector_num % ... | [
1,
0
] |
qemu | hw/misc/pvpanic.c | static void pvpanic_isa_realizefn(DeviceState *dev, Error **errp)
{
ISADevice *d = ISA_DEVICE(dev);
PVPanicState *s = ISA_PVPANIC_DEVICE(dev);
static bool port_configured;
FWCfgState *fw_cfg;
isa_register_ioport(d, &s->io, s->ioport);
if (!port_configured) {
fw_cfg = fw_cfg_find();
if (fw_c... | [
1,
0
] |
FFmpeg | libavcodec/a64multienc.c | static av_cold int ffv1_encode_close(AVCodecContext *avctx)
{
av_frame_free(&avctx->coded_frame);
ffv1_close(avctx);
return 0;
} | [
0,
0
] |
qemu | backends/rng-egd.c | static ssize_t write_console_data(SCLPEvent *event, const uint8_t *buf,
size_t len)
{
SCLPConsole *scon = SCLP_CONSOLE(event);
if (!scon->chr) {
/* If there's no backend, we can just say we consumed all data. */
return len;
}
return qemu_chr_fe_write_all(scon->ch... | [
1,
0
] |
qemu | vl.c | static int ram_load_dead(QEMUFile *f, void *opaque)
{
RamDecompressState s1, *s = &s1;
uint8_t buf[10];
ram_addr_t i;
if (ram_decompress_open(s, f) < 0)
return -EINVAL;
for (i = 0; i < last_ram_offset; i += BDRV_HASH_BLOCK_SIZE) {
if (ram_decompress_buf(s, buf, 1) < 0) {
fprintf(stderr,... | [
1,
0
] |
qemu | hw/block/dataplane/virtio-blk.c | static void virtio_blk_free_request(VirtIOBlockReq *req)
{
if (req) {
g_slice_free(VirtQueueElement, req->elem);
g_slice_free(VirtIOBlockReq, req);
}
} | [
1,
0
] |
FFmpeg | ffprobe.c | static void show_program(WriterContext *w, AVFormatContext *fmt_ctx,
AVProgram *program)
{
int i;
writer_print_section_header(w, SECTION_ID_PROGRAM);
print_int("program_id", program->id);
print_int("program_num", program->program_num);
print_int("nb_streams", program->nb_stream_... | [
0,
0
] |
qemu | HACKING | void omap_badwidth_write8(void *opaque, target_phys_addr_t addr,
uint32_t value)
{
uint8_t val8 = value;
OMAP_8B_REG(addr);
cpu_physical_memory_write(addr, (void *)&val8, 1);
} | [
0,
0
] |
qemu | io/channel-websock.c | static void qio_channel_websock_handshake_send_res_ok(QIOChannelWebsock *ioc,
const char *key,
Error **errp)
{
char combined_key[QIO_CHANNEL_WEBSOCK_CLIENT_KEY_LEN +
QIO_CHANNEL_WEBSOCK... | [
1,
0
] |
FFmpeg | libavformat/a64.c | static int a64_write_trailer(struct AVFormatContext *s)
{
A64MuxerContext *c = s->priv_data;
AVPacket pkt;
/* need to flush last packet? */
if (c->interleaved)
a64_write_packet(s, &pkt);
return 0;
} | [
1,
0
] |
qemu | block/backup.c | static int coroutine_fn mirror_dirty_init(MirrorBlockJob *s)
{
int64_t sector_num, end;
BlockDriverState *base = s->base;
BlockDriverState *bs = blk_bs(s->common.blk);
BlockDriverState *target_bs = blk_bs(s->target);
int ret, n;
end = s->bdev_length / BDRV_SECTOR_SIZE;
if (base == NULL && !bdrv_ha... | [
1,
0
] |
qemu | tests/test-cutils.c | static void test_qemu_strtoull_full_max(void)
{
char *str = g_strdup_printf("%lld", ULLONG_MAX);
uint64_t res = 999;
int err;
err = qemu_strtoull(str, NULL, 0, &res);
g_assert_cmpint(err, ==, 0);
g_assert_cmpint(res, ==, ULLONG_MAX);
g_free(str);
} | [
0,
0
] |
qemu | block/block-backend.c | static int virtio_blk_handle_rw_error(VirtIOBlockReq *req, int error,
bool is_read)
{
BlockErrorAction action = bdrv_get_error_action(req->dev->bs, is_read, error);
VirtIOBlock *s = req->dev;
if (action == BLOCK_ERROR_ACTION_STOP) {
req->next = s->rq;
s->rq = r... | [
0,
0
] |
qemu | hw/omap.c | int omap_validate_emifs_addr(struct omap_mpu_state_s *s,
target_phys_addr_t addr)
{
return addr >= OMAP_EMIFS_BASE && addr < OMAP_EMIFF_BASE;
} | [
1,
0
] |
qemu | Makefile.target | void cpu_resume_from_signal(CPUState *env1, void *puc)
{
env = env1;
/* XXX: restore cpu registers saved in host registers */
env->exception_index = -1;
longjmp(env->jmp_env, 1);
} | [
0,
1
] |
qemu | elf.h | static uint32_t get_elf_hwcap(void)
{
CPUState *e = thread_env;
uint32_t features = 0;
/* We don't have to be terribly complete here; the high points are
Altivec/FP/SPE support. Anything else is just a bonus. */
#define GET_FEATURE(flag, feature)
do {
if (e->insns_flags & flag)
features ... | [
1,
0
] |
FFmpeg | libavformat/rtmppkt.c | static void ff_amf_tag_contents(void *ctx, const uint8_t *data,
const uint8_t *data_end)
{
int size;
char buf[1024];
if (data >= data_end)
return;
switch (*data++) {
case AMF_DATA_TYPE_NUMBER:
av_log(ctx, AV_LOG_DEBUG, " number %g\n", av_int2double(AV_RB64(data)... | [
1,
0
] |
FFmpeg | libavformat/mov.c | static int mov_read_extradata(MOVContext *c, AVIOContext *pb, MOVAtom atom,
enum AVCodecID codec_id)
{
AVStream *st;
uint64_t size;
uint8_t *buf;
int err;
if (c->fc->nb_streams < 1) // will happen with jp2 files
return 0;
st = c->fc->streams[c->fc->nb_streams - 1];... | [
1,
1
] |
FFmpeg | libavcodec/pthread.c | void avcodec_flush_buffers(AVCodecContext *avctx)
{
if (HAVE_PTHREADS && avctx->active_thread_type & FF_THREAD_FRAME)
ff_thread_flush(avctx);
if (avctx->codec->flush)
avctx->codec->flush(avctx);
} | [
1,
0
] |
qemu | hw/ppc/spapr.c | static void spapr_cpu_reset(void *opaque)
{
PowerPCCPU *cpu = opaque;
CPUState *cs = CPU(cpu);
CPUPPCState *env = &cpu->env;
cpu_reset(cs);
/* All CPUs start halted. CPU0 is unhalted from the machine level
* reset code and the rest are explicitly started up by the guest
* using an RTAS call */
... | [
1,
0
] |
FFmpeg | libavcodec/bitstream_filter.c | void av_bitstream_filter_close(AVBitStreamFilterContext *bsfc) {
if (bsfc->filter->close)
bsfc->filter->close(bsfc);
av_freep(&bsfc->priv_data);
av_parser_close(bsfc->parser);
av_free(bsfc);
} | [
1,
0
] |
FFmpeg | libavcodec/movtextdec.c | static void mov_text_cleanup_ftab(MovTextContext *m)
{
int i;
for (i = 0; i < m->count_f; i++) {
av_freep(&m->ftab[i]->font);
av_freep(&m->ftab[i]);
}
av_freep(&m->ftab);
} | [
1,
0
] |
qemu | vl.c | static int virtcon_parse(const char *devname)
{
QemuOptsList *device = qemu_find_opts("device");
static int index = 0;
char label[32];
QemuOpts *bus_opts, *dev_opts;
if (strcmp(devname, "none") == 0)
return 0;
if (index == MAX_VIRTIO_CONSOLES) {
fprintf(stderr, "qemu: too many virtio consol... | [
1,
0
] |
qemu | MAINTAINERS | static void raw_reopen_abort(BDRVReopenState *state)
{
g_free(state->opaque);
state->opaque = NULL;
} | [
0,
0
] |
qemu | qemu-char.c | static void mux_print_help(CharDriverState *chr)
{
int i, j;
char ebuf[15] = "Escape-Char";
char cbuf[50] = "\n\r";
if (term_escape_char > 0 && term_escape_char < 26) {
snprintf(cbuf, sizeof(cbuf), "\n\r");
snprintf(ebuf, sizeof(ebuf), "C-%c", term_escape_char - 1 + 'a');
} else {
snprint... | [
1,
0
] |
qemu | acl.c | void net_slirp_hostfwd_remove(Monitor *mon, const QDict *qdict)
{
struct in_addr host_addr = {.s_addr = INADDR_ANY};
int host_port;
char buf[256] = "";
const char *src_str, *p;
SlirpState *s;
int is_udp = 0;
int err;
const char *arg1 = qdict_get_str(qdict, "arg1");
const char *arg2 = qdict_g... | [
1,
0
] |
qemu | block/curl.c | static int curl_aio_flush(void *opaque)
{
BDRVCURLState *s = opaque;
int i, j;
for (i = 0; i < CURL_NUM_STATES; i++) {
for (j = 0; j < CURL_NUM_ACB; j++) {
if (s->states[i].acb[j]) {
return 1;
}
}
}
return 0;
} | [
0,
0
] |
qemu | hw/core/qdev.c | static void object_get_link_property(Object *obj, Visitor *v, void *opaque,
const char *name, Error **errp)
{
Object **child = opaque;
gchar *path;
if (*child) {
path = object_get_canonical_path(*child);
visit_type_str(v, &path, name, errp);
g_free(path);
... | [
1,
0
] |
FFmpeg | libavcodec/dsputil.c | void FUNCC(ff_h264_idct_dc_add)(uint8_t *_dst, DCTELEM *block, int stride) {
int i, j;
int dc = (((dctcoef *)block)[0] + 32) >> 6;
INIT_CLIP
pixel *dst = (pixel *)_dst;
stride /= sizeof(pixel);
for (j = 0; j < 4; j++)
{
for (i = 0; i < 4; i++)
dst[i] = CLIP(dst[i] + dc);
dst += str... | [
1,
0
] |
qemu | hw/s390x/css.c | static int ccw_dstream_rw_noflags(CcwDataStream *cds, void *buff, int len,
CcwDataStreamOp op)
{
int ret;
ret = cds_check_len(cds, len);
if (ret <= 0) {
return ret;
if (op == CDS_OP_A) {
goto incr;
ret = address_space_rw(&address_space_memory, cds->cd... | [
1,
0
] |
qemu | migration/migration.c | void hmp_info_snapshots(Monitor *mon, const QDict *qdict)
{
BlockDriverState *bs, *bs1;
QEMUSnapshotInfo *sn_tab, *sn, s, *sn_info = &s;
int nb_sns, i, ret, available;
int total;
int *available_snapshots;
bs = find_vmstate_bs();
if (!bs) {
monitor_printf(mon, "No available block device suppor... | [
1,
0
] |
FFmpeg | Changelog | av_cold void ff_schro_queue_init(FFSchroQueue *queue)
{
queue->p_head = queue->p_tail = NULL;
queue->size = 0;
} | [
1,
0
] |
FFmpeg | libavformat/os_support.c | static int rtsp_write_packet(AVFormatContext *s, AVPacket *pkt)
{
RTSPState *rt = s->priv_data;
RTSPStream *rtsp_st;
fd_set rfds;
int n, tcp_fd;
struct timeval tv;
AVFormatContext *rtpctx;
int ret;
tcp_fd = url_get_file_handle(rt->rtsp_hd);
while (1) {
FD_ZERO(&rfds);
FD_SET(tcp_fd... | [
1,
1
] |
qemu | hw/block/fdc.c | static int get_uint64_equal(QEMUFile *f, void *pv, size_t size,
VMStateField *field)
{
uint64_t *v = pv;
uint64_t v2;
qemu_get_be64s(f, &v2);
if (*v == v2) {
return 0;
error_report("%" PRIx64 " != %" PRIx64, *v, v2);
return -EINVAL; | [
1,
0
] |
qemu | hw/net/vhost_net.c | static void vhost_net_stop_one(struct vhost_net *net,
VirtIODevice *dev)
{
struct vhost_vring_file file = {.fd = -1};
if (net->nc->info->type == NET_CLIENT_DRIVER_TAP) {
for (file.index = 0; file.index < net->dev.nvqs; ++file.index) {
const VhostOps *vhost_ops = net->d... | [
1,
0
] |
FFmpeg | libavcodec/vorbisenc.c | static av_cold int vorbis_encode_init(AVCodecContext *avccontext)
{
vorbis_enc_context *venc = avccontext->priv_data;
if (avccontext->channels != 2) {
av_log(avccontext, AV_LOG_ERROR,
"Current Libav Vorbis encoder only supports 2 channels.\n");
return -1;
}
create_vorbis_context(venc, a... | [
1,
0
] |
qemu | hw/arm/armv7m.c | static void qxl_realize_secondary(PCIDevice *dev, Error **errp)
{
static int device_id = 1;
PCIQXLDevice *qxl = PCI_QXL(dev);
qxl->id = device_id++;
qxl_init_ramsize(qxl);
memory_region_init_ram(&qxl->vga.vram, OBJECT(dev), "qxl.vgavram",
qxl->vga.vram_size, &error_abort);
v... | [
1,
0
] |
FFmpeg | libavcodec/tiertexseqv.c | static const unsigned char *seq_decode_op1(SeqVideoContext *seq,
const unsigned char *src,
unsigned char *dst)
{
const unsigned char *color_table;
int b, i, len, bits;
GetBitContext gb;
unsigned char block[8 * 8];
len ... | [
1,
0
] |
qemu | block/qed-table.c | static void qed_commit_l2_update(void *opaque, int ret)
{
QEDAIOCB *acb = opaque;
BDRVQEDState *s = acb_to_s(acb);
CachedL2Table *l2_table = acb->request.l2_table;
qed_commit_l2_cache_entry(&s->l2_cache, l2_table);
/* This is guaranteed to succeed because we just committed the entry to the
* cache.
... | [
1,
0
] |
qemu | hw/pci/pci.c | static void pci_qdev_unrealize(DeviceState *dev, Error **errp)
{
PCIDevice *pci_dev = PCI_DEVICE(dev);
PCIDeviceClass *pc = PCI_DEVICE_GET_CLASS(pci_dev);
pci_unregister_io_regions(pci_dev);
pci_del_option_rom(pci_dev);
if (pc->exit) {
pc->exit(pci_dev);
}
do_pci_unregister_device(pci_dev);
} | [
1,
0
] |
qemu | block/blkdebug.c | static int inject_error(BlockDriverState *bs, BlkdebugRule *rule)
{
BDRVBlkdebugState *s = bs->opaque;
int error = rule->options.inject.error;
bool immediately = rule->options.inject.immediately;
if (rule->options.inject.once) {
QSIMPLEQ_REMOVE(&s->active_rules, rule, BlkdebugRule, active_next);
... | [
1,
0
] |
FFmpeg | libavcodec/wmalosslessdec.c | static void use_high_update_speed(WmallDecodeCtx *s, int ich)
{
int ilms, recent, icoef;
s->update_speed[ich] = 16;
for (ilms = s->cdlms_ttl[ich]; ilms >= 0; ilms--) {
recent = s->cdlms[ich][ilms].recent;
if (s->bV3RTM) {
for (icoef = 0; icoef < s->cdlms[ich][ilms].order; icoef++)
s-... | [
1,
0
] |
qemu | monitor.c | static void do_info_commands(Monitor *mon, QObject **ret_data)
{
QList *cmd_list;
const mon_cmd_t *cmd;
cmd_list = qlist_new();
for (cmd = qmp_cmds; cmd->name != NULL; cmd++) {
if (monitor_handler_ported(cmd) && !monitor_cmd_user_only(cmd) &&
!compare_cmd(cmd->name, "info")) {
qlist_ap... | [
1,
0
] |
qemu | linux-user/elfload.c | static void fill_note(struct memelfnote *note, const char *name, int type,
unsigned int sz, void *data)
{
unsigned int namesz;
namesz = strlen(name) + 1;
note->name = name;
note->namesz = namesz;
note->namesz_rounded = roundup(namesz, sizeof(int32_t));
note->type = type;
not... | [
1,
0
] |
FFmpeg | libavformat/movenc.c | static int mov_write_gmhd_tag(AVIOContext *pb)
{
avio_wb32(pb, 0x20); /* size */
ffio_wfourcc(pb, "gmhd");
avio_wb32(pb, 0x18); /* gmin size */
ffio_wfourcc(pb, "gmin"); /* generic media info */
avio_wb32(pb, 0); /* version & flags */
avio_wb16(pb, 0x40); /* graphics mode = */
avio_wb16(pb, 0x8000... | [
0,
0
] |
qemu | fpu/softfloat-specialize.h | int float64_le(float64 a, float64 b STATUS_PARAM)
{
flag aSign, bSign;
if (((extractFloat64Exp(a) == 0x7FF) && extractFloat64Frac(a))
|| ((extractFloat64Exp(b) == 0x7FF) && extractFloat64Frac(b))
) {
float_raise(float_flag_invalid STATUS_VAR);
return 0;
}
aSign = extractFloat64Sign(a);
... | [
0,
0
] |
qemu | hw/pxa.h | static void pxa2xx_pm_write(void *opaque, target_phys_addr_t addr,
uint32_t value)
{
struct pxa2xx_state_s *s = (struct pxa2xx_state_s *)opaque;
if (addr > s->pm_base + PCMD31) {
/* Special case: PWRI2C registers appear in the same range. */
pxa2xx_i2c_write(s->i2c[1], add... | [
1,
0
] |
qemu | translate-i386.c | CPUX86State *cpu_x86_init(void)
{
CPUX86State *env;
int i;
static int inited;
cpu_x86_tblocks_init();
env = malloc(sizeof(CPUX86State));
if (!env)
return NULL;
memset(env, 0, sizeof(CPUX86State));
/* basic FPU init */
for (i = 0; i < 8; i++)
env->fptags[i] = 1;
env->fpuc = 0x37f... | [
1,
0
] |
qemu | block.c | void *qemu_try_blockalign(BlockDriverState *bs, size_t size)
{
size_t align = bdrv_opt_mem_align(bs);
/* Ensure that NULL is never returned on success */
assert(align > 0);
if (size == 0) {
size = align;
}
return qemu_try_memalign(align, size);
} | [
0,
0
] |
qemu | target-sparc/fop_helper.c | float32 helper_fxtos(CPUSPARCState *env, int64_t src)
{
float32 ret;
clear_float_exceptions(env);
ret = int64_to_float32(src, &env->fp_status);
check_ieee_exceptions(env);
return ret;
} | [
0,
0
] |
FFmpeg | libavutil/Makefile | static int test_vector_dmul_scalar(AVFloatDSPContext *fdsp,
AVFloatDSPContext *cdsp,
const double *v1, double scale)
{
LOCAL_ALIGNED(32, double, cdst, [LEN]);
LOCAL_ALIGNED(32, double, odst, [LEN]);
int ret;
cdsp->vector_dmul_scalar(cds... | [
0,
0
] |
qemu | monitor.c | static void monitor_call_handler(Monitor *mon, const mon_cmd_t *cmd,
const QDict *params)
{
QObject *data = NULL;
cmd->mhandler.cmd_new(mon, params, &data);
if (data)
cmd->user_print(mon, data);
qobject_decref(data);
} | [
0,
0
] |
qemu | hw/m68k/an5206.c | static void m5206_mbar_update(m5206_mbar_state *s)
{
int irq;
int vector;
int level;
irq = m5206_find_pending_irq(s);
if (irq) {
int tmp;
tmp = s->icr[irq];
level = (tmp >> 2) & 7;
if (tmp & 0x80) {
/* Autovector. */
vector = 24 + level;
} else {
switch (ir... | [
1,
0
] |
FFmpeg | libavcodec/pthread.c | static void frame_thread_free(AVCodecContext *avctx, int thread_count)
{
FrameThreadContext *fctx = avctx->thread_opaque;
AVCodec *codec = avctx->codec;
int i;
park_frame_worker_threads(fctx, thread_count);
if (fctx->prev_thread)
update_context_from_thread(fctx->threads->avctx, fctx->prev_thread->a... | [
1,
0
] |
qemu | hw/ipmi/ipmi_bmc_sim.c | static void smbios_encode_uuid(struct smbios_uuid *uuid, const uint8_t *buf)
{
memcpy(uuid, buf, 16);
if (smbios_uuid_encoded) {
uuid->time_low = bswap32(uuid->time_low);
uuid->time_mid = bswap16(uuid->time_mid);
uuid->time_hi_and_version = bswap16(uuid->time_hi_and_version);
}
} | [
1,
0
] |
qemu | target/s390x/cpu.h | void QEMU_NORETURN runtime_exception(CPUS390XState *env, int excp,
uintptr_t retaddr)
{
CPUState *cs = CPU(s390_env_get_cpu(env));
int t;
cs->exception_index = EXCP_PGM;
env->int_pgm_code = excp;
/* Use the (ultimate) callers address to find the insn that trapped. ... | [
0,
0
] |
qemu | hw/acpi/aml-build.c | void acpi_add_table(GArray *table_offsets, GArray *table_data)
{
uint32_t offset = cpu_to_le32(table_data->len);
g_array_append_val(table_offsets, offset);
} | [
0,
0
] |
qemu | hw/pc.c | int cpu_is_bsp(CPUState *env)
{
return env->cpuid_apic_id == 0;
} | [
0,
0
] |
FFmpeg | libavfilter/avfiltergraph.c | int avfilter_graph_queue_command(AVFilterGraph *graph, const char *target,
const char *command, const char *arg,
int flags, double ts) {
int i;
if (!graph)
return 0;
for (i = 0; i < graph->nb_filters; i++) {
AVFilterContext *filter = graph-... | [
1,
0
] |
FFmpeg | libavcodec/hevcdec.c | static av_cold int hevc_decode_init(AVCodecContext *avctx)
{
HEVCContext *s = avctx->priv_data;
int ret;
avctx->internal->allocate_progress = 1;
ret = hevc_init_context(avctx);
if (ret < 0)
return ret;
s->enable_parallel_tiles = 0;
s->sei.picture_timing.picture_struct = 0;
s->eos = 1;
a... | [
1,
0
] |
qemu | hw/usb/host-libusb.c | static int usb_host_init(void)
{
const struct libusb_pollfd **poll;
int i, rc;
if (ctx) {
return 0;
}
rc = libusb_init(&ctx);
if (rc != 0) {
return -1;
}
libusb_set_debug(ctx, loglevel);
libusb_set_pollfd_notifiers(ctx, usb_host_add_fd,
usb_host_del_fd,... | [
1,
0
] |
qemu | linux-user/m68k/target_signal.h | static inline int target_rt_restore_ucontext(CPUM68KState *env,
struct target_ucontext *uc,
int *pd0)
{
int temp;
target_greg_t *gregs = uc->tuc_mcontext.gregs;
__get_user(temp, &uc->tuc_mcontext.version);
if (temp ... | [
1,
0
] |
qemu | acl.c | static QCowAIOCB *
qcow_aio_setup(BlockDriverState *bs,
int64_t sector_num, QEMUIOVector *qiov, int nb_sectors,
BlockDriverCompletionFunc *cb, void *opaque, int is_write)
{
QCowAIOCB *acb;
acb = qemu_aio_get(&qcow_aio_pool, bs, cb, opaque);
if (!acb)
return NULL;
acb->h... | [
0,
0
] |
qemu | block/io.c | void bdrv_drain_all_end(void)
{
BlockDriverState *bs;
BdrvNextIterator it;
BlockJob *job = NULL;
for (bs = bdrv_first(&it); bs; bs = bdrv_next(&it)) {
AioContext *aio_context = bdrv_get_aio_context(bs);
aio_context_acquire(aio_context);
aio_enable_external(aio_context);
bdrv_io_unplugge... | [
0,
0
] |
qemu | include/block/aio.h | int qemu_set_fd_handler(int fd,
IOHandler *fd_read,
IOHandler *fd_write,
void *opaque)
{
return qemu_set_fd_handler2(fd, NULL, fd_read, fd_write, opaque);
} | [
0,
0
] |
qemu | hw/gumstix.c | static void tosa_init(ram_addr_t ram_size, int vga_ram_size,
const char *boot_device,
const char *kernel_filename, const char *kernel_cmdline,
const char *initrd_filename, const char *cpu_model)
{
struct pxa2xx_state_s *cpu;
struct tc6393xb_s *... | [
1,
0
] |
qemu | vmstate.c | static int get_int32_le(QEMUFile *f, void *pv, size_t size)
{
int32_t *old = pv;
int32_t new;
qemu_get_sbe32s(f, &new);
if (*old <= new) {
return 0;
}
return -EINVAL;
} | [
0,
0
] |
qemu | tests/acpi-test.c | static void load_asl(GArray *sdts, AcpiSdtTable *sdt)
{
AcpiSdtTable *temp;
GError *error = NULL;
GString *command_line = g_string_new("'iasl' ");
gint fd;
gchar *out, *out_err;
gboolean ret;
int i;
fd = g_file_open_tmp("asl-XXXXXX.dsl", &sdt->asl_file, &error);
g_assert_no_error(error);
... | [
0,
0
] |
qemu | hw/usb-uhci.c | static void uhci_ioport_writel(void *opaque, uint32_t addr, uint32_t val)
{
UHCIState *s = opaque;
addr &= 0x1f;
#ifdef DEBUG
printf("uhci writel port=0x%04x val=0x%08x\n", addr, val);
#endif
switch (addr) {
case 0x08:
s->fl_base_addr = val & ~0xfff;
break;
}
} | [
1,
0
] |
qemu | block/curl.c | static void curl_readv_bh_cb(void *p)
{
CURLState *state;
CURLAIOCB *acb = p;
BDRVCURLState *s = acb->common.bs->opaque;
qemu_bh_delete(acb->bh);
acb->bh = NULL;
size_t start = acb->sector_num * SECTOR_SIZE;
size_t end;
// In case we have the requested data already (e.g. read-ahead),
// we c... | [
1,
0
] |
qemu | HACKING | static uint64_t assigned_dev_ioport_read(void *opaque,
target_phys_addr_t addr, unsigned size)
{
return assigned_dev_ioport_rw(opaque, addr, size, NULL);
} | [
0,
0
] |
qemu | exec.c | int qemu_ram_addr_from_host(void *ptr, ram_addr_t *ram_addr)
{
RAMBlock *block;
uint8_t *host = ptr;
if (xen_enabled()) {
*ram_addr = xen_ram_addr_from_mapcache(ptr);
return 0;
}
QTAILQ_FOREACH(block, &ram_list.blocks, next) {
/* This case append when the block is not mapped. */
if (b... | [
0,
0
] |
qemu | HACKING | static void ne2000_write(void *opaque, target_phys_addr_t addr,
uint64_t data, unsigned size)
{
NE2000State *s = opaque;
if (addr < 0x10 && size == 1) {
ne2000_ioport_write(s, addr, data);
} else if (addr == 0x10) {
if (size <= 2) {
ne2000_asic_ioport_write(s, addr, ... | [
1,
0
] |
qemu | target-arm/translate.c | gen_set_condexec(DisasContext *s)
{
if (s->condexec_mask) {
uint32_t val = (s->condexec_cond << 4) | (s->condexec_mask >> 1);
TCGv tmp = new_tmp();
tcg_gen_movi_i32(tmp, val);
store_cpu_field(tmp, condexec_bits);
}
} | [
1,
0
] |
qemu | backends/rng-egd.c | void *mcf_uart_init(qemu_irq irq, CharDriverState *chr)
{
mcf_uart_state *s;
s = g_malloc0(sizeof(mcf_uart_state));
s->chr = chr;
s->irq = irq;
if (chr) {
qemu_chr_add_handlers(chr, mcf_uart_can_receive, mcf_uart_receive,
mcf_uart_event, s);
}
mcf_uart_reset(s);
r... | [
1,
0
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.