svn commit: branches/uClibc-nptl/libc/sysdeps/linux/bfin: bits sys

carmelo at uclibc.org carmelo at uclibc.org
Wed Jun 18 15:40:46 UTC 2008


Author: carmelo
Date: 2008-06-18 08:40:43 -0700 (Wed, 18 Jun 2008)
New Revision: 22427

Log:
Synch libc bfin specific  with trunk

Added:
   branches/uClibc-nptl/libc/sysdeps/linux/bfin/bfin_l1layout.h
   branches/uClibc-nptl/libc/sysdeps/linux/bfin/bfin_sram.h
   branches/uClibc-nptl/libc/sysdeps/linux/bfin/bits/byteswap.h
   branches/uClibc-nptl/libc/sysdeps/linux/bfin/dma-memcpy.c
   branches/uClibc-nptl/libc/sysdeps/linux/bfin/sram-alloc.c
   branches/uClibc-nptl/libc/sysdeps/linux/bfin/sram-free.c
   branches/uClibc-nptl/libc/sysdeps/linux/bfin/sysdep.h

Modified:
   branches/uClibc-nptl/libc/sysdeps/linux/bfin/Makefile.arch
   branches/uClibc-nptl/libc/sysdeps/linux/bfin/__longjmp.S
   branches/uClibc-nptl/libc/sysdeps/linux/bfin/bits/fcntl.h
   branches/uClibc-nptl/libc/sysdeps/linux/bfin/bits/kernel_types.h
   branches/uClibc-nptl/libc/sysdeps/linux/bfin/bits/syscalls.h
   branches/uClibc-nptl/libc/sysdeps/linux/bfin/bits/uClibc_arch_features.h
   branches/uClibc-nptl/libc/sysdeps/linux/bfin/brk.c
   branches/uClibc-nptl/libc/sysdeps/linux/bfin/bsd-_setjmp.S
   branches/uClibc-nptl/libc/sysdeps/linux/bfin/clone.c
   branches/uClibc-nptl/libc/sysdeps/linux/bfin/crt1.S
   branches/uClibc-nptl/libc/sysdeps/linux/bfin/crtreloc.c
   branches/uClibc-nptl/libc/sysdeps/linux/bfin/sys/procfs.h
   branches/uClibc-nptl/libc/sysdeps/linux/bfin/sys/ucontext.h


Changeset:
Modified: branches/uClibc-nptl/libc/sysdeps/linux/bfin/Makefile.arch
===================================================================
--- branches/uClibc-nptl/libc/sysdeps/linux/bfin/Makefile.arch	2008-06-18 15:28:29 UTC (rev 22426)
+++ branches/uClibc-nptl/libc/sysdeps/linux/bfin/Makefile.arch	2008-06-18 15:40:43 UTC (rev 22427)
@@ -5,8 +5,11 @@
 # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
 #
 
-CSRC := brk.c bsdsetjmp.c clone.c syscall.c
+CSRC := brk.c bsdsetjmp.c clone.c syscall.c \
+	sram-alloc.c sram-free.c dma-memcpy.c
 
 SSRC := __longjmp.S setjmp.S bsd-_setjmp.S vfork.S
 
+ARCH_HEADERS := bfin_l1layout.h bfin_sram.h
+
 include $(top_srcdir)libc/sysdeps/linux/Makefile.commonarch

Modified: branches/uClibc-nptl/libc/sysdeps/linux/bfin/__longjmp.S
===================================================================
--- branches/uClibc-nptl/libc/sysdeps/linux/bfin/__longjmp.S	2008-06-18 15:28:29 UTC (rev 22426)
+++ branches/uClibc-nptl/libc/sysdeps/linux/bfin/__longjmp.S	2008-06-18 15:40:43 UTC (rev 22427)
@@ -98,9 +98,9 @@
 	P0 = [SP++];
 
 	CC = R0 == 0;
-	IF !CC JUMP finished;
+	IF !CC JUMP .Lfinished;
 	R0 = 1;
-finished:
+.Lfinished:
 	RTS;
 .size ___longjmp,.-___longjmp
 

Added: branches/uClibc-nptl/libc/sysdeps/linux/bfin/bfin_l1layout.h
===================================================================
--- branches/uClibc-nptl/libc/sysdeps/linux/bfin/bfin_l1layout.h	                        (rev 0)
+++ branches/uClibc-nptl/libc/sysdeps/linux/bfin/bfin_l1layout.h	2008-06-18 15:40:43 UTC (rev 22427)
@@ -0,0 +1,17 @@
+#define L1_SCRATCH_START	0xFFB00000
+
+/* Data that is "mapped" into the process VM at the start of the L1 scratch
+   memory, so that each process can access it at a fixed address.  Used for
+   stack checking.  */
+struct l1_scratch_task_info
+{
+	/* Points to the start of the stack.  */
+	void *stack_start;
+	/* Not updated by the kernel; a user process can modify this to
+	   keep track of the lowest address of the stack pointer during its
+	   runtime.  */
+	void *lowest_sp;
+};
+
+/* A pointer to the structure in memory.  */
+#define L1_SCRATCH_TASK_INFO ((struct l1_scratch_task_info *)L1_SCRATCH_START)

