From mboxrd@z Thu Jan 1 00:00:00 1970 From: erik quanstrom To: 9fans@cse.psu.edu, geoff@collyer.net References: <2e567163be1a7bcfb00188625bc09359@collyer.net> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 In-Reply-To: <2e567163be1a7bcfb00188625bc09359@collyer.net> Subject: Re: [9fans] structure allocation. Message-Id: <20060307030035.617C311735@dexter-peak.quanstro.net> Date: Mon, 6 Mar 2006 21:00:35 -0600 Cc: Topicbox-Message-UUID: 0d72c6c6-ead1-11e9-9d60-3106f5b1d025 okay. many things about this interface don't make sense to me. but it's hard at this point to tell if driver is obfuscated or what. the space/time tradeoff here seems interesting. is pushing 3 more bytes over a pci bus really slower than doing the alignment on an ad-hoc basis? the trouble is these structures go on forever and have many bitfields. (in one i count 46 fields, all integers of random width, randomly intermixed.) - erik geoff@collyer.net writes | | You declare it like this: | | typedef struct { | char f; | uchar l[4]; | char g; | uchar m[4]; | } Dac960fu; | | and convert l and m using the usual integer-to-bytes and | bytes-to-integers macros or functions, presumably the little-endian | versions. Mylex were crazy to lay the data out this way.