diff options
author | bde <bde@FreeBSD.org> | 2000-10-27 08:30:59 +0000 |
---|---|---|
committer | bde <bde@FreeBSD.org> | 2000-10-27 08:30:59 +0000 |
commit | 0409d20c481a7971dfde8cdb5abd35c2a5513865 (patch) | |
tree | 213bdbb7dcc09488ec528b44c6ee165085345466 /sys | |
parent | 1eb23e9e86940a2ef00f6ffd88d6c97b82c914fe (diff) | |
download | FreeBSD-src-0409d20c481a7971dfde8cdb5abd35c2a5513865.zip FreeBSD-src-0409d20c481a7971dfde8cdb5abd35c2a5513865.tar.gz |
Declare or #define per-cpu globals in <machine/globals.h> in all cases.
The i386 UP case was messily different.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/amd64/amd64/bios.c | 1 | ||||
-rw-r--r-- | sys/amd64/amd64/machdep.c | 3 | ||||
-rw-r--r-- | sys/amd64/include/cpu.h | 3 | ||||
-rw-r--r-- | sys/amd64/include/fpu.h | 6 | ||||
-rw-r--r-- | sys/amd64/include/npx.h | 6 | ||||
-rw-r--r-- | sys/amd64/include/pcb.h | 6 | ||||
-rw-r--r-- | sys/amd64/include/segments.h | 2 | ||||
-rw-r--r-- | sys/amd64/include/tss.h | 8 | ||||
-rw-r--r-- | sys/i386/i386/bios.c | 1 | ||||
-rw-r--r-- | sys/i386/i386/machdep.c | 3 | ||||
-rw-r--r-- | sys/i386/include/cpu.h | 3 | ||||
-rw-r--r-- | sys/i386/include/globals.h | 14 | ||||
-rw-r--r-- | sys/i386/include/npx.h | 6 | ||||
-rw-r--r-- | sys/i386/include/pcb.h | 6 | ||||
-rw-r--r-- | sys/i386/include/segments.h | 2 | ||||
-rw-r--r-- | sys/i386/include/tss.h | 8 | ||||
-rw-r--r-- | sys/sys/proc.h | 11 |
17 files changed, 12 insertions, 77 deletions
diff --git a/sys/amd64/amd64/bios.c b/sys/amd64/amd64/bios.c index 56880ea..a22f1549 100644 --- a/sys/amd64/amd64/bios.c +++ b/sys/amd64/amd64/bios.c @@ -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> diff --git a/sys/amd64/amd64/machdep.c b/sys/amd64/amd64/machdep.c index 03bd07d..62c698b 100644 --- a/sys/amd64/amd64/machdep.c +++ b/sys/amd64/amd64/machdep.c @@ -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) diff --git a/sys/amd64/include/cpu.h b/sys/amd64/include/cpu.h index 74a260d..7b090b6 100644 --- a/sys/amd64/include/cpu.h +++ b/sys/amd64/include/cpu.h @@ -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)); diff --git a/sys/amd64/include/fpu.h b/sys/amd64/include/fpu.h index 695ab2a..81acc46 100644 --- a/sys/amd64/include/fpu.h +++ b/sys/amd64/include/fpu.h @@ -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)); diff --git a/sys/amd64/include/npx.h b/sys/amd64/include/npx.h index 695ab2a..81acc46 100644 --- a/sys/amd64/include/npx.h +++ b/sys/amd64/include/npx.h @@ -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)); diff --git a/sys/amd64/include/pcb.h b/sys/amd64/include/pcb.h index 1c7af85..f342ea6 100644 --- a/sys/amd64/include/pcb.h +++ b/sys/amd64/include/pcb.h @@ -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 diff --git a/sys/amd64/include/segments.h b/sys/amd64/include/segments.h index 4a7e368..82e9d74 100644 --- a/sys/amd64/include/segments.h +++ b/sys/amd64/include/segments.h @@ -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 diff --git a/sys/amd64/include/tss.h b/sys/amd64/include/tss.h index 77b9443..101c218 100644 --- a/sys/amd64/include/tss.h +++ b/sys/amd64/include/tss.h @@ -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_ */ diff --git a/sys/i386/i386/bios.c b/sys/i386/i386/bios.c index 56880ea..a22f1549 100644 --- a/sys/i386/i386/bios.c +++ b/sys/i386/i386/bios.c @@ -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> diff --git a/sys/i386/i386/machdep.c b/sys/i386/i386/machdep.c index 03bd07d..62c698b 100644 --- a/sys/i386/i386/machdep.c +++ b/sys/i386/i386/machdep.c @@ -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) diff --git a/sys/i386/include/cpu.h b/sys/i386/include/cpu.h index 74a260d..7b090b6 100644 --- a/sys/i386/include/cpu.h +++ b/sys/i386/include/cpu.h @@ -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)); diff --git a/sys/i386/include/globals.h b/sys/i386/include/globals.h index b7b7932..846cba9 100644 --- a/sys/i386/include/globals.h +++ b/sys/i386/include/globals.h @@ -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 diff --git a/sys/i386/include/npx.h b/sys/i386/include/npx.h index 695ab2a..81acc46 100644 --- a/sys/i386/include/npx.h +++ b/sys/i386/include/npx.h @@ -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)); diff --git a/sys/i386/include/pcb.h b/sys/i386/include/pcb.h index 1c7af85..f342ea6 100644 --- a/sys/i386/include/pcb.h +++ b/sys/i386/include/pcb.h @@ -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 diff --git a/sys/i386/include/segments.h b/sys/i386/include/segments.h index 4a7e368..82e9d74 100644 --- a/sys/i386/include/segments.h +++ b/sys/i386/include/segments.h @@ -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 diff --git a/sys/i386/include/tss.h b/sys/i386/include/tss.h index 77b9443..101c218 100644 --- a/sys/i386/include/tss.h +++ b/sys/i386/include/tss.h @@ -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_ */ diff --git a/sys/sys/proc.h b/sys/sys/proc.h index 0d9e0a9..b2cffb6 100644 --- a/sys/sys/proc.h +++ b/sys/sys/proc.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. */ |