All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Beginnings of conpat 32 code cleanups
@ 2002-11-22  5:23 Stephen Rothwell
  2002-11-22 19:47 ` Linus Torvalds
  2002-11-26 13:53 ` Pavel Machek
  0 siblings, 2 replies; 10+ messages in thread
From: Stephen Rothwell @ 2002-11-22  5:23 UTC (permalink / raw)
  To: Linus; +Cc: LKML, anton, David S. Miller, ak

Hi Linus,

There is a lot of duplicated code among the 32 compatibility layers in our
64 bit architectures.  I am proposing to considate this as much as
possible. To that end, I first need to tidy up the relevant header files
and make them as common as possible.  Discussions with Dave Miller, Andi
Kleen, and Anton Blanchard has led to the creation of compat32.h to
contain all the 32 compatibility data types.

This patch merely adds include/asm-generic/compat32.h which is the header
information that is common to all the 32 bit compatibility code across all
the architectures (except parisc as I don't pretend to understand that
:-)).

I will follow this up with patches for each architecture that I can. I
also intend to intruduce a CONFIG_COMPAT32 define that will be used to
wrap generic implementations of some of the 32 bit compatibility code in
our architecture independent code.  The idea is to share as much of the
non compatibility code and where that is not possible, to keep the 32 bit
versions of code near their "normal" (i.e.64 bit) counterparts in order to
minimise the number of bugs introduced and maximise the number of bugs
fixed.

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/

diff -ruN 2.5.48/include/asm-generic/compat32.h 2.5.48-32bit.1/include/asm-generic/compat32.h
--- 2.5.48/include/asm-generic/compat32.h	1970-01-01 10:00:00.000000000 +1000
+++ 2.5.48-32bit.1/include/asm-generic/compat32.h	2002-11-22 16:02:56.000000000 +1100
@@ -0,0 +1,31 @@
+#ifndef _ASM_GENERIC_COMPAT32_H
+#define _ASM_GENERIC_COMPAT32_H
+
+#include <linux/types.h>
+
+typedef unsigned int		__kernel_size_t32;
+typedef int			__kernel_ssize_t32;
+typedef int			__kernel_time_t32;
+typedef int			__kernel_clock_t32;
+typedef int			__kernel_pid_t32;
+typedef unsigned int		__kernel_ino_t32;
+typedef int			__kernel_daddr_t32;
+typedef int			__kernel_off_t32;
+typedef unsigned int		__kernel_caddr_t32;
+typedef long			__kernel_loff_t32;
+typedef __kernel_fsid_t		__kernel_fsid_t32;
+
+struct timespec32 {
+	s32			tv_sec;
+	s32			tv_nsec;
+};
+
+struct flock32 {
+	short			l_type;
+	short			l_whence;
+	__kernel_off_t32	l_start;
+	__kernel_off_t32	l_len;
+	__kernel_pid_t32	l_pid;
+};
+
+#endif /* _ASM_GENERIC_COMPAT32_H */

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

end of thread, other threads:[~2002-11-26 20:01 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-11-22  5:23 [PATCH] Beginnings of conpat 32 code cleanups Stephen Rothwell
2002-11-22 19:47 ` Linus Torvalds
2002-11-22 19:54   ` Larry McVoy
2002-11-22 20:13     ` Cort Dougan
2002-11-22 20:38       ` H. Peter Anvin
2002-11-23  0:28   ` Stephen Rothwell
2002-11-25 19:48     ` Linus Torvalds
2002-11-23  5:16   ` Anton Blanchard
2002-11-25 20:00     ` Linus Torvalds
2002-11-26 13:53 ` Pavel Machek

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.