public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Daniel Phillips <phillips@arcor.de>
To: Andi Kleen <ak@muc.de>
Cc: "David S. Miller" <davem@redhat.com>,
	yoshfuji@linux-ipv6.org, jgarzik@pobox.com, axboe@suse.de,
	linux-kernel@vger.kernel.org
Subject: Re: block layer sg, bsg
Date: Sun, 8 Aug 2004 15:18:25 -0400	[thread overview]
Message-ID: <200408081518.25522.phillips@arcor.de> (raw)
In-Reply-To: <20040806150416.GA90652@muc.de>

On Friday 06 August 2004 11:04, Andi Kleen wrote:
> > Somewhere I got the idea that if a structure is declared with attribute
> > PACKED, gcc will generate alignment-independent code (e.g., access each
> > field byte by byte) on alignment-restricted architectures.  So if what I
> > imagine about gcc is true, what issues remain?  These structs have to be
> > declared packed anyway and with fixed field sizes, or the layout will
> > vary across architectures.
>
> With packed things should be fine for x86-64/i386. However it may
> generate bad code for other architectures.

That's the question.  From talking to gcc developers in the former Cygnus 
office, it's thought that alignment-restricted architectures are supposed to 
do bytewise access (or equivalent) to PACKED fields, but nobody was sure if 
every architecture implements this, or even if it's the formally defined 
behavior for PACKED.  That's a subset of GCC developers of course.

As far as I can see, if PACKED doesn't work this way on all architectures then 
it's broken and needs to be fixed.

Regards,

Daniel

  reply	other threads:[~2004-08-08 19:18 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <2ppN4-1wi-11@gated-at.bofh.it>
     [not found] ` <2pvps-5xO-33@gated-at.bofh.it>
     [not found]   ` <2pvz2-5Lf-19@gated-at.bofh.it>
     [not found]     ` <2pwbQ-68b-43@gated-at.bofh.it>
2004-08-04 17:28       ` block layer sg, bsg Andi Kleen
2004-08-04 17:31         ` Jens Axboe
2004-08-04 19:18         ` Jeff Garzik
2004-08-04 19:22           ` David S. Miller
2004-08-04 23:21             ` Andi Kleen
2004-08-04 23:26               ` David S. Miller
2004-08-04 23:51               ` YOSHIFUJI Hideaki / 吉藤英明
2004-08-05  3:58                 ` David S. Miller
2004-08-06  7:03                   ` Daniel Phillips
2004-08-06 15:04                     ` Andi Kleen
2004-08-08 19:18                       ` Daniel Phillips [this message]
2004-08-05 11:49                 ` Andi Kleen
2004-08-06  3:46                   ` YOSHIFUJI Hideaki / 吉藤英明
2004-08-06  4:19                     ` David S. Miller
2004-08-06 13:20                       ` Andi Kleen
2004-08-06 18:28                         ` David S. Miller
2004-08-06 11:04                     ` Andi Kleen
2004-08-04  8:50 Jens Axboe
2004-08-04 14:52 ` David S. Miller
2004-08-04 15:04   ` Jens Axboe
2004-08-04 15:44     ` David S. Miller
2004-08-04 15:48       ` Jens Axboe
2004-08-04 15:56       ` Jeff Garzik
2004-08-04 15:58         ` Jens Axboe
2004-08-04 23:11           ` Douglas Gilbert

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=200408081518.25522.phillips@arcor.de \
    --to=phillips@arcor.de \
    --cc=ak@muc.de \
    --cc=axboe@suse.de \
    --cc=davem@redhat.com \
    --cc=jgarzik@pobox.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=yoshfuji@linux-ipv6.org \
    /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