Hi!
> > > hm. So if I have
> > >
> > > struct bar {
> > > unsigned long b;
> > > } __attribute__((packed));
> > >
> > > struct foo {
> > > unsigned long u;
> > > struct bar b;
> > > };
> > >
> > > then the compiler can see that foo.b.b is well-aligned,
Hi!
hm. So if I have
struct bar {
unsigned long b;
} __attribute__((packed));
struct foo {
unsigned long u;
struct bar b;
};
then the compiler can see that foo.b.b is well-aligned, regardless of the
packedness.
On Thu, Feb 15, 2007 at 05:27:20PM -0800, Andrew Morton wrote:
> No, icc surely supports attribute(packed). My point is that we shouldn't
> rely upon the gcc info file for this, because other compilers can (or
> could) be used to build the kernel.
>
> So it would be safer if the C spec said (or
On Fri, 16 Feb 2007 00:43:17 +
Ralf Baechle <[EMAIL PROTECTED]> wrote:
> On Thu, Feb 15, 2007 at 03:38:23PM -0800, Andrew Morton wrote:
>
> > hm. So if I have
> >
> > struct bar {
> > unsigned long b;
> > } __attribute__((packed));
> >
> > struct foo {
> >
On Thu, Feb 15, 2007 at 03:38:23PM -0800, Andrew Morton wrote:
> hm. So if I have
>
> struct bar {
> unsigned long b;
> } __attribute__((packed));
>
> struct foo {
> unsigned long u;
> struct bar b;
> };
>
> then the compiler
Andrew Morton wrote:
> hm. So if I have
>
> struct bar {
> unsigned long b;
> } __attribute__((packed));
>
> struct foo {
> unsigned long u;
> struct bar b;
> };
>
> then the compiler can see that foo.b.b is well-aligned,
On Thu, 15 Feb 2007 22:18:39 +
Ralf Baechle <[EMAIL PROTECTED]> wrote:
> On Thu, Feb 15, 2007 at 01:53:58PM -0800, Andrew Morton wrote:
>
> > > The whole union thing was only needed to get rid of a warning but Marcel's
> > > solution does the same thing by attaching the packed keyword to the
Ralf Baechle wrote:
> Gcc info page says:
>
> [...]
> `packed'
> The `packed' attribute specifies that a variable or structure field
> should have the smallest possible alignment--one byte for a
> variable, and one bit for a field, unless you specify a larger
> value with the
On Thu, Feb 15, 2007 at 01:53:58PM -0800, Andrew Morton wrote:
> > The whole union thing was only needed to get rid of a warning but Marcel's
> > solution does the same thing by attaching the packed keyword to the entire
> > structure instead, so this patch is now using his macros but using
On Thu, 15 Feb 2007 14:34:41 +
Ralf Baechle <[EMAIL PROTECTED]> wrote:
> On Wed, Feb 14, 2007 at 08:39:03PM -0800, Andrew Morton wrote:
>
> > Can someone please tell us how this magic works? (And it does appear to
> > work).
> >
> > It seems to assuming that the compiler will assume that
On Wed, Feb 14, 2007 at 08:39:03PM -0800, Andrew Morton wrote:
> Can someone please tell us how this magic works? (And it does appear to
> work).
>
> It seems to assuming that the compiler will assume that members of packed
> structures can have arbitrary alignment, even if that alignment is
Hi Andrew,
> > +#define get_unaligned(ptr) \
> > +({ \
> > + const struct { \
> > + union {
Hi Andrew,
+#define get_unaligned(ptr) \
+({ \
+ const struct { \
+ union {
On Wed, Feb 14, 2007 at 08:39:03PM -0800, Andrew Morton wrote:
Can someone please tell us how this magic works? (And it does appear to
work).
It seems to assuming that the compiler will assume that members of packed
structures can have arbitrary alignment, even if that alignment is
On Thu, 15 Feb 2007 14:34:41 +
Ralf Baechle [EMAIL PROTECTED] wrote:
On Wed, Feb 14, 2007 at 08:39:03PM -0800, Andrew Morton wrote:
Can someone please tell us how this magic works? (And it does appear to
work).
It seems to assuming that the compiler will assume that members of
On Thu, Feb 15, 2007 at 01:53:58PM -0800, Andrew Morton wrote:
The whole union thing was only needed to get rid of a warning but Marcel's
solution does the same thing by attaching the packed keyword to the entire
structure instead, so this patch is now using his macros but using __packed
Ralf Baechle wrote:
Gcc info page says:
[...]
`packed'
The `packed' attribute specifies that a variable or structure field
should have the smallest possible alignment--one byte for a
variable, and one bit for a field, unless you specify a larger
value with the `aligned'
On Thu, 15 Feb 2007 22:18:39 +
Ralf Baechle [EMAIL PROTECTED] wrote:
On Thu, Feb 15, 2007 at 01:53:58PM -0800, Andrew Morton wrote:
The whole union thing was only needed to get rid of a warning but Marcel's
solution does the same thing by attaching the packed keyword to the entire
Andrew Morton wrote:
hm. So if I have
struct bar {
unsigned long b;
} __attribute__((packed));
struct foo {
unsigned long u;
struct bar b;
};
then the compiler can see that foo.b.b is well-aligned, regardless of the
On Thu, Feb 15, 2007 at 03:38:23PM -0800, Andrew Morton wrote:
hm. So if I have
struct bar {
unsigned long b;
} __attribute__((packed));
struct foo {
unsigned long u;
struct bar b;
};
then the compiler can see that
On Fri, 16 Feb 2007 00:43:17 +
Ralf Baechle [EMAIL PROTECTED] wrote:
On Thu, Feb 15, 2007 at 03:38:23PM -0800, Andrew Morton wrote:
hm. So if I have
struct bar {
unsigned long b;
} __attribute__((packed));
struct foo {
unsigned long u;
On Thu, Feb 15, 2007 at 05:27:20PM -0800, Andrew Morton wrote:
No, icc surely supports attribute(packed). My point is that we shouldn't
rely upon the gcc info file for this, because other compilers can (or
could) be used to build the kernel.
So it would be safer if the C spec said (or
On Wed, 14 Feb 2007 21:42:26 + Ralf Baechle <[EMAIL PROTECTED]> wrote:
> Time for a little bit of dead horse flogging.
>
> On Mon, Mar 06, 2006 at 05:05:52PM -0800, Andrew Morton wrote:
>
> > > --- a/include/asm-generic/unaligned.h
> > > +++ b/include/asm-generic/unaligned.h
> > > @@ -78,7
Time for a little bit of dead horse flogging.
On Mon, Mar 06, 2006 at 05:05:52PM -0800, Andrew Morton wrote:
> > --- a/include/asm-generic/unaligned.h
> > +++ b/include/asm-generic/unaligned.h
> > @@ -78,7 +78,7 @@ static inline void __ustw(__u16 val, __u
> >
> > #define __get_unaligned(ptr,
Time for a little bit of dead horse flogging.
On Mon, Mar 06, 2006 at 05:05:52PM -0800, Andrew Morton wrote:
--- a/include/asm-generic/unaligned.h
+++ b/include/asm-generic/unaligned.h
@@ -78,7 +78,7 @@ static inline void __ustw(__u16 val, __u
#define __get_unaligned(ptr, size) ({
On Wed, 14 Feb 2007 21:42:26 + Ralf Baechle [EMAIL PROTECTED] wrote:
Time for a little bit of dead horse flogging.
On Mon, Mar 06, 2006 at 05:05:52PM -0800, Andrew Morton wrote:
--- a/include/asm-generic/unaligned.h
+++ b/include/asm-generic/unaligned.h
@@ -78,7 +78,7 @@ static
26 matches
Mail list logo