project stringclasses 2
values | commit_id stringlengths 40 40 | target int64 0 1 | func stringlengths 26 142k | idx int64 0 27.3k |
|---|---|---|---|---|
qemu | 306a06e5f766acaf26b71397a5692c65b65a61c7 | 0 | block_crypto_open_opts_init(QCryptoBlockFormat format,
QemuOpts *opts,
Error **errp)
{
Visitor *v;
QCryptoBlockOpenOptions *ret = NULL;
Error *local_err = NULL;
ret = g_new0(QCryptoBlockOpenOptions, 1);
ret->format = format;
v ... | 14,810 |
qemu | 42a268c241183877192c376d03bd9b6d527407c7 | 0 | gen_intermediate_code_internal(CRISCPU *cpu, TranslationBlock *tb,
bool search_pc)
{
CPUState *cs = CPU(cpu);
CPUCRISState *env = &cpu->env;
uint32_t pc_start;
unsigned int insn_len;
int j, lj;
struct DisasContext ctx;
struct DisasContext *dc = &ctx;
... | 14,811 |
qemu | f090c9d4ad5812fb92843d6470a1111c15190c4c | 0 | uint64_t float64_to_uint64_round_to_zero (float64 a STATUS_PARAM)
{
int64_t v;
v = int64_to_float64(INT64_MIN STATUS_VAR);
v = float64_to_int64_round_to_zero((a + v) STATUS_VAR);
return v - INT64_MIN;
}
| 14,812 |
qemu | 259342d34dbdfb304374f569feec26317edd97c9 | 1 | static AHCIQState *ahci_boot(void)
{
AHCIQState *s;
const char *cli;
s = g_malloc0(sizeof(AHCIQState));
cli = "-drive if=none,id=drive0,file=%s,cache=writeback,serial=%s"
",format=raw"
" -M q35 "
"-device ide-hd,drive=drive0 "
"-global ide-hd.ver=%s";
s-... | 14,815 |
FFmpeg | bd6610c3b39e24ff3c3745cdfc5c69450bc7b0e5 | 1 | static inline int parse_nal_units(AVCodecParserContext *s, const uint8_t *buf,
int buf_size, AVCodecContext *avctx)
{
HEVCParserContext *ctx = s->priv_data;
HEVCContext *h = &ctx->h;
GetBitContext *gb;
SliceHeader *sh = &h->sh;
HEVCParamSets *ps ... | 14,817 |
FFmpeg | 7cc84d241ba6ef8e27e4d057176a4ad385ad3d59 | 1 | static void decode_colskip(uint8_t* plane, int width, int height, int stride, VC9Context *v){
int x, y;
GetBitContext *gb = &v->s.gb;
for (x=0; x<width; x++){
if (!get_bits(gb, 1)) //colskip
for (y=0; y<height; y++)
plane[y*stride] = 0;
else
... | 14,820 |
qemu | faf7aaa9183d5f2029ada291837a8716e9be127b | 1 | gen_intermediate_code_internal (CPUState *env, TranslationBlock *tb,
int search_pc)
{
DisasContext ctx;
target_ulong pc_start;
uint16_t *gen_opc_end;
int j, lj = -1;
if (search_pc && loglevel)
fprintf (logfile, "search pc %d\n", search_pc);
pc... | 14,821 |
qemu | ddcb73b7782cb6104479503faea04cc224f982b5 | 1 | e1000_autoneg_timer(void *opaque)
{
E1000State *s = opaque;
qemu_get_queue(s->nic)->link_down = false;
e1000_link_up(s);
s->phy_reg[PHY_STATUS] |= MII_SR_AUTONEG_COMPLETE;
DBGOUT(PHY, "Auto negotiation is completed\n");
}
| 14,824 |
qemu | e0ef439588ce1ede747f82b77d893190c1cc9f4d | 1 | blkdebug_co_pwritev(BlockDriverState *bs, uint64_t offset, uint64_t bytes,
QEMUIOVector *qiov, int flags)
{
BDRVBlkdebugState *s = bs->opaque;
BlkdebugRule *rule = NULL;
QSIMPLEQ_FOREACH(rule, &s->active_rules, active_next) {
uint64_t inject_offset = rule->options.inject.offset;
... | 14,825 |
FFmpeg | 5a446bc88e49cc6400d0c646ca1eb540a727c9de | 1 | static void vc1_h_overlap_c(uint8_t* src, int stride)
{
int i;
int a, b, c, d;
int d1, d2;
int rnd = 1;
for(i = 0; i < 8; i++) {
a = src[-2];
b = src[-1];
c = src[0];
d = src[1];
d1 = (a - d + 3 + rnd) >> 3;
d2 = (a - d + b - c + 4 - rnd) >... | 14,826 |
FFmpeg | b4eb06d32535958d71568503cf886f448a5164ed | 1 | int ff_msmpeg4_decode_block(MpegEncContext * s, int16_t * block,
int n, int coded, const uint8_t *scan_table)
{
int level, i, last, run, run_diff;
int av_uninit(dc_pred_dir);
RLTable *rl;
RL_VLC_ELEM *rl_vlc;
int qmul, qadd;
if (s->mb_intra) {
qmu... | 14,827 |
FFmpeg | 7b588bb691644e1b3c168b99accf74248a24e3cf | 1 | static int svq1_decode_frame(AVCodecContext *avctx, void *data,
int *got_frame, AVPacket *avpkt)
{
const uint8_t *buf = avpkt->data;
int buf_size = avpkt->size;
SVQ1Context *s = avctx->priv_data;
AVFrame *cur = data;
uint8_t *current;
int resu... | 14,828 |
qemu | 549ce59e2b9ed7f41d2f88524bd5e01b0d7db2e9 | 0 | static void pci_get_node_name(char *nodename, int len, PCIDevice *dev)
{
int slot = PCI_SLOT(dev->devfn);
int func = PCI_FUNC(dev->devfn);
uint32_t ccode = pci_default_read_config(dev, PCI_CLASS_PROG, 3);
const char *name;
name = pci_find_device_name((ccode >> 16) & 0xff, (ccode >> 8) & 0xff... | 14,830 |
qemu | 4a1418e07bdcfaa3177739e04707ecaec75d89e1 | 0 | void kqemu_flush_page(CPUState *env, target_ulong addr)
{
LOG_INT("kqemu_flush_page: addr=" TARGET_FMT_lx "\n", addr);
if (nb_pages_to_flush >= KQEMU_MAX_PAGES_TO_FLUSH)
nb_pages_to_flush = KQEMU_FLUSH_ALL;
else
pages_to_flush[nb_pages_to_flush++] = addr;
}
| 14,831 |
qemu | 3b22c4707decb706b10ce023534f8b79413ff9fe | 0 | void helper_lcall_real_T0_T1(int shift, int next_eip)
{
int new_cs, new_eip;
uint32_t esp, esp_mask;
uint8_t *ssp;
new_cs = T0;
new_eip = T1;
esp = env->regs[R_ESP];
esp_mask = 0xffffffff;
if (!(env->segs[R_SS].flags & DESC_B_MASK))
esp_mask = 0xffff;
ssp = env->... | 14,832 |
qemu | 891fb2cd4592b6fe76106a69e0ca40efbf82726a | 0 | static void handle_port_owner_write(EHCIState *s, int port, uint32_t owner)
{
USBDevice *dev = s->ports[port].dev;
uint32_t *portsc = &s->portsc[port];
uint32_t orig;
if (s->companion_ports[port] == NULL)
return;
owner = owner & PORTSC_POWNER;
orig = *portsc & PORTSC_POWNER;... | 14,833 |
qemu | b3db211f3c80bb996a704d665fe275619f728bd4 | 0 | static void test_visitor_out_native_list_str(TestOutputVisitorData *data,
const void *unused)
{
test_native_list(data, unused, USER_DEF_NATIVE_LIST_UNION_KIND_STRING);
}
| 14,834 |
qemu | a0efbf16604770b9d805bcf210ec29942321134f | 0 | PCIBus *i440fx_init(const char *host_type, const char *pci_type,
PCII440FXState **pi440fx_state,
int *piix3_devfn,
ISABus **isa_bus, qemu_irq *pic,
MemoryRegion *address_space_mem,
MemoryRegion *address_space_io,
... | 14,835 |
qemu | bd269ebc82fbaa5fe7ce5bc7c1770ac8acecd884 | 0 | void qio_channel_socket_connect_async(QIOChannelSocket *ioc,
SocketAddressLegacy *addr,
QIOTaskFunc callback,
gpointer opaque,
GDestroyNotify destroy)
{
QIOTa... | 14,836 |
FFmpeg | d6604b29ef544793479d7fb4e05ef6622bb3e534 | 0 | static av_cold int targa_encode_close(AVCodecContext *avctx)
{
av_frame_free(&avctx->coded_frame);
return 0;
}
| 14,837 |
qemu | 5fb6c7a8b26eab1a22207d24b4784bd2b39ab54b | 0 | static int vnc_set_x509_credential_dir(VncDisplay *vs,
const char *certdir)
{
if (vnc_set_x509_credential(vs, certdir, X509_CA_CERT_FILE, &vs->x509cacert, 0) < 0)
goto cleanup;
if (vnc_set_x509_credential(vs, certdir, X509_CA_CRL_FILE, &vs->x509cacrl, 1) < 0)
goto cleanup;
if (vnc_set_x5... | 14,838 |
qemu | 47d3df2387ed6927732584ffa4159c26d9f4dee8 | 0 | static inline uint32_t xen_vcpu_eport(shared_iopage_t *shared_page, int i)
{
return shared_page->vcpu_iodata[i].vp_eport;
}
| 14,839 |
qemu | 61007b316cd71ee7333ff7a0a749a8949527575f | 0 | int bdrv_flush_all(void)
{
BlockDriverState *bs = NULL;
int result = 0;
while ((bs = bdrv_next(bs))) {
AioContext *aio_context = bdrv_get_aio_context(bs);
int ret;
aio_context_acquire(aio_context);
ret = bdrv_flush(bs);
if (ret < 0 && !result) {
... | 14,841 |
qemu | 9bf3eb2ca542dd9306cb2e72fc68e02ba3e56e2e | 0 | static inline void gen_movcf_s (int fs, int fd, int cc, int tf)
{
uint32_t ccbit;
int cond;
TCGv r_tmp1 = tcg_temp_local_new(TCG_TYPE_I32);
TCGv fp0 = tcg_temp_local_new(TCG_TYPE_I32);
TCGv fp1 = tcg_temp_local_new(TCG_TYPE_I32);
int l1 = gen_new_label();
if (cc)
ccbit = 1... | 14,843 |
qemu | f7c11b535040df31cc8bc3b1f0c33f546073ee62 | 0 | static void notdirty_mem_writel(void *opaque, target_phys_addr_t ram_addr,
uint32_t val)
{
int dirty_flags;
dirty_flags = phys_ram_dirty[ram_addr >> TARGET_PAGE_BITS];
if (!(dirty_flags & CODE_DIRTY_FLAG)) {
#if !defined(CONFIG_USER_ONLY)
tb_invalidate_phys_pag... | 14,844 |
qemu | c9e9e9c66cee9932fb28a41a4659aa421a7a3f78 | 0 | static void qcow2_invalidate_cache(BlockDriverState *bs, Error **errp)
{
BDRVQcow2State *s = bs->opaque;
int flags = s->flags;
QCryptoCipher *cipher = NULL;
QDict *options;
Error *local_err = NULL;
int ret;
/*
* Backing files are read-only which makes all of their metadata im... | 14,845 |
qemu | 27a69bb088bee6d4efea254659422fb9c751b3c7 | 0 | static inline void gen_evmwumiaa(DisasContext *ctx)
{
TCGv_i64 acc;
TCGv_i64 tmp;
if (unlikely(!ctx->spe_enabled)) {
gen_exception(ctx, POWERPC_EXCP_APU);
return;
}
gen_evmwumi(ctx); /* rD := rA * rB */
acc = tcg_temp_new_i64();
tmp = tcg_temp_new_i6... | 14,847 |
qemu | 72cf2d4f0e181d0d3a3122e04129c58a95da713e | 0 | void qemu_system_reset(void)
{
QEMUResetEntry *re, *nre;
/* reset all devices */
TAILQ_FOREACH_SAFE(re, &reset_handlers, entry, nre) {
re->func(re->opaque);
}
}
| 14,849 |
qemu | 55274a30522d0f542c1659386f01096b78669455 | 0 | static int cpu_can_run(CPUState *env)
{
if (env->stop)
return 0;
if (env->stopped)
return 0;
if (!vm_running)
return 0;
return 1;
}
| 14,851 |
qemu | 6aff24c6a61c6fec31e555c7748ba6085b7b2c06 | 0 | static void cpu_common_parse_features(const char *typename, char *features,
Error **errp)
{
char *featurestr; /* Single "key=value" string being parsed */
char *val;
static bool cpu_globals_initialized;
/* TODO: all callers of ->parse_features() need to be c... | 14,852 |
qemu | fd56e0612b6454a282fa6a953fdb09281a98c589 | 0 | static void ich9_lpc_update_apic(ICH9LPCState *lpc, int gsi)
{
int level = 0;
assert(gsi >= ICH9_LPC_PIC_NUM_PINS);
level |= pci_bus_get_irq_level(lpc->d.bus, ich9_gsi_to_pirq(gsi));
if (gsi == lpc->sci_gsi) {
level |= lpc->sci_level;
}
qemu_set_irq(lpc->gsi[gsi], level);
... | 14,853 |
qemu | 380feaffb0fcc8e5f615ed8e86d2e93717a6f2c6 | 0 | static int32_t scsi_disk_emulate_command(SCSIRequest *req, uint8_t *buf)
{
SCSIDiskReq *r = DO_UPCAST(SCSIDiskReq, req, req);
SCSIDiskState *s = DO_UPCAST(SCSIDiskState, qdev, req->dev);
uint64_t nb_sectors;
uint8_t *outbuf;
int buflen;
switch (req->cmd.buf[0]) {
case INQUIRY:
... | 14,855 |
qemu | b3db211f3c80bb996a704d665fe275619f728bd4 | 0 | static void qmp_input_start_list(Visitor *v, const char *name,
GenericList **list, size_t size, Error **errp)
{
QmpInputVisitor *qiv = to_qiv(v);
QObject *qobj = qmp_input_get_object(qiv, name, true, errp);
const QListEntry *entry;
if (!qobj) {
return;
... | 14,856 |
qemu | 04095e5ff305fc25a214b52e005153af9d009d66 | 0 | static int pci_e1000_init(PCIDevice *pci_dev)
{
E1000State *d = DO_UPCAST(E1000State, dev, pci_dev);
uint8_t *pci_conf;
uint16_t checksum = 0;
int i;
uint8_t *macaddr;
pci_conf = d->dev.config;
pci_config_set_vendor_id(pci_conf, PCI_VENDOR_ID_INTEL);
pci_config_set_device_id... | 14,857 |
qemu | c2b38b277a7882a592f4f2ec955084b2b756daaa | 0 | void qemu_clock_notify(QEMUClockType type)
{
QEMUTimerList *timer_list;
QEMUClock *clock = qemu_clock_ptr(type);
QLIST_FOREACH(timer_list, &clock->timerlists, list) {
timerlist_notify(timer_list);
}
}
| 14,858 |
FFmpeg | e3751aa6ec8147ab7ca2649d4daadf8d4dce27d5 | 0 | static void backward_filter(RA288Context *ractx)
{
float temp1[37]; // RTMP in the spec
float temp2[11]; // GPTPMP in the spec
do_hybrid_window(36, 40, 35, ractx->sp_block, temp1, ractx->sp_hist,
ractx->sp_rec, syn_window);
if (!eval_lpc_coeffs(temp1, ractx->sp_lpc, 36))
... | 14,859 |
qemu | 171cd1cdfff32a99855ec80ca8cab43384fe0600 | 0 | int target_mprotect(abi_ulong start, abi_ulong len, int prot)
{
abi_ulong end, host_start, host_end, addr;
int prot1, ret;
#ifdef DEBUG_MMAP
printf("mprotect: start=0x" TARGET_FMT_lx
"len=0x" TARGET_FMT_lx " prot=%c%c%c\n", start, len,
prot & PROT_READ ? 'r' : '-',
... | 14,860 |
qemu | 4fa4ce7107c6ec432f185307158c5df91ce54308 | 0 | static int local_open(FsContext *ctx, V9fsPath *fs_path,
int flags, V9fsFidOpenState *fs)
{
char buffer[PATH_MAX];
char *path = fs_path->data;
fs->fd = open(rpath(ctx, path, buffer), flags | O_NOFOLLOW);
return fs->fd;
}
| 14,861 |
qemu | 9e85cd5ce0d3fc99d910428c9fd9d267764d341b | 0 | void qmp_block_commit(const char *device,
bool has_base, const char *base,
bool has_top, const char *top,
bool has_backing_file, const char *backing_file,
bool has_speed, int64_t speed,
Error **errp)
{
... | 14,862 |
qemu | 2d3735d3bf61d5c8e154a197a11535cc65044334 | 0 | void do_commit(Monitor *mon, const QDict *qdict)
{
const char *device = qdict_get_str(qdict, "device");
BlockDriverState *bs;
if (!strcmp(device, "all")) {
bdrv_commit_all();
} else {
bs = bdrv_find(device);
if (!bs) {
qerror_report(QERR_DEVICE_NOT_FOUND, d... | 14,863 |
qemu | b3db211f3c80bb996a704d665fe275619f728bd4 | 0 | static QmpOutputVisitor *to_qov(Visitor *v)
{
return container_of(v, QmpOutputVisitor, visitor);
}
| 14,864 |
FFmpeg | 6a786b15c34765ec00be3cd808dafbb041fd5881 | 0 | static void vc1_inv_trans_8x8_c(DCTELEM block[64])
{
int i;
register int t1,t2,t3,t4,t5,t6,t7,t8;
DCTELEM *src, *dst, temp[64];
src = block;
dst = temp;
for(i = 0; i < 8; i++){
t1 = 12 * (src[ 0] + src[32]) + 4;
t2 = 12 * (src[ 0] - src[32]) + 4;
t3 = 16 * src... | 14,866 |
FFmpeg | bcd7bf7eeb09a395cc01698842d1b8be9af483fc | 0 | static void avc_loopfilter_luma_intra_edge_ver_msa(uint8_t *data,
uint8_t alpha_in,
uint8_t beta_in,
uint32_t img_width)
{
uint8_t *src;
v16u8 alpha, bet... | 14,867 |
FFmpeg | 190f6135b48a97dadd7586f154640bec6468df1b | 0 | static int dshow_read_packet(AVFormatContext *s, AVPacket *pkt)
{
struct dshow_ctx *ctx = s->priv_data;
AVPacketList *pktl = NULL;
while (!pktl) {
WaitForSingleObject(ctx->mutex, INFINITE);
pktl = ctx->pktl;
if (pktl) {
*pkt = pktl->pkt;
ctx->pktl =... | 14,868 |
FFmpeg | f164228fd793766187ed3e68cb6d6e2fe3e77c04 | 0 | static void blend_image(AVFilterContext *ctx,
AVFilterBufferRef *dst, AVFilterBufferRef *src,
int x, int y)
{
OverlayContext *over = ctx->priv;
int i, j, k;
int width = src->video->w;
int height = src->video->h;
if (over->main_is_packed_rg... | 14,869 |
FFmpeg | 56fc4cf04f9ed878cf8e159981f5d136af807973 | 0 | static void draw_mandelbrot(AVFilterContext *ctx, uint32_t *color, int linesize, int64_t pts)
{
MBContext *mb = ctx->priv;
int x,y,i, in_cidx=0, next_cidx=0, tmp_cidx;
double scale= mb->start_scale*pow(mb->end_scale/mb->start_scale, pts/mb->end_pts);
int use_zyklus=0;
fill_from_cache(ctx, NULL... | 14,871 |
FFmpeg | 6e0d8c06c7af61859e8d7bc2351a607d8abeab75 | 0 | static void opt_mb_qmax(const char *arg)
{
video_mb_qmax = atoi(arg);
if (video_mb_qmax < 0 ||
video_mb_qmax > 31) {
fprintf(stderr, "qmax must be >= 1 and <= 31\n");
exit(1);
}
}
| 14,873 |
FFmpeg | 39d0567737cbce35239dddeabe35ae037cecf362 | 0 | static void create_vorbis_context(venc_context_t * venc, AVCodecContext * avccontext) {
codebook_t * cb;
floor_t * fc;
residue_t * rc;
mapping_t * mc;
int i, book;
venc->channels = avccontext->channels;
venc->sample_rate = avccontext->sample_rate;
venc->blocksize[0] = venc->blo... | 14,874 |
qemu | 3c529d935923a70519557d420db1d5a09a65086a | 0 | static RawAIOCB *raw_aio_setup(BlockDriverState *bs,
int64_t sector_num, uint8_t *buf, int nb_sectors,
BlockDriverCompletionFunc *cb, void *opaque)
{
BDRVRawState *s = bs->opaque;
RawAIOCB *acb;
if (fd_open(bs) < 0)
return NULL;
acb = qemu_aio_get(bs, cb, opaque);
... | 14,875 |
qemu | fd859081453f94c3cbd6527289e41b7fddbf645f | 0 | static uint32_t tpm_tis_data_read(TPMState *s, uint8_t locty)
{
TPMTISEmuState *tis = &s->s.tis;
uint32_t ret = TPM_TIS_NO_DATA_BYTE;
uint16_t len;
if ((tis->loc[locty].sts & TPM_TIS_STS_DATA_AVAILABLE)) {
len = tpm_tis_get_size_from_buffer(&tis->loc[locty].r_buffer);
ret = ti... | 14,876 |
qemu | 9a78eead0c74333a394c0f7bbfc4423ac746fcd5 | 0 | cpu_x86_dump_seg_cache(CPUState *env, FILE *f,
int (*cpu_fprintf)(FILE *f, const char *fmt, ...),
const char *name, struct SegmentCache *sc)
{
#ifdef TARGET_X86_64
if (env->hflags & HF_CS64_MASK) {
cpu_fprintf(f, "%-3s=%04x %016" PRIx64 " %08x %08x", name,... | 14,877 |
qemu | 3dc6f8693694a649a9c83f1e2746565b47683923 | 0 | static int qemu_gluster_parse_uri(BlockdevOptionsGluster *gconf,
const char *filename)
{
SocketAddress *gsconf;
URI *uri;
QueryParams *qp = NULL;
bool is_unix = false;
int ret = 0;
uri = uri_parse(filename);
if (!uri) {
return -EINVAL;
... | 14,878 |
qemu | c4d9d19645a484298a67e9021060bc7c2b081d0f | 0 | static BlockDriverAIOCB *paio_submit(BlockDriverState *bs, HANDLE hfile,
int64_t sector_num, QEMUIOVector *qiov, int nb_sectors,
BlockDriverCompletionFunc *cb, void *opaque, int type)
{
RawWin32AIOData *acb = g_slice_new(RawWin32AIOData);
acb->bs = bs;
acb->hfile = hfile;
acb->a... | 14,879 |
qemu | a8170e5e97ad17ca169c64ba87ae2f53850dab4c | 0 | static void special_write(void *opaque, target_phys_addr_t addr,
uint64_t val, unsigned size)
{
qemu_log("pci: special write cycle");
}
| 14,880 |
qemu | 149f54b53b7666a3facd45e86eece60ce7d3b114 | 0 | MemoryRegionSection *phys_page_find(AddressSpaceDispatch *d, hwaddr index)
{
PhysPageEntry lp = d->phys_map;
PhysPageEntry *p;
int i;
for (i = P_L2_LEVELS - 1; i >= 0 && !lp.is_leaf; i--) {
if (lp.ptr == PHYS_MAP_NODE_NIL) {
return &phys_sections[phys_section_unassigned];
... | 14,881 |
qemu | df3a429ae82c0f45becdfab105617701d75e0f05 | 0 | static inline int qemu_gluster_zerofill(struct glfs_fd *fd, int64_t offset,
int64_t size)
{
return glfs_zerofill(fd, offset, size);
}
| 14,882 |
qemu | df475d18d890572b8456ebff327bb9debee6289a | 0 | static void write_cont (void *opaque, uint32_t nport, uint32_t data)
{
struct dma_cont *d = opaque;
int iport, ichan;
iport = (nport >> d->dshift) & 0x0f;
switch (iport) {
case 8: /* command */
if (data && (data | CMD_NOT_SUPPORTED)) {
log ("command ... | 14,883 |
qemu | a4a1c70dc759e5b81627e96564f344ab43ea86eb | 0 | static void test_visitor_in_fail_list(TestInputVisitorData *data,
const void *unused)
{
int64_t i64 = -1;
Visitor *v;
/* Unvisited list tail */
v = visitor_input_test_init(data, "[ 1, 2, 3 ]");
visit_start_list(v, NULL, NULL, 0, &error_abort);
... | 14,885 |
qemu | c21bbcfa3ff4f6dc49fb01080ef598851aa424dd | 0 | void qemu_console_copy(QEMUConsole *console, int src_x, int src_y,
int dst_x, int dst_y, int w, int h) {
if (active_console == console) {
if (console->ds->dpy_copy)
console->ds->dpy_copy(console->ds,
src_x, src_y, dst_x, dst_y, w, h);
els... | 14,886 |
qemu | f02ca5cbeaf86038834c1953247a1579d7921927 | 0 | static inline void tcg_out_ldst(TCGContext *s, int ret, int addr, int offset, int op)
{
if (offset == (offset & 0xfff))
tcg_out32(s, op | INSN_RD(ret) | INSN_RS1(addr) |
INSN_IMM13(offset));
else
fprintf(stderr, "unimplemented %s with offset %d\n", __func__, offset);
}
| 14,888 |
qemu | 3a9d85491ed2be8158fe93041dcbb34c13dfdb05 | 0 | static int i440fx_initfn(PCIDevice *dev)
{
PCII440FXState *d = DO_UPCAST(PCII440FXState, dev, dev);
pci_config_set_vendor_id(d->dev.config, PCI_VENDOR_ID_INTEL);
pci_config_set_device_id(d->dev.config, PCI_DEVICE_ID_INTEL_82441);
d->dev.config[0x08] = 0x02; // revision
pci_config_set_class(d... | 14,889 |
qemu | ac1970fbe8ad5a70174f462109ac0f6c7bf1bc43 | 0 | void cpu_register_physical_memory_log(MemoryRegionSection *section,
bool readonly)
{
MemoryRegionSection now = *section, remain = *section;
if ((now.offset_within_address_space & ~TARGET_PAGE_MASK)
|| (now.size < TARGET_PAGE_SIZE)) {
now.size = MIN(T... | 14,891 |
qemu | c20fd872257fb9abd2ce99741937c0f65aa162b7 | 0 | static void virtio_blk_handle_flush(BlockRequest *blkreq, int *num_writes,
VirtIOBlockReq *req)
{
BlockDriverAIOCB *acb;
/*
* Make sure all outstanding writes are posted to the backing device.
*/
if (*num_writes > 0) {
do_multiwrite(req->dev->bs, blkreq, *num_writes);
}
... | 14,892 |
qemu | 2884cf5b934808f547b5268a51be631805c25857 | 0 | static void gd_update_cursor(VirtualConsole *vc)
{
GtkDisplayState *s = vc->s;
GdkWindow *window;
if (vc->type != GD_VC_GFX) {
return;
}
window = gtk_widget_get_window(GTK_WIDGET(vc->gfx.drawing_area));
if (s->full_screen || qemu_input_is_absolute() || gd_is_grab_active(s)) {... | 14,893 |
qemu | 42922105beb14c2fc58185ea022b9f72fb5465e9 | 0 | static void sdhci_sdma_transfer_multi_blocks(SDHCIState *s)
{
bool page_aligned = false;
unsigned int n, begin;
const uint16_t block_size = s->blksize & 0x0fff;
uint32_t boundary_chk = 1 << (((s->blksize & 0xf000) >> 12) + 12);
uint32_t boundary_count = boundary_chk - (s->sdmasysad % boundary_... | 14,894 |
FFmpeg | 5d9e4eaa6d991718b24c7ce24318ee91419f593a | 0 | static int read_access_unit(AVCodecContext *avctx, void* data, int *data_size,
AVPacket *avpkt)
{
const uint8_t *buf = avpkt->data;
int buf_size = avpkt->size;
MLPDecodeContext *m = avctx->priv_data;
GetBitContext gb;
unsigned int length, substr;
unsigned int ... | 14,895 |
qemu | a03ef88f77af045a2eb9629b5ce774a3fb973c5e | 0 | static int coroutine_fn blkreplay_co_preadv(BlockDriverState *bs,
uint64_t offset, uint64_t bytes, QEMUIOVector *qiov, int flags)
{
uint64_t reqid = request_id++;
int ret = bdrv_co_preadv(bs->file->bs, offset, bytes, qiov, flags);
block_request_create(reqid, bs, qemu_coroutine_self());
qemu_co... | 14,896 |
qemu | 6482b0ffd12ce83810c10b1a3884a75eba2ade1a | 0 | void s390x_tod_timer(void *opaque)
{
S390CPU *cpu = opaque;
CPUS390XState *env = &cpu->env;
env->pending_int |= INTERRUPT_TOD;
cpu_interrupt(CPU(cpu), CPU_INTERRUPT_HARD);
}
| 14,897 |
qemu | 8360544a6d3a54df1fce80f55ba4ad075a8ded54 | 0 | static uint8_t qpci_spapr_io_readb(QPCIBus *bus, void *addr)
{
QPCIBusSPAPR *s = container_of(bus, QPCIBusSPAPR, bus);
uint64_t port = (uintptr_t)addr;
uint8_t v;
if (port < s->pio.size) {
v = readb(s->pio_cpu_base + port);
} else {
v = readb(s->mmio_cpu_base + port);
}
... | 14,898 |
qemu | df3c286c53ac51e7267f2761c7a0c62e11b6e815 | 0 | static void bench_cb(void *opaque, int ret)
{
BenchData *b = opaque;
BlockAIOCB *acb;
if (ret < 0) {
error_report("Failed request: %s\n", strerror(-ret));
exit(EXIT_FAILURE);
}
if (b->in_flush) {
/* Just finished a flush with drained queue: Start next requests */... | 14,899 |
qemu | a3f1afb43a09e4577571c044c48f2ba9e6e4ad06 | 0 | static int QEMU_WARN_UNUSED_RESULT update_refcount(BlockDriverState *bs,
int64_t offset,
int64_t length,
uint64_t addend,
... | 14,900 |
qemu | 3a1e8074d74ad2acbcedf28d35aebedc3573f19e | 0 | static void virtio_scsi_clear_aio(VirtIOSCSI *s)
{
VirtIOSCSICommon *vs = VIRTIO_SCSI_COMMON(s);
int i;
if (s->ctrl_vring) {
aio_set_event_notifier(s->ctx, &s->ctrl_vring->host_notifier,
false, NULL);
}
if (s->event_vring) {
aio_set_event_not... | 14,901 |
qemu | a367467995d0528fe591d87ca2e437c7b7d7951b | 0 | create_iovec(BlockBackend *blk, QEMUIOVector *qiov, char **argv, int nr_iov,
int pattern)
{
size_t *sizes = g_new0(size_t, nr_iov);
size_t count = 0;
void *buf = NULL;
void *p;
int i;
for (i = 0; i < nr_iov; i++) {
char *arg = argv[i];
int64_t len;
... | 14,903 |
qemu | 4be746345f13e99e468c60acbd3a355e8183e3ce | 0 | static void pflash_update(pflash_t *pfl, int offset,
int size)
{
int offset_end;
if (pfl->bs) {
offset_end = offset + size;
/* round to sectors */
offset = offset >> 9;
offset_end = (offset_end + 511) >> 9;
bdrv_write(pfl->bs, offset, pf... | 14,905 |
qemu | c169998802505c244b8bcad562633f29de7d74a4 | 0 | static int piix4_initfn(PCIDevice *d)
{
uint8_t *pci_conf;
isa_bus_new(&d->qdev);
register_savevm("PIIX4", 0, 2, piix_save, piix_load, d);
pci_conf = d->config;
pci_config_set_vendor_id(pci_conf, PCI_VENDOR_ID_INTEL);
pci_config_set_device_id(pci_conf, PCI_DEVICE_ID_INTEL_82371AB_0); ... | 14,906 |
qemu | f53a829bb9ef14be800556cbc02d8b20fc1050a7 | 0 | void nbd_client_session_detach_aio_context(NbdClientSession *client)
{
aio_set_fd_handler(bdrv_get_aio_context(client->bs), client->sock,
NULL, NULL, NULL);
}
| 14,907 |
qemu | 871d2f079661323a7645b388eb5ae8d7eeb3117c | 0 | static void fd_put_notify(void *opaque)
{
QEMUFileFD *s = opaque;
/* Remove writable callback and do a put notify */
qemu_set_fd_handler2(s->fd, NULL, NULL, NULL, NULL);
qemu_file_put_notify(s->file);
}
| 14,908 |
qemu | 2975725f6b3d634dbe924ea9d9f4d86b8a5b217d | 0 | int qemu_savevm_state_iterate(Monitor *mon, QEMUFile *f)
{
SaveStateEntry *se;
int ret = 1;
QTAILQ_FOREACH(se, &savevm_handlers, entry) {
if (se->save_live_state == NULL)
continue;
/* Section type */
qemu_put_byte(f, QEMU_VM_SECTION_PART);
qemu_put_be... | 14,909 |
qemu | 2c3b32d25620c26e26fd590c198ec6d9cf91da57 | 0 | int qcow2_alloc_cluster_offset(BlockDriverState *bs, uint64_t offset,
int n_start, int n_end, int *num, uint64_t *host_offset, QCowL2Meta **m)
{
BDRVQcowState *s = bs->opaque;
uint64_t start, remaining;
uint64_t cluster_offset;
uint64_t cur_bytes;
int ret;
trace_qcow2_alloc_cluster... | 14,910 |
qemu | 521a580d2352ad30086babcabb91e6338e47cf62 | 0 | QemuConsole *graphic_console_init(DeviceState *dev, uint32_t head,
const GraphicHwOps *hw_ops,
void *opaque)
{
int width = 640;
int height = 480;
QemuConsole *s;
DisplayState *ds;
ds = get_alloc_displaystate();
trace_... | 14,912 |
qemu | ac1970fbe8ad5a70174f462109ac0f6c7bf1bc43 | 0 | static inline void stw_phys_internal(target_phys_addr_t addr, uint32_t val,
enum device_endian endian)
{
uint8_t *ptr;
MemoryRegionSection *section;
section = phys_page_find(addr >> TARGET_PAGE_BITS);
if (!memory_region_is_ram(section->mr) || section->reado... | 14,914 |
qemu | 92cb05574b7bd489be81f9c58497dc7dfe5d8859 | 0 | bool virtio_disk_is_eckd(void)
{
if (guessed_disk_nature) {
return (blk_cfg.blk_size == 4096);
}
return (blk_cfg.geometry.heads == 15)
&& (blk_cfg.geometry.sectors == 12)
&& (blk_cfg.blk_size == 4096);
}
| 14,915 |
qemu | d1fdf257d52822695f5ace6c586e059aa17d4b79 | 0 | static int nbd_send_option_request(QIOChannel *ioc, uint32_t opt,
uint32_t len, const char *data,
Error **errp)
{
nbd_option req;
QEMU_BUILD_BUG_ON(sizeof(req) != 16);
if (len == -1) {
req.length = len = strlen(data);
... | 14,916 |
qemu | 88045ac55592cacc92567aa46cb6917854bf7241 | 0 | static void rtas_ibm_write_pci_config(sPAPREnvironment *spapr,
uint32_t token, uint32_t nargs,
target_ulong args,
uint32_t nret, target_ulong rets)
{
uint32_t val, size, addr;
uint64_t buid = ... | 14,917 |
qemu | fc19f8a02e45c4d8ad24dd7eb374330b03dfc28e | 0 | static void *show_parts(void *arg)
{
char *device = arg;
int nbd;
/* linux just needs an open() to trigger
* the partition table update
* but remember to load the module with max_part != 0 :
* modprobe nbd max_part=63
*/
nbd = open(device, O_RDWR);
if (nbd != -1) ... | 14,919 |
qemu | b80bb016d8c8e9d74345a90ab6dac1cb547904e0 | 0 | static TCGArg *tcg_constant_folding(TCGContext *s, uint16_t *tcg_opc_ptr,
TCGArg *args, TCGOpDef *tcg_op_defs)
{
int i, nb_ops, op_index, nb_temps, nb_globals, nb_call_args;
TCGOpcode op;
const TCGOpDef *def;
TCGArg *gen_args;
TCGArg tmp;
TCGCond cond;... | 14,920 |
qemu | 583d121520a81d07bacee7ebe9366d107c8b18b6 | 0 | static inline void tcg_out_sety(TCGContext *s, tcg_target_long val)
{
if (val == 0 || val == -1)
tcg_out32(s, WRY | INSN_IMM13(val));
else
fprintf(stderr, "unimplemented sety %ld\n", (long)val);
}
| 14,921 |
qemu | debaaa114a8877a939533ba846e64168fb287b7b | 0 | static void test_hba_spec(void)
{
AHCIQState *ahci;
ahci = ahci_boot();
ahci_pci_enable(ahci);
ahci_test_hba_spec(ahci);
ahci_shutdown(ahci);
}
| 14,922 |
qemu | 6868a420c519d74926ea814d48f6ce9beda35b98 | 0 | void pdu_free(V9fsPDU *pdu)
{
if (pdu) {
V9fsState *s = pdu->s;
/*
* Cancelled pdu are added back to the freelist
* by flush request .
*/
if (!pdu->cancelled) {
QLIST_REMOVE(pdu, next);
QLIST_INSERT_HEAD(&s->free_list, pdu, next);
... | 14,923 |
FFmpeg | 5bca5f87d1a32669e0357790e0d0ad8a5c9c998b | 0 | static av_noinline void emulated_edge_mc_mmxext(uint8_t *buf, const uint8_t *src,
ptrdiff_t buf_stride,
ptrdiff_t src_stride,
int block_w, int block_h,
... | 14,924 |
qemu | c54616608af442edf4cfb7397a1909c2653efba0 | 0 | static int token_is_operator(QObject *obj, char op)
{
const char *val;
if (token_get_type(obj) != JSON_OPERATOR) {
return 0;
}
val = token_get_value(obj);
return (val[0] == op) && (val[1] == 0);
}
| 14,925 |
qemu | 0db6e54a8a2c6e16780356422da671b71f862341 | 0 | static void mirror_start_job(BlockDriverState *bs, BlockDriverState *target,
const char *replaces,
int64_t speed, int64_t granularity,
int64_t buf_size,
BlockdevOnError on_source_error,
... | 14,926 |
qemu | 38e5756a614e9a492d1bb181166cd031bc87e159 | 0 | static void vnc_connect(VncDisplay *vd, QIOChannelSocket *sioc,
bool skipauth, bool websocket)
{
VncState *vs = g_new0(VncState, 1);
int i;
vs->sioc = sioc;
object_ref(OBJECT(vs->sioc));
vs->ioc = QIO_CHANNEL(sioc);
object_ref(OBJECT(vs->ioc));
vs->vd = vd;... | 14,927 |
qemu | 7859cc6e39bf86f890bb1c72fd9ba41deb6ce2e7 | 0 | static inline void tlb_reset_dirty_range(CPUTLBEntry *tlb_entry,
unsigned long start, unsigned long length)
{
unsigned long addr;
if ((tlb_entry->addr_write & ~TARGET_PAGE_MASK) == io_mem_ram.ram_addr) {
addr = (tlb_entry->addr_write & TARGET_PAGE_MASK) + tl... | 14,928 |
qemu | 27a69bb088bee6d4efea254659422fb9c751b3c7 | 0 | static inline void gen_evmergehi(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_... | 14,929 |
qemu | 9eaaf971683c99ed197fa1b7d1a3ca9baabfb3ee | 0 | static void simple_dict(void)
{
int i;
struct {
const char *encoded;
LiteralQObject decoded;
} test_cases[] = {
{
.encoded = "{\"foo\": 42, \"bar\": \"hello world\"}",
.decoded = QLIT_QDICT(((LiteralQDictEntry[]){
{ "foo", QLI... | 14,930 |
qemu | b97400caef60ccfb0bc81c59f8bd824c43a0d6c8 | 0 | static int local_open2(FsContext *fs_ctx, V9fsPath *dir_path, const char *name,
int flags, FsCred *credp)
{
char *path;
int fd = -1;
int err = -1;
int serrno = 0;
V9fsString fullname;
char buffer[PATH_MAX];
v9fs_string_init(&fullname);
v9fs_string_sprin... | 14,931 |
qemu | 9307c4c1d93939db9b04117b654253af5113dc21 | 0 | static void do_savevm(int argc, const char **argv)
{
if (argc != 2) {
help_cmd(argv[0]);
return;
}
if (qemu_savevm(argv[1]) < 0)
term_printf("I/O error when saving VM to '%s'\n", argv[1]);
}
| 14,932 |
qemu | a8cf66bb393ff420d40ae172a4c817bf2752918a | 0 | static void evaluate_flags_writeback(uint32_t flags)
{
int x;
/* Extended arithmetics, leave the z flag alone. */
x = env->cc_x;
if ((x || env->cc_op == CC_OP_ADDC)
&& flags & Z_FLAG)
env->cc_mask &= ~Z_FLAG;
/* all insn clear the x-flag except setf or clrf. */
env->pregs[PR_CCS] &= ~(env->c... | 14,934 |
FFmpeg | 0d21a84605bad4e75dacb8196e5859902ed36f01 | 0 | static int epzs_motion_search(MpegEncContext * s,
int *mx_ptr, int *my_ptr,
int P[5][2], int pred_x, int pred_y,
int xmin, int ymin, int xmax, int ymax, uint8_t * ref_picture)
{
int best[2]={0, 0};
int d, dmin;
UI... | 14,935 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.