diff --git a/sys/alpha/include/mutex.h b/sys/alpha/include/mutex.h index a8cc2d2d6d16..12b12a8011c5 100644 --- a/sys/alpha/include/mutex.h +++ b/sys/alpha/include/mutex.h @@ -33,10 +33,11 @@ #define _MACHINE_MUTEX_H_ #ifndef LOCORE +#include +#ifdef _KERNEL #include #include /* Needed for curproc. */ -#include #include #include #include @@ -77,6 +78,8 @@ #define MTX_FLAGMASK ~(MTX_RECURSE | MTX_CONTESTED) #define MTX_UNOWNED 0x8 /* Cookie for free mutex */ +#endif /* _KERNEL */ + /* * Sleep/spin mutex */ diff --git a/sys/amd64/include/mutex.h b/sys/amd64/include/mutex.h index 1bbe0e0d3c5a..ca518d98fd44 100644 --- a/sys/amd64/include/mutex.h +++ b/sys/amd64/include/mutex.h @@ -33,10 +33,11 @@ #define _MACHINE_MUTEX_H_ #ifndef LOCORE +#include +#ifdef _KERNEL #include #include /* Needed for curproc. */ -#include #include #include #include @@ -76,6 +77,8 @@ #define MTX_FLAGMASK ~(MTX_RECURSE | MTX_CONTESTED) #define MTX_UNOWNED 0x8 /* Cookie for free mutex */ +#endif /* _KERNEL */ + /* * Sleep/spin mutex */ diff --git a/sys/i386/include/mutex.h b/sys/i386/include/mutex.h index 1bbe0e0d3c5a..ca518d98fd44 100644 --- a/sys/i386/include/mutex.h +++ b/sys/i386/include/mutex.h @@ -33,10 +33,11 @@ #define _MACHINE_MUTEX_H_ #ifndef LOCORE +#include +#ifdef _KERNEL #include #include /* Needed for curproc. */ -#include #include #include #include @@ -76,6 +77,8 @@ #define MTX_FLAGMASK ~(MTX_RECURSE | MTX_CONTESTED) #define MTX_UNOWNED 0x8 /* Cookie for free mutex */ +#endif /* _KERNEL */ + /* * Sleep/spin mutex */ diff --git a/sys/powerpc/include/mutex.h b/sys/powerpc/include/mutex.h index a8cc2d2d6d16..12b12a8011c5 100644 --- a/sys/powerpc/include/mutex.h +++ b/sys/powerpc/include/mutex.h @@ -33,10 +33,11 @@ #define _MACHINE_MUTEX_H_ #ifndef LOCORE +#include +#ifdef _KERNEL #include #include /* Needed for curproc. */ -#include #include #include #include @@ -77,6 +78,8 @@ #define MTX_FLAGMASK ~(MTX_RECURSE | MTX_CONTESTED) #define MTX_UNOWNED 0x8 /* Cookie for free mutex */ +#endif /* _KERNEL */ + /* * Sleep/spin mutex */