project stringclasses 2
values | commit_id stringlengths 40 40 | target int64 0 1 | func stringlengths 26 142k | idx int64 0 27.3k |
|---|---|---|---|---|
qemu | 1745eaaa7c53c6090d53090d239d0234a7ecfd2d | 0 | static int vm_can_run(void)
{
if (powerdown_requested)
return 0;
if (reset_requested)
return 0;
if (shutdown_requested)
return 0;
if (debug_requested)
return 0;
return 1;
}
| 15,936 |
qemu | c169998802505c244b8bcad562633f29de7d74a4 | 0 | void vga_common_init(VGACommonState *s, int vga_ram_size)
{
int i, j, v, b;
for(i = 0;i < 256; i++) {
v = 0;
for(j = 0; j < 8; j++) {
v |= ((i >> j) & 1) << (j * 4);
}
expand4[i] = v;
v = 0;
for(j = 0; j < 4; j++) {
v |= ((i ... | 15,937 |
qemu | 568c73a4783cd981e9aa6de4f15dcda7829643ad | 0 | InputEvent *qemu_input_event_new_btn(InputButton btn, bool down)
{
InputEvent *evt = g_new0(InputEvent, 1);
evt->btn = g_new0(InputBtnEvent, 1);
evt->kind = INPUT_EVENT_KIND_BTN;
evt->btn->button = btn;
evt->btn->down = down;
return evt;
}
| 15,938 |
qemu | a8170e5e97ad17ca169c64ba87ae2f53850dab4c | 0 | static void ecc_diag_mem_write(void *opaque, target_phys_addr_t addr,
uint64_t val, unsigned size)
{
ECCState *s = opaque;
trace_ecc_diag_mem_writeb(addr, val);
s->diag[addr & ECC_DIAG_MASK] = val;
}
| 15,939 |
qemu | 81f17e0d435c3db3a3e67e0d32ebf9c98973211f | 0 | static void imx_fec_do_tx(IMXFECState *s)
{
int frame_size = 0;
uint8_t frame[ENET_MAX_FRAME_SIZE];
uint8_t *ptr = frame;
uint32_t addr = s->tx_descriptor;
while (1) {
IMXFECBufDesc bd;
int len;
imx_fec_read_bd(&bd, addr);
FEC_PRINTF("tx_bd %x flags %04x... | 15,940 |
qemu | a8170e5e97ad17ca169c64ba87ae2f53850dab4c | 0 | static void omap_eac_write(void *opaque, target_phys_addr_t addr,
uint64_t value, unsigned size)
{
struct omap_eac_s *s = (struct omap_eac_s *) opaque;
if (size != 2) {
return omap_badwidth_write16(opaque, addr, value);
}
switch (addr) {
case 0x098: /* ... | 15,941 |
FFmpeg | e3751aa6ec8147ab7ca2649d4daadf8d4dce27d5 | 0 | static void do_hybrid_window(int order, int n, int non_rec, const float *in,
float *out, float *hist, float *out2,
const float *window)
{
int i;
float buffer1[order + 1];
float buffer2[order + 1];
float work[order + n + non_rec];
/*... | 15,942 |
qemu | 7bd427d801e1e3293a634d3c83beadaa90ffb911 | 0 | static void pxa2xx_rtc_hzupdate(PXA2xxRTCState *s)
{
int64_t rt = qemu_get_clock(rt_clock);
s->last_rcnr += ((rt - s->last_hz) << 15) /
(1000 * ((s->rttr & 0xffff) + 1));
s->last_rdcr += ((rt - s->last_hz) << 15) /
(1000 * ((s->rttr & 0xffff) + 1));
s->last_hz = rt;
}
| 15,944 |
qemu | 2c5b1d2a479273cec4c1be491745f48b0808b508 | 0 | void HELPER(wer)(CPUXtensaState *env, uint32_t data, uint32_t addr)
{
address_space_stl(env->address_space_er, addr, data,
(MemTxAttrs){0}, NULL);
}
| 15,945 |
qemu | 568c73a4783cd981e9aa6de4f15dcda7829643ad | 0 | static void qemu_input_event_trace(QemuConsole *src, InputEvent *evt)
{
const char *name;
int qcode, idx = -1;
if (src) {
idx = qemu_console_get_index(src);
}
switch (evt->kind) {
case INPUT_EVENT_KIND_KEY:
switch (evt->key->key->kind) {
case KEY_VALUE_KIND_NU... | 15,946 |
FFmpeg | f20b67173ca6a05b8c3dee02dad3b7243b96292b | 0 | void ff_aac_encode_tns_info(AACEncContext *s, SingleChannelElement *sce)
{
int i, w, filt, coef_len, coef_compress;
const int coef_res = MAX_LPC_PRECISION == 4 ? 1 : 0;
const int is8 = sce->ics.window_sequence[0] == EIGHT_SHORT_SEQUENCE;
put_bits(&s->pb, 1, !!sce->tns.present);
if (!sce->t... | 15,947 |
FFmpeg | cc276c85d15272df6e44fb3252657a43cbd49555 | 0 | AVFilterBufferRef *avfilter_null_get_audio_buffer(AVFilterLink *link, int perms,
enum AVSampleFormat sample_fmt, int size,
int64_t channel_layout, int packed)
{
return avfilter_get_audio_buffer(link->dst->outputs... | 15,948 |
qemu | 9bd7854e1e5d6f4cfe4558090bbd9493c12bf846 | 0 | static void tcp_chr_read(void *opaque)
{
CharDriverState *chr = opaque;
TCPCharDriver *s = chr->opaque;
uint8_t buf[1024];
int len, size;
if (!s->connected || s->max_size <= 0)
return;
len = sizeof(buf);
if (len > s->max_size)
len = s->max_size;
size = tcp_ch... | 15,949 |
qemu | 59800ec8e52bcfa271fa61fb0aae19205ef1b7f1 | 0 | uint64_t helper_fctid(CPUPPCState *env, uint64_t arg)
{
CPU_DoubleU farg;
farg.ll = arg;
if (unlikely(float64_is_signaling_nan(farg.d))) {
/* sNaN conversion */
farg.ll = fload_invalid_op_excp(env, POWERPC_EXCP_FP_VXSNAN |
POWERPC_EXCP_FP_VX... | 15,950 |
qemu | a8170e5e97ad17ca169c64ba87ae2f53850dab4c | 0 | static uint64_t cchip_read(void *opaque, target_phys_addr_t addr, unsigned size)
{
CPUAlphaState *env = cpu_single_env;
TyphoonState *s = opaque;
uint64_t ret = 0;
if (addr & 4) {
return s->latch_tmp;
}
switch (addr) {
case 0x0000:
/* CSC: Cchip System Configura... | 15,951 |
qemu | 08fba7ac9b618516a5f1d096f78a7e2837fe0594 | 0 | void qemu_system_reset(ShutdownCause reason)
{
MachineClass *mc;
mc = current_machine ? MACHINE_GET_CLASS(current_machine) : NULL;
cpu_synchronize_all_states();
if (mc && mc->reset) {
mc->reset();
} else {
qemu_devices_reset();
}
if (reason) {
/* TODO... | 15,953 |
qemu | 5b3715bfdafcf35c352aa6d273cadd4eb543c449 | 0 | static int gdb_handle_packet(GDBState *s, CPUState *env, const char *line_buf)
{
const char *p;
int ch, reg_size, type;
char buf[MAX_PACKET_LENGTH];
uint8_t mem_buf[MAX_PACKET_LENGTH];
uint8_t *registers;
target_ulong addr, len;
#ifdef DEBUG_GDB
printf("command='%s'\n", line_buf);... | 15,955 |
FFmpeg | d68c05380cebf563915412182643a8be04ef890b | 0 | av_cold void ff_volume_init_x86(VolumeContext *vol)
{
int cpu_flags = av_get_cpu_flags();
enum AVSampleFormat sample_fmt = av_get_packed_sample_fmt(vol->sample_fmt);
if (sample_fmt == AV_SAMPLE_FMT_S16) {
if (EXTERNAL_SSE2(cpu_flags) && vol->volume_i < 32768) {
vol->scale_samples... | 15,956 |
qemu | fd56e0612b6454a282fa6a953fdb09281a98c589 | 0 | static void pxb_register_bus(PCIDevice *dev, PCIBus *pxb_bus, Error **errp)
{
PCIBus *bus = dev->bus;
int pxb_bus_num = pci_bus_num(pxb_bus);
if (bus->parent_dev) {
error_setg(errp, "PXB devices can be attached only to root bus");
return;
}
QLIST_FOREACH(bus, &bus->child,... | 15,957 |
qemu | ddca7f86ac022289840e0200fd4050b2b58e9176 | 0 | static void v9fs_flush(void *opaque)
{
int16_t tag;
size_t offset = 7;
V9fsPDU *cancel_pdu;
V9fsPDU *pdu = opaque;
V9fsState *s = pdu->s;
pdu_unmarshal(pdu, offset, "w", &tag);
trace_v9fs_flush(pdu->tag, pdu->id, tag);
QLIST_FOREACH(cancel_pdu, &s->active_list, next) {
... | 15,958 |
qemu | eabb7b91b36b202b4dac2df2d59d698e3aff197a | 0 | static uint32_t reloc_pc24_val(tcg_insn_unit *pc, tcg_insn_unit *target)
{
ptrdiff_t disp = tcg_ptr_byte_diff(target, pc);
assert(in_range_b(disp));
return disp & 0x3fffffc;
}
| 15,959 |
qemu | 273a2142176098fe2c27f263d86ad66b133b43cb | 0 | static void enable_interrupt(EEPRO100State * s)
{
if (!s->int_stat) {
logout("interrupt enabled\n");
qemu_irq_raise(s->pci_dev->irq[0]);
s->int_stat = 1;
}
}
| 15,960 |
qemu | 9058abdd180843473d440958c79a1a781be723c1 | 0 | static abi_ulong load_elf_interp(struct elfhdr * interp_elf_ex,
int interpreter_fd,
abi_ulong *interp_load_addr,
char bprm_buf[BPRM_BUF_SIZE])
{
struct elf_phdr *elf_phdata = NULL;
abi_ulong load_addr, loa... | 15,961 |
qemu | 4be746345f13e99e468c60acbd3a355e8183e3ce | 0 | static int execute_command(BlockDriverState *bdrv,
SCSIGenericReq *r, int direction,
BlockCompletionFunc *complete)
{
r->io_header.interface_id = 'S';
r->io_header.dxfer_direction = direction;
r->io_header.dxferp = r->buf;
r->io_header.dxfer_l... | 15,963 |
qemu | ac1970fbe8ad5a70174f462109ac0f6c7bf1bc43 | 0 | void stq_phys_notdirty(target_phys_addr_t addr, uint64_t val)
{
uint8_t *ptr;
MemoryRegionSection *section;
section = phys_page_find(addr >> TARGET_PAGE_BITS);
if (!memory_region_is_ram(section->mr) || section->readonly) {
addr = memory_region_section_addr(section, addr);
if (... | 15,964 |
FFmpeg | 6eda91ad54fd3214610edb1e4a5adb58806c243e | 0 | static void clear_program(MpegTSContext *ts, unsigned int programid)
{
int i;
clear_avprogram(ts, programid);
for(i=0; i<ts->nb_prg; i++)
if(ts->prg[i].id == programid)
ts->prg[i].nb_pids = 0;
}
| 15,967 |
FFmpeg | 0b42631641d998e509cde6fa344edc6ab5cb4ac8 | 0 | static void jpeg2000_flush(Jpeg2000DecoderContext *s)
{
if (*s->buf == 0xff)
s->buf++;
s->bit_index = 8;
s->buf++;
}
| 15,968 |
qemu | a8170e5e97ad17ca169c64ba87ae2f53850dab4c | 0 | static void kvm_apic_mem_write(void *opaque, target_phys_addr_t addr,
uint64_t data, unsigned size)
{
MSIMessage msg = { .address = addr, .data = data };
int ret;
ret = kvm_irqchip_send_msi(kvm_state, msg);
if (ret < 0) {
fprintf(stderr, "KVM: injection fa... | 15,969 |
qemu | ccea25f1c7cd3f0b12d878a5294620f5478729f8 | 0 | void os_daemonize(void)
{
if (daemonize) {
pid_t pid;
int fds[2];
if (pipe(fds) == -1) {
exit(1);
}
pid = fork();
if (pid > 0) {
uint8_t status;
ssize_t len;
close(fds[1]);
again:
... | 15,970 |
qemu | a78b1299f1bbb9608e3e3a36a7f16cf700a2789d | 0 | int cpu_signal_handler(int host_signum, void *pinfo,
void *puc)
{
siginfo_t *info = pinfo;
ucontext_t *uc = puc;
uint32_t *pc = uc->uc_mcontext.sc_pc;
uint32_t insn = *pc;
int is_write = 0;
/* XXX: need kernel patch to get write flag faster */
switch (in... | 15,971 |
qemu | a8170e5e97ad17ca169c64ba87ae2f53850dab4c | 0 | static uint32_t bitband_readw(void *opaque, target_phys_addr_t offset)
{
uint32_t addr;
uint16_t mask;
uint16_t v;
addr = bitband_addr(opaque, offset) & ~1;
mask = (1 << ((offset >> 2) & 15));
mask = tswap16(mask);
cpu_physical_memory_read(addr, (uint8_t *)&v, 2);
return (v & ma... | 15,972 |
qemu | dd26eb43337adf53d22b3fda3591e3837bc08b8c | 0 | static void sd_set_ocr(SDState *sd)
{
/* All voltages OK, card power-up OK, Standard Capacity SD Memory Card */
sd->ocr = 0x80ffff00;
}
| 15,974 |
qemu | 7bd427d801e1e3293a634d3c83beadaa90ffb911 | 0 | static uint32_t pxa2xx_rtc_read(void *opaque, target_phys_addr_t addr)
{
PXA2xxRTCState *s = (PXA2xxRTCState *) opaque;
switch (addr) {
case RTTR:
return s->rttr;
case RTSR:
return s->rtsr;
case RTAR:
return s->rtar;
case RDAR1:
return s->rdar1;
... | 15,975 |
qemu | 0a27af918b9cfb7fc1605c66dfc70700be16fab5 | 0 | static int check_protocol_support(bool *has_ipv4, bool *has_ipv6)
{
#ifdef HAVE_IFADDRS_H
struct ifaddrs *ifaddr = NULL, *ifa;
struct addrinfo hints = { 0 };
struct addrinfo *ai = NULL;
int gaierr;
*has_ipv4 = *has_ipv6 = false;
if (getifaddrs(&ifaddr) < 0) {
g_printerr("Fai... | 15,978 |
FFmpeg | 937cfebd72d30e617591c666ea4854a3898a64b2 | 0 | static int init(AVFilterContext *ctx)
{
EvalContext *eval = ctx->priv;
char *args1 = av_strdup(eval->exprs);
char *expr, *buf;
int ret, i;
if (!args1) {
av_log(ctx, AV_LOG_ERROR, "Channels expressions list is empty\n");
ret = eval->exprs ? AVERROR(ENOMEM) : AVERROR(EINVAL);... | 15,979 |
qemu | 6e0d8677cb443e7408c0b7a25a93c6596d7fa380 | 0 | void OPPROTO op_addl_EDI_T0(void)
{
EDI = (uint32_t)(EDI + T0);
}
| 15,981 |
qemu | ac531cb6e542b1e61d668604adf9dc5306a948c0 | 0 | START_TEST(qdict_haskey_not_test)
{
fail_unless(qdict_haskey(tests_dict, "test") == 0);
}
| 15,982 |
qemu | fda4096fca83dcdc72e0fc0e4a1ae6e7724fb5e0 | 0 | static void test_acpi_piix4_tcg_memhp(void)
{
test_data data;
memset(&data, 0, sizeof(data));
data.machine = MACHINE_PC;
data.variant = ".memhp";
test_acpi_one(" -m 128,slots=3,maxmem=1G -numa node", &data);
free_test_data(&data);
}
| 15,983 |
qemu | e771edab0d9aaa7925dc26aec3e0c6eac27f19c3 | 0 | static void gen_sse(DisasContext *s, int b, target_ulong pc_start, int rex_r)
{
int b1, op1_offset, op2_offset, is_xmm, val, ot;
int modrm, mod, rm, reg, reg_addr, offset_addr;
GenOpFunc2 *sse_op2;
GenOpFunc3 *sse_op3;
b &= 0xff;
if (s->prefix & PREFIX_DATA)
b1 = 1;
else i... | 15,984 |
FFmpeg | 08117a40157464f8a9dcc2df393fa5fe299c1e98 | 1 | int ff_h264_pred_weight_table(GetBitContext *gb, const SPS *sps,
const int *ref_count, int slice_type_nos,
H264PredWeightTable *pwt, void *logctx)
{
int list, i, j;
int luma_def, chroma_def;
pwt->use_weight = 0;
pwt->use_we... | 15,988 |
qemu | 6d0ceb80ffe18ad4b28aab7356f440636c0be7be | 1 | static int do_vm_stop(RunState state)
{
int ret = 0;
if (runstate_is_running()) {
cpu_disable_ticks();
pause_all_vcpus();
runstate_set(state);
vm_state_notify(0, state);
qapi_event_send_stop(&error_abort);
}
bdrv_drain_all();
ret = blk_flush_al... | 15,989 |
FFmpeg | df2235a16521db080da4bbe8fc98a85429d42f95 | 1 | static int cin_read_packet(AVFormatContext *s, AVPacket *pkt)
{
CinDemuxContext *cin = s->priv_data;
ByteIOContext *pb = s->pb;
CinFrameHeader *hdr = &cin->frame_header;
int rc, palette_type, pkt_size;
if (cin->audio_buffer_size == 0) {
rc = cin_read_frame_header(cin, pb);
... | 15,990 |
qemu | c0532a76b407af4b276dc5a62d8178db59857ea6 | 1 | static void kvm_do_inject_x86_mce(void *_data)
{
struct kvm_x86_mce_data *data = _data;
int r;
r = kvm_set_mce(data->env, data->mce);
if (r < 0)
perror("kvm_set_mce FAILED");
}
| 15,991 |
FFmpeg | a0c624e299730c8c5800375c2f5f3c6c200053ff | 1 | static int v4l2_receive_packet(AVCodecContext *avctx, AVPacket *avpkt)
{
V4L2m2mContext *s = avctx->priv_data;
V4L2Context *const capture = &s->capture;
V4L2Context *const output = &s->output;
int ret;
if (s->draining)
goto dequeue;
if (!output->streamon) {
ret = ff_... | 15,992 |
FFmpeg | 9bd4a9f4eec8c8843b54126253bb9d77af95bbb3 | 0 | static int mov_rewrite_dvd_sub_extradata(AVStream *st)
{
char pal_s[256];
char buf[256];
int pal_s_pos = 0;
uint8_t *src = st->codec->extradata;
int i;
if (st->codec->extradata_size != 64)
return 0;
for (i = 0; i < 16; i++) {
uint32_t yuv = AV_RB32(src + i * 4);... | 15,994 |
FFmpeg | 57d24225595af78b0fd836d4d145f5d181e320a2 | 0 | static void do_streamcopy(InputStream *ist, OutputStream *ost, const AVPacket *pkt)
{
OutputFile *of = output_files[ost->file_index];
int64_t ost_tb_start_time = av_rescale_q(of->start_time, AV_TIME_BASE_Q, ost->st->time_base);
AVPacket opkt;
av_init_packet(&opkt);
if ((!ost->frame_number ... | 15,995 |
FFmpeg | 92b8c9d89e7ae86bffa05393bb230d5a165b0148 | 0 | static int au_read_packet(AVFormatContext *s,
AVPacket *pkt)
{
int ret;
ret= av_get_packet(s->pb, pkt, BLOCK_SIZE *
s->streams[0]->codec->channels *
av_get_bits_per_sample(s->streams[0]->codec->codec_id) >> 3);
if (ret < 0)
... | 15,996 |
FFmpeg | 62784e3733ceb0f58007db8bb2e41e1abf62b85e | 0 | int av_find_stream_info(AVFormatContext *ic)
{
int i, count, ret, read_size, j;
AVStream *st;
AVPacket pkt1, *pkt;
int64_t old_offset = url_ftell(ic->pb);
struct {
int64_t last_dts;
int64_t duration_gcd;
int duration_count;
double duration_error[MAX_STD_TIME... | 15,997 |
FFmpeg | 898276c16b1683ac77723e97574a3bfdb29507fd | 0 | static int r3d_read_reda(AVFormatContext *s, AVPacket *pkt, Atom *atom)
{
AVStream *st = s->streams[1];
int av_unused tmp, tmp2;
int samples, size;
uint64_t pos = avio_tell(s->pb);
unsigned dts;
int ret;
dts = avio_rb32(s->pb);
st->codec->sample_rate = avio_rb32(s->pb);
... | 15,998 |
qemu | 5c843af22604edecda10d4bb89d4eede9e1bd3d0 | 1 | void hmp_hostfwd_add(Monitor *mon, const QDict *qdict)
{
const char *redir_str;
SlirpState *s;
const char *arg1 = qdict_get_str(qdict, "arg1");
const char *arg2 = qdict_get_try_str(qdict, "arg2");
const char *arg3 = qdict_get_try_str(qdict, "arg3");
if (arg2) {
s = slirp_lookup... | 16,000 |
FFmpeg | 6e42e6c4b410dbef8b593c2d796a5dad95f89ee4 | 1 | void rgb16tobgr32(const uint8_t *src, uint8_t *dst, long src_size)
{
const uint16_t *end;
uint8_t *d = (uint8_t *)dst;
const uint16_t *s = (uint16_t *)src;
end = s + src_size/2;
while(s < end)
{
register uint16_t bgr;
bgr = *s++;
#ifdef WORDS_BIGENDIAN
*d++ = 0;
*d++ = (bgr&0x1F)<<3;
*... | 16,001 |
FFmpeg | f707a5ebba734597b1ff0810931b55b630077ab3 | 1 | static void ir2_decode_plane_inter(Ir2Context *ctx, int width, int height, uint8_t *dst, int stride,
const uint8_t *table)
{
int j;
int out = 0;
int c;
int t;
for (j = 0; j < height; j++){
out = 0;
while (out < width){
c = ir2_... | 16,002 |
FFmpeg | c46a8c613e752164ed3142209266fd32958dbd95 | 1 | static int get_video_frame(VideoState *is, AVFrame *frame, int64_t *pts, AVPacket *pkt, int *serial)
{
int got_picture;
if (packet_queue_get(&is->videoq, pkt, 1, serial) < 0)
return -1;
if (pkt->data == flush_pkt.data) {
avcodec_flush_buffers(is->video_st->codec);
SDL_Lo... | 16,004 |
FFmpeg | 4d7c71c36467331f1e0c0f17af9f371d33308a9c | 1 | int ff_audio_rechunk_interleave(AVFormatContext *s, AVPacket *out, AVPacket *pkt, int flush,
int (*get_packet)(AVFormatContext *, AVPacket *, AVPacket *, int),
int (*compare_ts)(AVFormatContext *, AVPacket *, AVPacket *))
{
int i;
if (pkt) {
AVStre... | 16,005 |
FFmpeg | dbe29db8cb09fb39bd8dc5b25934e92279d0aa8d | 1 | static int aac_decode_frame_int(AVCodecContext *avctx, void *data,
int *got_frame_ptr, GetBitContext *gb)
{
AACContext *ac = avctx->priv_data;
ChannelElement *che = NULL, *che_prev = NULL;
enum RawDataBlockType elem_type, elem_type_prev = TYPE_END;
int err, elem_id;... | 16,006 |
qemu | 4482e05cbbb7e50e476f6a9500cf0b38913bd939 | 1 | static void musicpal_init(MachineState *machine)
{
const char *cpu_model = machine->cpu_model;
const char *kernel_filename = machine->kernel_filename;
const char *kernel_cmdline = machine->kernel_cmdline;
const char *initrd_filename = machine->initrd_filename;
ARMCPU *cpu;
qemu_irq pic[32... | 16,007 |
qemu | 4e47e39ab0ded72c0af174131ecf49d588d66c12 | 1 | void helper_fxrstor(CPUX86State *env, target_ulong ptr, int data64)
{
int i, fpus, fptag, nb_xmm_regs;
floatx80 tmp;
target_ulong addr;
/* The operand must be 16 byte aligned */
if (ptr & 0xf) {
raise_exception(env, EXCP0D_GPF);
}
env->fpuc = cpu_lduw_data(env, ptr);
... | 16,008 |
FFmpeg | 29860cc88caaf1c4852e5ba18ea15e0516039c14 | 1 | static int fill_default_ref_list(H264Context *h){
MpegEncContext * const s = &h->s;
int i;
int smallest_poc_greater_than_current = -1;
Picture sorted_short_ref[32];
if(h->slice_type==B_TYPE){
int out_i;
int limit= -1;
/* sort frame according to poc in B slice ... | 16,009 |
qemu | d96391c1ffeb30a0afa695c86579517c69d9a889 | 1 | target_ulong helper_rdhwr_cc(CPUMIPSState *env)
{
check_hwrena(env, 2);
#ifdef CONFIG_USER_ONLY
return env->CP0_Count;
#else
return (int32_t)cpu_mips_get_count(env);
#endif
}
| 16,010 |
qemu | a1bb73849fbd7d992b6ac2cf30c034244fb2299d | 1 | void helper_rfci(CPUPPCState *env)
{
do_rfi(env, env->spr[SPR_BOOKE_CSRR0], SPR_BOOKE_CSRR1,
~((target_ulong)0x3FFF0000), 0);
}
| 16,011 |
qemu | 42a268c241183877192c376d03bd9b6d527407c7 | 0 | static void gen_nabso(DisasContext *ctx)
{
int l1 = gen_new_label();
int l2 = gen_new_label();
tcg_gen_brcondi_tl(TCG_COND_GT, cpu_gpr[rA(ctx->opcode)], 0, l1);
tcg_gen_mov_tl(cpu_gpr[rD(ctx->opcode)], cpu_gpr[rA(ctx->opcode)]);
tcg_gen_br(l2);
gen_set_label(l1);
tcg_gen_neg_tl(cpu_g... | 16,012 |
qemu | 550830f9351291c585c963204ad9127998b1c1ce | 0 | static coroutine_fn int cow_co_read(BlockDriverState *bs, int64_t sector_num,
uint8_t *buf, int nb_sectors)
{
int ret;
BDRVCowState *s = bs->opaque;
qemu_co_mutex_lock(&s->lock);
ret = cow_read(bs, sector_num, buf, nb_sectors);
qemu_co_mutex_unlock(&s->lock... | 16,013 |
qemu | e8ede0a8bb5298a6979bcf7ed84ef64a64a4e3fe | 0 | static inline uint32_t ucf64_stoi(float32 s)
{
union {
uint32_t i;
float32 s;
} v;
v.s = s;
return v.i;
}
| 16,014 |
qemu | fc3d8e1138cd0c843d6fd75272633a31be6554ef | 0 | static void ahci_port_write(AHCIState *s, int port, int offset, uint32_t val)
{
AHCIPortRegs *pr = &s->dev[port].port_regs;
DPRINTF(port, "offset: 0x%x val: 0x%x\n", offset, val);
switch (offset) {
case PORT_LST_ADDR:
pr->lst_addr = val;
break;
case PORT_LS... | 16,015 |
qemu | a367467995d0528fe591d87ca2e437c7b7d7951b | 0 | static int do_write_compressed(BlockBackend *blk, char *buf, int64_t offset,
int64_t count, int64_t *total)
{
int ret;
if (count >> 9 > INT_MAX) {
return -ERANGE;
}
ret = blk_write_compressed(blk, offset >> 9, (uint8_t *)buf, count >> 9);
if (ret < ... | 16,016 |
qemu | 72cf2d4f0e181d0d3a3122e04129c58a95da713e | 0 | void qdict_put_obj(QDict *qdict, const char *key, QObject *value)
{
unsigned int hash;
QDictEntry *entry;
hash = tdb_hash(key) % QDICT_HASH_SIZE;
entry = qdict_find(qdict, key, hash);
if (entry) {
/* replace key's value */
qobject_decref(entry->value);
entry->value... | 16,017 |
qemu | becf8217deb2afc347d5172d9f30c8a8964b8b27 | 0 | static void trigger_page_fault(CPUS390XState *env, target_ulong vaddr,
uint32_t type, uint64_t asc, int rw, bool exc)
{
int ilen = ILEN_LATER;
uint64_t tec;
tec = vaddr | (rw == MMU_DATA_STORE ? FS_WRITE : FS_READ) | asc >> 46;
DPRINTF("%s: trans_exc_code=%016" P... | 16,018 |
FFmpeg | 98fed176cf28fac2a86b715c9d522e1cbecb45ff | 0 | static av_cold int read_specific_config(ALSDecContext *ctx)
{
GetBitContext gb;
uint64_t ht_size;
int i, config_offset;
MPEG4AudioConfig m4ac;
ALSSpecificConfig *sconf = &ctx->sconf;
AVCodecContext *avctx = ctx->avctx;
uint32_t als_id, header_size, trailer_size;
init_get_bi... | 16,019 |
qemu | bd269ebc82fbaa5fe7ce5bc7c1770ac8acecd884 | 0 | int socket_listen(SocketAddressLegacy *addr, Error **errp)
{
int fd;
switch (addr->type) {
case SOCKET_ADDRESS_LEGACY_KIND_INET:
fd = inet_listen_saddr(addr->u.inet.data, 0, false, errp);
break;
case SOCKET_ADDRESS_LEGACY_KIND_UNIX:
fd = unix_listen_saddr(addr->u.q_un... | 16,021 |
qemu | f0267ef7115656119bf00ed77857789adc036bda | 0 | static long do_sigreturn_v1(CPUARMState *env)
{
abi_ulong frame_addr;
struct sigframe_v1 *frame = NULL;
target_sigset_t set;
sigset_t host_set;
int i;
/*
* Since we stacked the signal on a 64-bit boundary,
* then 'sp' should be word aligned here. If it's
* not, then t... | 16,022 |
qemu | e3f5ec2b5e92706e3b807059f79b1fb5d936e567 | 0 | static int usbnet_can_receive(void *opaque)
{
USBNetState *s = opaque;
if (s->rndis && !s->rndis_state == RNDIS_DATA_INITIALIZED)
return 1;
return !s->in_len;
}
| 16,023 |
qemu | 048c74c4379789d03c857cea038ec00d95b68eaf | 0 | static int rtc_load(QEMUFile *f, void *opaque, int version_id)
{
RTCState *s = opaque;
if (version_id != 1)
return -EINVAL;
qemu_get_buffer(f, s->cmos_data, 128);
qemu_get_8s(f, &s->cmos_index);
s->current_tm.tm_sec=qemu_get_be32(f);
s->current_tm.tm_min=qemu_get_be32(f);
... | 16,024 |
qemu | 5fb6c7a8b26eab1a22207d24b4784bd2b39ab54b | 0 | void vnc_display_close(DisplayState *ds)
{
VncDisplay *vs = ds ? (VncDisplay *)ds->opaque : vnc_display;
if (!vs)
return;
if (vs->display) {
qemu_free(vs->display);
vs->display = NULL;
}
if (vs->lsock != -1) {
qemu_set_fd_handler2(vs->lsock, NULL, NULL, NULL, NULL);
close(vs... | 16,025 |
qemu | a8170e5e97ad17ca169c64ba87ae2f53850dab4c | 0 | static void tmu2_start(MilkymistTMU2State *s)
{
int pbuffer_attrib[6] = {
GLX_PBUFFER_WIDTH,
0,
GLX_PBUFFER_HEIGHT,
0,
GLX_PRESERVED_CONTENTS,
True
};
GLXPbuffer pbuffer;
GLuint texture;
void *fb;
target_phys_addr_t fb_len;
void... | 16,026 |
qemu | 6efeb3286dd80c8c943f50fbb5f611d525cd6f8a | 0 | static int colo_packet_compare_icmp(Packet *spkt, Packet *ppkt)
{
trace_colo_compare_main("compare icmp");
if (colo_packet_compare_common(ppkt, spkt)) {
trace_colo_compare_icmp_miscompare("primary pkt size",
ppkt->size);
qemu_hexdump((char *)ppk... | 16,027 |
qemu | f8b6cc0070aab8b75bd082582c829be1353f395f | 0 | static void scsi_destroy(SCSIDevice *dev)
{
SCSIDiskState *s = DO_UPCAST(SCSIDiskState, qdev, dev);
scsi_disk_purge_requests(s);
blockdev_mark_auto_del(s->qdev.conf.dinfo->bdrv);
}
| 16,028 |
qemu | 2399d4e7cec22ecf1c51062d2ebfd45220dbaace | 0 | void HELPER(yield)(CPUARMState *env)
{
ARMCPU *cpu = arm_env_get_cpu(env);
CPUState *cs = CPU(cpu);
/* When running in MTTCG we don't generate jumps to the yield and
* WFE helpers as it won't affect the scheduling of other vCPUs.
* If we wanted to more completely model WFE/SEV so we don't ... | 16,029 |
qemu | 544d1afa7013fce155f5afbbc24737f2fc0c0f26 | 0 | static void gic_init(gic_state *s, int num_cpu, int num_irq)
#else
static void gic_init(gic_state *s, int num_irq)
#endif
{
int i;
#if NCPU > 1
s->num_cpu = num_cpu;
if (s->num_cpu > NCPU) {
hw_error("requested %u CPUs exceeds GIC maximum %d\n",
num_cpu, NCPU);
}
#... | 16,030 |
FFmpeg | d8173f264f732a4d14220816de2e54642115e2a7 | 0 | static int dv_read_timecode(AVFormatContext *s) {
int ret;
char timecode[AV_TIMECODE_STR_SIZE];
int64_t pos = avio_tell(s->pb);
// Read 3 DIF blocks: Header block and 2 Subcode blocks.
int partial_frame_size = 3 * 80;
uint8_t *partial_frame = av_mallocz(sizeof(*partial_frame) *
... | 16,031 |
qemu | ee951a37d8873bff7aa58e23222dfd984111b6cb | 0 | static void vt82c686b_init_ports(PCIIDEState *d) {
int i;
struct {
int iobase;
int iobase2;
int isairq;
} port_info[] = {
{0x1f0, 0x3f6, 14},
{0x170, 0x376, 15},
};
for (i = 0; i < 2; i++) {
ide_bus_new(&d->bus[i], &d->dev.qdev, i);
... | 16,033 |
qemu | 42a268c241183877192c376d03bd9b6d527407c7 | 0 | static void gen_tlbsx_40x(DisasContext *ctx)
{
#if defined(CONFIG_USER_ONLY)
gen_inval_exception(ctx, POWERPC_EXCP_PRIV_OPC);
#else
TCGv t0;
if (unlikely(ctx->pr)) {
gen_inval_exception(ctx, POWERPC_EXCP_PRIV_OPC);
return;
}
t0 = tcg_temp_new();
gen_addr_reg_index(ctx,... | 16,034 |
qemu | 185698715dfb18c82ad2a5dbc169908602d43e81 | 0 | static unsigned int PerformComparison(const unsigned int opcode)
{
FPA11 *fpa11 = GET_FPA11();
unsigned int Fn, Fm;
floatx80 rFn, rFm;
int e_flag = opcode & 0x400000; /* 1 if CxFE */
int n_flag = opcode & 0x200000; /* 1 if CNxx */
unsigned int flags = 0;
//printk("PerformComparison(0x%08x... | 16,035 |
qemu | b493317d344357f7ac56606246d09b5604e54ab6 | 0 | static bool aio_dispatch_handlers(AioContext *ctx, HANDLE event)
{
AioHandler *node;
bool progress = false;
/*
* We have to walk very carefully in case aio_set_fd_handler is
* called while we're walking.
*/
node = QLIST_FIRST(&ctx->aio_handlers);
while (node) {
Aio... | 16,037 |
qemu | 5fa737a4792c0aef9cf0588242336eefb0cb8ca8 | 0 | static void monitor_control_read(void *opaque, const uint8_t *buf, int size)
{
Monitor *old_mon = cur_mon;
cur_mon = opaque;
// TODO: read QMP input
cur_mon = old_mon;
}
| 16,038 |
qemu | a426e122173f36f05ea2cb72dcff77b7408546ce | 0 | int kvm_log_stop(target_phys_addr_t phys_addr, ram_addr_t size)
{
return kvm_dirty_pages_log_change(phys_addr, size,
0,
KVM_MEM_LOG_DIRTY_PAGES);
}
| 16,039 |
qemu | b7079df4100069959f4e9d90d5cb5ba7d4ebbf1a | 0 | static int curl_find_buf(BDRVCURLState *s, size_t start, size_t len,
CURLAIOCB *acb)
{
int i;
size_t end = start + len;
for (i=0; i<CURL_NUM_STATES; i++) {
CURLState *state = &s->states[i];
size_t buf_end = (state->buf_start + state->buf_off);
size_... | 16,040 |
qemu | a8170e5e97ad17ca169c64ba87ae2f53850dab4c | 0 | static uint64_t mcf_intc_read(void *opaque, target_phys_addr_t addr,
unsigned size)
{
int offset;
mcf_intc_state *s = (mcf_intc_state *)opaque;
offset = addr & 0xff;
if (offset >= 0x40 && offset < 0x80) {
return s->icr[offset - 0x40];
}
switch (offs... | 16,041 |
FFmpeg | ad6946b8189e5e17796f1d5bf86d97ee619009b8 | 0 | int ff_hls_write_file_entry(AVIOContext *out, int insert_discont,
int byterange_mode,
double duration, int round_duration,
int64_t size, int64_t pos, //Used only if HLS_SINGLE_FILE flag is set
char *b... | 16,042 |
qemu | 2633a2d015b0ba57432f1e11970cc080eb5119a3 | 0 | static inline void tcg_out_qemu_ld(TCGContext *s, const TCGArg *args, int opc)
{
int addr_reg, data_reg, data_reg2, bswap;
#ifdef CONFIG_SOFTMMU
int mem_index, s_bits;
# if TARGET_LONG_BITS == 64
int addr_reg2;
# endif
uint32_t *label_ptr;
#endif
#ifdef TARGET_WORDS_BIGENDIAN
bswap = 1;... | 16,043 |
qemu | 2662a059aa2affddfbe42e78b11c802cf30a970f | 0 | static void gen_spr_403 (CPUPPCState *env)
{
/* MMU */
spr_register(env, SPR_403_PBL1, "PBL1",
SPR_NOACCESS, SPR_NOACCESS,
&spr_read_403_pbr, &spr_write_403_pbr,
0x00000000);
spr_register(env, SPR_403_PBU1, "PBU1",
SPR_NOACCESS, S... | 16,044 |
qemu | 5fb6c7a8b26eab1a22207d24b4784bd2b39ab54b | 0 | static gnutls_certificate_credentials_t vnc_tls_initialize_x509_cred(VncState *vs)
{
gnutls_certificate_credentials_t x509_cred;
int ret;
if (!vs->vd->x509cacert) {
VNC_DEBUG("No CA x509 certificate specified\n");
return NULL;
}
if (!vs->vd->x509cert) {
VNC_DEBUG("No server x509 certif... | 16,045 |
qemu | b6dcbe086c77ec683f5ff0b693593cda1d61f3a1 | 0 | CPUState *ppc440ep_init(ram_addr_t *ram_size, PCIBus **pcip,
const unsigned int pci_irq_nrs[4], int do_init,
const char *cpu_model)
{
target_phys_addr_t ram_bases[PPC440EP_SDRAM_NR_BANKS];
target_phys_addr_t ram_sizes[PPC440EP_SDRAM_NR_BANKS];
CPUState *... | 16,046 |
qemu | e95205e1f9cd2c4262b7a7b1c992a94512c86d0e | 1 | void *cpu_register_map_client(void *opaque, void (*callback)(void *opaque))
{
MapClient *client = g_malloc(sizeof(*client));
qemu_mutex_lock(&map_client_list_lock);
client->opaque = opaque;
client->callback = callback;
QLIST_INSERT_HEAD(&map_client_list, client, link);
if (!atomic_read(... | 16,048 |
FFmpeg | d5a3578350a3901a26df39df196bb085760ec46f | 1 | static int svag_read_header(AVFormatContext *s)
{
unsigned size, align;
AVStream *st;
avio_skip(s->pb, 4);
st = avformat_new_stream(s, NULL);
if (!st)
return AVERROR(ENOMEM);
size = avio_rl32(s->pb);
st->codec->codec_type = AVMEDIA_TYPE_AUDIO;
s... | 16,049 |
FFmpeg | 1481e198251192c9801d4e7818c3c23bc217f705 | 1 | int ff_mpeg_update_thread_context(AVCodecContext *dst,
const AVCodecContext *src)
{
int i;
MpegEncContext *s = dst->priv_data, *s1 = src->priv_data;
if (dst == src || !s1->context_initialized)
return 0;
// FIXME can parameters change on I-frames?
// in that ... | 16,050 |
FFmpeg | 0b23452c01c5f8145de111f09c0e9a7d5bd82068 | 1 | static void encode_rgb_frame(FFV1Context *s, uint8_t *src[3], int w, int h, int stride[3]){
int x, y, p, i;
const int ring_size= s->avctx->context_model ? 3 : 2;
int16_t *sample[4][3];
int lbd= s->avctx->bits_per_raw_sample <= 8;
int bits= s->avctx->bits_per_raw_sample > 0 ? s->avctx->bits_per... | 16,051 |
qemu | f5aa4bdc766190b95d18be27d5cdf4d80c35b33c | 1 | static void test_flush(void)
{
QPCIDevice *dev;
QPCIBar bmdma_bar, ide_bar;
uint8_t data;
ide_test_start(
"-drive file=blkdebug::%s,if=ide,cache=writeback,format=raw",
tmp_path);
dev = get_pci_device(&bmdma_bar, &ide_bar);
qtest_irq_intercept_in(global_qtest, "ioap... | 16,052 |
qemu | 7364dbdabb7824d5bde1e341bb6d928282f01c83 | 1 | static int protocol_client_auth_sasl_start(VncState *vs, uint8_t *data, size_t len)
{
uint32_t datalen = len;
const char *serverout;
unsigned int serveroutlen;
int err;
char *clientdata = NULL;
/* NB, distinction of NULL vs "" is *critical* in SASL */
if (datalen) {
client... | 16,053 |
FFmpeg | 44f1698a3824836d32708ae93e78ac1f2310a07e | 1 | static int decode_init(AVCodecContext * avctx)
{
MPADecodeContext *s = avctx->priv_data;
static int init=0;
int i, j, k;
#if defined(USE_HIGHPRECISION) && defined(CONFIG_AUDIO_NONSHORT)
avctx->sample_fmt= SAMPLE_FMT_S32;
#else
avctx->sample_fmt= SAMPLE_FMT_S16;
#endif
if(av... | 16,054 |
FFmpeg | c84ba07db4abd123b2ad93784e312a24d9341553 | 1 | static int init_muxer(AVFormatContext *s, AVDictionary **options)
{
int ret = 0, i;
AVStream *st;
AVDictionary *tmp = NULL;
AVCodecParameters *par = NULL;
AVOutputFormat *of = s->oformat;
const AVCodecDescriptor *desc;
AVDictionaryEntry *e;
if (options)
av_dict_copy(&... | 16,055 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.