From: "Nigel Roles" <nigel@9fs.org>
To: <9fans@cse.psu.edu>
Subject: RE: [9fans] struct problems
Date: Wed, 7 May 2003 06:36:51 +0100 [thread overview]
Message-ID: <HOEHIDJJJINMLFPOLFJCKEELCPAA.nigel@9fs.org> (raw)
In-Reply-To: <20030507053411.GZ36080@cassie.foobarbaz.net>
structs and unions are aligned on 4 byte boundaries.
bit fields are never portable. are you sure they will
work on any Plan 9 platform (not just x86)?
> -----Original Message-----
> From: 9fans-admin@cse.psu.edu [mailto:9fans-admin@cse.psu.edu]On Behalf
> Of Christopher Nielsen
> Sent: 07 May 2003 06:34
> To: 9fans@cse.psu.edu
> Subject: Re: [9fans] struct problems
>
>
> I forgot to add that my guess as to what is happening
> is due to alignment issues.
>
> On Tue, May 06, 2003 at 09:36:33PM -0700, Christopher Nielsen wrote:
> > I've been working on 48-bit LBA support for ATA, and
> > I've run into something peculiar. I decided to rewrite
> > the identify array as a struct of bit fields for better
> > readability. As it turns out, the struct is 16 bytes
> > bigger than expected, which is causing all sorts of
> > trouble with accessing the fields properly. I am pretty
> > sure I copied all the fields correctly; the struct
> > should be 512 bytes, but it's 528 bytes. Below is the
> > struct definition for folks to look at. I am in the
> > process of rooting out where the extra bytes are
> > coming from, but if someone can provide some insight,
> > it would save me some time.
>
> --
> Christopher Nielsen
> "They who can give up essential liberty for temporary
> safety, deserve neither liberty nor safety." --Benjamin Franklin
next prev parent reply other threads:[~2003-05-07 5:36 UTC|newest]
Thread overview: 52+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-05-07 4:36 Christopher Nielsen
2003-05-07 5:34 ` Christopher Nielsen
2003-05-07 5:36 ` Nigel Roles [this message]
2003-05-07 5:41 ` Christopher Nielsen
2003-05-08 7:30 ` boyd, rounin
2003-05-09 20:22 ` ron minnich
2003-05-09 21:09 ` Geoff Collyer
2003-05-09 23:29 ` Scott Schwartz
2003-05-10 2:54 ` boyd, rounin
2003-05-10 5:04 ` northern snowfall
2003-05-10 4:11 ` boyd, rounin
2003-05-12 8:56 ` Douglas A. Gwyn
2003-05-12 9:29 ` boyd, rounin
2003-05-07 7:32 ` northern snowfall
2003-05-07 11:05 ` Bruce Ellis
2003-05-07 13:06 ` northern snowfall
2003-05-07 12:47 ` Bruce Ellis
2003-05-07 13:50 ` northern snowfall
2003-05-07 17:01 ` [9fans] snapshots -> archives rog
2003-05-07 17:02 ` Russ Cox
2003-05-07 15:47 ` [9fans] acme/sam problem ron minnich
2003-05-07 15:59 ` Russ Cox
2003-05-07 16:32 ` ron minnich
2003-05-07 16:00 ` andrey mirtchovski
[not found] <presotto@closedmind.org>
2003-05-10 0:13 ` [9fans] struct problems David Presotto
2003-05-10 0:22 ` Scott Schwartz
2003-05-10 4:49 ` Skip Tavakkolian
2003-05-10 4:52 ` boyd, rounin
2003-05-10 5:20 ` Skip Tavakkolian
2003-05-10 5:19 ` boyd, rounin
2003-05-10 7:11 ` Dennis Ritchie
2003-05-10 16:53 ` matt
2003-05-10 16:58 ` boyd, rounin
2003-05-10 16:58 ` boyd, rounin
2003-05-10 18:08 ` northern snowfall
2003-05-10 17:12 ` boyd, rounin
2003-05-10 22:34 ` boyd, rounin
2003-05-10 23:09 ` jmk
2003-05-10 23:16 ` boyd, rounin
2003-05-11 2:07 ` rob pike, esq.
2003-05-11 2:26 ` boyd, rounin
2003-05-11 3:48 ` Dennis Ritchie
2003-05-11 3:54 ` boyd, rounin
2003-05-10 23:26 ` boyd, rounin
2003-05-11 2:06 ` rob pike, esq.
2003-05-10 23:54 ` Skip Tavakkolian
2003-05-11 2:08 ` rob pike, esq.
2003-05-11 2:31 ` boyd, rounin
2003-05-11 6:04 ` rob pike, esq.
2003-05-11 7:03 ` boyd, rounin
2003-05-12 8:56 ` Anthony Mandic
2003-05-12 9:27 ` boyd, rounin
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=HOEHIDJJJINMLFPOLFJCKEELCPAA.nigel@9fs.org \
--to=nigel@9fs.org \
--cc=9fans@cse.psu.edu \
/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;
as well as URLs for NNTP newsgroup(s).