Projectname large_stringclasses 15
values | Filepath large_stringlengths 4 106 ⌀ | Function large_stringlengths 11 3.45k | Label list |
|---|---|---|---|
qemu | Makefile | static int fd_open(BlockDriverState *bs)
{
BDRVRawState *s = bs->opaque;
int last_media_present;
if (s->type != FTYPE_FD)
return 0;
last_media_present = (s->fd >= 0);
if (s->fd >= 0 &&
(qemu_get_clock(rt_clock) - s->fd_open_time) >= FD_OPEN_TIMEOUT) {
close(s->fd);
s->fd = -1;
... | [
0,
0
] |
qemu | acl.c | static void qdev_print(Monitor *mon, DeviceState *dev, int indent)
{
BusState *child;
qdev_printf("dev: %s, id \"%s\"\n", dev->info->name,
dev->id ? dev->id : "");
indent += 2;
if (dev->num_gpio_in) {
qdev_printf("gpio-in %d\n", dev->num_gpio_in);
}
if (dev->num_gpio_out) {
qd... | [
1,
0
] |
qemu | block.c | void bdrv_append(BlockDriverState *bs_new, BlockDriverState *bs_top)
{
assert(!bdrv_requests_pending(bs_top));
assert(!bdrv_requests_pending(bs_new));
bdrv_ref(bs_top);
change_parent_backing_link(bs_top, bs_new);
bdrv_set_backing_hd(bs_new, bs_top);
bdrv_unref(bs_top);
/* bs_new is now referenced ... | [
0,
0
] |
qemu | linux-user/main.c | static void restore_sigcontext(CPUSH4State *regs, struct target_sigcontext *sc,
target_ulong *r0_p)
{
int i;
#define COPY(x) __get_user(regs->x, &sc->sc_##x)
COPY(gregs[1]);
COPY(gregs[2]);
COPY(gregs[3]);
COPY(gregs[4]);
COPY(gregs[5]);
COPY(gregs[6]);
COPY(gregs[... | [
0,
0
] |
qemu | block.c | static BlockDriverAIOCB *bdrv_aio_rw_vector(BlockDriverState *bs,
int64_t sector_num,
QEMUIOVector *qiov,
int nb_sectors,
BlockDriverComplet... | [
1,
0
] |
qemu | hw/i386/intel_iommu.c | static void vtd_update_iotlb(IntelIOMMUState *s, uint16_t source_id,
uint16_t domain_id, hwaddr addr, uint64_t slpte,
bool read_flags, bool write_flags)
{
VTDIOTLBEntry *entry = g_malloc(sizeof(*entry));
uint64_t *key = g_malloc(sizeof(*key));
uint64... | [
0,
0
] |
FFmpeg | libavcodec/mjpegdec.c | static int decode_dc_progressive(MJpegDecodeContext *s, int16_t *block,
int component, int dc_index,
uint16_t *quant_matrix, int Al)
{
int val;
s->bdsp.clear_block(block);
val = mjpeg_decode_dc(s, dc_index);
if (val == 0xfffff) {
av_l... | [
1,
0
] |
qemu | hw/vga.c | static void vga_screen_dump_common(VGAState *s, const char *filename,
int w, int h)
{
DisplayState *saved_ds, ds1, *ds = &ds1;
DisplayChangeListener dcl;
/* XXX: this is a little hackish */
vga_invalidate_display(s);
saved_ds = s->ds;
memset(ds, 0, sizeof(DisplaySt... | [
1,
1
] |
qemu | hw/usb/hcd-ehci.c | static int ehci_state_execute(EHCIQueue *q)
{
EHCIPacket *p = QTAILQ_FIRST(&q->packets);
int again = 0;
assert(p != NULL);
assert(p->qtdaddr == q->qtdaddr);
if (ehci_qh_do_overlay(q) != 0) {
return -1;
}
// TODO verify enough time remains in the uframe as in 4.4.1.1
// TODO write back ptr t... | [
1,
1
] |
qemu | hw/scsi/virtio-scsi.c | static void virtio_scsi_push_event(VirtIOSCSI *s, SCSIDevice *dev,
uint32_t event, uint32_t reason)
{
VirtIOSCSICommon *vs = VIRTIO_SCSI_COMMON(s);
VirtIOSCSIReq *req = virtio_scsi_pop_req(s, vs->event_vq);
VirtIOSCSIEvent *evt;
VirtIODevice *vdev = VIRTIO_DEVICE(s);
... | [
1,
0
] |
FFmpeg | libswscale/utils.c | static inline void
RENAME(yuv2yuvX)(SwsContext *c, const int16_t *lumFilter,
const int16_t **lumSrc, int lumFilterSize,
const int16_t *chrFilter, const int16_t **chrUSrc,
const int16_t **chrVSrc,
int chrFilterSize, const int16_t **alpSrc,
... | [
1,
0
] |
qemu | util/bitmap.c | void bitmap_clear(unsigned long *map, long start, long nr) {
unsigned long *p = map + BIT_WORD(start);
const long size = start + nr;
int bits_to_clear = BITS_PER_LONG - (start % BITS_PER_LONG);
unsigned long mask_to_clear = BITMAP_FIRST_WORD_MASK(start);
while (nr - bits_to_clear >= 0) {
*p &= ~mask_to_cl... | [
1,
0
] |
qemu | tcg/tcg.c | static inline void tcg_temp_free_internal(int idx) {
TCGContext *s = &tcg_ctx;
TCGTemp *ts;
int k;
assert(idx >= s->nb_globals && idx < s->nb_temps);
ts = &s->temps[idx];
assert(ts->temp_allocated != 0);
ts->temp_allocated = 0;
k = ts->base_type;
if (ts->temp_local)
k += TCG_TYPE_COUNT;
ts->next... | [
1,
0
] |
qemu | tests/test-qmp-input-strict.c | Visitor *validate_test_init(TestInputVisitorData *data,
const char *json_string, ...)
{
Visitor *v;
va_list ap;
va_start(ap, json_string);
data->obj = qobject_from_jsonv(json_string, &ap);
va_end(ap);
g_assert(data->obj != NULL);
data->qiv = qmp_input_visitor_new_stric... | [
1,
0
] |
FFmpeg | libavformat/movenc.c | static int mov_write_hdlr_tag(ByteIOContext *pb, MOVTrack *track)
{
const char *descr, *hdlr, *hdlr_type;
int64_t pos = url_ftell(pb);
if (!track) { /* no media --> data handler */
hdlr = "dhlr";
hdlr_type = "url ";
descr = "DataHandler";
} else {
hdlr = (track->mode == MODE_MOV) ? "mhl... | [
1,
0
] |
qemu | block/qcow2-cluster.c | static int qcow2_truncate(BlockDriverState *bs, int64_t offset)
{
BDRVQcowState *s = bs->opaque;
int ret, new_l1_size;
if (offset & 511) {
return -EINVAL;
}
/* cannot proceed if image has snapshots */
if (s->nb_snapshots) {
return -ENOTSUP;
}
/* shrinking is currently not supported */
... | [
1,
0
] |
FFmpeg | ffmpeg.c | static void opt_frame_aspect_ratio(const char *arg)
{
int x = 0, y = 0;
double ar = 0;
const char *p;
char *end;
p = strchr(arg, ':');
if (p) {
x = strtol(arg, &end, 10);
if (end == p)
y = strtol(end + 1, &end, 10);
if (x > 0 && y > 0)
ar = (double)x / (double)y;
} els... | [
1,
0
] |
qemu | block/qapi.c | static void test_validate_fail_alternate(TestInputVisitorData *data,
const void *unused)
{
UserDefAlternate *tmp;
Visitor *v;
Error *err = NULL;
v = validate_test_init(data, "3.14");
visit_type_UserDefAlternate(v, NULL, &tmp, &err);
error_free_or_abort(&err);... | [
0,
0
] |
qemu | pc-bios/s390-ccw/bootmap.c | void sclp_print(const char *str)
{
int len = _strlen(str);
WriteEventData *sccb = (void *)_sccb;
sccb->h.length = sizeof(WriteEventData) + len;
sccb->h.function_code = SCLP_FC_NORMAL_WRITE;
sccb->ebh.length = sizeof(EventBufferHeader) + len;
sccb->ebh.type = SCLP_EVENT_ASCII_CONSOLE_DATA;
sccb->eb... | [
1,
0
] |
qemu | hw/usb/hcd-xhci.c | static void xhci_er_reset(XHCIState *xhci, int v)
{
XHCIInterrupter *intr = &xhci->intr[v];
XHCIEvRingSeg seg;
if (intr->erstsz == 0) {
/* disabled */
intr->er_start = 0;
intr->er_size = 0;
return;
}
/* cache the (sole) event ring segment location */
if (intr->erstsz != 1) {
D... | [
1,
0
] |
qemu | hw/arm/nseries.c | static void pxa2xx_cm_write(void *opaque, hwaddr addr,
uint64_t value, unsigned size)
{
PXA2xxState *s = (PXA2xxState *)opaque;
switch (addr) {
case CCCR:
case CKEN:
s->cm_regs[addr >> 2] = value;
break;
case OSCC:
s->cm_regs[addr >> 2] &= ~0x6c;
s->cm_re... | [
1,
0
] |
qemu | hw/dp8393x.c | static int mcf_fec_can_receive(void *opaque)
{
mcf_fec_state *s = (mcf_fec_state *)opaque;
return s->rx_enabled;
} | [
0,
0
] |
qemu | memory.c | static void memory_region_dispatch_write(MemoryRegion *mr,
hwaddr addr,
uint64_t data,
unsigned size)
{
if (!memory_region_access_valid(mr, addr, size, true)) {
return; /* FIXME: better... | [
1,
1
] |
qemu | block.c | int bdrv_eject(BlockDriverState *bs, int eject_flag)
{
BlockDriver *drv = bs->drv;
if (bs->locked) {
return -EBUSY;
}
if (drv && drv->bdrv_eject) {
drv->bdrv_eject(bs, eject_flag);
}
bs->tray_open = eject_flag;
return 0;
} | [
1,
0
] |
qemu | target-i386/helper.c | static void exception_action(CPUState *cpu)
{
#if defined(TARGET_I386)
X86CPU *x86_cpu = X86_CPU(cpu);
CPUX86State *env1 = &x86_cpu->env;
raise_exception_err(env1, cpu->exception_index, env1->error_code);
#else
cpu_loop_exit(cpu);
#endif
} | [
0,
0
] |
qemu | hw/ppc/spapr_iommu.c | static void spapr_phb_finish_realize(sPAPRPHBState *sphb, Error **errp)
{
sphb->dma_window_start = 0;
sphb->dma_window_size = 0x40000000;
sphb->tcet = spapr_tce_new_table(DEVICE(sphb), sphb->dma_liobn,
sphb->dma_window_size);
if (!sphb->tcet) {
error_setg(errp, "Una... | [
1,
0
] |
qemu | qemu-char.c | static CharDriverState *qemu_chr_open_mux(const char *id,
ChardevBackend *backend,
ChardevReturn *ret, Error **errp)
{
ChardevMux *mux = backend->mux;
CharDriverState *chr, *drv;
MuxDriver *d;
drv = qemu_chr_find(mux->cha... | [
0,
0
] |
qemu | qapi/qmp-input-visitor.c | static void qmp_input_start_struct(Visitor *v, void **obj, const char *kind,
const char *name, size_t size, Error **errp)
{
QmpInputVisitor *qiv = to_qiv(v);
const QObject *qobj = qmp_input_get_object(qiv, name);
if (!qobj || qobject_type(qobj) != QTYPE_QDICT) {
error_... | [
1,
0
] |
FFmpeg | libswscale/swscale.c | static inline void
yuv2yuvXinC(int16_t *lumFilter, int16_t **lumSrc, int lumFilterSize,
int16_t *chrFilter, int16_t **chrSrc, int chrFilterSize,
uint8_t *dest, uint8_t *uDest, uint8_t *vDest, int dstW,
int chrDstW)
{
// FIXME Optimize (just quickly writen not opti..)
int i;
... | [
1,
1
] |
qemu | tests/test-cutils.c | static void test_qemu_strtoll_max(void)
{
const char *str = g_strdup_printf("%lld", LLONG_MAX);
char f = 'X';
const char *endptr = &f;
int64_t res = 999;
int err;
err = qemu_strtoll(str, &endptr, 0, &res);
g_assert_cmpint(err, ==, 0);
g_assert_cmpint(res, ==, LLONG_MAX);
g_assert(endptr == s... | [
1,
0
] |
qemu | target-ppc/translate_init.c | void ppc_cpu_list(FILE *f, int (*cpu_fprintf)(FILE *f, const char *fmt, ...))
{
int i;
for (i = 0;; i++) {
(*cpu_fprintf)(f, "PowerPC %-16s PVR %08x\n",
ppc_defs[i].name, ppc_defs[i].pvr);
if (strcmp(ppc_defs[i].name, "default") == 0)
break;
}
} | [
1,
0
] |
qemu | hw/ppc/Makefile.objs | static target_ulong h_add_logical_lan_buffer(CPUPPCState *env,
sPAPREnvironment *spapr,
target_ulong opcode,
target_ulong *args)
{
target_ulong reg = args[0];
target_ulong buf... | [
1,
0
] |
qemu | exec-all.h | static uint32_t unassigned_mem_readw(void *opaque, target_phys_addr_t addr)
{
#ifdef DEBUG_UNASSIGNED
printf("Unassigned mem read " TARGET_FMT_plx "\n", addr);
#endif
#if defined(TARGET_ALPHA) || defined(TARGET_SPARC) || defined(TARGET_MICROBLAZE)
do_unassigned_access(addr, 0, 0, 0, 2);
#endif
return 0;
} | [
1,
0
] |
FFmpeg | libavcodec/cavsdec.c | static int decode_residual_block(AVSContext *h, GetBitContext *gb,
const dec_2dvlc_t *r, int esc_golomb_order,
int qp, uint8_t *dst, int stride) {
int i, level_code, esc_code, level, run, mask;
DCTELEM level_buf[64];
uint8_t run_buf[64];
DC... | [
1,
0
] |
qemu | linux-user/main.c | static void gen_tlbld_6xx(DisasContext *ctx)
{
#if defined(CONFIG_USER_ONLY)
gen_inval_exception(ctx, POWERPC_EXCP_PRIV_OPC);
#else
if (unlikely(ctx->pr)) {
gen_inval_exception(ctx, POWERPC_EXCP_PRIV_OPC);
return;
}
gen_helper_6xx_tlbd(cpu_env, cpu_gpr[rB(ctx->opcode)]);
#endif
} | [
1,
0
] |
qemu | block-migration.c | static int vdi_check(BlockDriverState *bs, BdrvCheckResult *res,
BdrvCheckMode fix)
{
/* TODO: additional checks possible. */
BDRVVdiState *s = (BDRVVdiState *)bs->opaque;
uint32_t blocks_allocated = 0;
uint32_t block;
uint32_t *bmap;
logout("\n");
if (fix) {
return -ENO... | [
1,
1
] |
qemu | target-i386/helper.c | void helper_idivl_EAX_T0(void)
{
int den, q, r;
int64_t num;
num = ((uint32_t)EAX) | ((uint64_t)((uint32_t)EDX) << 32);
den = T0;
if (den == 0) {
raise_exception(EXCP00_DIVZ);
}
#ifdef BUGGY_GCC_DIV64
r = idiv32(&q, num, den);
#else
q = (num / den);
r = (num % den);
#endif
EAX = (u... | [
1,
0
] |
qemu | hw/usb/redirect.c | static int usbredir_post_load(void *priv, int version_id) {
USBRedirDevice *dev = priv;
switch (dev->device_info.speed) {
case usb_redir_speed_low:
dev->dev.speed = USB_SPEED_LOW;
break;
case usb_redir_speed_full:
dev->dev.speed = USB_SPEED_FULL;
break;
case usb_redir_speed_high:
dev->dev.... | [
1,
0
] |
FFmpeg | libavcodec/g723_1dec.c | static int estimate_sid_gain(G723_1_Context *p)
{
int i, shift, seg, seg2, t, val, val_add, x, y;
shift = 16 - p->cur_gain * 2;
if (shift > 0)
t = p->sid_gain << shift;
else
t = p->sid_gain >> -shift;
x = av_clipl_int32(t * (int64_t)cng_filt[0] >> 16);
if (x >= cng_bseg[2])
return 0x3F... | [
1,
0
] |
FFmpeg | libavcodec/ra288.c | static void decode(RA288Context *ractx, float gain, int cb_coef)
{
int i, j;
double sumsum;
float sum, buffer[5];
memmove(ractx->sp_block + 5, ractx->sp_block, 36 * sizeof(*ractx->sp_block));
for (i = 4; i >= 0; i--)
ractx->sp_block[i] = -scalar_product_float(ractx->sp_block + i + 1,
... | [
1,
0
] |
qemu | block/nbd.c | static ssize_t nbd_send_reply(int csock, struct nbd_reply *reply)
{
uint8_t buf[4 + 4 + 8];
/* Reply
[ 0 .. 3] magic (NBD_REPLY_MAGIC)
[ 4 .. 7] error (0 == no error)
[ 7 .. 15] handle
*/
cpu_to_be32w((uint32_t *)buf, NBD_REPLY_MAGIC);
cpu_to_be32w((uint32_t *)(buf + 4)... | [
1,
0
] |
qemu | target/ppc/kvm.c | void kvmppc_read_hptes(ppc_hash_pte64_t *hptes, hwaddr ptex, int n)
{
int fd, rc;
int i;
fd = kvmppc_get_htab_fd(false, ptex, &error_abort);
i = 0;
while (i < n) {
struct kvm_get_htab_header *hdr;
int m = n < HPTES_PER_GROUP ? n : HPTES_PER_GROUP;
char buf[sizeof(*hdr) + m * HASH_PTE_SIZE... | [
1,
0
] |
qemu | block/qapi.c | void qmp_output_visitor_cleanup(QmpOutputVisitor *v)
{
QStackEntry *e, *tmp;
QTAILQ_FOREACH_SAFE(e, &v->stack, node, tmp) {
QTAILQ_REMOVE(&v->stack, e, node);
g_free(e);
}
qobject_decref(v->root);
g_free(v);
} | [
0,
0
] |
qemu | block/block-backend.c | static void n8x0_nand_setup(struct n800_s *s)
{
char *otp_region;
DriveInfo *dinfo;
s->nand = qdev_create(NULL, "onenand");
qdev_prop_set_uint16(s->nand, "manufacturer_id", NAND_MFR_SAMSUNG);
/* Either 0x40 or 0x48 are OK for the device ID */
qdev_prop_set_uint16(s->nand, "device_id", 0x48);
qdev_... | [
1,
1
] |
qemu | hw/intc/xics.c | static void ics_base_realize(DeviceState *dev, Error **errp)
{
ICSStateClass *icsc = ICS_BASE_GET_CLASS(dev);
ICSState *ics = ICS_BASE(dev);
Object *obj;
Error *err = NULL;
obj = object_property_get_link(OBJECT(dev), ICS_PROP_XICS, &err);
if (!obj) {
error_setg(errp, "%s: required link '" ICS_PR... | [
1,
0
] |
qemu | target-ppc/translate.c | static inline void gen_op_mfspr(DisasContext *ctx)
{
void (*read_cb)(void *opaque, int gprn, int sprn);
uint32_t sprn = SPR(ctx->opcode);
#if !defined(CONFIG_USER_ONLY)
if (ctx->mem_idx == 2)
read_cb = ctx->spr_cb[sprn].hea_read;
else if (ctx->mem_idx)
read_cb = ctx->spr_cb[sprn].oea_read;
el... | [
1,
1
] |
qemu | hw/usb/hcd-xhci.c | static void xhci_check_iso_kick(XHCIState *xhci, XHCITransfer *xfer,
XHCIEPContext *epctx, uint64_t mfindex)
{
if (xfer->mfindex_kick > mfindex) {
timer_mod(epctx->kick_timer, qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL) +
(xfer->mfindex_kick - mf... | [
1,
0
] |
FFmpeg | libavcodec/imgresample.c | struct SwsContext *sws_getContext(int srcW, int srcH, int srcFormat,
int dstW, int dstH, int dstFormat,
int flags, SwsFilter *srcFilter,
SwsFilter *dstFilter, double *param)
{
struct SwsContext *ctx;
ctx = av... | [
1,
0
] |
FFmpeg | libavutil/opt.c | void av_opt_freep_ranges(AVOptionRanges **rangesp)
{
int i;
AVOptionRanges *ranges = *rangesp;
if (!ranges)
return;
for (i = 0; i < ranges->nb_ranges * ranges->nb_components; i++) {
AVOptionRange *range = ranges->range[i];
av_freep(&range->str);
av_freep(&ranges->range[i]);
}
av_fr... | [
1,
0
] |
qemu | Makefile.objs | void qmp_migrate_set_downtime(double value, Error **errp)
{
value *= 1e9;
value = MAX(0, MIN(UINT64_MAX, value));
max_downtime = (uint64_t)value;
} | [
1,
0
] |
FFmpeg | libavformat/rtpenc.c | static void rtcp_send_sr(AVFormatContext *s1, int64_t ntp_time)
{
RTPDemuxContext *s = s1->priv_data;
uint32_t rtp_ts;
#if defined(DEBUG)
printf("RTCP: %02x %" PRIx64 " %x\n", s->payload_type, ntp_time,
s->timestamp);
#endif
if (s->first_rtcp_ntp_time == AV_NOPTS_VALUE)
s->first_rtcp_ntp_tim... | [
1,
0
] |
qemu | bsd-user/main.c | envlist_setenv(envlist_t *envlist, const char *env)
{
struct envlist_entry *entry = NULL;
const char *eq_sign;
size_t envname_len;
if ((envlist == NULL) || (env == NULL))
return (EINVAL);
/* find out first equals sign in given env */
if ((eq_sign = strchr(env, '=')) == NULL)
return (EINVAL)... | [
1,
0
] |
qemu | darwin-user/main.c | static void spr_write_dbatu_h(void *opaque, int sprn)
{
DisasContext *ctx = opaque;
gen_op_store_dbatu((sprn - SPR_DBAT4U) / 2);
RET_STOP(ctx);
} | [
0,
0
] |
qemu | block.c | void bdrv_drain(BlockDriverState *bs)
{
while (bdrv_drain_one(bs)) {
/* Keep iterating */
}
} | [
0,
0
] |
qemu | slirp/misc.c | sprintf_len(char *string, const char *format, ...)
#else
sprintf_len(va_alist) va_dcl
#endif
{
va_list args;
#ifdef __STDC__
va_start(args, format);
#else
char *string;
char *format;
va_start(args);
string = va_arg(args, char *);
format = va_arg(args, char *);
#endif
vsprintf(string, ... | [
1,
0
] |
qemu | target-mips/cpu.h | void op_dmfc0_ebase(void)
{
T0 = env->CP0_EBase;
RETURN();
} | [
0,
0
] |
FFmpeg | libavcodec/hevcdsp_template.c | static void FUNC(put_hevc_epel_bi_w_h)(uint8_t *_dst, ptrdiff_t _dststride,
uint8_t *_src, ptrdiff_t _srcstride,
int16_t *src2,
int height, int denom, int wx0, int wx1,
... | [
1,
0
] |
qemu | hw/display/virtio-gpu-3d.c | void sdl2_gl_scanout(DisplayChangeListener *dcl,
uint32_t backing_id, bool backing_y_0_top,
uint32_t x, uint32_t y,
uint32_t w, uint32_t h)
{
struct sdl2_console *scon = container_of(dcl, struct sdl2_console, dcl);
assert(scon->opengl);
scon->x... | [
1,
0
] |
qemu | qemu-char.c | static void win_stdio_close(CharDriverState *chr)
{
WinStdioCharState *stdio = chr->opaque;
if (stdio->hInputReadyEvent != INVALID_HANDLE_VALUE) {
CloseHandle(stdio->hInputReadyEvent);
}
if (stdio->hInputDoneEvent != INVALID_HANDLE_VALUE) {
CloseHandle(stdio->hInputDoneEvent);
}
if (stdio->hI... | [
1,
0
] |
qemu | qemu-options-wrapper.h | static void help(int exitcode)
{
const char *options_help =
#define QEMU_OPTIONS_GENERATE_HELP
#include "qemu-options-wrapper.h"
;
version();
printf("usage: %s [options] [disk_image]\n"
"\n"
"'disk_image' is a raw hard disk image for IDE hard disk 0\n"
"\n"
"%s... | [
0,
0
] |
qemu | HACKING | static const IntelHDAReg *intel_hda_reg_find(IntelHDAState *d,
target_phys_addr_t addr)
{
const IntelHDAReg *reg;
if (addr >= sizeof(regtab) / sizeof(regtab[0])) {
goto noreg;
}
reg = regtab + addr;
if (reg->name == NULL) {
goto noreg;
}
return ... | [
1,
0
] |
qemu | block.c | void bdrv_io_limits_disable(BlockDriverState *bs)
{
bs->io_limits_enabled = false;
bdrv_start_throttled_reqs(bs);
throttle_destroy(&bs->throttle_state);
} | [
0,
0
] |
qemu | translate-all.c | static __attribute__((unused)) void map_exec(void *addr, long size)
{
unsigned long start, end, page_size;
page_size = getpagesize();
start = (unsigned long)addr;
start &= ~(page_size - 1);
end = (unsigned long)addr + size;
end += page_size - 1;
end &= ~(page_size - 1);
mprotect((void *)start, ... | [
1,
0
] |
FFmpeg | libavformat/nutdec.c | static int decode_syncpoint(NUTContext *nut, int64_t *ts, int64_t *back_ptr) {
AVFormatContext *s = nut->avf;
ByteIOContext *bc = &s->pb;
int64_t end, tmp;
AVRational time_base;
nut->last_syncpoint_pos = url_ftell(bc) - 8;
end = get_packetheader(nut, bc, 1);
end += url_ftell(bc);
tmp = get_v(bc)... | [
1,
0
] |
FFmpeg | libavcore/imgutils.c | int av_image_fill_linesizes(int linesizes[4], enum PixelFormat pix_fmt,
int width)
{
int i;
const AVPixFmtDescriptor *desc = &av_pix_fmt_descriptors[pix_fmt];
int max_step[4]; /* max pixel step for each plane */
int max_step_comp[4]; /* the component for each plane which has the... | [
1,
0
] |
qemu | Makefile.objs | void qemu_bh_cancel(QEMUBH *bh)
{
bh->scheduled = 0;
} | [
0,
0
] |
qemu | aio-posix.c | static void test_source_notify(void)
{
while (g_main_context_iteration(NULL, false))
;
aio_notify(ctx);
g_assert(g_main_context_iteration(NULL, true));
g_assert(!g_main_context_iteration(NULL, false));
} | [
1,
0
] |
qemu | configure | static void boston_lcd_event(void *opaque, int event)
{
BostonState *s = opaque;
if (event == CHR_EVENT_OPENED && !s->lcd_inited) {
qemu_chr_fe_printf(&s->lcd_display, " ");
s->lcd_inited = true;
}
} | [
1,
0
] |
qemu | hmp.c | void hmp_info_memdev(Monitor *mon, const QDict *qdict) {
Error *err = NULL;
MemdevList *memdev_list = qmp_query_memdev(&err);
MemdevList *m = memdev_list;
StringOutputVisitor *ov;
char *str;
int i = 0;
while (m) {
ov = string_output_visitor_new(false);
visit_type_uint16List(string_output_get_visit... | [
1,
0
] |
qemu | cmd.c | void add_command(const cmdinfo_t *ci)
{
cmdtab = realloc((void *)cmdtab, ++ncmds * sizeof(*cmdtab));
cmdtab[ncmds - 1] = *ci;
qsort(cmdtab, ncmds, sizeof(*cmdtab), compare);
} | [
1,
0
] |
qemu | block/dmg.c | static int dmg_read_resource_fork(BlockDriverState *bs, DmgHeaderState *ds,
uint64_t info_begin, uint64_t info_length)
{
BDRVDMGState *s = bs->opaque;
int ret;
uint32_t count, rsrc_data_offset;
uint8_t *buffer = NULL;
uint64_t info_end;
uint64_t offset;
/* read o... | [
1,
0
] |
qemu | hw/core/qdev-properties-system.c | static int qdev_add_one_global(QemuOpts *opts, void *opaque)
{
GlobalProperty *g;
ObjectClass *oc;
g = g_malloc0(sizeof(*g));
g->driver = qemu_opt_get(opts, "driver");
g->property = qemu_opt_get(opts, "property");
g->value = qemu_opt_get(opts, "value");
oc = object_class_by_name(g->driver);
if ... | [
1,
0
] |
qemu | hw/scsi/vhost-scsi.c | void virtio_scsi_common_realize(DeviceState *dev, Error **errp)
{
VirtIODevice *vdev = VIRTIO_DEVICE(dev);
VirtIOSCSICommon *s = VIRTIO_SCSI_COMMON(dev);
int i;
virtio_init(vdev, "virtio-scsi", VIRTIO_ID_SCSI,
sizeof(VirtIOSCSIConfig));
s->cmd_vqs = g_malloc0(s->conf.num_queues * sizeof(V... | [
1,
0
] |
FFmpeg | libavformat/genh.c | static int genh_read_packet(AVFormatContext *s, AVPacket *pkt)
{
AVCodecContext *codec = s->streams[0]->codec;
GENHDemuxContext *c = s->priv_data;
int ret;
if (c->dsp_int_type == 1 && codec->codec_id == AV_CODEC_ID_ADPCM_THP &&
codec->channels > 1) {
int i, ch;
if (avio_feof(s->pb))
... | [
1,
0
] |
qemu | arch_init.c | static void balloon_page(void *addr, int deflate)
{
#if defined(__linux__)
if (!kvm_enabled() || kvm_has_sync_mmu())
madvise(addr, TARGET_PAGE_SIZE,
deflate ? MADV_WILLNEED : MADV_DONTNEED);
#endif
} | [
1,
0
] |
qemu | linux-user/main.c | static void gen_wrteei(DisasContext *ctx)
{
#if defined(CONFIG_USER_ONLY)
gen_inval_exception(ctx, POWERPC_EXCP_PRIV_OPC);
#else
if (unlikely(ctx->pr)) {
gen_inval_exception(ctx, POWERPC_EXCP_PRIV_OPC);
return;
}
if (ctx->opcode & 0x00008000) {
tcg_gen_ori_tl(cpu_msr, cpu_msr, (1 << MSR_EE)... | [
1,
0
] |
qemu | fsdev/virtfs-proxy-helper.c | static void proxy_rewinddir(FsContext *ctx, V9fsFidOpenState *fs)
{
rewinddir(fs->dir);
} | [
0,
0
] |
qemu | configure | int qcrypto_init(Error **errp G_GNUC_UNUSED)
{
return 0;
} | [
0,
0
] |
qemu | block.c | BlockDriverState *check_to_replace_node(const char *node_name, Error **errp)
{
BlockDriverState *to_replace_bs = bdrv_find_node(node_name);
AioContext *aio_context;
if (!to_replace_bs) {
error_setg(errp, "Node name '%s' not found", node_name);
return NULL;
}
aio_context = bdrv_get_aio_context(t... | [
0,
0
] |
qemu | target-i386/translate.c | static inline void gen_op_mov_reg_v(int ot, int reg, TCGv t0)
{
switch (ot) {
case OT_BYTE:
if (reg < 4 X86_64_DEF(|| reg >= 8 || x86_64_hregs)) {
tcg_gen_deposit_tl(cpu_regs[reg], cpu_regs[reg], t0, 0, 8);
} else {
tcg_gen_deposit_tl(cpu_regs[reg - 4], cpu_regs[reg - 4], t0, 8, 8);
}... | [
1,
1
] |
qemu | HACKING | DeviceState *exynos4210_uart_create(target_phys_addr_t addr,
int fifo_size,
int channel,
CharDriverState *chr,
qemu_irq irq)
{
DeviceState *dev;
SysBusDevice *bus;
... | [
0,
0
] |
qemu | hmp.c | static VncClientInfo *qmp_query_vnc_client(const VncState *client)
{
struct sockaddr_storage sa;
socklen_t salen = sizeof(sa);
char host[NI_MAXHOST];
char serv[NI_MAXSERV];
VncClientInfo *info;
if (getpeername(client->csock, (struct sockaddr *)&sa, &salen) < 0) {
return NULL;
}
if (getnamei... | [
1,
0
] |
FFmpeg | libavcodec/ac3dec.c | static inline void mix_2f_2r_to_dolby(AC3DecodeContext *ctx)
{
int i;
float (*output)[256] = ctx->audio_block.block_output;
for (i = 0; i < 256; i++) {
output[1][i] -= output[3][i];
output[2][i] += output[4][i];
}
memset(output[3], 0, sizeof(output[3]));
memset(output[4], 0, sizeof(output[4]... | [
1,
0
] |
FFmpeg | libavcodec/mmvideo.c | static void mm_decode_intra(MmContext *s, int half_horiz, int half_vert,
const uint8_t *buf, int buf_size)
{
int i, x, y;
i = 0;
x = 0;
y = 0;
while (i < buf_size) {
int run_length, color;
if (buf[i] & 0x80) {
run_length = 1;
color = buf[i];
i++;
... | [
1,
0
] |
qemu | hw/bt-hci.c | static int bt_hci_name_req(struct bt_hci_s *hci, bdaddr_t *bdaddr)
{
struct bt_device_s *slave;
evt_remote_name_req_complete params;
int len;
for (slave = hci->device.net->slave; slave; slave = slave->next)
if (slave->page_scan && !bacmp(&slave->bd_addr, bdaddr))
break;
if (!slave)
retu... | [
1,
0
] |
qemu | blockdev.c | void qmp_block_stream(bool has_job_id, const char *job_id, const char *device,
bool has_base, const char *base,
bool has_backing_file, const char *backing_file,
bool has_speed, int64_t speed,
bool has_on_error, BlockdevOnError o... | [
0,
0
] |
qemu | net/colo-compare.c | static gboolean check_old_packet_regular(void *opaque)
{
CompareState *s = opaque;
/* if have old packet we will notify checkpoint */
colo_old_packet_check(s);
return TRUE;
} | [
0,
0
] |
qemu | target-sparc/fop_helper.c | float64 helper_fsqrtd(CPUSPARCState *env, float64 src)
{
float64 ret;
clear_float_exceptions(env);
ret = float64_sqrt(src, &env->fp_status);
check_ieee_exceptions(env);
return ret;
} | [
0,
0
] |
qemu | block/block-backend.c | static void scsi_realize(SCSIDevice *dev, Error **errp)
{
SCSIDiskState *s = DO_UPCAST(SCSIDiskState, qdev, dev);
Error *err = NULL;
if (!s->qdev.conf.bs) {
error_setg(errp, "drive property not set");
return;
}
if (!(s->features & (1 << SCSI_DISK_F_REMOVABLE)) &&
!bdrv_is_inserted(s->qde... | [
0,
0
] |
FFmpeg | ffserver.c | int udp_set_remote_url(URLContext *h, const char *uri)
{
UDPContext *s = h->priv_data;
char hostname[256];
int port;
url_split(NULL, 0, hostname, sizeof(hostname), &port, NULL, 0, uri);
/* set the destination address */
if (resolve_host(&s->dest_addr.sin_addr, hostname) < 0)
return AVERROR_IO;
... | [
1,
0
] |
qemu | net/socket.c | static void net_socket_connected(int fd, Error *err, void *opaque)
{
socket_connect_data *c = opaque;
NetSocketState *s;
char *addr_str = NULL;
Error *local_error = NULL;
addr_str = socket_address_to_string(c->saddr, &local_error);
if (addr_str == NULL) {
error_report_err(local_error);
clos... | [
1,
0
] |
qemu | target-i386/op.c | void OPPROTO op_decw_ECX(void)
{
ECX = (ECX & ~0xffff) | ((ECX - 1) & 0xffff);
} | [
0,
0
] |
qemu | vnc.c | static void vnc_write_pixels_generic(VncState *vs, void *pixels1, int size)
{
uint8_t buf[4];
if (vs->depth == 4) {
uint32_t *pixels = pixels1;
int n, i;
n = size >> 2;
for (i = 0; i < n; i++) {
vnc_convert_pixel(vs, buf, pixels[i]);
vnc_write(vs, buf, vs->pix_bpp);
}
} e... | [
1,
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 (is_async_return(data)) {
/*
* Asynchronous commands have no initial return data but they can
* gen... | [
1,
0
] |
qemu | hw/openpic.c | static void openpic_tmr_write(void *opaque, hwaddr addr, uint64_t val,
unsigned len)
{
OpenPICState *opp = opaque;
int idx;
DPRINTF("%s: addr %08x <= %08x\n", __func__, addr, val);
if (addr & 0xF)
return;
idx = (addr >> 6) & 0x3;
addr = addr & 0x30;
if (addr == ... | [
1,
0
] |
FFmpeg | libavcodec/resample2.c | AVResampleContext *av_resample_init(int out_rate, int in_rate, int filter_size,
int phase_shift, int linear,
double cutoff) {
AVResampleContext *c = av_mallocz(sizeof(AVResampleContext));
double factor = FFMIN(out_rate * cutoff / in_rate, 1.0... | [
1,
0
] |
FFmpeg | libavformat/mov.c | static int mov_read_elst(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
{
MOVStreamContext *sc = c->fc->streams[c->fc->nb_streams - 1]->priv_data;
int i, edit_count;
get_byte(pb); /* version */
get_be24(pb); /* flags */
edit_count = sc->edit_count = get_be32(pb); /* entries */
for (i = 0; i < edit_c... | [
1,
0
] |
qemu | block/parallels.c | static int64_t seek_to_sector(BDRVParallelsState *s, int64_t sector_num)
{
uint32_t index, offset;
index = sector_num / s->tracks;
offset = sector_num % s->tracks;
/* not allocated */
if ((index >= s->catalog_size) || (s->catalog_bitmap[index] == 0))
return -1;
return (uint64_t)s->catalog_bitmap... | [
1,
0
] |
qemu | net/l2tpv3.c | static int l2tpv3_can_send(void *opaque)
{
NetL2TPV3State *s = opaque;
return qemu_can_send_packet(&s->nc);
} | [
0,
0
] |
qemu | target-s390x/fpu_helper.c | uint32_t HELPER(lpebr)(CPUS390XState *env, uint32_t f1, uint32_t f2)
{
float32 v1;
float32 v2 = env->fregs[f2].d;
v1 = float32_abs(v2);
env->fregs[f1].d = v1;
return set_cc_nz_f32(v1);
} | [
0,
0
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.