Added: branches/uClibc-nptl/libc/sysdeps/linux/bfin/bfin_sram.h
===================================================================
--- branches/uClibc-nptl/libc/sysdeps/linux/bfin/bfin_sram.h	                        (rev 0)
+++ branches/uClibc-nptl/libc/sysdeps/linux/bfin/bfin_sram.h	2008-06-18 15:40:43 UTC (rev 22427)
@@ -0,0 +1,30 @@
+/*
+ * bfin_sram.h - userspace interface to L1 memory allocator
+ *
+ * Copyright (c) 2007 Analog Devices Inc.
+ *
+ * Licensed under the GPL-2 or later.
+ */
+
+#ifndef __BFIN_SRAM_H__
+#define __BFIN_SRAM_H__
+
+#include <features.h>
+#include <sys/types.h>
+
+__BEGIN_DECLS
+
+#define L1_INST_SRAM            0x00000001
+#define L1_DATA_A_SRAM          0x00000002
+#define L1_DATA_B_SRAM          0x00000004
+#define L1_DATA_SRAM            0x00000006
+
+extern void *sram_alloc(size_t size, unsigned long flags)
+	__attribute_malloc__ __attribute_warn_unused_result__;
+extern int sram_free(const void *addr);
+extern void *dma_memcpy(void *dest, const void *src, size_t len)
+	__nonnull((1, 2));
+
+__END_DECLS
+
+#endif

Added: branches/uClibc-nptl/libc/sysdeps/linux/bfin/bits/byteswap.h
===================================================================
--- branches/uClibc-nptl/libc/sysdeps/linux/bfin/bits/byteswap.h	                        (rev 0)
+++ branches/uClibc-nptl/libc/sysdeps/linux/bfin/bits/byteswap.h	2008-06-18 15:40:43 UTC (rev 22427)
@@ -0,0 +1,94 @@
+/* File: libc/sysdeps/linux/bfin/bits/byteswap.h
+ *
+ * Copyright 2004-2006 Analog Devices Inc.
+ *
+ * Enter bugs at http://blackfin.uclinux.org/
+ *
+ * Licensed under the GPL-2 or later.
+ */
+
+#if !defined _BYTESWAP_H && !defined _NETINET_IN_H
+# error "Never use <bits/byteswap.h> directly; include <byteswap.h> instead."
+#endif
+
+#ifndef _BITS_BYTESWAP_H
+#define _BITS_BYTESWAP_H 1
+
+/* Swap bytes in 16 bit value.  */
+#define __bswap_constant_16(x) \
+     ((((x) >> 8) & 0xffu) | (((x) & 0xffu) << 8))
+
+#ifdef __GNUC__
+# define __bswap_16(x) \
+     (__extension__							      \
+      ({ register unsigned short int __v, __x = (x);			      \
+	 if (__builtin_constant_p (__x))				      \
+	   __v = __bswap_constant_16 (__x);				      \
+	 else								      \
+	   __asm__ ("%0 = PACK (%1.L, %1.L);"				      \
+		    "%0 >>= 8;"						      \
+		    : "=d" (__v)					      \
+		    : "d" (__x));					      \
+	 __v; }))
+#else
+static __inline unsigned short int
+__bswap_16 (unsigned short int __bsx)
+{
+  return __bswap_constant_16 (__bsx);
+}
+#endif
+
+/* Swap bytes in 32 bit value.  */
+#define __bswap_constant_32(x) \
+     ((((x) & 0xff000000u) >> 24) | (((x) & 0x00ff0000u) >>  8) |	      \
+      (((x) & 0x0000ff00u) <<  8) | (((x) & 0x000000ffu) << 24))
+
+#ifdef __GNUC__
+# define __bswap_32(x) \
+     (__extension__							      \
+      ({ register unsigned int __v, __x = (x);				      \
+	 if (__builtin_constant_p (__x))				      \
+	   __v = __bswap_constant_32 (__x);				      \
+	 else								      \
+	   __asm__ ("%1 = %0 >> 8 (V);"					      \
+		    "%0 = %0 << 8 (V);"					      \
+		    "%0 = %0 | %1;"					      \
+		    "%1 = PACK(%0.L, %0.H);"				      \
+		    : "+d"(__x), "=&d"(__v));				      \
+	 __v; }))
+#else
+static __inline unsigned int
+__bswap_32 (unsigned int __bsx)
+{
+  return __bswap_constant_32 (__bsx);
+}
+#endif
+
+#if defined __GNUC__ && __GNUC__ >= 2
+/* Swap bytes in 64 bit value.  */
+# define __bswap_constant_64(x) \
+     ((((x) & 0xff00000000000000ull) >> 56)				      \
+      | (((x) & 0x00ff000000000000ull) >> 40)				      \
+      | (((x) & 0x0000ff0000000000ull) >> 24)				      \
+      | (((x) & 0x000000ff00000000ull) >> 8)				      \
+      | (((x) & 0x00000000ff000000ull) << 8)				      \
+      | (((x) & 0x0000000000ff0000ull) << 24)				      \
+      | (((x) & 0x000000000000ff00ull) << 40)				      \
+      | (((x) & 0x00000000000000ffull) << 56))
+
+# define __bswap_64(x) \
+     (__extension__							      \
+      ({ union { __extension__ unsigned long long int __ll;		      \
+		 unsigned int __l[2]; } __w, __r;			      \
+         if (__builtin_constant_p (x))					      \
+	   __r.__ll = __bswap_constant_64 (x);				      \
+	 else								      \
+	   {								      \
+	     __w.__ll = (x);						      \
+	     __r.__l[0] = __bswap_32 (__w.__l[1]);			      \
+	     __r.__l[1] = __bswap_32 (__w.__l[0]);			      \
+	   }								      \
+	 __r.__ll; }))
+#endif
+
+#endif /* _BITS_BYTESWAP_H */

