This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: Minor feature for ld
Pete Gonzalez <pgonzalez@bluel.com> writes:
> But then it occurred to me that the hacks could be eliminated,
> if you could just map variables onto the ports. In fact, most of
> cases could be handled with ordinary C bitfields:
>
> __attribute__((section("/0x400000C/"))) struct {
> int priority : 2;
> TDataPage tileDataPage : 2;
> bool enableMosaic : 1;
> // etc.
> } REG_BG2CNT __attribute__((packed));
It seems to me that you can still do that in C.
struct REG_BG2CNT_T {
int priority : 2;
TDataPage tileDataPage : 2;
bool enableMosaic : 1;
// etc.
} __attribute__((packed));
#define REG_BG2CNT ((struct REG_BG2CNT_T *)(0x40000C))
REG_BG2CNT->priority = 1;
Ian