Move bogus proc reference stuff into <machine/globals.h>. There is no

more include file including <sys/proc.h>, but there still is this wonky
and (causes warnings on i386) reference in globals.h.

CURTHD is now defined in <machine/globals.h> as well. The correct thing
to do is provide a platform function for this.
This commit is contained in:
Matt Jacob 2000-10-23 18:36:03 +00:00
parent 4ae338d0f2
commit eb661345a9
4 changed files with 9 additions and 8 deletions

View file

@ -30,6 +30,7 @@
#define _MACHINE_GLOBALS_H_
#ifdef _KERNEL
#include <machine/globaldata.h>
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)

View file

@ -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))

View file

@ -30,6 +30,7 @@
#define _MACHINE_GLOBALS_H_
#ifdef _KERNEL
#include <machine/globaldata.h>
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)

View file

@ -41,11 +41,6 @@
#include <machine/bus.h>
#include <machine/cpufunc.h>
#include <machine/globals.h>
#include <sys/proc.h> /* 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);