TRAP codes not very well explained

Any technical questions about the Epiphany chip and Parallella HW Platform.

Moderator: aolofsson

TRAP codes not very well explained

Postby alexrp » Tue Dec 10, 2013 2:08 pm

The codes that are valid for TRAP are not very well documented in the architecture manual.

* It's not clear what 3 does. How is the exit code actually passed along?
* What is 4 even used for?
* Can the reserved codes be used by applications or does reserved mean "reserved by the ISA" here?
alexrp
 
Posts: 154
Joined: Mon Dec 17, 2012 3:22 am
Location: Thisted, Denmark

Re: TRAP codes not very well explained

Postby alexrp » Tue Dec 10, 2013 2:11 pm

The system call table is also incomplete with regards to the actual system calls made in the Newlib port.
Last edited by alexrp on Tue Dec 10, 2013 3:43 pm, edited 1 time in total.
alexrp
 
Posts: 154
Joined: Mon Dec 17, 2012 3:22 am
Location: Thisted, Denmark

Re: TRAP codes not very well explained

Postby alexrp » Tue Dec 10, 2013 2:22 pm

And finally, the text should explain that when the core resumes after the TRAP, R3 will hold the error code (non-zero if error) and R0 will hold the result.
alexrp
 
Posts: 154
Joined: Mon Dec 17, 2012 3:22 am
Location: Thisted, Denmark

Re: TRAP codes not very well explained

Postby mhonman » Tue Dec 10, 2013 7:05 pm

A while back I put some trap notes in the documentation errors thread, here: .

Also see the post that follows it.

As far as I can tell trap 4 is not reserved for any architectural reason - it looks like it may have been used in an earlier version of the SDK - traps 0 - 2 are write, read and open functions that seem to have been superseded by the Trap 7 syscalls.

If you are thinking of adding trap functionality, it may be best to do so by extending the range of functions that map to the syscall trap.

Hope this helps!
mhonman
 
Posts: 112
Joined: Thu Apr 25, 2013 2:22 pm


Return to Epiphany and Parallella Q & A

Who is online

Users browsing this forum: No registered users and 19 guests