1 /* Assembler macros for 64 bit S/390.
2 Copyright (C) 2001 Free Software Foundation, Inc.
3 Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com).
4 This file is part of the GNU C Library.
6 The GNU C Library is free software; you can redistribute it and/or
7 modify it under the terms of the GNU Lesser General Public
8 License as published by the Free Software Foundation; either
9 version 2.1 of the License, or (at your option) any later version.
11 The GNU C Library is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 Lesser General Public License for more details.
16 You should have received a copy of the GNU Lesser General Public
17 License along with the GNU C Library; if not, write to the Free
18 Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
21 #include <sysdeps/generic/sysdep.h>
25 /* Syntactic details of assembler. */
29 /* ELF uses byte-counts for .align, most others use log2 of count of bytes. */
30 #define ALIGNARG(log2) 1<<log2
31 /* For ELF we need the `.type' directive to make shared libs work right. */
32 #define ASM_TYPE_DIRECTIVE(name,typearg) .type name,typearg;
33 #define ASM_SIZE_DIRECTIVE(name) .size name,.-name;
35 /* In ELF C symbols are asm symbols. */
37 #define NO_UNDERSCORES
41 #define ALIGNARG(log2) log2
42 #define ASM_TYPE_DIRECTIVE(name,type) /* Nothing is specified. */
43 #define ASM_SIZE_DIRECTIVE(name) /* Nothing is specified. */
48 /* Define an entry point visible from C. */
50 ASM_GLOBAL_DIRECTIVE C_SYMBOL_NAME(name); \
51 ASM_TYPE_DIRECTIVE (C_SYMBOL_NAME(name),@function) \
58 ASM_SIZE_DIRECTIVE(name) \
60 /* If compiled for profiling, call `mcount' at the start of each function. */
64 lgr 0,14 ; larl 1,0f ; brasl 14,_mcount@PLT ; lgr 14,0 ; \
65 .data ; .align 4 ; 0: .long 0 ; .text ;
68 lgr 0,14 ; larl 1,0f ; brasl 14,_mcount ; lgr 14,0 ; \
69 .data ; .align 4 ; 0: .long 0 ; .text ;
72 #define CALL_MCOUNT /* Do nothing. */
76 /* Since C identifiers are not normally prefixed with an underscore
77 on this system, the asm identifier `syscall_error' intrudes on the
78 C name space. Make sure we use an innocuous name. */
79 #define syscall_error __syscall_error
80 #define mcount _mcount
83 #define PSEUDO(name, syscall_name, args) \
84 lose: SYSCALL_PIC_SETUP \
85 JUMPTARGET(syscall_error) \
86 .globl syscall_error; \
88 DO_CALL (syscall_name, args); \
92 #define PSEUDO_END(name) \
96 #define JUMPTARGET(name) \
98 #define SYSCALL_PIC_SETUP \
99 larl %r12,_GLOBAL_OFFSET_TABLE_
101 #define JUMPTARGET(name) \
103 #define SYSCALL_PIC_SETUP /* Nothing. */
106 /* Local label name for asm code. */
111 #endif /* __ASSEMBLER__ */