diff options
Diffstat (limited to 'sys/powerpc/include/globals.h')
-rw-r--r-- | sys/powerpc/include/globals.h | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/sys/powerpc/include/globals.h b/sys/powerpc/include/globals.h index 10de1b7..286e5eb 100644 --- a/sys/powerpc/include/globals.h +++ b/sys/powerpc/include/globals.h @@ -30,23 +30,30 @@ #define _MACHINE_GLOBALS_H_ #ifdef _KERNEL +#include <machine/cpufunc.h> #include <machine/globaldata.h> -register struct globaldata *globalp __asm__("$8"); - -#if 1 -#define GLOBALP globalp -#else -#define GLOBALP ((struct globaldata *) alpha_pal_rdval()) -#endif +#define GLOBALP ((struct globaldata *) powerpc_get_globalp()) #define PCPU_GET(name) (GLOBALP->gd_##name) #define PCPU_PTR(name) (&GLOBALP->gd_##name) #define PCPU_SET(name,value) (GLOBALP->gd_##name = (value)) +/* + * The following set of macros works for UP kernel as well, but for maximum + * performance we allow the global variables to be accessed directly. On the + * other hand, kernel modules should always use these macros to maintain + * 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) +#define fpcurproc PCPU_GET(fpcurproc) +#define switchtime PCPU_GET(switchtime) +#define switchticks PCPU_GET(switchticks) +#define witness_spin_check PCPU_GET(witness_spin_check) #endif /* _KERNEL */ |