summaryrefslogtreecommitdiff
path: root/libc/sysdeps/linux/microblaze/vfork.S
diff options
context:
space:
mode:
authorWaldemar Brodkorb <wbx@uclibc-ng.org>2016-10-31 18:05:44 +0100
committerWaldemar Brodkorb <wbx@uclibc-ng.org>2016-11-03 20:37:48 +0100
commit191739597c6d380692885cfdd8dd8aa4f31f029d (patch)
treeb3f05ce72f7a87433905698dd58371048c904812 /libc/sysdeps/linux/microblaze/vfork.S
parent7825930078208462655e107677656c45014e91b4 (diff)
microblaze: add NPTL/TLS support from GNU libc
Not perfect, but a starting point. Some tests of the test suite are failing.
Diffstat (limited to 'libc/sysdeps/linux/microblaze/vfork.S')
-rw-r--r--libc/sysdeps/linux/microblaze/vfork.S58
1 files changed, 30 insertions, 28 deletions
diff --git a/libc/sysdeps/linux/microblaze/vfork.S b/libc/sysdeps/linux/microblaze/vfork.S
index cadd1167d..11b9e2758 100644
--- a/libc/sysdeps/linux/microblaze/vfork.S
+++ b/libc/sysdeps/linux/microblaze/vfork.S
@@ -1,42 +1,44 @@
-/*
- * libc/sysdeps/linux/microblaze/vfork.S -- `vfork' syscall for linux/microblaze
- *
- * Copyright (C) 2003 John Williams <jwilliams@itee.uq.edu.au>
- * Copyright (C) 2001 NEC Corporation
- * Copyright (C) 2001 Miles Bader <miles@gnu.org>
- *
- * This file is subject to the terms and conditions of the GNU Lesser
- * General Public License. See the file COPYING.LIB in the main
- * directory of this archive for more details.
- *
- * Written by Miles Bader <miles@gnu.org>
- * Microblaze port by John Williams
- */
-
-#include <sys/syscall.h>
+/* Copyright (C) 2005-2016 Free Software Foundation, Inc.
+
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <sysdep.h>
+#define _ERRNO_H 1
+#include <bits/errno.h>
/* Clone the calling process, but without copying the whole address space.
The calling process is suspended until the new process exits or is
replaced by a call to `execve'. Return -1 for errors, 0 to the new process,
and the process ID of the new process to the old process. */
- .globl __vfork
- .hidden __vfork
- .align 4
-__vfork:
- addi r12, r0, SYS_vfork
- brki r14, 0x08;
- addi r4, r3, 125 /* minimum err value */
- blti r4, 1f /* is r3 < -125? */
- bri 2f /* normal return */
+ENTRY(__vfork)
+
+ DO_CALL (vfork, 0)
+ addik r12,r0,-4095
+ cmpu r12,r12,r3
+ bgei r12,1f
+ rtsd r15,8
+ nop
1: rsubk r3,r3,r0
rtsd r15,8
addik r3,r0,-1 /* delay slot. */
-2: rtsd r15, 8 /* error return */
- nop
- .size __vfork, .-__vfork
+END(__vfork)
weak_alias(__vfork, vfork)
libc_hidden_def(vfork)