| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: cpu.h,v 1.93 2010/12/26 12:06:57 martin Exp $ */ | | 1 | /* $NetBSD: cpu.h,v 1.94 2011/01/24 10:04:28 martin 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 software was developed by the Computer Systems Engineering group | | 7 | * This software was developed by the Computer Systems Engineering group |
8 | * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and | | 8 | * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and |
9 | * contributed to Berkeley. | | 9 | * contributed to Berkeley. |
10 | * | | 10 | * |
11 | * All advertising materials mentioning features or use of this software | | 11 | * All advertising materials mentioning features or use of this software |
12 | * must display the following acknowledgement: | | 12 | * must display the following acknowledgement: |
13 | * This product includes software developed by the University of | | 13 | * This product includes software developed by the University of |
14 | * California, Lawrence Berkeley Laboratory. | | 14 | * California, Lawrence Berkeley Laboratory. |
| @@ -254,26 +254,29 @@ typedef void (* ipifunc_t)(void *, void | | | @@ -254,26 +254,29 @@ typedef void (* ipifunc_t)(void *, void |
254 | | | 254 | |
255 | void sparc64_multicast_ipi(sparc64_cpuset_t, ipifunc_t, uint64_t, uint64_t); | | 255 | void sparc64_multicast_ipi(sparc64_cpuset_t, ipifunc_t, uint64_t, uint64_t); |
256 | void sparc64_broadcast_ipi(ipifunc_t, uint64_t, uint64_t); | | 256 | void sparc64_broadcast_ipi(ipifunc_t, uint64_t, uint64_t); |
257 | void sparc64_send_ipi(int, ipifunc_t, uint64_t, uint64_t); | | 257 | void sparc64_send_ipi(int, ipifunc_t, uint64_t, uint64_t); |
258 | | | 258 | |
259 | /* | | 259 | /* |
260 | * Call an arbitrary C function on another cpu (or all others but ourself) | | 260 | * Call an arbitrary C function on another cpu (or all others but ourself) |
261 | */ | | 261 | */ |
262 | typedef void (*ipi_c_call_func_t)(void*); | | 262 | typedef void (*ipi_c_call_func_t)(void*); |
263 | void sparc64_generic_xcall(struct cpu_info*, ipi_c_call_func_t, void*); | | 263 | void sparc64_generic_xcall(struct cpu_info*, ipi_c_call_func_t, void*); |
264 | | | 264 | |
265 | #endif | | 265 | #endif |
266 | | | 266 | |
| | | 267 | /* Provide %pc of a lwp */ |
| | | 268 | #define LWP_PC(l) ((l)->l_md.md_tf->tf_pc) |
| | | 269 | |
267 | /* | | 270 | /* |
268 | * Arguments to hardclock, softclock and gatherstats encapsulate the | | 271 | * Arguments to hardclock, softclock and gatherstats encapsulate the |
269 | * previous machine state in an opaque clockframe. The ipl is here | | 272 | * previous machine state in an opaque clockframe. The ipl is here |
270 | * as well for strayintr (see locore.s:interrupt and intr.c:strayintr). | | 273 | * as well for strayintr (see locore.s:interrupt and intr.c:strayintr). |
271 | * Note that CLKF_INTR is valid only if CLKF_USERMODE is false. | | 274 | * Note that CLKF_INTR is valid only if CLKF_USERMODE is false. |
272 | */ | | 275 | */ |
273 | struct clockframe { | | 276 | struct clockframe { |
274 | struct trapframe64 t; | | 277 | struct trapframe64 t; |
275 | }; | | 278 | }; |
276 | | | 279 | |
277 | #define CLKF_USERMODE(framep) (((framep)->t.tf_tstate & TSTATE_PRIV) == 0) | | 280 | #define CLKF_USERMODE(framep) (((framep)->t.tf_tstate & TSTATE_PRIV) == 0) |
278 | #define CLKF_PC(framep) ((framep)->t.tf_pc) | | 281 | #define CLKF_PC(framep) ((framep)->t.tf_pc) |
279 | /* Since some files in sys/kern do not know BIAS, I'm using 0x7ff here */ | | 282 | /* Since some files in sys/kern do not know BIAS, I'm using 0x7ff here */ |