From ffcb357bd173210ba028d6c5442c4950416ec6f9 Mon Sep 17 00:00:00 2001
From: Peter Wemm <peter@FreeBSD.org>
Date: Sat, 6 Nov 2004 03:23:36 +0000
Subject: [PATCH] Begin an invasion of i386-land by amd64.

Expose some of the amd64-specific sysarch functions to allow alternative
implementations of the %fs/%gs code for TLS, threads, etc.  USER_LDT does
not exist on the amd64 kernel, so we have to implement things other ways.
---
 sys/i386/include/sysarch.h | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/sys/i386/include/sysarch.h b/sys/i386/include/sysarch.h
index 01c52a9e1e31..b11794384472 100644
--- a/sys/i386/include/sysarch.h
+++ b/sys/i386/include/sysarch.h
@@ -44,6 +44,12 @@
 				/* xxxxx */
 #define I386_VM86	6
 
+/* These four only exist when running an i386 binary on amd64 */
+#define	_AMD64_GET_FSBASE	128
+#define	_AMD64_SET_FSBASE	129
+#define	_AMD64_GET_GSBASE	130
+#define	_AMD64_SET_GSBASE	131
+
 struct i386_ldt_args {
 	unsigned int start;
 	union	descriptor *descs;
@@ -68,6 +74,11 @@ union descriptor;
 struct dbreg;
 
 __BEGIN_DECLS
+/* These four only exist when running an i386 binary on amd64 */
+int _amd64_get_fsbase(void **);
+int _amd64_get_gsbase(void **);
+int _amd64_set_fsbase(void *);
+int _amd64_set_gsbase(void *);
 int i386_get_ldt(int, union descriptor *, int);
 int i386_set_ldt(int, union descriptor *, int);
 int i386_get_ioperm(unsigned int, unsigned int *, int *);