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>
This commit is contained in:
Richard Henderson 2018-12-03 09:25:10 -06:00
parent 913c2bddc2
commit 5785c17f31

View File

@ -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)
{