]>
Commit | Line | Data |
---|---|---|
2b778ceb | 1 | /* Copyright (C) 1994-2021 Free Software Foundation, Inc. |
478b92f0 | 2 | This file is part of the GNU C Library. |
28f540f4 | 3 | |
478b92f0 | 4 | The GNU C Library is free software; you can redistribute it and/or |
41bdb6e2 AJ |
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. | |
28f540f4 | 8 | |
478b92f0 UD |
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 | |
41bdb6e2 | 12 | Lesser General Public License for more details. |
28f540f4 | 13 | |
41bdb6e2 | 14 | You should have received a copy of the GNU Lesser General Public |
59ba27a6 | 15 | License along with the GNU C Library; if not, see |
5a82c748 | 16 | <https://www.gnu.org/licenses/>. */ |
28f540f4 | 17 | |
66715f83 | 18 | #ifdef __ASSEMBLER__ |
28f540f4 RM |
19 | |
20 | /* Get the Mach definitions of ENTRY and kernel_trap. */ | |
21 | #include <mach/machine/syscall_sw.h> | |
22 | ||
23 | /* The Mach definitions assume underscores should be prepended to | |
24 | symbol names. Redefine them to do so only when appropriate. */ | |
25 | #undef EXT | |
26 | #undef LEXT | |
27 | #define EXT(x) C_SYMBOL_NAME(x) | |
28 | #define LEXT(x) C_SYMBOL_NAME(x##:) | |
29 | ||
1a2df358 RM |
30 | /* For ELF we need to add the `.type' directive to make shared libraries |
31 | work right. */ | |
32 | #undef ENTRY | |
33 | #define ENTRY(name) \ | |
7b8e0d49 | 34 | .globl name; \ |
1a2df358 RM |
35 | .align ALIGN; \ |
36 | .type name,@function; \ | |
37 | name: | |
1a2df358 | 38 | |
28f540f4 RM |
39 | #endif |
40 | ||
41 | /* This is invoked by things run when there is random lossage, before they | |
42 | try to do anything else. Just to be safe, deallocate the reply port so | |
43 | bogons arriving on it don't foul up future RPCs. */ | |
44 | ||
66715f83 | 45 | #ifndef __ASSEMBLER__ |
28f540f4 RM |
46 | #define FATAL_PREPARE_INCLUDE <mach/mig_support.h> |
47 | #define FATAL_PREPARE __mig_dealloc_reply_port (MACH_PORT_NULL) | |
48 | #endif | |
49 | ||
50 | /* sysdeps/mach/MACHINE/sysdep.h should define the following macros. */ | |
51 | ||
52 | /* Produce a text assembler label for the C global symbol NAME. */ | |
53 | #ifndef ENTRY | |
54 | #define ENTRY(name) .error ENTRY not defined by sysdeps/mach/MACHINE/sysdep.h | |
55 | /* This is not used on all machines. */ | |
56 | #endif | |
57 | ||
58 | /* Set variables ARGC, ARGV, and ENVP for the arguments | |
59 | left on the stack by the microkernel. */ | |
60 | #ifndef SNARF_ARGS | |
61 | #define SNARF_ARGS(argc, argv, envp) | |
62 | #error SNARF_ARGS not defined by sysdeps/mach/MACHINE/sysdep.h | |
63 | #endif | |
64 | ||
28f540f4 RM |
65 | /* LOSE can be defined as the `halt' instruction or something |
66 | similar which will cause the process to die in a characteristic | |
67 | way suggesting a bug. */ | |
68 | #ifndef LOSE | |
69 | #define LOSE ({ volatile int zero = 0; zero / zero; }) | |
70 | #endif | |
71 | ||
72 | /* One of these should be defined to specify the stack direction. */ | |
73 | #if !defined (STACK_GROWTH_UP) && !defined (STACK_GROWTH_DOWN) | |
74 | #error stack direction unspecified | |
75 | #endif | |
76 | ||
77 | /* Used by some assembly code. */ | |
28f540f4 | 78 | #define C_SYMBOL_NAME(name) name |