本文整理汇总了C++中qemu_chr_add_handlers函数的典型用法代码示例。如果您正苦于以下问题:C++ qemu_chr_add_handlers函数的具体用法?C++ qemu_chr_add_handlers怎么用?C++ qemu_chr_add_handlers使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了qemu_chr_add_handlers函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: generic_port_init
static int generic_port_init(VirtConsole *vcon, VirtIOSerialPort *port)
{
if (vcon->chr) {
qemu_chr_add_handlers(vcon->chr, chr_can_read, chr_read, chr_event,
vcon);
vcon->port.info->have_data = flush_buf;
}
return 0;
}
示例2: debugcon_init_core
static void debugcon_init_core(DebugconState *s)
{
if (!s->chr) {
fprintf(stderr, "Can't create debugcon device, empty char device\n");
exit(1);
}
qemu_chr_add_handlers(s->chr, NULL, NULL, NULL, s);
}
示例3: milkymist_uart_realize
static void milkymist_uart_realize(DeviceState *dev, Error **errp)
{
MilkymistUartState *s = MILKYMIST_UART(dev);
s->chr = qemu_char_get_next_serial();
if (s->chr) {
qemu_chr_add_handlers(s->chr, uart_can_rx, uart_rx, uart_event, s);
}
}
示例4: etraxfs_ser_realize
static void etraxfs_ser_realize(DeviceState *dev, Error **errp)
{
ETRAXSerial *s = ETRAX_SERIAL(dev);
if (s->chr) {
qemu_chr_add_handlers(s->chr,
serial_can_receive, serial_receive,
serial_event, s);
}
}
示例5: modem_driver_init
static void
modem_driver_init( int base_port, ModemDriver* dm, CharDriverState* cs )
{
dm->cs = cs;
dm->in_pos = 0;
dm->in_sms = 0;
dm->modem = amodem_create( base_port, modem_driver_unsol, dm );
qemu_chr_add_handlers( cs, modem_driver_can_read, modem_driver_read, NULL, dm );
}
示例6: release_chr
static void release_chr(Object *obj, const char *name, void *opaque)
{
DeviceState *dev = DEVICE(obj);
Property *prop = opaque;
CharDriverState **ptr = qdev_get_prop_ptr(dev, prop);
if (*ptr) {
qemu_chr_add_handlers(*ptr, NULL, NULL, NULL, NULL);
}
}
示例7: digic_uart_realize
static void digic_uart_realize(DeviceState *dev, Error **errp)
{
DigicUartState *s = DIGIC_UART(dev);
/* FIXME use a qdev chardev prop instead of qemu_char_get_next_serial() */
s->chr = qemu_char_get_next_serial();
if (s->chr) {
qemu_chr_add_handlers(s->chr, uart_can_rx, uart_rx, uart_event, s);
}
}
示例8: charbuffer_update_handlers
static void
charbuffer_update_handlers( CharDriverState* cs )
{
CharBuffer* cbuf = cs->opaque;
qemu_chr_add_handlers( cbuf->endpoint,
cs->chr_can_read,
cs->chr_read,
cs->chr_event,
cs->handler_opaque );
}
示例9: ipmi_bmc_extern_realize
static void ipmi_bmc_extern_realize(DeviceState *dev, Error **errp)
{
IPMIBmcExtern *ibe = IPMI_BMC_EXTERN(dev);
if (!ibe->chr) {
error_setg(errp, "IPMI external bmc requires chardev attribute");
return;
}
qemu_chr_add_handlers(ibe->chr, can_receive, receive, chr_event, ibe);
}
示例10: test_server_create_chr
static void test_server_create_chr(TestServer *server, const gchar *opt)
{
gchar *chr_path;
chr_path = g_strdup_printf("unix:%s%s", server->socket_path, opt);
server->chr = qemu_chr_new(server->chr_name, chr_path, NULL);
g_free(chr_path);
qemu_chr_add_handlers(server->chr, chr_can_read, chr_read,
chr_event, server);
}
示例11: lm32_juart_init
static int lm32_juart_init(SysBusDevice *dev)
{
LM32JuartState *s = FROM_SYSBUS(typeof(*s), dev);
s->chr = qemu_char_get_next_serial();
if (s->chr) {
qemu_chr_add_handlers(s->chr, juart_can_rx, juart_rx, juart_event, s);
}
return 0;
}
示例12: imx_serial_realize
static void imx_serial_realize(DeviceState *dev, Error **errp)
{
IMXSerialState *s = IMX_SERIAL(dev);
if (s->chr) {
qemu_chr_add_handlers(s->chr, imx_can_receive, imx_receive,
imx_event, s);
} else {
DPRINTF("No char dev for uart\n");
}
}
示例13: serial_init_core
static void serial_init_core(SerialState *s)
{
if (!s->chr) {
fprintf(stderr, "Can't create radio device, empty char device\n");
exit(1);
}
qemu_register_reset(radio_reset, s);
qemu_chr_add_handlers(s->chr, serial_can_receive1, serial_receive1,
serial_event, s);
}
示例14: generic_port_init
static int generic_port_init(VirtConsole *vcon, VirtIOSerialDevice *dev)
{
vcon->port.info = dev->info;
if (vcon->chr) {
qemu_chr_add_handlers(vcon->chr, &chr_handlers, vcon);
vcon->port.info->have_data = flush_buf;
vcon->port.info->guest_open = guest_open;
vcon->port.info->guest_close = guest_close;
}
return 0;
}
示例15: bcm2835_aux_realize
static void bcm2835_aux_realize(DeviceState *dev, Error **errp)
{
BCM2835AuxState *s = BCM2835_AUX(dev);
/* FIXME use a qdev chardev prop instead of qemu_char_get_next_serial() */
s->chr = qemu_char_get_next_serial();
if (s->chr) {
qemu_chr_add_handlers(s->chr, bcm2835_aux_can_receive,
bcm2835_aux_receive, bcm2835_aux_event, s);
}
}