From: Anton Blanchard <anton@samba.org>
To: linux-kernel@vger.kernel.org
Cc: akpm@osdl.org
Subject: [PATCH] Add prctl to change endian of a task
Date: Sun, 2 Apr 2006 08:29:21 +1000 [thread overview]
Message-ID: <20060401222921.GI23416@krispykreme> (raw)
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 */
next reply other threads:[~2006-04-01 22:30 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-04-01 22:29 Anton Blanchard [this message]
2006-04-02 14:37 ` [PATCH] Add prctl to change endian of a task 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20060401222921.GI23416@krispykreme \
--to=anton@samba.org \
--cc=akpm@osdl.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox