project stringclasses 2
values | commit_id stringlengths 40 40 | target int64 0 1 | func stringlengths 26 142k | idx int64 0 27.3k |
|---|---|---|---|---|
qemu | fa1298c2d623522eda7b4f1f721fcb935abb7360 | 1 | static int ohci_eof_timer_pre_load(void *opaque)
{
OHCIState *ohci = opaque;
ohci_bus_start(ohci);
return 0;
}
| 19,863 |
qemu | ec45bbe5f1921c6553fbf9c0c76b358b0403c22d | 1 | envlist_free(envlist_t *envlist)
{
struct envlist_entry *entry;
assert(envlist != NULL);
while (envlist->el_entries.lh_first != NULL) {
entry = envlist->el_entries.lh_first;
QLIST_REMOVE(entry, ev_link);
free((char *)entry->ev_var);
free(entry);
}
free(envlist);
}
| 19,865 |
qemu | a9416dc62c36079b93b4951c894a0b15e53bb38c | 1 | static void test_visitor_in_intList(TestInputVisitorData *data,
const void *unused)
{
/* Note: the visitor *sorts* ranges *unsigned* */
int64_t expect1[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 20 };
int64_t expect2[] = { 32767, -32768, -32767 };
int64_t expect3[] = { INT64... | 19,867 |
qemu | 60fe637bf0e4d7989e21e50f52526444765c63b4 | 1 | static void put_unused_buffer(QEMUFile *f, void *pv, size_t size)
{
static const uint8_t buf[1024];
int block_len;
while (size > 0) {
block_len = MIN(sizeof(buf), size);
size -= block_len;
qemu_put_buffer(f, buf, block_len);
}
}
| 19,868 |
qemu | a89d89d3e65800fa4a8e00de7af0ea8272bef779 | 1 | static int find_snapshot_by_id(BlockDriverState *bs, const char *id_str)
{
BDRVQcowState *s = bs->opaque;
int i;
for(i = 0; i < s->nb_snapshots; i++) {
if (!strcmp(s->snapshots[i].id_str, id_str))
return i;
}
return -1;
}
| 19,869 |
qemu | 1735fe1edba9cc86bc0f26937ed5a62d3cb47c9c | 1 | static inline void vmsvga_update_rect(struct vmsvga_state_s *s,
int x, int y, int w, int h)
{
DisplaySurface *surface = qemu_console_surface(s->vga.con);
int line;
int bypl;
int width;
int start;
uint8_t *src;
uint8_t *dst;
if (x < 0) {
... | 19,870 |
FFmpeg | cc25a887c5467be5c7b004665047a32d36c9cf42 | 1 | static int webm_dash_manifest_cues(AVFormatContext *s, int64_t init_range)
{
MatroskaDemuxContext *matroska = s->priv_data;
EbmlList *seekhead_list = &matroska->seekhead;
MatroskaSeekhead *seekhead = seekhead_list->elem;
char *buf;
int64_t cues_start = -1, cues_end = -1, before_pos, bandwidth;... | 19,871 |
FFmpeg | 9684341346fd5aad436325529cade47966c4731b | 1 | int avresample_convert(AVAudioResampleContext *avr, void **output,
int out_plane_size, int out_samples, void **input,
int in_plane_size, int in_samples)
{
AudioData input_buffer;
AudioData output_buffer;
AudioData *current_buffer;
int ret;
/* r... | 19,872 |
qemu | afcd9c0dcd1d6ab14a72db6abde76142c6a0ac12 | 1 | static ssize_t rtl8139_do_receive(VLANClientState *nc, const uint8_t *buf, size_t size_, int do_interrupt)
{
RTL8139State *s = DO_UPCAST(NICState, nc, nc)->opaque;
/* size is the length of the buffer passed to the driver */
int size = size_;
const uint8_t *dot1q_buf = NULL;
uint32_t packet_h... | 19,873 |
FFmpeg | 6e20554a6d33e92b81dc3cfed6082e03bff2a7f8 | 1 | static void decode_mb(MadContext *t, int inter)
{
MpegEncContext *s = &t->s;
int mv_map = 0;
int mv_x, mv_y;
int j;
if (inter) {
int v = decode210(&s->gb);
if (v < 2) {
mv_map = v ? get_bits(&s->gb, 6) : 63;
mv_x = decode_motion(&s->gb);
... | 19,874 |
FFmpeg | eec67f7b24da5407cc2e8933ffe72358336811ab | 1 | static int save_subtitle_set(AVCodecContext *avctx, AVSubtitle *sub, int *got_output)
{
DVBSubContext *ctx = avctx->priv_data;
DVBSubRegionDisplay *display;
DVBSubDisplayDefinition *display_def = ctx->display_definition;
DVBSubRegion *region;
AVSubtitleRect *rect;
DVBSubCLUT *clut;
u... | 19,876 |
qemu | ec1efab95767312ff4afb816d0d4b548e093b031 | 1 | static bool vexpress_cfgctrl_read(arm_sysctl_state *s, unsigned int dcc,
unsigned int function, unsigned int site,
unsigned int position, unsigned int device,
uint32_t *val)
{
/* We don't support anything othe... | 19,877 |
FFmpeg | 2bbec1eda46d907605772a8b6e8263caa4bc4c82 | 1 | static void vc1_decode_ac_coeff(VC1Context *v, int *last, int *skip, int *value, int codingset)
{
GetBitContext *gb = &v->s.gb;
int index, escape, run = 0, level = 0, lst = 0;
index = get_vlc2(gb, ff_vc1_ac_coeff_table[codingset].table, AC_VLC_BITS, 3);
if (index != vc1_ac_sizes[codingset] - 1) {... | 19,878 |
FFmpeg | 4690e01c3aaf495c87127e5dc74aa347197dbc0b | 1 | static int find_slice_quant(AVCodecContext *avctx, const AVFrame *pic,
int trellis_node, int x, int y, int mbs_per_slice,
ProresThreadData *td)
{
ProresContext *ctx = avctx->priv_data;
int i, q, pq, xp, yp;
const uint16_t *src;
int slice_wid... | 19,879 |
FFmpeg | 27085d1b47c3741cc0fac284c916127c4066d049 | 1 | static void process_input_packet(InputStream *ist, const AVPacket *pkt, int no_eof)
{
int i;
int repeating = 0;
AVPacket avpkt;
if (ist->next_dts == AV_NOPTS_VALUE)
ist->next_dts = ist->last_dts;
if (!pkt) {
/* EOF handling */
av_init_packet(&avpkt);
avp... | 19,880 |
FFmpeg | f19af812a32c1398d48c3550d11dbc6aafbb2bfc | 1 | static int adx_decode_header(AVCodecContext *avctx,const unsigned char *buf,size_t bufsize)
{
int offset;
int channels,freq,size;
offset = is_adx(buf,bufsize);
if (offset==0) return 0;
channels = buf[7];
freq = read_long(buf+8);
size = read_long(buf+12);
// printf("freq=%d ch=%d\n",freq,channels);... | 19,881 |
qemu | a2d4e44b485222a8972ea9e555b148148c655bb9 | 1 | uint32_t pci_default_read_config(PCIDevice *d,
uint32_t address, int len)
{
uint32_t val;
switch(len) {
case 1:
val = d->config[address];
break;
case 2:
val = le16_to_cpu(*(uint16_t *)(d->config + address));
break;
default:... | 19,882 |
qemu | 779cec4d20907cbccb26fbf5f5c19c6cdee33eff | 1 | static QDict *qmp_check_input_obj(QObject *input_obj, Error **errp)
{
const QDictEntry *ent;
int has_exec_key = 0;
QDict *input_dict;
if (qobject_type(input_obj) != QTYPE_QDICT) {
error_set(errp, QERR_QMP_BAD_INPUT_OBJECT, "object");
return NULL;
}
input_dict = qobje... | 19,883 |
qemu | 0dacea92d26c31d453c58de2e99c178fee554166 | 1 | static void vmxnet3_rx_need_csum_calculate(struct NetRxPkt *pkt,
const void *pkt_data,
size_t pkt_len)
{
struct virtio_net_hdr *vhdr;
bool isip4, isip6, istcp, isudp;
uint8_t *data;
int len;
if (!net_rx_p... | 19,884 |
FFmpeg | bf1945af301aff54c33352e75f17aec6cb5269d7 | 0 | int ff_ps_apply(AVCodecContext *avctx, PSContext *ps, float L[2][38][64], float R[2][38][64], int top)
{
float Lbuf[91][32][2];
float Rbuf[91][32][2];
const int len = 32;
int is34 = ps->is34bands;
top += NR_BANDS[is34] - 64;
memset(ps->delay+top, 0, (NR_BANDS[is34] - top)*sizeof(ps->del... | 19,885 |
FFmpeg | f18d2dff1194b34b79dc7641aafe54d1df349e40 | 0 | static void bl_intrp(EVRCContext *e, float *ex, float delay)
{
float *f;
int offset, i, coef_idx;
int16_t t;
offset = lrintf(fabs(delay));
t = (offset - delay + 0.5) * 8.0 + 0.5;
if (t == 8) {
t = 0;
offset--;
}
f = ex - offset - 8;
coef_idx = t * ... | 19,887 |
FFmpeg | 0c9d5b015c2022e8deebb93367f8ee8a8eb779e8 | 1 | static av_always_inline void fic_idct(int16_t *blk, int step, int shift, int rnd)
{
const int t0 = 27246 * blk[3 * step] + 18405 * blk[5 * step];
const int t1 = 27246 * blk[5 * step] - 18405 * blk[3 * step];
const int t2 = 6393 * blk[7 * step] + 32139 * blk[1 * step];
const int t3 = 6393 * bl... | 19,888 |
qemu | 60fe637bf0e4d7989e21e50f52526444765c63b4 | 1 | static int qemu_rdma_alloc_pd_cq(RDMAContext *rdma)
{
/* allocate pd */
rdma->pd = ibv_alloc_pd(rdma->verbs);
if (!rdma->pd) {
fprintf(stderr, "failed to allocate protection domain\n");
return -1;
}
/* create completion channel */
rdma->comp_channel = ibv_create_comp_c... | 19,890 |
qemu | a9fc37f6bc3f2ab90585cb16493da9f6dcfbfbcf | 1 | static void qobject_input_type_int64(Visitor *v, const char *name, int64_t *obj,
Error **errp)
{
QObjectInputVisitor *qiv = to_qiv(v);
QObject *qobj = qobject_input_get_object(qiv, name, true, errp);
QInt *qint;
if (!qobj) {
return;
}
qint ... | 19,891 |
qemu | 4c315c27661502a0813b129e41c0bf640c34a8d6 | 1 | static void xlnx_zynqmp_class_init(ObjectClass *oc, void *data)
{
DeviceClass *dc = DEVICE_CLASS(oc);
dc->props = xlnx_zynqmp_props;
dc->realize = xlnx_zynqmp_realize;
} | 19,894 |
qemu | ad0ebb91cd8b5fdc4a583b03645677771f420a46 | 1 | static target_ulong h_send_logical_lan(CPUPPCState *env, sPAPREnvironment *spapr,
target_ulong opcode, target_ulong *args)
{
target_ulong reg = args[0];
target_ulong *bufs = args + 1;
target_ulong continue_token = args[7];
VIOsPAPRDevice *sdev = spapr_vio_fin... | 19,895 |
qemu | 0cf33fb6b49a19de32859e2cdc6021334f448fb3 | 1 | static ssize_t virtio_net_receive(NetClientState *nc, const uint8_t *buf, size_t size)
{
VirtIONet *n = qemu_get_nic_opaque(nc);
VirtIONetQueue *q = virtio_net_get_subqueue(nc);
VirtIODevice *vdev = VIRTIO_DEVICE(n);
struct iovec mhdr_sg[VIRTQUEUE_MAX_SIZE];
struct virtio_net_hdr_mrg_rxbuf mhd... | 19,896 |
FFmpeg | 0b79a389ba488d50fd9947554d803fc51b877bb3 | 1 | static int read_sm_data(AVFormatContext *s, AVIOContext *bc, AVPacket *pkt, int is_meta, int64_t maxpos)
{
int count = ffio_read_varlen(bc);
int skip_start = 0;
int skip_end = 0;
int channels = 0;
int64_t channel_layout = 0;
int sample_rate = 0;
int width = 0;
int height = 0;
... | 19,897 |
FFmpeg | b1e242bc565665420661e016127fe07b4b615ecb | 1 | static uint32_t epic_decode_pixel_pred(ePICContext *dc, int x, int y,
const uint32_t *curr_row,
const uint32_t *above_row)
{
uint32_t N, W, NW, pred;
unsigned delta;
int GN, GW, GNW, R, G, B;
if (x && y) {
W = curr_ro... | 19,898 |
qemu | 33e66b86d89040f0a9e99aa53deb74ce8936a649 | 1 | static USBDevice *usb_host_device_open_addr(int bus_num, int addr, const char *prod_name)
{
int fd = -1, ret;
USBDevice *d = NULL;
USBHostDevice *dev;
struct usbdevfs_connectinfo ci;
char buf[1024];
printf("husb: open device %d.%d\n", bus_num, addr);
if (!usb_host_device_path) {
... | 19,899 |
FFmpeg | 5e03eea673a9da2253ed15152e46b1422b35d145 | 1 | static int vp9_decode_frame(AVCodecContext *avctx, void *frame,
int *got_frame, AVPacket *pkt)
{
const uint8_t *data = pkt->data;
int size = pkt->size;
VP9Context *s = avctx->priv_data;
int ret, i, j, ref;
int retain_segmap_ref = s->s.frames[REF_FRAME_SEGMAP].segme... | 19,900 |
qemu | 6ab3fc32ea640026726bc5f9f4db622d0954fb8a | 1 | static void ccid_card_vscard_send_msg(PassthruState *s,
VSCMsgType type, uint32_t reader_id,
const uint8_t *payload, uint32_t length)
{
VSCMsgHeader scr_msg_header;
scr_msg_header.type = htonl(type);
scr_msg_header.reader_id = htonl(reader_id);
scr_msg_header.length = htonl(leng... | 19,901 |
qemu | 00f4d64ee76e873be881a82d893a591487aa7950 | 1 | static int kvmclock_post_load(void *opaque, int version_id)
{
KVMClockState *s = opaque;
struct kvm_clock_data data;
data.clock = s->clock;
data.flags = 0;
return kvm_vm_ioctl(kvm_state, KVM_SET_CLOCK, &data);
}
| 19,902 |
qemu | 68d45bb61c5bbfb3999486f78cf026c1e79eb301 | 1 | static void tcg_out_qemu_st(TCGContext *s, const TCGArg *args, bool is_64)
{
TCGReg datalo, datahi, addrlo, rbase;
TCGReg addrhi __attribute__((unused));
TCGMemOpIdx oi;
TCGMemOp opc, s_bits;
#ifdef CONFIG_SOFTMMU
int mem_index;
tcg_insn_unit *label_ptr;
#endif
datalo = *args++;
... | 19,903 |
FFmpeg | ffbe087b589506cb0e671fa711e5c2c6ea203ac0 | 1 | static int decode_dvd_subtitles(AVSubtitle *sub_header,
const uint8_t *buf, int buf_size)
{
int cmd_pos, pos, cmd, x1, y1, x2, y2, offset1, offset2, next_cmd_pos;
int big_offsets, offset_size, is_8bit = 0;
const uint8_t *yuv_palette = 0;
uint8_t colormap[4], alpha[2... | 19,904 |
FFmpeg | 2ee380aefbb92c89e8e9c7aa5846aa404919ec7c | 1 | int ff_vaapi_render_picture(struct vaapi_context *vactx, VASurfaceID surface)
{
VABufferID va_buffers[3];
unsigned int n_va_buffers = 0;
vaUnmapBuffer(vactx->display, vactx->pic_param_buf_id);
va_buffers[n_va_buffers++] = vactx->pic_param_buf_id;
if (vactx->iq_matrix_buf_id) {
vaUnmapBuffer(... | 19,905 |
FFmpeg | 5f5b78aca35d07c771f5c4c73a984be9fe04a0b8 | 1 | static av_cold int xcbgrab_read_header(AVFormatContext *s)
{
XCBGrabContext *c = s->priv_data;
int screen_num, ret;
const xcb_setup_t *setup;
char *host = s->filename[0] ? s->filename : NULL;
const char *opts = strchr(s->filename, '+');
if (opts) {
sscanf(opts, "%d,%d",... | 19,906 |
FFmpeg | 0a8bff788b0a9f96b863f0e836a235cb1d223f55 | 1 | static int parse_pixel_format(AVCodecContext *avctx)
{
DDSContext *ctx = avctx->priv_data;
GetByteContext *gbc = &ctx->gbc;
char buf[32];
uint32_t flags, fourcc, gimp_tag;
enum DDSDXGIFormat dxgi;
int size, bpp, r, g, b, a;
int alpha_exponent, ycocg_classic, ycocg_scaled, normal_map, array;
... | 19,909 |
FFmpeg | ef4dc3e55b677b27f6e8f471946c711bcf92da82 | 1 | static int write_number(void *obj, const AVOption *o, void *dst, double num, int den, int64_t intnum)
{
if (o->max*den < num*intnum || o->min*den > num*intnum) {
av_log(obj, AV_LOG_ERROR, "Value %f for parameter '%s' out of range\n",
num*intnum/den, o->name);
return AVERROR(ERANG... | 19,911 |
qemu | f2eb665a11a34ac9f6459f8a18c3d9d8be9ca359 | 1 | static uint64_t itc_tag_read(void *opaque, hwaddr addr, unsigned size)
{
MIPSITUState *tag = (MIPSITUState *)opaque;
uint64_t index = addr >> 3;
uint64_t ret = 0;
switch (index) {
case 0 ... ITC_ADDRESSMAP_NUM:
ret = tag->ITCAddressMap[index];
break;
default:
... | 19,913 |
FFmpeg | 4bd869eb7c8416942f12b61db6439d2bfc474456 | 1 | static int calc_add_mv(RV34DecContext *r, int dir, int val)
{
int mul = dir ? -r->mv_weight2 : r->mv_weight1;
return (val * mul + 0x2000) >> 14;
}
| 19,914 |
FFmpeg | 50833c9f7b4e1922197a8955669f8ab3589c8cef | 1 | static void put_line(uint8_t *dst, int size, int width, const int *runs)
{
PutBitContext pb;
int run, mode = ~0, pix_left = width, run_idx = 0;
init_put_bits(&pb, dst, size * 8);
while (pix_left > 0) {
run = runs[run_idx++];
mode = ~mode;
pix_left -= run;
... | 19,915 |
FFmpeg | 44391f706b0be13e74b2432b57a6597b210a989c | 0 | int ff_load_image(uint8_t *data[4], int linesize[4],
int *w, int *h, enum PixelFormat *pix_fmt,
const char *filename, void *log_ctx)
{
AVInputFormat *iformat = NULL;
AVFormatContext *format_ctx;
AVCodec *codec;
AVCodecContext *codec_ctx;
AVFrame *frame;
... | 19,917 |
FFmpeg | 49caac24132c06e2f14b275da9048588c7da63d0 | 0 | void ff_vdpau_h264_picture_complete(MpegEncContext *s)
{
H264Context *h = s->avctx->priv_data;
struct vdpau_render_state *render;
int i;
render = (struct vdpau_render_state *)s->current_picture_ptr->data[0];
assert(render);
render->info.h264.slice_count = h->slice_num;
if (render... | 19,918 |
FFmpeg | 01e4537f66c6d054f8c7bdbdd5b3cfb4220d12fe | 0 | static void flat_print_int(WriterContext *wctx, const char *key, long long int value)
{
flat_print_key_prefix(wctx);
printf("%s=%lld\n", key, value);
}
| 19,920 |
FFmpeg | 50b4468598cbc032c0ec4597df9637f71b9ef664 | 0 | void av_fifo_write(AVFifoBuffer *f, const uint8_t *buf, int size)
{
while (size > 0) {
int len = FFMIN(f->end - f->wptr, size);
memcpy(f->wptr, buf, len);
f->wptr += len;
if (f->wptr >= f->end)
f->wptr = f->buffer;
buf += len;
size -= len;
}
... | 19,921 |
FFmpeg | 162f1fbc147bbff6e23b4df1e587cec5d5111052 | 0 | static int handle_packets(MpegTSContext *ts, int nb_packets)
{
AVFormatContext *s = ts->stream;
uint8_t packet[TS_PACKET_SIZE];
int packet_num, ret = 0;
if (avio_tell(s->pb) != ts->last_pos) {
int i;
av_dlog("Skipping after seek\n");
/* seek detected, flush pes buffer *... | 19,922 |
FFmpeg | f777504f640260337974848c7d5d7a3f064bbb45 | 0 | void ff_h264_filter_mb( H264Context *h, int mb_x, int mb_y, uint8_t *img_y, uint8_t *img_cb, uint8_t *img_cr, unsigned int linesize, unsigned int uvlinesize) {
const int mb_xy= mb_x + mb_y*h->mb_stride;
const int mb_type = h->cur_pic.mb_type[mb_xy];
const int mvy_limit = IS_INTERLACED(mb_type) ? 2 : 4;
... | 19,923 |
FFmpeg | 6a4832caaede15e3d918b1408ff83fe30324507b | 0 | DIRAC_PIXOP(put, ff_put, mmx)
DIRAC_PIXOP(avg, ff_avg, mmx)
DIRAC_PIXOP(avg, ff_avg, mmxext)
void ff_put_dirac_pixels16_sse2(uint8_t *dst, const uint8_t *src[5], int stride, int h)
{
if (h&3)
ff_put_dirac_pixels16_c(dst, src, stride, h);
else
ff_put_pixels16_sse2(dst, src[0], stride, h);
... | 19,924 |
qemu | d0d7708ba29cbcc343364a46bff981e0ff88366f | 0 | static CharDriverState *qemu_chr_open_spice_vmc(const char *id,
ChardevBackend *backend,
ChardevReturn *ret,
Error **errp)
{
const char *type = backend->u.spicevmc->ty... | 19,925 |
qemu | 99fd437dee468609de8218f0eb3b16621fb6a9c9 | 0 | void acpi_build(PcGuestInfo *guest_info, AcpiBuildTables *tables)
{
GArray *table_offsets;
unsigned facs, dsdt, rsdt;
AcpiCpuInfo cpu;
AcpiPmInfo pm;
AcpiMiscInfo misc;
AcpiMcfgInfo mcfg;
PcPciInfo pci;
uint8_t *u;
acpi_get_cpu_info(&cpu);
acpi_get_pm_info(&pm);
... | 19,926 |
qemu | de00982e9e14e2d6ba3d148f02c5a1e94deaa985 | 0 | static uint32_t xen_platform_ioport_readb(void *opaque, uint32_t addr)
{
addr &= 0xff;
if (addr == 0) {
return platform_fixed_ioport_readb(opaque, XEN_PLATFORM_IOPORT);
} else {
return ~0u;
}
}
| 19,928 |
qemu | 4fa4ce7107c6ec432f185307158c5df91ce54308 | 0 | static ssize_t mp_pacl_getxattr(FsContext *ctx, const char *path,
const char *name, void *value, size_t size)
{
char buffer[PATH_MAX];
return lgetxattr(rpath(ctx, path, buffer), MAP_ACL_ACCESS, value, size);
}
| 19,929 |
qemu | 1281c08a46df94a66acca140bafc1785c0fcd47f | 0 | void ga_command_state_init(GAState *s, GACommandState *cs)
{
if (vss_init(true)) {
ga_command_state_add(cs, NULL, guest_fsfreeze_cleanup);
}
}
| 19,930 |
FFmpeg | 8813d55fa5978660d9f4e7dbe1f50da9922be08d | 0 | int ff_vaapi_commit_slices(FFVAContext *vactx)
{
VABufferID *slice_buf_ids;
VABufferID slice_param_buf_id, slice_data_buf_id;
if (vactx->slice_count == 0)
return 0;
slice_buf_ids =
av_fast_realloc(vactx->slice_buf_ids,
&vactx->slice_buf_ids_alloc,
... | 19,931 |
qemu | b798068d51ecf173702c91617793989ab843c8fb | 0 | static void dec_scall(DisasContext *dc)
{
TCGv t0;
int l1;
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");
}
t0 = tcg_temp_new();
l1 = gen_new_label();
... | 19,934 |
qemu | b3a2319792ad5c0f0f8c3d2f4d02b95fd7efbc69 | 0 | static void slavio_check_interrupts(void *opaque)
{
CPUState *env;
SLAVIO_INTCTLState *s = opaque;
uint32_t pending = s->intregm_pending;
unsigned int i, j, max = 0;
pending &= ~s->intregm_disabled;
if (pending && !(s->intregm_disabled & 0x80000000)) {
for (i = 0; i < 32; i++) {
... | 19,936 |
qemu | 8c7f3dd05e4f1ee90000c89e428e69ae2e6bd691 | 0 | static int pci_add_option_rom(PCIDevice *pdev, bool is_default_rom)
{
int size;
char *path;
void *ptr;
char name[32];
const VMStateDescription *vmsd;
if (!pdev->romfile)
return 0;
if (strlen(pdev->romfile) == 0)
return 0;
if (!pdev->rom_bar) {
/*
... | 19,937 |
qemu | 730b00bbfdc15f914f47e03a703fa7647c10c4a9 | 0 | static char *qemu_rbd_next_tok(int max_len,
char *src, char delim,
const char *name,
char **p, Error **errp)
{
int l;
char *end;
*p = NULL;
if (delim != '\0') {
for (end = src; *end; ++end) ... | 19,938 |
qemu | 7e7e2ebc942da8285931ceabf12823e165dced8b | 0 | static int protocol_client_vencrypt_auth(VncState *vs, uint8_t *data, size_t len)
{
int auth = read_u32(data, 0);
if (auth != vs->vd->subauth) {
VNC_DEBUG("Rejecting auth %d\n", auth);
vnc_write_u8(vs, 0); /* Reject auth */
vnc_flush(vs);
vnc_client_error(vs);
} els... | 19,939 |
qemu | f17fd4fdf0df3d2f3444399d04c38d22b9a3e1b7 | 0 | int64_t qemu_strtosz_metric(const char *nptr, char **end)
{
return do_strtosz(nptr, end, 'B', 1000);
}
| 19,940 |
qemu | 9be385980d37e8f4fd33f605f5fb1c3d144170a8 | 0 | static int l2_load(BlockDriverState *bs, uint64_t l2_offset,
uint64_t **l2_table)
{
BDRVQcow2State *s = bs->opaque;
int ret;
ret = qcow2_cache_get(bs, s->l2_table_cache, l2_offset, (void**) l2_table);
return ret;
}
| 19,941 |
FFmpeg | 68f593b48433842f3407586679fe07f3e5199ab9 | 0 | static int mjpeg_decode_init(AVCodecContext *avctx)
{
MJpegDecodeContext *s = avctx->priv_data;
MpegEncContext s2;
s->avctx = avctx;
/* ugly way to get the idct & scantable */
memset(&s2, 0, sizeof(MpegEncContext));
s2.flags= avctx->flags;
s2.avctx= avctx;
// s2->out_format =... | 19,942 |
qemu | 2c62f08ddbf3fa80dc7202eb9a2ea60ae44e2cc5 | 0 | static int pci_std_vga_initfn(PCIDevice *dev)
{
PCIVGAState *d = DO_UPCAST(PCIVGAState, dev, dev);
VGACommonState *s = &d->vga;
/* vga + console init */
vga_common_init(s);
vga_init(s, pci_address_space(dev), pci_address_space_io(dev), true);
s->con = graphic_console_init(s->update, s... | 19,943 |
qemu | a89f364ae8740dfc31b321eed9ee454e996dc3c1 | 0 | static int tosa_dac_recv(I2CSlave *s)
{
printf("%s: recv not supported!!!\n", __FUNCTION__);
return -1;
}
| 19,944 |
qemu | 1ea879e5580f63414693655fcf0328559cdce138 | 0 | static int waveformat_from_audio_settings (WAVEFORMATEX *wfx, audsettings_t *as)
{
memset (wfx, 0, sizeof (*wfx));
wfx->wFormatTag = WAVE_FORMAT_PCM;
wfx->nChannels = as->nchannels;
wfx->nSamplesPerSec = as->freq;
wfx->nAvgBytesPerSec = as->freq << (as->nchannels == 2);
wfx->nBlockAlign... | 19,945 |
qemu | d8b7e0adf562277180f96ecbd7f1777a384a0308 | 0 | static BlockDriverAIOCB *raw_aio_readv(BlockDriverState *bs,
int64_t sector_num, QEMUIOVector *qiov, int nb_sectors,
BlockDriverCompletionFunc *cb, void *opaque)
{
return bdrv_aio_readv(bs->file, sector_num, qiov, nb_sectors, cb, opaque);
}
| 19,946 |
qemu | 539de1246d355d3b8aa33fb7cde732352d8827c7 | 0 | static int blk_mig_save_dirty_block(Monitor *mon, QEMUFile *f, int is_async)
{
BlkMigDevState *bmds;
int ret = 0;
QSIMPLEQ_FOREACH(bmds, &block_mig_state.bmds_list, entry) {
if (mig_save_device_dirty(mon, f, bmds, is_async) == 0) {
ret = 1;
break;
}
}
... | 19,947 |
qemu | f090c9d4ad5812fb92843d6470a1111c15190c4c | 0 | float64 float64_sqrt( float64 a STATUS_PARAM )
{
flag aSign;
int16 aExp, zExp;
bits64 aSig, zSig, doubleZSig;
bits64 rem0, rem1, term0, term1;
aSig = extractFloat64Frac( a );
aExp = extractFloat64Exp( a );
aSign = extractFloat64Sign( a );
if ( aExp == 0x7FF ) {
if ( a... | 19,948 |
qemu | 1e9737da4aafb54681203931dfe8f8eea21fcef7 | 0 | static int dynticks_start_timer(struct qemu_alarm_timer *t)
{
struct sigevent ev;
timer_t host_timer;
struct sigaction act;
sigfillset(&act.sa_mask);
act.sa_flags = 0;
act.sa_handler = host_alarm_handler;
sigaction(SIGALRM, &act, NULL);
/*
* Initialize ev struct to ... | 19,950 |
qemu | 10c4c98ab7dc18169b37b76f6ea5e60ebe65222b | 0 | void sysbus_register_withprop(SysBusDeviceInfo *info)
{
info->qdev.init = sysbus_device_init;
info->qdev.bus_type = BUS_TYPE_SYSTEM;
assert(info->qdev.size >= sizeof(SysBusDevice));
qdev_register(&info->qdev);
}
| 19,951 |
qemu | 4a998740b22aa673ea475060c787da7c545588cf | 0 | int qemu_timer_expired(QEMUTimer *timer_head, int64_t current_time)
{
if (!timer_head)
return 0;
return (timer_head->expire_time <= current_time);
}
| 19,952 |
FFmpeg | 44cde38c8acbef7d5250e6d1b52b1020871e093b | 0 | static int cbs_read_se_golomb(CodedBitstreamContext *ctx, BitstreamContext *bc,
const char *name, int32_t *write_to,
int32_t range_min, int32_t range_max)
{
int32_t value;
int position;
if (ctx->trace_enable) {
char bits[65];
... | 19,953 |
qemu | 57003085037f554de82327cbc34105cda1942892 | 0 | void cpu_x86_cpuid(CPUX86State *env, uint32_t index,
uint32_t *eax, uint32_t *ebx,
uint32_t *ecx, uint32_t *edx)
{
/* test if maximum index reached */
if (index & 0x80000000) {
if (index > env->cpuid_xlevel)
index = env->cpuid_level;
} else {... | 19,954 |
qemu | a8170e5e97ad17ca169c64ba87ae2f53850dab4c | 0 | static uint32_t isa_mmio_readl(void *opaque, target_phys_addr_t addr)
{
return cpu_inl(addr & IOPORTS_MASK);
}
| 19,955 |
qemu | b227a8e9aa5f27d29f77ba90d5eb9d0662a1175e | 0 | static always_inline int _pte_check (mmu_ctx_t *ctx, int is_64b,
target_ulong pte0, target_ulong pte1,
int h, int rw)
{
target_ulong ptem, mmask;
int access, ret, pteh, ptev;
access = 0;
ret = -1;
/* Check validity a... | 19,956 |
qemu | 3d948cdf3760b52238038626a7ffa7d30913060b | 0 | void qmp_block_job_resume(const char *device, Error **errp)
{
BlockJob *job = find_block_job(device);
if (!job) {
error_set(errp, QERR_BLOCK_JOB_NOT_ACTIVE, device);
return;
}
trace_qmp_block_job_resume(job);
block_job_resume(job);
}
| 19,957 |
qemu | 9be385980d37e8f4fd33f605f5fb1c3d144170a8 | 0 | int AUD_write (SWVoiceOut *sw, void *buf, int size)
{
int bytes;
if (!sw) {
/* XXX: Consider options */
return size;
}
if (!sw->hw->enabled) {
dolog ("Writing to disabled voice %s\n", SW_NAME (sw));
return 0;
}
bytes = sw->hw->pcm_ops->write (sw, ... | 19,958 |
qemu | 45a50b1668822c23afc2a89f724654e176518bc4 | 0 | static void option_rom_setup_reset(target_phys_addr_t addr, unsigned size)
{
RomResetData *rrd = qemu_malloc(sizeof *rrd);
rrd->data = qemu_malloc(size);
cpu_physical_memory_read(addr, rrd->data, size);
rrd->addr = addr;
rrd->size = size;
qemu_register_reset(option_rom_reset, rrd);
}
| 19,959 |
qemu | 9d4c0f4f0a71e74fd7e04d73620268484d693adf | 0 | static uint32_t drc_unisolate_physical(sPAPRDRConnector *drc)
{
/* cannot unisolate a non-existent resource, and, or resources
* which are in an 'UNUSABLE' allocation state. (PAPR 2.7,
* 13.5.3.5)
*/
if (!drc->dev) {
return RTAS_OUT_NO_SUCH_INDICATOR;
}
drc->isolation_s... | 19,960 |
qemu | c60bf3391bf4cb79b7adc6650094e21671ddaabd | 0 | static void monitor_command_cb(Monitor *mon, const char *cmdline, void *opaque)
{
monitor_suspend(mon);
handle_user_command(mon, cmdline);
monitor_resume(mon);
}
| 19,961 |
FFmpeg | d7e9533aa06f4073a27812349b35ba5fede11ca1 | 1 | static void dct_unquantize_mpeg1_c(MpegEncContext *s,
DCTELEM *block, int n, int qscale)
{
int i, level, nCoeffs;
const UINT16 *quant_matrix;
if(s->alternate_scan) nCoeffs= 64;
else nCoeffs= s->block_last_index[n]+1;
if (s->mb_intra) {
if (... | 19,964 |
qemu | 297a3646c2947ee64a6d42ca264039732c6218e0 | 1 | static void balloon_stats_get_all(Object *obj, struct Visitor *v,
void *opaque, const char *name, Error **errp)
{
Error *err = NULL;
VirtIOBalloon *s = opaque;
int i;
if (!s->stats_last_update) {
error_setg(errp, "guest hasn't updated any stats yet");
... | 19,967 |
qemu | 02c4f26b1517d9e403ec10d6f6ca3c0276d19e43 | 1 | void qemuio_add_command(const cmdinfo_t *ci)
{
cmdtab = g_realloc(cmdtab, ++ncmds * sizeof(*cmdtab));
cmdtab[ncmds - 1] = *ci;
qsort(cmdtab, ncmds, sizeof(*cmdtab), compare_cmdname);
}
| 19,968 |
qemu | bd1820227ecc0c77cc2aeba7c7c25b2d0a72ff3c | 1 | static void max_x86_cpu_initfn(Object *obj)
{
X86CPU *cpu = X86_CPU(obj);
CPUX86State *env = &cpu->env;
KVMState *s = kvm_state;
/* We can't fill the features array here because we don't know yet if
* "migratable" is true or false.
*/
cpu->max_features = true;
if (kvm_enab... | 19,969 |
qemu | 8fc94e5a8046e349e07976f9bcaffbcd5833f3a2 | 1 | static int vfio_get_device(VFIOGroup *group, const char *name, VFIODevice *vdev)
{
struct vfio_device_info dev_info = { .argsz = sizeof(dev_info) };
struct vfio_region_info reg_info = { .argsz = sizeof(reg_info) };
int ret, i;
ret = ioctl(group->fd, VFIO_GROUP_GET_DEVICE_FD, name);
if (ret <... | 19,971 |
FFmpeg | 64fbf5e263a0698c6cf6e0580feebe9a6f502ae5 | 1 | static int parse_inputs(const char **buf, AVFilterInOut **currInputs,
AVFilterInOut **openLinks, AVClass *log_ctx)
{
int pad = 0;
while(**buf == '[') {
char *name = parse_link_name(buf, log_ctx);
AVFilterInOut *match;
if(!name)
return -1;
... | 19,972 |
qemu | 362e9299b34b3101aaa20f20363441c9f055fa5e | 1 | static BlockBackend *blockdev_init(const char *file, QDict *bs_opts,
Error **errp)
{
const char *buf;
int bdrv_flags = 0;
int on_read_error, on_write_error;
BlockBackend *blk;
BlockDriverState *bs;
ThrottleConfig cfg;
int snapshot = 0;
Error ... | 19,973 |
FFmpeg | 4a81bddb4d9bd6402fc3be64ca406dda7976058d | 1 | static int configure_input_video_filter(FilterGraph *fg, InputFilter *ifilter,
AVFilterInOut *in)
{
AVFilterContext *last_filter;
const AVFilter *buffer_filt = avfilter_get_by_name("buffer");
InputStream *ist = ifilter->ist;
InputFile *f = input_files[is... | 19,974 |
FFmpeg | 636ced8e1dc8248a1353b416240b93d70ad03edb | 1 | static void do_video_stats(OutputStream *ost, int frame_size)
{
AVCodecContext *enc;
int frame_number;
double ti1, bitrate, avg_bitrate;
/* this is executed just the first time do_video_stats is called */
if (!vstats_file) {
vstats_file = fopen(vstats_filename, "w");
if (!v... | 19,975 |
FFmpeg | 7148da489e4991c88eeff9cd6238ad6e273613b5 | 1 | void intra_predict(VP8Context *s, uint8_t *dst[3], VP8Macroblock *mb,
int mb_x, int mb_y)
{
AVCodecContext *avctx = s->avctx;
int x, y, mode, nnz, tr;
// for the first row, we need to run xchg_mb_border to init the top edge to 127
// otherwise, skip it if we aren't going to de... | 19,977 |
qemu | ed8b5847e46c24d6e9c286892a00a34bee9b0835 | 1 | Aml *aml_buffer(void)
{
Aml *var = aml_bundle(0x11 /* BufferOp */, AML_BUFFER);
return var;
}
| 19,978 |
qemu | 949868633f0454715af1781c0f377413b6ab000e | 1 | static hwaddr ppc_hash64_pteg_search(PowerPCCPU *cpu, hwaddr hash,
ppc_slb_t *slb, target_ulong ptem,
ppc_hash_pte64_t *pte)
{
CPUPPCState *env = &cpu->env;
int i;
uint64_t token;
target_ulong pte0, pte1;
target_ulong ... | 19,979 |
qemu | e25a0651f4be22099122b5e14c77c354be0aa88b | 1 | static int qxl_init_common(PCIQXLDevice *qxl)
{
uint8_t* config = qxl->pci.config;
uint32_t pci_device_rev;
uint32_t io_size;
qxl->mode = QXL_MODE_UNDEFINED;
qxl->generation = 1;
qxl->num_memslots = NUM_MEMSLOTS;
qemu_mutex_init(&qxl->track_lock);
qemu_mutex_init(&qxl->async_l... | 19,980 |
qemu | 9ada575bbafaf6d3724a7f59df9da89776817cac | 1 | static void create_header64(DumpState *s, Error **errp)
{
DiskDumpHeader64 *dh = NULL;
KdumpSubHeader64 *kh = NULL;
size_t size;
uint32_t block_size;
uint32_t sub_hdr_size;
uint32_t bitmap_blocks;
uint32_t status = 0;
uint64_t offset_note;
Error *local_err = NULL;
/* write common... | 19,981 |
qemu | 458f3b2c953bdc7110896cb3691251023652523f | 1 | static void test_rtas_get_time_of_day(void)
{
QOSState *qs;
struct tm tm;
uint32_t ns;
uint64_t ret;
time_t t1, t2;
qs = qtest_spapr_boot("-machine pseries");
g_assert(qs != NULL);
t1 = time(NULL);
ret = qrtas_get_time_of_day(qs->alloc, &tm, &ns);
g_assert_cmpint(r... | 19,982 |
qemu | 8be7e7e4c72c048b90e3482557954a24bba43ba7 | 1 | int qemu_opts_set(QemuOptsList *list, const char *id,
const char *name, const char *value)
{
QemuOpts *opts;
opts = qemu_opts_create(list, id, 1);
if (opts == NULL) {
return -1;
}
return qemu_opt_set(opts, name, value);
}
| 19,983 |
FFmpeg | 6998a9f4c4e069f515c50614179f4cfc7d0184f5 | 1 | static int parse_icy(HTTPContext *s, const char *tag, const char *p)
{
int len = 4 + strlen(p) + strlen(tag);
int is_first = !s->icy_metadata_headers;
int ret;
if (s->icy_metadata_headers)
len += strlen(s->icy_metadata_headers);
if ((ret = av_reallocp(&s->icy_metadata_headers, len)) < 0)
... | 19,984 |
FFmpeg | 910e3668170d2e1e56dc28f8b722232a218e4b9a | 1 | static av_cold void decode_init_vlc(void){
static int done = 0;
if (!done) {
int i;
done = 1;
init_vlc(&chroma_dc_coeff_token_vlc, CHROMA_DC_COEFF_TOKEN_VLC_BITS, 4*5,
&chroma_dc_coeff_token_len [0], 1, 1,
&chroma_dc_coeff_token_bits[0], 1, 1,... | 19,985 |
qemu | 3bc36a401e0f33e63a4d2c58b646ddf78efb567c | 1 | static USBDevice *usb_serial_init(USBBus *bus, const char *filename)
{
USBDevice *dev;
CharDriverState *cdrv;
uint32_t vendorid = 0, productid = 0;
char label[32];
static int index;
while (*filename && *filename != ':') {
const char *p;
char *e;
if (strstart(f... | 19,986 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.