From 191739597c6d380692885cfdd8dd8aa4f31f029d Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Mon, 31 Oct 2016 18:05:44 +0100 Subject: microblaze: add NPTL/TLS support from GNU libc Not perfect, but a starting point. Some tests of the test suite are failing. --- libc/sysdeps/linux/microblaze/vfork.S | 58 ++++++++++++++++++----------------- 1 file changed, 30 insertions(+), 28 deletions(-) (limited to 'libc/sysdeps/linux/microblaze/vfork.S') 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 - * Copyright (C) 2001 NEC Corporation - * Copyright (C) 2001 Miles Bader - * - * 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 - * Microblaze port by John Williams - */ - -#include +/* 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 + . */ + +#include +#define _ERRNO_H 1 +#include /* 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) -- cgit v1.2.3