pppd unaligned trap on Sparc/LEON3
gedare at rtems.org
Thu Mar 7 14:33:47 UTC 2019
On Mon, Mar 4, 2019 at 2:34 PM Cudmore, Alan P. (GSFC-5820) <
alan.p.cudmore at nasa.gov> wrote:
> I’m trying to get PPP working on SPARC/LEON3. I’m currently using RTEMS
> 4.11, but plan on switching to 5.x soon.
> While handshaking with a Linux PPP client, the LEON3 gets an unaligned
> memory trap in the GetMask function:
> The second network interface returned by the ioctl(SIOGIFCONF) call is not
> aligned on a 4 byte boundary, so the pointer de-reference causes the trap.
> It looks like this was referenced in ticket 1401:
> NOTE: the caller, when unpacking the
> sequence of ifreqs is likely to encounter
> the same problem (see separate bug report
> filed for pppd)
> I could not find that ticket for pppd. Did anyone try to create a fix for
> Is the best approach to try to fix the pppd GetMask function to avoid
> unaligned accesses?
Yes, the best approach would seem to be coercing the value into an aligned
reference and then extracting the bits you want to get.
A general solution could also be to implement trap-and-emulate for
unaligned data accesses. I started writing code like this (about 5 years
ago!), it is about 20-30 hours of coding/testing to be confident about the
result. Existing code is available in netbsd for deriving the exception
handler, so most of the effort is to extract, simplify, refactor, and test
that code in rtems-sparc.
> devel mailing list
> devel at rtems.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the devel