project stringclasses 2
values | commit_id stringlengths 40 40 | target int64 0 1 | func stringlengths 26 142k | idx int64 0 27.3k |
|---|---|---|---|---|
qemu | e68c5958668596a5023e30ddf8368410878f7682 | 0 | ChardevReturn *qmp_chardev_add(const char *id, ChardevBackend *backend,
Error **errp)
{
ChardevReturn *ret = g_new0(ChardevReturn, 1);
CharDriverState *base, *chr = NULL;
chr = qemu_chr_find(id);
if (chr) {
error_setg(errp, "Chardev '%s' already exists", i... | 18,995 |
qemu | 92f9a4f13ea29de4644bd0b077643e1dff96ab29 | 0 | static int pbm_pci_host_init(PCIDevice *d)
{
pci_config_set_vendor_id(d->config, PCI_VENDOR_ID_SUN);
pci_config_set_device_id(d->config, PCI_DEVICE_ID_SUN_SABRE);
pci_set_word(d->config + PCI_COMMAND,
PCI_COMMAND_MEMORY | PCI_COMMAND_MASTER);
pci_set_word(d->config + PCI_STATUS,
... | 18,996 |
qemu | 5fb6c7a8b26eab1a22207d24b4784bd2b39ab54b | 0 | static int32_t read_s32(uint8_t *data, size_t offset)
{
return (int32_t)((data[offset] << 24) | (data[offset + 1] << 16) |
(data[offset + 2] << 8) | data[offset + 3]);
}
| 18,998 |
qemu | b769d8fef6c06ddb39ef0337882a4f8872b9c2bc | 0 | CPUSPARCState *cpu_sparc_init(void)
{
CPUSPARCState *env;
cpu_exec_init();
if (!(env = malloc(sizeof(CPUSPARCState))))
return (NULL);
memset(env, 0, sizeof(*env));
env->cwp = 0;
env->wim = 1;
env->regwptr = env->regbase + (env->cwp * 16);
env->access_type = ACCESS_DATA;
#... | 19,000 |
qemu | c2b38b277a7882a592f4f2ec955084b2b756daaa | 0 | void timer_init_tl(QEMUTimer *ts,
QEMUTimerList *timer_list, int scale,
QEMUTimerCB *cb, void *opaque)
{
ts->timer_list = timer_list;
ts->cb = cb;
ts->opaque = opaque;
ts->scale = scale;
ts->expire_time = -1;
}
| 19,001 |
qemu | 0cd09c3a6cc2230ba38c462fc410b4acce59eb6f | 0 | static uint32_t virtio_net_get_features(VirtIODevice *vdev, uint32_t features)
{
VirtIONet *n = VIRTIO_NET(vdev);
NetClientState *nc = qemu_get_queue(n->nic);
features |= (1 << VIRTIO_NET_F_MAC);
if (!peer_has_vnet_hdr(n)) {
features &= ~(0x1 << VIRTIO_NET_F_CSUM);
features &=... | 19,004 |
FFmpeg | eabbc64728c2fdb74f565aededec2ab023d20699 | 0 | static int64_t mkv_write_cues(AVFormatContext *s, mkv_cues *cues, mkv_track *tracks, int num_tracks)
{
MatroskaMuxContext *mkv = s->priv_data;
AVIOContext *dyn_cp, *pb = s->pb;
ebml_master cues_element;
int64_t currentpos;
int i, j, ret;
currentpos = avio_tell(pb);
ret = start_ebml... | 19,007 |
FFmpeg | c8241e730f116f1c9cfc0b34110aa7f052e05332 | 0 | av_cold int ff_vaapi_encode_init(AVCodecContext *avctx,
const VAAPIEncodeType *type)
{
VAAPIEncodeContext *ctx = avctx->priv_data;
AVVAAPIFramesContext *recon_hwctx = NULL;
AVVAAPIHWConfig *hwconfig = NULL;
AVHWFramesConstraints *constraints = NULL;
enum AVPix... | 19,008 |
FFmpeg | 20ec0d2a750a804f50c090cf6e6509db8ff9cadd | 0 | void ff_print_debug_info(MpegEncContext *s, AVFrame *pict)
{
if ( s->avctx->hwaccel || !pict || !pict->mb_type
|| (s->avctx->codec->capabilities&CODEC_CAP_HWACCEL_VDPAU))
return;
if (s->avctx->debug & (FF_DEBUG_SKIP | FF_DEBUG_QP | FF_DEBUG_MB_TYPE)) {
int x,y;
av_... | 19,010 |
qemu | b4ba67d9a702507793c2724e56f98e9b0f7be02b | 1 | static uint8_t qvirtio_pci_config_readb(QVirtioDevice *d, uint64_t off)
{
QVirtioPCIDevice *dev = (QVirtioPCIDevice *)d;
return qpci_io_readb(dev->pdev, CONFIG_BASE(dev) + off);
}
| 19,013 |
qemu | 4656e1f01289cc3aa20986deb6a407165826abe5 | 1 | int cpu_ppc_register_internal (CPUPPCState *env, const ppc_def_t *def)
{
env->msr_mask = def->msr_mask;
env->mmu_model = def->mmu_model;
env->excp_model = def->excp_model;
env->bus_model = def->bus_model;
env->insns_flags = def->insns_flags;
env->insns_flags2 = def->insns_flags2;
env->flags ... | 19,015 |
qemu | c6d2283068026035a6468aae9dcde953bd7521ac | 1 | static void set_dirty_bitmap(BlockDriverState *bs, int64_t sector_num,
int nb_sectors, int dirty)
{
int64_t start, end;
start = sector_num / BDRV_SECTORS_PER_DIRTY_CHUNK;
end = (sector_num + nb_sectors) / BDRV_SECTORS_PER_DIRTY_CHUNK;
for (; start <= end; start++) ... | 19,016 |
qemu | 0479097859372a760843ad1b9c6ed3705c6423ca | 1 | static void pc_dimm_unplug(HotplugHandler *hotplug_dev,
DeviceState *dev, Error **errp)
{
PCMachineState *pcms = PC_MACHINE(hotplug_dev);
PCDIMMDevice *dimm = PC_DIMM(dev);
PCDIMMDeviceClass *ddc = PC_DIMM_GET_CLASS(dimm);
MemoryRegion *mr = ddc->get_memory_region(dimm);... | 19,017 |
qemu | bae416e5ba65701d3c5238164517158066d615e5 | 1 | uint64_t ram_bytes_remaining(void)
{
return ram_state->migration_dirty_pages * TARGET_PAGE_SIZE;
}
| 19,018 |
qemu | afeecec2e8e99ba184c487633d5d0dde68a002ac | 1 | QEMU_BUILD_BUG_ON(ARRAY_SIZE(monitor_event_names) != QEVENT_MAX)
/**
* monitor_protocol_event(): Generate a Monitor event
*
* Event-specific data can be emitted through the (optional) 'data' parameter.
*/
void monitor_protocol_event(MonitorEvent event, QObject *data)
{
QDict *qmp;
const char *eve... | 19,019 |
qemu | 19dbcbf7cc1892f5130b4edd5a4bb4ca800ef7d8 | 1 | static int preallocate(BlockDriverState *bs)
{
uint64_t nb_sectors;
uint64_t offset;
int num;
int ret;
QCowL2Meta meta;
nb_sectors = bdrv_getlength(bs) >> 9;
offset = 0;
QLIST_INIT(&meta.dependent_requests);
meta.cluster_offset = 0;
while (nb_sectors) {
nu... | 19,020 |
qemu | ae392c416c69a020226c768d9c3af08b29dd6d96 | 1 | static int msix_is_masked(PCIDevice *dev, int vector)
{
unsigned offset =
vector * PCI_MSIX_ENTRY_SIZE + PCI_MSIX_ENTRY_VECTOR_CTRL;
return dev->msix_function_masked ||
dev->msix_table_page[offset] & PCI_MSIX_ENTRY_CTRL_MASKBIT;
}
| 19,021 |
qemu | 301c7d38a0c359b91526391d13617386f3d9bb29 | 1 | static int vmdk_add_extent(BlockDriverState *bs,
BlockDriverState *file, bool flat, int64_t sectors,
int64_t l1_offset, int64_t l1_backup_offset,
uint32_t l1_size,
int l2_size, uint64_t cluster_sectors,
... | 19,022 |
FFmpeg | c7921a480467876ece06566e0efd8f6bce9d1903 | 1 | static int get_stream_info(AVCodecContext *avctx)
{
FDKAACDecContext *s = avctx->priv_data;
CStreamInfo *info = aacDecoder_GetStreamInfo(s->handle);
int channel_counts[0x24] = { 0 };
int i, ch_error = 0;
uint64_t ch_layout = 0;
if (!info) {
av_log(avctx, AV_LOG_E... | 19,024 |
qemu | 60fe637bf0e4d7989e21e50f52526444765c63b4 | 1 | static void *qemu_rdma_data_init(const char *host_port, Error **errp)
{
RDMAContext *rdma = NULL;
InetSocketAddress *addr;
if (host_port) {
rdma = g_malloc0(sizeof(RDMAContext));
memset(rdma, 0, sizeof(RDMAContext));
rdma->current_index = -1;
rdma->current_chunk = -... | 19,025 |
qemu | 34779e8c3991f7fcd74b2045478abcef67dbeb15 | 1 | static void test_tco_second_timeout_pause(void)
{
TestData td;
const uint16_t ticks = TCO_SECS_TO_TICKS(32);
QDict *ad;
td.args = "-watchdog-action pause";
td.noreboot = false;
test_init(&td);
stop_tco(&td);
clear_tco_status(&td);
reset_on_second_timeout(true);
set... | 19,026 |
FFmpeg | a4f6be86d67ae30d494fbe8a470bc32b715d75a9 | 0 | static void filter_mb_mbaff_edgev( H264Context *h, uint8_t *pix, int stride, const int16_t bS[7], int bsi, int qp ) {
const int qp_bd_offset = 6 * (h->sps.bit_depth_luma - 8);
int index_a = qp - qp_bd_offset + h->slice_alpha_c0_offset;
int alpha = alpha_table[index_a];
int beta = beta_table[qp - qp... | 19,028 |
FFmpeg | c89658008705d949c319df3fa6f400c481ad73e1 | 0 | static int rtsp_read_packet(AVFormatContext *s,
AVPacket *pkt)
{
RTSPState *rt = s->priv_data;
int ret;
RTSPMessageHeader reply1, *reply = &reply1;
char cmd[1024];
if (rt->server_type == RTSP_SERVER_REAL) {
int i;
enum AVDiscard cache[MAX_STREAM... | 19,029 |
FFmpeg | 0faf3c3a25ede9ecfdb1cf68a0f8aef23c25197a | 0 | static int cudaupload_query_formats(AVFilterContext *ctx)
{
static const enum AVPixelFormat input_pix_fmts[] = {
AV_PIX_FMT_NV12, AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV444P,
AV_PIX_FMT_NONE,
};
static const enum AVPixelFormat output_pix_fmts[] = {
AV_PIX_FMT_CUDA, AV_PIX_FMT_NONE,... | 19,030 |
FFmpeg | 6c18f1cda2e2b2471ebf75d30d552cb0cb61b6ad | 0 | static void opt_audio_sample_fmt(const char *arg)
{
if (strcmp(arg, "list"))
audio_sample_fmt = av_get_sample_fmt(arg);
else {
list_fmts(av_get_sample_fmt_string, AV_SAMPLE_FMT_NB);
ffmpeg_exit(0);
}
}
| 19,032 |
FFmpeg | e1b0d3a389ff7050c66f43891539200eddf4af15 | 0 | static int wsvqa_read_header(AVFormatContext *s)
{
WsVqaDemuxContext *wsvqa = s->priv_data;
AVIOContext *pb = s->pb;
AVStream *st;
unsigned char *header;
unsigned char scratch[VQA_PREAMBLE_SIZE];
unsigned int chunk_tag;
unsigned int chunk_size;
int fps;
/* initialize the ... | 19,033 |
FFmpeg | 01e4537f66c6d054f8c7bdbdd5b3cfb4220d12fe | 0 | static void flat_print_str(WriterContext *wctx, const char *key, const char *value)
{
FlatContext *flat = wctx->priv;
AVBPrint buf;
flat_print_key_prefix(wctx);
av_bprint_init(&buf, 1, AV_BPRINT_SIZE_UNLIMITED);
printf("%s=", flat_escape_key_str(&buf, key, flat->sep));
av_bprint_clear(&... | 19,034 |
FFmpeg | b010d9b58651379883b42e58494aaefbab4df648 | 0 | static int nut_write_packet(AVFormatContext *s, AVPacket *pkt){
NUTContext *nut = s->priv_data;
StreamContext *nus= &nut->stream[pkt->stream_index];
AVIOContext *bc = s->pb, *dyn_bc;
FrameCode *fc;
int64_t coded_pts;
int best_length, frame_code, flags, needed_flags, i, header_idx, best_hea... | 19,035 |
FFmpeg | dc3685e12999f106dd8e576e5b7d5543d4f70fa1 | 0 | ff_rm_parse_packet (AVFormatContext *s, ByteIOContext *pb,
AVStream *st, RMStream *ast, int len, AVPacket *pkt,
int *seq, int *flags, int64_t *timestamp)
{
RMDemuxContext *rm = s->priv_data;
if (st->codec->codec_type == CODEC_TYPE_VIDEO) {
rm->current_stre... | 19,036 |
FFmpeg | 90a43060077dbbca7ef161a584e95cbc7466264d | 0 | static int tiff_unpack_strip(TiffContext *s, uint8_t* dst, int stride, const uint8_t *src, int size, int lines){
int c, line, pixels, code;
const uint8_t *ssrc = src;
int width = ((s->width * s->bpp) + 7) >> 3;
#if CONFIG_ZLIB
uint8_t *zbuf; unsigned long outlen;
if(s->compr == TIFF_DEFLATE ... | 19,037 |
FFmpeg | e7a47515abbcf2c8a07c280ea3d04129fc3aaaf6 | 0 | inline static void RENAME(hcscale)(SwsContext *c, uint16_t *dst, long dstWidth, const uint8_t *src1, const uint8_t *src2,
int srcW, int xInc, int flags, const int16_t *hChrFilter,
const int16_t *hChrFilterPos, int hChrFilterSize,
... | 19,038 |
qemu | 65207c59d99f2260c5f1d3b9c491146616a522aa | 1 | static void user_async_cmd_handler(Monitor *mon, const mon_cmd_t *cmd,
const QDict *params)
{
int ret;
MonitorCompletionData *cb_data = g_malloc(sizeof(*cb_data));
cb_data->mon = mon;
cb_data->user_print = cmd->user_print;
monitor_suspend(mon);
ret = ... | 19,039 |
FFmpeg | 56838103020385020469d1da076f0e4a6cbe15e5 | 1 | static int rm_write_audio(AVFormatContext *s, const uint8_t *buf, int size, int flags)
{
uint8_t *buf1;
RMMuxContext *rm = s->priv_data;
AVIOContext *pb = s->pb;
StreamInfo *stream = rm->audio_stream;
int i;
/* XXX: suppress this malloc */
buf1 = av_malloc(size * sizeof(uint8_t));
... | 19,040 |
FFmpeg | 4c3e1956ee35fdcc5ffdb28782050164b4623c0b | 1 | static int lag_decode_frame(AVCodecContext *avctx,
void *data, int *got_frame, AVPacket *avpkt)
{
const uint8_t *buf = avpkt->data;
int buf_size = avpkt->size;
LagarithContext *l = avctx->priv_data;
ThreadFrame frame = { .f = data };
AVFrame *const p = data;
... | 19,042 |
qemu | 966439a67830239a6c520c5df6c55627b8153c8b | 1 | void do_divdo (void)
{
if (likely(!(((int64_t)T0 == INT64_MIN && (int64_t)T1 == -1ULL) ||
(int64_t)T1 == 0))) {
xer_ov = 0;
T0 = (int64_t)T0 / (int64_t)T1;
} else {
xer_so = 1;
xer_ov = 1;
T0 = (-1ULL) * ((uint64_t)T0 >> 63);
}
}
| 19,043 |
qemu | ba56e4cad41ea2b2fb68d18a632ebc7d4e4b1051 | 1 | void framebuffer_update_display(
DisplaySurface *ds,
MemoryRegionSection *mem_section,
int cols, /* Width in pixels. */
int rows, /* Height in pixels. */
int src_width, /* Length of source line, in bytes. */
int dest_row_pitch, /* Bytes between adjacent horizontal output pixels. */
... | 19,044 |
qemu | 4482e05cbbb7e50e476f6a9500cf0b38913bd939 | 1 | SPARCCPU *sparc64_cpu_devinit(const char *cpu_model,
const char *default_cpu_model, uint64_t prom_addr)
{
SPARCCPU *cpu;
CPUSPARCState *env;
ResetData *reset_info;
uint32_t tick_frequency = 100 * 1000000;
uint32_t stick_frequency = 100 * 1000000;
uint32... | 19,045 |
FFmpeg | 0cb7f8a26094c533b7dbe25897198953b6660f15 | 1 | int ff_lzw_decode(LZWState *p, uint8_t *buf, int len){
int l, c, code, oc, fc;
uint8_t *sp;
struct LZWState *s = (struct LZWState *)p;
if (s->end_code < 0)
return 0;
l = len;
sp = s->sp;
oc = s->oc;
fc = s->fc;
for (;;) {
while (sp > s->stack) {
... | 19,046 |
FFmpeg | 319438e2f206036ee0cddf401dd50f3b2a3ae117 | 1 | void ff_hyscale_fast_mmxext(SwsContext *c, int16_t *dst,
int dstWidth, const uint8_t *src,
int srcW, int xInc)
{
int32_t *filterPos = c->hLumFilterPos;
int16_t *filter = c->hLumFilter;
void *mmxextFilterCode = c->lumMmxextFilterCo... | 19,047 |
qemu | 60fe637bf0e4d7989e21e50f52526444765c63b4 | 1 | static int get_int32_equal(QEMUFile *f, void *pv, size_t size)
{
int32_t *v = pv;
int32_t v2;
qemu_get_sbe32s(f, &v2);
if (*v == v2) {
return 0;
}
return -EINVAL;
}
| 19,048 |
FFmpeg | 2caf19e90f270abe1e80a3e85acaf0eb5c9d0aac | 1 | static void FUNCC(pred4x4_vertical)(uint8_t *_src, const uint8_t *topright, int _stride){
pixel *src = (pixel*)_src;
int stride = _stride/sizeof(pixel);
const pixel4 a= ((pixel4*)(src-stride))[0];
((pixel4*)(src+0*stride))[0]= a;
((pixel4*)(src+1*stride))[0]= a;
((pixel4*)(src+2*stride))[0... | 19,049 |
qemu | 778358d0a8f74a76488daea3c1b6fb327d8135b4 | 1 | static OfDpaGroup *of_dpa_group_alloc(uint32_t id)
{
OfDpaGroup *group = g_malloc0(sizeof(OfDpaGroup));
if (!group) {
return NULL;
}
group->id = id;
return group;
}
| 19,050 |
FFmpeg | 01ecb7172b684f1c4b3e748f95c5a9a494ca36ec | 1 | static float get_band_cost_UQUAD_mips(struct AACEncContext *s,
PutBitContext *pb, const float *in,
const float *scaled, int size, int scale_idx,
int cb, const float lambda, const float uplim,
... | 19,052 |
qemu | eaa2e027b73c9afca623d877c91150a94c83049d | 1 | static void sdl_grab_start(void)
{
/*
* If the application is not active, do not try to enter grab state. This
* prevents 'SDL_WM_GrabInput(SDL_GRAB_ON)' from blocking all the
* application (SDL bug).
*/
if (!(SDL_GetAppState() & SDL_APPINPUTFOCUS)) {
return;
}
if (... | 19,053 |
FFmpeg | 220b24c7c97dc033ceab1510549f66d0e7b52ef1 | 1 | static void libschroedinger_free_frame(void *data)
{
FFSchroEncodedFrame *enc_frame = data;
av_freep(&enc_frame->p_encbuf);
av_free(enc_frame);
}
| 19,054 |
FFmpeg | 01ecb7172b684f1c4b3e748f95c5a9a494ca36ec | 1 | static float quantize_band_cost(struct AACEncContext *s, const float *in,
const float *scaled, int size, int scale_idx,
int cb, const float lambda, const float uplim,
int *bits, int rtz)
{
return get_band_cost(s, NU... | 19,055 |
qemu | 898248a32915024a4f01ce4f0c3519509fb703cb | 1 | static void xhci_er_reset(XHCIState *xhci, int v)
{
XHCIInterrupter *intr = &xhci->intr[v];
XHCIEvRingSeg seg;
if (intr->erstsz == 0) {
/* disabled */
intr->er_start = 0;
intr->er_size = 0;
return;
}
/* cache the (sole) event ring segment location */
... | 19,056 |
qemu | 7474f1be701f136b224af5e1abe55e97dc3f29a5 | 1 | DeviceState *qdev_try_create(BusState *bus, const char *type)
{
DeviceState *dev;
if (object_class_by_name(type) == NULL) {
return NULL;
}
dev = DEVICE(object_new(type));
if (!dev) {
return NULL;
}
if (!bus) {
bus = sysbus_get_default();
}
... | 19,057 |
qemu | debfb917a4f9c0784772c86f110f2bcd22e5a14f | 1 | static int iscsi_open(BlockDriverState *bs, QDict *options, int flags,
Error **errp)
{
IscsiLun *iscsilun = bs->opaque;
struct iscsi_context *iscsi = NULL;
struct iscsi_url *iscsi_url = NULL;
struct scsi_task *task = NULL;
struct scsi_inquiry_standard *inq = NULL;
s... | 19,058 |
qemu | b981289c493c7ddabc1cdf7de99daa24642c7739 | 1 | type_init(macio_register_types)
void macio_init(PCIDevice *d,
MemoryRegion *pic_mem,
MemoryRegion *escc_mem)
{
MacIOState *macio_state = MACIO(d);
macio_state->pic_mem = pic_mem;
macio_state->escc_mem = escc_mem;
/* Note: this code is strongly inspirated from ... | 19,059 |
qemu | 6687b79d636cd60ed9adb1177d0d946b58fa7717 | 1 | int net_client_init(QemuOpts *opts, int is_netdev, Error **errp)
{
const char *name;
const char *type;
int i;
type = qemu_opt_get(opts, "type");
if (!type) {
error_set(errp, QERR_MISSING_PARAMETER, "type");
return -1;
}
if (is_netdev) {
if (strcmp(type,... | 19,060 |
qemu | 723aedd53281cfa0997457cb156a59909a75f5a8 | 1 | static void usbredir_handle_interrupt_out_data(USBRedirDevice *dev,
USBPacket *p, uint8_t ep)
{
/* Output interrupt endpoint, normal async operation */
struct usb_redir_interrupt_packet_header interrupt_packet;
uint8_t buf[p->iov.size];
DPRINTF("int... | 19,061 |
FFmpeg | a5e0dbf530d447f36099aed575b34e9258c5d75a | 1 | static void push_output_configuration(AACContext *ac) {
if (ac->oc[1].status == OC_LOCKED || ac->oc[0].status == OC_NONE) {
ac->oc[0] = ac->oc[1];
}
ac->oc[1].status = OC_NONE;
}
| 19,063 |
FFmpeg | 215e197942e33d5c5749d786e938bf7abe856c1d | 1 | dshow_cycle_devices(AVFormatContext *avctx, ICreateDevEnum *devenum,
enum dshowDeviceType devtype, IBaseFilter **pfilter)
{
struct dshow_ctx *ctx = avctx->priv_data;
IBaseFilter *device_filter = NULL;
IEnumMoniker *classenum = NULL;
IMoniker *m = NULL;
const char *device_n... | 19,064 |
FFmpeg | ac424b23e404a53bb88e36496fac94d2ff9dd775 | 1 | pp_context *pp_get_context(int width, int height, int cpuCaps){
PPContext *c= av_mallocz(sizeof(PPContext));
int stride= FFALIGN(width, 16); //assumed / will realloc if needed
int qpStride= (width+15)/16 + 2; //assumed / will realloc if needed
c->av_class = &av_codec_context_class;
if(cpuCaps&PP_FO... | 19,066 |
FFmpeg | e07c82688e8187dbafac489b7c15427252974021 | 1 | static void store_slice_c(uint8_t *dst, const int16_t *src,
int dst_stride, int src_stride,
int width, int height, int log2_scale)
{
int y, x;
#define STORE(pos) do { \
temp = ((src[x + y * src_stride... | 19,067 |
qemu | c9ad19c57b4e35dda507ec636443069048a4ad72 | 1 | void helper_fxtract(void)
{
CPU86_LDoubleU temp;
unsigned int expdif;
temp.d = ST0;
expdif = EXPD(temp) - EXPBIAS;
/*DP exponent bias*/
ST0 = expdif;
fpush();
BIASEXPONENT(temp);
ST0 = temp.d;
}
| 19,068 |
qemu | 5c6c0e513600ba57c3e73b7151d3c0664438f7b5 | 1 | static void usb_msd_cancel_io(USBPacket *p, void *opaque)
{
MSDState *s = opaque;
s->scsi_dev->info->cancel_io(s->scsi_dev, s->tag);
s->packet = NULL;
s->scsi_len = 0;
}
| 19,069 |
qemu | 5f758366c0710d23e43f4d0f83816b98616a13d0 | 1 | static CharDriverState *qmp_chardev_open_udp(ChardevUdp *udp,
Error **errp)
{
int fd;
fd = socket_dgram(udp->remote, udp->local, errp);
if (error_is_set(errp)) {
return NULL;
}
return qemu_chr_open_udp_fd(fd);
}
| 19,070 |
FFmpeg | f6774f905fb3cfdc319523ac640be30b14c1bc55 | 1 | static av_always_inline void MPV_motion_internal(MpegEncContext *s,
uint8_t *dest_y,
uint8_t *dest_cb,
uint8_t *dest_cr,
... | 19,071 |
FFmpeg | 95fee70d6773fde1c34ff6422f48e5e66f37f263 | 1 | static av_cold int imc_decode_init(AVCodecContext * avctx)
{
int i, j;
IMCContext *q = avctx->priv_data;
double r1, r2;
q->decoder_reset = 1;
for(i = 0; i < BANDS; i++)
q->old_floor[i] = 1.0;
/* Build mdct window, a simple sine window normalized with sqrt(2) */
ff_sine... | 19,072 |
FFmpeg | aa3c77998404cc32233cb76e961ca27db8565459 | 1 | int av_append_packet(AVIOContext *s, AVPacket *pkt, int size)
{
int ret;
int old_size;
if (!pkt->size)
return av_get_packet(s, pkt, size);
old_size = pkt->size;
ret = av_grow_packet(pkt, size);
if (ret < 0)
return ret;
ret = avio_read(s, pkt->data + old_size, size);... | 19,073 |
FFmpeg | 8bedbb82cee4463a43e60eb22674c8bf927280ef | 1 | int ff_j2k_init_component(Jpeg2000Component *comp,
Jpeg2000CodingStyle *codsty,
Jpeg2000QuantStyle *qntsty,
int cbps, int dx, int dy,
AVCodecContext *avctx)
{
uint8_t log2_band_prec_width, log2_band_prec_he... | 19,074 |
qemu | 4ae4b609ee2d5bcc9df6c03c21dc1fed527aada1 | 1 | static void gen_stx(DisasContext *dc, uint32_t code, uint32_t flags)
{
I_TYPE(instr, code);
TCGv val = load_gpr(dc, instr.b);
TCGv addr = tcg_temp_new();
tcg_gen_addi_tl(addr, load_gpr(dc, instr.a), instr.imm16s);
tcg_gen_qemu_st_tl(val, addr, dc->mem_idx, flags);
tcg_temp_free(addr);
... | 19,076 |
FFmpeg | f92f4935acd7d974adfd1deebdf1bb06cbe107ca | 1 | static void down_heap(uint32_t nr_heap, uint32_t *heap, uint32_t *weights)
{
uint32_t val = 1;
uint32_t val2;
uint32_t initial_val = heap[val];
while (1) {
val2 = val << 1;
if (val2 > nr_heap)
break;
if (val2 < nr_heap && weights[heap[val2 + 1]] < weigh... | 19,077 |
FFmpeg | d7e9533aa06f4073a27812349b35ba5fede11ca1 | 1 | static void dct_unquantize_mpeg1_mmx(MpegEncContext *s,
DCTELEM *block, int n, int qscale)
{
int nCoeffs;
const UINT16 *quant_matrix;
if(s->alternate_scan) nCoeffs= 64;
else nCoeffs= nCoeffs= zigzag_end[ s->block_last_index[n] ];
if (s->mb_intra) {... | 19,078 |
FFmpeg | 571572fcddc16ebe3d60054ae5a2db05800c1d6d | 1 | void RENAME(ff_init_mpadsp_tabs)(void)
{
int i, j;
/* compute mdct windows */
for (i = 0; i < 36; i++) {
for (j = 0; j < 4; j++) {
double d;
if (j == 2 && i % 3 != 1)
continue;
d = sin(M_PI * (i + 0.5) / 36.0);
if (j == 1)... | 19,079 |
qemu | 857d4f46c31d2f4d57d2f0fad9dfb584262bf9b9 | 1 | static int coroutine_fn bdrv_co_do_copy_on_readv(BlockDriverState *bs,
int64_t sector_num, int nb_sectors, QEMUIOVector *qiov)
{
/* Perform I/O through a temporary buffer so that users who scribble over
* their read buffer while the operation is in progress do not end up
* modifying the image... | 19,080 |
qemu | d3f8e138c23ba082f87c96634d06b978473c1e9b | 1 | static int local_create_mapped_attr_dir(FsContext *ctx, const char *path)
{
int err;
char attr_dir[PATH_MAX];
char *tmp_path = strdup(path);
snprintf(attr_dir, PATH_MAX, "%s/%s/%s",
ctx->fs_root, dirname(tmp_path), VIRTFS_META_DIR);
err = mkdir(attr_dir, 0700);
if (err <... | 19,081 |
qemu | af7e9e74c6a62a5bcd911726a9e88d28b61490e0 | 1 | static int openpic_init(SysBusDevice *dev)
{
OpenPICState *opp = FROM_SYSBUS(typeof (*opp), dev);
int i, j;
struct memreg list_le[] = {
{"glb", &openpic_glb_ops_le, true,
OPENPIC_GLB_REG_START, OPENPIC_GLB_REG_SIZE},
{"tmr", &openpic_tmr_ops_le, true,
... | 19,083 |
FFmpeg | 1255eed533b4069db7f205601953ca54c0dc42c9 | 1 | static int tgq_decode_frame(AVCodecContext *avctx,
void *data, int *data_size,
AVPacket *avpkt){
const uint8_t *buf = avpkt->data;
int buf_size = avpkt->size;
const uint8_t *buf_start = buf;
const uint8_t *buf_end = buf + buf_size;
TgqCo... | 19,084 |
FFmpeg | 2e391a576c1fc2e8816990924c6e4c21ccf75a82 | 1 | static int handle_packet(MpegTSContext *ts, const uint8_t *packet)
{
MpegTSFilter *tss;
int len, pid, cc, expected_cc, cc_ok, afc, is_start, is_discontinuity,
has_adaptation, has_payload;
const uint8_t *p, *p_end;
int64_t pos;
pid = AV_RB16(packet + 1) & 0x1fff;
if (pid && discard_pid(ts... | 19,085 |
qemu | f3a06403b82c7f036564e4caf18b52ce6885fcfb | 1 | void qmp_guest_suspend_disk(Error **errp)
{
Error *local_err = NULL;
GuestSuspendMode *mode = g_malloc(sizeof(GuestSuspendMode));
*mode = GUEST_SUSPEND_MODE_DISK;
check_suspend_mode(*mode, &local_err);
acquire_privilege(SE_SHUTDOWN_NAME, &local_err);
execute_async(do_suspend, mode, &loc... | 19,086 |
qemu | b0a0551283076c6f3e57cf2bdd525334009b2677 | 0 | static void kvm_pit_put(PITCommonState *pit)
{
KVMPITState *s = KVM_PIT(pit);
struct kvm_pit_state2 kpit;
struct kvm_pit_channel_state *kchan;
struct PITChannelState *sc;
int i, ret;
/* The offset keeps changing as long as the VM is stopped. */
if (s->vm_stopped) {
kvm_pit... | 19,088 |
qemu | 69970fcef937bddd7f745efe39501c7716fdfe56 | 0 | static void vfio_rtl8168_window_quirk_write(void *opaque, hwaddr addr,
uint64_t data, unsigned size)
{
VFIOQuirk *quirk = opaque;
VFIOPCIDevice *vdev = quirk->vdev;
switch (addr) {
case 4: /* address */
if ((data & 0x7fff0000) == 0x10000) {
... | 19,089 |
qemu | 6fc76aa9adc1c8896a97059f12a1e5e6c1820c64 | 0 | static void hash32_bat_601_size(CPUPPCState *env, target_ulong *blp, int *validp,
target_ulong batu, target_ulong batl)
{
target_ulong bl;
int valid;
bl = (batl & BATL32_601_BL) << 17;
LOG_BATS("b %02x ==> bl " TARGET_FMT_lx " msk " TARGET_FMT_lx "\n",
... | 19,091 |
qemu | 9be385980d37e8f4fd33f605f5fb1c3d144170a8 | 0 | static size_t cache_get_cache_pos(const PageCache *cache,
uint64_t address)
{
size_t pos;
g_assert(cache->max_num_items);
pos = (address / cache->page_size) & (cache->max_num_items - 1);
return pos;
}
| 19,092 |
qemu | 8bba5c81b1febeb20cdd60f1c18eb0e695cad6d6 | 0 | void vnc_display_init(DisplayState *ds)
{
VncState *vs;
vs = qemu_mallocz(sizeof(VncState));
if (!vs)
exit(1);
ds->opaque = vs;
vnc_state = vs;
vs->display = NULL;
vs->password = NULL;
vs->lsock = -1;
vs->csock = -1;
vs->depth = 4;
vs->last_x = -1;
vs... | 19,093 |
qemu | 72cf2d4f0e181d0d3a3122e04129c58a95da713e | 0 | QemuOpts *qemu_opts_find(QemuOptsList *list, const char *id)
{
QemuOpts *opts;
TAILQ_FOREACH(opts, &list->head, next) {
if (!opts->id) {
continue;
}
if (strcmp(opts->id, id) != 0) {
continue;
}
return opts;
}
return NULL;
}
| 19,094 |
qemu | cea5f9a28faa528b6b1b117c9ab2d8828f473fef | 0 | static inline TranslationBlock *tb_find_fast(void)
{
TranslationBlock *tb;
target_ulong cs_base, pc;
int flags;
/* we record a subset of the CPU state. It will
always be the same before a given translated block
is executed. */
cpu_get_tb_cpu_state(env, &pc, &cs_base, &flags);... | 19,095 |
qemu | c2b38b277a7882a592f4f2ec955084b2b756daaa | 0 | static void aio_timerlist_notify(void *opaque)
{
aio_notify(opaque);
}
| 19,096 |
qemu | 72cf2d4f0e181d0d3a3122e04129c58a95da713e | 0 | void qdev_free(DeviceState *dev)
{
#if 0 /* FIXME: need sane vmstate_unregister function */
if (dev->info->vmsd)
vmstate_unregister(dev->info->vmsd, dev);
#endif
if (dev->info->reset)
qemu_unregister_reset(dev->info->reset, dev);
LIST_REMOVE(dev, sibling);
qemu_free(dev);
}
| 19,097 |
FFmpeg | 3425501d3b09650c6b295ba225e02e97c002372c | 0 | static inline void write_back_motion(H264Context *h, int mb_type){
MpegEncContext * const s = &h->s;
const int b_xy = 4*s->mb_x + 4*s->mb_y*h->b_stride;
const int b8_xy= 2*s->mb_x + 2*s->mb_y*h->b8_stride;
int list;
if(!USES_LIST(mb_type, 0))
fill_rectangle(&s->current_picture.ref_in... | 19,098 |
qemu | 1687a089f103f9b7a1b4a1555068054cb46ee9e9 | 0 | cac_new_pki_applet(int i, const unsigned char *cert,
int cert_len, VCardKey *key)
{
VCardAppletPrivate *applet_private = NULL;
VCardApplet *applet = NULL;
unsigned char pki_aid[] = { 0xa0, 0x00, 0x00, 0x00, 0x79, 0x01, 0x00 };
int pki_aid_len = sizeof(pki_aid);
pki_aid[pk... | 19,100 |
qemu | a8170e5e97ad17ca169c64ba87ae2f53850dab4c | 0 | static void omap_rtc_write(void *opaque, target_phys_addr_t addr,
uint64_t value, unsigned size)
{
struct omap_rtc_s *s = (struct omap_rtc_s *) opaque;
int offset = addr & OMAP_MPUI_REG_MASK;
struct tm new_tm;
time_t ti[2];
if (size != 1) {
return omap_ba... | 19,101 |
qemu | a12a712a7dfbd2e2f4882ef2c90a9b2162166dd7 | 0 | static void nbd_recv_coroutines_enter_all(BlockDriverState *bs)
{
NBDClientSession *s = nbd_get_client_session(bs);
int i;
for (i = 0; i < MAX_NBD_REQUESTS; i++) {
if (s->recv_coroutine[i]) {
qemu_coroutine_enter(s->recv_coroutine[i]);
}
}
BDRV_POLL_WHILE(bs, s... | 19,103 |
qemu | 67c5322d7000fd105a926eec44bc1765b7d70bdd | 0 | static void serial_xmit(void *opaque)
{
SerialState *s = opaque;
uint64_t new_xmit_ts = qemu_get_clock_ns(vm_clock);
if (s->tsr_retry <= 0) {
if (s->fcr & UART_FCR_FE) {
s->tsr = fifo_get(s,XMIT_FIFO);
if (!s->xmit_fifo.count)
s->lsr |= UART_LSR_THRE... | 19,104 |
qemu | 2e8bc7874bb674b7d6837706b1249bf871941637 | 0 | static int64_t coroutine_fn bdrv_co_get_block_status_above(BlockDriverState *bs,
BlockDriverState *base,
bool want_zero,
int64_t sector_num,
int nb_sectors,
int *pnum,
BlockDriverState **file)
{
BlockDriverState *p;
int64_t ret = 0;
bool first = true... | 19,105 |
qemu | bd269ebc82fbaa5fe7ce5bc7c1770ac8acecd884 | 0 | static void socket_start_incoming_migration(SocketAddressLegacy *saddr,
Error **errp)
{
QIOChannelSocket *listen_ioc = qio_channel_socket_new();
qio_channel_set_name(QIO_CHANNEL(listen_ioc),
"migration-socket-listener");
if (qio_... | 19,106 |
qemu | 81607cbfa433272d1f09bd0f0ae6c3b14f818972 | 0 | QemuOpts *vnc_parse_func(const char *str)
{
QemuOptsList *olist = qemu_find_opts("vnc");
QemuOpts *opts = qemu_opts_parse(olist, str, 1);
const char *id = qemu_opts_id(opts);
if (!id) {
/* auto-assign id if not present */
vnc_auto_assign_id(olist, opts);
}
return opts;... | 19,107 |
FFmpeg | 7a4f74eed51f914e9bbfebaffd4a92ac6791f819 | 0 | static void flush_dpb(AVCodecContext *avctx)
{
H264Context *h = avctx->priv_data;
int i;
memset(h->delayed_pic, 0, sizeof(h->delayed_pic));
ff_h264_flush_change(h);
if (h->DPB)
for (i = 0; i < H264_MAX_PICTURE_COUNT; i++)
ff_h264_unref_picture(h, &h->DPB[i]);
h... | 19,109 |
qemu | 67a0fd2a9bca204d2b39f910a97c7137636a0715 | 0 | static int64_t coroutine_fn vdi_co_get_block_status(BlockDriverState *bs,
int64_t sector_num, int nb_sectors, int *pnum)
{
/* TODO: Check for too large sector_num (in bdrv_is_allocated or here). */
BDRVVdiState *s = (BDRVVdiState *)bs->opaque;
size_t bmap_index = sector_num / s->block_sectors;
... | 19,110 |
qemu | 0b5a24454fc551f0294fe93821e8c643214a55f5 | 0 | static void coroutine_fn bdrv_aio_flush_co_entry(void *opaque)
{
BlockAIOCBCoroutine *acb = opaque;
BlockDriverState *bs = acb->common.bs;
acb->req.error = bdrv_co_flush(bs);
acb->bh = aio_bh_new(bdrv_get_aio_context(bs), bdrv_co_em_bh, acb);
qemu_bh_schedule(acb->bh);
}
| 19,111 |
qemu | 364031f17932814484657e5551ba12957d993d7e | 0 | int qemu_v9fs_synth_add_file(V9fsSynthNode *parent, int mode,
const char *name, v9fs_synth_read read,
v9fs_synth_write write, void *arg)
{
int ret;
V9fsSynthNode *node, *tmp;
if (!v9fs_synth_fs) {
return EAGAIN;
}
if (!name... | 19,112 |
qemu | bb628e1af8b8b5ecf6420e50123cb696ee18b09f | 0 | static void usage(const char *name)
{
(printf) (
"Usage: %s [OPTIONS] FILE\n"
"QEMU Disk Network Block Device Server\n"
"\n"
" -h, --help display this help and exit\n"
" -V, --version output version information and exit\n"
"\n"
"Connection properties:\n"
" -p, --port=PORT ... | 19,113 |
qemu | 72cf2d4f0e181d0d3a3122e04129c58a95da713e | 0 | static void run_dependent_requests(QCowL2Meta *m)
{
QCowAIOCB *req;
QCowAIOCB *next;
/* Take the request off the list of running requests */
if (m->nb_clusters != 0) {
LIST_REMOVE(m, next_in_flight);
}
/*
* Restart all dependent requests.
* Can't use LIST_FOREACH ... | 19,114 |
qemu | 9a10bbb4e83b184faef6fa744396a6775283c0aa | 0 | static void vt82c686b_pm_realize(PCIDevice *dev, Error **errp)
{
VT686PMState *s = DO_UPCAST(VT686PMState, dev, dev);
uint8_t *pci_conf;
pci_conf = s->dev.config;
pci_set_word(pci_conf + PCI_COMMAND, 0);
pci_set_word(pci_conf + PCI_STATUS, PCI_STATUS_FAST_BACK |
PCI_STATUS_... | 19,117 |
qemu | 9be385980d37e8f4fd33f605f5fb1c3d144170a8 | 0 | static int load_refcount_block(BlockDriverState *bs,
int64_t refcount_block_offset,
void **refcount_block)
{
BDRVQcow2State *s = bs->opaque;
int ret;
BLKDBG_EVENT(bs->file, BLKDBG_REFBLOCK_LOAD);
ret = qcow2_cache_get(bs, s->refcount... | 19,118 |
qemu | 42a268c241183877192c376d03bd9b6d527407c7 | 0 | static inline void gen_branch_cond(DisasContext *ctx, TCGCond cond, TCGv r1,
TCGv r2, int16_t address)
{
int jumpLabel;
jumpLabel = gen_new_label();
tcg_gen_brcond_tl(cond, r1, r2, jumpLabel);
gen_goto_tb(ctx, 1, ctx->next_pc);
gen_set_label(jumpLabel);
... | 19,121 |
qemu | 5a7e7a0bad17c96e03f55ed7019e2d7545e21a96 | 0 | void qmp_drive_mirror(const char *device, const char *target,
bool has_format, const char *format,
bool has_node_name, const char *node_name,
bool has_replaces, const char *replaces,
enum MirrorSyncMode sync,
... | 19,123 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.