From: Stephen Rothwell <sfr@canb.auug.org.au>
To: Christoph Hellwig <hch@infradead.org>
Cc: linux-kernel@vger.kernel.org, akpm@osdl.org
Subject: Re: [PATCH] compat_sys_read/write
Date: Fri, 29 Jul 2005 01:13:07 +1000 [thread overview]
Message-ID: <20050729011307.01a2d64e.sfr@canb.auug.org.au> (raw)
In-Reply-To: <20050728150258.GA22472@infradead.org>
[-- Attachment #1: Type: text/plain, Size: 5010 bytes --]
On Thu, 28 Jul 2005 16:02:58 +0100 Christoph Hellwig <hch@infradead.org> wrote:
>
> > And where were you a week ago when I asked if I should post this patch?
>
> A :-) Can't remember it at all, maybe you forgot that we mere mortals can't
> read linux-arch@vger.kernel.org ?
Sorry about that, my omniscience must be slipping :-)
Anyway, here is the alternative I offered that was rejected by some (hi Andi :-))
and not particularly like by others ... (without the actual evdev.c fix)
Is this any more palatable to the wider community?
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/
diff -ruN linus/include/asm-ia64/compat.h linus-willy.3/include/asm-ia64/compat.h
--- linus/include/asm-ia64/compat.h 2005-06-27 16:08:06.000000000 +1000
+++ linus-willy.3/include/asm-ia64/compat.h 2005-06-27 18:06:35.000000000 +1000
@@ -4,6 +4,11 @@
* Architecture specific compatibility types
*/
#include <linux/types.h>
+#include <linux/sched.h>
+
+#include <asm/system.h>
+#include <asm/ptrace.h>
+#include <asm/processor.h>
#define COMPAT_USER_HZ 100
@@ -196,4 +201,9 @@
return (void __user *) (((regs->r12 & 0xffffffff) & -16) - len);
}
+static inline int is_compat_task(struct task_struct *t)
+{
+ return IS_IA32_PROCESS(ia64_task_regs(t));
+}
+
#endif /* _ASM_IA64_COMPAT_H */
diff -ruN linus/include/asm-mips/compat.h linus-willy.3/include/asm-mips/compat.h
--- linus/include/asm-mips/compat.h 2005-06-27 16:08:07.000000000 +1000
+++ linus-willy.3/include/asm-mips/compat.h 2005-06-27 18:06:35.000000000 +1000
@@ -4,7 +4,9 @@
* Architecture specific compatibility types
*/
#include <linux/types.h>
+#include <linux/sched.h>
#include <asm/page.h>
+#include <asm/processor.h>
#define COMPAT_USER_HZ 100
@@ -142,4 +144,9 @@
#define __COMPAT_ENDIAN_SWAP__ 1
#endif
+static inline int is_compat_task(struct task_struct *t)
+{
+ return (t->thread.mflags & MF_ABI_MASK) == MF_O32;
+}
+
#endif /* _ASM_COMPAT_H */
diff -ruN linus/include/asm-parisc/compat.h linus-willy.3/include/asm-parisc/compat.h
--- linus/include/asm-parisc/compat.h 2005-06-27 16:08:08.000000000 +1000
+++ linus-willy.3/include/asm-parisc/compat.h 2005-06-27 18:06:35.000000000 +1000
@@ -142,4 +142,9 @@
return (void __user *)regs->gr[30];
}
+static inline int is_compat_task(struct task_struct *t)
+{
+ return personality(t->personality) == PER_LINUX32;
+}
+
#endif /* _ASM_PARISC_COMPAT_H */
diff -ruN linus/include/asm-ppc64/compat.h linus-willy.3/include/asm-ppc64/compat.h
--- linus/include/asm-ppc64/compat.h 2005-06-27 16:08:08.000000000 +1000
+++ linus-willy.3/include/asm-ppc64/compat.h 2005-06-27 18:06:35.000000000 +1000
@@ -200,4 +200,9 @@
compat_ulong_t __unused6;
};
+static inline int is_compat_task(struct task_struct *t)
+{
+ return test_tsk_thread_flag(t, TIF_32BIT);
+}
+
#endif /* _ASM_PPC64_COMPAT_H */
diff -ruN linus/include/asm-s390/compat.h linus-willy.3/include/asm-s390/compat.h
--- linus/include/asm-s390/compat.h 2005-06-27 16:08:09.000000000 +1000
+++ linus-willy.3/include/asm-s390/compat.h 2005-06-27 18:06:35.000000000 +1000
@@ -195,4 +195,10 @@
compat_ulong_t __unused1;
compat_ulong_t __unused2;
};
+
+static inline int is_compat_task(struct task_struct *t)
+{
+ return test_tsk_thread_flag(t, TIF_31BIT);
+}
+
#endif /* _ASM_S390X_COMPAT_H */
diff -ruN linus/include/asm-sparc64/compat.h linus-willy.3/include/asm-sparc64/compat.h
--- linus/include/asm-sparc64/compat.h 2005-06-27 16:08:10.000000000 +1000
+++ linus-willy.3/include/asm-sparc64/compat.h 2005-06-27 18:06:35.000000000 +1000
@@ -4,6 +4,7 @@
* Architecture specific compatibility types
*/
#include <linux/types.h>
+#include <linux/sched.h>
#define COMPAT_USER_HZ 100
@@ -233,4 +234,9 @@
unsigned int __unused2;
};
+static inline int is_compat_task(struct task_struct *t)
+{
+ return test_tsk_thread_flag(t, TIF_32BIT);
+}
+
#endif /* _ASM_SPARC64_COMPAT_H */
diff -ruN linus/include/asm-x86_64/compat.h linus-willy.3/include/asm-x86_64/compat.h
--- linus/include/asm-x86_64/compat.h 2005-06-27 16:08:10.000000000 +1000
+++ linus-willy.3/include/asm-x86_64/compat.h 2005-06-27 18:06:35.000000000 +1000
@@ -202,4 +202,9 @@
return (void __user *)regs->rsp - len;
}
+static inline int is_compat_task(struct task_struct *t)
+{
+ return test_tsk_thread_flag(t, TIF_IA32);
+}
+
#endif /* _ASM_X86_64_COMPAT_H */
diff -ruN linus/include/linux/compat.h linus-willy.3/include/linux/compat.h
--- linus/include/linux/compat.h 2005-06-27 16:08:11.000000000 +1000
+++ linus-willy.3/include/linux/compat.h 2005-06-27 18:06:35.000000000 +1000
@@ -158,5 +158,9 @@
int get_compat_sigevent(struct sigevent *event,
const struct compat_sigevent __user *u_event);
+#else /* CONFIG_COMPAT */
+
+#define is_compat_task(x) 0
+
#endif /* CONFIG_COMPAT */
#endif /* _LINUX_COMPAT_H */
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
next prev parent reply other threads:[~2005-07-28 15:25 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-07-28 13:43 Stephen Rothwell
2005-07-28 14:16 ` Christoph Hellwig
2005-07-28 14:48 ` Stephen Rothwell
2005-07-28 14:53 ` Stephen Rothwell
2005-07-28 15:02 ` Christoph Hellwig
2005-07-28 15:13 ` Stephen Rothwell [this message]
2005-07-28 15:16 ` Christoph Hellwig
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=20050729011307.01a2d64e.sfr@canb.auug.org.au \
--to=sfr@canb.auug.org.au \
--cc=akpm@osdl.org \
--cc=hch@infradead.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
all inboxes | Powered by JetHome®