diff --git a/configure.ac b/configure.ac index 833514dc11..215b5091c1 100644 --- a/configure.ac +++ b/configure.ac @@ -9,8 +9,6 @@ AC_PROG_CC AC_PROG_LIBTOOL ver=`uname -r` -KERNELCFLAGS= - kernelsrc= kernelbuild= AC_ARG_WITH(kernel, @@ -98,6 +96,10 @@ else AC_MSG_RESULT([no]) fi +# Add "V=1" to KERNELMAKE_PARAMS to enable verbose module build +KERNELMAKE_PARAMS= +KERNELCPPFLAGS="-I`/bin/pwd`/include" + if test "$kernelbuild" != "$kernelsrc"; then KERNELMAKE_PARAMS="$KERNELMAKE_PARAMS O=$kernelbuild" fi diff --git a/include/linux-callb.h b/include/linux-callb.h index 5ddb678b3d..6ffcfb76ed 100644 --- a/include/linux-callb.h +++ b/include/linux-callb.h @@ -1,11 +1,11 @@ -#ifndef _SYS_LINUX_CALLB_H -#define _SYS_LINUX_CALLB_H +#ifndef _LINUX_CALLB_H +#define _LINUX_CALLB_H #ifdef __cplusplus extern "C" { #endif -#include +#include #define DEBUG_CALLB @@ -41,5 +41,5 @@ typedef struct callb_cpr { } #endif -#endif /* _SYS_LINUX_CALLB_H */ +#endif /* _LINUX_CALLB_H */ diff --git a/include/linux-condvar.h b/include/linux-condvar.h index 33ad515392..e4a1779a53 100644 --- a/include/linux-condvar.h +++ b/include/linux-condvar.h @@ -1,5 +1,5 @@ -#ifndef _SYS_LINUX_CONDVAR_H -#define _SYS_LINUX_CONDVAR_H +#ifndef _LINUX_CONDVAR_H +#define _LINUX_CONDVAR_H #ifdef __cplusplus extern "C" { @@ -198,4 +198,4 @@ cv_broadcast(kcondvar_t *cvp) if (atomic_read(&cvp->cv_waiters) > 0) wake_up_all(&cvp->cv_event); } -#endif /* _SYS_LINUX_CONDVAR_H */ +#endif /* _LINUX_CONDVAR_H */ diff --git a/include/linux-cred.h b/include/linux-cred.h index 5f308bace9..d342aa016d 100644 --- a/include/linux-cred.h +++ b/include/linux-cred.h @@ -1,5 +1,5 @@ -#ifndef _SYS_LINUX_CRED_H -#define _SYS_LINUX_CRED_H +#ifndef _LINUX_CRED_H +#define _LINUX_CRED_H #ifdef __cplusplus extern "C" { @@ -36,5 +36,5 @@ typedef struct cred { } #endif -#endif /* _SYS_LINUX_CRED_H */ +#endif /* _LINUX_CRED_H */ diff --git a/include/linux-generic.h b/include/linux-generic.h index 5c4f9146af..e36baef0ef 100644 --- a/include/linux-generic.h +++ b/include/linux-generic.h @@ -1,5 +1,5 @@ -#ifndef _SYS_LINUX_GENERIC_H -#define _SYS_LINUX_GENERIC_H +#ifndef _LINUX_GENERIC_H +#define _LINUX_GENERIC_H #ifdef __cplusplus extern "C" { @@ -69,4 +69,4 @@ static int p0 = 0; } #endif -#endif /* _SYS_LINUX_GENERIC_H */ +#endif /* _LINUX_GENERIC_H */ diff --git a/include/linux-kmem.h b/include/linux-kmem.h index c68344cf3f..f08590d1d2 100644 --- a/include/linux-kmem.h +++ b/include/linux-kmem.h @@ -1,5 +1,5 @@ -#ifndef _SYS_LINUX_KMEM_H -#define _SYS_LINUX_KMEM_H +#ifndef _LINUX_KMEM_H +#define _LINUX_KMEM_H #ifdef __cplusplus extern "C" { @@ -170,4 +170,4 @@ __kmem_cache_destroy(kmem_cache_t *cache); } #endif -#endif /* _SYS_LINUX_KMEM_H */ +#endif /* _LINUX_KMEM_H */ diff --git a/include/linux-kstat.h b/include/linux-kstat.h index 738dbc8679..27aefdb9d6 100644 --- a/include/linux-kstat.h +++ b/include/linux-kstat.h @@ -1,11 +1,11 @@ -#ifndef _SYS_LINUX_KSTAT_H -#define _SYS_LINUX_KSTAT_H +#ifndef _LINUX_KSTAT_H +#define _LINUX_KSTAT_H #ifdef __cplusplus extern "C" { #endif -#include +#include /* XXX - The minimum functionality here is stubbed out but nothing works. */ @@ -132,5 +132,5 @@ kstat_delete(kstat_t *ksp) } #endif -#endif /* _SYS_LINUX_KSTAT_H */ +#endif /* _LINUX_KSTAT_H */ diff --git a/include/linux-mutex.h b/include/linux-mutex.h index 42056617f2..1fea2e7d1d 100644 --- a/include/linux-mutex.h +++ b/include/linux-mutex.h @@ -1,5 +1,5 @@ -#ifndef _SYS_LINUX_MUTEX_H -#define _SYS_LINUX_MUTEX_H +#ifndef _LINUX_MUTEX_H +#define _LINUX_MUTEX_H #ifdef __cplusplus extern "C" { @@ -115,4 +115,4 @@ mutex_owner(kmutex_t *mp) } #endif -#endif /* _SYS_LINUX_MUTEX_H */ +#endif /* _LINUX_MUTEX_H */ diff --git a/include/linux-random.h b/include/linux-random.h index 51233d48f8..78327d0f0e 100644 --- a/include/linux-random.h +++ b/include/linux-random.h @@ -1,5 +1,5 @@ -#ifndef _SYS_LINUX_RANDOM_H -#define _SYS_LINUX_RANDOM_H +#ifndef _LINUX_RANDOM_H +#define _LINUX_RANDOM_H #ifdef __cplusplus extern "C" { @@ -34,4 +34,4 @@ random_get_pseudo_bytes(uint8_t *ptr, size_t len) } #endif -#endif /* _SYS_LINUX_RANDOM_H */ +#endif /* _LINUX_RANDOM_H */ diff --git a/include/linux-rwlock.h b/include/linux-rwlock.h index a6a2787d8a..6ceafddf86 100644 --- a/include/linux-rwlock.h +++ b/include/linux-rwlock.h @@ -1,10 +1,10 @@ -#ifndef _SYS_LINUX_RWLOCK_H -#define _SYS_LINUX_RWLOCK_H +#ifndef _LINUX_RWLOCK_H +#define _LINUX_RWLOCK_H #include #include #include -#include +#include #ifdef __cplusplus extern "C" { @@ -220,4 +220,4 @@ rw_owner(krwlock_t *rwlp) } #endif -#endif /* _SYS_LINUX_RWLOCK_H */ +#endif /* _LINUX_RWLOCK_H */ diff --git a/include/linux-taskq.h b/include/linux-taskq.h index 3612f84c03..9680178df5 100644 --- a/include/linux-taskq.h +++ b/include/linux-taskq.h @@ -1,5 +1,5 @@ -#ifndef _SYS_LINUX_TASKQ_H -#define _SYS_LINUX_TASKQ_H +#ifndef _LINUX_TASKQ_H +#define _LINUX_TASKQ_H #ifdef __cplusplus extern "C" { @@ -23,7 +23,7 @@ extern "C" { #include #include #include -#include +#include #undef DEBUG_TASKQ_UNIMPLEMENTED @@ -83,4 +83,4 @@ extern taskq_t *__taskq_create(const char *, int, pri_t, int, int, uint_t); } #endif -#endif /* _SYS_LINUX_TASKQ_H */ +#endif /* _LINUX_TASKQ_H */ diff --git a/include/linux-thread.h b/include/linux-thread.h index dc9726322a..a1e1296a35 100644 --- a/include/linux-thread.h +++ b/include/linux-thread.h @@ -1,5 +1,5 @@ -#ifndef _SYS_LINUX_THREAD_H -#define _SYS_LINUX_THREAD_H +#ifndef _LINUX_THREAD_H +#define _LINUX_THREAD_H #ifdef __cplusplus extern "C" { @@ -7,8 +7,8 @@ extern "C" { #include #include -#include -#include +#include +#include /* * Thread interfaces @@ -44,5 +44,5 @@ kthread_t * __thread_create(caddr_t stk, size_t stksize, } #endif -#endif /* _SYS_LINUX_THREAD_H */ +#endif /* _LINUX_THREAD_H */ diff --git a/include/linux-time.h b/include/linux-time.h index c1105ab6be..792811c697 100644 --- a/include/linux-time.h +++ b/include/linux-time.h @@ -1,5 +1,5 @@ -#ifndef _SYS_TIME_H -#define _SYS_TIME_H +#ifndef _TIME_H +#define _TIME_H #pragma ident "%Z%%M% %I% %E% SMI" /* SVr4.0 1.16 */ @@ -13,7 +13,7 @@ extern "C" { #endif #include -#include +#include extern unsigned long long monotonic_clock(void); typedef struct timespec timestruc_t; /* definition per SVr4 */ @@ -61,4 +61,4 @@ gethrestime_sec(void) } #endif -#endif /* _SYS_TIME_H */ +#endif /* _TIME_H */ diff --git a/include/linux-timer.h b/include/linux-timer.h index a01579519e..0ff296ede8 100644 --- a/include/linux-timer.h +++ b/include/linux-timer.h @@ -1,5 +1,5 @@ -#ifndef _SYS_LINUX_TIMER_H -#define _SYS_LINUX_TIMER_H +#ifndef _LINUX_TIMER_H +#define _LINUX_TIMER_H #ifdef __cplusplus extern "C" { @@ -17,5 +17,5 @@ extern "C" { } #endif -#endif /* _SYS_LINUX_TIMER_H */ +#endif /* _LINUX_TIMER_H */ diff --git a/include/linux-types.h b/include/linux-types.h index d2b12a16b9..af692e364e 100644 --- a/include/linux-types.h +++ b/include/linux-types.h @@ -1,11 +1,11 @@ -#ifndef _SYS_LINUX_TYPES_H -#define _SYS_LINUX_TYPES_H +#ifndef _LINUX_TYPES_H +#define _LINUX_TYPES_H #ifdef __cplusplus extern "C" { #endif -typedef enum { B_FALSE=0, B_TRUE=1 } boolean_t; +typedef enum { B_FALSE=0, B_TRUE=1 } boolean_t; typedef unsigned long uintptr_t; typedef unsigned long intptr_t; typedef unsigned long ulong_t; @@ -16,7 +16,7 @@ typedef unsigned long long u_offset_t; typedef unsigned long long rlim64_t; typedef long long longlong_t; typedef long long offset_t; -typedef struct task_struct kthread_t; +typedef struct task_struct kthread_t; typedef struct vmem { } vmem_t; typedef short pri_t; @@ -24,4 +24,4 @@ typedef short pri_t; } #endif -#endif /* _SYS_LINUX_TYPES_H */ +#endif /* _LINUX_TYPES_H */ diff --git a/include/spl.h b/include/spl.h index ba38e81054..26e6b8712c 100644 --- a/include/spl.h +++ b/include/spl.h @@ -1,4 +1,4 @@ -#ifndef _SYS_SPL_H -#define _SYS_SPL_H +#ifndef _SPL_H +#define _SPL_H -#endif /* _SYS_SPL_H */ +#endif /* _SPL_H */ diff --git a/include/splat-ctl.h b/include/splat-ctl.h index b0e2a69eb4..89b8eb7b0e 100644 --- a/include/splat-ctl.h +++ b/include/splat-ctl.h @@ -1,5 +1,5 @@ -#ifndef _SYS_KZT_H -#define _SYS_KZT_H +#ifndef _SPLAT_CTL_H +#define _SPLAY_CTL_H #ifdef _KERNEL #include @@ -208,4 +208,4 @@ kzt_subsystem_t * kzt_time_init(void); #endif /* _KERNEL */ -#endif /* _SYS_KZT_H */ +#endif /* _SPLAY_CTL_H */ diff --git a/src/spl/Makefile.in b/src/spl/Makefile.in index 8a8674d6e6..2a77394d31 100644 --- a/src/spl/Makefile.in +++ b/src/spl/Makefile.in @@ -1,17 +1,9 @@ # Makefile.in for spl kernel module MODULES := spl - DISTFILES = Makefile.in \ linux-kmem.c linux-rwlock.c linux-taskq.c linux-thread.c - -EXTRA_CFLAGS += -I$(src) - -# Removed '-std=gnu99' does to compile issues with i386 SPIN_LOCK_UNLOCKED -# EXTRA_CFLAGS += -Wall -Wno-unknown-pragmas -Wno-missing-braces \ -# -Wno-sign-compare -Wno-parentheses -Wno-uninitialized \ -# -Wno-implicit-function-declaration -Wno-unused -Wno-trigraphs \ -# -Wno-char-subscripts -Wno-switch +CPPFLAGS += @KERNELCPPFLAGS@ # Solaris porting layer module obj-m := spl.o diff --git a/src/spl/linux-thread.c b/src/spl/linux-thread.c index ad036471a9..f3caa6365e 100644 --- a/src/spl/linux-thread.c +++ b/src/spl/linux-thread.c @@ -1,4 +1,4 @@ -#include +#include /* * Thread interfaces diff --git a/src/splat/Makefile.in b/src/splat/Makefile.in index 758c4be0a5..ebc0fb6cf5 100644 --- a/src/splat/Makefile.in +++ b/src/splat/Makefile.in @@ -1,18 +1,11 @@ # Makefile.in for splat kernel module MODULES := splat - DISTFILES = Makefile.in \ splat-kmem.c splat-random.c splat-taskq.c \ splat-time.c splat-condvar.c splat-mutex.c \ splat-rwlock.c splat-thread.c splat-ctl.c - -# Removed '-std=gnu99' does to compile issues with i386 SPIN_LOCK_UNLOCKED -# EXTRA_CFLAGS += -I$(src) -# EXTRA_CFLAGS += -Wall -Wno-unknown-pragmas -Wno-missing-braces \ -# -Wno-sign-compare -Wno-parentheses -Wno-uninitialized \ -# -Wno-implicit-function-declaration -Wno-unused -Wno-trigraphs \ -# -Wno-char-subscripts -Wno-switch +CPPFLAGS += @KERNELCPPFLAGS@ # Solaris porting layer aggressive tests obj-m := splat.o