Modified: branches/uClibc-nptl/libc/sysdeps/linux/bfin/bits/fcntl.h
===================================================================
--- branches/uClibc-nptl/libc/sysdeps/linux/bfin/bits/fcntl.h	2008-06-18 15:28:29 UTC (rev 22426)
+++ branches/uClibc-nptl/libc/sysdeps/linux/bfin/bits/fcntl.h	2008-06-18 15:40:43 UTC (rev 22427)
@@ -96,6 +96,8 @@
 # define F_SETLEASE	1024	/* Set a lease.	 */
 # define F_GETLEASE	1025	/* Enquire what lease is active.  */
 # define F_NOTIFY	1026	/* Request notfications on a directory.	 */
+# define F_DUPFD_CLOEXEC 1030	/* Duplicate file descriptor with
+				   close-on-exit set on new fd.  */
 #endif
 
 /* For F_[GET|SET]FL.  */
@@ -182,7 +184,10 @@
 # define POSIX_FADV_NOREUSE	5 /* Data will be accessed once.  */
 #endif
 
+
 #ifdef __USE_GNU
+#if 0
+/* Flags for SYNC_FILE_RANGE.  */
 # define SYNC_FILE_RANGE_WAIT_BEFORE	1 /* Wait upon writeout of all pages
 					     in the range before performing the
 					     write.  */
@@ -194,6 +199,15 @@
 					     write.  */
 #endif
 
+/* Flags for SPLICE and VMSPLICE.  */
+# define SPLICE_F_MOVE		1	/* Move pages instead of copying.  */
+# define SPLICE_F_NONBLOCK	2	/* Don't block on the pipe splicing
+					   (but we may still block on the fd
+					   we splice from/to).  */
+# define SPLICE_F_MORE		4	/* Expect more data.  */
+# define SPLICE_F_GIFT		8	/* Pages passed in are a gift.  */
+#endif
+
 __BEGIN_DECLS
 
 #ifdef __USE_GNU
@@ -207,21 +221,21 @@
 /* Selective file content synch'ing.  */
 extern int sync_file_range (int __fd, __off64_t __from, __off64_t __to,
 			    unsigned int __flags);
+#endif
 
-
 /* Splice address range into a pipe.  */
-extern int vmsplice (int __fdout, const struct iovec *__iov, size_t __count,
-		     unsigned int __flags);
+extern ssize_t vmsplice (int __fdout, const struct iovec *__iov,
+			 size_t __count, unsigned int __flags);
 
 /* Splice two files together.  */
-extern int splice (int __fdin, int __fdout, size_t __len, unsigned int __flags)
-    __THROW;
+extern ssize_t splice (int __fdin, __off64_t *__offin, int __fdout,
+		       __off64_t *__offout, size_t __len,
+		       unsigned int __flags);
 
 /* In-kernel implementation of tee for pipe buffers.  */
-extern int tee (int __fdin, int __fdout, size_t __len, unsigned int __flags)
-    __THROW;
-#endif
+extern ssize_t tee (int __fdin, int __fdout, size_t __len,
+		    unsigned int __flags);
 
 #endif
