stdlib: Fix stdbit.h with -Wconversion for clang
[glibc.git] / sysdeps / mach / x86 / sysdep.h
blob63be5638e8fcb17f3f3dc17a0d3f035d59fc752b
1 /* Copyright (C) 1991-2024 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.
5 The GNU C Library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
10 The GNU C Library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Lesser General Public License for more details.
15 You should have received a copy of the GNU Lesser General Public
16 License along with the GNU C Library; if not, see
17 <https://www.gnu.org/licenses/>. */
19 #ifndef _MACH_X86_SYSDEP_H
20 #define _MACH_X86_SYSDEP_H 1
22 /* Defines RTLD_PRIVATE_ERRNO and USE_DL_SYSINFO. */
23 #include <dl-sysdep.h>
24 #include <tls.h>
26 #define LOSE asm volatile ("hlt")
28 #define STACK_GROWTH_DOWN
30 /* Get the machine-independent Mach definitions. */
31 #include <sysdeps/mach/sysdep.h>
33 #undef ENTRY
34 #undef ALIGN
36 #ifdef __x86_64__
37 #define RETURN_TO(sp, pc, retval) \
38 asm volatile ("movq %0, %%rsp; jmp %*%1 # %2" \
39 : : "g" (sp), "r" (pc), "a" (retval))
40 /* This should be rearranged, but at the moment this file provides
41 the most useful definitions for assembler syntax details. */
42 #include <sysdeps/unix/x86_64/sysdep.h>
43 #else
44 #define RETURN_TO(sp, pc, retval) \
45 asm volatile ("movl %0, %%esp; jmp %*%1 # %2" \
46 : : "g" (sp), "r" (pc), "a" (retval))
47 #include <sysdeps/unix/i386/sysdep.h>
48 #endif
50 #endif /* mach/x86/sysdep.h */