Index: sys/amd64/amd64/apic_vector.S =================================================================== --- sys/amd64/amd64/apic_vector.S +++ sys/amd64/amd64/apic_vector.S @@ -174,22 +174,6 @@ jmp doreti #endif -#ifdef HYPERV -/* - * This is the Hyper-V vmbus channel direct callback interrupt. - * Only used when it is running on Hyper-V. - */ - .text - SUPERALIGN_TEXT -IDTVEC(hv_vmbus_callback) - PUSH_FRAME - FAKE_MCOUNT(TF_RIP(%rsp)) - movq %rsp, %rdi - call hv_vector_handler - MEXITCOUNT - jmp doreti -#endif - #ifdef SMP /* * Global address space TLB shootdown. Index: sys/amd64/amd64/exception.S =================================================================== --- sys/amd64/amd64/exception.S +++ sys/amd64/amd64/exception.S @@ -657,6 +657,7 @@ .text SUPERALIGN_TEXT .type doreti,@function + .global doreti doreti: FAKE_MCOUNT($bintr) /* init "from" bintr -> doreti */ /* Index: sys/amd64/conf/GENERIC =================================================================== --- sys/amd64/conf/GENERIC +++ sys/amd64/conf/GENERIC @@ -349,8 +349,6 @@ device virtio_balloon # VirtIO Memory Balloon device # HyperV drivers and enchancement support -# NOTE: HYPERV depends on hyperv. They must be added or removed together. -options HYPERV # Hyper-V kernel infrastructure device hyperv # HyperV drivers # Xen HVM Guest Optimizations Index: sys/amd64/conf/NOTES =================================================================== --- sys/amd64/conf/NOTES +++ sys/amd64/conf/NOTES @@ -515,7 +515,6 @@ device virtio_console # VirtIO Console device # Microsoft Hyper-V enchancement support -options HYPERV # Hyper-V kernel infrastructure device hyperv # HyperV drivers # Xen HVM Guest Optimizations Index: sys/conf/files.amd64 =================================================================== --- sys/conf/files.amd64 +++ sys/conf/files.amd64 @@ -277,6 +277,7 @@ dev/hyperv/vmbus/hv_et.c optional hyperv dev/hyperv/vmbus/hv_ring_buffer.c optional hyperv dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c optional hyperv +dev/hyperv/vmbus/amd64/hv_vector.S optional hyperv dev/nfe/if_nfe.c optional nfe pci dev/ntb/if_ntb/if_ntb.c optional if_ntb dev/ntb/ntb_hw/ntb_hw.c optional if_ntb | ntb_hw Index: sys/conf/files.i386 =================================================================== --- sys/conf/files.i386 +++ sys/conf/files.i386 @@ -252,6 +252,7 @@ dev/hyperv/vmbus/hv_et.c optional hyperv dev/hyperv/vmbus/hv_ring_buffer.c optional hyperv dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c optional hyperv +dev/hyperv/vmbus/i386/hv_vector.S optional hyperv dev/ichwd/ichwd.c optional ichwd dev/if_ndis/if_ndis.c optional ndis dev/if_ndis/if_ndis_pccard.c optional ndis pccard Index: sys/conf/options.amd64 =================================================================== --- sys/conf/options.amd64 +++ sys/conf/options.amd64 @@ -63,7 +63,5 @@ XENHVM opt_global.h -HYPERV opt_global.h - # options for the Intel C600 SAS driver (isci) ISCI_LOGGING opt_isci.h Index: sys/conf/options.i386 =================================================================== --- sys/conf/options.i386 +++ sys/conf/options.i386 @@ -123,7 +123,5 @@ XENHVM opt_global.h -HYPERV opt_global.h - # options for the Intel C600 SAS driver (isci) ISCI_LOGGING opt_isci.h Index: sys/dev/hyperv/vmbus/amd64/hv_vector.S =================================================================== --- /dev/null +++ sys/dev/hyperv/vmbus/amd64/hv_vector.S @@ -0,0 +1,18 @@ +#include +#include + +#include "assym.s" + +/* + * This is the Hyper-V vmbus channel direct callback interrupt. + * Only used when it is running on Hyper-V. + */ + .text + SUPERALIGN_TEXT +IDTVEC(hv_vmbus_callback) + PUSH_FRAME + FAKE_MCOUNT(TF_RIP(%rsp)) + movq %rsp, %rdi + call hv_vector_handler + MEXITCOUNT + jmp doreti Index: sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c =================================================================== --- sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c +++ sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c @@ -390,9 +390,7 @@ return (BUS_PROBE_DEFAULT); } -#ifdef HYPERV extern inthand_t IDTVEC(hv_vmbus_callback); -#endif /** * @brief Main vmbus driver initialization routine. @@ -426,14 +424,10 @@ return (ret); } -#ifdef HYPERV /* * Find a free IDT slot for vmbus callback. */ hv_vmbus_g_context.hv_cb_vector = lapic_ipi_alloc(IDTVEC(hv_vmbus_callback)); -#else - hv_vmbus_g_context.hv_cb_vector = -1; -#endif if (hv_vmbus_g_context.hv_cb_vector < 0) { if(bootverbose) printf("Error VMBUS: Cannot find free IDT slot for " Index: sys/dev/hyperv/vmbus/i386/hv_vector.S =================================================================== --- /dev/null +++ sys/dev/hyperv/vmbus/i386/hv_vector.S @@ -0,0 +1,21 @@ +#include +#include + +#include "assym.s" + +/* + * This is the Hyper-V vmbus channel direct callback interrupt. + * Only used when it is running on Hyper-V. + */ + .text + SUPERALIGN_TEXT +IDTVEC(hv_vmbus_callback) + PUSH_FRAME + SET_KERNEL_SREGS + cld + FAKE_MCOUNT(TF_EIP(%esp)) + pushl %esp + call hv_vector_handler + add $4, %esp + MEXITCOUNT + jmp doreti Index: sys/i386/conf/GENERIC =================================================================== --- sys/i386/conf/GENERIC +++ sys/i386/conf/GENERIC @@ -367,8 +367,6 @@ device virtio_balloon # VirtIO Memory Balloon device # HyperV drivers and enchancement support -# NOTE: HYPERV depends on hyperv. They must be added or removed together. -options HYPERV # Hyper-V kernel infrastructure device hyperv # HyperV drivers # Xen HVM Guest Optimizations Index: sys/i386/i386/apic_vector.s =================================================================== --- sys/i386/i386/apic_vector.s +++ sys/i386/i386/apic_vector.s @@ -181,25 +181,6 @@ jmp doreti #endif -#ifdef HYPERV -/* - * This is the Hyper-V vmbus channel direct callback interrupt. - * Only used when it is running on Hyper-V. - */ - .text - SUPERALIGN_TEXT -IDTVEC(hv_vmbus_callback) - PUSH_FRAME - SET_KERNEL_SREGS - cld - FAKE_MCOUNT(TF_EIP(%esp)) - pushl %esp - call hv_vector_handler - add $4, %esp - MEXITCOUNT - jmp doreti -#endif - #ifdef SMP /* * Global address space TLB shootdown. Index: sys/i386/i386/exception.s =================================================================== --- sys/i386/i386/exception.s +++ sys/i386/i386/exception.s @@ -343,6 +343,7 @@ .text SUPERALIGN_TEXT .type doreti,@function + .global doreti doreti: FAKE_MCOUNT($bintr) /* init "from" bintr -> doreti */ doreti_next: Index: sys/modules/hyperv/vmbus/Makefile =================================================================== --- sys/modules/hyperv/vmbus/Makefile +++ sys/modules/hyperv/vmbus/Makefile @@ -1,7 +1,7 @@ # $FreeBSD$ .PATH: ${.CURDIR}/../../../dev/hyperv/vmbus \ - ${.CURDIR}/../../../dev/hyperv/utilities + ${.CURDIR}/../../../dev/hyperv/vmbus/${MACHINE_CPUARCH} KMOD= hv_vmbus SRCS= hv_channel.c \ @@ -14,8 +14,17 @@ hv_vmbus_priv.h SRCS+= acpi_if.h bus_if.h device_if.h opt_acpi.h +# XXX: for assym.s +SRCS+= opt_kstack_pages.h opt_nfs.h opt_apic.h opt_hwpmc_hooks.h + +SRCS+= assym.s \ + hv_vector.S + +hv_vector.o: + ${CC} -c -x assembler-with-cpp -DLOCORE ${CFLAGS} \ + ${.IMPSRC} -o ${.TARGET} + CFLAGS+= -I${.CURDIR}/../../../dev/hyperv/include \ - -I${.CURDIR}/../../../dev/hyperv/vmbus \ - -I${.CURDIR}/../../../dev/hyperv/utilities + -I${.CURDIR}/../../../dev/hyperv/vmbus .include