patch-1.3.71 linux/include/asm-sparc/segment.h

Next file: linux/include/asm-sparc/sigcontext.h
Previous file: linux/include/asm-sparc/sbus.h
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v1.3.70/linux/include/asm-sparc/segment.h linux/include/asm-sparc/segment.h
@@ -1,12 +1,7 @@
-/* $Id: segment.h,v 1.6 1995/11/25 02:32:40 davem Exp $ */
+/* $Id: segment.h,v 1.9 1996/01/14 00:05:33 davem Exp $ */
 #ifndef _ASM_SEGMENT_H
 #define _ASM_SEGMENT_H
 
-/* Sparc is not segmented, these are just place holders. */
-#define KERNEL_DS   0
-#define USER_DS     1
-
-#include <linux/string.h>
 #include <asm/vac-ops.h>
 
 #ifndef __ASSEMBLY__
@@ -109,21 +104,27 @@
 
 #define memcpy_tofs(to, from, n) memcpy((to),(from),(n))
 
-extern int current_user_segment;
+/* Sparc is not segmented, however we need to be able to fool verify_area()
+ * when doing system calls from kernel mode legitimately.
+ */
+#define KERNEL_DS   0
+#define USER_DS     1
+
+extern int active_ds;
 
-static inline unsigned long get_fs(void)
+static inline int get_fs(void)
 {
-	return current_user_segment;
+	return active_ds;
 }
 
-static inline unsigned long get_ds(void)
+static inline int get_ds(void)
 {
 	return KERNEL_DS;
 }
 
-static inline void set_fs(unsigned long val)
+static inline void set_fs(int val)
 {
-	current_user_segment = val;
+	active_ds = val;
 }
 
 #endif  /* __ASSEMBLY__ */

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov with Sam's (original) version
of this