diff --git a/sys/alpha/include/globals.h b/sys/alpha/include/globals.h index f85a67c4c37..b9e75fc5c58 100644 --- a/sys/alpha/include/globals.h +++ b/sys/alpha/include/globals.h @@ -30,6 +30,7 @@ #define _MACHINE_GLOBALS_H_ #ifdef _KERNEL +#include register struct globaldata *globalp __asm__("$8"); @@ -49,6 +50,7 @@ register struct globaldata *globalp __asm__("$8"); * portability between UP and SMP kernels. */ #define CURPROC PCPU_GET(curproc) +#define CURTHD PCPU_GET(curproc) /* temporary */ #define curproc PCPU_GET(curproc) #define idleproc PCPU_GET(idleproc) #define curpcb PCPU_GET(curpcb) diff --git a/sys/i386/include/globals.h b/sys/i386/include/globals.h index c0f0dd75242..b7b7932e256 100644 --- a/sys/i386/include/globals.h +++ b/sys/i386/include/globals.h @@ -174,6 +174,11 @@ GLOBAL_FUNC(witness_spin_check) #define GLOBALDATA (&globaldata) #endif +#ifndef curproc +struct proc; +extern struct proc *curproc; +#endif +#define CURTHD curproc #define CURPROC curproc #define PCPU_SET(name, value) (_global_##name##_set((int)value)) diff --git a/sys/powerpc/include/globals.h b/sys/powerpc/include/globals.h index f85a67c4c37..b9e75fc5c58 100644 --- a/sys/powerpc/include/globals.h +++ b/sys/powerpc/include/globals.h @@ -30,6 +30,7 @@ #define _MACHINE_GLOBALS_H_ #ifdef _KERNEL +#include register struct globaldata *globalp __asm__("$8"); @@ -49,6 +50,7 @@ register struct globaldata *globalp __asm__("$8"); * portability between UP and SMP kernels. */ #define CURPROC PCPU_GET(curproc) +#define CURTHD PCPU_GET(curproc) /* temporary */ #define curproc PCPU_GET(curproc) #define idleproc PCPU_GET(idleproc) #define curpcb PCPU_GET(curpcb) diff --git a/sys/sys/mutex.h b/sys/sys/mutex.h index 54d4088d8e6..1ff8d352184 100644 --- a/sys/sys/mutex.h +++ b/sys/sys/mutex.h @@ -41,11 +41,6 @@ #include #include #include -#include /* Needed for curproc. */ -#ifndef curproc -struct proc; -extern struct proc *curproc; -#endif #endif /* _KERNEL_ */ #endif /* !LOCORE */ @@ -138,9 +133,6 @@ struct mtx { #define mp_fixme(string) #ifdef _KERNEL -/* Misc */ -#define CURTHD CURPROC /* Current thread ID */ - /* Prototypes */ void mtx_init(struct mtx *m, const char *description, int flag); void mtx_enter_hard(struct mtx *, int type, int saveintr);