Blame sysdeps/mach/sysdep.h

Packit 6c4009
/* Copyright (C) 1994-2018 Free Software Foundation, Inc.
Packit 6c4009
   This file is part of the GNU C Library.
Packit 6c4009
Packit 6c4009
   The GNU C Library is free software; you can redistribute it and/or
Packit 6c4009
   modify it under the terms of the GNU Lesser General Public
Packit 6c4009
   License as published by the Free Software Foundation; either
Packit 6c4009
   version 2.1 of the License, or (at your option) any later version.
Packit 6c4009
Packit 6c4009
   The GNU C Library is distributed in the hope that it will be useful,
Packit 6c4009
   but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit 6c4009
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Packit 6c4009
   Lesser General Public License for more details.
Packit 6c4009
Packit 6c4009
   You should have received a copy of the GNU Lesser General Public
Packit 6c4009
   License along with the GNU C Library; if not, see
Packit 6c4009
   <http://www.gnu.org/licenses/>.  */
Packit 6c4009
Packit 6c4009
#ifdef __ASSEMBLER__
Packit 6c4009
Packit 6c4009
/* Get the Mach definitions of ENTRY and kernel_trap.  */
Packit 6c4009
#include <mach/machine/syscall_sw.h>
Packit 6c4009
Packit 6c4009
/* The Mach definitions assume underscores should be prepended to
Packit 6c4009
   symbol names.  Redefine them to do so only when appropriate.  */
Packit 6c4009
#undef EXT
Packit 6c4009
#undef LEXT
Packit 6c4009
#define EXT(x) C_SYMBOL_NAME(x)
Packit 6c4009
#define LEXT(x) C_SYMBOL_NAME(x##:)
Packit 6c4009
Packit 6c4009
/* For ELF we need to add the `.type' directive to make shared libraries
Packit 6c4009
   work right.  */
Packit 6c4009
#undef ENTRY
Packit 6c4009
#define ENTRY(name) \
Packit 6c4009
  .globl name; \
Packit 6c4009
  .align ALIGN; \
Packit 6c4009
  .type name,@function; \
Packit 6c4009
  name:
Packit 6c4009
Packit 6c4009
#endif
Packit 6c4009
Packit 6c4009
/* This is invoked by things run when there is random lossage, before they
Packit 6c4009
   try to do anything else.  Just to be safe, deallocate the reply port so
Packit 6c4009
   bogons arriving on it don't foul up future RPCs.  */
Packit 6c4009
Packit 6c4009
#ifndef __ASSEMBLER__
Packit 6c4009
#define FATAL_PREPARE_INCLUDE <mach/mig_support.h>
Packit 6c4009
#define FATAL_PREPARE __mig_dealloc_reply_port (MACH_PORT_NULL)
Packit 6c4009
#endif
Packit 6c4009
Packit 6c4009
/* sysdeps/mach/MACHINE/sysdep.h should define the following macros.  */
Packit 6c4009
Packit 6c4009
/* Produce a text assembler label for the C global symbol NAME.  */
Packit 6c4009
#ifndef ENTRY
Packit 6c4009
#define ENTRY(name) .error ENTRY not defined by sysdeps/mach/MACHINE/sysdep.h
Packit 6c4009
/* This is not used on all machines.  */
Packit 6c4009
#endif
Packit 6c4009
Packit 6c4009
/* Set variables ARGC, ARGV, and ENVP for the arguments
Packit 6c4009
   left on the stack by the microkernel.  */
Packit 6c4009
#ifndef SNARF_ARGS
Packit 6c4009
#define SNARF_ARGS(argc, argv, envp)
Packit 6c4009
#error SNARF_ARGS not defined by sysdeps/mach/MACHINE/sysdep.h
Packit 6c4009
#endif
Packit 6c4009
Packit 6c4009
/* Call the C function FN with no arguments,
Packit 6c4009
   on a stack starting at SP (as returned by *_cthread_init_routine).
Packit 6c4009
   You don't need to deal with FN returning; it shouldn't.  */
Packit 6c4009
#ifndef	CALL_WITH_SP
Packit 6c4009
#define CALL_WITH_SP(fn, sp)
Packit 6c4009
#error CALL_WITH_SP not defined by sysdeps/mach/MACHINE/sysdep.h
Packit 6c4009
#endif
Packit 6c4009
Packit 6c4009
/* LOSE can be defined as the `halt' instruction or something
Packit 6c4009
   similar which will cause the process to die in a characteristic
Packit 6c4009
   way suggesting a bug.  */
Packit 6c4009
#ifndef LOSE
Packit 6c4009
#define	LOSE	({ volatile int zero = 0; zero / zero; })
Packit 6c4009
#endif
Packit 6c4009
Packit 6c4009
/* One of these should be defined to specify the stack direction.  */
Packit 6c4009
#if !defined (STACK_GROWTH_UP) && !defined (STACK_GROWTH_DOWN)
Packit 6c4009
#error stack direction unspecified
Packit 6c4009
#endif
Packit 6c4009
Packit 6c4009
/* Used by some assembly code.  */
Packit 6c4009
#define C_SYMBOL_NAME(name)	name