From: Stephen Rothwell <sfr@canb.auug.org.au>
To: Linus <torvalds@transmeta.com>
Cc: LKML <linux-kernel@vger.kernel.org>,
"David S. Miller" <davem@redhat.com>
Subject: [PATCH][COMPAT] more compat types
Date: Wed, 26 Mar 2003 00:36:49 +1100 [thread overview]
Message-ID: <20030326003649.331cb880.sfr@canb.auug.org.au> (raw)
Hi Linus,
Is creating new types like this sensible? Basically this patch
creates compat_{int,uint,long,ulong}_t for use in generic
declarations of structures and generic compatibility code.
Is this going further than you wanted? Or am I heading in
the direction? I think this is where DaveM wants to go.
socklen_t comes from the user mode definition of the msghdr
strucure.
Yes, Dave, I put this through the corss compiler :-)
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/
diff -ruN 2.5.66-032517-32bit.1/include/asm-parisc/compat.h 2.5.66-032517-32bit.2/include/asm-parisc/compat.h
--- 2.5.66-032517-32bit.1/include/asm-parisc/compat.h 2003-03-25 12:08:24.000000000 +1100
+++ 2.5.66-032517-32bit.2/include/asm-parisc/compat.h 2003-03-25 16:10:11.000000000 +1100
@@ -23,6 +23,12 @@
typedef u16 compat_ipc_pid_t;
typedef s32 compat_daddr_t;
typedef u32 compat_caddr_t;
+typedef s32 compat_socklen_t;
+
+typedef s32 compat_int_t;
+typedef s32 compat_long_t;
+typedef u32 compat_uint_t;
+typedef u32 compat_ulong_t;
struct compat_timespec {
compat_time_t tv_sec;
diff -ruN 2.5.66-032517-32bit.1/include/asm-ppc64/compat.h 2.5.66-032517-32bit.2/include/asm-ppc64/compat.h
--- 2.5.66-032517-32bit.1/include/asm-ppc64/compat.h 2003-03-25 12:08:24.000000000 +1100
+++ 2.5.66-032517-32bit.2/include/asm-ppc64/compat.h 2003-03-25 16:10:16.000000000 +1100
@@ -24,6 +24,12 @@
typedef s32 compat_daddr_t;
typedef u32 compat_caddr_t;
typedef __kernel_fsid_t compat_fsid_t;
+typedef s32 compat_socklen_t;
+
+typedef s32 compat_int_t;
+typedef s32 compat_long_t;
+typedef u32 compat_uint_t;
+typedef u32 compat_ulong_t;
struct compat_timespec {
compat_time_t tv_sec;
diff -ruN 2.5.66-032517-32bit.1/include/asm-s390x/compat.h 2.5.66-032517-32bit.2/include/asm-s390x/compat.h
--- 2.5.66-032517-32bit.1/include/asm-s390x/compat.h 2003-03-25 12:08:24.000000000 +1100
+++ 2.5.66-032517-32bit.2/include/asm-s390x/compat.h 2003-03-25 16:10:20.000000000 +1100
@@ -24,6 +24,12 @@
typedef s32 compat_daddr_t;
typedef u32 compat_caddr_t;
typedef __kernel_fsid_t compat_fsid_t;
+typedef s32 compat_socklen_t;
+
+typedef s32 compat_int_t;
+typedef s32 compat_long_t;
+typedef u32 compat_uint_t;
+typedef u32 compat_ulong_t;
struct compat_timespec {
compat_time_t tv_sec;
diff -ruN 2.5.66-032517-32bit.1/include/asm-sparc64/compat.h 2.5.66-032517-32bit.2/include/asm-sparc64/compat.h
--- 2.5.66-032517-32bit.1/include/asm-sparc64/compat.h 2003-03-25 12:08:24.000000000 +1100
+++ 2.5.66-032517-32bit.2/include/asm-sparc64/compat.h 2003-03-25 16:10:24.000000000 +1100
@@ -24,6 +24,12 @@
typedef s32 compat_daddr_t;
typedef u32 compat_caddr_t;
typedef __kernel_fsid_t compat_fsid_t;
+typedef s32 compat_socklen_t;
+
+typedef s32 compat_int_t;
+typedef s32 compat_long_t;
+typedef u32 compat_uint_t;
+typedef u32 compat_ulong_t;
struct compat_timespec {
compat_time_t tv_sec;
diff -ruN 2.5.66-032517-32bit.1/include/asm-x86_64/compat.h 2.5.66-032517-32bit.2/include/asm-x86_64/compat.h
--- 2.5.66-032517-32bit.1/include/asm-x86_64/compat.h 2003-03-25 12:08:25.000000000 +1100
+++ 2.5.66-032517-32bit.2/include/asm-x86_64/compat.h 2003-03-25 16:10:31.000000000 +1100
@@ -26,6 +26,12 @@
typedef s32 compat_daddr_t;
typedef u32 compat_caddr_t;
typedef __kernel_fsid_t compat_fsid_t;
+typedef s32 compat_socklen_t;
+
+typedef s32 compat_int_t;
+typedef s32 compat_long_t;
+typedef u32 compat_uint_t;
+typedef u32 compat_ulong_t;
struct compat_timespec {
compat_time_t tv_sec;
diff -ruN 2.5.66-032517-32bit.1/include/linux/compat.h 2.5.66-032517-32bit.2/include/linux/compat.h
--- 2.5.66-032517-32bit.1/include/linux/compat.h 2003-03-25 12:08:25.000000000 +1100
+++ 2.5.66-032517-32bit.2/include/linux/compat.h 2003-03-25 15:59:01.000000000 +1100
@@ -43,7 +43,7 @@
extern int put_compat_timespec(struct timespec *, struct compat_timespec *);
struct compat_iovec {
- compat_uptr_t iov_base;
+ compat_uptr_t iov_base; /* void * */
compat_size_t iov_len;
};
diff -ruN 2.5.66-032517-32bit.1/include/net/compat.h 2.5.66-032517-32bit.2/include/net/compat.h
--- 2.5.66-032517-32bit.1/include/net/compat.h 2003-03-25 12:08:26.000000000 +1100
+++ 2.5.66-032517-32bit.2/include/net/compat.h 2003-03-25 16:11:22.000000000 +1100
@@ -8,19 +8,19 @@
#include <linux/compat.h>
struct compat_msghdr {
- compat_uptr_t msg_name;
- s32 msg_namelen;
- compat_uptr_t msg_iov;
+ compat_uptr_t msg_name; /* void * */
+ compat_socklen_t msg_namelen;
+ compat_uptr_t msg_iov; /* struct compat_iovec * */
compat_size_t msg_iovlen;
- compat_uptr_t msg_control;
+ compat_uptr_t msg_control; /* void * */
compat_size_t msg_controllen;
- u32 msg_flags;
+ compat_uint_t msg_flags;
};
struct compat_cmsghdr {
compat_size_t cmsg_len;
- s32 cmsg_level;
- s32 cmsg_type;
+ compat_int_t cmsg_level;
+ compat_int_t cmsg_type;
};
#else /* defined(CONFIG_COMPAT) */
@@ -29,8 +29,8 @@
extern int get_compat_msghdr(struct msghdr *, struct compat_msghdr *);
extern int verify_compat_iovec(struct msghdr *, struct iovec *, char *, int);
-extern asmlinkage long compat_sys_sendmsg(int,struct compat_msghdr *,unsigned);
-extern asmlinkage long compat_sys_recvmsg(int,struct compat_msghdr *,unsigned);
+extern asmlinkage long compat_sys_sendmsg(int, struct compat_msghdr *, unsigned);
+extern asmlinkage long compat_sys_recvmsg(int, struct compat_msghdr *, unsigned);
extern asmlinkage long compat_sys_getsockopt(int, int, int, char *, int *);
extern int put_cmsg_compat(struct msghdr*, int, int, int, void *);
extern int put_compat_msg_controllen(struct msghdr *, struct compat_msghdr *,
reply other threads:[~2003-03-25 13:26 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20030326003649.331cb880.sfr@canb.auug.org.au \
--to=sfr@canb.auug.org.au \
--cc=davem@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@transmeta.com \
/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®