mbochs.c (da44c340c4fe9d9653ae84fa6a60f406bafcffce) mbochs.c (290aac5df88a83e264b3a73ec146e5e5b3c45793)
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * Mediated virtual PCI display host device driver
4 *
5 * Emulate enough of qemu stdvga to make bochs-drm.ko happy. That is
6 * basically the vram memory bar and the bochs dispi interface vbe
7 * registers in the mmio register bar. Specifically it does *not*
8 * include any legacy vga stuff. Device looks a lot like "qemu -device

--- 1370 unchanged lines hidden (view full) ---

1379 struct mbochs_type *type =
1380 container_of(mtype, struct mbochs_type, type);
1381 int count = atomic_read(&mbochs_avail_mbytes) / type->mbytes;
1382
1383 return sprintf(buf, "%d\n", count);
1384}
1385static MDEV_TYPE_ATTR_RO(available_instances);
1386
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * Mediated virtual PCI display host device driver
4 *
5 * Emulate enough of qemu stdvga to make bochs-drm.ko happy. That is
6 * basically the vram memory bar and the bochs dispi interface vbe
7 * registers in the mmio register bar. Specifically it does *not*
8 * include any legacy vga stuff. Device looks a lot like "qemu -device

--- 1370 unchanged lines hidden (view full) ---

1379 struct mbochs_type *type =
1380 container_of(mtype, struct mbochs_type, type);
1381 int count = atomic_read(&mbochs_avail_mbytes) / type->mbytes;
1382
1383 return sprintf(buf, "%d\n", count);
1384}
1385static MDEV_TYPE_ATTR_RO(available_instances);
1386
1387static ssize_t device_api_show(struct mdev_type *mtype,
1388 struct mdev_type_attribute *attr, char *buf)
1389{
1390 return sprintf(buf, "%s\n", VFIO_DEVICE_API_PCI_STRING);
1391}
1392static MDEV_TYPE_ATTR_RO(device_api);
1393
1394static const struct attribute *mdev_types_attrs[] = {
1395 &mdev_type_attr_name.attr,
1396 &mdev_type_attr_description.attr,
1387static const struct attribute *mdev_types_attrs[] = {
1388 &mdev_type_attr_name.attr,
1389 &mdev_type_attr_description.attr,
1397 &mdev_type_attr_device_api.attr,
1398 &mdev_type_attr_available_instances.attr,
1399 NULL,
1400};
1401
1402static const struct vfio_device_ops mbochs_dev_ops = {
1403 .close_device = mbochs_close_device,
1404 .init = mbochs_init_dev,
1405 .release = mbochs_release_dev,
1406 .read = mbochs_read,
1407 .write = mbochs_write,
1408 .ioctl = mbochs_ioctl,
1409 .mmap = mbochs_mmap,
1410};
1411
1412static struct mdev_driver mbochs_driver = {
1390 &mdev_type_attr_available_instances.attr,
1391 NULL,
1392};
1393
1394static const struct vfio_device_ops mbochs_dev_ops = {
1395 .close_device = mbochs_close_device,
1396 .init = mbochs_init_dev,
1397 .release = mbochs_release_dev,
1398 .read = mbochs_read,
1399 .write = mbochs_write,
1400 .ioctl = mbochs_ioctl,
1401 .mmap = mbochs_mmap,
1402};
1403
1404static struct mdev_driver mbochs_driver = {
1405 .device_api = VFIO_DEVICE_API_PCI_STRING,
1413 .driver = {
1414 .name = "mbochs",
1415 .owner = THIS_MODULE,
1416 .mod_name = KBUILD_MODNAME,
1417 .dev_groups = mdev_dev_groups,
1418 },
1419 .probe = mbochs_probe,
1420 .remove = mbochs_remove,

--- 81 unchanged lines hidden ---
1406 .driver = {
1407 .name = "mbochs",
1408 .owner = THIS_MODULE,
1409 .mod_name = KBUILD_MODNAME,
1410 .dev_groups = mdev_dev_groups,
1411 },
1412 .probe = mbochs_probe,
1413 .remove = mbochs_remove,

--- 81 unchanged lines hidden ---