pcpu.h (76078) | pcpu.h (78342) |
---|---|
1/*- 2 * Copyright (c) 1999 Luoqi Chen <luoqi@freebsd.org> 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 9 unchanged lines hidden (view full) --- 18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 * | 1/*- 2 * Copyright (c) 1999 Luoqi Chen <luoqi@freebsd.org> 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 9 unchanged lines hidden (view full) --- 18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 * |
26 * $FreeBSD: head/sys/powerpc/include/pcpu.h 76078 2001-04-27 19:28:25Z jhb $ | 26 * $FreeBSD: head/sys/powerpc/include/pcpu.h 78342 2001-06-16 07:14:07Z benno $ |
27 */ 28 29#ifndef _MACHINE_GLOBALDATA_H_ 30#define _MACHINE_GLOBALDATA_H_ 31 32#ifdef _KERNEL 33 34#include <sys/queue.h> 35 36/* 37 * This structure maps out the global data that needs to be kept on a 38 * per-cpu basis. genassym uses this to generate offsets for the assembler 39 * code, which also provides external symbols so that C can get at them as 40 * though they were really globals. This structure is pointed to by 41 * the per-cpu system value (see alpha_pal_rdval() and alpha_pal_wrval()). 42 * Inside the kernel, the globally reserved register t7 is used to 43 * point at the globaldata structure. 44 */ 45struct globaldata { | 27 */ 28 29#ifndef _MACHINE_GLOBALDATA_H_ 30#define _MACHINE_GLOBALDATA_H_ 31 32#ifdef _KERNEL 33 34#include <sys/queue.h> 35 36/* 37 * This structure maps out the global data that needs to be kept on a 38 * per-cpu basis. genassym uses this to generate offsets for the assembler 39 * code, which also provides external symbols so that C can get at them as 40 * though they were really globals. This structure is pointed to by 41 * the per-cpu system value (see alpha_pal_rdval() and alpha_pal_wrval()). 42 * Inside the kernel, the globally reserved register t7 is used to 43 * point at the globaldata structure. 44 */ 45struct globaldata { |
46 struct alpha_pcb gd_idlepcb; /* pcb for idling */ | |
47 struct proc *gd_curproc; /* current process */ 48 struct proc *gd_idleproc; /* idle process */ 49 struct proc *gd_fpcurproc; /* fp state owner */ 50 struct pcb *gd_curpcb; /* current pcb */ 51 struct timeval gd_switchtime; 52 int gd_switchticks; 53 u_int gd_cpuid; /* this cpu number */ 54 u_int gd_other_cpus; /* all other cpus */ | 46 struct proc *gd_curproc; /* current process */ 47 struct proc *gd_idleproc; /* idle process */ 48 struct proc *gd_fpcurproc; /* fp state owner */ 49 struct pcb *gd_curpcb; /* current pcb */ 50 struct timeval gd_switchtime; 51 int gd_switchticks; 52 u_int gd_cpuid; /* this cpu number */ 53 u_int gd_other_cpus; /* all other cpus */ |
55 u_int64_t gd_idlepcbphys; /* pa of gd_idlepcb */ 56 u_int64_t gd_pending_ipis; /* pending IPI events */ | 54 int gd_inside_intr; |
57 u_int32_t gd_next_asn; /* next ASN to allocate */ 58 u_int32_t gd_current_asngen; /* ASN rollover check */ | 55 u_int32_t gd_next_asn; /* next ASN to allocate */ 56 u_int32_t gd_current_asngen; /* ASN rollover check */ |
57 u_int32_t gd_intr_nesting_level; /* interrupt recursion */ |
|
59 | 58 |
59 u_int gd_astpending; |
|
60 SLIST_ENTRY(globaldata) gd_allcpu; 61 struct lock_list_entry *gd_spinlocks; 62#ifdef KTR_PERCPU | 60 SLIST_ENTRY(globaldata) gd_allcpu; 61 struct lock_list_entry *gd_spinlocks; 62#ifdef KTR_PERCPU |
63#ifdef KTR |
|
63 volatile int gd_ktr_idx; /* Index into trace table */ 64 char *gd_ktr_buf; | 64 volatile int gd_ktr_idx; /* Index into trace table */ 65 char *gd_ktr_buf; |
65 char gd_ktr_buf_data[0]; | 66 char gd_ktr_buf_data[KTR_SIZE]; |
66#endif | 67#endif |
68#endif |
|
67}; 68 69void globaldata_init(struct globaldata *pcpu, int cpuid, size_t sz); 70 71#endif /* _KERNEL */ 72 73#endif /* !_MACHINE_GLOBALDATA_H_ */ | 69}; 70 71void globaldata_init(struct globaldata *pcpu, int cpuid, size_t sz); 72 73#endif /* _KERNEL */ 74 75#endif /* !_MACHINE_GLOBALDATA_H_ */ |