git: 83a8ffc20205 - stable/14 - bhyve: Move the RTC driver to amd64/

From: Mark Johnston <markj_at_FreeBSD.org>
Date: Wed, 11 Oct 2023 13:25:09 UTC
The branch stable/14 has been updated by markj:

URL: https://cgit.FreeBSD.org/src/commit/?id=83a8ffc20205fe4389a57d22bdeacf91eb365b12

commit 83a8ffc20205fe4389a57d22bdeacf91eb365b12
Author:     Mark Johnston <markj@FreeBSD.org>
AuthorDate: 2023-10-04 16:23:36 +0000
Commit:     Mark Johnston <markj@FreeBSD.org>
CommitDate: 2023-10-11 13:21:59 +0000

    bhyve: Move the RTC driver to amd64/
    
    No functional change intended.
    
    Reviewed by:    corvink, jhb
    MFC after:      1 week
    Sponsored by:   Innovate UK
    Differential Revision:  https://reviews.freebsd.org/D40734
    
    (cherry picked from commit a7f6c2ff732db1d0032066109ee0dd5af1a39b81)
---
 usr.sbin/bhyve/Makefile           | 1 -
 usr.sbin/bhyve/amd64/Makefile.inc | 1 +
 usr.sbin/bhyve/{ => amd64}/rtc.c  | 0
 usr.sbin/bhyve/{ => amd64}/rtc.h  | 0
 usr.sbin/bhyve/bhyverun.c         | 8 +++++++-
 5 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/usr.sbin/bhyve/Makefile b/usr.sbin/bhyve/Makefile
index 30ecf56ae748..ef78b149c68c 100644
--- a/usr.sbin/bhyve/Makefile
+++ b/usr.sbin/bhyve/Makefile
@@ -62,7 +62,6 @@ SRCS=	\
 	qemu_fwcfg.c		\
 	qemu_loader.c		\
 	rfb.c			\
-	rtc.c			\
 	smbiostbl.c		\
 	sockstream.c		\
 	spinup_ap.c		\
diff --git a/usr.sbin/bhyve/amd64/Makefile.inc b/usr.sbin/bhyve/amd64/Makefile.inc
index d655708210ce..a18b98a157ec 100644
--- a/usr.sbin/bhyve/amd64/Makefile.inc
+++ b/usr.sbin/bhyve/amd64/Makefile.inc
@@ -7,6 +7,7 @@ SRCS+=	\
 	post.c		\
 	ps2kbd.c	\
 	ps2mouse.c	\
+	rtc.c		\
 	task_switch.c	\
 	xmsr.c
 
diff --git a/usr.sbin/bhyve/rtc.c b/usr.sbin/bhyve/amd64/rtc.c
similarity index 100%
rename from usr.sbin/bhyve/rtc.c
rename to usr.sbin/bhyve/amd64/rtc.c
diff --git a/usr.sbin/bhyve/rtc.h b/usr.sbin/bhyve/amd64/rtc.h
similarity index 100%
rename from usr.sbin/bhyve/rtc.h
rename to usr.sbin/bhyve/amd64/rtc.h
diff --git a/usr.sbin/bhyve/bhyverun.c b/usr.sbin/bhyve/bhyverun.c
index 005acec77a93..a1ab5bd32fec 100644
--- a/usr.sbin/bhyve/bhyverun.c
+++ b/usr.sbin/bhyve/bhyverun.c
@@ -103,7 +103,9 @@
 #include "snapshot.h"
 #endif
 #include "tpm_device.h"
-#include "rtc.h"
+#ifdef __amd64__
+#include "amd64/rtc.h"
+#endif
 #include "vmgenc.h"
 #include "vmexit.h"
 #ifdef __amd64__
@@ -899,9 +901,11 @@ main(int argc, char *argv[])
 		case 'e':
 			set_config_bool("x86.strictio", true);
 			break;
+#ifdef __amd64__
 		case 'u':
 			set_config_bool("rtc.use_localtime", false);
 			break;
+#endif
 		case 'U':
 			set_config_value("uuid", optarg);
 			break;
@@ -1033,7 +1037,9 @@ main(int argc, char *argv[])
 	pci_irq_init(ctx);
 	ioapic_init(ctx);
 
+#ifdef __amd64__
 	rtc_init(ctx);
+#endif
 	sci_init(ctx);
 
 	if (qemu_fwcfg_init(ctx) != 0) {