summaryrefslogtreecommitdiffstats
path: root/include/asm-alpha/uaccess.h
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>1997-09-12 01:29:55 +0000
committerRalf Baechle <ralf@linux-mips.org>1997-09-12 01:29:55 +0000
commit545f435ebcfd94a1e7c20b46efe81b4d6ac4e698 (patch)
treee9ce4bc598d06374bda906f18365984bf22a526a /include/asm-alpha/uaccess.h
parent4291a610eef89d0d5c69d9a10ee6560e1aa36c74 (diff)
Merge with Linux 2.1.55. More bugfixes and goodies from my private
CVS archive.
Diffstat (limited to 'include/asm-alpha/uaccess.h')
-rw-r--r--include/asm-alpha/uaccess.h14
1 files changed, 13 insertions, 1 deletions
diff --git a/include/asm-alpha/uaccess.h b/include/asm-alpha/uaccess.h
index 870fd290c..a76b1fc38 100644
--- a/include/asm-alpha/uaccess.h
+++ b/include/asm-alpha/uaccess.h
@@ -10,6 +10,10 @@
* performed or not. If get_fs() == USER_DS, checking is performed, with
* get_fs() == KERNEL_DS, checking is bypassed.
*
+ * Or at least it did once upon a time. Nowadays it is a mask that
+ * defines which bits of the address space are off limits. This is a
+ * wee bit faster than the above.
+ *
* For historical reasons, these macros are grossly misnamed.
*/
@@ -20,9 +24,17 @@
#define VERIFY_WRITE 1
#define get_fs() (current->tss.fs)
-#define set_fs(x) (current->tss.fs = (x))
#define get_ds() (KERNEL_DS)
+/* Our scheme relies on all bits being preserved. Trap those evil
+ Intellists in their plot to use unsigned short. */
+
+extern unsigned long __bad_fs_size(void);
+
+#define set_fs(x) (current->tss.fs = \
+ sizeof(x) == sizeof(unsigned long) ? (x) \
+ : __bad_fs_size())
+
/*
* Is a address valid? This does a straighforward calculation rather
* than tests.