1 /* Copyright (C) 1994, 1995 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 Library General Public License as
6 published by the Free Software Foundation; either version 2 of the
7 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 Library General Public License for more details.
14 You should have received a copy of the GNU Library General Public
15 License along with the GNU C Library; see the file COPYING.LIB. If
16 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
17 Cambridge, MA 02139, USA. */
21 /* Get the Mach definitions of ENTRY and kernel_trap. */
22 #include <mach/machine/syscall_sw.h>
24 /* The Mach definitions assume underscores should be prepended to
25 symbol names. Redefine them to do so only when appropriate. */
28 #define EXT(x) C_SYMBOL_NAME(x)
29 #define LEXT(x) C_SYMBOL_NAME(x##:)
32 /* For ELF we need to add the `.type' directive to make shared libraries
36 ASM_GLOBAL_DIRECTIVE name; \
38 .type name,@function; \
44 /* This is invoked by things run when there is random lossage, before they
45 try to do anything else. Just to be safe, deallocate the reply port so
46 bogons arriving on it don't foul up future RPCs. */
49 #define FATAL_PREPARE_INCLUDE <mach/mig_support.h>
50 #define FATAL_PREPARE __mig_dealloc_reply_port (MACH_PORT_NULL)
53 /* sysdeps/mach/MACHINE/sysdep.h should define the following macros. */
55 /* Produce a text assembler label for the C global symbol NAME. */
57 #define ENTRY(name) .error ENTRY not defined by sysdeps/mach/MACHINE/sysdep.h
58 /* This is not used on all machines. */
61 /* Set variables ARGC, ARGV, and ENVP for the arguments
62 left on the stack by the microkernel. */
64 #define SNARF_ARGS(argc, argv, envp)
65 #error SNARF_ARGS not defined by sysdeps/mach/MACHINE/sysdep.h
68 /* Call the C function FN with no arguments,
69 on a stack starting at SP (as returned by *_cthread_init_routine).
70 You don't need to deal with FN returning; it shouldn't. */
72 #define CALL_WITH_SP(fn, sp)
73 #error CALL_WITH_SP not defined by sysdeps/mach/MACHINE/sysdep.h
76 /* LOSE can be defined as the `halt' instruction or something
77 similar which will cause the process to die in a characteristic
78 way suggesting a bug. */
80 #define LOSE ({ volatile int zero = 0; zero / zero; })
83 /* One of these should be defined to specify the stack direction. */
84 #if !defined (STACK_GROWTH_UP) && !defined (STACK_GROWTH_DOWN)
85 #error stack direction unspecified
88 /* Used by some assembly code. */
90 #define C_SYMBOL_NAME(name) name
92 #define C_SYMBOL_NAME(name) _##name