hjl / source-git / glibc

Forked from source-git/glibc 3 years ago
Clone

Blame sysdeps/unix/sysv/linux/alpha/sysdep.h

Packit 6c4009
/* Copyright (C) 1992-2018 Free Software Foundation, Inc.
Packit 6c4009
   This file is part of the GNU C Library.
Packit 6c4009
   Contributed by Ulrich Drepper, <drepper@gnu.ai.mit.edu>, August 1995.
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
#ifndef _LINUX_ALPHA_SYSDEP_H
Packit 6c4009
#define _LINUX_ALPHA_SYSDEP_H 1
Packit 6c4009
Packit 6c4009
#ifdef __ASSEMBLER__
Packit 6c4009
#include <asm/pal.h>
Packit 6c4009
#include <alpha/regdef.h>
Packit 6c4009
#endif
Packit 6c4009
Packit 6c4009
/* There is some commonality.  */
Packit 6c4009
#include <sysdeps/unix/sysv/linux/sysdep.h>
Packit 6c4009
#include <sysdeps/unix/alpha/sysdep.h>
Packit 6c4009
Packit 6c4009
#include <tls.h>
Packit 6c4009
Packit 6c4009
/* For Linux we can use the system call table in the header file
Packit 6c4009
	/usr/include/asm/unistd.h
Packit 6c4009
   of the kernel.  But these symbols do not follow the SYS_* syntax
Packit 6c4009
   so we have to redefine the `SYS_ify' macro here.  */
Packit 6c4009
#undef SYS_ify
Packit 6c4009
#define SYS_ify(syscall_name)	__NR_##syscall_name
Packit 6c4009
Packit 6c4009
/* Define some aliases to make automatic syscall generation work
Packit 6c4009
   properly.  The SYS_* variants are for the benefit of the files in
Packit 6c4009
   sysdeps/unix.  */
Packit 6c4009
#define __NR_getpid	__NR_getxpid
Packit 6c4009
#define __NR_getuid	__NR_getxuid
Packit 6c4009
#define __NR_getgid	__NR_getxgid
Packit 6c4009
#define SYS_getpid	__NR_getxpid
Packit 6c4009
#define SYS_getuid	__NR_getxuid
Packit 6c4009
#define SYS_getgid	__NR_getxgid
Packit 6c4009
Packit 6c4009
/*
Packit 6c4009
 * Some syscalls no Linux program should know about:
Packit 6c4009
 */
Packit 6c4009
#define __NR_osf_sigprocmask	 48
Packit 6c4009
#define __NR_osf_shmat		209
Packit 6c4009
#define __NR_osf_getsysinfo	256
Packit 6c4009
#define __NR_osf_setsysinfo	257
Packit 6c4009
Packit 6c4009
/* Help old kernel headers where particular syscalls are not available.  */
Packit 6c4009
#ifndef __NR_semtimedop
Packit 6c4009
# define __NR_semtimedop	423
Packit 6c4009
#endif
Packit 6c4009
Packit 6c4009
/* This is a kludge to make syscalls.list find these under the names
Packit 6c4009
   pread and pwrite, since some kernel headers define those names
Packit 6c4009
   and some define the *64 names for the same system calls.  */
Packit 6c4009
#if !defined __NR_pread && defined __NR_pread64
Packit 6c4009
# define __NR_pread __NR_pread64
Packit 6c4009
#endif
Packit 6c4009
#if !defined __NR_pwrite && defined __NR_pwrite64
Packit 6c4009
# define __NR_pwrite __NR_pwrite64
Packit 6c4009
#endif
Packit 6c4009
Packit 6c4009
#define SINGLE_THREAD_BY_GLOBAL 1
Packit 6c4009
Packit 6c4009
/*
Packit 6c4009
 * In order to get the hidden arguments for rt_sigaction set up
Packit 6c4009
 * properly, we need to call the assembly version.  This shouldn't
Packit 6c4009
 * happen except for inside sigaction.c, where we handle this
Packit 6c4009
 * specially.  Catch other uses and error.
Packit 6c4009
 */
Packit 6c4009
Packit 6c4009
#undef INLINE_SYSCALL
Packit 6c4009
#define INLINE_SYSCALL(name, nr, args...)				\
Packit 6c4009
({									\
Packit 6c4009
	extern char ChEcK[__NR_##name == __NR_rt_sigaction ? -1 : 1]	\
Packit 6c4009
	  __attribute__((unused));					\
Packit 6c4009
	INLINE_SYSCALL1(name, nr, args);				\
Packit 6c4009
})
Packit 6c4009
Packit 6c4009
#undef INTERNAL_SYSCALL
Packit 6c4009
#define INTERNAL_SYSCALL(name, err_out, nr, args...)			\
Packit 6c4009
({									\
Packit 6c4009
	extern char ChEcK[__NR_##name == __NR_rt_sigaction ? -1 : 1]	\
Packit 6c4009
	  __attribute__((unused));					\
Packit 6c4009
	INTERNAL_SYSCALL1(name, err_out, nr, args);			\
Packit 6c4009
})
Packit 6c4009
Packit 6c4009
#endif /* _LINUX_ALPHA_SYSDEP_H */