lkml.org 
[lkml]   [2003]   [Mar]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH][COMPAT] more compat types
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 *,
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
\
 
 \ /
  Last update: 2005-03-22 13:34    [W:0.021 / U:0.408 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site