[PATCH]: Fix GLX crashes on RISC cpus.

Jaymz Julian jaymz at artificial-stupidity.net
Thu Dec 27 03:35:34 PST 2007


On Thu, Dec 27, 2007 at 12:43:00AM -0800, David Miller wrote:
> From: Xavier Bestel <xavier.bestel at free.fr>
> Date: Thu, 27 Dec 2007 09:35:45 +0100
> 
> > Le jeudi 27 décembre 2007 à 07:43 +0000, Daniel Stone a écrit :
> > > This is the wrong approach for modular; instead of hardcoding a list of
> > > CPUs that throw errors on unaligned accesses, you could just check
> > > whether or not unaligned accesses work.
> > 
> > Beware, not all archs generate a trap on unaligned access. Some have
> > weird (uncorrectable) failure modes.
> 
> Yes, I believe some ARM variants are like this, they just randomly
> crap into the memory location or destination register.

It's not random (it rotates the result in a specific way), but that's not the
point - you can easily check for this bevaviour by doing something like:

(warning: written into email client :-p.  Bonus points if you modify
it to check endian at the same time)

 int main()
 {
     char foop[5];
     int *fleep=(int *)(foop+1)
     int j;
     foop[0]=0;
     fleep=0x12345678;
     j=*(int *)foop;
     return (j==0x00123456 || j==0x00785634);
  }

	--jj

-- 
--
Jaymz Julian - Coder, Visionary, Fat Ass.
"Hannibal is a serial killer. He only likes to kill and eat people. 
 Very few people have `I want to be killed and eaten' on their cards, 
 so Hannibal is out of a job." - http://cards.sf.net



More information about the xorg mailing list