powerpc: Merge ipcbuf.h

David Gibson david at gibson.dropbear.id.au
Thu Nov 3 10:13:58 EST 2005


On Wed, Nov 02, 2005 at 02:12:01PM +0100, Andreas Schwab wrote:
> David Gibson <david at gibson.dropbear.id.au> writes:
> 
> > Oops, when merging ipcbuf.h, I forgot that 'u64' can't be used in
> > user-visible headers.  This patch corrects the problem, replacing the
> > unused fields with an array of four __u32s.
> >
> > Signed-off-by: David Gibson <dwg at au1.ibm.com>
> >
> > Index: working-2.6/include/asm-powerpc/ipcbuf.h
> > ===================================================================
> > --- working-2.6.orig/include/asm-powerpc/ipcbuf.h	2005-11-02 10:41:06.000000000 +1100
> > +++ working-2.6/include/asm-powerpc/ipcbuf.h	2005-11-02 11:41:36.000000000 +1100
> > @@ -27,8 +27,7 @@
> >  	__kernel_mode_t	mode;
> >  	unsigned int	seq;
> >  	unsigned int	__pad1;
> > -	u64		__unused1;
> > -	u64		__unused2;
> > +	__u32		__unused[4];
> 
> I think you are changing the alignment of the structure.  A u64 has bigger
> alignment than a u32[2].

Bother, so it does.  Paulus, please apply.

powerpc: Keep fixing merged ipcbuf.h

Oops, replacing the two u64s in struct ipc64_perm with __u32s changed
the alignment of that structure, which could mess up userspace.
Revert to using two unsigned long longs (which is what ppc32 had
originally).  ppc64 orignally had two unsigned longs, but long long is
the same size on 64 bit, so this should be ok there too.

Signed-off-by: David Gibson <dwg at au1.ibm.com>

Index: working-2.6/include/asm-powerpc/ipcbuf.h
===================================================================
--- working-2.6.orig/include/asm-powerpc/ipcbuf.h	2005-11-02 15:47:11.000000000 +1100
+++ working-2.6/include/asm-powerpc/ipcbuf.h	2005-11-03 10:10:58.000000000 +1100
@@ -27,7 +27,8 @@
 	__kernel_mode_t	mode;
 	unsigned int	seq;
 	unsigned int	__pad1;
-	__u32		__unused[4];
+	unsigned long long __unused1;
+	unsigned long long __unused2;
 };
 
 #endif /* _ASM_POWERPC_IPCBUF_H */


-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/people/dgibson



More information about the Linuxppc64-dev mailing list