summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authormarcel <marcel@FreeBSD.org>2004-04-03 22:23:36 +0000
committermarcel <marcel@FreeBSD.org>2004-04-03 22:23:36 +0000
commit238ada9c745fd1a908039eb3538666a116d96ac0 (patch)
treee542cb666a666d428c7b35a2dfebba20113026ee /sys
parent094e4edcfab5254c125560ad10b33eda88bb6de6 (diff)
downloadFreeBSD-src-238ada9c745fd1a908039eb3538666a116d96ac0.zip
FreeBSD-src-238ada9c745fd1a908039eb3538666a116d96ac0.tar.gz
Move the definition of rss() from db_interface.c to cpufunc.h where
it belongs. Change the implementation to match those of rfs() and rgs() for consistency and irrespective of whether the original was more correct or not (technically speaking).
Diffstat (limited to 'sys')
-rw-r--r--sys/i386/i386/db_interface.c13
-rw-r--r--sys/i386/include/cpufunc.h8
2 files changed, 8 insertions, 13 deletions
diff --git a/sys/i386/i386/db_interface.c b/sys/i386/i386/db_interface.c
index 03d5453..a528502 100644
--- a/sys/i386/i386/db_interface.c
+++ b/sys/i386/i386/db_interface.c
@@ -60,19 +60,6 @@ db_regs_t ddb_regs;
static jmp_buf db_global_jmpbuf;
-static __inline u_short
-rss(void)
-{
- u_short ss;
-#if defined(__GNUC__) || defined(__INTEL_COMPILER)
- __asm __volatile("mov %%ss,%0" : "=r" (ss));
-#else
-#error Function rss() needs to get ported to this compiler.
- ss = 0; /* XXXX Fix for other compilers. */
-#endif
- return ss;
-}
-
/*
* kdb_trap - field a TRACE or BPT trap
*/
diff --git a/sys/i386/include/cpufunc.h b/sys/i386/include/cpufunc.h
index 5b092f0..9fe9df8 100644
--- a/sys/i386/include/cpufunc.h
+++ b/sys/i386/include/cpufunc.h
@@ -456,6 +456,14 @@ rgs(void)
return (sel);
}
+static __inline u_int
+rss(void)
+{
+ u_int sel;
+ __asm __volatile("movl %%ss,%0" : "=rm" (sel));
+ return (sel);
+}
+
static __inline void
load_fs(u_int sel)
{
OpenPOWER on IntegriCloud