All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Add prctl to change endian of a task
@ 2006-04-01 22:29 Anton Blanchard
  2006-04-02 14:37 ` Ingo Oeser
  0 siblings, 1 reply; 6+ messages in thread
From: Anton Blanchard @ 2006-04-01 22:29 UTC (permalink / raw)
  To: linux-kernel; +Cc: akpm


Add a prctl to change a tasks endian. While we only have powerpc code to
implement this so far, it seems like something that warrants a generic
interface (like setting floating point mode bits).

Signed-off-by: Anton Blanchard <anton@samba.org>
---

Index: build/kernel/sys.c
===================================================================
--- build.orig/kernel/sys.c	2006-04-02 08:11:40.000000000 +1000
+++ build/kernel/sys.c	2006-04-02 08:13:13.000000000 +1000
@@ -57,6 +57,12 @@
 #ifndef GET_FPEXC_CTL
 # define GET_FPEXC_CTL(a,b)	(-EINVAL)
 #endif
+#ifndef GET_ENDIAN
+# define GET_ENDIAN(a,b)	(-EINVAL)
+#endif
+#ifndef SET_ENDIAN
+# define SET_ENDIAN(a,b)	(-EINVAL)
+#endif
 
 /*
  * this is where the system-wide overflow UID and GID are defined, for
@@ -2057,6 +2063,13 @@ asmlinkage long sys_prctl(int option, un
 				return -EFAULT;
 			return 0;
 		}
+		case PR_GET_ENDIAN:
+			error = GET_ENDIAN(current, arg2);
+			break;
+		case PR_SET_ENDIAN:
+			error = SET_ENDIAN(current, arg2);
+			break;
+
 		default:
 			error = -EINVAL;
 			break;
Index: build/include/linux/prctl.h
===================================================================
--- build.orig/include/linux/prctl.h	2006-04-02 08:11:40.000000000 +1000
+++ build/include/linux/prctl.h	2006-04-02 08:13:13.000000000 +1000
@@ -52,4 +52,10 @@
 #define PR_SET_NAME    15		/* Set process name */
 #define PR_GET_NAME    16		/* Get process name */
 
+/* Get/set process endian */
+#define PR_GET_ENDIAN	19
+#define PR_SET_ENDIAN	20
+# define PR_ENDIAN_BIG		0
+# define PR_ENDIAN_LITTLE	1
+
 #endif /* _LINUX_PRCTL_H */

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2006-04-06  5:14 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-04-01 22:29 [PATCH] Add prctl to change endian of a task Anton Blanchard
2006-04-02 14:37 ` Ingo Oeser
2006-04-02 14:56   ` Alan Cox
2006-04-03 22:36     ` Anton Blanchard
2006-04-03 22:40       ` David S. Miller
2006-04-06  5:13         ` Paul Mackerras

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.