Subject: Re: #pragma pack parameter ?
To: None <hm@hcs.de>
From: John F. Woods <jfw@jfwhome.funhouse.com>
List: port-i386
Date: 04/11/1995 09:13:11
> For a driver on NetBSD 1.0 i need an exact representation of structures in
> memory and i just discovered the hard way gcc does some filling and adjust-
> ments to structures.
> And as i walked through the gcc manuals i noticed RMS does not like pragmas,
> so is there a more recommended way instead of using #pragma pack ?
The absolutely guaranteed way to do this is to not use structures at all
to represent hardware registers. Write dedicated routines that read and
write the device registers into structures, or routines to manipulate
individual registers (which can be inline functions if you begrudge the
extra microsecond or two).
This has the advantage that when DEC finally yields to the inevitable and
comes out with an Alpha with an ISA bus :-), your driver should work without
modification...