VFIO - Virtual Function I/O
Co-Authored-By: richardg867 <540874+richardg867@users.noreply.github.com>
This commit is contained in:
@@ -185,6 +185,7 @@ cmake_dependent_option(SIO_DETECT "Super I/O Detection Helper"
|
|||||||
cmake_dependent_option(WACOM "Wacom Input Devices" ON "DEV_BRANCH" OFF)
|
cmake_dependent_option(WACOM "Wacom Input Devices" ON "DEV_BRANCH" OFF)
|
||||||
cmake_dependent_option(XL24 "ATI VGA Wonder XL24 (ATI-28800-6)" ON "DEV_BRANCH" OFF)
|
cmake_dependent_option(XL24 "ATI VGA Wonder XL24 (ATI-28800-6)" ON "DEV_BRANCH" OFF)
|
||||||
cmake_dependent_option(NETSWITCH "Network Switch Support" ON "DEV_BRANCH" OFF)
|
cmake_dependent_option(NETSWITCH "Network Switch Support" ON "DEV_BRANCH" OFF)
|
||||||
|
cmake_dependent_option(VFIO "Virtual Function I/O" ON "DEV_BRANCH" OFF)
|
||||||
|
|
||||||
# Ditto but for Qt
|
# Ditto but for Qt
|
||||||
if(QT)
|
if(QT)
|
||||||
|
|||||||
@@ -107,6 +107,7 @@
|
|||||||
#include <86box/apm.h>
|
#include <86box/apm.h>
|
||||||
#include <86box/acpi.h>
|
#include <86box/acpi.h>
|
||||||
#include <86box/nv/vid_nv_rivatimer.h>
|
#include <86box/nv/vid_nv_rivatimer.h>
|
||||||
|
#include <86box/vfio.h>
|
||||||
|
|
||||||
// Disable c99-designator to avoid the warnings about int ng
|
// Disable c99-designator to avoid the warnings about int ng
|
||||||
#ifdef __clang__
|
#ifdef __clang__
|
||||||
@@ -1646,6 +1647,11 @@ pc_reset_hard_init(void)
|
|||||||
the chances of the SCSI controller ending up on the bridge. */
|
the chances of the SCSI controller ending up on the bridge. */
|
||||||
video_voodoo_init();
|
video_voodoo_init();
|
||||||
|
|
||||||
|
#if defined(USE_VFIO) && defined(__linux__)
|
||||||
|
/* Initialize VFIO */
|
||||||
|
vfio_init();
|
||||||
|
#endif
|
||||||
|
|
||||||
/* installs first game port if no device provides one, must be late */
|
/* installs first game port if no device provides one, must be late */
|
||||||
if (joystick_type[0])
|
if (joystick_type[0])
|
||||||
gameport_update_joystick_type(0);
|
gameport_update_joystick_type(0);
|
||||||
|
|||||||
@@ -103,6 +103,16 @@ if(VNC)
|
|||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if(CMAKE_SYSTEM_NAME MATCHES "Linux")
|
||||||
|
if(VFIO)
|
||||||
|
include(CheckIncludeFile)
|
||||||
|
check_include_file("linux/vfio.h" VFIO_AVAILABLE)
|
||||||
|
if(VFIO_AVAILABLE)
|
||||||
|
add_compile_definitions(USE_VFIO)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
if(INSTRUMENT)
|
if(INSTRUMENT)
|
||||||
add_compile_definitions(USE_INSTRUMENT)
|
add_compile_definitions(USE_INSTRUMENT)
|
||||||
endif()
|
endif()
|
||||||
|
|||||||
@@ -81,6 +81,17 @@ if(ISAMEM_BRAT)
|
|||||||
target_compile_definitions(dev PRIVATE USE_ISAMEM_BRAT)
|
target_compile_definitions(dev PRIVATE USE_ISAMEM_BRAT)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if(CMAKE_SYSTEM_NAME MATCHES "Linux")
|
||||||
|
if(VFIO)
|
||||||
|
include(CheckIncludeFile)
|
||||||
|
check_include_file("linux/vfio.h" VFIO_AVAILABLE)
|
||||||
|
if(VFIO_AVAILABLE)
|
||||||
|
add_compile_definitions(USE_VFIO)
|
||||||
|
target_sources(dev PRIVATE vfio.c)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
if(LASERXT)
|
if(LASERXT)
|
||||||
target_compile_definitions(dev PRIVATE USE_LASERXT)
|
target_compile_definitions(dev PRIVATE USE_LASERXT)
|
||||||
endif()
|
endif()
|
||||||
|
|||||||
3377
src/device/vfio.c
Normal file
3377
src/device/vfio.c
Normal file
File diff suppressed because it is too large
Load Diff
20
src/include/86box/vfio.h
Normal file
20
src/include/86box/vfio.h
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
/*
|
||||||
|
* 86Box A hypervisor and IBM PC system emulator that specializes in
|
||||||
|
* running old operating systems and software designed for IBM
|
||||||
|
* PC systems and compatibles from 1981 through fairly recent
|
||||||
|
* system designs based on the PCI bus.
|
||||||
|
*
|
||||||
|
* This file is part of the 86Box distribution.
|
||||||
|
*
|
||||||
|
* Definitions for Virtual Function I/O PCI passthrough.
|
||||||
|
*
|
||||||
|
* Authors: RichardG, <richardg867@gmail.com>
|
||||||
|
*
|
||||||
|
* Copyright 2021-2025 RichardG.
|
||||||
|
*/
|
||||||
|
#if !defined(EMU_VFIO_H) && defined(USE_VFIO)
|
||||||
|
# define EMU_VFIO_H
|
||||||
|
|
||||||
|
extern void vfio_init(void);
|
||||||
|
|
||||||
|
#endif
|
||||||
Reference in New Issue
Block a user