This is the mail archive of the gdb@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: long long considered harmful?


> > > typedef struct mips_cpu_registers
> > > {
> > >   unsigned regs[74];
> > >   unsigned long long regs_alignment;
> > > } MIPS_CPU_REGISTERS;
> >
> > What's the purpose of the alignment entry?  I doubt it does what you
> > want it to.
>
> I was more or less correct on this one.  Apparently this was not even
> defined by us but by one of our very large chip vendors who shall remain
> nameless.  Rather than the nicer solution of just defining an array of 64
> bit regs, they did this which necessitates some nastiness when dealing
with
> different endians.  The alignment field ensures that the overall structure
> is 64 bit aligned which is a handy thing to be on mips.

Pardon me, by overall structure, I mean the starting address of the
structure.  Having a 64 bit entry causes the compiler to align the structure
on a 64 bit boundary.

cheers,

Kris


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]