diff options
author | David E. O'Brien <obrien@FreeBSD.org> | 2001-08-16 09:29:35 +0000 |
---|---|---|
committer | David E. O'Brien <obrien@FreeBSD.org> | 2001-08-16 09:29:35 +0000 |
commit | 589278dbaeaa80850097b35d25e4f3f9ba0c6921 (patch) | |
tree | fa94197a35ffa007a11c5f91059188205d6476e5 | |
parent | cc00d33c5f2c5fea29688498ea21c202c07e3881 (diff) |
style(9) and make consistent across platforms
Notes
Notes:
svn path=/head/; revision=81763
-rw-r--r-- | sys/alpha/include/globaldata.h | 25 | ||||
-rw-r--r-- | sys/alpha/include/pcpu.h | 25 | ||||
-rw-r--r-- | sys/amd64/include/pcpu.h | 46 | ||||
-rw-r--r-- | sys/i386/include/globaldata.h | 46 | ||||
-rw-r--r-- | sys/i386/include/pcpu.h | 46 | ||||
-rw-r--r-- | sys/ia64/include/globaldata.h | 25 | ||||
-rw-r--r-- | sys/ia64/include/pcpu.h | 25 | ||||
-rw-r--r-- | sys/powerpc/include/globaldata.h | 27 | ||||
-rw-r--r-- | sys/powerpc/include/pcpu.h | 27 | ||||
-rw-r--r-- | sys/sparc64/include/globaldata.h | 43 | ||||
-rw-r--r-- | sys/sparc64/include/pcpu.h | 43 |
11 files changed, 208 insertions, 170 deletions
diff --git a/sys/alpha/include/globaldata.h b/sys/alpha/include/globaldata.h index 4d6d02f60717..d577fee0390a 100644 --- a/sys/alpha/include/globaldata.h +++ b/sys/alpha/include/globaldata.h @@ -1,5 +1,6 @@ /*- * Copyright (c) 1999 Luoqi Chen <luoqi@freebsd.org> + * Copyright (c) Peter Wemm <peter@netplex.com.au> * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -43,26 +44,26 @@ * point at the globaldata structure. */ struct globaldata { - struct alpha_pcb gd_idlepcb; /* pcb for idling */ - struct proc *gd_curproc; /* current process */ - struct proc *gd_idleproc; /* idle process */ - struct proc *gd_fpcurproc; /* fp state owner */ - struct pcb *gd_curpcb; /* current pcb */ - struct timeval gd_switchtime; - int gd_switchticks; - u_int gd_cpuid; /* this cpu number */ - u_int gd_other_cpus; /* all other cpus */ + struct alpha_pcb gd_idlepcb; /* pcb for idling */ + struct proc *gd_curproc; /* current process */ + struct proc *gd_idleproc; /* idle process */ + struct proc *gd_fpcurproc; /* fp state owner */ + struct pcb *gd_curpcb; /* current pcb */ + struct timeval gd_switchtime; + int gd_switchticks; + u_int gd_cpuid; /* this cpu number */ + u_int gd_other_cpus; /* all other cpus */ u_int64_t gd_idlepcbphys; /* pa of gd_idlepcb */ u_int64_t gd_pending_ipis; /* pending IPI events */ u_int32_t gd_next_asn; /* next ASN to allocate */ u_int32_t gd_current_asngen; /* ASN rollover check */ SLIST_ENTRY(globaldata) gd_allcpu; - struct lock_list_entry *gd_spinlocks; + struct lock_list_entry *gd_spinlocks; #ifdef KTR_PERCPU volatile int gd_ktr_idx; /* Index into trace table */ - char *gd_ktr_buf; - char gd_ktr_buf_data[0]; + char *gd_ktr_buf; + char gd_ktr_buf_data[0]; #endif }; diff --git a/sys/alpha/include/pcpu.h b/sys/alpha/include/pcpu.h index 4d6d02f60717..d577fee0390a 100644 --- a/sys/alpha/include/pcpu.h +++ b/sys/alpha/include/pcpu.h @@ -1,5 +1,6 @@ /*- * Copyright (c) 1999 Luoqi Chen <luoqi@freebsd.org> + * Copyright (c) Peter Wemm <peter@netplex.com.au> * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -43,26 +44,26 @@ * point at the globaldata structure. */ struct globaldata { - struct alpha_pcb gd_idlepcb; /* pcb for idling */ - struct proc *gd_curproc; /* current process */ - struct proc *gd_idleproc; /* idle process */ - struct proc *gd_fpcurproc; /* fp state owner */ - struct pcb *gd_curpcb; /* current pcb */ - struct timeval gd_switchtime; - int gd_switchticks; - u_int gd_cpuid; /* this cpu number */ - u_int gd_other_cpus; /* all other cpus */ + struct alpha_pcb gd_idlepcb; /* pcb for idling */ + struct proc *gd_curproc; /* current process */ + struct proc *gd_idleproc; /* idle process */ + struct proc *gd_fpcurproc; /* fp state owner */ + struct pcb *gd_curpcb; /* current pcb */ + struct timeval gd_switchtime; + int gd_switchticks; + u_int gd_cpuid; /* this cpu number */ + u_int gd_other_cpus; /* all other cpus */ u_int64_t gd_idlepcbphys; /* pa of gd_idlepcb */ u_int64_t gd_pending_ipis; /* pending IPI events */ u_int32_t gd_next_asn; /* next ASN to allocate */ u_int32_t gd_current_asngen; /* ASN rollover check */ SLIST_ENTRY(globaldata) gd_allcpu; - struct lock_list_entry *gd_spinlocks; + struct lock_list_entry *gd_spinlocks; #ifdef KTR_PERCPU volatile int gd_ktr_idx; /* Index into trace table */ - char *gd_ktr_buf; - char gd_ktr_buf_data[0]; + char *gd_ktr_buf; + char gd_ktr_buf_data[0]; #endif }; diff --git a/sys/amd64/include/pcpu.h b/sys/amd64/include/pcpu.h index ef82a6682b41..cda7b1e172e2 100644 --- a/sys/amd64/include/pcpu.h +++ b/sys/amd64/include/pcpu.h @@ -29,6 +29,8 @@ #ifndef _MACHINE_GLOBALDATA_H_ #define _MACHINE_GLOBALDATA_H_ +#ifdef _KERNEL + #include <machine/segments.h> #include <machine/tss.h> @@ -50,27 +52,25 @@ * other processors" */ struct globaldata { - struct globaldata *gd_prvspace; /* self-reference */ - struct proc *gd_curproc; - struct proc *gd_npxproc; - struct pcb *gd_curpcb; - struct proc *gd_idleproc; - struct timeval gd_switchtime; - struct i386tss gd_common_tss; - int gd_switchticks; - struct segment_descriptor gd_common_tssd; - struct segment_descriptor *gd_tss_gdt; - int gd_currentldt; - u_int gd_cpuid; - u_int gd_other_cpus; + struct globaldata *gd_prvspace; /* self-reference */ + struct proc *gd_curproc; /* current process */ + struct proc *gd_idleproc; /* idle process */ + struct proc *gd_npxproc; + struct pcb *gd_curpcb; /* current pcb */ + struct timeval gd_switchtime; + struct i386tss gd_common_tss; + int gd_switchticks; + struct segment_descriptor gd_common_tssd; + struct segment_descriptor *gd_tss_gdt; + int gd_currentldt; + u_int gd_cpuid; /* this cpu number */ + u_int gd_other_cpus; /* all other cpus */ SLIST_ENTRY(globaldata) gd_allcpu; - struct lock_list_entry *gd_spinlocks; + struct lock_list_entry *gd_spinlocks; #ifdef KTR_PERCPU -#ifdef KTR - volatile int gd_ktr_idx; - char *gd_ktr_buf; - char gd_ktr_buf_data[KTR_SIZE]; -#endif + volatile int gd_ktr_idx; /* Index into trace table */ + char *gd_ktr_buf; + char gd_ktr_buf_data[KTR_SIZE]; #endif }; @@ -82,11 +82,11 @@ struct globaldata { */ struct privatespace { /* page 0 - data page */ - struct globaldata globaldata; - char __filler0[PAGE_SIZE - sizeof(struct globaldata)]; + struct globaldata globaldata; + char __filler0[PAGE_SIZE - sizeof(struct globaldata)]; /* page 1 - idle stack (UPAGES pages) */ - char idlestack[UPAGES * PAGE_SIZE]; + char idlestack[UPAGES * PAGE_SIZE]; /* page 1+UPAGES... */ }; @@ -94,4 +94,6 @@ extern struct privatespace SMP_prvspace[]; #endif +#endif /* _KERNEL */ + #endif /* ! _MACHINE_GLOBALDATA_H_ */ diff --git a/sys/i386/include/globaldata.h b/sys/i386/include/globaldata.h index ef82a6682b41..cda7b1e172e2 100644 --- a/sys/i386/include/globaldata.h +++ b/sys/i386/include/globaldata.h @@ -29,6 +29,8 @@ #ifndef _MACHINE_GLOBALDATA_H_ #define _MACHINE_GLOBALDATA_H_ +#ifdef _KERNEL + #include <machine/segments.h> #include <machine/tss.h> @@ -50,27 +52,25 @@ * other processors" */ struct globaldata { - struct globaldata *gd_prvspace; /* self-reference */ - struct proc *gd_curproc; - struct proc *gd_npxproc; - struct pcb *gd_curpcb; - struct proc *gd_idleproc; - struct timeval gd_switchtime; - struct i386tss gd_common_tss; - int gd_switchticks; - struct segment_descriptor gd_common_tssd; - struct segment_descriptor *gd_tss_gdt; - int gd_currentldt; - u_int gd_cpuid; - u_int gd_other_cpus; + struct globaldata *gd_prvspace; /* self-reference */ + struct proc *gd_curproc; /* current process */ + struct proc *gd_idleproc; /* idle process */ + struct proc *gd_npxproc; + struct pcb *gd_curpcb; /* current pcb */ + struct timeval gd_switchtime; + struct i386tss gd_common_tss; + int gd_switchticks; + struct segment_descriptor gd_common_tssd; + struct segment_descriptor *gd_tss_gdt; + int gd_currentldt; + u_int gd_cpuid; /* this cpu number */ + u_int gd_other_cpus; /* all other cpus */ SLIST_ENTRY(globaldata) gd_allcpu; - struct lock_list_entry *gd_spinlocks; + struct lock_list_entry *gd_spinlocks; #ifdef KTR_PERCPU -#ifdef KTR - volatile int gd_ktr_idx; - char *gd_ktr_buf; - char gd_ktr_buf_data[KTR_SIZE]; -#endif + volatile int gd_ktr_idx; /* Index into trace table */ + char *gd_ktr_buf; + char gd_ktr_buf_data[KTR_SIZE]; #endif }; @@ -82,11 +82,11 @@ struct globaldata { */ struct privatespace { /* page 0 - data page */ - struct globaldata globaldata; - char __filler0[PAGE_SIZE - sizeof(struct globaldata)]; + struct globaldata globaldata; + char __filler0[PAGE_SIZE - sizeof(struct globaldata)]; /* page 1 - idle stack (UPAGES pages) */ - char idlestack[UPAGES * PAGE_SIZE]; + char idlestack[UPAGES * PAGE_SIZE]; /* page 1+UPAGES... */ }; @@ -94,4 +94,6 @@ extern struct privatespace SMP_prvspace[]; #endif +#endif /* _KERNEL */ + #endif /* ! _MACHINE_GLOBALDATA_H_ */ diff --git a/sys/i386/include/pcpu.h b/sys/i386/include/pcpu.h index ef82a6682b41..cda7b1e172e2 100644 --- a/sys/i386/include/pcpu.h +++ b/sys/i386/include/pcpu.h @@ -29,6 +29,8 @@ #ifndef _MACHINE_GLOBALDATA_H_ #define _MACHINE_GLOBALDATA_H_ +#ifdef _KERNEL + #include <machine/segments.h> #include <machine/tss.h> @@ -50,27 +52,25 @@ * other processors" */ struct globaldata { - struct globaldata *gd_prvspace; /* self-reference */ - struct proc *gd_curproc; - struct proc *gd_npxproc; - struct pcb *gd_curpcb; - struct proc *gd_idleproc; - struct timeval gd_switchtime; - struct i386tss gd_common_tss; - int gd_switchticks; - struct segment_descriptor gd_common_tssd; - struct segment_descriptor *gd_tss_gdt; - int gd_currentldt; - u_int gd_cpuid; - u_int gd_other_cpus; + struct globaldata *gd_prvspace; /* self-reference */ + struct proc *gd_curproc; /* current process */ + struct proc *gd_idleproc; /* idle process */ + struct proc *gd_npxproc; + struct pcb *gd_curpcb; /* current pcb */ + struct timeval gd_switchtime; + struct i386tss gd_common_tss; + int gd_switchticks; + struct segment_descriptor gd_common_tssd; + struct segment_descriptor *gd_tss_gdt; + int gd_currentldt; + u_int gd_cpuid; /* this cpu number */ + u_int gd_other_cpus; /* all other cpus */ SLIST_ENTRY(globaldata) gd_allcpu; - struct lock_list_entry *gd_spinlocks; + struct lock_list_entry *gd_spinlocks; #ifdef KTR_PERCPU -#ifdef KTR - volatile int gd_ktr_idx; - char *gd_ktr_buf; - char gd_ktr_buf_data[KTR_SIZE]; -#endif + volatile int gd_ktr_idx; /* Index into trace table */ + char *gd_ktr_buf; + char gd_ktr_buf_data[KTR_SIZE]; #endif }; @@ -82,11 +82,11 @@ struct globaldata { */ struct privatespace { /* page 0 - data page */ - struct globaldata globaldata; - char __filler0[PAGE_SIZE - sizeof(struct globaldata)]; + struct globaldata globaldata; + char __filler0[PAGE_SIZE - sizeof(struct globaldata)]; /* page 1 - idle stack (UPAGES pages) */ - char idlestack[UPAGES * PAGE_SIZE]; + char idlestack[UPAGES * PAGE_SIZE]; /* page 1+UPAGES... */ }; @@ -94,4 +94,6 @@ extern struct privatespace SMP_prvspace[]; #endif +#endif /* _KERNEL */ + #endif /* ! _MACHINE_GLOBALDATA_H_ */ diff --git a/sys/ia64/include/globaldata.h b/sys/ia64/include/globaldata.h index 0ec1e1984424..308086c8a506 100644 --- a/sys/ia64/include/globaldata.h +++ b/sys/ia64/include/globaldata.h @@ -1,5 +1,6 @@ /*- * Copyright (c) 1999 Luoqi Chen <luoqi@freebsd.org> + * Copyright (c) Peter Wemm <peter@netplex.com.au> * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -43,26 +44,26 @@ * point at the globaldata structure. */ struct globaldata { - struct proc *gd_curproc; /* current process */ - struct proc *gd_idleproc; /* idle process */ - struct proc *gd_fpcurproc; /* fp state owner */ - struct pcb *gd_curpcb; /* current pcb */ - struct timeval gd_switchtime; - int gd_switchticks; - u_int gd_cpuid; /* this cpu number */ - u_int gd_other_cpus; /* all other cpus */ + struct proc *gd_curproc; /* current process */ + struct proc *gd_idleproc; /* idle process */ + struct proc *gd_fpcurproc; /* fp state owner */ + struct pcb *gd_curpcb; /* current pcb */ + struct timeval gd_switchtime; + int gd_switchticks; + u_int gd_cpuid; /* this cpu number */ + u_int gd_other_cpus; /* all other cpus */ u_int64_t gd_idlepcbphys; /* pa of gd_idlepcb */ u_int64_t gd_pending_ipis; /* pending IPI events */ - struct pmap *gd_current_pmap; /* which pmap is active */ + struct pmap *gd_current_pmap; /* which pmap is active */ u_int32_t gd_next_asn; /* next ASN to allocate */ u_int32_t gd_current_asngen; /* ASN rollover check */ SLIST_ENTRY(globaldata) gd_allcpu; - struct lock_list_entry *gd_spinlocks; + struct lock_list_entry *gd_spinlocks; #ifdef KTR_PERCPU volatile int gd_ktr_idx; /* Index into trace table */ - char *gd_ktr_buf; - char gd_ktr_buf_data[0]; + char *gd_ktr_buf; + char gd_ktr_buf_data[0]; #endif }; diff --git a/sys/ia64/include/pcpu.h b/sys/ia64/include/pcpu.h index 0ec1e1984424..308086c8a506 100644 --- a/sys/ia64/include/pcpu.h +++ b/sys/ia64/include/pcpu.h @@ -1,5 +1,6 @@ /*- * Copyright (c) 1999 Luoqi Chen <luoqi@freebsd.org> + * Copyright (c) Peter Wemm <peter@netplex.com.au> * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -43,26 +44,26 @@ * point at the globaldata structure. */ struct globaldata { - struct proc *gd_curproc; /* current process */ - struct proc *gd_idleproc; /* idle process */ - struct proc *gd_fpcurproc; /* fp state owner */ - struct pcb *gd_curpcb; /* current pcb */ - struct timeval gd_switchtime; - int gd_switchticks; - u_int gd_cpuid; /* this cpu number */ - u_int gd_other_cpus; /* all other cpus */ + struct proc *gd_curproc; /* current process */ + struct proc *gd_idleproc; /* idle process */ + struct proc *gd_fpcurproc; /* fp state owner */ + struct pcb *gd_curpcb; /* current pcb */ + struct timeval gd_switchtime; + int gd_switchticks; + u_int gd_cpuid; /* this cpu number */ + u_int gd_other_cpus; /* all other cpus */ u_int64_t gd_idlepcbphys; /* pa of gd_idlepcb */ u_int64_t gd_pending_ipis; /* pending IPI events */ - struct pmap *gd_current_pmap; /* which pmap is active */ + struct pmap *gd_current_pmap; /* which pmap is active */ u_int32_t gd_next_asn; /* next ASN to allocate */ u_int32_t gd_current_asngen; /* ASN rollover check */ SLIST_ENTRY(globaldata) gd_allcpu; - struct lock_list_entry *gd_spinlocks; + struct lock_list_entry *gd_spinlocks; #ifdef KTR_PERCPU volatile int gd_ktr_idx; /* Index into trace table */ - char *gd_ktr_buf; - char gd_ktr_buf_data[0]; + char *gd_ktr_buf; + char gd_ktr_buf_data[0]; #endif }; diff --git a/sys/powerpc/include/globaldata.h b/sys/powerpc/include/globaldata.h index 225349a65377..b51592a415c9 100644 --- a/sys/powerpc/include/globaldata.h +++ b/sys/powerpc/include/globaldata.h @@ -1,5 +1,6 @@ /*- * Copyright (c) 1999 Luoqi Chen <luoqi@freebsd.org> + * Copyright (c) Peter Wemm <peter@netplex.com.au> * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -43,27 +44,25 @@ * point at the globaldata structure. */ struct globaldata { - struct proc *gd_curproc; /* current process */ - struct proc *gd_idleproc; /* idle process */ - struct proc *gd_fpcurproc; /* fp state owner */ - struct pcb *gd_curpcb; /* current pcb */ - struct timeval gd_switchtime; - int gd_switchticks; - u_int gd_cpuid; /* this cpu number */ - u_int gd_other_cpus; /* all other cpus */ - int gd_inside_intr; + struct proc *gd_curproc; /* current process */ + struct proc *gd_idleproc; /* idle process */ + struct proc *gd_fpcurproc; /* fp state owner */ + struct pcb *gd_curpcb; /* current pcb */ + struct timeval gd_switchtime; + int gd_switchticks; + u_int gd_cpuid; /* this cpu number */ + u_int gd_other_cpus; /* all other cpus */ + int gd_inside_intr; u_int32_t gd_next_asn; /* next ASN to allocate */ u_int32_t gd_current_asngen; /* ASN rollover check */ u_int32_t gd_intr_nesting_level; /* interrupt recursion */ SLIST_ENTRY(globaldata) gd_allcpu; - struct lock_list_entry *gd_spinlocks; + struct lock_list_entry *gd_spinlocks; #ifdef KTR_PERCPU -#ifdef KTR volatile int gd_ktr_idx; /* Index into trace table */ - char *gd_ktr_buf; - char gd_ktr_buf_data[KTR_SIZE]; -#endif + char *gd_ktr_buf; + char gd_ktr_buf_data[KTR_SIZE]; #endif }; diff --git a/sys/powerpc/include/pcpu.h b/sys/powerpc/include/pcpu.h index 225349a65377..b51592a415c9 100644 --- a/sys/powerpc/include/pcpu.h +++ b/sys/powerpc/include/pcpu.h @@ -1,5 +1,6 @@ /*- * Copyright (c) 1999 Luoqi Chen <luoqi@freebsd.org> + * Copyright (c) Peter Wemm <peter@netplex.com.au> * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -43,27 +44,25 @@ * point at the globaldata structure. */ struct globaldata { - struct proc *gd_curproc; /* current process */ - struct proc *gd_idleproc; /* idle process */ - struct proc *gd_fpcurproc; /* fp state owner */ - struct pcb *gd_curpcb; /* current pcb */ - struct timeval gd_switchtime; - int gd_switchticks; - u_int gd_cpuid; /* this cpu number */ - u_int gd_other_cpus; /* all other cpus */ - int gd_inside_intr; + struct proc *gd_curproc; /* current process */ + struct proc *gd_idleproc; /* idle process */ + struct proc *gd_fpcurproc; /* fp state owner */ + struct pcb *gd_curpcb; /* current pcb */ + struct timeval gd_switchtime; + int gd_switchticks; + u_int gd_cpuid; /* this cpu number */ + u_int gd_other_cpus; /* all other cpus */ + int gd_inside_intr; u_int32_t gd_next_asn; /* next ASN to allocate */ u_int32_t gd_current_asngen; /* ASN rollover check */ u_int32_t gd_intr_nesting_level; /* interrupt recursion */ SLIST_ENTRY(globaldata) gd_allcpu; - struct lock_list_entry *gd_spinlocks; + struct lock_list_entry *gd_spinlocks; #ifdef KTR_PERCPU -#ifdef KTR volatile int gd_ktr_idx; /* Index into trace table */ - char *gd_ktr_buf; - char gd_ktr_buf_data[KTR_SIZE]; -#endif + char *gd_ktr_buf; + char gd_ktr_buf_data[KTR_SIZE]; #endif }; diff --git a/sys/sparc64/include/globaldata.h b/sys/sparc64/include/globaldata.h index b3441dddcd48..35d924bcb2db 100644 --- a/sys/sparc64/include/globaldata.h +++ b/sys/sparc64/include/globaldata.h @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2001 Jake Burkholder. + * Copyright (c) 1999 Luoqi Chen <luoqi@freebsd.org> * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -29,23 +29,38 @@ #ifndef _MACHINE_GLOBALDATA_H_ #define _MACHINE_GLOBALDATA_H_ -struct lock_list_entry; -struct pcb; -struct proc; +#ifdef _KERNEL -struct globaldata { +#include <sys/queue.h> + +/* + * This structure maps out the global data that needs to be kept on a + * per-cpu basis. genassym uses this to generate offsets for the assembler + * code, which also provides external symbols so that C can get at them as + * though they were really globals. This structure is pointed to by + * the per-cpu system value. + * Inside the kernel, the globally reserved register g7 is used to + * point at the globaldata structure. + */ +struct globaldata { + struct proc *gd_curproc; /* current process */ + struct proc *gd_idleproc; /* idle process */ + struct pcb *gd_curpcb; /* current pcb */ + struct timeval gd_switchtime; + int gd_switchticks; + u_int gd_cpuid; /* this cpu number */ + u_int gd_other_cpus; /* all other cpus */ SLIST_ENTRY(globaldata) gd_allcpu; - struct pcb *gd_curpcb; - struct proc *gd_curproc; - struct proc *gd_idleproc; - u_int gd_cpuid; - u_int gd_other_cpus; struct lock_list_entry *gd_spinlocks; - struct timeval gd_switchtime; - int gd_switchticks; - +#ifdef KTR_PERCPU + volatile int gd_ktr_idx; /* Index into trace table */ + char *gd_ktr_buf; + char gd_ktr_buf_data[0]; +#endif struct intr_queue *gd_iq; struct intr_vector *gd_ivt; }; -#endif /* !_MACHINE_GLOBALDATA_H_ */ +#endif /* _KERNEL */ + +#endif /* !_MACHINE_GLOBALDATA_H_ */ diff --git a/sys/sparc64/include/pcpu.h b/sys/sparc64/include/pcpu.h index b3441dddcd48..35d924bcb2db 100644 --- a/sys/sparc64/include/pcpu.h +++ b/sys/sparc64/include/pcpu.h @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2001 Jake Burkholder. + * Copyright (c) 1999 Luoqi Chen <luoqi@freebsd.org> * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -29,23 +29,38 @@ #ifndef _MACHINE_GLOBALDATA_H_ #define _MACHINE_GLOBALDATA_H_ -struct lock_list_entry; -struct pcb; -struct proc; +#ifdef _KERNEL -struct globaldata { +#include <sys/queue.h> + +/* + * This structure maps out the global data that needs to be kept on a + * per-cpu basis. genassym uses this to generate offsets for the assembler + * code, which also provides external symbols so that C can get at them as + * though they were really globals. This structure is pointed to by + * the per-cpu system value. + * Inside the kernel, the globally reserved register g7 is used to + * point at the globaldata structure. + */ +struct globaldata { + struct proc *gd_curproc; /* current process */ + struct proc *gd_idleproc; /* idle process */ + struct pcb *gd_curpcb; /* current pcb */ + struct timeval gd_switchtime; + int gd_switchticks; + u_int gd_cpuid; /* this cpu number */ + u_int gd_other_cpus; /* all other cpus */ SLIST_ENTRY(globaldata) gd_allcpu; - struct pcb *gd_curpcb; - struct proc *gd_curproc; - struct proc *gd_idleproc; - u_int gd_cpuid; - u_int gd_other_cpus; struct lock_list_entry *gd_spinlocks; - struct timeval gd_switchtime; - int gd_switchticks; - +#ifdef KTR_PERCPU + volatile int gd_ktr_idx; /* Index into trace table */ + char *gd_ktr_buf; + char gd_ktr_buf_data[0]; +#endif struct intr_queue *gd_iq; struct intr_vector *gd_ivt; }; -#endif /* !_MACHINE_GLOBALDATA_H_ */ +#endif /* _KERNEL */ + +#endif /* !_MACHINE_GLOBALDATA_H_ */ |