home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.std.c
- Path: sparky!uunet!haven.umd.edu!news.umbc.edu!gmuvax2!kbass
- From: kbass@gmuvax2.gmu.edu (Ken Bass)
- Subject: Help with bit and byte addressable bitfields
- Message-ID: <1992Jul26.043900.7020@gmuvax2.gmu.edu>
- Organization: George Mason University, Fairfax, Va.
- Distribution: na
- Date: Sun, 26 Jul 1992 04:39:00 GMT
- Lines: 23
-
- I'd like to know your suggestions on how to define and access a bitfield
- that is both bit and byte addressable. The application is to maintain a
- ram image in a memory mapped i/o system.
-
- Lets say we have WidgetRamImg of type WidgetRamImgDef where
-
- typedef struct {
- unsigned int bit0;
- ...
- unsigned int bit32;
- } WidgetRamImgDef;
-
- WidgetRamImgDef WidgetRamImg;
-
- I'd like to say WidgetRamImg=0x0; at init time, but the type is wrong.
- Casting to WidgetRamImgDef does not work either.
-
- Any suggestions?
-
- --
- Ken Bass (kbass@gmuvax2.gmu.edu) | Telecommunications
- George Mason University | Techniques Corp,
- Student, Department of Electrical Engineering | Software Engineer
-