project stringclasses 2
values | commit_id stringlengths 40 40 | target int64 0 1 | func stringlengths 26 142k | idx int64 0 27.3k |
|---|---|---|---|---|
qemu | 24df3371d97a7516605aef8abbc253a8c162b211 | 1 | static int handle_utimensat(FsContext *ctx, V9fsPath *fs_path,
const struct timespec *buf)
{
int ret;
#ifdef CONFIG_UTIMENSAT
int fd;
struct handle_data *data = (struct handle_data *)ctx->private;
fd = open_by_handle(data->mountfd, fs_path->data, O_NONBLOCK);
if... | 16,692 |
qemu | a01aedc8d32e6f5b08a4041b62be3c5fab7a3382 | 1 | void object_property_add_str(Object *obj, const char *name,
char *(*get)(Object *, Error **),
void (*set)(Object *, const char *, Error **),
Error **errp)
{
StringProperty *prop = g_malloc0(sizeof(*prop));
prop->get = get;
... | 16,694 |
qemu | 7d1b0095bff7157e856d1d0e6c4295641ced2752 | 1 | static int disas_cp14_write(CPUState * env, DisasContext *s, uint32_t insn)
{
int crn = (insn >> 16) & 0xf;
int crm = insn & 0xf;
int op1 = (insn >> 21) & 7;
int op2 = (insn >> 5) & 7;
int rt = (insn >> 12) & 0xf;
TCGv tmp;
if (arm_feature(env, ARM_FEATURE_THUMB2EE)) {
if ... | 16,695 |
qemu | d59ce6f34434bf47a9b26138c908650bf9a24be1 | 1 | static void tcp_wait_for_connect(int fd, Error *err, void *opaque)
{
MigrationState *s = opaque;
if (fd < 0) {
DPRINTF("migrate connect error: %s\n", error_get_pretty(err));
s->to_dst_file = NULL;
migrate_fd_error(s);
} else {
DPRINTF("migrate connect success\n");
... | 16,696 |
qemu | 8417cebfda193c7f9ca70be5e308eaa92cf84b94 | 1 | static FlatView generate_memory_topology(MemoryRegion *mr)
{
FlatView view;
flatview_init(&view);
render_memory_region(&view, mr, 0, addrrange_make(0, UINT64_MAX));
flatview_simplify(&view);
return view;
}
| 16,697 |
qemu | 4e27e819bea0ea6c8108dc7e9fa48afd6ec13c46 | 1 | static void visit_type_int32(Visitor *v, int *value, const char *name, Error **errp)
{
int64_t val = *value;
visit_type_int(v, &val, name, errp);
}
| 16,699 |
qemu | 2ba1eeb62c29d23238b95dc7e9ade3444b49f0a1 | 1 | static inline int tcg_gen_code_common(TCGContext *s, uint8_t *gen_code_buf,
int do_search_pc,
const uint8_t *searched_pc)
{
int opc, op_index, macro_op_index;
const TCGOpDef *def;
unsigned int dead_iargs;
const TCGArg *ar... | 16,701 |
FFmpeg | 31741aecbf9938194b25f14de434104be33f5809 | 1 | static int setup_hwaccel(AVCodecContext *avctx,
const enum AVPixelFormat fmt,
const char *name)
{
AVHWAccel *hwa = find_hwaccel(avctx->codec_id, fmt);
int ret = 0;
if (!hwa) {
"Could not find an AVHWAccel for the pixel format: %s",
... | 16,702 |
FFmpeg | 78e9852a2e3b198ecd69ffa0deab3fa22a8e5378 | 1 | static void rpza_decode_stream(RpzaContext *s)
{
int width = s->avctx->width;
int stride = s->frame.linesize[0] / 2;
int row_inc = stride - 4;
int stream_ptr = 0;
int chunk_size;
unsigned char opcode;
int n_blocks;
unsigned short colorA = 0, colorB;
unsigned short color4[4]... | 16,703 |
FFmpeg | 428098165de4c3edfe42c1b7f00627d287015863 | 1 | static int mlib_YUV2RGB420_24(SwsContext *c, uint8_t* src[], int srcStride[], int srcSliceY,
int srcSliceH, uint8_t* dst[], int dstStride[]){
if(c->srcFormat == PIX_FMT_YUV422P){
srcStride[1] *= 2;
srcStride[2] *= 2;
}
assert(srcStride[1] == srcStride[2]);
mlib_VideoColorYUV2RG... | 16,705 |
qemu | ad0ebb91cd8b5fdc4a583b03645677771f420a46 | 1 | uint64_t ldq_tce(VIOsPAPRDevice *dev, uint64_t taddr)
{
uint64_t val;
spapr_tce_dma_read(dev, taddr, &val, sizeof(val));
return tswap64(val);
}
| 16,706 |
qemu | 5839e53bbc0fec56021d758aab7610df421ed8c8 | 1 | static int raw_reopen_prepare(BDRVReopenState *state,
BlockReopenQueue *queue, Error **errp)
{
BDRVRawState *s;
BDRVRawReopenState *raw_s;
int ret = 0;
Error *local_err = NULL;
assert(state != NULL);
assert(state->bs != NULL);
s = state->bs->opaque;... | 16,707 |
qemu | 6687b79d636cd60ed9adb1177d0d946b58fa7717 | 1 | int net_init_dump(QemuOpts *opts, const char *name, VLANState *vlan)
{
int len;
const char *file;
char def_file[128];
assert(vlan);
file = qemu_opt_get(opts, "file");
if (!file) {
snprintf(def_file, sizeof(def_file), "qemu-vlan%d.pcap", vlan->id);
file = def_file;
... | 16,710 |
qemu | 2f01dfacb56bc7a0d4639adc9dff9aae131e6216 | 1 | static int blk_free(struct XenDevice *xendev)
{
struct XenBlkDev *blkdev = container_of(xendev, struct XenBlkDev, xendev);
struct ioreq *ioreq;
if (blkdev->blk || blkdev->sring) {
blk_disconnect(xendev);
}
/* Free persistent grants */
if (blkdev->feature_persistent) {
... | 16,711 |
qemu | ab2da564d7f8f2a0e4e31875e1cdf87db14500e2 | 1 | static void r2d_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)
{
CPUState *env;
struct SH7750State *s;
ram_addr_t sdram_addr, sm501_vga_ram_ad... | 16,712 |
qemu | 97f3ad35517e0d02c0149637d1bb10713c52b057 | 1 | MigrationIncomingState *migration_incoming_state_new(QEMUFile* f)
{
mis_current = g_malloc0(sizeof(MigrationIncomingState));
mis_current->file = f;
QLIST_INIT(&mis_current->loadvm_handlers);
return mis_current;
}
| 16,713 |
FFmpeg | 8089b7fa8c5b5a48cc7101daa4be891d0ead5a5e | 1 | double av_get_double(void *obj, const char *name, const AVOption **o_out)
{
int64_t intnum=1;
double num=1;
int den=1;
av_get_number(obj, name, o_out, &num, &den, &intnum);
return num*intnum/den;
}
| 16,714 |
qemu | 771b64daf9c73be98d223d3ab101a61f02cac277 | 1 | static void laio_cancel(BlockDriverAIOCB *blockacb)
{
struct qemu_laiocb *laiocb = (struct qemu_laiocb *)blockacb;
struct io_event event;
int ret;
if (laiocb->ret != -EINPROGRESS)
return;
/*
* Note that as of Linux 2.6.31 neither the block device code nor any
* filesys... | 16,715 |
FFmpeg | 009f829dde811af654af7110326aea3a72c05d5e | 1 | static inline void RENAME(yuv2bgr24_1)(SwsContext *c, const uint16_t *buf0,
const uint16_t *ubuf0, const uint16_t *ubuf1,
const uint16_t *vbuf0, const uint16_t *vbuf1,
const uint16_t *abuf0, uint8_t *... | 16,716 |
FFmpeg | 3c7f75bd84b4c30a0f86a491a37f759dfaaab86d | 1 | static int avi_read_idx1(AVFormatContext *s, int size)
{
AVIContext *avi = s->priv_data;
AVIOContext *pb = s->pb;
int nb_index_entries, i;
AVStream *st;
AVIStream *ast;
unsigned int index, tag, flags, pos, len, first_packet = 1;
unsigned last_pos= -1;
int64_t idx1_pos, first_pac... | 16,718 |
FFmpeg | 01ecb7172b684f1c4b3e748f95c5a9a494ca36ec | 1 | static float quantize_band_cost_bits(struct AACEncContext *s, const float *in,
const float *scaled, int size, int scale_idx,
int cb, const float lambda, const float uplim,
int *bits, int rtz)
{
return... | 16,719 |
qemu | c3e4f43a99549daa6e9b87350922e8339341c2ab | 1 | static void coroutine_fn stream_run(void *opaque)
{
StreamBlockJob *s = opaque;
BlockDriverState *bs = s->common.bs;
BlockDriverState *base = s->base;
int64_t sector_num, end;
int error = 0;
int ret = 0;
int n = 0;
void *buf;
s->common.len = bdrv_getlength(bs);
if (s... | 16,720 |
qemu | 6864fa38972081833f79b39df74b9c08cc94f6cc | 0 | PCIBus *pci_apb_init(hwaddr special_base,
hwaddr mem_base,
qemu_irq *ivec_irqs, PCIBus **busA, PCIBus **busB,
qemu_irq **pbm_irqs)
{
DeviceState *dev;
SysBusDevice *s;
PCIHostState *phb;
APBState *d;
IOMMUState *is;
PCIDevi... | 16,722 |
qemu | 72cf2d4f0e181d0d3a3122e04129c58a95da713e | 0 | void register_module_init(void (*fn)(void), module_init_type type)
{
ModuleEntry *e;
ModuleTypeList *l;
e = qemu_mallocz(sizeof(*e));
e->init = fn;
l = find_type(type);
TAILQ_INSERT_TAIL(l, e, node);
}
| 16,725 |
qemu | a0b753dfd3920df146a5f4d05e442e3c522900c7 | 0 | static void spitz_common_init(ram_addr_t ram_size, int vga_ram_size,
const char *kernel_filename,
const char *kernel_cmdline, const char *initrd_filename,
const char *cpu_model, enum spitz_model_e model, int arm_id)
{
struct pxa2xx_state_s *cpu;
struct scoop... | 16,726 |
qemu | b40acf99bef69fa8ab0f9092ff162fde945eec12 | 0 | uint32_t cpu_inl(pio_addr_t addr)
{
uint32_t val;
val = ioport_read(2, addr);
trace_cpu_in(addr, val);
LOG_IOPORT("inl : %04"FMT_pioaddr" %08"PRIx32"\n", addr, val);
return val;
}
| 16,729 |
qemu | 4bfe4478d17679464a2aaa91ed703522ed9af8a0 | 0 | static int nbd_co_request(BlockDriverState *bs,
NBDRequest *request,
QEMUIOVector *qiov)
{
NBDClientSession *client = nbd_get_client_session(bs);
int ret;
assert(!qiov || request->type == NBD_CMD_WRITE ||
request->type == NBD_CMD_READ);... | 16,730 |
qemu | 384acbf46b70edf0d2c1648aa1a92a90bcf7057d | 0 | static int posix_aio_process_queue(void *opaque)
{
PosixAioState *s = opaque;
struct qemu_paiocb *acb, **pacb;
int ret;
int result = 0;
int async_context_id = get_async_context_id();
for(;;) {
pacb = &s->first_aio;
for(;;) {
acb = *pacb;
if (!... | 16,732 |
qemu | a8170e5e97ad17ca169c64ba87ae2f53850dab4c | 0 | static uint32_t isa_mmio_readb (void *opaque, target_phys_addr_t addr)
{
return cpu_inb(addr & IOPORTS_MASK);
}
| 16,733 |
qemu | 6e9ea0c0629fe25723494a19498bedf4b781cbfa | 0 | static int vpc_create(const char *filename, int64_t total_sectors,
const char *backing_file, int flags)
{
uint8_t buf[1024];
struct vhd_footer* footer = (struct vhd_footer*) buf;
struct vhd_dyndisk_header* dyndisk_header =
(struct vhd_dyndisk_header*) buf;
int fd, i;
uint16_t cyl... | 16,734 |
qemu | 6a84cb1f2822e494839b93dd8c7f7f8fa6c261a9 | 0 | static int usb_msd_initfn(USBDevice *dev)
{
MSDState *s = DO_UPCAST(MSDState, dev, dev);
BlockDriverState *bs = s->conf.bs;
DriveInfo *dinfo;
if (!bs) {
error_report("usb-msd: drive property not set");
return -1;
}
/*
* Hack alert: this pretends to be a block d... | 16,736 |
FFmpeg | 5d652e063bd3a180f9de8915e5137aa4f938846d | 0 | static int encode_superframe(AVCodecContext *avctx,
unsigned char *buf, int buf_size, void *data){
WMACodecContext *s = avctx->priv_data;
const short *samples = data;
int i, total_gain;
s->block_len_bits= s->frame_len_bits; //required by non variable block len
s->... | 16,738 |
qemu | b2c98d9d392c87c9b9e975d30f79924719d9cbbe | 0 | static void tgen_movcond(TCGContext *s, TCGType type, TCGCond c, TCGReg dest,
TCGReg c1, TCGArg c2, int c2const, TCGReg r3)
{
int cc;
if (facilities & FACILITY_LOAD_ON_COND) {
cc = tgen_cmp(s, type, c, c1, c2, c2const, false);
tcg_out_insn(s, RRF, LOCGR, dest, r3, ... | 16,739 |
qemu | cc001888b78090ed08d05453b5574b3253a143c0 | 0 | static void parse_numa_node(MachineState *ms, NumaNodeOptions *node,
QemuOpts *opts, Error **errp)
{
uint16_t nodenr;
uint16List *cpus = NULL;
MachineClass *mc = MACHINE_GET_CLASS(ms);
if (node->has_nodeid) {
nodenr = node->nodeid;
} else {
node... | 16,740 |
qemu | 258d2edbcd4bb5d267c96163333820332e1c14fa | 0 | static int calculate_geometry(int64_t total_sectors, uint16_t* cyls,
uint8_t* heads, uint8_t* secs_per_cyl)
{
uint32_t cyls_times_heads;
if (total_sectors > 65535 * 16 * 255)
return -EFBIG;
if (total_sectors > 65535 * 16 * 63) {
*secs_per_cyl = 255;
*heads = 16;
... | 16,741 |
qemu | 8d2f850a5ab7579a852f23b28273940a47dfd7ff | 0 | static uint32_t do_csst(CPUS390XState *env, uint32_t r3, uint64_t a1,
uint64_t a2, bool parallel)
{
#if !defined(CONFIG_USER_ONLY) || defined(CONFIG_ATOMIC128)
uint32_t mem_idx = cpu_mmu_index(env, false);
#endif
uintptr_t ra = GETPC();
uint32_t fc = extract32(env->regs[0], 0,... | 16,742 |
qemu | b3db211f3c80bb996a704d665fe275619f728bd4 | 0 | static void test_visitor_out_native_list_int32(TestOutputVisitorData *data,
const void *unused)
{
test_native_list(data, unused, USER_DEF_NATIVE_LIST_UNION_KIND_S32);
}
| 16,743 |
qemu | 1f0c461b82d5ec2664ca0cfc9548f80da87a8f8a | 0 | static void blockdev_mirror_common(BlockDriverState *bs,
BlockDriverState *target,
bool has_replaces, const char *replaces,
enum MirrorSyncMode sync,
bool has_speed, int64_t sp... | 16,745 |
qemu | ba801af429aaa68f6cc03842c8b6be81a6ede65a | 0 | void helper_mtc0_index(CPUMIPSState *env, target_ulong arg1)
{
int num = 1;
unsigned int tmp = env->tlb->nb_tlb;
do {
tmp >>= 1;
num <<= 1;
} while (tmp);
env->CP0_Index = (env->CP0_Index & 0x80000000) | (arg1 & (num - 1));
}
| 16,746 |
qemu | 4a1418e07bdcfaa3177739e04707ecaec75d89e1 | 0 | static ram_addr_t kqemu_ram_alloc(ram_addr_t size)
{
ram_addr_t addr;
if ((last_ram_offset + size) > kqemu_phys_ram_size) {
fprintf(stderr, "Not enough memory (requested_size = %" PRIu64 ", max memory = %" PRIu64 ")\n",
(uint64_t)size, (uint64_t)kqemu_phys_ram_size);
abort(... | 16,747 |
qemu | dd673288a8ff73ad77fcc1c255486d2466a772e1 | 0 | void do_cpu_init(X86CPU *cpu)
{
CPUX86State *env = &cpu->env;
int sipi = env->interrupt_request & CPU_INTERRUPT_SIPI;
uint64_t pat = env->pat;
cpu_reset(CPU(cpu));
env->interrupt_request = sipi;
env->pat = pat;
apic_init_reset(env->apic_state);
env->halted = !cpu_is_bsp(env);
... | 16,748 |
FFmpeg | cbba331aa02f29870581ff0b7ded7477b279ae2c | 0 | static inline int show_tags(WriterContext *wctx, AVDictionary *tags, int section_id)
{
AVDictionaryEntry *tag = NULL;
int ret = 0;
if (!tags)
return 0;
writer_print_section_header(wctx, section_id);
while ((tag = av_dict_get(tags, "", tag, AV_DICT_IGNORE_SUFFIX))) {
ret =... | 16,749 |
qemu | 42a268c241183877192c376d03bd9b6d527407c7 | 0 | static void gen_dozi(DisasContext *ctx)
{
target_long simm = SIMM(ctx->opcode);
int l1 = gen_new_label();
int l2 = gen_new_label();
tcg_gen_brcondi_tl(TCG_COND_LT, cpu_gpr[rA(ctx->opcode)], simm, l1);
tcg_gen_subfi_tl(cpu_gpr[rD(ctx->opcode)], simm, cpu_gpr[rA(ctx->opcode)]);
tcg_gen_br(l... | 16,750 |
qemu | a7812ae412311d7d47f8aa85656faadac9d64b56 | 0 | static inline void t_gen_swapb(TCGv d, TCGv s)
{
TCGv t, org_s;
t = tcg_temp_new(TCG_TYPE_TL);
org_s = tcg_temp_new(TCG_TYPE_TL);
/* d and s may refer to the same object. */
tcg_gen_mov_tl(org_s, s);
tcg_gen_shli_tl(t, org_s, 8);
tcg_gen_andi_tl(d, t, 0xff00ff00);
tcg_gen_shri_tl(t, org_s, 8);
t... | 16,751 |
FFmpeg | 223d996aaf9f1668c28519d3d7eb756e6cdf3fcf | 1 | static inline int get_symbol(RangeCoder *c, uint8_t *state, int is_signed){
if(get_rac(c, state+0))
return 0;
else{
int i, e, a;
e= 0;
while(get_rac(c, state+1 + e)){ //1..10
e++;
}
assert(e<=9);
a= 1;
for(i=e-1; i>=0; i--)... | 16,754 |
FFmpeg | fd7a7e11b94b12259c6f1e375da15298cbc37e83 | 1 | static int asink_query_formats(AVFilterContext *ctx)
{
BufferSinkContext *buf = ctx->priv;
AVFilterFormats *formats = NULL;
AVFilterChannelLayouts *layouts = NULL;
unsigned i;
int ret;
CHECK_LIST_SIZE(sample_fmts)
CHECK_LIST_SIZE(sample_rates)
CHECK_LIST_SIZE(channel_layouts)
... | 16,756 |
FFmpeg | fd34dbea58e097609ff09cf7dcc59f74930195d3 | 1 | static int mxf_read_source_package(void *arg, AVIOContext *pb, int tag, int size, UID uid)
{
MXFPackage *package = arg;
switch(tag) {
case 0x4403:
package->tracks_count = avio_rb32(pb);
if (package->tracks_count >= UINT_MAX / sizeof(UID))
return -1;
package->track... | 16,757 |
FFmpeg | bb6a7b6f75ac544c956e3eefee297700ef4d3468 | 1 | int ff_lzf_uncompress(GetByteContext *gb, uint8_t **buf, int64_t *size)
{
int ret = 0;
uint8_t *p = *buf;
int64_t len = 0;
while (bytestream2_get_bytes_left(gb) > 2) {
uint8_t s = bytestream2_get_byte(gb);
if (s < LZF_LITERAL_MAX) {
s++;
if (s > ... | 16,760 |
FFmpeg | e55376a1fd5abebbb0a082aa20739d58c2260a37 | 1 | static int inject_fake_duration_metadata(RTMPContext *rt)
{
// We need to insert the metdata packet directly after the FLV
// header, i.e. we need to move all other already read data by the
// size of our fake metadata packet.
uint8_t* p;
// Keep old flv_data pointer
uint8_t* old_flv_da... | 16,761 |
qemu | 69d34a360dfe773e17e72c76d15931c9b9d190f6 | 1 | static int dmg_open(BlockDriverState *bs, int flags)
{
BDRVDMGState *s = bs->opaque;
off_t info_begin,info_end,last_in_offset,last_out_offset;
uint32_t count;
uint32_t max_compressed_size=1,max_sectors_per_chunk=1,i;
int64_t offset;
bs->read_only = 1;
s->n_chunks = 0;
s->offse... | 16,762 |
FFmpeg | 11f0acf829e26279c5f2a414c6860bd4933f29af | 0 | static void idct32(int *out, int *tab)
{
int i, j;
int *t, *t1, xr;
const int *xp = costab32;
for(j=31;j>=3;j-=2) tab[j] += tab[j - 2];
t = tab + 30;
t1 = tab + 2;
do {
t[0] += t[-4];
t[1] += t[1 - 4];
t -= 4;
} while (t != t1);
t = tab + 28... | 16,763 |
FFmpeg | c78c6d6c588c1db60cf2a1bd5bc65095852f91fc | 0 | static int ac3_decode_frame(AVCodecContext * avctx, void *data, int *data_size,
const uint8_t *buf, int buf_size)
{
AC3DecodeContext *s = avctx->priv_data;
int16_t *out_samples = (int16_t *)data;
int i, blk, ch, err;
/* initialize the GetBitContext with the start of v... | 16,764 |
qemu | a48da7b5bc1f0c98e7a124337140efd47049066c | 1 | static void multi_serial_pci_realize(PCIDevice *dev, Error **errp)
{
PCIDeviceClass *pc = PCI_DEVICE_GET_CLASS(dev);
PCIMultiSerialState *pci = DO_UPCAST(PCIMultiSerialState, dev, dev);
SerialState *s;
Error *err = NULL;
int i;
switch (pc->device_id) {
case 0x0003:
pci->po... | 16,766 |
FFmpeg | 732f9fcfe54fc9a0a7bbce53fe86b38744c2d301 | 1 | int ff_h264_decode_picture_parameter_set(H264Context *h, int bit_length){
MpegEncContext * const s = &h->s;
unsigned int pps_id= get_ue_golomb(&s->gb);
PPS *pps;
const int qp_bd_offset = 6*(h->sps.bit_depth_luma-8);
int bits_left;
if(pps_id >= MAX_PPS_COUNT) {
av_log(h->s.avctx,... | 16,768 |
qemu | 3a3b8502e6f0c8d30865c5f36d2c3ae4114000b5 | 1 | int spapr_rtas_device_tree_setup(void *fdt, hwaddr rtas_addr,
hwaddr rtas_size)
{
int ret;
int i;
ret = fdt_add_mem_rsv(fdt, rtas_addr, rtas_size);
if (ret < 0) {
fprintf(stderr, "Couldn't add RTAS reserve entry: %s\n",
fdt_strerror(ret)... | 16,769 |
qemu | 7e09797c299712cafa7bc05dd57c1b13afcc6039 | 1 | static int get_phys_addr_mpu(CPUARMState *env, uint32_t address,
int access_type, int is_user,
hwaddr *phys_ptr, int *prot)
{
int n;
uint32_t mask;
uint32_t base;
*phys_ptr = address;
for (n = 7; n >= 0; n--) {
base = env->cp15.c6... | 16,770 |
FFmpeg | 341f01290c2353669ed2263f56e1a9f4c67cc597 | 1 | static int huff_build(VLC *vlc, uint8_t *len)
{
HuffEntry he[256];
uint32_t codes[256];
uint8_t bits[256];
uint8_t syms[256];
uint32_t code;
int i;
for (i = 0; i < 256; i++) {
he[i].sym = 255 - i;
he[i].len = len[i];
if (len[i] == 0)
return A... | 16,772 |
FFmpeg | 1a3598aae768465a8efc8475b6df5a8261bc62fc | 1 | static int get_cox(Jpeg2000DecoderContext *s, Jpeg2000CodingStyle *c)
{
uint8_t byte;
if (s->buf_end - s->buf < 5)
return AVERROR(EINVAL);
/* nreslevels = number of resolution levels
= number of decomposition level +1 */
c->nreslevels = bytestream_get_byte(&s->buf) +... | 16,773 |
qemu | ce78d18ced118b03e821135e702ba1d513c8b2a7 | 1 | void qemu_clock_warp(QEMUClockType type)
{
int64_t deadline;
/*
* There are too many global variables to make the "warp" behavior
* applicable to other clocks. But a clock argument removes the
* need for if statements all over the place.
*/
if (type != QEMU_CLOCK_VIRTUAL || !u... | 16,774 |
qemu | acd80015fbe28f4f513e036ad1db2a76738d1f53 | 0 | void qpci_plug_device_test(const char *driver, const char *id,
uint8_t slot, const char *opts)
{
QDict *response;
char *cmd;
cmd = g_strdup_printf("{'execute': 'device_add',"
" 'arguments': {"
" 'driver': '%s',"
... | 16,775 |
qemu | 094d028a7968236cd2b7f7b96394f7a3b8ad97c8 | 0 | void tlb_fill(CPUState *cs, target_ulong addr, int is_write, int mmu_idx,
uintptr_t retaddr)
{
bool ret;
uint32_t fsr = 0;
ARMMMUFaultInfo fi = {};
ret = arm_tlb_fill(cs, addr, is_write, mmu_idx, &fsr, &fi);
if (unlikely(ret)) {
ARMCPU *cpu = ARM_CPU(cs);
CPU... | 16,778 |
qemu | b97400caef60ccfb0bc81c59f8bd824c43a0d6c8 | 0 | static int local_fstat(FsContext *fs_ctx, int fd, struct stat *stbuf)
{
int err;
err = fstat(fd, stbuf);
if (err) {
return err;
}
if (fs_ctx->fs_sm == SM_MAPPED) {
/* Actual credentials are part of extended attrs */
uid_t tmp_uid;
gid_t tmp_gid;
mod... | 16,779 |
qemu | b3db211f3c80bb996a704d665fe275619f728bd4 | 0 | static void test_visitor_in_native_list_int8(TestInputVisitorData *data,
const void *unused)
{
test_native_list_integer_helper(data, unused,
USER_DEF_NATIVE_LIST_UNION_KIND_S8);
}
| 16,781 |
qemu | ae4d2eb273b167dad748ea4249720319240b1ac2 | 0 | static void xen_platform_ioport_writeb(void *opaque, hwaddr addr,
uint64_t val, unsigned int size)
{
PCIXenPlatformState *s = opaque;
PCIDevice *pci_dev = PCI_DEVICE(s);
switch (addr) {
case 0: /* Platform flags */
platform_fixed_ioport_writeb(opaq... | 16,782 |
FFmpeg | a553c6a347d3d28d7ee44c3df3d5c4ee780dba23 | 0 | void ff_thread_release_buffer(AVCodecContext *avctx, ThreadFrame *f)
{
PerThreadContext *p = avctx->internal->thread_ctx;
FrameThreadContext *fctx;
AVFrame *dst, *tmp;
FF_DISABLE_DEPRECATION_WARNINGS
int can_direct_free = !(avctx->active_thread_type & FF_THREAD_FRAME) ||
... | 16,784 |
qemu | 4341df8a83d6a528a1e2855735f87fc3aab42b70 | 0 | static int count_contiguous_clusters_by_type(int nb_clusters,
uint64_t *l2_table,
int wanted_type)
{
int i;
for (i = 0; i < nb_clusters; i++) {
int type = qcow2_get_cluster_type(be64_to_cpu(l2_table[i]));
... | 16,785 |
qemu | 4be746345f13e99e468c60acbd3a355e8183e3ce | 0 | static void scsi_disk_emulate_mode_select(SCSIDiskReq *r, uint8_t *inbuf)
{
SCSIDiskState *s = DO_UPCAST(SCSIDiskState, qdev, r->req.dev);
uint8_t *p = inbuf;
int cmd = r->req.cmd.buf[0];
int len = r->req.cmd.xfer;
int hdr_len = (cmd == MODE_SELECT ? 4 : 8);
int bd_len;
int pass;
... | 16,786 |
qemu | f090c9d4ad5812fb92843d6470a1111c15190c4c | 0 | int32 float32_to_int32_round_to_zero( float32 a STATUS_PARAM )
{
flag aSign;
int16 aExp, shiftCount;
bits32 aSig;
int32 z;
aSig = extractFloat32Frac( a );
aExp = extractFloat32Exp( a );
aSign = extractFloat32Sign( a );
shiftCount = aExp - 0x9E;
if ( 0 <= shiftCount ) {
... | 16,788 |
qemu | a4cc73d629d43c8a4d171d043ff229a959df3ca6 | 0 | QEMUFile *qemu_popen_cmd(const char *command, const char *mode)
{
FILE *stdio_file;
QEMUFileStdio *s;
stdio_file = popen(command, mode);
if (stdio_file == NULL) {
return NULL;
}
if (mode == NULL || (mode[0] != 'r' && mode[0] != 'w') || mode[1] != 0) {
fprintf(stderr,... | 16,789 |
qemu | c975330ec4f5674f2899331f914c04ecba6edf26 | 0 | static int openpic_load(QEMUFile* f, void *opaque, int version_id)
{
OpenPICState *opp = (OpenPICState *)opaque;
unsigned int i;
if (version_id != 1)
return -EINVAL;
qemu_get_be32s(f, &opp->glbc);
qemu_get_be32s(f, &opp->veni);
qemu_get_be32s(f, &opp->pint);
qemu_get_be3... | 16,790 |
qemu | d30107814c8d02f1896bd57249aef1b5aaed38c9 | 0 | uint64_t HELPER(abs_i64)(int64_t val)
{
HELPER_LOG("%s: val 0x%" PRIx64 "\n", __func__, val);
if (val < 0) {
return -val;
} else {
return val;
}
}
| 16,791 |
qemu | 4417ab7adf1613799054be5afedf810fc2524ee8 | 0 | void blk_resume_after_migration(Error **errp)
{
BlockBackend *blk;
Error *local_err = NULL;
for (blk = blk_all_next(NULL); blk; blk = blk_all_next(blk)) {
if (!blk->disable_perm) {
continue;
}
blk->disable_perm = false;
blk_set_perm(blk, blk->perm, ... | 16,793 |
qemu | 7df9381b7aa56c897e344f3bfe43bf5848bbd3e0 | 0 | static int vfio_pci_hot_reset(VFIOPCIDevice *vdev, bool single)
{
VFIOGroup *group;
struct vfio_pci_hot_reset_info *info;
struct vfio_pci_dependent_device *devices;
struct vfio_pci_hot_reset *reset;
int32_t *fds;
int ret, i, count;
bool multi = false;
trace_vfio_pci_hot_reset(... | 16,796 |
qemu | d251157ac1928191af851d199a9ff255d330bec9 | 0 | pvscsi_ring_pop_req_descr(PVSCSIRingInfo *mgr)
{
uint32_t ready_ptr = RS_GET_FIELD(mgr, reqProdIdx);
if (ready_ptr != mgr->consumed_ptr) {
uint32_t next_ready_ptr =
mgr->consumed_ptr++ & mgr->txr_len_mask;
uint32_t next_ready_page =
next_ready_ptr / PVSCSI_MAX_NU... | 16,797 |
qemu | 7423f417827146f956df820f172d0bf80a489495 | 0 | int nbd_receive_negotiate(QIOChannel *ioc, const char *name, uint32_t *flags,
QCryptoTLSCreds *tlscreds, const char *hostname,
QIOChannel **outioc,
off_t *size, Error **errp)
{
char buf[256];
uint64_t magic, s;
int rc;
... | 16,798 |
qemu | afa46c468acc18914c2773538f1b088c507766ee | 0 | SCSIRequest *scsi_req_new(SCSIDevice *d, uint32_t tag, uint32_t lun,
uint8_t *buf, void *hba_private)
{
SCSIRequest *req;
req = d->info->alloc_req(d, tag, lun, hba_private);
memcpy(req->cmd.buf, buf, 16);
return req;
}
| 16,799 |
qemu | 6a11d5183fb7564a3d32007b46846312fd61a1c5 | 0 | int qemu_read_password(char *buf, int buf_size)
{
uint8_t ch;
int i, ret;
printf("password: ");
fflush(stdout);
term_init();
i = 0;
for (;;) {
ret = read(0, &ch, 1);
if (ret == -1) {
if (errno == EAGAIN || errno == EINTR) {
continue;
... | 16,800 |
qemu | b39e3f34c9de7ead6a11a74aa2de78baf41d81a7 | 0 | static void qemu_account_warp_timer(void)
{
if (!use_icount || !icount_sleep) {
return;
}
/* Nothing to do if the VM is stopped: QEMU_CLOCK_VIRTUAL timers
* do not fire, so computing the deadline does not make sense.
*/
if (!runstate_is_running()) {
return;
}
... | 16,801 |
qemu | 167c50d8f94e0ffb880aa5cd2a232a3f32f0df1d | 0 | int host_to_target_signal(int sig)
{
if (sig >= _NSIG)
return sig;
return host_to_target_signal_table[sig];
}
| 16,802 |
qemu | 1c275925bfbbc2de84a8f0e09d1dd70bbefb6da3 | 0 | void process_pending_signals(CPUArchState *cpu_env)
{
CPUState *cpu = ENV_GET_CPU(cpu_env);
int sig;
abi_ulong handler;
sigset_t set, old_set;
target_sigset_t target_old_set;
struct emulated_sigtable *k;
struct target_sigaction *sa;
struct sigqueue *q;
TaskState *ts = cpu->... | 16,803 |
FFmpeg | 9f5769437aaab30a359cde254f39d9a28b1ce657 | 0 | static void handle_stream_probing(AVStream *st)
{
if (st->codec->codec_id == AV_CODEC_ID_PCM_S16LE) {
st->request_probe = AVPROBE_SCORE_EXTENSION;
st->probe_packets = FFMIN(st->probe_packets, 14);
}
}
| 16,805 |
FFmpeg | dccda293a0576d5414fafc0e95615c82a2f2399f | 0 | int avcodec_close(AVCodecContext *avctx)
{
/* If there is a user-supplied mutex locking routine, call it. */
if (ff_lockmgr_cb) {
if ((*ff_lockmgr_cb)(&codec_mutex, AV_LOCK_OBTAIN))
return -1;
}
entangled_thread_counter++;
if(entangled_thread_counter != 1){
av_... | 16,806 |
FFmpeg | 3eca1e6fad56f295fb1ef67cb70aff37ff4936a4 | 0 | static int a52_decode_frame(AVCodecContext *avctx,
void *data, int *data_size,
uint8_t *buf, int buf_size)
{
AC3DecodeState *s = avctx->priv_data;
uint8_t *buf_ptr;
int flags, i, len;
int sample_rate, bit_rate;
short *out_samples = data... | 16,807 |
FFmpeg | a26e1d4c1f7c93d24250dd9c0786241f92fcdea4 | 0 | static int get_packetheader(NUTContext *nut, ByteIOContext *bc, int calculate_checksum)
{
int64_t start, size;
start= url_ftell(bc) - 8;
init_checksum(bc, calculate_checksum ? update_adler32 : NULL, 0);
size= get_v(bc);
nut->packet_start[2] = start;
nut->written_packet_size= size;
... | 16,809 |
FFmpeg | c89658008705d949c319df3fa6f400c481ad73e1 | 0 | static void rtsp_close_streams(RTSPState *rt)
{
int i;
RTSPStream *rtsp_st;
for(i=0;i<rt->nb_rtsp_streams;i++) {
rtsp_st = rt->rtsp_streams[i];
if (rtsp_st) {
if (rtsp_st->transport_priv) {
if (rt->transport == RTSP_TRANSPORT_RDT)
ff... | 16,810 |
qemu | 9d4c0f4f0a71e74fd7e04d73620268484d693adf | 0 | static uint32_t drc_isolate_logical(sPAPRDRConnector *drc)
{
/* if the guest is configuring a device attached to this DRC, we
* should reset the configuration state at this point since it may
* no longer be reliable (guest released device and needs to start
* over, or unplug occurred so the FDT ... | 16,811 |
FFmpeg | a2816230c5c0a8fc72bc0163b7d21a96b194d87a | 0 | static void compat_free_buffer(void *opaque, uint8_t *data)
{
CompatReleaseBufPriv *priv = opaque;
priv->avctx.release_buffer(&priv->avctx, &priv->frame);
av_freep(&priv);
}
| 16,813 |
qemu | 37546ff28fb89744ebf2223db22cbc253592abe1 | 0 | static int aio_write_f(BlockBackend *blk, int argc, char **argv)
{
int nr_iov, c;
int pattern = 0xcd;
struct aio_ctx *ctx = g_new0(struct aio_ctx, 1);
int flags = 0;
ctx->blk = blk;
while ((c = getopt(argc, argv, "CfqP:uz")) != -1) {
switch (c) {
case 'C':
... | 16,814 |
qemu | 7ad4c7200111d20eb97eed4f46b6026e3f0b0eef | 0 | void *g_malloc_n(size_t nmemb, size_t size)
{
size_t sz;
void *ptr;
__coverity_negative_sink__(nmemb);
__coverity_negative_sink__(size);
sz = nmemb * size;
ptr = __coverity_alloc__(size);
__coverity_mark_as_uninitialized_buffer__(ptr);
__coverity_mark_as_afm_allocated__(ptr, A... | 16,815 |
qemu | 056fca7b51d949aa0e18e0eb647838874a53bcbe | 0 | int i2c_recv(I2CBus *bus)
{
I2CSlaveClass *sc;
if ((QLIST_EMPTY(&bus->current_devs)) || (bus->broadcast)) {
return -1;
}
sc = I2C_SLAVE_GET_CLASS(QLIST_FIRST(&bus->current_devs)->elt);
if (sc->recv) {
return sc->recv(QLIST_FIRST(&bus->current_devs)->elt);
}
retu... | 16,818 |
qemu | 1ddcae82a2509668b94a13e84921bdcafddcdfff | 0 | static int spapr_vga_init(PCIBus *pci_bus)
{
switch (vga_interface_type) {
case VGA_STD:
pci_std_vga_init(pci_bus);
return 1;
case VGA_NONE:
return 0;
default:
fprintf(stderr, "This vga model is not supported,"
"currently it only supports -vga st... | 16,819 |
qemu | 4e59b545868a5ee5f59b346337f0c44209929334 | 0 | void async_context_pop(void)
{
}
| 16,820 |
qemu | c2e50e3d11a0bf4c973cc30478c1af0f2d5f8e81 | 0 | static void thread_pool_init_one(ThreadPool *pool, AioContext *ctx)
{
if (!ctx) {
ctx = qemu_get_aio_context();
}
memset(pool, 0, sizeof(*pool));
event_notifier_init(&pool->notifier, false);
pool->ctx = ctx;
qemu_mutex_init(&pool->lock);
qemu_cond_init(&pool->check_cancel)... | 16,822 |
qemu | a7812ae412311d7d47f8aa85656faadac9d64b56 | 0 | static always_inline void gen_cmov (TCGCond inv_cond,
int ra, int rb, int rc,
int islit, uint8_t lit, int mask)
{
int l1;
if (unlikely(rc == 31))
return;
l1 = gen_new_label();
if (ra != 31) {
if (mask)... | 16,823 |
FFmpeg | f20b67173ca6a05b8c3dee02dad3b7243b96292b | 0 | static int process_tns_coeffs(TemporalNoiseShaping *tns, float *tns_coefs_raw,
int order, int w, int filt)
{
int i, j;
int *idx = tns->coef_idx[w][filt];
float *lpc = tns->coef[w][filt];
const int iqfac_p = ((1 << (MAX_LPC_PRECISION-1)) - 0.5)/(M_PI/2.0);
const i... | 16,824 |
FFmpeg | 0058584580b87feb47898e60e4b80c7f425882ad | 0 | static inline void downmix_3f_to_stereo(float *samples)
{
int i;
for (i = 0; i < 256; i++) {
samples[i] += samples[i + 256];
samples[i + 256] = samples[i + 512];
samples[i + 512] = 0;
}
}
| 16,825 |
qemu | a22313deca720e038ebc5805cf451b3a685d29ce | 0 | static int vfio_set_resample_eventfd(VFIOINTp *intp)
{
VFIODevice *vbasedev = &intp->vdev->vbasedev;
struct vfio_irq_set *irq_set;
int argsz, ret;
int32_t *pfd;
argsz = sizeof(*irq_set) + sizeof(*pfd);
irq_set = g_malloc0(argsz);
irq_set->argsz = argsz;
irq_set->flags = VFIO_I... | 16,826 |
qemu | dfd100f242370886bb6732f70f1f7cbd8eb9fedc | 0 | static void test_io_channel_unix_fd_pass(void)
{
SocketAddress *listen_addr = g_new0(SocketAddress, 1);
SocketAddress *connect_addr = g_new0(SocketAddress, 1);
QIOChannel *src, *dst;
int testfd;
int fdsend[3];
int *fdrecv = NULL;
size_t nfdrecv = 0;
size_t i;
char bufsend[1... | 16,827 |
qemu | fc32a72dc19a79f7e16156784b1e76a128d41841 | 0 | static int raw_open_common(BlockDriverState *bs, const char *filename,
int bdrv_flags, int open_flags)
{
BDRVRawState *s = bs->opaque;
int fd, ret;
ret = raw_normalize_devicepath(&filename);
if (ret != 0) {
return ret;
}
s->open_flags = open_flags ... | 16,828 |
qemu | 494a8ebe713055d3946183f4b395f85a18b43e9e | 0 | static int proxy_close(FsContext *ctx, V9fsFidOpenState *fs)
{
return close(fs->fd);
}
| 16,830 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.