summaryrefslogtreecommitdiffstats
path: root/tcg/i386
diff options
context:
space:
mode:
authorRichard Henderson2018-12-03 16:25:10 +0100
committerRichard Henderson2018-12-17 04:04:44 +0100
commit5785c17f319106d6709f4ffc05de888cb0a412f3 (patch)
tree1c8cbc5f761ee905d47159f3a94b86e2135e50dd /tcg/i386
parenttcg/i386: Precompute all guest_base parameters (diff)
downloadqemu-5785c17f319106d6709f4ffc05de888cb0a412f3.tar.gz
qemu-5785c17f319106d6709f4ffc05de888cb0a412f3.tar.xz
qemu-5785c17f319106d6709f4ffc05de888cb0a412f3.zip
tcg/i386: Add setup_guest_base_seg for FreeBSD
Reviewed-by: Emilio G. Cota <cota@braap.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Diffstat (limited to 'tcg/i386')
-rw-r--r--tcg/i386/tcg-target.inc.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/tcg/i386/tcg-target.inc.c b/tcg/i386/tcg-target.inc.c
index 3fb2f4b971..c21c3272f2 100644
--- a/tcg/i386/tcg-target.inc.c
+++ b/tcg/i386/tcg-target.inc.c
@@ -1876,6 +1876,15 @@ static inline int setup_guest_base_seg(void)
}
return 0;
}
+# elif defined (__FreeBSD__) || defined (__FreeBSD_kernel__)
+# include <machine/sysarch.h>
+static inline int setup_guest_base_seg(void)
+{
+ if (sysarch(AMD64_SET_GSBASE, &guest_base) == 0) {
+ return P_GS;
+ }
+ return 0;
+}
# else
static inline int setup_guest_base_seg(void)
{