Declare or #define per-cpu globals in <machine/globals.h> in all cases.
The i386 UP case was messily different.
This commit is contained in:
parent
e7e3f4f84c
commit
940450b913
@ -40,6 +40,7 @@
|
||||
#include <sys/bus.h>
|
||||
#include <vm/vm.h>
|
||||
#include <vm/pmap.h>
|
||||
#include <machine/globals.h>
|
||||
#include <machine/md_var.h>
|
||||
#include <machine/segments.h>
|
||||
#include <machine/stdarg.h>
|
||||
|
@ -1169,9 +1169,6 @@ union descriptor ldt[NLDT]; /* local descriptor table */
|
||||
struct region_descriptor r_gdt, r_idt;
|
||||
#endif
|
||||
|
||||
#ifndef SMP
|
||||
extern struct segment_descriptor common_tssd, *tss_gdt;
|
||||
#endif
|
||||
int private_tss; /* flag indicating private tss */
|
||||
|
||||
#if defined(I586_CPU) && !defined(NO_F00F_HACK)
|
||||
|
@ -130,9 +130,6 @@
|
||||
#ifdef _KERNEL
|
||||
extern char btext[];
|
||||
extern char etext[];
|
||||
#ifndef intr_nesting_level
|
||||
extern u_char intr_nesting_level;
|
||||
#endif
|
||||
|
||||
void fork_trampoline __P((void));
|
||||
void fork_return __P((struct proc *, struct trapframe));
|
||||
|
@ -45,8 +45,6 @@
|
||||
#ifndef _MACHINE_NPX_H_
|
||||
#define _MACHINE_NPX_H_
|
||||
|
||||
#include <machine/globals.h>
|
||||
|
||||
/* Environment information of floating point unit */
|
||||
struct env87 {
|
||||
long en_cw; /* control word (16bits) */
|
||||
@ -107,10 +105,6 @@ struct save87 {
|
||||
#define __INITIAL_NPXCW__ 0x127F
|
||||
|
||||
#ifdef _KERNEL
|
||||
#ifndef npxproc
|
||||
extern struct proc *npxproc;
|
||||
#endif
|
||||
|
||||
int npxdna __P((void));
|
||||
void npxexit __P((struct proc *p));
|
||||
void npxinit __P((int control));
|
||||
|
@ -45,8 +45,6 @@
|
||||
#ifndef _MACHINE_NPX_H_
|
||||
#define _MACHINE_NPX_H_
|
||||
|
||||
#include <machine/globals.h>
|
||||
|
||||
/* Environment information of floating point unit */
|
||||
struct env87 {
|
||||
long en_cw; /* control word (16bits) */
|
||||
@ -107,10 +105,6 @@ struct save87 {
|
||||
#define __INITIAL_NPXCW__ 0x127F
|
||||
|
||||
#ifdef _KERNEL
|
||||
#ifndef npxproc
|
||||
extern struct proc *npxproc;
|
||||
#endif
|
||||
|
||||
int npxdna __P((void));
|
||||
void npxexit __P((struct proc *p));
|
||||
void npxinit __P((int control));
|
||||
|
@ -43,7 +43,6 @@
|
||||
/*
|
||||
* Intel 386 process control block
|
||||
*/
|
||||
#include <machine/globals.h>
|
||||
#include <machine/npx.h>
|
||||
|
||||
struct pcb {
|
||||
@ -86,11 +85,6 @@ struct md_coredump {
|
||||
};
|
||||
|
||||
#ifdef _KERNEL
|
||||
|
||||
#ifndef curpcb
|
||||
extern struct pcb *curpcb; /* our current running pcb */
|
||||
#endif
|
||||
|
||||
void savectx __P((struct pcb *));
|
||||
#endif
|
||||
|
||||
|
@ -41,8 +41,6 @@
|
||||
#ifndef _MACHINE_SEGMENTS_H_
|
||||
#define _MACHINE_SEGMENTS_H_
|
||||
|
||||
#include <machine/globals.h>
|
||||
|
||||
/*
|
||||
* 386 Segmentation Data Structures and definitions
|
||||
* William F. Jolitz (william@ernie.berkeley.edu) 6/20/1989
|
||||
|
@ -40,8 +40,6 @@
|
||||
#ifndef _MACHINE_TSS_H_
|
||||
#define _MACHINE_TSS_H_ 1
|
||||
|
||||
#include <machine/globals.h>
|
||||
|
||||
/*
|
||||
* Intel 386 Context Data Type
|
||||
*/
|
||||
@ -82,10 +80,4 @@ struct i386tss {
|
||||
/* XXX unimplemented .. i/o permission bitmap */
|
||||
};
|
||||
|
||||
#ifdef _KERNEL
|
||||
#ifndef common_tss
|
||||
extern struct i386tss common_tss;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#endif /* _MACHINE_TSS_H_ */
|
||||
|
@ -40,6 +40,7 @@
|
||||
#include <sys/bus.h>
|
||||
#include <vm/vm.h>
|
||||
#include <vm/pmap.h>
|
||||
#include <machine/globals.h>
|
||||
#include <machine/md_var.h>
|
||||
#include <machine/segments.h>
|
||||
#include <machine/stdarg.h>
|
||||
|
@ -1169,9 +1169,6 @@ union descriptor ldt[NLDT]; /* local descriptor table */
|
||||
struct region_descriptor r_gdt, r_idt;
|
||||
#endif
|
||||
|
||||
#ifndef SMP
|
||||
extern struct segment_descriptor common_tssd, *tss_gdt;
|
||||
#endif
|
||||
int private_tss; /* flag indicating private tss */
|
||||
|
||||
#if defined(I586_CPU) && !defined(NO_F00F_HACK)
|
||||
|
@ -130,9 +130,6 @@
|
||||
#ifdef _KERNEL
|
||||
extern char btext[];
|
||||
extern char etext[];
|
||||
#ifndef intr_nesting_level
|
||||
extern u_char intr_nesting_level;
|
||||
#endif
|
||||
|
||||
void fork_trampoline __P((void));
|
||||
void fork_return __P((struct proc *, struct trapframe));
|
||||
|
@ -125,6 +125,16 @@ _global_globaldata(void)
|
||||
#else /* !(SMP || KLD_MODULE) */
|
||||
|
||||
extern u_int astpending;
|
||||
extern struct i386tss common_tss;
|
||||
extern struct segment_descriptor common_tssd;
|
||||
extern struct pcb *curpcb; /* Our current running pcb. */
|
||||
extern struct proc *curproc; /* Current running proc. */
|
||||
extern struct proc *idleproc; /* Current idle proc. */
|
||||
extern u_char intr_nesting_level;
|
||||
extern struct proc *npxproc;
|
||||
extern int switchticks; /* `ticks' at last context switch. */
|
||||
extern struct timeval switchtime; /* Uptime at last context switch. */
|
||||
extern struct segment_descriptor *tss_gdt;
|
||||
|
||||
#endif /* SMP || KLD_MODULE */
|
||||
|
||||
@ -174,10 +184,6 @@ GLOBAL_FUNC(witness_spin_check)
|
||||
#define GLOBALDATA (&globaldata)
|
||||
#endif
|
||||
|
||||
#ifndef curproc
|
||||
struct proc;
|
||||
extern struct proc *curproc;
|
||||
#endif
|
||||
#define CURTHD curproc
|
||||
#define CURPROC curproc
|
||||
|
||||
|
@ -45,8 +45,6 @@
|
||||
#ifndef _MACHINE_NPX_H_
|
||||
#define _MACHINE_NPX_H_
|
||||
|
||||
#include <machine/globals.h>
|
||||
|
||||
/* Environment information of floating point unit */
|
||||
struct env87 {
|
||||
long en_cw; /* control word (16bits) */
|
||||
@ -107,10 +105,6 @@ struct save87 {
|
||||
#define __INITIAL_NPXCW__ 0x127F
|
||||
|
||||
#ifdef _KERNEL
|
||||
#ifndef npxproc
|
||||
extern struct proc *npxproc;
|
||||
#endif
|
||||
|
||||
int npxdna __P((void));
|
||||
void npxexit __P((struct proc *p));
|
||||
void npxinit __P((int control));
|
||||
|
@ -43,7 +43,6 @@
|
||||
/*
|
||||
* Intel 386 process control block
|
||||
*/
|
||||
#include <machine/globals.h>
|
||||
#include <machine/npx.h>
|
||||
|
||||
struct pcb {
|
||||
@ -86,11 +85,6 @@ struct md_coredump {
|
||||
};
|
||||
|
||||
#ifdef _KERNEL
|
||||
|
||||
#ifndef curpcb
|
||||
extern struct pcb *curpcb; /* our current running pcb */
|
||||
#endif
|
||||
|
||||
void savectx __P((struct pcb *));
|
||||
#endif
|
||||
|
||||
|
@ -41,8 +41,6 @@
|
||||
#ifndef _MACHINE_SEGMENTS_H_
|
||||
#define _MACHINE_SEGMENTS_H_
|
||||
|
||||
#include <machine/globals.h>
|
||||
|
||||
/*
|
||||
* 386 Segmentation Data Structures and definitions
|
||||
* William F. Jolitz (william@ernie.berkeley.edu) 6/20/1989
|
||||
|
@ -40,8 +40,6 @@
|
||||
#ifndef _MACHINE_TSS_H_
|
||||
#define _MACHINE_TSS_H_ 1
|
||||
|
||||
#include <machine/globals.h>
|
||||
|
||||
/*
|
||||
* Intel 386 Context Data Type
|
||||
*/
|
||||
@ -82,10 +80,4 @@ struct i386tss {
|
||||
/* XXX unimplemented .. i/o permission bitmap */
|
||||
};
|
||||
|
||||
#ifdef _KERNEL
|
||||
#ifndef common_tss
|
||||
extern struct i386tss common_tss;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#endif /* _MACHINE_TSS_H_ */
|
||||
|
@ -444,17 +444,6 @@ extern u_long pidhash;
|
||||
extern LIST_HEAD(pgrphashhead, pgrp) *pgrphashtbl;
|
||||
extern u_long pgrphash;
|
||||
|
||||
#ifndef SET_CURPROC
|
||||
#define SET_CURPROC(p) (curproc = (p))
|
||||
#endif
|
||||
|
||||
#ifndef curproc
|
||||
extern struct proc *curproc; /* Current running proc. */
|
||||
extern struct proc *prevproc; /* Previously running proc. */
|
||||
extern struct proc *idleproc; /* Current idle proc. */
|
||||
extern int switchticks; /* `ticks' at last context switch. */
|
||||
extern struct timeval switchtime; /* Uptime at last context switch */
|
||||
#endif
|
||||
extern struct proc proc0; /* Process slot for swapper. */
|
||||
extern int hogticks; /* Limit on kernel cpu hogs. */
|
||||
extern int nprocs, maxproc; /* Current and max number of procs. */
|
||||
|
Loading…
Reference in New Issue
Block a user