Date: Tue, 6 Jul 2010 16:56:27 +0000 (UTC) From: Rui Paulo <rpaulo@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r209731 - head/sys/amd64/include Message-ID: <201007061656.o66GuR06028579@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: rpaulo Date: Tue Jul 6 16:56:27 2010 New Revision: 209731 URL: http://svn.freebsd.org/changeset/base/209731 Log: Introduce USD_{SET,GET}{BASE,LIMIT}. These help setting up the user segment descriptor hi and lo values. Idea from Solaris. Reviewed by: kib Modified: head/sys/amd64/include/segments.h Modified: head/sys/amd64/include/segments.h ============================================================================== --- head/sys/amd64/include/segments.h Tue Jul 6 16:55:39 2010 (r209730) +++ head/sys/amd64/include/segments.h Tue Jul 6 16:56:27 2010 (r209731) @@ -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) */
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201007061656.o66GuR06028579>