summaryrefslogtreecommitdiff
path: root/sys/arch/amd64/include/cpu.h
diff options
context:
space:
mode:
authorPhilip Guenthe <guenther@cvs.openbsd.org>2011-04-05 21:14:01 +0000
committerPhilip Guenthe <guenther@cvs.openbsd.org>2011-04-05 21:14:01 +0000
commit6e77b8380c3db497c799d8168d9f686409cd2643 (patch)
treeb69078ec7d83d4b88eeb0ab965e1aea196a92b5d /sys/arch/amd64/include/cpu.h
parent0d679e66aa1bbe99765255105f187afb1d4e9ae9 (diff)
Add support for per-rthread base-offset for the %fs selector on amd64.
Add pcb_fsbase to the PCB for tracking what the value for the thread is, and ci_cur_fsbase to struct cpu_info for tracking the CPU's current value for FS.base, then on return to user-space, skip the setting if the CPU has the right value already. Non-threaded processes without TLS leave FS.base zero, which can be conveniently optimized: setting %fs zeros FS.base for fewer cycles than wrmsr. ok kettenis@
Diffstat (limited to 'sys/arch/amd64/include/cpu.h')
-rw-r--r--sys/arch/amd64/include/cpu.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/arch/amd64/include/cpu.h b/sys/arch/amd64/include/cpu.h
index 260212f10a9..53e063ae551 100644
--- a/sys/arch/amd64/include/cpu.h
+++ b/sys/arch/amd64/include/cpu.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: cpu.h,v 1.63 2011/03/23 16:54:34 pirofti Exp $ */
+/* $OpenBSD: cpu.h,v 1.64 2011/04/05 21:14:00 guenther Exp $ */
/* $NetBSD: cpu.h,v 1.1 2003/04/26 18:39:39 fvdl Exp $ */
/*-
@@ -72,6 +72,7 @@ struct cpu_info {
u_int32_t ci_randseed;
u_int64_t ci_scratch;
+ u_int64_t ci_cur_fsbase;
struct proc *ci_fpcurproc;
struct proc *ci_fpsaveproc;