diff options
| author | John Baldwin <jhb@FreeBSD.org> | 2001-12-11 23:33:44 +0000 |
|---|---|---|
| committer | John Baldwin <jhb@FreeBSD.org> | 2001-12-11 23:33:44 +0000 |
| commit | 0bbc882680ceece07eb134ddeb7fceffb59ea018 (patch) | |
| tree | c785835e70070309148a72c55669ff0bf043a20a /sys/alpha/include | |
| parent | defd4957ccd0abfd2d3d3417dfae025ee37f770e (diff) | |
Notes
Diffstat (limited to 'sys/alpha/include')
| -rw-r--r-- | sys/alpha/include/asm.h | 2 | ||||
| -rw-r--r-- | sys/alpha/include/globaldata.h | 74 | ||||
| -rw-r--r-- | sys/alpha/include/globals.h | 51 | ||||
| -rw-r--r-- | sys/alpha/include/mutex.h | 2 | ||||
| -rw-r--r-- | sys/alpha/include/pcb.h | 1 | ||||
| -rw-r--r-- | sys/alpha/include/pcpu.h | 50 | ||||
| -rw-r--r-- | sys/alpha/include/proc.h | 3 |
7 files changed, 16 insertions, 167 deletions
diff --git a/sys/alpha/include/asm.h b/sys/alpha/include/asm.h index 4a9963c5a40b..782505cfae45 100644 --- a/sys/alpha/include/asm.h +++ b/sys/alpha/include/asm.h @@ -91,7 +91,7 @@ /* In the kernel, we use t7 to point at the per-cpu globals. */ #ifdef _KERNEL -#define globalp $8 +#define pcpup $8 #endif /* Floating point registers (XXXX VERIFY THIS) */ diff --git a/sys/alpha/include/globaldata.h b/sys/alpha/include/globaldata.h deleted file mode 100644 index d0ba7064cad7..000000000000 --- a/sys/alpha/include/globaldata.h +++ /dev/null @@ -1,74 +0,0 @@ -/*- - * 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 - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * $FreeBSD$ - */ - -#ifndef _MACHINE_GLOBALDATA_H_ -#define _MACHINE_GLOBALDATA_H_ - -#ifdef _KERNEL - -#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 (see alpha_pal_rdval() and alpha_pal_wrval()). - * Inside the kernel, the globally reserved register t7 is used to - * point at the globaldata structure. - */ -struct globaldata { - struct alpha_pcb gd_idlepcb; /* pcb for idling */ - struct thread *gd_curthread; /* current thread */ - struct thread *gd_idlethread; /* idle thread */ - struct thread *gd_fpcurthread; /* 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; -#ifdef KTR_PERCPU - int gd_ktr_idx; /* Index into trace table */ - char *gd_ktr_buf; - char gd_ktr_buf_data[0]; -#endif -}; - -void globaldata_init(struct globaldata *pcpu, int cpuid, size_t sz); - -#endif /* _KERNEL */ - -#endif /* !_MACHINE_GLOBALDATA_H_ */ diff --git a/sys/alpha/include/globals.h b/sys/alpha/include/globals.h deleted file mode 100644 index a6a87f26a378..000000000000 --- a/sys/alpha/include/globals.h +++ /dev/null @@ -1,51 +0,0 @@ -/*- - * Copyright (c) 1999 Luoqi Chen <luoqi@freebsd.org> - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * $FreeBSD$ - */ - -#ifndef _MACHINE_GLOBALS_H_ -#define _MACHINE_GLOBALS_H_ - -#ifdef _KERNEL -#include <machine/globaldata.h> - -register struct globaldata *globalp __asm__("$8"); - -#define GLOBALP globalp - -#define PCPU_GET(member) (GLOBALP->gd_ ## member) -#define PCPU_PTR(member) (&GLOBALP->gd_ ## member) -#define PCPU_SET(member,value) (GLOBALP->gd_ ## member = (value)) - -#define curthread PCPU_GET(curthread) -#define CURPROC (curthread->td_proc) -#define curproc (curthread->td_proc) -#define curksegrp (curthread->td_ksegrp) -#define curkse (curthread->td_kse) - -#endif /* _KERNEL */ - -#endif /* !_MACHINE_GLOBALS_H_ */ diff --git a/sys/alpha/include/mutex.h b/sys/alpha/include/mutex.h index 9192bb2b0c3c..970049bda0bd 100644 --- a/sys/alpha/include/mutex.h +++ b/sys/alpha/include/mutex.h @@ -58,7 +58,7 @@ extern struct mtx clock_lock; 1: ldq_l a0, lck+MTX_LOCK; \ cmpeq a0, MTX_UNOWNED, a1; \ beq a1, 1b; \ - ldq a0, PC_CURTHREAD(globalp); \ + ldq a0, PC_CURTHREAD(pcpup); \ stq_c a0, lck+MTX_LOCK; \ beq a0, 1b; \ mb; \ diff --git a/sys/alpha/include/pcb.h b/sys/alpha/include/pcb.h index 18c4c13de086..cfbdfdf74b9d 100644 --- a/sys/alpha/include/pcb.h +++ b/sys/alpha/include/pcb.h @@ -33,7 +33,6 @@ #include <machine/frame.h> #include <machine/reg.h> -#include <machine/globaldata.h> #include <machine/alpha_cpu.h> /* diff --git a/sys/alpha/include/pcpu.h b/sys/alpha/include/pcpu.h index d0ba7064cad7..807f259f5614 100644 --- a/sys/alpha/include/pcpu.h +++ b/sys/alpha/include/pcpu.h @@ -27,48 +27,26 @@ * $FreeBSD$ */ -#ifndef _MACHINE_GLOBALDATA_H_ -#define _MACHINE_GLOBALDATA_H_ +#ifndef _MACHINE_PCPU_H_ +#define _MACHINE_PCPU_H_ #ifdef _KERNEL -#include <sys/queue.h> +#define PCPU_MD_FIELDS \ + struct alpha_pcb pc_idlepcb; /* pcb for idling */ \ + u_int64_t pc_idlepcbphys; /* pa of pc_idlepcb */ \ + u_int64_t pc_pending_ipis; /* pending IPI's */ \ + u_int32_t pc_next_asn; /* next ASN to alloc */ \ + u_int32_t pc_current_asngen /* ASN rollover check */ -/* - * 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 (see alpha_pal_rdval() and alpha_pal_wrval()). - * Inside the kernel, the globally reserved register t7 is used to - * point at the globaldata structure. - */ -struct globaldata { - struct alpha_pcb gd_idlepcb; /* pcb for idling */ - struct thread *gd_curthread; /* current thread */ - struct thread *gd_idlethread; /* idle thread */ - struct thread *gd_fpcurthread; /* 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 */ +struct pcpu; - SLIST_ENTRY(globaldata) gd_allcpu; - struct lock_list_entry *gd_spinlocks; -#ifdef KTR_PERCPU - int gd_ktr_idx; /* Index into trace table */ - char *gd_ktr_buf; - char gd_ktr_buf_data[0]; -#endif -}; +register struct pcpu *pcpup __asm__("$8"); -void globaldata_init(struct globaldata *pcpu, int cpuid, size_t sz); +#define PCPU_GET(member) (pcpup->pc_ ## member) +#define PCPU_PTR(member) (&pcpup->pc_ ## member) +#define PCPU_SET(member,value) (pcpup->pc_ ## member = (value)) #endif /* _KERNEL */ -#endif /* !_MACHINE_GLOBALDATA_H_ */ +#endif /* !_MACHINE_PCPU_H_ */ diff --git a/sys/alpha/include/proc.h b/sys/alpha/include/proc.h index 16cf1d5b59a5..eb1772a1128a 100644 --- a/sys/alpha/include/proc.h +++ b/sys/alpha/include/proc.h @@ -31,9 +31,6 @@ #ifndef _MACHINE_PROC_H_ #define _MACHINE_PROC_H_ -#include <machine/globaldata.h> -#include <machine/globals.h> - /* * Machine-dependent part of the proc struct for the Alpha. */ |
