summaryrefslogtreecommitdiff
path: root/ldso/ldso/sh64/dl-syscalls.h
diff options
context:
space:
mode:
authorPaul Mundt <lethal@linux-sh.org>2005-03-31 19:30:38 +0000
committerPaul Mundt <lethal@linux-sh.org>2005-03-31 19:30:38 +0000
commit0560005b6bb699e195e7334d6908b53db7b2c943 (patch)
tree2d3884f524d121af3b590c86f192e55aa283de0f /ldso/ldso/sh64/dl-syscalls.h
parente643bb46c58a9eaf0dfb77e60c47539b487435be (diff)
sh64 ldso updates and fixes.
Update the sh64 ldso backend to work with Jocke's ldso changes. We also handle a few more relative relocations, and fix a few spots where the LSB was being set incorrectly for SHmedia branches.
Diffstat (limited to 'ldso/ldso/sh64/dl-syscalls.h')
-rw-r--r--ldso/ldso/sh64/dl-syscalls.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/ldso/ldso/sh64/dl-syscalls.h b/ldso/ldso/sh64/dl-syscalls.h
index f0f4baed8..1db7b6719 100644
--- a/ldso/ldso/sh64/dl-syscalls.h
+++ b/ldso/ldso/sh64/dl-syscalls.h
@@ -4,3 +4,21 @@ extern int _dl_errno;
#define __set_errno(X) {(_dl_errno) = (X);}
#include "sys/syscall.h"
+#undef __syscall_return
+#define __syscall_return(type, res) \
+do { \
+ /* \
+ * Note: when returning from kernel the return value is in r9 \
+ * \
+ * This prevents conflicts between return value and arg1 \
+ * when dispatching signal handler, in other words makes \
+ * life easier in the system call epilogue (see entry.S) \
+ */ \
+ register unsigned long __sr2 __asm__ ("r2") = res; \
+ if ((unsigned long)(res) >= (unsigned long)(-125)) { \
+ _dl_errno = -(res); \
+ __sr2 = -1; \
+ } \
+ return (type)(__sr2); \
+} while (0)
+