So, I built the rt2570 with symbols, and was able to track one of the unaligned accesses back to sanity.c:PeerBeaconAndProbeRspSanity(). Specifically:
Code:
498 // get timestamp from payload and advance the pointer
499 memcpy(Timestamp, Ptr, TIMESTAMP_LEN);
500 Ptr += TIMESTAMP_LEN;
501
502 // get beacon interval from payload and advance the pointer
503 *BeaconPeriod = le16_to_cpup((PUSHORT)(Ptr));
504 Ptr += 2;
The assembly for this:
Code:
/home/dossy/src/rt2570-cvs-2008102616/Module/sanity.c:499
2b810: 8fa20078 lw v0,120(sp)
2b814: 8ac40018 lwl a0,24(s6)
2b818: 9ac4001b lwr a0,27(s6)
2b81c: 8ac5001c lwl a1,28(s6)
2b820: 9ac5001f lwr a1,31(s6)
2b824: a8440000 swl a0,0(v0)
2b828: b8440003 swr a0,3(v0)
2b82c: a8450004 swl a1,4(v0)
2b830: b8450007 swr a1,7(v0)
/home/dossy/src/linux-2.4/include/linux/byteorder/swab.h:165
2b834: 96c20020 lhu v0,32(s6)
2b838: 304300ff andi v1,v0,0xff
2b83c: 00031a00 sll v1,v1,0x8
2b840: 00021202 srl v0,v0,0x8
2b844: 00621825 or v1,v1,v0
/home/dossy/src/rt2570-cvs-2008102616/Module/sanity.c:503
2b848: 8fa20070 lw v0,112(sp)
2b84c: a4430000 sh v1,0(v0)
Specifically, the trap happens at 2b834:
Code:
2b834: 96c20020 lhu v0,32(s6)
Here's the relevant lines from swab.h:
Code:
163 static __inline__ __u16 __swab16p(__u16 *x)
164 {
165 return __arch__swab16p(x);
166 }
I'm going to keep digging, but maybe this will make a lot of sense to Vern or someone else as to why this is resulting in an Unaligned Access trap.