summaryrefslogtreecommitdiffstats
path: root/sys/amd64
diff options
context:
space:
mode:
authorrpaulo <rpaulo@FreeBSD.org>2010-07-06 16:56:27 +0000
committerrpaulo <rpaulo@FreeBSD.org>2010-07-06 16:56:27 +0000
commit6b746d7d7dfe7b095d2a50b04ce49586fd4a0079 (patch)
tree6084eaaea30af98d777d4ff2517bf537a7fea995 /sys/amd64
parente0da55d85c88cc5e6e6ea9a7daaf024f51bfe9d0 (diff)
downloadFreeBSD-src-6b746d7d7dfe7b095d2a50b04ce49586fd4a0079.zip
FreeBSD-src-6b746d7d7dfe7b095d2a50b04ce49586fd4a0079.tar.gz
Introduce USD_{SET,GET}{BASE,LIMIT}. These help setting up the user
segment descriptor hi and lo values. Idea from Solaris. Reviewed by: kib
Diffstat (limited to 'sys/amd64')
-rw-r--r--sys/amd64/include/segments.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/sys/amd64/include/segments.h b/sys/amd64/include/segments.h
index 3dca80a..d0604be 100644
--- a/sys/amd64/include/segments.h
+++ b/sys/amd64/include/segments.h
@@ -74,6 +74,13 @@ struct user_segment_descriptor {
u_int64_t sd_hibase:8; /* segment base address (msb) */
} __packed;
+#define USD_GETBASE(_sd) (((_sd)->sd_lobase) | (_sd)->sd_hibase << 24)
+#define USD_SETBASE(_sd, _b) (_sd)->sd_lobase = (_b); \
+ (_sd)->sd_hibase = ((_b) >> 24);
+#define USD_GETLIMIT(_sd) (((_sd)->sd_lolimit) | (_sd)->sd_hilimit << 16)
+#define USD_SETLIMIT(_sd, _l) (_sd)->sd_lolimit = (_l); \
+ (_sd)->sd_hilimit = ((_l) >> 16);
+
/*
* System segment descriptors (128 bit wide)
*/
OpenPOWER on IntegriCloud