project stringclasses 2
values | commit_id stringlengths 40 40 | target int64 0 1 | func stringlengths 26 142k | idx int64 0 27.3k |
|---|---|---|---|---|
qemu | 0824afda0cd20045ffe87d58e142774514b61026 | 0 | void block_job_sleep_ns(BlockJob *job, QEMUClockType type, int64_t ns)
{
assert(job->busy);
/* Check cancellation *before* setting busy = false, too! */
if (block_job_is_cancelled(job)) {
return;
}
job->busy = false;
if (block_job_is_paused(job)) {
qemu_coroutine_yi... | 12,845 |
qemu | 1ea879e5580f63414693655fcf0328559cdce138 | 0 | void mixeng_clear (st_sample_t *buf, int len)
{
memset (buf, 0, len * sizeof (st_sample_t));
}
| 12,847 |
qemu | b3a2319792ad5c0f0f8c3d2f4d02b95fd7efbc69 | 0 | static void slavio_set_timer_irq_cpu(void *opaque, int cpu, int level)
{
SLAVIO_INTCTLState *s = opaque;
DPRINTF("Set cpu %d local level %d\n", cpu, level);
if (!s->cpu_envs[cpu])
return;
if (level) {
s->intreg_pending[cpu] |= s->cputimer_bit;
} else {
s->intreg_... | 12,848 |
qemu | 374f2981d1f10bc4307f250f24b2a7ddb9b14be0 | 0 | void address_space_init(AddressSpace *as, MemoryRegion *root, const char *name)
{
if (QTAILQ_EMPTY(&address_spaces)) {
memory_init();
}
memory_region_transaction_begin();
as->root = root;
as->current_map = g_new(FlatView, 1);
flatview_init(as->current_map);
as->ioeventfd_n... | 12,849 |
FFmpeg | 7c9d2ad45f4e46ad2c3b2e93051efbe1e0d0529e | 0 | int avpriv_dca_parse_core_frame_header(GetBitContext *gb, DCACoreFrameHeader *h)
{
if (get_bits_long(gb, 32) != DCA_SYNCWORD_CORE_BE)
return DCA_PARSE_ERROR_SYNC_WORD;
h->normal_frame = get_bits1(gb);
h->deficit_samples = get_bits(gb, 5) + 1;
if (h->deficit_samples != DCA_PCMBLOCK_SAMPLE... | 12,850 |
qemu | 853d6f7a835ff33cf53f2922e4039d4cfad8ac17 | 0 | static void padzero(unsigned long elf_bss)
{
unsigned long nbyte;
char * fpnt;
nbyte = elf_bss & (host_page_size-1); /* was TARGET_PAGE_SIZE - JRP */
if (nbyte) {
nbyte = host_page_size - nbyte;
fpnt = (char *) elf_bss;
do {
*fpnt++ = 0;
} while (--nbyte... | 12,851 |
qemu | 2bc3166c22aeeb5cd7b8f21104f4744f08c7a288 | 0 | static int vmdk_open(BlockDriverState *bs, int flags)
{
int ret;
BDRVVmdkState *s = bs->opaque;
if (vmdk_open_sparse(bs, bs->file, flags) == 0) {
s->desc_offset = 0x200;
} else {
ret = vmdk_open_desc_file(bs, flags, 0);
if (ret) {
goto fail;
}
... | 12,852 |
qemu | f74e27bf0f07425aba6cb812aa7f5aa98bb68542 | 0 | static void coroutine_fn pdu_complete(V9fsPDU *pdu, ssize_t len)
{
int8_t id = pdu->id + 1; /* Response */
V9fsState *s = pdu->s;
if (len < 0) {
int err = -len;
len = 7;
if (s->proto_version != V9FS_PROTO_2000L) {
V9fsString str;
str.data = stre... | 12,855 |
qemu | ca6b6e1e68ac44b2e8895da10dd1c80dc03d08b7 | 0 | static QDict *parse_json_filename(const char *filename, Error **errp)
{
QObject *options_obj;
QDict *options;
int ret;
ret = strstart(filename, "json:", &filename);
assert(ret);
options_obj = qobject_from_json(filename);
if (!options_obj) {
error_setg(errp, "Could not pa... | 12,856 |
qemu | 63ae0915f8ec9746d17a25c27f64cf65550627ab | 0 | static void gen_rlwnm(DisasContext *ctx)
{
uint32_t mb, me;
mb = MB(ctx->opcode);
me = ME(ctx->opcode);
if (likely(mb == 0 && me == 31)) {
TCGv_i32 t0, t1;
t0 = tcg_temp_new_i32();
t1 = tcg_temp_new_i32();
tcg_gen_trunc_tl_i32(t0, cpu_gpr[rB(ctx->opcode)]);
... | 12,857 |
qemu | b3db211f3c80bb996a704d665fe275619f728bd4 | 0 | static void test_native_list(TestOutputVisitorData *data,
const void *unused,
UserDefNativeListUnionKind kind)
{
UserDefNativeListUnion *cvalue = g_new0(UserDefNativeListUnion, 1);
QObject *obj;
cvalue->type = kind;
init_native_list(cval... | 12,858 |
FFmpeg | 1acd7d594c15aa491729c837ad3519d3469e620a | 0 | static void FUNCC(pred8x8l_horizontal_add)(uint8_t *_pix, const int16_t *_block,
ptrdiff_t stride)
{
int i;
pixel *pix = (pixel*)_pix;
const dctcoef *block = (const dctcoef*)_block;
stride >>= sizeof(pixel)-1;
for(i=0; i<8; i++){
pixel v = p... | 12,859 |
FFmpeg | dcd3418a35aab7ef283b68ed9997ce4ac204094e | 0 | static int vtenc_create_encoder(AVCodecContext *avctx,
CMVideoCodecType codec_type,
CFStringRef profile_level,
CFNumberRef gamma_level,
CFDictionaryRef enc_info,
... | 12,860 |
FFmpeg | 3b061c5e10f78caaf3b2a45cf7a92e50d4d20bfb | 0 | static av_cold int libspeex_decode_init(AVCodecContext *avctx)
{
LibSpeexContext *s = avctx->priv_data;
const SpeexMode *mode;
// defaults in the case of a missing header
if (avctx->sample_rate <= 8000)
mode = &speex_nb_mode;
else if (avctx->sample_rate <= 16000)
mode = &sp... | 12,861 |
FFmpeg | 8897b5aa4c09906e4d43157fdcd7042f47fe15cf | 0 | static int mpegts_set_stream_info(AVStream *st, PESContext *pes,
uint32_t stream_type, uint32_t prog_reg_desc)
{
int old_codec_type= st->codec->codec_type;
int old_codec_id = st->codec->codec_id;
if (old_codec_id != AV_CODEC_ID_NONE && avcodec_is_open(st->codec)) {
... | 12,863 |
FFmpeg | 280beebd399b2d2c9bf58438c2aa2a22a0a53282 | 0 | void ff_cavs_init_top_lines(AVSContext *h) {
/* alloc top line of predictors */
h->top_qp = av_malloc( h->mb_width);
h->top_mv[0] = av_malloc((h->mb_width*2+1)*sizeof(cavs_vector));
h->top_mv[1] = av_malloc((h->mb_width*2+1)*sizeof(cavs_vector));
h->top_pred_Y = av_malloc( h->mb_w... | 12,864 |
qemu | 7385ac0ba2456159a52b9b2cbb5f6c71921d0c23 | 0 | static void gen_dmfc0 (CPUState *env, DisasContext *ctx, int reg, int sel)
{
const char *rn = "invalid";
if (sel != 0)
check_insn(env, ctx, ISA_MIPS64);
switch (reg) {
case 0:
switch (sel) {
case 0:
gen_op_mfc0_index();
rn = "Index";
... | 12,865 |
qemu | d57e4e482e3997b1382625c84149ad0b69155fc0 | 0 | static BlockBackend *img_open(const char *id, const char *filename,
const char *fmt, int flags,
bool require_io, bool quiet)
{
BlockBackend *blk;
BlockDriverState *bs;
char password[256];
Error *local_err = NULL;
QDict *options = NU... | 12,866 |
qemu | f1839938b090b28537d9be2c1b255b834f3cfbb8 | 0 | static void do_boot_set(Monitor *mon, const QDict *qdict)
{
int res;
const char *bootdevice = qdict_get_str(qdict, "bootdevice");
res = qemu_boot_set(bootdevice);
if (res == 0) {
monitor_printf(mon, "boot device list now set to %s\n", bootdevice);
} else if (res > 0) {
moni... | 12,867 |
qemu | 40f860cd6c1aa0d3399e3f8158f20bdc5b2bfbfe | 0 | void restore_state_to_opc(CPUARMState *env, TranslationBlock *tb, int pc_pos)
{
if (is_a64(env)) {
env->pc = tcg_ctx.gen_opc_pc[pc_pos];
} else {
env->regs[15] = tcg_ctx.gen_opc_pc[pc_pos];
}
env->condexec_bits = gen_opc_condexec_bits[pc_pos];
}
| 12,868 |
qemu | 62d60e8cc4c4c8aebdfd97f10087456d2690c0a0 | 0 | void kvm_set_phys_mem(target_phys_addr_t start_addr,
ram_addr_t size,
ram_addr_t phys_offset)
{
KVMState *s = kvm_state;
ram_addr_t flags = phys_offset & ~TARGET_PAGE_MASK;
KVMSlot *mem;
/* KVM does not support read-only slots */
phys_offset &= ~... | 12,870 |
qemu | 25db9ebe15125deb32958c6df74996f745edf1f9 | 0 | static int virtio_pci_set_host_notifier(void *opaque, int n, bool assign)
{
VirtIOPCIProxy *proxy = opaque;
VirtQueue *vq = virtio_get_queue(proxy->vdev, n);
EventNotifier *notifier = virtio_queue_get_host_notifier(vq);
int r;
if (assign) {
r = event_notifier_init(notifier, 1);
... | 12,872 |
qemu | a7812ae412311d7d47f8aa85656faadac9d64b56 | 0 | static inline void neon_load_reg64(TCGv var, int reg)
{
tcg_gen_ld_i64(var, cpu_env, vfp_reg_offset(1, reg));
}
| 12,873 |
FFmpeg | f1e173049ecc9de03817385ba8962d14cba779db | 0 | static void encode_sigpass(Jpeg2000T1Context *t1, int width, int height, int bandno, int *nmsedec, int bpno)
{
int y0, x, y, mask = 1 << (bpno + NMSEDEC_FRACBITS);
for (y0 = 0; y0 < height; y0 += 4)
for (x = 0; x < width; x++)
for (y = y0; y < height && y < y0+4; y++){
... | 12,874 |
qemu | e3cb6ba65d265f2cc1313ee26e879407ff24663c | 0 | static void qdev_set_legacy_property(DeviceState *dev, Visitor *v, void *opaque,
const char *name, Error **errp)
{
Property *prop = opaque;
if (dev->state != DEV_STATE_CREATED) {
error_set(errp, QERR_PERMISSION_DENIED);
return;
}
if (prop-... | 12,875 |
qemu | a8170e5e97ad17ca169c64ba87ae2f53850dab4c | 0 | static void channel_load_d(struct fs_dma_ctrl *ctrl, int c)
{
target_phys_addr_t addr = channel_reg(ctrl, c, RW_SAVED_DATA);
/* Load and decode. FIXME: handle endianness. */
D(printf("%s ch=%d addr=" TARGET_FMT_plx "\n", __func__, c, addr));
cpu_physical_memory_read (addr,
(void *) &ctrl->channels[c]... | 12,876 |
qemu | 0193c62c94643a837832f2b5ccc133434ee740cb | 0 | static int xenfb_map_fb(struct XenFB *xenfb)
{
struct xenfb_page *page = xenfb->c.page;
char *protocol = xenfb->c.xendev.protocol;
int n_fbdirs;
unsigned long *pgmfns = NULL;
unsigned long *fbmfns = NULL;
void *map, *pd;
int mode, ret = -1;
/* default to native */
pd = pa... | 12,877 |
qemu | ff1d1977ffe1c276f5937a6ad4b6a5b6d2b1c6ae | 0 | static int cpu_gdb_read_register(CPUState *env, uint8_t *mem_buf, int n)
{
if (n < 32) {
GET_REGL(env->active_tc.gpr[n]);
}
if (env->CP0_Config1 & (1 << CP0C1_FP)) {
if (n >= 38 && n < 70) {
if (env->CP0_Status & (1 << CP0St_FR))
GET_REGL(env->active_fpu.fpr[n - 38].d);... | 12,878 |
qemu | a8170e5e97ad17ca169c64ba87ae2f53850dab4c | 0 | static int update_rom_mapping(VAPICROMState *s, CPUX86State *env, target_ulong ip)
{
target_phys_addr_t paddr;
uint32_t rom_state_vaddr;
uint32_t pos, patch, offset;
/* nothing to do if already activated */
if (s->state == VAPIC_ACTIVE) {
return 0;
}
/* bail out if ROM i... | 12,879 |
qemu | a8170e5e97ad17ca169c64ba87ae2f53850dab4c | 0 | void omap_badwidth_write32(void *opaque, target_phys_addr_t addr,
uint32_t value)
{
OMAP_32B_REG(addr);
cpu_physical_memory_write(addr, (void *) &value, 4);
}
| 12,880 |
qemu | 871d2f079661323a7645b388eb5ae8d7eeb3117c | 0 | static void file_put_buffer(void *opaque, const uint8_t *buf,
int64_t pos, int size)
{
QEMUFileStdio *s = opaque;
fseek(s->outfile, pos, SEEK_SET);
fwrite(buf, 1, size, s->outfile);
}
| 12,881 |
qemu | dfd100f242370886bb6732f70f1f7cbd8eb9fedc | 0 | void qio_channel_socket_connect_async(QIOChannelSocket *ioc,
SocketAddress *addr,
QIOTaskFunc callback,
gpointer opaque,
GDestroyNotify destroy)
{
QIOTask *ta... | 12,882 |
qemu | 2a0c46da967e5dc8cfe73b1b6fe7a1600c04f461 | 0 | connect_to_qemu(
const char *host,
const char *port
) {
struct addrinfo hints;
struct addrinfo *server;
int ret, sock;
sock = qemu_socket(AF_INET, SOCK_STREAM, 0);
if (sock < 0) {
/* Error */
fprintf(stderr, "Error opening socket!\n");
return -1;
}
... | 12,883 |
qemu | 185698715dfb18c82ad2a5dbc169908602d43e81 | 0 | static inline uint32_t efsctuiz(uint32_t val)
{
CPU_FloatU u;
u.l = val;
/* NaN are not treated the same way IEEE 754 does */
if (unlikely(float32_is_nan(u.f)))
return 0;
return float32_to_uint32_round_to_zero(u.f, &env->vec_status);
}
| 12,884 |
FFmpeg | 9767ec6b865c35f68cb6642fefeacc009f17e638 | 0 | static int escape(char **dst, const char *src, const char *special_chars,
enum EscapeMode mode)
{
AVBPrint dstbuf;
av_bprint_init(&dstbuf, 1, AV_BPRINT_SIZE_UNLIMITED);
switch (mode) {
case ESCAPE_MODE_FULL:
case ESCAPE_MODE_LAZY:
/* \-escape characters */
... | 12,885 |
qemu | 079019f2e319bd1279681b6c1d7dde785d09e69e | 0 | static void spapr_machine_class_init(ObjectClass *oc, void *data)
{
MachineClass *mc = MACHINE_CLASS(oc);
sPAPRMachineClass *smc = SPAPR_MACHINE_CLASS(oc);
FWPathProviderClass *fwc = FW_PATH_PROVIDER_CLASS(oc);
NMIClass *nc = NMI_CLASS(oc);
HotplugHandlerClass *hc = HOTPLUG_HANDLER_CLASS(oc);
... | 12,886 |
qemu | 72cf2d4f0e181d0d3a3122e04129c58a95da713e | 0 | static void xen_config_cleanup_dir(char *dir)
{
struct xs_dirs *d;
d = qemu_malloc(sizeof(*d));
d->xs_dir = dir;
TAILQ_INSERT_TAIL(&xs_cleanup, d, list);
}
| 12,888 |
qemu | 4448a83606b5861cfa11528c0395868fc2b0e99e | 0 | void gen_intermediate_code(CPUSH4State * env, struct TranslationBlock *tb)
{
SuperHCPU *cpu = sh_env_get_cpu(env);
CPUState *cs = CPU(cpu);
DisasContext ctx;
target_ulong pc_start;
int num_insns;
int max_insns;
pc_start = tb->pc;
ctx.pc = pc_start;
ctx.tbflags = (uint32_t... | 12,889 |
qemu | 504e56ebdca53bf8e8d379aa994e90a2e3b0d564 | 0 | void OPPROTO op_cli(void)
{
raise_exception(EXCP0D_GPF);
}
| 12,890 |
qemu | b2c98d9d392c87c9b9e975d30f79924719d9cbbe | 0 | static void tgen_ext16u(TCGContext *s, TCGType type, TCGReg dest, TCGReg src)
{
if (facilities & FACILITY_EXT_IMM) {
tcg_out_insn(s, RRE, LLGHR, dest, src);
return;
}
if (dest == src) {
tcg_out_movi(s, type, TCG_TMP0, 0xffff);
src = TCG_TMP0;
} else {
... | 12,891 |
qemu | 35c648078aa493c3b976840eb7cf2e53ab5b7a2d | 0 | void mips_malta_init(QEMUMachineInitArgs *args)
{
ram_addr_t ram_size = args->ram_size;
const char *cpu_model = args->cpu_model;
const char *kernel_filename = args->kernel_filename;
const char *kernel_cmdline = args->kernel_cmdline;
const char *initrd_filename = args->initrd_filename;
cha... | 12,892 |
qemu | debaaa114a8877a939533ba846e64168fb287b7b | 0 | static void test_pci_enable(void)
{
AHCIQState *ahci;
ahci = ahci_boot();
ahci_pci_enable(ahci);
ahci_shutdown(ahci);
}
| 12,893 |
qemu | 991f8f0c91d65cebf51fa931450e02b0d5209012 | 0 | static int fill_psinfo(struct target_elf_prpsinfo *psinfo, const TaskState *ts)
{
char *filename, *base_filename;
unsigned int i, len;
(void) memset(psinfo, 0, sizeof (*psinfo));
len = ts->info->arg_end - ts->info->arg_start;
if (len >= ELF_PRARGSZ)
len = ELF_PRARGSZ - 1;
if ... | 12,895 |
FFmpeg | fa2a34cd40d124161c748bb0f430dc63c94dd0da | 0 | static void do_exit(void)
{
if (cur_stream) {
stream_close(cur_stream);
cur_stream = NULL;
}
uninit_opts();
#if CONFIG_AVFILTER
avfilter_uninit();
#endif
avformat_network_deinit();
if (show_status)
printf("\n");
SDL_Quit();
av_log(NULL, AV_LOG_QUIET,... | 12,896 |
qemu | dd8070d865ad1b32876931f812a80645f97112ff | 0 | static TileExcp decode_y0(DisasContext *dc, tilegx_bundle_bits bundle)
{
unsigned opc = get_Opcode_Y0(bundle);
unsigned ext = get_RRROpcodeExtension_Y0(bundle);
unsigned dest = get_Dest_Y0(bundle);
unsigned srca = get_SrcA_Y0(bundle);
unsigned srcb;
int imm;
switch (opc) {
cas... | 12,897 |
qemu | 7e01376daea75e888c370aab521a7d4aeaf2ffd1 | 0 | void ioinst_handle_schm(S390CPU *cpu, uint64_t reg1, uint64_t reg2,
uint32_t ipb)
{
uint8_t mbk;
int update;
int dct;
CPUS390XState *env = &cpu->env;
trace_ioinst("schm");
if (SCHM_REG1_RES(reg1)) {
program_interrupt(env, PGM_OPERAND, 2);
ret... | 12,898 |
qemu | 8360544a6d3a54df1fce80f55ba4ad075a8ded54 | 0 | QPCIBus *qpci_init_spapr(QGuestAllocator *alloc)
{
QPCIBusSPAPR *ret;
ret = g_malloc(sizeof(*ret));
ret->alloc = alloc;
ret->bus.io_readb = qpci_spapr_io_readb;
ret->bus.io_readw = qpci_spapr_io_readw;
ret->bus.io_readl = qpci_spapr_io_readl;
ret->bus.io_writeb = qpci_spapr_i... | 12,899 |
qemu | 8ed961d95708ee6cadac22fba7762724d533a5b4 | 0 | static void icount_warp_rt(void *opaque)
{
if (vm_clock_warp_start == -1) {
return;
}
if (runstate_is_running()) {
int64_t clock = qemu_clock_get_ns(QEMU_CLOCK_REALTIME);
int64_t warp_delta = clock - vm_clock_warp_start;
if (use_icount == 1) {
qemu_icou... | 12,900 |
qemu | f287b2c2d4d20d35880ab6dca44bda0476e67dce | 0 | static abi_long do_sendrecvmsg(int fd, abi_ulong target_msg,
int flags, int send)
{
abi_long ret, len;
struct target_msghdr *msgp;
struct msghdr msg;
int count;
struct iovec *vec;
abi_ulong target_vec;
/* FIXME */
if (!lock_user_struct(send ? VE... | 12,901 |
FFmpeg | 252746d052652b48f7bc0652e7c1601b1e997d9c | 1 | void av_image_copy_plane(uint8_t *dst, int dst_linesize,
const uint8_t *src, int src_linesize,
int bytewidth, int height)
{
if (!dst || !src)
return;
for (;height > 0; height--) {
memcpy(dst, src, bytewidth);
dst += dst_li... | 12,902 |
FFmpeg | 7f46a641bf2540b8cf1293d5e50c0c0e34264254 | 1 | static int latm_decode_frame(AVCodecContext *avctx, void *out,
int *got_frame_ptr, AVPacket *avpkt)
{
struct LATMContext *latmctx = avctx->priv_data;
int muxlength, err;
GetBitContext gb;
if ((err = init_get_bits8(&gb, avpkt->data, avpkt->size))... | 12,903 |
qemu | 209bef3e014ba1613759575e2c10f0ef8d64eb84 | 1 | static int ioreq_runio_qemu_aio(struct ioreq *ioreq)
{
struct XenBlkDev *blkdev = ioreq->blkdev;
if (ioreq->req.nr_segments && ioreq_map(ioreq) == -1)
goto err;
ioreq->aio_inflight++;
if (ioreq->presync)
bdrv_flush(blkdev->bs); /* FIXME: aio_flush() ??? */
switch (ioreq->req.operatio... | 12,904 |
FFmpeg | d32547a24a3fcc8286b318353f43805838b84775 | 1 | int attribute_align_arg avcodec_encode_video(AVCodecContext *avctx, uint8_t *buf, int buf_size,
const AVFrame *pict)
{
AVPacket pkt;
int ret, got_packet = 0;
if (buf_size < FF_MIN_BUFFER_SIZE) {
av_log(avctx, AV_LOG_ERROR, "buffer smaller than min... | 12,905 |
qemu | e806b4db1477a1c6bfda7bba28c7f26c47f18e1e | 1 | static void spapr_pci_pre_save(void *opaque)
{
sPAPRPHBState *sphb = opaque;
GHashTableIter iter;
gpointer key, value;
int i;
g_free(sphb->msi_devs);
sphb->msi_devs = NULL;
sphb->msi_devs_num = g_hash_table_size(sphb->msi);
if (!sphb->msi_devs_num) {
return;
}
... | 12,906 |
FFmpeg | 99fb79b55ad9e6be52c16f2fd794f350bd76154a | 1 | static void print_report(AVFormatContext **output_files,
AVOutputStream **ost_table, int nb_ostreams,
int is_last_report)
{
char buf[1024];
AVOutputStream *ost;
AVFormatContext *oc, *os;
int64_t total_size;
AVCodecContext *enc;
int frame... | 12,907 |
qemu | be53081a619443dc4512039d89345475ef7d9a46 | 1 | static void decode_opc(DisasContext * ctx)
{
uint32_t old_flags = ctx->envflags;
_decode_opc(ctx);
if (old_flags & DELAY_SLOT_MASK) {
/* go out of the delay slot */
ctx->envflags &= ~DELAY_SLOT_MASK;
tcg_gen_movi_i32(cpu_flags, ctx->envflags);
ctx->bstate = BS_BRA... | 12,908 |
qemu | b4548fcc0314f5e118ed45b5774e9cd99f9a97d3 | 1 | grlib_apbuart_writel(void *opaque, target_phys_addr_t addr, uint32_t value)
{
UART *uart = opaque;
unsigned char c = 0;
addr &= 0xff;
/* Unit registers */
switch (addr) {
case DATA_OFFSET:
c = value & 0xFF;
qemu_chr_write(uart->chr, &c, 1);
retu... | 12,909 |
qemu | 2ce68e4cf5be9b5176a3c3c372948d6340724d2d | 1 | static void vhost_set_memory(MemoryListener *listener,
MemoryRegionSection *section,
bool add)
{
struct vhost_dev *dev = container_of(listener, struct vhost_dev,
memory_listener);
hwaddr start_addr = section... | 12,910 |
qemu | d9bce9d99f4656ae0b0127f7472db9067b8f84ab | 1 | void do_tw (int flags)
{
if (!likely(!((Ts0 < Ts1 && (flags & 0x10)) ||
(Ts0 > Ts1 && (flags & 0x08)) ||
(Ts0 == Ts1 && (flags & 0x04)) ||
(T0 < T1 && (flags & 0x02)) ||
(T0 > T1 && (flags & 0x01)))))
do_raise_exception_err(EXCP_... | 12,911 |
FFmpeg | 149268b47c4b0f9c584771e41d266d10cf7e3bf0 | 0 | static int mss2_decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
AVPacket *avpkt)
{
const uint8_t *buf = avpkt->data;
int buf_size = avpkt->size;
MSS2Context *ctx = avctx->priv_data;
MSS12Context *c = &ctx->c;
AVFrame *frame = data;
Ge... | 12,912 |
FFmpeg | 2f3dd904f4d3b2df5ea36ab5720d8f8834c54817 | 1 | static int output_packet(InputStream *ist, int ist_index,
OutputStream *ost_table, int nb_ostreams,
const AVPacket *pkt)
{
AVFormatContext *os;
OutputStream *ost;
int ret, i;
int got_output;
void *buffer_to_free = NULL;
static unsigned i... | 12,913 |
qemu | 09aaa1602f9381c0e0fb539390b1793e51bdfc7b | 1 | void wdt_i6300esb_init(void)
{
watchdog_add_model(&model);
}
| 12,914 |
FFmpeg | 2d83f323d63332e5ecaa481d8f9301c0ea92b6ba | 1 | static int decode_frame(AVCodecContext * avctx,
void *data, int *data_size,
UINT8 * buf, int buf_size)
{
MPADecodeContext *s = avctx->priv_data;
UINT32 header;
UINT8 *buf_ptr;
int len, out_size;
short *out_samples = data;
*data_size = 0;
buf_ptr = buf;
while (buf_size ... | 12,915 |
FFmpeg | b754978a3b0aa17e7794f64c69bf4491762797fd | 0 | static int mpegps_read_seek(AVFormatContext *s,
int stream_index, int64_t timestamp)
{
int64_t pos_min, pos_max, pos;
int64_t dts_min, dts_max, dts;
timestamp = (timestamp * 90000) / AV_TIME_BASE;
#ifdef DEBUG_SEEK
printf("read_seek: %d %0.3f\n", stream_index, tim... | 12,917 |
FFmpeg | 70143a3954e1c4412efb2bf1a3a818adea2d3abf | 0 | static void dxva2_uninit(AVCodecContext *s)
{
InputStream *ist = s->opaque;
DXVA2Context *ctx = ist->hwaccel_ctx;
ist->hwaccel_uninit = NULL;
ist->hwaccel_get_buffer = NULL;
ist->hwaccel_retrieve_data = NULL;
if (ctx->decoder_service)
IDirectXVideoDecoderService_Re... | 12,918 |
FFmpeg | d6604b29ef544793479d7fb4e05ef6622bb3e534 | 0 | static av_cold int xvid_encode_close(AVCodecContext *avctx)
{
struct xvid_context *x = avctx->priv_data;
if (x->encoder_handle) {
xvid_encore(x->encoder_handle, XVID_ENC_DESTROY, NULL, NULL);
x->encoder_handle = NULL;
}
av_frame_free(&avctx->coded_frame);
av_freep(&avctx-... | 12,919 |
qemu | aec4b054ea36c53c8b887da99f20010133b84378 | 1 | static void single_quote_string(void)
{
int i;
struct {
const char *encoded;
const char *decoded;
} test_cases[] = {
{ "'hello world'", "hello world" },
{ "'the quick brown fox \\' jumped over the fence'",
"the quick brown fox ' jumped over the fence" },
... | 12,920 |
FFmpeg | f92f4935acd7d974adfd1deebdf1bb06cbe107ca | 1 | static void calculate_code_lengths(uint8_t *lengths, uint32_t *counts)
{
uint32_t nr_nodes, nr_heap, node1, node2;
int i, j;
int32_t k;
/* Heap and node entries start from 1 */
uint32_t weights[512];
uint32_t heap[512];
int32_t parents[512];
/* Set initial weights */
... | 12,922 |
FFmpeg | eefb68c9c335dda423c9115ba11dc4bb3e73e3f9 | 1 | static av_always_inline void autocorrelate(const int x[40][2], SoftFloat phi[3][2][2], int lag)
{
int i;
int64_t real_sum, imag_sum;
int64_t accu_re = 0, accu_im = 0;
if (lag) {
for (i = 1; i < 38; i++) {
accu_re += (int64_t)x[i][0] * x[i+lag][0];
accu_re += (in... | 12,923 |
FFmpeg | 0f55bc29d41585d110b126cb4ed4b395fd46d7ac | 1 | static int oma_read_seek(struct AVFormatContext *s,
int stream_index, int64_t timestamp, int flags)
{
OMAContext *oc = s->priv_data;
int err = ff_pcm_read_seek(s, stream_index, timestamp, flags);
if (!oc->encrypted)
return err;
/* readjust IV for CBC */
i... | 12,924 |
qemu | d4f9e806c20607cafe7bb0d9eba14ccb160390a1 | 1 | int pci_piix3_xen_ide_unplug(DeviceState *dev)
{
PCIIDEState *pci_ide;
DriveInfo *di;
int i = 0;
pci_ide = PCI_IDE(dev);
for (; i < 3; i++) {
di = drive_get_by_index(IF_IDE, i);
if (di != NULL && !di->media_cd) {
BlockBackend *blk = blk_by_legacy_dinfo(di);
... | 12,925 |
FFmpeg | cac8de2da5c4935773128335c11b806faa73e19d | 1 | int avcodec_copy_context(AVCodecContext *dest, const AVCodecContext *src)
{
const AVCodec *orig_codec = dest->codec;
uint8_t *orig_priv_data = dest->priv_data;
if (avcodec_is_open(dest)) { // check that the dest context is uninitialized
av_log(dest, AV_LOG_ERROR,
"Tried to cop... | 12,926 |
FFmpeg | c043def91f92da398fe04874191c8d4d7b6cf0e0 | 0 | static int ftp_open(URLContext *h, const char *url, int flags)
{
char proto[10], path[MAX_URL_SIZE];
int err;
FTPContext *s = h->priv_data;
av_dlog(h, "ftp protocol open\n");
s->state = DISCONNECTED;
s->filesize = -1;
s->position = 0;
av_url_split(proto, sizeof(proto),
... | 12,928 |
qemu | 6cec5487990bf3f1f22b3fcb871978255e92ae0d | 1 | static void vnc_convert_pixel(VncState *vs, uint8_t *buf, uint32_t v)
{
uint8_t r, g, b;
r = ((v >> vs->server_red_shift) & vs->server_red_max) * (vs->client_red_max + 1) /
(vs->server_red_max + 1);
g = ((v >> vs->server_green_shift) & vs->server_green_max) * (vs->client_green_max + 1) /
... | 12,929 |
FFmpeg | 473f0f75a16b4d37bdaa943f75e4ae249212c1ba | 1 | static int thread_execute(AVFilterContext *ctx, avfilter_action_func *func,
void *arg, int *ret, int nb_jobs)
{
ThreadContext *c = ctx->graph->internal->thread;
int dummy_ret;
if (nb_jobs <= 0)
return 0;
pthread_mutex_lock(&c->current_job_lock);
c->cur... | 12,930 |
FFmpeg | 8375dc1dd101d51baa430f34c0bcadfa37873896 | 1 | static int asf_read_payload(AVFormatContext *s, AVPacket *pkt)
{
ASFContext *asf = s->priv_data;
AVIOContext *pb = s->pb;
int ret, i;
ASFPacket *asf_pkt = NULL;
if (!asf->sub_left) {
uint32_t off_len, media_len;
uint8_t stream_num;
stream_num = avio_r8(pb);
... | 12,931 |
FFmpeg | 60f10e0ad37418cc697765d85b0bc22db70f726a | 1 | static void pred8x8_dc_rv40_c(uint8_t *src, int stride){
int i;
int dc0=0;
for(i=0;i<4; i++){
dc0+= src[-1+i*stride] + src[i-stride];
dc0+= src[4+i-stride];
dc0+= src[-1+(i+4)*stride];
}
dc0= 0x01010101*((dc0 + 8)>>4);
for(i=0; i<4; i++){
((uint32_t*... | 12,932 |
FFmpeg | 9da369604ecf31d9dce2dee21ed214b8c43264c6 | 0 | static int set_expr(AVExpr **pexpr, const char *expr, void *log_ctx)
{
int ret;
AVExpr *old = NULL;
if (*pexpr)
old = *pexpr;
ret = av_expr_parse(pexpr, expr, var_names,
NULL, NULL, NULL, NULL, 0, log_ctx);
if (ret < 0) {
av_log(log_ctx, AV_LOG_ERRO... | 12,933 |
FFmpeg | bf494092b03f107e35ab6ad70be324f23a193c2b | 0 | static void av_estimate_timings_from_pts(AVFormatContext *ic, offset_t old_offset)
{
AVPacket pkt1, *pkt = &pkt1;
AVStream *st;
int read_size, i, ret;
int64_t end_time;
int64_t filesize, offset, duration;
/* free previous packet */
if (ic->cur_st && ic->cur_st->parser)
av_... | 12,934 |
FFmpeg | ae4cffd9fc5bc495692920d646d7d1462315cfa6 | 0 | static inline void RENAME(rgb32tobgr16)(const uint8_t *src, uint8_t *dst, unsigned int src_size)
{
const uint8_t *s = src;
const uint8_t *end;
#ifdef HAVE_MMX
const uint8_t *mm_end;
#endif
uint16_t *d = (uint16_t *)dst;
end = s + src_size;
#ifdef HAVE_MMX
__asm __volatile(PREFETCH" %0"::"m"(*src):"memor... | 12,935 |
FFmpeg | c4e554701ec27b31b1b6396130b8bb2aaa0d4ad0 | 0 | static int dv_read_header(AVFormatContext *s,
AVFormatParameters *ap)
{
RawDVContext *c = s->priv_data;
c->dv_demux = dv_init_demux(s);
return c->dv_demux ? 0 : -1;
}
| 12,937 |
qemu | 07ceaf98800519ef9c5dc893af00f1fe1f9144e4 | 1 | static void vfio_map_bar(VFIOPCIDevice *vdev, int nr)
{
VFIOBAR *bar = &vdev->bars[nr];
uint64_t size = bar->region.size;
char name[64];
uint32_t pci_bar;
uint8_t type;
int ret;
/* Skip both unimplemented BARs and the upper half of 64bit BARS. */
if (!size) {
return;
... | 12,939 |
qemu | f3ced3c59287dabc253f83f0c70aa4934470c15e | 1 | static void cpu_common_reset(CPUState *cpu)
{
CPUClass *cc = CPU_GET_CLASS(cpu);
int i;
if (qemu_loglevel_mask(CPU_LOG_RESET)) {
qemu_log("CPU Reset (CPU %d)\n", cpu->cpu_index);
log_cpu_state(cpu, cc->reset_dump_flags);
}
cpu->interrupt_request = 0;
cpu->halted = 0;... | 12,941 |
qemu | 7c47959d0cb05db43014141a156ada0b6d53a750 | 1 | static void string_output_append_range(StringOutputVisitor *sov,
int64_t s, int64_t e)
{
Range *r = g_malloc0(sizeof(*r));
r->begin = s;
r->end = e + 1;
sov->ranges = g_list_insert_sorted_merged(sov->ranges, r, range_compare);
}
| 12,942 |
FFmpeg | d3f84dfc0e65201983e88c99b7544d5a60d0165e | 1 | int ff_rtsp_connect(AVFormatContext *s)
{
RTSPState *rt = s->priv_data;
char host[1024], path[1024], tcpname[1024], cmd[2048], auth[128];
char *option_list, *option, *filename;
URLContext *rtsp_hd, *rtsp_hd_out;
int port, err, tcp_fd;
RTSPMessageHeader reply1 = {}, *reply = &reply1;
... | 12,943 |
FFmpeg | 82b9e4a286e904dd402ddf6c914756963b2e2c4d | 1 | static int asf_read_seek(AVFormatContext *s, int stream_index, int64_t pts)
{
ASFContext *asf = s->priv_data;
AVStream *st;
AVPacket pkt1, *pkt;
int block_align;
int64_t pos;
int64_t pos_min, pos_max, pts_min, pts_max, cur_pts;
pkt = &pkt1;
// Validate pts
if (pts < 0)
... | 12,944 |
qemu | f678f671ba654d4610f0e43d175c8c1b2fad10df | 1 | static void decode_src_opc(CPUTriCoreState *env, DisasContext *ctx, int op1)
{
int r1;
int32_t const4;
TCGv temp, temp2;
r1 = MASK_OP_SRC_S1D(ctx->opcode);
const4 = MASK_OP_SRC_CONST4_SEXT(ctx->opcode);
switch (op1) {
case OPC1_16_SRC_ADD:
gen_addi_d(cpu_gpr_d[r1], cpu_g... | 12,945 |
FFmpeg | 5afe1d27912be9b643ffb4ddc21f6d920260dbb0 | 1 | int ffio_read_indirect(AVIOContext *s, unsigned char *buf, int size, unsigned char **data)
{
if (s->buf_end - s->buf_ptr >= size && !s->write_flag) {
*data = s->buf_ptr;
s->buf_ptr += size;
return size;
} else {
*data = buf;
return avio_read(s, buf, size);
}
... | 12,947 |
FFmpeg | 2420763638bef385c8116a44ff5c0d2c15589494 | 0 | int avfilter_graph_parse(AVFilterGraph *graph, const char *filters,
AVFilterInOut **open_inputs_ptr, AVFilterInOut **open_outputs_ptr,
void *log_ctx)
{
int index = 0, ret = 0;
char chr = 0;
AVFilterInOut *curr_inputs = NULL;
AVFilterInOut *open_... | 12,948 |
FFmpeg | afb2aa537954db537d54358997b68f46561fd5a7 | 1 | static inline int vorbis_residue_decode(vorbis_context *vc, vorbis_residue *vr,
unsigned ch,
uint8_t *do_not_decode,
float *vec, unsigned vlen)
{
if (vr->type == 2)
return vorbis_res... | 12,950 |
FFmpeg | 0c2aaa882d124f05b7bf0a4a4abba3293f4d6d84 | 1 | static void common_end(FFV1Context *s){
int i;
for(i=0; i<s->plane_count; i++){
PlaneContext *p= &s->plane[i];
av_freep(&p->state);
}
}
| 12,952 |
FFmpeg | 7500781313d11b37772c05a28da20fbc112db478 | 1 | static av_cold int ape_decode_close(AVCodecContext * avctx)
{
APEContext *s = avctx->priv_data;
int i;
for (i = 0; i < APE_FILTER_LEVELS; i++)
av_freep(&s->filterbuf[i]);
av_freep(&s->data);
return 0;
}
| 12,953 |
qemu | 1f51470d044852592922f91000e741c381582cdc | 1 | static int qemu_chr_open_file_out(QemuOpts *opts, CharDriverState **_chr)
{
int fd_out;
TFR(fd_out = qemu_open(qemu_opt_get(opts, "path"),
O_WRONLY | O_TRUNC | O_CREAT | O_BINARY, 0666));
if (fd_out < 0) {
return -errno;
}
*_chr = qemu_chr_open_fd(-1, fd_out... | 12,954 |
qemu | 9ed257d1d1c65dbe5a08f207e5106e98384e1860 | 1 | static int con_initialise(struct XenDevice *xendev)
{
struct XenConsole *con = container_of(xendev, struct XenConsole, xendev);
int limit;
if (xenstore_read_int(con->console, "ring-ref", &con->ring_ref) == -1)
return -1;
if (xenstore_read_int(con->console, "port", &con->xendev.remote_port) == -... | 12,955 |
FFmpeg | 704cc5e75df3a1dc68581d3857a06d502d8662b6 | 1 | static void writer_close(WriterContext **wctx)
{
int i;
if (!*wctx)
return;
if ((*wctx)->writer->uninit)
(*wctx)->writer->uninit(*wctx);
for (i = 0; i < SECTION_MAX_NB_LEVELS; i++)
av_bprint_finalize(&(*wctx)->section_pbuf[i], NULL);
if ((*wctx)->writer->priv_cla... | 12,956 |
FFmpeg | 570a4a0189946c2c983da41d37fdd67fa13266e7 | 0 | static int avi_read_tag(AVFormatContext *s, AVStream *st, uint32_t tag, uint32_t size)
{
AVIOContext *pb = s->pb;
char key[5] = {0}, *value;
size += (size & 1);
if (size == UINT_MAX)
return -1;
value = av_malloc(size+1);
if (!value)
return -1;
avio_read(pb, valu... | 12,957 |
qemu | b8afb520e479e693c227aa39c2fb7670743e104f | 1 | static void set_dirty_tracking(void)
{
BlkMigDevState *bmds;
QSIMPLEQ_FOREACH(bmds, &block_mig_state.bmds_list, entry) {
bmds->dirty_bitmap = bdrv_create_dirty_bitmap(bmds->bs, BLOCK_SIZE);
}
}
| 12,958 |
FFmpeg | c3ab0004ae4dffc32494ae84dd15cfaa909a7884 | 1 | static inline void RENAME(nvXXtoUV)(uint8_t *dst1, uint8_t *dst2,
const uint8_t *src, int width)
{
#if COMPILE_TEMPLATE_MMX
__asm__ volatile(
"movq "MANGLE(bm01010101)", %%mm4 \n\t"
"mov %0, %%"REG_a" \n\t"
"1: ... | 12,959 |
FFmpeg | 2acee08a4a53b6c8f5fc160e6d6da92f77208a06 | 1 | static int frame_copy_props(AVFrame *dst, const AVFrame *src, int force_copy)
{
int i;
dst->key_frame = src->key_frame;
dst->pict_type = src->pict_type;
dst->sample_aspect_ratio = src->sample_aspect_ratio;
dst->pts = src->pts;
dst->repeat_... | 12,960 |
qemu | c8057f951d64de93bfd01569c0a725baa9f94372 | 1 | static int img_create(int argc, char **argv)
{
int c, ret = 0;
uint64_t img_size = -1;
const char *fmt = "raw";
const char *base_fmt = NULL;
const char *filename;
const char *base_filename = NULL;
char *options = NULL;
for(;;) {
c = getopt(argc, argv, "F:b:f:he6o:");
... | 12,961 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.