From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christopher Nielsen To: 9fans@cse.psu.edu Subject: Re: [9fans] struct problems Message-ID: <20030507053411.GZ36080@cassie.foobarbaz.net> References: <20030507043633.GX36080@cassie.foobarbaz.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20030507043633.GX36080@cassie.foobarbaz.net> User-Agent: Mutt/1.5.3i Date: Tue, 6 May 2003 22:34:11 -0700 Topicbox-Message-UUID: a0ebbe36-eacb-11e9-9e20-41e7f4b1d025 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