Define F_DUPFD_CLOEXEC.
[glibc-ports.git] / sysdeps / mach / mips / sysdep.h
blob8136f95bf2fbf39675470b2ec315626282d17816
1 /* Copyright (C) 1996, 1997 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 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.
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 Lesser General Public License for more details.
14 You should have received a copy of the GNU Lesser General Public
15 License along with the GNU C Library; if not, write to the Free
16 Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
17 02111-1307 USA. */
19 #define LOSE asm volatile ("1: b 1b")
21 #define START_MACHDEP asm ("\
22 .text\n\
23 .globl _start\n\
24 .ent _start\n\
25 _start:\n\
26 # Put initial SP in a0.\n\
27 move $4, $29\n\
28 # Jump to _start0; don't return.\n\
29 j _start0\n\
30 .end _start\n\
31 ");
32 #define START_ARGS int *entry_sp
33 #define SNARF_ARGS(argc, argv, envp) \
34 do \
35 { \
36 register char **p; \
38 argc = *entry_sp; \
39 argv = (char **) (entry_sp + 1); \
40 p = argv; \
41 while (*p++ != NULL) \
42 ; \
43 if (p >= (char **) argv[0]) \
44 --p; \
45 envp = p; \
46 } while (0)
48 #define CALL_WITH_SP(fn, sp) \
49 ({ register int __fn = fn, __sp = (int) sp; \
50 asm volatile ("move $sp,%0; j %1" : : "r" (__sp), "r" (__fn));})
52 #define RETURN_TO(sp, pc, retval) \
53 asm volatile ("move $29, %0; move $2, %2; move $25, %1; jr $25" \
54 : : "r" (sp), "r" (pc), "r" (retval))
56 #define STACK_GROWTH_DOWN
58 #include <syscall.h>
60 #if defined (__ASSEMBLER__)
62 #define ALIGN 2
64 #define MOVE(x,y) move y , x
66 #define SYSCALL(name, args) \
67 .globl syscall_error; \
68 kernel_trap(name,SYS_##name,args); \
69 beq $1,$0,1f; \
70 j syscall_error; \
73 #define SYSCALL__(name, args) \
74 .globl syscall_error; \
75 kernel_trap(__##name,SYS_##name,args); \
76 beq $1,$0,1f; \
77 j syscall_error; \
80 #define ret j ra; nop
81 #endif
83 #include <sysdeps/mach/sysdep.h>