1 /* Copyright (C) 2003, 2004 Free Software Foundation, Inc.
2 This file is part of the GNU C Library.
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.
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.
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
22 # include <nptl/pthreadP.h>
25 #if !defined NOT_IN_libc || defined IS_IN_libpthread || defined IS_IN_librt
31 # define PSEUDO(name, syscall_name, args) \
37 .type __##syscall_name##_nocancel,@function; \
38 .globl __##syscall_name##_nocancel; \
39 __##syscall_name##_nocancel: \
40 DO_CALL (syscall_name, args); \
49 .size __##syscall_name##_nocancel,.-__##syscall_name##_nocancel; \
62 DO_CALL(syscall_name, args); \
80 SYSCALL_ERROR_HANDLER; \
82 /* Create unwinding information for the syscall wrapper. */ \
83 .section .eh_frame,"a",@progbits; \
85 .ualong .LECIE1-.LSCIE1; \
89 AUGMENTATION_STRING; \
100 .ualong .LEFDE1-.LASFDE1; \
102 .ualong .LASFDE1-.Lframe1; \
104 .ualong .Lpseudo_end - .Lpseudo_start; \
105 AUGMENTATION_PARAM_FDE; \
107 .ualong .LCFI0-.Lpseudo_start; \
113 .ualong .LCFI1-.LCFI0; \
118 .ualong .LCFI2-.LCFI1; \
122 .ualong .LCFI3-.LCFI2; \
127 .ualong .LCFI4-.LCFI3; \
133 .ualong .LCFI5-.LCFI4; \
139 .ualong .LCFI6-.LCFI5; \
144 .ualong .LCFI7-.LCFI6; \
153 # define AUGMENTATION_STRING .string "zR"
154 # define AUGMENTATION_PARAM .uleb128 1; .byte 0x1b
155 # define AUGMENTATION_PARAM_FDE .uleb128 0
156 # define START_SYMBOL_REF .long .Lpseudo_start-.
158 # define AUGMENTATION_STRING .ascii "\0"
159 # define AUGMENTATION_PARAM
160 # define AUGMENTATION_PARAM_FDE
161 # define START_SYMBOL_REF .long .Lpseudo_start
164 # define FRAME_REG_0 /* Nothing. */
165 # define FRAME_REG_1 FRAME_REG_0; .byte 0x84; .uleb128 5
166 # define FRAME_REG_2 FRAME_REG_1; .byte 0x85; .uleb128 4
167 # define FRAME_REG_3 FRAME_REG_2; .byte 0x86; .uleb128 3
168 # define FRAME_REG_4 FRAME_REG_3; .byte 0x87; .uleb128 2
169 # define FRAME_REG_5 FRAME_REG_4
170 # define FRAME_REG_6 FRAME_REG_5
173 # define PSEUDO_END(sym) \
176 # define SAVE_ARGS_0 /* Nothing. */
177 # define SAVE_ARGS_1 SAVE_ARGS_0; mov.l r4,@(0,r15)
178 # define SAVE_ARGS_2 SAVE_ARGS_1; mov.l r5,@(4,r15)
179 # define SAVE_ARGS_3 SAVE_ARGS_2; mov.l r6,@(8,r15)
180 # define SAVE_ARGS_4 SAVE_ARGS_3; mov.l r7,@(12,r15)
181 # define SAVE_ARGS_5 SAVE_ARGS_4
182 # define SAVE_ARGS_6 SAVE_ARGS_5
184 # define LOAD_ARGS_0 /* Nothing. */
185 # define LOAD_ARGS_1 LOAD_ARGS_0; mov.l @(0,r15),r4
186 # define LOAD_ARGS_2 LOAD_ARGS_1; mov.l @(4,r15),r5
187 # define LOAD_ARGS_3 LOAD_ARGS_2; mov.l @(8,r15),r6
188 # define LOAD_ARGS_4 LOAD_ARGS_3; mov.l @(12,r15),r7
189 # define LOAD_ARGS_5 LOAD_ARGS_4
190 # define LOAD_ARGS_6 LOAD_ARGS_5
192 # ifdef IS_IN_libpthread
193 # define __local_enable_asynccancel __pthread_enable_asynccancel
194 # define __local_disable_asynccancel __pthread_disable_asynccancel
195 # elif !defined NOT_IN_libc
196 # define __local_enable_asynccancel __libc_enable_asynccancel
197 # define __local_disable_asynccancel __libc_disable_asynccancel
198 # elif defined IS_IN_librt
199 # define __local_enable_asynccancel __librt_enable_asynccancel
200 # define __local_disable_asynccancel __librt_disable_asynccancel
202 # error Unsupported library
212 1: .long __local_enable_asynccancel - 0b; \
222 1: .long __local_disable_asynccancel - 0b; \
225 # ifndef __ASSEMBLER__
226 # define SINGLE_THREAD_P \
227 __builtin_expect (THREAD_GETMEM (THREAD_SELF, \
228 header.multiple_threads) == 0, 1)
230 # define SINGLE_THREAD_P \
234 mov.l @(MULTIPLE_THREADS_OFFSET,r0),r0; \
237 0: .word TLS_PRE_TCB_SIZE; \
242 #elif !defined __ASSEMBLER__
244 # define SINGLE_THREAD_P (1)
245 # define NO_CANCELLATION 1