Get rid of l_addr references pulled in via merge.diff -r1.2 -r1.3 src/sys/arch/mips/mips/netbsd32_machdep.c
(matt)
--- src/sys/arch/mips/mips/netbsd32_machdep.c 2009/12/14 00:46:07 1.2
+++ src/sys/arch/mips/mips/netbsd32_machdep.c 2009/12/14 04:37:02 1.3
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: netbsd32_machdep.c,v 1.2 2009/12/14 00:46:07 matt Exp $ */ | 1 | /* $NetBSD: netbsd32_machdep.c,v 1.3 2009/12/14 04:37:02 matt Exp $ */ | |
2 | 2 | |||
3 | /*- | 3 | /*- | |
4 | * Copyright (c) 2009 The NetBSD Foundation, Inc. | 4 | * Copyright (c) 2009 The NetBSD Foundation, Inc. | |
5 | * All rights reserved. | 5 | * All rights reserved. | |
6 | * | 6 | * | |
7 | * This code is derived from software contributed to The NetBSD Foundation | 7 | * This code is derived from software contributed to The NetBSD Foundation | |
8 | * by Matt Thomas <matt@3am-software.com>. | 8 | * by Matt Thomas <matt@3am-software.com>. | |
9 | * | 9 | * | |
10 | * Redistribution and use in source and binary forms, with or without | 10 | * Redistribution and use in source and binary forms, with or without | |
11 | * modification, are permitted provided that the following conditions | 11 | * modification, are permitted provided that the following conditions | |
12 | * are met: | 12 | * are met: | |
13 | * 1. Redistributions of source code must retain the above copyright | 13 | * 1. Redistributions of source code must retain the above copyright | |
14 | * notice, this list of conditions and the following disclaimer. | 14 | * notice, this list of conditions and the following disclaimer. | |
@@ -20,27 +20,27 @@ | @@ -20,27 +20,27 @@ | |||
20 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED | 20 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED | |
21 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | 21 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | |
22 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS | 22 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS | |
23 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | 23 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | |
24 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | 24 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | |
25 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | 25 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | |
26 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | 26 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | |
27 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | 27 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | |
28 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | 28 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | |
29 | * POSSIBILITY OF SUCH DAMAGE. | 29 | * POSSIBILITY OF SUCH DAMAGE. | |
30 | */ | 30 | */ | |
31 | 31 | |||
32 | #include <sys/cdefs.h> | 32 | #include <sys/cdefs.h> | |
33 | __KERNEL_RCSID(0, "$NetBSD: netbsd32_machdep.c,v 1.2 2009/12/14 00:46:07 matt Exp $"); | 33 | __KERNEL_RCSID(0, "$NetBSD: netbsd32_machdep.c,v 1.3 2009/12/14 04:37:02 matt Exp $"); | |
34 | 34 | |||
35 | #include "opt_compat_netbsd.h" | 35 | #include "opt_compat_netbsd.h" | |
36 | #include "opt_sa.h" | 36 | #include "opt_sa.h" | |
37 | #include "opt_coredump.h" | 37 | #include "opt_coredump.h" | |
38 | 38 | |||
39 | #include <sys/param.h> | 39 | #include <sys/param.h> | |
40 | #include <sys/systm.h> | 40 | #include <sys/systm.h> | |
41 | #include <sys/ioctl.h> | 41 | #include <sys/ioctl.h> | |
42 | #include <sys/exec.h> | 42 | #include <sys/exec.h> | |
43 | #include <sys/core.h> | 43 | #include <sys/core.h> | |
44 | #include <sys/file.h> | 44 | #include <sys/file.h> | |
45 | #include <sys/time.h> | 45 | #include <sys/time.h> | |
46 | #include <sys/proc.h> | 46 | #include <sys/proc.h> | |
@@ -298,28 +298,30 @@ cpu_coredump32(struct lwp *l, void *ioco | @@ -298,28 +298,30 @@ cpu_coredump32(struct lwp *l, void *ioco | |||
298 | } cpustate; | 298 | } cpustate; | |
299 | 299 | |||
300 | if (iocookie == NULL) { | 300 | if (iocookie == NULL) { | |
301 | CORE_SETMAGIC(*chdr, COREMAGIC, MID_MACHINE, 0); | 301 | CORE_SETMAGIC(*chdr, COREMAGIC, MID_MACHINE, 0); | |
302 | chdr->c_hdrsize = ALIGN(sizeof(struct core)); | 302 | chdr->c_hdrsize = ALIGN(sizeof(struct core)); | |
303 | chdr->c_seghdrsize = ALIGN(sizeof(struct coreseg)); | 303 | chdr->c_seghdrsize = ALIGN(sizeof(struct coreseg)); | |
304 | chdr->c_cpusize = sizeof(struct cpustate); | 304 | chdr->c_cpusize = sizeof(struct cpustate); | |
305 | chdr->c_nseg++; | 305 | chdr->c_nseg++; | |
306 | return 0; | 306 | return 0; | |
307 | } | 307 | } | |
308 | 308 | |||
309 | if ((l->l_md.md_flags & MDP_FPUSED) && l == fpcurlwp) | 309 | if ((l->l_md.md_flags & MDP_FPUSED) && l == fpcurlwp) | |
310 | savefpregs(l); | 310 | savefpregs(l); | |
311 | ||||
312 | struct pcb * const pcb = lwp_getpcb(l); | |||
311 | cpustate.frame = *l->l_md.md_regs; | 313 | cpustate.frame = *l->l_md.md_regs; | |
312 | cpustate.fpregs = l->l_addr->u_pcb.pcb_fpregs; | 314 | cpustate.fpregs = pcb->pcb_fpregs; | |
313 | 315 | |||
314 | CORE_SETMAGIC(cseg, CORESEGMAGIC, MID_MACHINE, CORE_CPU); | 316 | CORE_SETMAGIC(cseg, CORESEGMAGIC, MID_MACHINE, CORE_CPU); | |
315 | cseg.c_addr = 0; | 317 | cseg.c_addr = 0; | |
316 | cseg.c_size = chdr->c_cpusize; | 318 | cseg.c_size = chdr->c_cpusize; | |
317 | 319 | |||
318 | error = coredump_write(iocookie, UIO_SYSSPACE, &cseg, | 320 | error = coredump_write(iocookie, UIO_SYSSPACE, &cseg, | |
319 | chdr->c_seghdrsize); | 321 | chdr->c_seghdrsize); | |
320 | if (error) | 322 | if (error) | |
321 | return error; | 323 | return error; | |
322 | 324 | |||
323 | return coredump_write(iocookie, UIO_SYSSPACE, &cpustate, | 325 | return coredump_write(iocookie, UIO_SYSSPACE, &cpustate, | |
324 | chdr->c_cpusize); | 326 | chdr->c_cpusize); | |
325 | } | 327 | } |
--- src/sys/arch/mips/mips/vm_machdep.c 2009/12/14 00:46:07 1.129
+++ src/sys/arch/mips/mips/vm_machdep.c 2009/12/14 04:37:02 1.130
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: vm_machdep.c,v 1.129 2009/12/14 00:46:07 matt Exp $ */ | 1 | /* $NetBSD: vm_machdep.c,v 1.130 2009/12/14 04:37:02 matt Exp $ */ | |
2 | 2 | |||
3 | /* | 3 | /* | |
4 | * Copyright (c) 1992, 1993 | 4 | * Copyright (c) 1992, 1993 | |
5 | * The Regents of the University of California. All rights reserved. | 5 | * The Regents of the University of California. All rights reserved. | |
6 | * | 6 | * | |
7 | * This code is derived from software contributed to Berkeley by | 7 | * This code is derived from software contributed to Berkeley by | |
8 | * the Systems Programming Group of the University of Utah Computer | 8 | * the Systems Programming Group of the University of Utah Computer | |
9 | * Science Department and Ralph Campbell. | 9 | * Science Department and Ralph Campbell. | |
10 | * | 10 | * | |
11 | * Redistribution and use in source and binary forms, with or without | 11 | * Redistribution and use in source and binary forms, with or without | |
12 | * modification, are permitted provided that the following conditions | 12 | * modification, are permitted provided that the following conditions | |
13 | * are met: | 13 | * are met: | |
14 | * 1. Redistributions of source code must retain the above copyright | 14 | * 1. Redistributions of source code must retain the above copyright | |
@@ -67,27 +67,27 @@ | @@ -67,27 +67,27 @@ | |||
67 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | 67 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | |
68 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | 68 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | |
69 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | 69 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | |
70 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | 70 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | |
71 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | 71 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |
72 | * SUCH DAMAGE. | 72 | * SUCH DAMAGE. | |
73 | * | 73 | * | |
74 | * from: Utah Hdr: vm_machdep.c 1.21 91/04/06 | 74 | * from: Utah Hdr: vm_machdep.c 1.21 91/04/06 | |
75 | * | 75 | * | |
76 | * @(#)vm_machdep.c 8.3 (Berkeley) 1/4/94 | 76 | * @(#)vm_machdep.c 8.3 (Berkeley) 1/4/94 | |
77 | */ | 77 | */ | |
78 | 78 | |||
79 | #include <sys/cdefs.h> /* RCS ID & Copyright macro defns */ | 79 | #include <sys/cdefs.h> /* RCS ID & Copyright macro defns */ | |
80 | __KERNEL_RCSID(0, "$NetBSD: vm_machdep.c,v 1.129 2009/12/14 00:46:07 matt Exp $"); | 80 | __KERNEL_RCSID(0, "$NetBSD: vm_machdep.c,v 1.130 2009/12/14 04:37:02 matt Exp $"); | |
81 | 81 | |||
82 | #include "opt_ddb.h" | 82 | #include "opt_ddb.h" | |
83 | 83 | |||
84 | #include <sys/param.h> | 84 | #include <sys/param.h> | |
85 | #include <sys/systm.h> | 85 | #include <sys/systm.h> | |
86 | #include <sys/proc.h> | 86 | #include <sys/proc.h> | |
87 | #include <sys/malloc.h> | 87 | #include <sys/malloc.h> | |
88 | #include <sys/buf.h> | 88 | #include <sys/buf.h> | |
89 | #include <sys/vnode.h> | 89 | #include <sys/vnode.h> | |
90 | #include <sys/core.h> | 90 | #include <sys/core.h> | |
91 | #include <sys/exec.h> | 91 | #include <sys/exec.h> | |
92 | #include <sys/sa.h> | 92 | #include <sys/sa.h> | |
93 | #include <sys/savar.h> | 93 | #include <sys/savar.h> | |
@@ -185,27 +185,27 @@ cpu_lwp_fork(struct lwp *l1, struct lwp | @@ -185,27 +185,27 @@ cpu_lwp_fork(struct lwp *l1, struct lwp | |||
185 | #endif | 185 | #endif | |
186 | #ifdef IPL_ICU_MASK | 186 | #ifdef IPL_ICU_MASK | |
187 | /* Machine depenedend interrupt mask. */ | 187 | /* Machine depenedend interrupt mask. */ | |
188 | pcb2->pcb_ppl = 0; | 188 | pcb2->pcb_ppl = 0; | |
189 | #endif | 189 | #endif | |
190 | } | 190 | } | |
191 | 191 | |||
192 | void | 192 | void | |
193 | cpu_setfunc(struct lwp *l, void (*func)(void *), void *arg) | 193 | cpu_setfunc(struct lwp *l, void (*func)(void *), void *arg) | |
194 | { | 194 | { | |
195 | struct pcb *pcb = lwp_getpcb(l); | 195 | struct pcb *pcb = lwp_getpcb(l); | |
196 | struct frame *f = l->l_md.md_regs; | 196 | struct frame *f = l->l_md.md_regs; | |
197 | 197 | |||
198 | KASSERT(f == (struct frame *)((char *)l->l_addr + USPACE) - 1); | 198 | KASSERT(f == (struct frame *)((uintptr_t)uvm_lwp_getuarea(l) + USPACE) - 1); | |
199 | 199 | |||
200 | pcb->pcb_context.val[_L_S0] = (intptr_t)func; /* S0 */ | 200 | pcb->pcb_context.val[_L_S0] = (intptr_t)func; /* S0 */ | |
201 | pcb->pcb_context.val[_L_S1] = (intptr_t)arg; /* S1 */ | 201 | pcb->pcb_context.val[_L_S1] = (intptr_t)arg; /* S1 */ | |
202 | pcb->pcb_context.val[MIPS_CURLWP_CARD - 16] = (intptr_t)l; /* S? */ | 202 | pcb->pcb_context.val[MIPS_CURLWP_CARD - 16] = (intptr_t)l; /* S? */ | |
203 | pcb->pcb_context.val[_L_SP] = (intptr_t)f; /* SP */ | 203 | pcb->pcb_context.val[_L_SP] = (intptr_t)f; /* SP */ | |
204 | pcb->pcb_context.val[_L_RA] = (intptr_t)setfunc_trampoline; /* RA */ | 204 | pcb->pcb_context.val[_L_RA] = (intptr_t)setfunc_trampoline; /* RA */ | |
205 | #ifdef _LP64 | 205 | #ifdef _LP64 | |
206 | KASSERT(pcb->pcb_context.val[_L_SR] & MIPS_SR_KX); | 206 | KASSERT(pcb->pcb_context.val[_L_SR] & MIPS_SR_KX); | |
207 | #endif | 207 | #endif | |
208 | #ifdef IPL_ICU_MASK | 208 | #ifdef IPL_ICU_MASK | |
209 | /* Machine depenedend interrupt mask. */ | 209 | /* Machine depenedend interrupt mask. */ | |
210 | pcb->pcb_ppl = 0; | 210 | pcb->pcb_ppl = 0; | |
211 | #endif | 211 | #endif |