Projectname large_stringclasses 15
values | Filepath large_stringlengths 4 106 ⌀ | Function large_stringlengths 11 3.45k | Label list |
|---|---|---|---|
qemu | linux-user/syscall.c | static abi_long do_socket(int domain, int type, int protocol)
{
int target_type = type;
int ret;
ret = target_to_host_sock_type(&type);
if (ret) {
return ret;
}
if (domain == PF_NETLINK)
return -TARGET_EAFNOSUPPORT;
if (domain == AF_PACKET ||
(domain == AF_INET && type == SOCK_PACK... | [
0,
0
] |
qemu | migration.c | void process_incoming_migration(QEMUFile *f)
{
if (qemu_loadvm_state(f) < 0) {
fprintf(stderr, "load of migration failed\n");
exit(0);
}
qemu_announce_self();
DPRINTF("successfully loaded vm state\n");
incoming_expected = false;
if (autostart) {
vm_start();
} else {
runstate_set... | [
0,
0
] |
qemu | target/s390x/cpu.c | bool s390_cpu_exec_interrupt(CPUState *cs, int interrupt_request)
{
if (interrupt_request & CPU_INTERRUPT_HARD) {
S390CPU *cpu = S390_CPU(cs);
CPUS390XState *env = &cpu->env;
if (env->ex_value) {
/* Execution of the target insn is indivisible from
the parent EXECUTE insn. */
... | [
0,
0
] |
qemu | HACKING | ioapic_mem_read(void *opaque, target_phys_addr_t addr, unsigned int size)
{
IOAPICCommonState *s = opaque;
int index;
uint32_t val = 0;
switch (addr & 0xff) {
case IOAPIC_IOREGSEL:
val = s->ioregsel;
break;
case IOAPIC_IOWIN:
if (size != 4) {
break;
}
switch (s->ioregse... | [
1,
0
] |
qemu | target/s390x/internal.h | static void sigp_stop_and_store_status(CPUState *cs, run_on_cpu_data arg)
{
S390CPU *cpu = S390_CPU(cs);
SigpInfo *si = arg.host_ptr;
struct kvm_s390_irq irq = {
.type = KVM_S390_SIGP_STOP,
};
/* disabled wait - sleeping in user space */
if (s390_cpu_get_state(cpu) == CPU_STATE_OPERATING && cs... | [
1,
0
] |
qemu | hw/display/xenfb.c | static int xen_remove_from_physmap(XenIOState *state,
hwaddr start_addr,
ram_addr_t size)
{
unsigned long i = 0;
int rc = 0;
XenPhysmap *physmap = NULL;
hwaddr phys_offset = 0;
physmap = get_physmapping(state, start_addr, size);
... | [
1,
0
] |
qemu | json-lexer.c | int json_lexer_flush(JSONLexer *lexer)
{
return lexer->state == IN_START ? 0 : json_lexer_feed_char(lexer, 0);
} | [
0,
0
] |
qemu | target-sparc/fop_helper.c | float64 helper_fxtod(CPUSPARCState *env, int64_t src)
{
float64 ret;
clear_float_exceptions(env);
ret = int64_to_float64(src, &env->fp_status);
check_ieee_exceptions(env);
return ret;
} | [
0,
0
] |
qemu | tests/test-qmp-input-strict.c | static void test_visitor_out_list(TestOutputVisitorData *data,
const void *unused)
{
const char *value_str = "list value";
TestStructList *p, *head = NULL;
const int max_items = 10;
bool value_bool = true;
int value_int = 10;
Error *err = NULL;
QListEntry *entry;... | [
1,
0
] |
qemu | acl.c | static int foreach_device_config(int type, int (*func)(const char *cmdline))
{
struct device_config *conf;
int rc;
TAILQ_FOREACH(conf, &device_configs, next) {
if (conf->type != type)
continue;
rc = func(conf->cmdline);
if (0 != rc)
return rc;
}
return 0;
} | [
0,
0
] |
qemu | block.c | int qdev_prop_set_drive(DeviceState *dev, const char *name,
BlockDriverState *value)
{
int res;
res = bdrv_attach(value, dev);
if (res < 0) {
error_report("Can't attach drive %s to %s.%s: %s",
bdrv_get_device_name(value),
dev->id ? dev->id : dev... | [
1,
0
] |
qemu | hw/acpi.c | static void pm_update_sci(PIIX4PMState *s)
{
int sci_level, pmsts;
int64_t expire_time;
pmsts = get_pmsts(s);
sci_level = (((pmsts & s->pmen) &
(RTC_EN | PWRBTN_EN | GBL_EN | TMROF_EN)) != 0);
qemu_set_irq(s->irq, sci_level);
/* schedule a timer interruption if needed */
if ((s->p... | [
1,
0
] |
qemu | hw/9pfs/Makefile.objs | static int v9fs_synth_renameat(FsContext *ctx, V9fsPath *olddir,
const char *old_name, V9fsPath *newdir,
const char *new_name)
{
errno = EPERM;
return -1;
} | [
0,
0
] |
qemu | kvm-all.c | static void qemu_signal_lock(unsigned int msecs)
{
qemu_mutex_lock(&qemu_fair_mutex);
while (qemu_mutex_trylock(&qemu_global_mutex)) {
qemu_thread_signal(tcg_cpu_thread, SIGUSR1);
if (!qemu_mutex_timedlock(&qemu_global_mutex, msecs))
break;
}
qemu_mutex_unlock(&qemu_fair_mutex);
} | [
0,
0
] |
qemu | net/dump.c | int net_init_slirp(const NetClientOptions *opts, const char *name,
NetClientState *peer, Error **errp)
{
/* FIXME error_setg(errp, ...) on failure */
struct slirp_config_str *config;
char *vnet;
int ret;
const NetdevUserOptions *user;
const char **dnssearch;
assert(opts->kind =... | [
1,
1
] |
qemu | block.c | void bdrv_detach(BlockDriverState *bs, DeviceState *qdev)
{
assert(bs->peer == qdev);
bs->peer = NULL;
bs->change_cb = NULL;
bs->change_opaque = NULL;
} | [
0,
0
] |
qemu | block/snapshot.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... | [
0,
0
] |
qemu | hw/arm/musicpal.c | static void g364fb_init(DeviceState *dev, G364State *s)
{
s->vram = g_malloc0(s->vram_size);
s->con = graphic_console_init(g364fb_update_display,
g364fb_invalidate_display,
g364fb_screen_dump, NULL, s);
memory_region_init_io(&s->mem_ctrl, &g364... | [
0,
0
] |
qemu | block/nbd.c | static SocketAddress *sd_socket_address(const char *path,
const char *host, const char *port)
{
SocketAddress *addr = g_new0(SocketAddress, 1);
if (path) {
addr->type = SOCKET_ADDRESS_KIND_UNIX;
addr->u.q_unix.data = g_new0(UnixSocketAddress, 1);
addr->u.q_... | [
0,
0
] |
qemu | vl.c | static void configure_alarms(char const *opt)
{
int i;
int cur = 0;
int count = (sizeof(alarm_timers) / sizeof(*alarm_timers)) - 1;
char *arg;
char *name;
if (!strcmp(opt, "help")) {
show_available_alarms();
exit(0);
}
arg = strdup(opt);
/* Reorder the array */
name = strtok(arg,... | [
1,
0
] |
qemu | hw/ipmi/ipmi_bmc_sim.c | static void rtas_ibm_get_system_parameter(PowerPCCPU *cpu,
sPAPRMachineState *spapr,
uint32_t token, uint32_t nargs,
target_ulong args,
uint32_t nre... | [
1,
0
] |
qemu | block/dirty-bitmap.c | void bdrv_set_dirty_bitmap(BdrvDirtyBitmap *bitmap,
int64_t cur_sector, int64_t nr_sectors)
{
assert(bdrv_dirty_bitmap_enabled(bitmap));
hbitmap_set(bitmap->bitmap, cur_sector, nr_sectors);
} | [
0,
0
] |
qemu | include/sysemu/kvm.h | int kvm_has_xsave(void)
{
return kvm_state->xsave;
} | [
0,
0
] |
qemu | target/s390x/excp_helper.c | static int translate_pages(S390CPU *cpu, vaddr addr, int nr_pages,
target_ulong *pages, bool is_write)
{
bool lowprot = is_write && lowprot_enabled(&cpu->env);
uint64_t asc = cpu->env.psw.mask & PSW_MASK_ASC;
CPUS390XState *env = &cpu->env;
int ret, i, pflags;
for (i = 0; i <... | [
1,
0
] |
qemu | hw/xen/xen_pt_config_init.c | static int xen_pt_msixctrl_reg_init(XenPCIPassthroughState *s,
XenPTRegInfo *reg, uint32_t real_offset,
uint32_t *data)
{
PCIDevice *d = &s->dev;
uint16_t reg_field = 0;
/* use I/O device register's value as initial value */
reg_fiel... | [
0,
0
] |
qemu | block/block-backend.c | static bool cmd_read_dma(IDEState *s, uint8_t cmd)
{
bool lba48 = (cmd == WIN_READDMA_EXT);
if (!s->bs) {
ide_abort_command(s);
return true;
}
ide_cmd_lba48_transform(s, lba48);
ide_sector_start_dma(s, IDE_DMA_READ);
return false;
} | [
0,
0
] |
qemu | buffered_file.c | static void timer_start(SpiceTimer *timer, uint32_t ms)
{
qemu_mod_timer(timer->timer, qemu_get_clock(rt_clock) + ms);
} | [
0,
0
] |
qemu | target-mips/cpu.h | void cpu_reset(CPUMIPSState *env)
{
memset(env, 0, offsetof(CPUMIPSState, breakpoints));
tlb_flush(env, 1);
/* Minimal init */
#if !defined(CONFIG_USER_ONLY)
if (env->hflags & MIPS_HFLAG_BMASK) {
/* If the exception was raised from a delay slot,
* come back to the jump. */
env->CP0_ErrorE... | [
1,
1
] |
qemu | target-arm/helpers.h | static void gen_neon_unzip_u8(TCGv t0, TCGv t1)
{
TCGv rd, rm, tmp;
rd = new_tmp();
rm = new_tmp();
tmp = new_tmp();
tcg_gen_andi_i32(rd, t0, 0xff);
tcg_gen_shri_i32(tmp, t0, 8);
tcg_gen_andi_i32(tmp, tmp, 0xff00);
tcg_gen_or_i32(rd, rd, tmp);
tcg_gen_shli_i32(tmp, t1, 16);
tcg_gen_andi_i... | [
0,
0
] |
qemu | target/ppc/fpu_helper.c | void helper_xssqrtqp(CPUPPCState *env, uint32_t opcode)
{
ppc_vsr_t xb;
ppc_vsr_t xt;
float_status tstat;
getVSR(rB(opcode) + 32, &xb, env);
memset(&xt, 0, sizeof(xt));
helper_reset_fpstatus(env);
if (unlikely(Rc(opcode) != 0)) {
/* TODO: Support xsadddpo after round-to-odd is implemented */
... | [
1,
1
] |
qemu | fpu/softfloat-specialize.h | int float64_eq_signaling(float64 a, float64 b STATUS_PARAM)
{
if (((extractFloat64Exp(a) == 0x7FF) && extractFloat64Frac(a))
|| ((extractFloat64Exp(b) == 0x7FF) && extractFloat64Frac(b))
) {
float_raise(float_flag_invalid STATUS_VAR);
return 0;
}
return (a == b) || ((bits64)((a | b) << 1) =... | [
0,
0
] |
qemu | Makefile.objs | static int is_dup_page(uint8_t *page, uint8_t ch)
{
uint32_t val = ch << 24 | ch << 16 | ch << 8 | ch;
uint32_t *array = (uint32_t *)page;
int i;
for (i = 0; i < (TARGET_PAGE_SIZE / 4); i++) {
if (array[i] != val)
return 0;
}
return 1;
} | [
1,
0
] |
FFmpeg | ffmpeg_qsv.c | int qsv_init(AVCodecContext *s)
{
InputStream *ist = s->opaque;
QSVContext *qsv = ist->hwaccel_ctx;
AVQSVContext *hwctx_dec;
int ret;
if (!qsv) {
av_log(NULL, AV_LOG_ERROR,
"QSV transcoding is not initialized. "
"-hwaccel qsv should only be used for one-to-one QSV transcoding... | [
0,
0
] |
qemu | HACKING | int cpu_memory_rw_debug(CPUArchState *env, target_ulong addr,
uint8_t *buf, int len, int is_write)
{
int l;
target_phys_addr_t phys_addr;
target_ulong page;
while (len > 0) {
page = addr & TARGET_PAGE_MASK;
phys_addr = cpu_get_phys_page_debug(env, page);
/* if no phy... | [
0,
0
] |
qemu | hw/s390x/css.c | void css_generate_css_crws(uint8_t cssid)
{
if (!channel_subsys.sei_pending) {
css_queue_crw(CRW_RSC_CSS, CRW_ERC_EVENT, 0, cssid);
}
channel_subsys.sei_pending = true;
} | [
0,
0
] |
qemu | hw/intc/arm_gic.c | static void armv7m_nvic_reset(DeviceState *dev)
{
nvic_state *s = NVIC(dev);
NVICClass *nc = NVIC_GET_CLASS(s);
nc->parent_reset(dev);
/* Common GIC reset resets to disabled; the NVIC doesn't have
* per-CPU interfaces so mark our non-existent CPU interface
* as enabled by default, and with a priori... | [
1,
0
] |
qemu | hw/s390x/sclp.c | static void read_storage_element0_info(SCLPDevice *sclp, SCCB *sccb)
{
int i, assigned;
int subincrement_id = SCLP_STARTING_SUBINCREMENT_ID;
ReadStorageElementInfo *storage_info = (ReadStorageElementInfo *)sccb;
sclpMemoryHotplugDev *mhd = get_sclp_memory_hotplug_dev();
assert(mhd);
if ((ram_size >> ... | [
1,
0
] |
qemu | cpu-exec.c | static inline void t_gen_sext(TCGv d, TCGv s, int size)
{
if (size == 1)
tcg_gen_ext8s_i32(d, s);
else if (size == 2)
tcg_gen_ext16s_i32(d, s);
else if (GET_TCGV(d) != GET_TCGV(s))
tcg_gen_mov_tl(d, s);
} | [
0,
0
] |
qemu | tests/libqos/libqos.c | void mkimg(const char *file, const char *fmt, unsigned size_mb)
{
gchar *cli;
bool ret;
int rc;
GError *err = NULL;
char *qemu_img_path;
gchar *out, *out2;
char *abs_path;
qemu_img_path = getenv("QTEST_QEMU_IMG");
abs_path = realpath(qemu_img_path, NULL);
assert(qemu_img_path);
cli = g... | [
1,
0
] |
qemu | block/nbd.c | static void blockdev_backup_prepare(BlkTransactionState *common, Error **errp)
{
BlockdevBackupState *state = DO_UPCAST(BlockdevBackupState, common, common);
BlockdevBackup *backup;
BlockBackend *blk, *target;
Error *local_err = NULL;
assert(common->action->kind == TRANSACTION_ACTION_KIND_BLOCKDEV_BACKU... | [
1,
0
] |
qemu | hw/bt/core.c | static void bt_hid_interrupt_sdu(void *opaque, const uint8_t *data, int len)
{
struct bt_hid_device_s *hid = opaque;
if (len > BT_HID_MTU || len < 1)
goto bad;
if ((data[0] & 3) != BT_DATA_OUTPUT)
goto bad;
if ((data[0] >> 4) == BT_DATA) {
if (hid->intr_state)
goto bad;
hid->data... | [
1,
0
] |
qemu | hw/i386/pc.c | static void port92_write(void *opaque, hwaddr addr, uint64_t val,
unsigned size)
{
Port92State *s = opaque;
int oldval = s->outport;
DPRINTF("port92: write 0x%02" PRIx64 "\n", val);
s->outport = val;
qemu_set_irq(*s->a20_out, (val >> 1) & 1);
if ((val & 1) && !(oldval & 1)) ... | [
0,
0
] |
FFmpeg | libavcodec/a64multienc.c | static av_cold int raw_encode_close(AVCodecContext *avctx)
{
av_frame_free(&avctx->coded_frame);
return 0;
} | [
0,
0
] |
qemu | hw/vfio/common.c | static bool vfio_prereg_listener_skipped_section(MemoryRegionSection *section)
{
if (memory_region_is_iommu(section->mr)) {
hw_error("Cannot possibly preregister IOMMU memory");
}
return !memory_region_is_ram(section->mr) ||
memory_region_is_skip_dump(section->mr);
} | [
0,
0
] |
qemu | hw/net/net_rx_pkt.c | void net_rx_pkt_attach_data(struct NetRxPkt *pkt, const void *data,
size_t len, bool strip_vlan)
{
uint16_t tci = 0;
uint16_t ploff;
assert(pkt);
pkt->vlan_stripped = false;
if (strip_vlan) {
pkt->vlan_stripped = eth_strip_vlan(data, pkt->ehdr_buf, &ploff, &tci);
}
... | [
1,
0
] |
qemu | docs/qmp-commands.txt | void qmp_migrate_set_downtime(double value, Error **errp)
{
value *= 1e9;
value = MAX(0, MIN(UINT64_MAX, value));
max_downtime = (uint64_t)value;
} | [
0,
0
] |
qemu | target-alpha/translate.c | static inline void gen_outs(DisasContext *s, TCGMemOp ot)
{
if (use_icount)
gen_io_start();
gen_string_movl_A0_ESI(s);
gen_op_ld_v(s, ot, cpu_T[0], cpu_A0);
tcg_gen_trunc_tl_i32(cpu_tmp2_i32, cpu_regs[R_EDX]);
tcg_gen_andi_i32(cpu_tmp2_i32, cpu_tmp2_i32, 0xffff);
tcg_gen_trunc_tl_i32(cpu_tmp3_i3... | [
0,
0
] |
qemu | blockdev.c | static void drive_backup_prepare(BlkActionState *common, Error **errp)
{
DriveBackupState *state = DO_UPCAST(DriveBackupState, common, common);
BlockBackend *blk;
DriveBackup *backup;
Error *local_err = NULL;
assert(common->action->type == TRANSACTION_ACTION_KIND_DRIVE_BACKUP);
backup = common->actio... | [
1,
0
] |
qemu | block/dirty-bitmap.c | uint64_t bdrv_dirty_bitmap_serialization_align(const BdrvDirtyBitmap *bitmap)
{
return hbitmap_serialization_align(bitmap->bitmap);
} | [
0,
0
] |
qemu | hw/core/qdev-properties-system.c | static void parse_drive(DeviceState *dev, const char *str, void **ptr,
const char *propname, Error **errp)
{
BlockBackend *blk;
blk = blk_by_name(str);
if (!blk) {
error_setg(errp, "Property '%s.%s' can't find value '%s'",
object_get_typename(OBJECT(dev)), propnam... | [
0,
0
] |
qemu | hw/i386/acpi-build.c | static void build_append_notify_target(GArray *method, GArray *target_name,
uint32_t value, int size)
{
GArray *notify = build_alloc_array();
uint8_t op = 0xA0; /* IfOp */
build_append_byte(notify, 0x93); /* LEqualOp */
build_append_byte(notify, 0x68); /* Arg0Op */
... | [
1,
0
] |
FFmpeg | ffmpeg.c | long check_dcbzl_effect(void)
{
register char *fakedata = (char *)av_malloc(1024);
register char *fakedata_middle;
register long zero = 0;
register long i = 0;
long count = 0;
if (!fakedata)
{
return 0L;
}
fakedata_middle = (fakedata + 512);
memset(fakedata, 0xFF, 1024);
/* below t... | [
1,
0
] |
qemu | exec.c | static int subpage_register(subpage_t *mmio, uint32_t start, uint32_t end,
ram_addr_t memory, ram_addr_t region_offset)
{
int idx, eidx;
if (start >= TARGET_PAGE_SIZE || end >= TARGET_PAGE_SIZE)
return -1;
idx = SUBPAGE_IDX(start);
eidx = SUBPAGE_IDX(end);
#if defined(DEB... | [
1,
0
] |
FFmpeg | libavcodec/eamad.c | static inline void comp_block(MadContext *t, int mb_x, int mb_y,
int j, int mv_x, int mv_y, int add)
{
MpegEncContext *s = &t->s;
if (j < 4) {
comp(t->frame.data[0] +
(mb_y * 16 + ((j & 2) << 2)) * t->frame.linesize[0] + mb_x * 16 +
((j & 1) << 3),
... | [
1,
0
] |
qemu | hw/twl92230.c | static void tm_put(QEMUFile *f, struct tm *tm) {
qemu_put_be16(f, tm->tm_sec);
qemu_put_be16(f, tm->tm_min);
qemu_put_be16(f, tm->tm_hour);
qemu_put_be16(f, tm->tm_mday);
qemu_put_be16(f, tm->tm_min);
qemu_put_be16(f, tm->tm_year);
} | [
0,
0
] |
qemu | kvm-all.c | static int kvm_handle_internal_error(CPUState *env, struct kvm_run *run)
{
fprintf(stderr, "KVM internal error.");
if (kvm_check_extension(kvm_state, KVM_CAP_INTERNAL_ERROR_DATA)) {
int i;
fprintf(stderr, " Suberror: %d\n", run->internal.suberror);
for (i = 0; i < run->internal.ndata; ++i) {
... | [
0,
1
] |
qemu | Makefile.objs | static void network_to_result(RDMARegisterResult *result)
{
result->rkey = ntohl(result->rkey);
result->host_addr = ntohll(result->host_addr);
}; | [
1,
0
] |
FFmpeg | libavcodec/vdpau.c | int ff_vdpau_common_end_frame(AVCodecContext *avctx, AVFrame *frame,
struct vdpau_picture_context *pic_ctx)
{
VDPAUContext *vdctx = avctx->internal->hwaccel_priv_data;
AVVDPAUContext *hwctx = avctx->hwaccel_context;
VdpVideoSurface surf = ff_vdpau_get_surface_id(frame);
VdpSt... | [
1,
0
] |
FFmpeg | libavcodec/h264.c | static void unref_picture(H264Context *h, Picture *pic)
{
int off = offsetof(Picture, tf) + sizeof(pic->tf);
int i;
if (!pic->f.data[0])
return;
ff_thread_release_buffer(h->avctx, &pic->tf);
av_buffer_unref(&pic->hwaccel_priv_buf);
av_buffer_unref(&pic->qscale_table_buf);
av_buffer_unref(&pic... | [
1,
0
] |
qemu | hw/usb/hcd-xhci.c | static void xhci_runtime_write(void *ptr, hwaddr reg,
uint64_t val, unsigned size)
{
XHCIState *xhci = ptr;
int v = (reg - 0x20) / 0x20;
XHCIInterrupter *intr = &xhci->intr[v];
trace_usb_xhci_runtime_write(reg, val);
if (reg < 0x20) {
trace_usb_xhci_unimplemented("ru... | [
1,
1
] |
qemu | tests/hd-geo-test.c | static void test_ide_none(void)
{
char *argv[256];
setup_common(argv, ARRAY_SIZE(argv));
qtest_start(g_strjoinv(" ", argv));
test_cmos();
qtest_end();
} | [
1,
0
] |
qemu | cpus.c | void cpu_disable_ticks(void)
{
/* Here, the really thing protected by seqlock is cpu_clock_offset. */
seqlock_write_lock(&timers_state.vm_clock_seqlock);
if (timers_state.cpu_ticks_enabled) {
timers_state.cpu_ticks_offset = cpu_get_ticks();
timers_state.cpu_clock_offset = cpu_get_clock_locked();
... | [
1,
0
] |
FFmpeg | postproc/rgb2rgb.c | static inline void RENAME(yv12toyuy2)(const uint8_t *ysrc, const uint8_t *usrc,
const uint8_t *vsrc, uint8_t *dst,
unsigned int width, unsigned int height,
int lumStride, int chromStride,
... | [
1,
1
] |
qemu | include/monitor/monitor.h | static QDict *qmp_check_input_obj(QObject *input_obj)
{
const QDictEntry *ent;
int has_exec_key = 0;
QDict *input_dict;
if (qobject_type(input_obj) != QTYPE_QDICT) {
qerror_report(QERR_QMP_BAD_INPUT_OBJECT, "object");
return NULL;
}
input_dict = qobject_to_qdict(input_obj);
for (ent = qdi... | [
1,
1
] |
FFmpeg | libavcodec/dsputil.c | static void add_pixels_clamped4_c(const DCTELEM *block,
uint8_t *restrict pixels,
int line_size)
{
int i;
uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;
/* read the pixels */
for (i = 0; i < 4; i++) {
pixels[0] = cm[pixels[0] + block[0]];
... | [
1,
0
] |
qemu | include/qemu/throttle.h | static void test_enabled(void)
{
int i;
throttle_config_init(&cfg);
g_assert(!throttle_enabled(&cfg));
for (i = 0; i < BUCKETS_COUNT; i++) {
throttle_config_init(&cfg);
set_cfg_value(false, i, 150);
g_assert(throttle_enabled(&cfg));
}
for (i = 0; i < BUCKETS_COUNT; i++) {
throttle_... | [
1,
0
] |
qemu | target-i386/kvm.c | int kvm_arch_process_async_events(CPUState *env) {
if (kvm_irqchip_in_kernel()) {
if (env->interrupt_request & (CPU_INTERRUPT_HARD | CPU_INTERRUPT_NMI)) {
if (env->interrupt_request & CPU_INTERRUPT_INIT) {
do_cpu_init(env);
if (env->interrupt_request & CPU_INTERRUPT_SIPI) {
do_cpu_... | [
1,
0
] |
qemu | target-arm/translate.c | static void shifter_out_im(TCGv var, int shift)
{
TCGv tmp = new_tmp();
if (shift == 0) {
tcg_gen_andi_i32(tmp, var, 1);
} else {
tcg_gen_shri_i32(tmp, var, shift);
if (shift != 31)
tcg_gen_andi_i32(tmp, tmp, 1);
}
gen_set_CF(tmp);
dead_tmp(tmp);
} | [
1,
0
] |
qemu | hw/net/vmxnet3.c | static void vmxnet3_deactivate_device(VMXNET3State *s)
{
VMW_CBPRN("Deactivating vmxnet3...");
s->device_active = false;
} | [
1,
0
] |
qemu | hw/net/e1000e_core.c | e1000e_set_pbaclr(E1000ECore *core, int index, uint32_t val)
{
int i;
core->mac[PBACLR] = val & E1000_PBACLR_VALID_MASK;
if (msix_enabled(core->owner)) {
return;
}
for (i = 0; i < E1000E_MSIX_VEC_NUM; i++) {
if (core->mac[PBACLR] & BIT(i)) {
msix_clr_pending(core->owner, i);
}
}
} | [
1,
0
] |
FFmpeg | libavformat/4xm.c | static int film_probe(AVProbeData *p)
{
if (p->buf_size < 4)
return 0;
if (AV_RB32(&p->buf[0]) != FILM_TAG)
return 0;
return AVPROBE_SCORE_MAX;
} | [
0,
0
] |
FFmpeg | libavcodec/Makefile | av_cold int ff_rdft_init(RDFTContext *s, int nbits, enum RDFTransformType trans)
{
int n = 1 << nbits;
int ret;
s->nbits = nbits;
s->inverse = trans == IDFT_C2R || trans == DFT_C2R;
s->sign_convention = trans == IDFT_R2C || trans == DFT_C2R ? 1 : -1;
if (nbits < 4 || nbits > 16)
return AVERROR(E... | [
1,
0
] |
qemu | vnc.c | int vnc_client_io_error(VncState *vs, int ret, int last_errno)
{
if (ret == 0 || ret == -1) {
if (ret == -1) {
switch (last_errno) {
case EINTR:
case EAGAIN:
#ifdef _WIN32
case WSAEWOULDBLOCK:
#endif
return 0;
default:
break;
}
}
VNC_DEBUG("... | [
1,
0
] |
FFmpeg | libavcodec/truemotion2.c | static inline int GET_TOK(TM2Context *ctx, int type) {
if (ctx->tok_ptrs[type] >= ctx->tok_lens[type]) {
av_log(ctx->avctx, AV_LOG_ERROR,
"Read token from stream %i out of bounds (%i>=%i)\n", type,
ctx->tok_ptrs[type], ctx->tok_lens[type]);
return 0;
}
if (type <= TM2_MOT)
r... | [
1,
0
] |
qemu | block/nbd-client.c | int nbd_client_co_pdiscard(BlockDriverState *bs, int64_t offset, int bytes)
{
NBDClientSession *client = nbd_get_client_session(bs);
NBDRequest request = {
.type = NBD_CMD_TRIM,
.from = offset,
.len = bytes,
};
if (!(client->info.flags & NBD_FLAG_SEND_TRIM)) {
return 0;
}
ret... | [
1,
0
] |
qemu | hw/rtl8139.c | static int rtl8139_can_receive(VLANClientState *nc)
{
RTL8139State *s = DO_UPCAST(NICState, nc, nc)->opaque;
int avail;
/* Receive (drop) packets if card is disabled. */
if (!s->clock_enabled)
return 1;
if (!rtl8139_receiver_enabled(s))
return 1;
if (rtl8139_cp_receiver_enabled(s)) {
... | [
1,
1
] |
qemu | Makefile.objs | unsigned int qemu_get_be16(QEMUFile *f)
{
unsigned int v;
v = qemu_get_byte(f) << 8;
v |= qemu_get_byte(f);
return v;
} | [
1,
0
] |
FFmpeg | libavformat/avformat.h | static int index_search_timestamp(AVIndexEntry *entries,
int nb_entries, int wanted_timestamp)
{
int a, b, m;
int64_t timestamp;
if (nb_entries <= 0)
return -1;
a = 0;
b = nb_entries - 1;
while (a <= b) {
m = (a + b) >> 1;
timestamp = entries[m].times... | [
0,
0
] |
qemu | hw/vfio/pci.c | static void vfio_add_kvm_msi_virq(VFIOMSIVector *vector, MSIMessage *msg,
bool msix)
{
int virq;
if ((msix && !VFIO_ALLOW_KVM_MSIX) ||
(!msix && !VFIO_ALLOW_KVM_MSI) || !msg) {
return;
}
if (event_notifier_init(&vector->kvm_interrupt, 0)) {
return;
}
... | [
1,
0
] |
qemu | hw/ide/core.c | static void ide_trim_bh_cb(void *opaque)
{
TrimAIOCB *iocb = opaque;
iocb->common.cb(iocb->common.opaque, iocb->ret);
qemu_bh_delete(iocb->bh);
iocb->bh = NULL;
qemu_aio_unref(iocb);
} | [
0,
0
] |
qemu | audio/alsaaudio.c | static int fmod_init_out(HWVoiceOut *hw, audsettings_t *as)
{
int bits16, mode, channel;
FMODVoiceOut *fmd = (FMODVoiceOut *)hw;
audsettings_t obt_as = *as;
mode = aud_to_fmodfmt(as->fmt, as->nchannels == 2 ? 1 : 0);
fmd->fmod_sample = FSOUND_Sample_Alloc(
FSOUND_FREE, /* index */
conf.nb_... | [
1,
0
] |
qemu | block/block-backend.c | void blk_dev_change_media_cb(BlockBackend *blk, bool load)
{
if (blk->dev_ops && blk->dev_ops->change_media_cb) {
bool tray_was_closed = !blk_dev_is_tray_open(blk);
blk->dev_ops->change_media_cb(blk->dev_opaque, load);
if (tray_was_closed) {
/* tray open */
qapi_event_send_device_tray_m... | [
1,
0
] |
qemu | target-ppc/translate.c | static inline void gen_evmergelohi(DisasContext *ctx)
{
if (unlikely(!ctx->spe_enabled)) {
gen_exception(ctx, POWERPC_EXCP_APU);
return;
}
#if defined(TARGET_PPC64)
TCGv t0 = tcg_temp_new();
TCGv t1 = tcg_temp_new();
tcg_gen_shri_tl(t0, cpu_gpr[rB(ctx->opcode)], 32);
tcg_gen_shli_tl(t1, cpu... | [
0,
0
] |
qemu | target-i386/op.c | static inline void gen_movs(DisasContext *s, int ot)
{
gen_string_movl_A0_ESI(s);
gen_op_ld_T0_A0(ot + s->mem_index);
gen_string_movl_A0_EDI(s);
gen_op_st_T0_A0(ot + s->mem_index);
gen_op_movl_T0_Dshift[ot]();
#ifdef TARGET_X86_64
if (s->aflag == 2) {
gen_op_addq_ESI_T0();
gen_op_addq_EDI_... | [
0,
0
] |
FFmpeg | libavformat/udp.c | static int udp_read(URLContext *h, uint8_t *buf, int size)
{
UDPContext *s = h->priv_data;
int ret;
int avail;
#if HAVE_PTHREADS
if (s->fifo) {
pthread_mutex_lock(&s->mutex);
do {
avail = av_fifo_size(s->fifo);
if (avail) { // >=size) {
uint8_t tmp[4];
pthread_mut... | [
0,
0
] |
qemu | hw/virtio/virtio-pci.c | static int virtio_pci_vector_unmask(PCIDevice *dev, unsigned vector,
MSIMessage msg)
{
VirtIOPCIProxy *proxy = container_of(dev, VirtIOPCIProxy, pci_dev);
VirtIODevice *vdev = virtio_bus_get_device(&proxy->bus);
VirtQueue *vq = virtio_vector_first_queue(vdev, vector);
i... | [
1,
0
] |
qemu | tcg/tcg.c | void tcg_register_helper(void *func, const char *name)
{
TCGContext *s = &tcg_ctx;
GHashTable *table = s->helpers;
if (table == NULL) {
/* Use g_direct_hash/equal for direct pointer comparisons on func. */
table = g_hash_table_new(NULL, NULL);
s->helpers = table;
}
g_hash_table_insert(tab... | [
0,
0
] |
qemu | vnc.c | static void vnc_disconnect_finish(VncState *vs)
{
if (vs->input.buffer)
qemu_free(vs->input.buffer);
if (vs->output.buffer)
qemu_free(vs->output.buffer);
#ifdef CONFIG_VNC_TLS
vnc_tls_client_cleanup(vs);
#endif /* CONFIG_VNC_TLS */
#ifdef CONFIG_VNC_SASL
vnc_sasl_client_cleanup(vs);
#endif /* C... | [
1,
0
] |
FFmpeg | Changelog | static int dxva2_retrieve_data(AVCodecContext *s, AVFrame *frame)
{
InputStream *ist = s->opaque;
DXVA2Context *ctx = ist->hwaccel_ctx;
int ret;
ret = av_hwframe_transfer_data(ctx->tmp_frame, frame, 0);
if (ret < 0)
return ret;
ret = av_frame_copy_props(ctx->tmp_frame, frame);
if (ret < 0) {
... | [
0,
0
] |
qemu | hw/acpi/piix4.c | static void pci_grackle_class_init(ObjectClass *klass, void *data)
{
SysBusDeviceClass *k = SYS_BUS_DEVICE_CLASS(klass);
DeviceClass *dc = DEVICE_CLASS(klass);
k->init = pci_grackle_init_device;
dc->no_user = 1;
} | [
1,
0
] |
qemu | hw/i386/amd_iommu.c | static void vtd_realize(DeviceState *dev, Error **errp)
{
PCMachineState *pcms = PC_MACHINE(qdev_get_machine());
PCIBus *bus = pcms->bus;
IntelIOMMUState *s = INTEL_IOMMU_DEVICE(dev);
X86IOMMUState *x86_iommu = X86_IOMMU_DEVICE(dev);
VTD_DPRINTF(GENERAL, "");
x86_iommu->type = TYPE_INTEL;
if (!vtd... | [
1,
0
] |
qemu | hw/i2c.h | static inline void menelaus_rtc_start(struct menelaus_s *s)
{
s->rtc.next = +qemu_get_clock(rt_clock);
qemu_mod_timer(s->rtc.hz, s->rtc.next);
} | [
1,
0
] |
qemu | target-mips/exec.h | void op_ddiv(void)
{
if (T1 != 0) {
env->LO = (int64_t)T0 / (int64_t)T1;
env->HI = (int64_t)T0 % (int64_t)T1;
}
RETURN();
} | [
1,
0
] |
FFmpeg | libavcodec/png.h | static int png_decode_idat(PNGDecContext *s, int length)
{
int ret;
s->zstream.avail_in = FFMIN(length, bytestream2_get_bytes_left(&s->gb));
s->zstream.next_in = (unsigned char *)s->gb.buffer;
bytestream2_skip(&s->gb, length);
/* decode one line if possible */
while (s->zstream.avail_in > 0) {
r... | [
1,
0
] |
FFmpeg | libavcodec/mpeg12.c | static int mpeg_decode_frame(AVCodecContext *avctx,
void *data, int *got_output,
AVPacket *avpkt)
{
const uint8_t *buf = avpkt->data;
int buf_size = avpkt->size;
Mpeg1Context *s = avctx->priv_data;
AVFrame *picture = data;
MpegEncContext *s2 = ... | [
1,
0
] |
qemu | linux-user/syscall.c | void syscall_init(void)
{
IOCTLEntry *ie;
const argtype *arg_type;
int size;
int i;
#define STRUCT(name, list...) \
thunk_register_struct(STRUCT_##name, #name, struct_##name##_def);
#define STRUCT_SPECIAL(name) ... | [
1,
0
] |
qemu | cpus.c | void tcg_cpu_address_space_init(CPUState *cpu, AddressSpace *as)
{
/* We only support one address space per cpu at the moment. */
assert(cpu->as == as);
if (cpu->cpu_ases) {
/* We've already registered the listener for our only AS */
return;
}
cpu->cpu_ases = g_new0(CPUAddressSpace, 1);
cpu... | [
0,
0
] |
qemu | target-arm/cpu.h | bool write_list_to_cpustate(ARMCPU *cpu)
{
int i;
bool ok = true;
for (i = 0; i < cpu->cpreg_array_len; i++) {
uint32_t regidx = kvm_to_cpreg_id(cpu->cpreg_indexes[i]);
uint64_t v = cpu->cpreg_values[i];
const ARMCPRegInfo *ri;
ri = get_arm_cp_reginfo(cpu->cp_regs, regidx);
if (!ri) {... | [
0,
0
] |
qemu | hw/9pfs/9p-local.c | static bool local_is_mapped_file_metadata(FsContext *fs_ctx, const char *name)
{
return !strcmp(name, VIRTFS_META_DIR);
} | [
0,
0
] |
FFmpeg | libavformat/avformat.h | void ff_restore_parser_state(AVFormatContext *s, AVParserState *state)
{
int i;
AVStream *st;
AVParserStreamState *ss;
ff_read_frame_flush(s);
if (!state)
return;
avio_seek(s->pb, state->fpos, SEEK_SET);
// copy context structures
s->cur_st = state->cur_st;
s->packet_buffer = state->pac... | [
0,
0
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.