aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Johnston <markj@FreeBSD.org>2023-10-04 16:22:41 +0000
committerMark Johnston <markj@FreeBSD.org>2023-10-04 16:53:16 +0000
commita1642451ce25bb0e2d01765a8dedda69c5029d48 (patch)
treee200d416778ed3c8923025820d540c6e44120261
parent4fe5b70cae6761b9205ff35b72ccfe60d7326301 (diff)
downloadsrc-a1642451ce25bb0e2d01765a8dedda69c5029d48.tar.gz
src-a1642451ce25bb0e2d01765a8dedda69c5029d48.zip
bhyve: Move kernemu to amd64/
This code handles instruction emulation for accesses to various amd64-specific MMIO regions. No functional change intended. Reviewed by: corvink, jhb, emaste MFC after: 1 week Sponsored by: Innovate UK Differential Revision: https://reviews.freebsd.org/D40554
-rw-r--r--usr.sbin/bhyve/Makefile3
-rw-r--r--usr.sbin/bhyve/amd64/Makefile.inc4
-rw-r--r--usr.sbin/bhyve/amd64/kernemu_dev.c (renamed from usr.sbin/bhyve/kernemu_dev.c)0
-rw-r--r--usr.sbin/bhyve/amd64/kernemu_dev.h (renamed from usr.sbin/bhyve/kernemu_dev.h)0
-rw-r--r--usr.sbin/bhyve/bhyverun.c6
5 files changed, 8 insertions, 5 deletions
diff --git a/usr.sbin/bhyve/Makefile b/usr.sbin/bhyve/Makefile
index 499c0d1bb89d..c2ccd60790ae 100644
--- a/usr.sbin/bhyve/Makefile
+++ b/usr.sbin/bhyve/Makefile
@@ -33,7 +33,6 @@ SRCS= \
inout.c \
ioapic.c \
iov.c \
- kernemu_dev.c \
mem.c \
mevent.c \
net_backends.c \
@@ -85,8 +84,6 @@ SRCS+= snapshot.c
.include "${MACHINE_CPUARCH}/Makefile.inc"
-CFLAGS.kernemu_dev.c+= -I${SRCTOP}/sys/amd64
-
CFLAGS+=-I${.CURDIR} \
-I${.CURDIR}/../../contrib/lib9p \
-I${SRCTOP}/sys
diff --git a/usr.sbin/bhyve/amd64/Makefile.inc b/usr.sbin/bhyve/amd64/Makefile.inc
index e0cb84e32b85..6843cec4919f 100644
--- a/usr.sbin/bhyve/amd64/Makefile.inc
+++ b/usr.sbin/bhyve/amd64/Makefile.inc
@@ -2,14 +2,16 @@ SRCS+= \
atkbdc.c \
e820.c \
fwctl.c \
+ kernemu_dev.c \
mptbl.c \
post.c \
ps2kbd.c \
ps2mouse.c \
task_switch.c
-
.PATH: ${BHYVE_SYSDIR}/sys/amd64/vmm
SRCS+= vmm_instruction_emul.c
+CFLAGS.kernemu_dev.c+= -I${SRCTOP}/sys/amd64
+
SUBDIR+= kbdlayout
diff --git a/usr.sbin/bhyve/kernemu_dev.c b/usr.sbin/bhyve/amd64/kernemu_dev.c
index 54ca55307c62..54ca55307c62 100644
--- a/usr.sbin/bhyve/kernemu_dev.c
+++ b/usr.sbin/bhyve/amd64/kernemu_dev.c
diff --git a/usr.sbin/bhyve/kernemu_dev.h b/usr.sbin/bhyve/amd64/kernemu_dev.h
index 5f5cb24d17da..5f5cb24d17da 100644
--- a/usr.sbin/bhyve/kernemu_dev.h
+++ b/usr.sbin/bhyve/amd64/kernemu_dev.h
diff --git a/usr.sbin/bhyve/bhyverun.c b/usr.sbin/bhyve/bhyverun.c
index 7672c577da66..df40c7a7cc2a 100644
--- a/usr.sbin/bhyve/bhyverun.c
+++ b/usr.sbin/bhyve/bhyverun.c
@@ -95,7 +95,9 @@
#endif
#include "gdb.h"
#include "ioapic.h"
-#include "kernemu_dev.h"
+#ifdef __amd64__
+#include "amd64/kernemu_dev.h"
+#endif
#include "mem.h"
#include "mevent.h"
#ifdef __amd64__
@@ -1457,7 +1459,9 @@ main(int argc, char *argv[])
init_mem(guest_ncpus);
init_inout();
+#ifdef __amd64__
kernemu_dev_init();
+#endif
init_bootrom(ctx);
#ifdef __amd64__
atkbdc_init(ctx);