summaryrefslogtreecommitdiff
path: root/ldso/ldso/c6x/dl-syscalls.h
diff options
context:
space:
mode:
authorAurelien Jacquiot <a-jacquiot@ti.com>2011-02-23 13:04:59 +0100
committerBernd Schmidt <bernds@codesourcery.com>2011-03-05 18:10:15 +0100
commit46d6a24872b7fa2717f8f71b5e0598a14d38e1f6 (patch)
tree886cf5a54ef7fd260acf2dd7d1722acea1c62186 /ldso/ldso/c6x/dl-syscalls.h
parent817f685f4c65ed1af6eef79749b1f158eedd5bfc (diff)
The C6X port
This adds support for the TI C6X family of processors. Signed-off-by: Mark Salter <msalter@redhat.com> Signed-off-by: Aurelien Jacquiot <a-jacquiot@ti.com> Signed-off-by: Bernd Schmidt <bernds@codesourcery.com>
Diffstat (limited to 'ldso/ldso/c6x/dl-syscalls.h')
-rw-r--r--ldso/ldso/c6x/dl-syscalls.h25
1 files changed, 25 insertions, 0 deletions
diff --git a/ldso/ldso/c6x/dl-syscalls.h b/ldso/ldso/c6x/dl-syscalls.h
new file mode 100644
index 000000000..9ff3358b0
--- /dev/null
+++ b/ldso/ldso/c6x/dl-syscalls.h
@@ -0,0 +1,25 @@
+/* Copyright (C) 2010 Texas Instruments Incorporated
+ * Contributed by Mark Salter <msalter@redhat.com>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+/* We can't use the real errno in ldso, since it has not yet
+ * been dynamicly linked in yet. */
+#include "sys/syscall.h"
+extern int _dl_errno;
+#undef __set_errno
+#define __set_errno(X) {(_dl_errno) = (X);}
+#include <sys/mman.h>
+
+#ifdef __NR_pread64
+#define __NR___syscall_pread __NR_pread64
+static __always_inline _syscall5(ssize_t, __syscall_pread, int, fd, void *, buf,
+ size_t, count, off_t, offset_hi, off_t, offset_lo);
+
+static __always_inline ssize_t
+_dl_pread(int fd, void *buf, size_t count, off_t offset)
+{
+ return(__syscall_pread(fd,buf,count, offset, offset >> 31));
+}
+#endif