Address error exception

Eric Norum eric at cls.usask.ca
Fri Apr 21 15:54:08 UTC 2000


"Alexey S. Fadeyev" wrote:
> 
> Hello.
> Can anyone suggest why RTEMS throw exception as soon as I put packet in
> ether_input?
> Target - mips64orionel
> CPU    - p4650
> 
> /*
> * Check our list of addresses, to see if the packet is for us.
> */
> for (ia = in_ifaddr; ia; ia = ia->ia_next) {
>     9f04b338: 3c069f07 lui $a2,0x9f07
>     9f04b33c: 8cc63638 lw $a2,13880($a2)
>     9f04b340: 8fa80028 lw $t0,40($sp)
>     9f04b344: 10c00017 beqz $a2,9f04b3a4 <ip_input+0x348>
>     9f04b348: 00c0182d 0xc0182d
>     9f04b34c: 8d040010 lw $a0,16($t0)
> #define satosin(sa) ((struct sockaddr_in *)(sa))
> 
> Cause Register
>     00007810 i.e.  0111  1000  0(001  00)00  Exc Code equals 4 - Address
> Error Exception
> EPC
>     9f04b34c


Address Error Exception?  Could this be because you're trying to access
a 32-bit value that isn't on a 32-bit boundary.  IMHO the designers of
Ethernet made a *major* blunder in making the ethernet header 14 bytes
long since an ethernet frame aligned on a 32-bit boundary has all the
TCP/UDP/IP header information offset by 2 bytes from a 32-bit boundary.

If this is the problem you'll have to either memcpy the frame so that
the IP header is on a 0 mod 4 address, or arrange for the transfer from
the ethernet controller to memory to begin on a 2 mod 4 address.

-- 
Eric Norum                                 eric at cls.usask.ca
Canadian Light Source                      Phone: (306) 966-6308
University of Saskatchewan                 FAX:   (306) 966-6058
Saskatoon, Canada.



More information about the users mailing list