Re: Getting rid of alignment faults in userspace

2011-06-18 Thread Paul Brook
> > > char buf[8]; > > > void *v = &buf[1]; > > > unsigned int *p = (unsigned int *)v; > > > > This does not (reliably) do what you expect. The compiler need not align > > buf. > > Printing the value of p should clarify this. > > And, as we can see above, the "simple" accesses

Re: Getting rid of alignment faults in userspace

2011-06-17 Thread Paul Brook
> >> There is still going to be a small cost even in hardware fixup so this > >> is very much worth solving despite it's "becoming invisible" because the > >> chips are hiding / solving it already. > > > > But I believe that h/w feature is turned off in Linux by default. You > > have to add noalig