project stringclasses 2
values | commit_id stringlengths 40 40 | target int64 0 1 | func stringlengths 26 142k | idx int64 0 27.3k |
|---|---|---|---|---|
qemu | bdb5ee3064d5ae786b0bcb6cf6ff4e3554a72990 | 0 | int rom_add_option(const char *file)
{
if (!rom_enable_driver_roms)
return 0;
return rom_add_file(file, "genroms", file, 0);
}
| 20,371 |
qemu | 5b120785e70a9a48b43e3f1f156a10a015334a28 | 0 | static target_ulong h_client_architecture_support(PowerPCCPU *cpu_,
sPAPRMachineState *spapr,
target_ulong opcode,
target_ulong *args)
{
target_ulong list = ppc6... | 20,372 |
qemu | 4445b1d27ee65ceee12b71bc20242996c8eb5cf8 | 0 | static void rtas_ibm_configure_connector(PowerPCCPU *cpu,
sPAPRMachineState *spapr,
uint32_t token, uint32_t nargs,
target_ulong args, uint32_t nret,
ta... | 20,373 |
qemu | 7e2515e87c41e2e658aaed466e11cbdf1ea8bcb1 | 0 | static void term_show_prompt2(void)
{
term_printf("(qemu) ");
fflush(stdout);
term_last_cmd_buf_index = 0;
term_last_cmd_buf_size = 0;
term_esc_state = IS_NORM;
}
| 20,374 |
qemu | a89f364ae8740dfc31b321eed9ee454e996dc3c1 | 0 | static void pxa2xx_lcdc_write(void *opaque, hwaddr offset,
uint64_t value, unsigned size)
{
PXA2xxLCDState *s = (PXA2xxLCDState *) opaque;
int ch;
switch (offset) {
case LCCR0:
/* ACK Quick Disable done */
if ((s->control[0] & LCCR0_ENB) && !(value... | 20,375 |
qemu | ddca7f86ac022289840e0200fd4050b2b58e9176 | 0 | static void v9fs_clunk(void *opaque)
{
int err;
int32_t fid;
size_t offset = 7;
V9fsFidState *fidp;
V9fsPDU *pdu = opaque;
V9fsState *s = pdu->s;
pdu_unmarshal(pdu, offset, "d", &fid);
trace_v9fs_clunk(pdu->tag, pdu->id, fid);
fidp = clunk_fid(s, fid);
if (fidp == ... | 20,376 |
qemu | 786a4ea82ec9c87e3a895cf41081029b285a5fe5 | 0 | static void pcie_aer_update_log(PCIDevice *dev, const PCIEAERErr *err)
{
uint8_t *aer_cap = dev->config + dev->exp.aer_cap;
uint8_t first_bit = ffs(err->status) - 1;
uint32_t errcap = pci_get_long(aer_cap + PCI_ERR_CAP);
int i;
assert(err->status);
assert(!(err->status & (err->status - ... | 20,377 |
qemu | 4099df586a0f16522383c4e4a9613e7c2dcd2491 | 0 | static int hdev_create(const char *filename, QEMUOptionParameter *options)
{
int fd;
int ret = 0;
struct stat stat_buf;
int64_t total_size = 0;
/* Read out options */
while (options && options->name) {
if (!strcmp(options->name, "size")) {
total_size = options->val... | 20,378 |
qemu | eb700029c7836798046191d62d595363d92c84d4 | 0 | void net_rx_pkt_set_protocols(struct NetRxPkt *pkt, const void *data,
size_t len)
{
assert(pkt);
eth_get_protocols(data, len, &pkt->isip4, &pkt->isip6,
&pkt->isudp, &pkt->istcp);
}
| 20,379 |
FFmpeg | 0abab003034145a33077a613807165055013030a | 0 | static int decode_frame(AVCodecContext *avctx,
void *data,
int *data_size,
AVPacket *avpkt)
{
const uint8_t *buf = avpkt->data;
const uint8_t *buf_end = avpkt->data + avpkt->size;
int buf_size = avpkt->size;
DPXContext... | 20,380 |
FFmpeg | 9f61abc8111c7c43f49ca012e957a108b9cc7610 | 0 | static int hls_write_trailer(struct AVFormatContext *s)
{
HLSContext *hls = s->priv_data;
AVFormatContext *oc = hls->avf;
av_write_trailer(oc);
avio_closep(&oc->pb);
avformat_free_context(oc);
av_free(hls->basename);
append_entry(hls, hls->duration);
hls_window(s, 1);
f... | 20,381 |
FFmpeg | c8d36d254e298a51ea569b2557451d26499d0f88 | 0 | static int g726_decode_frame(AVCodecContext *avctx,
void *data, int *data_size,
AVPacket *avpkt)
{
const uint8_t *buf = avpkt->data;
int buf_size = avpkt->size;
G726Context *c = avctx->priv_data;
int16_t *samples = data;
GetBitContext... | 20,382 |
FFmpeg | 0058584580b87feb47898e60e4b80c7f425882ad | 0 | static inline void downmix_mono_to_stereo(float *samples)
{
int i;
for (i = 0; i < 256; i++)
samples[i + 256] = samples[i];
}
| 20,383 |
FFmpeg | c33ffc7b21b9531a971b5da1edcae0b308fe88aa | 0 | dshow_cycle_devices(AVFormatContext *avctx, ICreateDevEnum *devenum,
enum dshowDeviceType devtype, enum dshowSourceFilterType sourcetype, IBaseFilter **pfilter)
{
struct dshow_ctx *ctx = avctx->priv_data;
IBaseFilter *device_filter = NULL;
IEnumMoniker *classenum = NULL;
IMonik... | 20,384 |
FFmpeg | 7e7e59409294af9caa63808e56c5cc824c98b4fc | 0 | static void rgb24_to_yuvj444p(AVPicture *dst, AVPicture *src,
int width, int height)
{
int src_wrap, x, y;
int r, g, b;
uint8_t *lum, *cb, *cr;
const uint8_t *p;
lum = dst->data[0];
cb = dst->data[1];
cr = dst->data[2];
src_wrap = src->linesize... | 20,386 |
FFmpeg | 70205f1799252c3363a5bb5ea7ea5df090f2c88f | 0 | static int vf_open(vf_instance_t *vf, char *args){
vf->config=config;
vf->put_image=put_image;
vf->get_image=get_image;
vf->query_format=query_format;
vf->uninit=uninit;
vf->control= control;
vf->priv=malloc(sizeof(struct vf_priv_s));
memset(vf->priv, 0, sizeof(struct vf_priv_s))... | 20,387 |
FFmpeg | 1e18d32d01fc0ac784a0d592b46215bfbdcc579d | 0 | static void ff_id3v2_parse(AVFormatContext *s, int len, uint8_t version, uint8_t flags, ID3v2ExtraMeta **extra_meta)
{
int isv34, tlen, unsync;
char tag[5];
int64_t next, end = avio_tell(s->pb) + len;
int taghdrlen;
const char *reason = NULL;
AVIOContext pb;
AVIOContext *pbx;
un... | 20,388 |
FFmpeg | b888abe1be9f0b3c75273c28e9a7b58fe47d5ec4 | 0 | static int eval_refl(int *refl, const int16_t *coefs, RA144Context *ractx)
{
int b, c, i;
unsigned int u;
int buffer1[10];
int buffer2[10];
int *bp1 = buffer1;
int *bp2 = buffer2;
for (i=0; i < 10; i++)
buffer2[i] = coefs[i];
refl[9] = bp2[9];
if ((unsigned) ... | 20,389 |
FFmpeg | 21b37480291e827ad6af26df283f734381a9fb75 | 0 | static char *sdp_media_attributes(char *buff, int size, AVCodecContext *c, int payload_type)
{
char *config = NULL;
switch (c->codec_id) {
case CODEC_ID_MPEG4:
if (c->flags & CODEC_FLAG_GLOBAL_HEADER) {
config = extradata2config(c->extradata, c->extradata_size);
... | 20,390 |
FFmpeg | a4c7a5ea27050a28625eabf1ba98cfef9ac6620d | 0 | static int mpegvideo_parse(AVCodecParserContext *s,
AVCodecContext *avctx,
const uint8_t **poutbuf, int *poutbuf_size,
const uint8_t *buf, int buf_size)
{
ParseContext1 *pc1 = s->priv_data;
ParseContext *pc= &pc1->pc;
in... | 20,391 |
FFmpeg | 3176217c60ca7828712985092d9102d331ea4f3d | 0 | int ff_h264_execute_ref_pic_marking(H264Context *h, MMCO *mmco, int mmco_count)
{
int i, av_uninit(j);
int current_ref_assigned = 0, err = 0;
H264Picture *av_uninit(pic);
if ((h->avctx->debug & FF_DEBUG_MMCO) && mmco_count == 0)
av_log(h->avctx, AV_LOG_DEBUG, "no mmco here\n");
fo... | 20,392 |
FFmpeg | d6604b29ef544793479d7fb4e05ef6622bb3e534 | 0 | static int libschroedinger_encode_close(AVCodecContext *avctx)
{
SchroEncoderParams *p_schro_params = avctx->priv_data;
/* Close the encoder. */
schro_encoder_free(p_schro_params->encoder);
/* Free data in the output frame queue. */
ff_schro_queue_free(&p_schro_params->enc_frame_queue,
... | 20,393 |
FFmpeg | f3e084909bff422f0c853507a82f92ff2efc0d28 | 0 | static void apply_window_mp3(float *in, float *win, int *unused, float *out,
int incr)
{
LOCAL_ALIGNED_16(float, suma, [17]);
LOCAL_ALIGNED_16(float, sumb, [17]);
LOCAL_ALIGNED_16(float, sumc, [17]);
LOCAL_ALIGNED_16(float, sumd, [17]);
float sum;
/* copy... | 20,394 |
qemu | 4fa4ce7107c6ec432f185307158c5df91ce54308 | 0 | static int mp_user_removexattr(FsContext *ctx,
const char *path, const char *name)
{
char buffer[PATH_MAX];
if (strncmp(name, "user.virtfs.", 12) == 0) {
/*
* Don't allow fetch of user.virtfs namesapce
* in case of mapped security
*/
... | 20,396 |
qemu | d368ba4376b2c1c24175c74b3733b8fe64dbe8a6 | 0 | static void sdhci_data_transfer(SDHCIState *s)
{
SDHCIClass *k = SDHCI_GET_CLASS(s);
if (s->trnmod & SDHC_TRNS_DMA) {
switch (SDHC_DMA_TYPE(s->hostctl)) {
case SDHC_CTRL_SDMA:
if ((s->trnmod & SDHC_TRNS_MULTI) &&
(!(s->trnmod & SDHC_TRNS_BLK_CNT_EN) || s-... | 20,397 |
qemu | 42a268c241183877192c376d03bd9b6d527407c7 | 0 | static void disas_cc(DisasContext *s, uint32_t insn)
{
unsigned int sf, op, y, cond, rn, nzcv, is_imm;
int label_continue = -1;
TCGv_i64 tcg_tmp, tcg_y, tcg_rn;
if (!extract32(insn, 29, 1)) {
unallocated_encoding(s);
return;
}
if (insn & (1 << 10 | 1 << 4)) {
... | 20,399 |
qemu | 4df26e88ee2f23c01418630368e87b719ed06b75 | 0 | static void xenfb_handle_events(struct XenFB *xenfb)
{
uint32_t prod, cons, out_cons;
struct xenfb_page *page = xenfb->c.page;
prod = page->out_prod;
out_cons = page->out_cons;
if (prod - out_cons >= XENFB_OUT_RING_LEN) {
return;
}
xen_rmb(); /* ensure we see ring content... | 20,400 |
qemu | a7812ae412311d7d47f8aa85656faadac9d64b56 | 0 | static always_inline void gen_ext_l(void (*tcg_gen_ext_i64)(TCGv t0, TCGv t1),
int ra, int rb, int rc,
int islit, uint8_t lit)
{
if (unlikely(rc == 31))
return;
if (ra != 31) {
if (islit) {
tcg_gen_... | 20,401 |
qemu | eb700029c7836798046191d62d595363d92c84d4 | 0 | eth_calc_pseudo_hdr_csum(struct ip_header *iphdr, uint16_t csl)
{
struct ip_pseudo_header ipph;
ipph.ip_src = iphdr->ip_src;
ipph.ip_dst = iphdr->ip_dst;
ipph.ip_payload = cpu_to_be16(csl);
ipph.ip_proto = iphdr->ip_p;
ipph.zeros = 0;
return net_checksum_add(sizeof(ipph), (uint8_t *)... | 20,404 |
FFmpeg | e46e49e31d7e8057881ffa89fc1f17e1f4d16d67 | 0 | static int ftp_auth(FTPContext *s, char *auth)
{
const char *user = NULL, *pass = NULL;
char *end = NULL, buf[CONTROL_BUFFER_SIZE];
int err;
av_assert2(auth);
user = av_strtok(auth, ":", &end);
pass = av_strtok(end, ":", &end);
if (user) {
snprintf(buf, sizeof(buf), "USE... | 20,405 |
qemu | 92c0bba9a95739c92e959fe478cb1acb92fa5446 | 0 | static void omap_l4_io_writew(void *opaque, target_phys_addr_t addr,
uint32_t value)
{
unsigned int i = (addr - OMAP2_L4_BASE) >> TARGET_PAGE_BITS;
return omap_l4_io_writew_fn[i](omap_l4_io_opaque[i], addr, value);
}
| 20,406 |
qemu | fbfecf43e9d354cfae04496563f7bb87d2ccde46 | 0 | static void pl050_write(void *opaque, hwaddr offset,
uint64_t value, unsigned size)
{
pl050_state *s = (pl050_state *)opaque;
switch (offset >> 2) {
case 0: /* KMICR */
s->cr = value;
pl050_update(s, s->pending);
/* ??? Need to implement the enable/dis... | 20,408 |
qemu | 2c6942fa7b332a95286071b92d233853e1000948 | 0 | static int eject_device(Monitor *mon, BlockDriverState *bs, int force)
{
if (!bdrv_is_removable(bs)) {
qerror_report(QERR_DEVICE_NOT_REMOVABLE, bdrv_get_device_name(bs));
return -1;
}
if (!force && bdrv_dev_is_medium_locked(bs)) {
qerror_report(QERR_DEVICE_LOCKED, bdrv_get_dev... | 20,409 |
qemu | a8170e5e97ad17ca169c64ba87ae2f53850dab4c | 0 | static int load_dtb(target_phys_addr_t addr, const struct arm_boot_info *binfo)
{
#ifdef CONFIG_FDT
uint32_t *mem_reg_property;
uint32_t mem_reg_propsize;
void *fdt = NULL;
char *filename;
int size, rc;
uint32_t acells, scells, hival;
filename = qemu_find_file(QEMU_FILE_TYPE_BIOS,... | 20,411 |
qemu | 90e56fb46d0a7add88ed463efa4e723a6238f692 | 0 | static void flush_compressed_data(QEMUFile *f)
{
int idx, len, thread_count;
if (!migrate_use_compression()) {
return;
}
thread_count = migrate_compress_threads();
for (idx = 0; idx < thread_count; idx++) {
if (!comp_param[idx].done) {
qemu_mutex_lock(comp_done... | 20,412 |
qemu | 94649d423e4647fca3bc3e8b2b363d6d2adee9ce | 0 | sPAPRDRConnector *spapr_dr_connector_new(Object *owner,
sPAPRDRConnectorType type,
uint32_t id)
{
sPAPRDRConnector *drc =
SPAPR_DR_CONNECTOR(object_new(TYPE_SPAPR_DR_CONNECTOR));
g_assert(type);
drc->type = ... | 20,413 |
qemu | de08c606f9ddafe647b6843e2b10a6d6030b0fc0 | 0 | int bdrv_snapshot_create(BlockDriverState *bs,
QEMUSnapshotInfo *sn_info)
{
BlockDriver *drv = bs->drv;
if (!drv)
return -ENOMEDIUM;
if (drv->bdrv_snapshot_create)
return drv->bdrv_snapshot_create(bs, sn_info);
if (bs->file)
return bdrv_snapshot_... | 20,414 |
qemu | eabb7b91b36b202b4dac2df2d59d698e3aff197a | 0 | static char *tcg_get_arg_str_idx(TCGContext *s, char *buf,
int buf_size, int idx)
{
assert(idx >= 0 && idx < s->nb_temps);
return tcg_get_arg_str_ptr(s, buf, buf_size, &s->temps[idx]);
}
| 20,415 |
FFmpeg | 68f593b48433842f3407586679fe07f3e5199ab9 | 0 | static inline int mpeg4_is_resync(MpegEncContext *s){
const int bits_count= get_bits_count(&s->gb);
if(s->workaround_bugs&FF_BUG_NO_PADDING){
return 0;
}
if(bits_count + 8 >= s->gb.size*8){
int v= show_bits(&s->gb, 8);
v|= 0x7F >> (7-(bits_count&7));
... | 20,416 |
qemu | 5507904e362df252f6065cb27d1ff98372db6abc | 1 | ssize_t v9fs_list_xattr(FsContext *ctx, const char *path,
void *value, size_t vsize)
{
ssize_t size = 0;
char *buffer;
void *ovalue = value;
XattrOperations *xops;
char *orig_value, *orig_value_start;
ssize_t xattr_len, parsed_len = 0, attr_len;
/* Get the ... | 20,418 |
FFmpeg | 501866a1fab9ee38b5360ae0e0dc0d04cbff1bf6 | 1 | static int mov_write_udta_tag(ByteIOContext *pb, MOVContext* mov,
AVFormatContext *s)
{
int pos = url_ftell(pb);
int i;
put_be32(pb, 0); /* size */
put_tag(pb, "udta");
/* iTunes meta data */
mov_write_meta_tag(pb, mov, s);
/* Requirements */
... | 20,419 |
qemu | 4333979e3d8c129953bba36ed87ce543d33cbea1 | 1 | static void bochs_bios_write(void *opaque, uint32_t addr, uint32_t val)
{
static const char shutdown_str[8] = "Shutdown";
static int shutdown_index = 0;
switch(addr) {
/* Bochs BIOS messages */
case 0x400:
case 0x401:
/* used to be panic, now unused */
break;
... | 20,420 |
qemu | d195325b05199038b5907fa791729425b9720d21 | 1 | void error_propagate(Error **dst_err, Error *local_err)
{
if (dst_err) {
*dst_err = local_err;
} else if (local_err) {
error_free(local_err);
}
}
| 20,421 |
qemu | 6c5819c4d685bf5f3c81edb462f4d17fb99ca2b5 | 1 | static int macio_newworld_initfn(PCIDevice *d)
{
MacIOState *s = MACIO(d);
NewWorldMacIOState *ns = NEWWORLD_MACIO(d);
SysBusDevice *sysbus_dev;
MemoryRegion *timer_memory = g_new(MemoryRegion, 1);
int i;
int cur_irq = 0;
int ret = macio_common_initfn(d);
if (ret < 0) {
... | 20,423 |
qemu | b6d9766ddf5453e79e0c66c9348728ba44ba115f | 1 | static void cpu_openrisc_load_kernel(ram_addr_t ram_size,
const char *kernel_filename,
OpenRISCCPU *cpu)
{
long kernel_size;
uint64_t elf_entry;
hwaddr entry;
if (kernel_filename && !qtest_enabled()) {
kernel_siz... | 20,424 |
qemu | 24f3902b088cd4f2dbebfd90527b5d81d6a050e9 | 1 | void qmp_migrate(const char *uri, bool has_blk, bool blk,
bool has_inc, bool inc, bool has_detach, bool detach,
Error **errp)
{
Error *local_err = NULL;
MigrationState *s = migrate_get_current();
MigrationParams params;
const char *p;
params.blk = has_blk ... | 20,426 |
FFmpeg | 1181d93231e9b807965724587d363c1cfd5a1d0d | 0 | static void avc_luma_hv_qrt_and_aver_dst_16x16_msa(const uint8_t *src_x,
const uint8_t *src_y,
int32_t src_stride,
uint8_t *dst,
... | 20,427 |
qemu | 22156ab498acf5f8104801148732ae8e83f336a0 | 0 | uint32_t net_checksum_add(int len, uint8_t *buf)
{
uint32_t sum = 0;
int i;
for (i = 0; i < len; i++) {
if (i & 1)
sum += (uint32_t)buf[i];
else
sum += (uint32_t)buf[i] << 8;
}
return sum;
}
| 20,428 |
qemu | b2bedb214469af55179d907a60cd67fed6b0779e | 0 | static uint32_t hpet_ram_readl(void *opaque, target_phys_addr_t addr)
{
HPETState *s = opaque;
uint64_t cur_tick, index;
DPRINTF("qemu: Enter hpet_ram_readl at %" PRIx64 "\n", addr);
index = addr;
/*address range of all TN regs*/
if (index >= 0x100 && index <= 0x3ff) {
uint8_t ... | 20,429 |
qemu | 42a268c241183877192c376d03bd9b6d527407c7 | 0 | static void gen_jump(DisasContext *dc, uint32_t imm, uint32_t reg, uint32_t op0)
{
target_ulong tmp_pc;
/* N26, 26bits imm */
tmp_pc = sign_extend((imm<<2), 26) + dc->pc;
switch (op0) {
case 0x00: /* l.j */
tcg_gen_movi_tl(jmp_pc, tmp_pc);
break;
case 0x01: /* ... | 20,430 |
qemu | 32bafa8fdd098d52fbf1102d5a5e48d29398c0aa | 0 | static int net_init_nic(const NetClientOptions *opts, const char *name,
NetClientState *peer, Error **errp)
{
int idx;
NICInfo *nd;
const NetLegacyNicOptions *nic;
assert(opts->type == NET_CLIENT_OPTIONS_KIND_NIC);
nic = opts->u.nic;
idx = nic_get_free_idx();
... | 20,431 |
FFmpeg | 6a6bc43f5f79587b8936334cc0b3a6616f4807ac | 0 | static int dxtory_decode_v2_410(AVCodecContext *avctx, AVFrame *pic,
const uint8_t *src, int src_size)
{
GetByteContext gb;
GetBitContext gb2;
int nslices, slice, slice_height, ref_slice_height;
int cur_y, next_y;
uint32_t off, slice_size;
uint8_t *Y, *U,... | 20,432 |
qemu | d07cc1f12d8e15c167857852c39190d770763824 | 0 | int kvm_irqchip_update_msi_route(KVMState *s, int virq, MSIMessage msg)
{
struct kvm_irq_routing_entry kroute;
if (!kvm_irqchip_in_kernel()) {
return -ENOSYS;
}
kroute.gsi = virq;
kroute.type = KVM_IRQ_ROUTING_MSI;
kroute.flags = 0;
kroute.u.msi.address_lo = (uint32_t)ms... | 20,435 |
qemu | 4be746345f13e99e468c60acbd3a355e8183e3ce | 0 | type_init(pflash_cfi01_register_types)
pflash_t *pflash_cfi01_register(hwaddr base,
DeviceState *qdev, const char *name,
hwaddr size,
BlockDriverState *bs,
uint32_t sector_len, int nb_b... | 20,437 |
qemu | 5fb6c7a8b26eab1a22207d24b4784bd2b39ab54b | 0 | static void vnc_write_u16(VncState *vs, uint16_t value)
{
uint8_t buf[2];
buf[0] = (value >> 8) & 0xFF;
buf[1] = value & 0xFF;
vnc_write(vs, buf, 2);
}
| 20,438 |
qemu | be968c721ee9df49708691ab58f0e66b394dea82 | 0 | type_init(assign_register_types)
static void assigned_dev_load_option_rom(AssignedDevice *dev)
{
int size = 0;
pci_assign_dev_load_option_rom(&dev->dev, OBJECT(dev), &size,
dev->host.domain, dev->host.bus,
dev->host.slot, dev->host.... | 20,439 |
qemu | ef0e64a9838c0a20b5cb8a0bd2dcbcc59b0b812d | 0 | static void ide_issue_trim_cb(void *opaque, int ret)
{
TrimAIOCB *iocb = opaque;
if (ret >= 0) {
while (iocb->j < iocb->qiov->niov) {
int j = iocb->j;
while (++iocb->i < iocb->qiov->iov[j].iov_len / 8) {
int i = iocb->i;
uint64_t *buffer = ... | 20,440 |
qemu | 1510168e273a12a56e3bd4488b4b2904f5138e09 | 0 | static void usbredir_device_disconnect(void *priv)
{
USBRedirDevice *dev = priv;
int i;
/* Stop any pending attaches */
qemu_del_timer(dev->attach_timer);
if (dev->dev.attached) {
usb_device_detach(&dev->dev);
/*
* Delay next usb device attach to give the guest ... | 20,441 |
qemu | b2bedb214469af55179d907a60cd67fed6b0779e | 0 | static void pm_write_config(PCIDevice *d,
uint32_t address, uint32_t val, int len)
{
DPRINTF("pm_write_config address 0x%x val 0x%x len 0x%x \n",
address, val, len);
pci_default_write_config(d, address, val, len);
}
| 20,442 |
FFmpeg | 332f9ac4e31ce5e6d0c42ac9e0229d7d1b2b4d60 | 0 | static int rv20_decode_picture_header(MpegEncContext *s)
{
int seq, mb_pos, i;
i= get_bits(&s->gb, 2);
switch(i){
case 0: s->pict_type= I_TYPE; break;
case 1: s->pict_type= I_TYPE; break; //hmm ...
case 2: s->pict_type= P_TYPE; break;
case 3: s->pict_type= B_TYPE; break;
defau... | 20,443 |
qemu | 3f66f764ee25f10d3e1144ebc057a949421b7728 | 0 | static void test_visitor_in_union_flat(TestInputVisitorData *data,
const void *unused)
{
Visitor *v;
Error *err = NULL;
UserDefFlatUnion *tmp;
UserDefUnionBase *base;
v = visitor_input_test_init(data,
"{ 'enum1': 'value... | 20,445 |
qemu | fd56e0612b6454a282fa6a953fdb09281a98c589 | 0 | static void s390_pcihost_hot_unplug(HotplugHandler *hotplug_dev,
DeviceState *dev, Error **errp)
{
PCIDevice *pci_dev = NULL;
PCIBus *bus;
int32_t devfn;
S390PCIBusDevice *pbdev = NULL;
S390pciState *s = s390_get_phb();
if (object_dynamic_cast(OBJECT... | 20,446 |
FFmpeg | 89bcb77726e222aee9d8536f0310d805f7d39fac | 1 | static int parse_presentation_segment(AVCodecContext *avctx,
const uint8_t *buf, int buf_size,
int64_t pts)
{
PGSSubContext *ctx = avctx->priv_data;
int i, state, ret;
// Video descriptor
int w = bytestream_get_be16(&b... | 20,447 |
FFmpeg | 7d89f7cbf3ccd98f9a5f58db97effa9afd2d571a | 1 | static int crypto_close(URLContext *h)
{
CryptoContext *c = h->priv_data;
if (c->hd)
ffurl_close(c->hd);
av_freep(&c->aes);
av_freep(&c->key);
av_freep(&c->iv);
return 0;
}
| 20,448 |
FFmpeg | a115eb9e750543f1d8bf951414d291069bf396c2 | 1 | static int mimic_decode_frame(AVCodecContext *avctx, void *data,
int *got_frame, AVPacket *avpkt)
{
const uint8_t *buf = avpkt->data;
int buf_size = avpkt->size;
int swap_buf_size = buf_size - MIMIC_HEADER_SIZE;
MimicContext *ctx = avctx->priv_data;
GetBy... | 20,449 |
qemu | 4871b51b9241b10f4fd8e04bbb21577886795e25 | 1 | static void vmgenid_set_guid_auto_test(void)
{
const char *cmd;
QemuUUID measured;
cmd = "-machine accel=tcg -device vmgenid,id=testvgid," "guid=auto";
qtest_start(cmd);
read_guid_from_memory(&measured);
/* Just check that the GUID is non-null */
g_assert(!qemu_uuid_is_null(&me... | 20,450 |
qemu | d8633620a112296fcf6a6ae9a1cbba614c0ca502 | 1 | static TCGv gen_lea_indexed(CPUM68KState *env, DisasContext *s, TCGv base)
{
uint32_t offset;
uint16_t ext;
TCGv add;
TCGv tmp;
uint32_t bd, od;
offset = s->pc;
ext = cpu_lduw_code(env, s->pc);
s->pc += 2;
if ((ext & 0x800) == 0 && !m68k_feature(s->env, M68K_FEATURE_WORD_INDEX))
... | 20,451 |
FFmpeg | 3fa8f263abf90650b62d43cb532cdb8cc5bd7c13 | 1 | int swr_convert_frame(SwrContext *s,
AVFrame *out, const AVFrame *in)
{
int ret, setup = 0;
if (!swr_is_initialized(s)) {
if ((ret = swr_config_frame(s, out, in)) < 0)
return ret;
if ((ret = swr_init(s)) < 0)
return ret;
setup = 1;... | 20,452 |
FFmpeg | 41b68dce4d148b6a227d001b32deb275c01aa550 | 0 | av_cold static int fbdev_read_header(AVFormatContext *avctx,
AVFormatParameters *ap)
{
FBDevContext *fbdev = avctx->priv_data;
AVStream *st = NULL;
enum PixelFormat pix_fmt;
int ret, flags = O_RDONLY;
ret = av_parse_video_rate(&fbdev->framerate_q, fbdev-... | 20,453 |
qemu | b9403979b5c51d42018f40bf568d07519edb992e | 1 | static abi_long target_to_host_data_route(struct nlmsghdr *nlh)
{
struct ifinfomsg *ifi;
struct ifaddrmsg *ifa;
struct rtmsg *rtm;
switch (nlh->nlmsg_type) {
case RTM_GETLINK:
break;
case RTM_NEWLINK:
case RTM_DELLINK:
ifi = NLMSG_DATA(nlh);
ifi->ifi_type... | 20,454 |
qemu | d9bce9d99f4656ae0b0127f7472db9067b8f84ab | 1 | PPC_OP(cmp)
{
if (Ts0 < Ts1) {
T0 = 0x08;
} else if (Ts0 > Ts1) {
T0 = 0x04;
} else {
T0 = 0x02;
}
RETURN();
}
| 20,456 |
FFmpeg | efbf107f5b28866d2e82701484e2859f5aa77e6d | 1 | static int parse_channel_expressions(AVFilterContext *ctx,
int expected_nb_channels)
{
EvalContext *eval = ctx->priv;
char *args1 = av_strdup(eval->exprs);
char *expr, *last_expr, *buf;
double (* const *func1)(void *, double) = NULL;
const char * const *fu... | 20,458 |
FFmpeg | b425b81fd2040f173051efc0f1413f2101ba993e | 1 | static int sdp_probe(AVProbeData *p1)
{
const char *p = p1->buf, *p_end = p1->buf + p1->buf_size;
/* we look for a line beginning "c=IN IP" */
while (p < p_end && *p != '\0') {
if (p + sizeof("c=IN IP") - 1 < p_end &&
av_strstart(p, "c=IN IP", NULL))
return AVPROBE_S... | 20,459 |
FFmpeg | fec9ccb7e6fdc6844b1e2d1bb95436b36f47a412 | 0 | int avcodec_decode_audio(AVCodecContext *avctx, int16_t *samples,
int *frame_size_ptr,
uint8_t *buf, int buf_size)
{
int ret;
*frame_size_ptr= 0;
ret = avctx->codec->decode(avctx, samples, frame_size_ptr,
buf, buf_si... | 20,460 |
FFmpeg | 1c46e53dcc685593eaa0d730f263ec95c16a5da8 | 0 | static int mpeg4_unpack_bframes_filter(AVBSFContext *ctx, AVPacket *out)
{
UnpackBFramesBSFContext *s = ctx->priv_data;
int pos_p = -1, nb_vop = 0, pos_vop2 = -1, ret = 0;
AVPacket *in;
ret = ff_bsf_get_packet(ctx, &in);
if (ret < 0)
return ret;
scan_buffer(in->data, in->size... | 20,461 |
FFmpeg | 24327706e173c86ad7738dd9c21f214cc78cd8d1 | 1 | static int set_string_number(void *obj, void *target_obj, const AVOption *o, const char *val, void *dst)
{
int ret = 0;
int num, den;
char c;
if (sscanf(val, "%d%*1[:/]%d%c", &num, &den, &c) == 2) {
if ((ret = write_number(obj, o, dst, 1, den, num)) >= 0)
return ret;
... | 20,462 |
qemu | 15c2f669e3fb2bc97f7b42d1871f595c0ac24af8 | 1 | static void qmp_input_pop(QmpInputVisitor *qiv, Error **errp)
{
StackObject *tos = &qiv->stack[qiv->nb_stack - 1];
assert(qiv->nb_stack > 0);
if (qiv->strict) {
GHashTable *const top_ht = tos->h;
if (top_ht) {
GHashTableIter iter;
const char *key;
... | 20,463 |
qemu | aec4b054ea36c53c8b887da99f20010133b84378 | 1 | static void large_dict(void)
{
GString *gstr = g_string_new("");
QObject *obj;
gen_test_json(gstr, 10, 100);
obj = qobject_from_json(gstr->str, NULL);
g_assert(obj != NULL);
qobject_decref(obj);
g_string_free(gstr, true);
}
| 20,464 |
qemu | b68cb06093a36bd6fbd4d06cd62c08629fea2242 | 1 | static uint32_t m25p80_transfer8(SSISlave *ss, uint32_t tx)
{
Flash *s = M25P80(ss);
uint32_t r = 0;
switch (s->state) {
case STATE_PAGE_PROGRAM:
DB_PRINT_L(1, "page program cur_addr=%#" PRIx64 " data=%" PRIx8 "\n",
s->cur_addr, (uint8_t)tx);
flash_write8(s... | 20,465 |
qemu | 3604a76fea6ff37738d4a8f596be38407be74a83 | 1 | static void dec_scall(DisasContext *dc)
{
if (dc->imm5 == 7) {
LOG_DIS("scall\n");
} else if (dc->imm5 == 2) {
LOG_DIS("break\n");
} else {
cpu_abort(dc->env, "invalid opcode\n");
}
if (dc->imm5 == 7) {
tcg_gen_movi_tl(cpu_pc, dc->pc);
t_gen_raise... | 20,466 |
qemu | 4f4321c11ff6e98583846bfd6f0e81954924b003 | 1 | static int ohci_service_iso_td(OHCIState *ohci, struct ohci_ed *ed,
int completion)
{
int dir;
size_t len = 0;
#ifdef DEBUG_ISOCH
const char *str = NULL;
#endif
int pid;
int ret;
int i;
USBDevice *dev;
struct ohci_iso_td iso_td;
uint32_t ad... | 20,468 |
qemu | ad0ebb91cd8b5fdc4a583b03645677771f420a46 | 1 | int spapr_vio_send_crq(VIOsPAPRDevice *dev, uint8_t *crq)
{
int rc;
uint8_t byte;
if (!dev->crq.qsize) {
fprintf(stderr, "spapr_vio_send_creq on uninitialized queue\n");
return -1;
}
/* Maybe do a fast path for KVM just writing to the pages */
rc = spapr_tce_dma_read... | 20,469 |
qemu | 5c0ba1be37181bd8a7c96c7f81b19ae5f8e66e2d | 1 | static void vhost_log_put(struct vhost_dev *dev, bool sync)
{
struct vhost_log *log = dev->log;
if (!log) {
return;
}
dev->log = NULL;
dev->log_size = 0;
--log->refcnt;
if (log->refcnt == 0) {
/* Sync only the range covered by the old log */
if (dev->lo... | 20,470 |
qemu | f3e4ce4af336f2ea306fa0f40ec1a5149864ca8c | 1 | static void mirror_set_speed(BlockJob *job, int64_t speed, Error **errp)
{
MirrorBlockJob *s = container_of(job, MirrorBlockJob, common);
if (speed < 0) {
error_setg(errp, QERR_INVALID_PARAMETER, "speed");
return;
}
ratelimit_set_speed(&s->limit, speed / BDRV_SECTOR_SIZE, SLICE_... | 20,473 |
qemu | 1ee24514aed34760fb2863d98bea3a1b705d9c9f | 1 | static uint16_t nvme_map_prp(QEMUSGList *qsg, QEMUIOVector *iov, uint64_t prp1,
uint64_t prp2, uint32_t len, NvmeCtrl *n)
{
hwaddr trans_len = n->page_size - (prp1 % n->page_size);
trans_len = MIN(len, trans_len);
int num_prps = (len >> n->page_bits) + 1;
if (!prp1) ... | 20,474 |
FFmpeg | 1171d938af219aa1217a472391bc392f6e698386 | 1 | static int init_input(AVFormatContext *s, const char *filename, AVDictionary **options)
{
int ret;
AVProbeData pd = {filename, NULL, 0};
if(s->iformat && !strlen(filename))
return 0;
if (s->pb) {
s->flags |= AVFMT_FLAG_CUSTOM_IO;
if (!s->iformat)
return a... | 20,475 |
qemu | 9bd8e9330ade42878b19a5172131087220d590d5 | 1 | static GuestPCIAddress *get_pci_info(char *guid, Error **errp)
{
HDEVINFO dev_info;
SP_DEVINFO_DATA dev_info_data;
DWORD size = 0;
int i;
char dev_name[MAX_PATH];
char *buffer = NULL;
GuestPCIAddress *pci = NULL;
char *name = g_strdup(&guid[4]);
if (!QueryDosDevice(name, ... | 20,476 |
qemu | 95a5befc2f8b359e72926f89cd661d063c2cf06c | 1 | int target_get_monitor_def(CPUState *cs, const char *name, uint64_t *pval)
{
int i, regnum;
PowerPCCPU *cpu = POWERPC_CPU(cs);
CPUPPCState *env = &cpu->env;
/* General purpose registers */
if ((tolower(name[0]) == 'r') &&
ppc_cpu_get_reg_num(name + 1, ARRAY_SIZE(env->gpr), ®num))... | 20,477 |
qemu | d9bce9d99f4656ae0b0127f7472db9067b8f84ab | 1 | PPC_OP(update_nip)
{
env->nip = PARAM(1);
RETURN();
}
| 20,479 |
FFmpeg | 863522431fb2fc7d35fce582fcaacdcf37fc3c44 | 1 | static int mpeg1_decode_sequence(AVCodecContext *avctx,
const uint8_t *buf, int buf_size)
{
Mpeg1Context *s1 = avctx->priv_data;
MpegEncContext *s = &s1->mpeg_enc_ctx;
int width, height;
int i, v, j;
init_get_bits(&s->gb, buf, buf_size * 8);
width =... | 20,481 |
qemu | c53af37f375ce9c4999ff451c51173bdc1167e67 | 1 | static void vnc_async_encoding_end(VncState *orig, VncState *local)
{
orig->tight = local->tight;
orig->zlib = local->zlib;
orig->hextile = local->hextile;
orig->zrle = local->zrle;
orig->lossy_rect = local->lossy_rect;
} | 20,482 |
FFmpeg | a38e9797cb4123d13ba871d166a737786ba04a9b | 1 | static int s302m_decode_frame(AVCodecContext *avctx, void *data,
int *got_frame_ptr, AVPacket *avpkt)
{
S302Context *s = avctx->priv_data;
AVFrame *frame = data;
const uint8_t *buf = avpkt->data;
int buf_size = avpkt->size;
int block_size, ret;
int... | 20,483 |
qemu | cdbf6e165988ab9d7c01da03b9e27bb8ac0c76aa | 0 | static gboolean tcp_chr_read(GIOChannel *chan, GIOCondition cond, void *opaque)
{
CharDriverState *chr = opaque;
TCPCharDriver *s = chr->opaque;
uint8_t buf[READ_BUF_LEN];
int len, size;
if (!s->connected || s->max_size <= 0) {
return FALSE;
}
len = sizeof(buf);
if (l... | 20,484 |
qemu | f17fd4fdf0df3d2f3444399d04c38d22b9a3e1b7 | 0 | static void ivshmem_realize(PCIDevice *dev, Error **errp)
{
IVShmemState *s = IVSHMEM_COMMON(dev);
if (!qtest_enabled()) {
error_report("ivshmem is deprecated, please use ivshmem-plain"
" or ivshmem-doorbell instead");
}
if (!!qemu_chr_fe_get_driver(&s->server_chr... | 20,486 |
qemu | 91b0a8f33419573c1d741e49559bfb666fd8b1f0 | 0 | void css_conditional_io_interrupt(SubchDev *sch)
{
/*
* If the subchannel is not currently status pending, make it pending
* with alert status.
*/
if (!(sch->curr_status.scsw.ctrl & SCSW_STCTL_STATUS_PEND)) {
S390CPU *cpu = s390_cpu_addr2state(0);
uint8_t isc = (sch->curr_... | 20,487 |
qemu | 7d48a0f7217474899c5f5920b21f4cfdf4efa8d1 | 0 | int load_image_gzipped(const char *filename, hwaddr addr, uint64_t max_sz)
{
uint8_t *compressed_data = NULL;
uint8_t *data = NULL;
gsize len;
ssize_t bytes;
int ret = -1;
if (!g_file_get_contents(filename, (char **) &compressed_data, &len,
NULL)) {
... | 20,488 |
qemu | 47d3df2387ed6927732584ffa4159c26d9f4dee8 | 0 | static ioreq_t *cpu_get_ioreq_from_shared_memory(XenIOState *state, int vcpu)
{
ioreq_t *req = xen_vcpu_ioreq(state->shared_page, vcpu);
if (req->state != STATE_IOREQ_READY) {
DPRINTF("I/O request not ready: "
"%x, ptr: %x, port: %"PRIx64", "
"data: %"PRIx64", cou... | 20,489 |
qemu | 4b5d5e87c7ab2e979a2cad6c8e01bcae55b85f1c | 0 | static void vfio_pci_write_config(PCIDevice *pdev, uint32_t addr,
uint32_t val, int len)
{
VFIODevice *vdev = DO_UPCAST(VFIODevice, pdev, pdev);
uint32_t val_le = cpu_to_le32(val);
DPRINTF("%s(%04x:%02x:%02x.%x, @0x%x, 0x%x, len=0x%x)\n", __func__,
vdev-... | 20,490 |
qemu | 78fb328e854542d79bebe54f3a426cba6d46dbf1 | 0 | static int check_refblocks(BlockDriverState *bs, BdrvCheckResult *res,
BdrvCheckMode fix, uint16_t **refcount_table,
int64_t *nb_clusters)
{
BDRVQcowState *s = bs->opaque;
int64_t i;
for(i = 0; i < s->refcount_table_size; i++) {
uint64_t... | 20,491 |
qemu | 18b21a2f83a26c3d6a9e7f0bdc4e8eb2b177e8f6 | 0 | static void gen_lwarx(DisasContext *ctx)
{
TCGv t0;
gen_set_access_type(ctx, ACCESS_RES);
t0 = tcg_temp_local_new();
gen_addr_reg_index(ctx, t0);
gen_check_align(ctx, t0, 0x03);
gen_qemu_ld32u(ctx, cpu_gpr[rD(ctx->opcode)], t0);
tcg_gen_mov_tl(cpu_reserve, t0);
tcg_temp_free(t0)... | 20,492 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.