Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Frysinger <vapier@gentoo.org>2011-06-22 08:18:45 +0400
committerMichael Frysinger <vapier@gentoo.org>2011-06-22 08:18:45 +0400
commit4dfc786b8b7ab8abd71e5cc8be1b8de7bc28d85e (patch)
tree0bb73e9f22c924b83adc0504e3074ea233bed08b /libgloss
parent3a81efd10e8e32100c77d197dcd35d320e81568c (diff)
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>
Diffstat (limited to 'libgloss')
-rw-r--r--libgloss/ChangeLog8
-rw-r--r--libgloss/bfin/syscalls.c13
2 files changed, 17 insertions, 4 deletions
diff --git a/libgloss/ChangeLog b/libgloss/ChangeLog
index a6f7ef606..433f12652 100644
--- a/libgloss/ChangeLog
+++ b/libgloss/ChangeLog
@@ -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.
diff --git a/libgloss/bfin/syscalls.c b/libgloss/bfin/syscalls.c
index b9a5f583f..03765bf5d 100644
--- a/libgloss/bfin/syscalls.c
+++ b/libgloss/bfin/syscalls.c
@@ -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;
}