From: Sascha Wildner Date: Sat, 16 Feb 2013 18:32:38 +0000 (+0100) Subject: kernel: A few small fixes to make a minimal kernel config compile. X-Git-Tag: v3.4.0rc~294 X-Git-Url: http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff_plain/a6ae3d3be5202c06a25ce68193836bc18d3aef1f kernel: A few small fixes to make a minimal kernel config compile. It is solely for my build testing purposes: platform pc64 machine x86_64 machine_arch x86_64 ident MINI cpu HAMMER_CPU * Put two INET specific functions in uipc_socket.c under #ifdef INET. * Compile in isa_intr.c only when isa is specified in the config. * Move PCI specific include under #if 0 too in mp_clock.c * In nexus.c, compile in PCI specific parts only when pci is specified in the config. --- diff --git a/sys/kern/uipc_socket.c b/sys/kern/uipc_socket.c index 629afa0974..3a0434fcb0 100644 --- a/sys/kern/uipc_socket.c +++ b/sys/kern/uipc_socket.c @@ -886,6 +886,7 @@ out: return (error); } +#ifdef INET /* * A specialization of sosend() for UDP based on protocol-specific knowledge: * so->so_proto->pr_flags has the PR_ATOMIC field set. This means that @@ -1175,6 +1176,7 @@ out: m_freem(control); return (error); } +#endif /* * Implement receive operations on a socket. diff --git a/sys/platform/pc32/conf/files b/sys/platform/pc32/conf/files index 57c66fe654..4e3b751bb4 100644 --- a/sys/platform/pc32/conf/files +++ b/sys/platform/pc32/conf/files @@ -263,7 +263,7 @@ dev/serial/cy/cy_pci.c optional cy pci dev/netif/elink_layer/elink.c optional ep dev/disk/fd/fd.c optional fd dev/disk/fd/fd_pccard.c optional fd pccard -platform/pc32/isa/isa_intr.c standard +platform/pc32/isa/isa_intr.c optional isa bus/isa/i386/isa.c optional isa bus/isa/i386/isa_dma.c optional isa platform/pc32/isa/npx.c mandatory npx diff --git a/sys/platform/pc32/i386/mp_clock.c b/sys/platform/pc32/i386/mp_clock.c index f2170854bf..8c4b73a73e 100644 --- a/sys/platform/pc32/i386/mp_clock.c +++ b/sys/platform/pc32/i386/mp_clock.c @@ -39,10 +39,10 @@ #include #include -#include - #if 0 +#include + static unsigned piix_get_timecount(struct timecounter *tc); static u_int32_t piix_timecounter_address; diff --git a/sys/platform/pc32/i386/nexus.c b/sys/platform/pc32/i386/nexus.c index 7f947e0a3b..e74534a6b7 100644 --- a/sys/platform/pc32/i386/nexus.c +++ b/sys/platform/pc32/i386/nexus.c @@ -40,6 +40,8 @@ * and I/O memory address space. */ +#include "use_pci.h" + #include #include #include @@ -61,7 +63,9 @@ #include #include +#if NPCI > 0 #include "pcib_if.h" +#endif static MALLOC_DEFINE(M_NEXUSDEV, "nexusdev", "Nexus device"); struct nexus_device { @@ -101,11 +105,13 @@ static int nexus_set_resource(device_t, device_t, int, int, u_long, u_long, static int nexus_get_resource(device_t, device_t, int, int, u_long *, u_long *); static void nexus_delete_resource(device_t, device_t, int, int); +#if NPCI > 0 static int nexus_alloc_msi(device_t, device_t, int, int, int *, int); static int nexus_release_msi(device_t, device_t, int, int *, int); static int nexus_map_msi(device_t, device_t, int, uint64_t *, uint32_t *, int); static int nexus_alloc_msix(device_t, device_t, int *, int); static int nexus_release_msix(device_t, device_t, int, int); +#endif /* * The device_identify method will cause nexus to automatically associate @@ -137,11 +143,13 @@ static device_method_t nexus_methods[] = { DEVMETHOD(bus_get_resource, nexus_get_resource), DEVMETHOD(bus_delete_resource, nexus_delete_resource), +#if NPCI > 0 DEVMETHOD(pcib_alloc_msi, nexus_alloc_msi), DEVMETHOD(pcib_release_msi, nexus_release_msi), DEVMETHOD(pcib_map_msi, nexus_map_msi), DEVMETHOD(pcib_alloc_msix, nexus_alloc_msix), DEVMETHOD(pcib_release_msix, nexus_release_msix), +#endif { 0, 0 } }; @@ -570,6 +578,7 @@ nexus_delete_resource(device_t dev, device_t child, int type, int rid) resource_list_delete(rl, type, rid); } +#if NPCI > 0 static int nexus_alloc_msi(device_t dev, device_t child, int count, int maxcount, int *irqs, int cpuid) @@ -613,3 +622,4 @@ nexus_release_msix(device_t dev, device_t child, int irq, int cpuid) MachIntrABI.msix_release(irq, cpuid); return 0; } +#endif diff --git a/sys/platform/pc64/conf/files b/sys/platform/pc64/conf/files index 850b2a0bea..f35ee9eebd 100644 --- a/sys/platform/pc64/conf/files +++ b/sys/platform/pc64/conf/files @@ -247,6 +247,6 @@ dev/serial/sio/sio.c optional sio bus/isa/syscons_isa.c optional sc bus/isa/vga_isa.c optional vga platform/pc64/isa/clock.c standard nowerror -platform/pc64/isa/isa_intr.c standard +platform/pc64/isa/isa_intr.c optional isa platform/pc64/x86_64/spinlock.s standard dev/netif/elink_layer/elink.c optional ep diff --git a/sys/platform/pc64/x86_64/nexus.c b/sys/platform/pc64/x86_64/nexus.c index d2ee821564..a1fab9ed55 100644 --- a/sys/platform/pc64/x86_64/nexus.c +++ b/sys/platform/pc64/x86_64/nexus.c @@ -41,6 +41,8 @@ * and I/O memory address space. */ +#include "use_pci.h" + #include #include #include @@ -62,7 +64,9 @@ #include #include +#if NPCI > 0 #include "pcib_if.h" +#endif #define I386_BUS_SPACE_IO 0 /* space is i/o space */ #define I386_BUS_SPACE_MEM 1 /* space is mem space */ @@ -105,11 +109,13 @@ static int nexus_set_resource(device_t, device_t, int, int, u_long, u_long, static int nexus_get_resource(device_t, device_t, int, int, u_long *, u_long *); static void nexus_delete_resource(device_t, device_t, int, int); +#if NPCI > 0 static int nexus_alloc_msi(device_t, device_t, int, int, int *, int); static int nexus_release_msi(device_t, device_t, int, int *, int); static int nexus_map_msi(device_t, device_t, int, uint64_t *, uint32_t *, int); static int nexus_alloc_msix(device_t, device_t, int *, int); static int nexus_release_msix(device_t, device_t, int, int); +#endif /* * The device_identify method will cause nexus to automatically associate @@ -141,11 +147,13 @@ static device_method_t nexus_methods[] = { DEVMETHOD(bus_get_resource, nexus_get_resource), DEVMETHOD(bus_delete_resource, nexus_delete_resource), +#if NPCI > 0 DEVMETHOD(pcib_alloc_msi, nexus_alloc_msi), DEVMETHOD(pcib_release_msi, nexus_release_msi), DEVMETHOD(pcib_map_msi, nexus_map_msi), DEVMETHOD(pcib_alloc_msix, nexus_alloc_msix), DEVMETHOD(pcib_release_msix, nexus_release_msix), +#endif { 0, 0 } }; @@ -574,6 +582,7 @@ nexus_delete_resource(device_t dev, device_t child, int type, int rid) resource_list_delete(rl, type, rid); } +#if NPCI > 0 static int nexus_alloc_msi(device_t dev, device_t child, int count, int maxcount, int *irqs, int cpuid) @@ -617,3 +626,4 @@ nexus_release_msix(device_t dev, device_t child, int irq, int cpuid) MachIntrABI.msix_release(irq, cpuid); return 0; } +#endif