git: 61429b49d2bd - main - bhyve: Conditionally compile framebuffer-related code

From: Mark Johnston <markj_at_FreeBSD.org>
Date: Wed, 04 Oct 2023 16:54:10 UTC
The branch main has been updated by markj:

URL: https://cgit.FreeBSD.org/src/commit/?id=61429b49d2bd4fdad37e0873b2fc085eacbd26b2

commit 61429b49d2bd4fdad37e0873b2fc085eacbd26b2
Author:     Mark Johnston <markj@FreeBSD.org>
AuthorDate: 2023-10-04 16:25:47 +0000
Commit:     Mark Johnston <markj@FreeBSD.org>
CommitDate: 2023-10-04 16:53:17 +0000

    bhyve: Conditionally compile framebuffer-related code
    
    The arm64 port does not implement VGA, so move the device model sources.
    Compile framebuffer code only on amd64 for now, but do not move the
    sources, as we ought to be able to add support later.
    
    No functional change intended.
    
    Reviewed by:    corvink, jhb
    MFC after:      1 week
    Sponsored by:   Innovate UK
    Differential Revision:  https://reviews.freebsd.org/D40740
---
 usr.sbin/bhyve/Makefile           | 3 ---
 usr.sbin/bhyve/amd64/Makefile.inc | 3 +++
 usr.sbin/bhyve/{ => amd64}/vga.c  | 0
 usr.sbin/bhyve/{ => amd64}/vga.h  | 0
 usr.sbin/bhyve/pci_fbuf.c         | 5 +++--
 5 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/usr.sbin/bhyve/Makefile b/usr.sbin/bhyve/Makefile
index 5aaf0d4ea2a0..1bb3c9a1b053 100644
--- a/usr.sbin/bhyve/Makefile
+++ b/usr.sbin/bhyve/Makefile
@@ -37,7 +37,6 @@ SRCS=	\
 	net_backends.c		\
 	net_utils.c		\
 	pci_emul.c		\
-	pci_fbuf.c		\
 	pci_hostbridge.c	\
 	pci_nvme.c		\
 	pci_passthru.c		\
@@ -50,7 +49,6 @@ SRCS=	\
 	pci_virtio_scsi.c	\
 	qemu_fwcfg.c		\
 	qemu_loader.c		\
-	rfb.c			\
 	smbiostbl.c		\
 	sockstream.c		\
 	tpm_device.c		\
@@ -60,7 +58,6 @@ SRCS=	\
 	uart_emul.c		\
 	usb_emul.c		\
 	usb_mouse.c		\
-	vga.c			\
 	virtio.c		\
 	vmexit.c		\
 	vmgenc.c
diff --git a/usr.sbin/bhyve/amd64/Makefile.inc b/usr.sbin/bhyve/amd64/Makefile.inc
index 76813891b0a0..435327155fc3 100644
--- a/usr.sbin/bhyve/amd64/Makefile.inc
+++ b/usr.sbin/bhyve/amd64/Makefile.inc
@@ -7,6 +7,7 @@ SRCS+=	\
 	mptbl.c		\
 	pci_ahci.c	\
 	pci_e82545.c	\
+	pci_fbuf.c	\
 	pci_gvt-d.c	\
 	pci_hda.c	\
 	pci_irq.c	\
@@ -18,9 +19,11 @@ SRCS+=	\
 	post.c		\
 	ps2kbd.c	\
 	ps2mouse.c	\
+	rfb.c		\
 	rtc.c		\
 	spinup_ap.c	\
 	task_switch.c	\
+	vga.c		\
 	xmsr.c
 
 .PATH:  ${BHYVE_SYSDIR}/sys/amd64/vmm
diff --git a/usr.sbin/bhyve/vga.c b/usr.sbin/bhyve/amd64/vga.c
similarity index 100%
rename from usr.sbin/bhyve/vga.c
rename to usr.sbin/bhyve/amd64/vga.c
diff --git a/usr.sbin/bhyve/vga.h b/usr.sbin/bhyve/amd64/vga.h
similarity index 100%
rename from usr.sbin/bhyve/vga.h
rename to usr.sbin/bhyve/amd64/vga.h
diff --git a/usr.sbin/bhyve/pci_fbuf.c b/usr.sbin/bhyve/pci_fbuf.c
index 3d63707affa8..a6bf508a46e6 100644
--- a/usr.sbin/bhyve/pci_fbuf.c
+++ b/usr.sbin/bhyve/pci_fbuf.c
@@ -46,10 +46,11 @@
 #include "config.h"
 #include "debug.h"
 #include "console.h"
-#include "inout.h"
 #include "pci_emul.h"
 #include "rfb.h"
-#include "vga.h"
+#ifdef __amd64__
+#include "amd64/vga.h"
+#endif
 
 /*
  * bhyve Framebuffer device emulation.