+__END_DECLS
 
-__END_DECLS

Modified: branches/uClibc-nptl/libc/sysdeps/linux/bfin/bits/kernel_types.h
===================================================================
--- branches/uClibc-nptl/libc/sysdeps/linux/bfin/bits/kernel_types.h	2008-06-18 15:28:29 UTC (rev 22426)
+++ branches/uClibc-nptl/libc/sysdeps/linux/bfin/bits/kernel_types.h	2008-06-18 15:40:43 UTC (rev 22427)
@@ -13,9 +13,9 @@
 typedef unsigned short	__kernel_nlink_t;
 typedef long		__kernel_off_t;
 typedef int		__kernel_pid_t;
-typedef unsigned short	__kernel_ipc_pid_t;
-typedef unsigned short	__kernel_uid_t;
-typedef unsigned short	__kernel_gid_t;
+typedef unsigned int	__kernel_ipc_pid_t;
+typedef unsigned int	__kernel_uid_t;
+typedef unsigned int	__kernel_gid_t;
 typedef unsigned int	__kernel_size_t;
 typedef int		__kernel_ssize_t;
 typedef int		__kernel_ptrdiff_t;

Modified: branches/uClibc-nptl/libc/sysdeps/linux/bfin/bits/syscalls.h
===================================================================
--- branches/uClibc-nptl/libc/sysdeps/linux/bfin/bits/syscalls.h	2008-06-18 15:28:29 UTC (rev 22426)
+++ branches/uClibc-nptl/libc/sysdeps/linux/bfin/bits/syscalls.h	2008-06-18 15:40:43 UTC (rev 22427)
@@ -39,12 +39,10 @@
 type name(void) {							\
 	long __res;							\
 	__asm__ __volatile__ (						\
-		"p0 = %1;\n\t"						\
 		"excpt 0;\n\t"						\
-		"%0=r0;\n\t"						\
-		: "=da" (__res)						\
-		: "i" (__NR_##name)					\
-		: "memory","CC","R0","P0");				\
+		: "=q0" (__res)						\
+		: "qA" (__NR_##name)					\
+		: "memory","CC");					\
 	__syscall_return(type,__res);					\
 }
 
@@ -52,14 +50,11 @@
 type name(type1 arg1) {							\
 	long __res;							\
 	__asm__ __volatile__ (						\
-		"r0=%2;\n\t"						\
-		"p0=%1;\n\t"						\
 		"excpt 0;\n\t"						\
-		"%0=r0;\n\t"						\
-		: "=da" (__res)						\
-		: "i" (__NR_##name),					\
-		  "rm" ((long)(arg1))					\
-		: "memory","CC","R0","P0");				\
+		: "=q0" (__res)						\
+		: "qA" (__NR_##name),					\
+		  "q0" ((long)(arg1))					\
+		: "memory","CC");					\
 	__syscall_return(type,__res);					\
 }
 
@@ -67,16 +62,13 @@
 type name(type1 arg1,type2 arg2) {					\
 	long __res;							\
 	__asm__ __volatile__ (						\
-		"r1=%3;\n\t"						\
-		"r0=%2;\n\t"						\
-		"p0=%1;\n\t"						\
 		"excpt 0;\n\t"						\
 		"%0=r0;\n\t"						\
-		: "=da" (__res)						\
-		: "i" (__NR_##name),					\
-		  "rm" ((long)(arg1)),					\
-		  "rm" ((long)(arg2))					\
-		: "memory","CC","R0","R1","P0");			\
+		: "=q0" (__res)						\
+		: "qA" (__NR_##name),					\
+		  "q0" ((long)(arg1)),					\
+		  "q1" ((long)(arg2))					\
+		: "memory","CC");					\
 	__syscall_return(type,__res);					\
 }
 
@@ -84,18 +76,13 @@
 type name(type1 arg1,type2 arg2,type3 arg3) {				\
 	long __res;							\
 	__asm__ __volatile__ (						\
-		"r2=%4;\n\t"						\
-		"r1=%3;\n\t"						\
-		"r0=%2;\n\t"						\
-		"p0=%1;\n\t"						\
 		"excpt 0;\n\t"						\
-		"%0=r0;\n\t"						\
-		: "=da" (__res)						\
-		: "i"   (__NR_##name),					\
-		  "rm"   ((long)(arg1)),				\
-		  "rm"   ((long)(arg2)),				\
-		  "rm"   ((long)(arg3))					\
-		: "memory","CC","R0","R1","R2","P0");			\
+		: "=q0" (__res)						\
+		: "qA"   (__NR_##name),					\
+		  "q0"   ((long)(arg1)),				\
+		  "q1"   ((long)(arg2)),				\
+		  "q2"   ((long)(arg3))					\
+		: "memory","CC");					\
 	__syscall_return(type,__res);					\
 }
 
@@ -103,20 +90,14 @@
 type name(type1 arg1, type2 arg2, type3 arg3, type4 arg4) {		\
 	long __res;							\
 	__asm__ __volatile__ (						\
-		"r3=%5;\n\t"						\
-		"r2=%4;\n\t"						\
-		"r1=%3;\n\t"						\
-		"r0=%2;\n\t"						\
-		"p0=%1;\n\t"						\
 		"excpt 0;\n\t"						\
-		"%0=r0;\n\t"						\
-		: "=da" (__res)						\
-		: "i"  (__NR_##name),					\
-		  "rm"  ((long)(arg1)),					\
-		  "rm"  ((long)(arg2)),					\
-		  "rm"  ((long)(arg3)),					\
-		  "rm"  ((long)(arg4))					\
-		: "memory","CC","R0","R1","R2","R3","P0");		\
+		: "=q0" (__res)						\
+		: "qA"  (__NR_##name),					\
+		  "q0"  ((long)(arg1)),					\
+		  "q1"  ((long)(arg2)),					\
+		  "q2"  ((long)(arg3)),					\
+		  "q3"  ((long)(arg4))					\
+		: "memory","CC");					\
 	__syscall_return(type,__res);					\
 }
 
@@ -124,22 +105,15 @@
 type name(type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5) {	\
 	long __res;							\
 	__asm__ __volatile__ (						\
-		"r4=%6;\n\t"						\
-		"r3=%5;\n\t"						\
-		"r2=%4;\n\t"						\
-		"r1=%3;\n\t"						\
-		"r0=%2;\n\t"						\
-		"P0=%1;\n\t"						\
 		"excpt 0;\n\t"						\
-		"%0=r0;\n\t"						\
-		: "=da" (__res)						\
-		: "i"  (__NR_##name),					\
-		  "rm"  ((long)(arg1)),					\
-		  "rm"  ((long)(arg2)),					\
-		  "rm"  ((long)(arg3)),					\
-		  "rm"  ((long)(arg4)),					\
-		  "rm"  ((long)(arg5))					\
-		: "memory","CC","R0","R1","R2","R3","R4","P0");		\
+		: "=q0" (__res)						\
+		: "qA"  (__NR_##name),					\
+		  "q0"  ((long)(arg1)),					\
+		  "q1"  ((long)(arg2)),					\
+		  "q2"  ((long)(arg3)),					\
+		  "q3"  ((long)(arg4)),					\
+		  "q4"  ((long)(arg5))					\
+		: "memory","CC");					\
 	__syscall_return(type,__res);					\
 }
 
@@ -147,24 +121,16 @@
 type name(type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5, type6 arg6) { \
 	long __res;							\
 	__asm__ __volatile__ (						\
-		"r5=%7;\n\t"						\
-		"r4=%6;\n\t"						\
-		"r3=%5;\n\t"						\
-		"r2=%4;\n\t"						\
-		"r1=%3;\n\t"						\
-		"r0=%2;\n\t"						\
-		"P0=%1;\n\t"						\
 		"excpt 0;\n\t"						\
-		"%0=r0;\n\t"						\
-		: "=da" (__res)						\
-		: "i"  (__NR_##name),					\
-		  "rm"  ((long)(arg1)),					\
-		  "rm"  ((long)(arg2)),					\
-		  "rm"  ((long)(arg3)),					\
-		  "rm"  ((long)(arg4)),					\
-		  "rm"  ((long)(arg5)),					\
-		  "rm"  ((long)(arg6))					\
-		: "memory","CC","R0","R1","R2","R3","R4","R5","P0");	\
+		: "=q0" (__res)						\
+		: "qA"  (__NR_##name),					\
+		  "q0"  ((long)(arg1)),					\
+		  "q1"  ((long)(arg2)),					\
+		  "q2"  ((long)(arg3)),					\
+		  "q3"  ((long)(arg4)),					\
+		  "q4"  ((long)(arg5)),					\
+		  "q5"  ((long)(arg6))					\
+		: "memory","CC");					\
 	__syscall_return(type,__res);					\
 }
 

Modified: branches/uClibc-nptl/libc/sysdeps/linux/bfin/bits/uClibc_arch_features.h
===================================================================
--- branches/uClibc-nptl/libc/sysdeps/linux/bfin/bits/uClibc_arch_features.h	2008-06-18 15:28:29 UTC (rev 22426)
+++ branches/uClibc-nptl/libc/sysdeps/linux/bfin/bits/uClibc_arch_features.h	2008-06-18 15:40:43 UTC (rev 22427)
@@ -18,9 +18,6 @@
 /* does your target have a broken create_module() ? */
 #undef __UCLIBC_BROKEN_CREATE_MODULE__
 
-/* does your target prefix all symbols with an _ ? */
-#undef __UCLIBC_NO_UNDERSCORES__
-
 /* does your target have an asm .set ? */
 #define __UCLIBC_HAVE_ASM_SET_DIRECTIVE__
 

Modified: branches/uClibc-nptl/libc/sysdeps/linux/bfin/brk.c
===================================================================
--- branches/uClibc-nptl/libc/sysdeps/linux/bfin/brk.c	2008-06-18 15:28:29 UTC (rev 22426)
+++ branches/uClibc-nptl/libc/sysdeps/linux/bfin/brk.c	2008-06-18 15:40:43 UTC (rev 22427)
@@ -19,11 +19,9 @@
 
 	__asm__ __volatile__(
 		"P0 = %2;\n\t"
-		"R0 = %1;\n\t"
 		"excpt 0;\n\t"
-		"%0 = R0;\n\t"
-		: "=r"(newbrk)
-		: "r"(addr), "i" (__NR_brk): "P0" );
+		: "=q0" (newbrk)
+		: "q0" (addr), "i" (__NR_brk): "P0" );
 
     __curbrk = newbrk;
 

Modified: branches/uClibc-nptl/libc/sysdeps/linux/bfin/bsd-_setjmp.S
===================================================================
--- branches/uClibc-nptl/libc/sysdeps/linux/bfin/bsd-_setjmp.S	2008-06-18 15:28:29 UTC (rev 22426)
+++ branches/uClibc-nptl/libc/sysdeps/linux/bfin/bsd-_setjmp.S	2008-06-18 15:40:43 UTC (rev 22427)
@@ -90,7 +90,8 @@
 	R0 = RETS;
 	[P0 + 0x9C] = R0;
 
-	R0 = 0;
+	R0 = [P0 + 0x20];
+	R1 = 0;
+	JUMP.L ___sigjmp_save;
 
-	RTS;
 .size __setjmp,.-__setjmp

Modified: branches/uClibc-nptl/libc/sysdeps/linux/bfin/clone.c
===================================================================
--- branches/uClibc-nptl/libc/sysdeps/linux/bfin/clone.c	2008-06-18 15:28:29 UTC (rev 22426)
+++ branches/uClibc-nptl/libc/sysdeps/linux/bfin/clone.c	2008-06-18 15:40:43 UTC (rev 22427)
@@ -19,11 +19,7 @@
 
 #ifdef __BFIN_FDPIC__
 	__asm__ __volatile__ (
-			"r1 = %2;"
-			"r0 = %3;"
-			"P0 = %1;"
 			"excpt 0;"	 /*Call sys_clone*/
-			"%0  = r0;"
 			"cc = r0 == 0;"
 			"if !cc jump .Lxxx;"	/* if (rval != 0) skip to parent */
 			"r0 = %4;"
@@ -35,16 +31,12 @@
 			"p0 = %6;"
 			"excpt 0;"	/* Call sys_exit */
 			".Lxxx: nop;"
-			: "=d" (rval)
-			: "i" (__NR_clone), "a" (child_stack), "a" (flags), "a" (arg), "a" (fn), "i" (__NR_exit)
-			: "CC", "R0", "R1", "P0");
+			: "=q0" (rval)
+			: "qA" (__NR_clone), "q1" (child_stack), "q0" (flags), "a" (arg), "a" (fn), "i" (__NR_exit)
+			: "CC");
 #else
 	__asm__ __volatile__ (
-			"r1 = %2;"
-			"r0 = %3;"
-			"P0 = %1;"
 			"excpt 0;"	 /*Call sys_clone*/
-			"%0  = r0;"
 			"cc = r0 == 0;"
 			"if !cc jump .Lxxx;"	/* if (rval != 0) skip to parent */
 			"r0 = %4;"
@@ -54,9 +46,9 @@
 			"p0 = %6;"
 			"excpt 0;"	/* Call sys_exit */
 			".Lxxx: nop;"
-			: "=d" (rval)
-			: "i" (__NR_clone), "a" (child_stack), "a" (flags), "a" (arg), "a" (fn), "i" (__NR_exit)
-			: "CC", "R0", "R1", "P0");
+			: "=q0" (rval)
+			: "qA" (__NR_clone), "q1" (child_stack), "q0" (flags), "a" (arg), "a" (fn), "i" (__NR_exit)
+			: "CC");
 #endif
 
 	} else {

Modified: branches/uClibc-nptl/libc/sysdeps/linux/bfin/crt1.S
===================================================================
--- branches/uClibc-nptl/libc/sysdeps/linux/bfin/crt1.S	2008-06-18 15:28:29 UTC (rev 22426)
+++ branches/uClibc-nptl/libc/sysdeps/linux/bfin/crt1.S	2008-06-18 15:40:43 UTC (rev 22427)
@@ -34,8 +34,13 @@
 
 #include <features.h>
 
-#ifndef	L_Scrt1
+#undef USE_GOT
+#if defined (__UCLIBC_FORMAT_SHARED_FLAT__) || defined (__UCLIBC_FORMAT_FLAT_SEP_DATA__)
+#define USE_GOT
+#endif
 
+#if !(defined L_Scrt1 && defined __UCLIBC_FORMAT_SHARED_FLAT__)
+
 .text
 .align 2
 .global __start;
@@ -53,7 +58,7 @@
 
 __start:
 
-#if defined(__BFIN_FDPIC__) && !defined(__pie__)
+#if defined(__BFIN_FDPIC__) && !defined(L_Scrt1)
 	/* P0 contains a pointer to the program's load map.  */
 	call	.Lcall;
 .Lcall:
@@ -108,7 +113,7 @@
 
 #ifdef __BFIN_FDPIC__
 	R3 = [P3 + __init at FUNCDESC_GOT17M4];
-#elif defined __ID_SHARED_LIB__
+#elif defined USE_GOT
 	P5 = [P5 + _current_shared_library_p5_offset_]; 
 	R3 = [P5 + ___shared_flat_init at GOT];
 #else
@@ -120,7 +125,7 @@
 
 #ifdef __BFIN_FDPIC__
 	R3 = [P3 + __fini at FUNCDESC_GOT17M4];
-#elif defined __ID_SHARED_LIB__
+#elif defined USE_GOT
 	R3 = [P5 + ___shared_flat_fini at GOT];
 #else	
 	R3.H = __fini;
@@ -135,13 +140,13 @@
 
 #ifdef __BFIN_FDPIC__
 	R0 = [P3 + _main at FUNCDESC_GOT17M4];
-#elif defined __ID_SHARED_LIB__
+#elif defined USE_GOT
 	R0 = [P5 + _main at GOT];
 #else
 	R0.H = _main;
 	R0.L = _main;
 #endif
-#ifdef __ID_SHARED_LIB__
+#ifdef USE_GOT
 	P0 = [P5 + ___uClibc_main at GOT];
 	jump (P0)
 #else

Modified: branches/uClibc-nptl/libc/sysdeps/linux/bfin/crtreloc.c
===================================================================
--- branches/uClibc-nptl/libc/sysdeps/linux/bfin/crtreloc.c	2008-06-18 15:28:29 UTC (rev 22426)
+++ branches/uClibc-nptl/libc/sysdeps/linux/bfin/crtreloc.c	2008-06-18 15:40:43 UTC (rev 22427)
@@ -47,32 +47,35 @@
 {
   while (p < e)
     {
-      void *ptr = __reloc_pointer (*p, map);
-      if (ptr)
+      if (*p != (void **)-1)
 	{
-	  void *pt;
-	  if ((long)ptr & 3)
+	  void *ptr = __reloc_pointer (*p, map);
+	  if (ptr != (void *)-1)
 	    {
-	      unsigned char *c = ptr;
-	      int i;
-	      unsigned long v = 0;
-	      for (i = 0; i < 4; i++)
-		v |= c[i] << 8 * i;
-	      pt = (void *)v;
+	      void *pt;
+	      if ((long)ptr & 3)
+		{
+		  unsigned char *c = ptr;
+		  int i;
+		  unsigned long v = 0;
+		  for (i = 0; i < 4; i++)
+		    v |= c[i] << 8 * i;
+		  pt = (void *)v;
+		}
+	      else
+		pt = *(void**)ptr;
+	      pt = __reloc_pointer (pt, map);
+	      if ((long)ptr & 3)
+		{
+		  unsigned char *c = ptr;
+		  int i;
+		  unsigned long v = (unsigned long)pt;
+		  for (i = 0; i < 4; i++, v >>= 8)
+		    c[i] = v;
+		}
+	      else
+		*(void**)ptr = pt;
 	    }
-	  else
-	    pt = *(void**)ptr;
-	  pt = __reloc_pointer (pt, map);
-	  if ((long)ptr & 3)
-	    {
-	      unsigned char *c = ptr;
-	      int i;
-	      unsigned long v = (unsigned long)pt;
-	      for (i = 0; i < 4; i++, v >>= 8)
-		c[i] = v;
-	    }
-	  else
-	    *(void**)ptr = pt;
 	}
       p++;
     }

Added: branches/uClibc-nptl/libc/sysdeps/linux/bfin/dma-memcpy.c
===================================================================
--- branches/uClibc-nptl/libc/sysdeps/linux/bfin/dma-memcpy.c	                        (rev 0)
+++ branches/uClibc-nptl/libc/sysdeps/linux/bfin/dma-memcpy.c	2008-06-18 15:40:43 UTC (rev 22427)
@@ -0,0 +1,6 @@
+#include <unistd.h>
+#include <errno.h>
+#include <sys/syscall.h>
+
+_syscall3 (__ptr_t, dma_memcpy, __ptr_t, dest, __ptr_t, src, size_t, len);
+

Added: branches/uClibc-nptl/libc/sysdeps/linux/bfin/sram-alloc.c
===================================================================
--- branches/uClibc-nptl/libc/sysdeps/linux/bfin/sram-alloc.c	                        (rev 0)
+++ branches/uClibc-nptl/libc/sysdeps/linux/bfin/sram-alloc.c	2008-06-18 15:40:43 UTC (rev 22427)
@@ -0,0 +1,6 @@
+#include <unistd.h>
+#include <errno.h>
+#include <sys/syscall.h>
+
+_syscall2 (__ptr_t, sram_alloc, size_t, len, unsigned long, flags);
+

Added: branches/uClibc-nptl/libc/sysdeps/linux/bfin/sram-free.c
===================================================================
--- branches/uClibc-nptl/libc/sysdeps/linux/bfin/sram-free.c	                        (rev 0)
+++ branches/uClibc-nptl/libc/sysdeps/linux/bfin/sram-free.c	2008-06-18 15:40:43 UTC (rev 22427)
@@ -0,0 +1,6 @@
+#include <unistd.h>
+#include <errno.h>
+#include <sys/syscall.h>
+
+_syscall1 (__ptr_t, sram_free, __ptr_t, addr);
+

Modified: branches/uClibc-nptl/libc/sysdeps/linux/bfin/sys/procfs.h
===================================================================
--- branches/uClibc-nptl/libc/sysdeps/linux/bfin/sys/procfs.h	2008-06-18 15:28:29 UTC (rev 22426)
+++ branches/uClibc-nptl/libc/sysdeps/linux/bfin/sys/procfs.h	2008-06-18 15:40:43 UTC (rev 22427)
@@ -45,8 +45,8 @@
 #define ELF_NGREG (sizeof (struct user_regs_struct) / sizeof(elf_greg_t))
 typedef elf_greg_t elf_gregset_t[ELF_NGREG];
 
-/* Register set for the floating-point registers.  */
-typedef struct user_bfinfp_struct elf_fpregset_t;
+/* Register set for the floating-point registers.  Empty on the Blackfin.  */
+typedef struct { } elf_fpregset_t;
 
 /* Signal info.  */
 struct elf_siginfo

Modified: branches/uClibc-nptl/libc/sysdeps/linux/bfin/sys/ucontext.h
===================================================================
--- branches/uClibc-nptl/libc/sysdeps/linux/bfin/sys/ucontext.h	2008-06-18 15:28:29 UTC (rev 22426)
+++ branches/uClibc-nptl/libc/sysdeps/linux/bfin/sys/ucontext.h	2008-06-18 15:40:43 UTC (rev 22427)
@@ -109,7 +109,7 @@
   REG_L3 = 35,
 #define REG_L3	REG_L3
   REG_B_0 = 36,
-#define REG_B_0	REG_B_0
+#define REG_B0	REG_B0
   REG_B1 = 37,
 #define REG_B1	REG_B1
   REG_B2 = 38,
@@ -135,7 +135,6 @@
 /* Context to describe whole processor state.  */
 typedef struct
 {
-  int version;
   gregset_t gregs;
 } mcontext_t;
 

Added: branches/uClibc-nptl/libc/sysdeps/linux/bfin/sysdep.h
===================================================================
--- branches/uClibc-nptl/libc/sysdeps/linux/bfin/sysdep.h	                        (rev 0)
+++ branches/uClibc-nptl/libc/sysdeps/linux/bfin/sysdep.h	2008-06-18 15:40:43 UTC (rev 22427)
@@ -0,0 +1,20 @@
+/*
+ * libc/sysdeps/linux/bfin/sysdep.h
+ *
+ * Copyright (C) 2007 Analog Devices Inc.
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#ifndef __BFIN_SYSDEP_H__
+#define __BFIN_SYSDEP_H__
+
+#include <features.h>
+
+#ifdef __ASSEMBLER__
+
+#define ENTRY(sym) .global sym; .type sym, STT_FUNC; sym:
+
+#endif
+
+#endif




More information about the uClibc-cvs mailing list