]> rtime.felk.cvut.cz Git - l4.git/blob - l4/pkg/uclibc/lib/contrib/uclibc/libpthread/nptl/sysdeps/unix/sysv/linux/metag/pt-vfork.S
update
[l4.git] / l4 / pkg / uclibc / lib / contrib / uclibc / libpthread / nptl / sysdeps / unix / sysv / linux / metag / pt-vfork.S
1 /* Copyright (C) 2005 Free Software Foundation, Inc.
2    This file is part of the GNU C Library.
3
4    The GNU C Library is free software; you can redistribute it and/or
5    modify it under the terms of the GNU Lesser General Public
6    License as published by the Free Software Foundation; either
7    version 2.1 of the License, or (at your option) any later version.
8
9    The GNU C Library is distributed in the hope that it will be useful,
10    but WITHOUT ANY WARRANTY; without even the implied warranty of
11    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12    Lesser General Public License for more details.
13
14    You should have received a copy of the GNU Lesser General Public
15    License along with the GNU C Library; if not, write to the Free
16    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
17    02111-1307 USA.  */
18
19 #include <tcb-offsets.h>
20 #include <asm/unistd.h>
21
22 #ifdef __PIC__
23 #define __VFORK_METAG_LOAD_TP ___metag_load_tp@PLT
24 #else
25 #define __VFORK_METAG_LOAD_TP ___metag_load_tp
26 #endif
27
28 /* Save the PID value.  */
29 #define SAVE_PID \
30         SETL    [A0StP++], D0FrT, D1RtP; \
31         CALLR   D1RtP, __VFORK_METAG_LOAD_TP; \
32         SUB     D0Re0, D0Re0, #TLS_PRE_TCB_SIZE; \
33         GETD    D0FrT, [D0Re0 + #PID]; \
34         NEG     D0FrT, D0FrT; \
35         SETD    [D0Re0 + #PID], D0FrT; \
36         GETL    D0FrT, D1RtP, [--A0StP];
37
38 #define RESTORE_PID \
39         CMP     D0Re0, #0; \
40         BEQ     1f; \
41         MSETL   [A0StP++], D0Re0, D0FrT; \
42         CALLR   D1RtP, __VFORK_METAG_LOAD_TP; \
43         SUB     D0Re0, D0Re0, #TLS_PRE_TCB_SIZE; \
44         GETD    D0FrT, [D0Re0 + #PID]; \
45         NEG     D0FrT, D0FrT; \
46         SETD    [D0Re0 + #PID], D0FrT; \
47         GETL    D0FrT, D1RtP, [--A0StP]; \
48         GETL    D0Re0, D1Re0, [--A0StP]; \
49 1:
50
51 #include <../../../../../../../libc/sysdeps/linux/metag/vfork.S>