libgloss: bfin: handle result2/errcode in sim syscalls
The sim passes back results via two values, and the error code via a 3rd. make sure libgloss extracts all three so that things like errno work as expected. This fixes many gdb tests which look for this sort of thing. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
This commit is contained in:
		| @@ -1,3 +1,11 @@ | ||||
| 2011-06-22  Mike Frysinger  <vapier@gentoo.org> | ||||
|  | ||||
| 	* bfin/syscalls.c (do_syscall): Delete local variable definitions. | ||||
| 	Declare result, result2, errcode local ints.  Delete asm inputs | ||||
| 	and outputs.  Set output constraints to q0/result, q1/result2, and | ||||
| 	q2/errcode.  Set input constraints to qA/reason and q0/arg.  Set | ||||
| 	errno to errcode. | ||||
|  | ||||
| 2011-06-21  Mike Frysinger  <vapier@gentoo.org> | ||||
|  | ||||
| 	* bfin/syscalls.c: Trim trailing whitespace. | ||||
|   | ||||
| @@ -32,10 +32,15 @@ register char *stack_ptr asm ("SP"); | ||||
| static inline int | ||||
| do_syscall (int reason, void *arg) | ||||
| { | ||||
|   register int r asm ("P0") = reason; | ||||
|   register void *a asm ("R0") = arg; | ||||
|   register int result asm ("R0"); | ||||
|   asm volatile ("excpt 0;" : "=r" (result) : "a" (r), "r" (a) : "memory", "CC"); | ||||
|   int result, result2, errcode; | ||||
|   asm volatile ("excpt 0;" | ||||
| 		: "=q0" (result), | ||||
| 		  "=q1" (result2), | ||||
| 		  "=q2" (errcode) | ||||
| 		: "qA" (reason), | ||||
| 		  "q0" (arg) | ||||
| 		: "memory", "CC"); | ||||
|   errno = errcode; | ||||
|   return result; | ||||
| } | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user