svn commit: trunk/uClibc/libc/sysdeps/linux: bfin common
vapier at uclibc.org
vapier at uclibc.org
Thu Dec 11 10:08:00 UTC 2008
Author: vapier
Date: 2008-12-11 02:08:00 -0800 (Thu, 11 Dec 2008)
New Revision: 24375
Log:
create arch-generic brk() based on blackfin one
Added:
trunk/uClibc/libc/sysdeps/linux/common/brk.c
Removed:
trunk/uClibc/libc/sysdeps/linux/bfin/brk.c
Modified:
trunk/uClibc/libc/sysdeps/linux/bfin/Makefile.arch
Changeset:
Modified: trunk/uClibc/libc/sysdeps/linux/bfin/Makefile.arch
===================================================================
--- trunk/uClibc/libc/sysdeps/linux/bfin/Makefile.arch 2008-12-11 10:04:41 UTC (rev 24374)
+++ trunk/uClibc/libc/sysdeps/linux/bfin/Makefile.arch 2008-12-11 10:08:00 UTC (rev 24375)
@@ -5,7 +5,7 @@
# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
#
-CSRC := brk.c bsdsetjmp.c clone.c syscall.c \
+CSRC := 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
Deleted: trunk/uClibc/libc/sysdeps/linux/bfin/brk.c
===================================================================
--- trunk/uClibc/libc/sysdeps/linux/bfin/brk.c 2008-12-11 10:04:41 UTC (rev 24374)
+++ trunk/uClibc/libc/sysdeps/linux/bfin/brk.c 2008-12-11 10:08:00 UTC (rev 24375)
@@ -1,36 +0,0 @@
-/*
- * Copyright (C) 2000-2006 Erik Andersen <andersen at uclibc.org>
- *
- * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
- */
-
-#include <errno.h>
-#include <unistd.h>
-#include <sys/syscall.h>
-
-/* libc_hidden_proto(brk) */
-
-/* This must be initialized data because commons can't have aliases. */
-void * __curbrk attribute_hidden = 0;
-
-int brk (void *addr)
-{
- void *newbrk;
-
- __asm__ __volatile__(
- "P0 = %2;\n\t"
- "excpt 0;\n\t"
- : "=q0" (newbrk)
- : "q0" (addr), "i" (__NR_brk): "P0" );
-
- __curbrk = newbrk;
-
- if (newbrk < addr)
- {
- __set_errno (ENOMEM);
- return -1;
- }
-
- return 0;
-}
-libc_hidden_def(brk)
Copied: trunk/uClibc/libc/sysdeps/linux/common/brk.c (from rev 24367, trunk/uClibc/libc/sysdeps/linux/bfin/brk.c)
===================================================================
--- trunk/uClibc/libc/sysdeps/linux/common/brk.c (rev 0)
+++ trunk/uClibc/libc/sysdeps/linux/common/brk.c 2008-12-11 10:08:00 UTC (rev 24375)
@@ -0,0 +1,32 @@
+/*
+ * Copyright (C) 2000-2006 Erik Andersen <andersen at uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <errno.h>
+#include <unistd.h>
+#include <sys/syscall.h>
+
+libc_hidden_proto(brk)
+
+#define __NR___syscall_brk __NR_brk
+static inline _syscall1(void *, __syscall_brk, void *, end)
+
+/* This must be initialized data because commons can't have aliases. */
+void * __curbrk attribute_hidden = 0;
+
+int brk(void *addr)
+{
+ void *newbrk = __syscall_brk(addr);
+
+ __curbrk = newbrk;
+
+ if (newbrk < addr) {
+ __set_errno (ENOMEM);
+ return -1;
+ }
+
+ return 0;
+}
+libc_hidden_def(brk)
Property changes on: trunk/uClibc/libc/sysdeps/linux/common/brk.c
___________________________________________________________________
Name: svn:mergeinfo
+
More information about the uClibc-cvs
mailing list