diff --git a/usr.sbin/bhyve/Makefile b/usr.sbin/bhyve/Makefile --- a/usr.sbin/bhyve/Makefile +++ b/usr.sbin/bhyve/Makefile @@ -3,9 +3,14 @@ # .include -CFLAGS+=-I${.CURDIR}/../../contrib/lib9p -CFLAGS+=-I${SRCTOP}/sys -.PATH: ${SRCTOP}/sys/libkern ${SRCTOP}/sys/cam/ctl + +CFLAGS+=-I${.CURDIR} \ + -I${.CURDIR}/../../contrib/lib9p \ + -I${SRCTOP}/sys + +.PATH: ${.CURDIR}/${MACHINE_CPUARCH} \ + ${SRCTOP}/sys/libkern \ + ${SRCTOP}/sys/cam/ctl PROG= bhyve PACKAGE= bhyve @@ -30,7 +35,6 @@ ctl_util.c \ ctl_scsi_all.c \ e820.c \ - fwctl.c \ gdb.c \ hda_codec.c \ inout.c \ @@ -71,7 +75,6 @@ rtc.c \ smbiostbl.c \ sockstream.c \ - task_switch.c \ tpm_device.c \ uart_emul.c \ usb_emul.c \ @@ -83,6 +86,11 @@ spinup_ap.c \ iov.c +.if ${MACHINE_CPUARCH} == "amd64" +SRCS+= fwctl.c \ + task_switch.c +.endif + .if ${MK_BHYVE_SNAPSHOT} != "no" SRCS+= snapshot.c .endif diff --git a/usr.sbin/bhyve/fwctl.h b/usr.sbin/bhyve/amd64/fwctl.h rename from usr.sbin/bhyve/fwctl.h rename to usr.sbin/bhyve/amd64/fwctl.h diff --git a/usr.sbin/bhyve/fwctl.c b/usr.sbin/bhyve/amd64/fwctl.c rename from usr.sbin/bhyve/fwctl.c rename to usr.sbin/bhyve/amd64/fwctl.c diff --git a/usr.sbin/bhyve/task_switch.c b/usr.sbin/bhyve/amd64/task_switch.c rename from usr.sbin/bhyve/task_switch.c rename to usr.sbin/bhyve/amd64/task_switch.c --- a/usr.sbin/bhyve/task_switch.c +++ b/usr.sbin/bhyve/amd64/task_switch.c @@ -702,6 +702,8 @@ return (VMEXIT_CONTINUE); \ } while (0) +int vmexit_task_switch(struct vmctx *, struct vcpu *, struct vm_run *); + int vmexit_task_switch(struct vmctx *ctx, struct vcpu *vcpu, struct vm_run *vmrun) { diff --git a/usr.sbin/bhyve/bhyverun.h b/usr.sbin/bhyve/bhyverun.h --- a/usr.sbin/bhyve/bhyverun.h +++ b/usr.sbin/bhyve/bhyverun.h @@ -48,6 +48,4 @@ int fbsdrun_virtio_msix(void); -int vmexit_task_switch(struct vmctx *, struct vcpu *, struct vm_run *); - #endif diff --git a/usr.sbin/bhyve/bhyverun.c b/usr.sbin/bhyve/bhyverun.c --- a/usr.sbin/bhyve/bhyverun.c +++ b/usr.sbin/bhyve/bhyverun.c @@ -92,7 +92,9 @@ #include "inout.h" #include "debug.h" #include "e820.h" -#include "fwctl.h" +#ifdef __amd64__ +#include "amd64/fwctl.h" +#endif #include "gdb.h" #include "ioapic.h" #include "kernemu_dev.h" @@ -947,6 +949,8 @@ return (error); } +int vmexit_task_switch(struct vmctx *, struct vcpu *, struct vm_run *); + static vmexit_handler_t handler[VM_EXITCODE_MAX] = { [VM_EXITCODE_INOUT] = vmexit_inout, [VM_EXITCODE_INOUT_STR] = vmexit_inout, @@ -1599,9 +1603,11 @@ } free(e820_fwcfg_item); +#ifdef __amd64__ if (lpc_bootrom() && strcmp(lpc_fwcfg(), "bhyve") == 0) { fwctl_init(); } +#endif /* * Change the proc title to include the VM name. diff --git a/usr.sbin/bhyve/snapshot.c b/usr.sbin/bhyve/snapshot.c --- a/usr.sbin/bhyve/snapshot.c +++ b/usr.sbin/bhyve/snapshot.c @@ -81,7 +81,6 @@ #include "debug.h" #include "inout.h" #include "ipc.h" -#include "fwctl.h" #include "ioapic.h" #include "mem.h" #include "mevent.h"