1 /* Copyright (C) 2003, 2004 Free Software Foundation, Inc.
2 This file is part of the GNU C Library.
3 Contributed by Jakub Jelinek <jakub@redhat.com>, 2003.
5 The GNU C Library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
10 The GNU C Library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Lesser General Public License for more details.
15 You should have received a copy of the GNU Lesser General Public
16 License along with the GNU C Library; if not, see
17 <http://www.gnu.org/licenses/>. */
22 # include <linuxthreads/internals.h>
25 #if !defined NOT_IN_libc || defined IS_IN_libpthread || defined IS_IN_librt
28 # define PSEUDO(name, syscall_name, args) \
32 stmg %r13,%r15,104(%r15); \
39 DO_CALL(syscall_name, args); \
42 brasl %r14,CDISABLE; \
44 lmg %r13,%r15,104+160(%r15); \
48 jne L(pseudo_cancel); \
49 DO_CALL(syscall_name, args); \
53 jgnl SYSCALL_ERROR_LABEL; \
56 # ifdef IS_IN_libpthread
57 # define CENABLE __pthread_enable_asynccancel
58 # define CDISABLE __pthread_disable_asynccancel
59 # define __local_multiple_threads __pthread_multiple_threads
60 # elif !defined NOT_IN_libc
61 # define CENABLE __libc_enable_asynccancel
62 # define CDISABLE __libc_disable_asynccancel
63 # define __local_multiple_threads __libc_multiple_threads
65 # define CENABLE __librt_enable_asynccancel@PLT
66 # define CDISABLE __librt_disable_asynccancel@PLT
69 #define STM_0 /* Nothing */
70 #define STM_1 stg %r2,16(%r15);
71 #define STM_2 stmg %r2,%r3,16(%r15);
72 #define STM_3 stmg %r2,%r4,16(%r15);
73 #define STM_4 stmg %r2,%r5,16(%r15);
74 #define STM_5 stmg %r2,%r5,16(%r15);
76 #define LM_0 /* Nothing */
77 #define LM_1 lg %r2,16+160(%r15);
78 #define LM_2 lmg %r2,%r3,16+160(%r15);
79 #define LM_3 lmg %r2,%r4,16+160(%r15);
80 #define LM_4 lmg %r2,%r5,16+160(%r15);
81 #define LM_5 lmg %r2,%r5,16+160(%r15);
83 # if !defined NOT_IN_libc || defined IS_IN_libpthread
84 # ifndef __ASSEMBLER__
85 extern int __local_multiple_threads attribute_hidden;
86 # define SINGLE_THREAD_P \
87 __builtin_expect (__local_multiple_threads == 0, 1)
89 # define SINGLE_THREAD_P \
90 larl %r1,__local_multiple_threads; \
96 # ifndef __ASSEMBLER__
97 # define SINGLE_THREAD_P \
98 __builtin_expect (THREAD_GETMEM (THREAD_SELF, \
99 p_header.data.multiple_threads) == 0, 1)
101 # define SINGLE_THREAD_P \
105 icm %r1,15,MULTIPLE_THREADS_OFFSET(%r1);
110 #elif !defined __ASSEMBLER__
112 /* This code should never be used but we define it anyhow. */
113 # define SINGLE_THREAD_P (1)