]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Rename sys/ucontext.h to bits/ucontext.h. zack/no-nested-includes
authorZack Weinberg <zackw@panix.com>
Tue, 11 Jun 2019 17:05:02 +0000 (13:05 -0400)
committerZack Weinberg <zackw@panix.com>
Wed, 8 Jan 2020 19:17:46 +0000 (14:17 -0500)
sys/ucontext.h is effectively a bits header.  Its contents are
extremely system-specific, and it’s strongly associated with a
specific public header (ucontext.h) that provides a superset of its
definitions, but there are other public headers that also require some
of its definitions.  This patch therefore moves it into the bits/
namespace and adjusts all the headers that refer to it.  In case there
are external users, a stub is added that includes ucontext.h.

Most of the fallout changes are trivial, but aarch64, ia64 and riscv
need a little more work.  aarch64 sys/ucontext.h (now bits/ucontext.h)
was including sys/procfs.h for the definition of elf_greg_t etc;
the simplest fix is to have it include bits/procfs.h instead (and then
that needs to include sys/user.h for user_regs_struct).  This is not
ideal but fixing it properly would require disentangling all of the
debugger interface headers which is more than I’m up for at the moment.

ia64 bits/ptrace.h and bits/procfs.h were both including
bits/sigcontext.h, which is only licensed to be included from
signal.h.  (I’m not sure how this ever worked, or why it broke with
this patch and not some previous one.)  This is fixed by creating
another single-type header, bits/types/__ia64_fpreg.h, which provides
the only thing they need from bits/sigcontext.h.

s/u/s/l/riscv/makecontext.c was defining makecontext with a function
head that didn’t agree with its official prototype (in ucontext.h);
formerly that file did not include ucontext.h, only sys/ucontext.h,
so we were getting away with it, but it’s still wrong.  Making the
function head match the prototype actually simplifies the code.

* sysdeps/generic/sys/ucontext.h: Move to top level bits/ucontext.h.
Adjust multiple inclusion guard.
* sysdeps/arm/sys/ucontext.h: Move to sysdeps/arm/bits/ucontext.h.
Adjust multiple inclusion guard.
* sysdeps/i386/sys/ucontext.h: Similarly.
* sysdeps/m68k/sys/ucontext.h: Similarly.
* sysdeps/mips/sys/ucontext.h: Similarly.
* sysdeps/unix/sysv/linux/aarch64/sys/ucontext.h: Similarly.
* sysdeps/unix/sysv/linux/alpha/sys/ucontext.h: Similarly.
* sysdeps/unix/sysv/linux/arm/sys/ucontext.h: Similarly.
* sysdeps/unix/sysv/linux/csky/sys/ucontext.h: Similarly.
* sysdeps/unix/sysv/linux/hppa/sys/ucontext.h: Similarly.
* sysdeps/unix/sysv/linux/ia64/sys/ucontext.h: Similarly.
* sysdeps/unix/sysv/linux/m68k/sys/ucontext.h: Similarly.
* sysdeps/unix/sysv/linux/microblaze/sys/ucontext.h: Similarly.
* sysdeps/unix/sysv/linux/mips/sys/ucontext.h: Similarly.
* sysdeps/unix/sysv/linux/nios2/sys/ucontext.h: Similarly.
* sysdeps/unix/sysv/linux/powerpc/sys/ucontext.h: Similarly.
* sysdeps/unix/sysv/linux/riscv/sys/ucontext.h: Similarly.
* sysdeps/unix/sysv/linux/s390/sys/ucontext.h: Similarly.
* sysdeps/unix/sysv/linux/sh/sys/ucontext.h: Similarly.
* sysdeps/unix/sysv/linux/sparc/sys/ucontext.h: Similarly.
* sysdeps/unix/sysv/linux/x86/sys/ucontext.h: Similarly.
* stdlib/Makefile: Install bits/ucontext.h.

* stdlib/sys/ucontext.h: New backward compatibility stub header,
includes ucontext.h.
* include/sys/ucontext.h: New wrapper.

* sysdeps/unix/sysv/linux/aarch64/bits/procfs.h: Allow inclusion
by bits/ucontext.h as well as sys/procfs.h.  Include sys/user.h.
* sysdeps/unix/sysv/linux/aarch64/bits/ucontext.h: Include
bits/procfs.h instead of sys/procfs.h.

* sysdeps/unix/sysv/linux/ia64/bits/types/__ia64_fpreg.h:
New file, contents factored out of ia64/bits/sigcontext.h and
ia64/bits/ucontext.h.
* sysdeps/unix/sysv/linux/ia64/Makefile:
Install bits/types/__ia64_fpreg.h.  Merge subdir=misc blocks.
* sysdeps/unix/sysv/linux/ia64/bits/sigcontext.h
* sysdeps/unix/sysv/linux/ia64/bits/ucontext.h:
Include bits/types/__ia64_fpreg.h for struct ia64_fpreg.

* sysdeps/unix/sysv/linux/ia64/bits/procfs.h:
Include bits/types/__ia64_fpreg.h for struct ia64_fpreg.
Don’t include bits/sigcontext.h or bits/ucontext.h.
* sysdeps/unix/sysv/linux/ia64/sys/ptrace.h:
Don’t include bits/sigcontext.h.

* sysdeps/unix/sysv/linux/riscv/makecontext.c: Include
ucontext.h, not sys/ucontext.h. Correct function head to match
prototype in ucontext.h.  Use va_arg to retrieve all arguments
past argc.

* sysdeps/unix/sysv/linux/s390/tst-ptrace-singleblock.c:
Sort list of includes.

* signal/signal.h, stdlib/ucontext.h
* sysdeps/unix/sysv/linux/alpha/bits/procfs-prregset.h
* sysdeps/unix/sysv/linux/ia64/sys/ptrace.h
* sysdeps/unix/sysv/linux/riscv/bits/procfs.h
* sysdeps/unix/sysv/linux/s390/bits/procfs.h:
Include bits/ucontext.h, not sys/ucontext.h.

* sysdeps/unix/sysv/linux/aarch64/sigcontextinfo.h
* sysdeps/unix/sysv/linux/arm/sigcontextinfo.h
* sysdeps/unix/sysv/linux/nios2/sigcontextinfo.h
* sysdeps/unix/sysv/linux/riscv/sigcontextinfo.h:
Include signal.h, not sys/ucontext.h.

* sysdeps/unix/sysv/linux/arm/register-dump.h
* sysdeps/unix/sysv/linux/csky/register-dump.h:
Include ucontext.h, not sys/ucontext.h.

* sysdeps/unix/sysv/linux/aarch64/ucontext_i.sym
* sysdeps/unix/sysv/linux/alpha/ucontext-offsets.sym
* sysdeps/unix/sysv/linux/arm/ucontext_i.sym
* sysdeps/unix/sysv/linux/csky/abiv2/ucontext_i.sym
* sysdeps/unix/sysv/linux/hppa/ucontext_i.sym
* sysdeps/unix/sysv/linux/i386/ucontext_i.sym
* sysdeps/unix/sysv/linux/ia64/sigcontext-offsets.sym
* sysdeps/unix/sysv/linux/m68k/m680x0/ucontext_i.sym
* sysdeps/unix/sysv/linux/powerpc/powerpc32/ucontext_i.sym
* sysdeps/unix/sysv/linux/powerpc/powerpc64/ucontext_i.sym
* sysdeps/unix/sysv/linux/mips/ucontext_i.sym
* sysdeps/unix/sysv/linux/nios2/ucontext_i.sym
* sysdeps/unix/sysv/linux/riscv/ucontext_i.sym
* sysdeps/unix/sysv/linux/s390/ucontext_i.sym
* sysdeps/unix/sysv/linux/sh/sh3/ucontext_i.sym
* sysdeps/unix/sysv/linux/sh/sh4/ucontext_i.sym
* sysdeps/unix/sysv/linux/sparc/sparc32/ucontext_i.sym
* sysdeps/unix/sysv/linux/x86_64/ucontext_i.sym:
Include stddef.h and signal.h; don’t include any other headers.

* scripts/check-obsolete-constructs.py (HEADER_ALLOWED_INCLUDES)
(SYSDEP_ALLOWED_INCLUDES): Update.

60 files changed:
bits/ucontext.h [moved from sysdeps/generic/sys/ucontext.h with 95% similarity]
include/sys/ucontext.h [new file with mode: 0644]
scripts/check-obsolete-constructs.py
signal/signal.h
stdlib/Makefile
stdlib/sys/ucontext.h [new file with mode: 0644]
stdlib/ucontext.h
sysdeps/arm/bits/ucontext.h [moved from sysdeps/arm/sys/ucontext.h with 96% similarity]
sysdeps/i386/bits/ucontext.h [moved from sysdeps/i386/sys/ucontext.h with 97% similarity]
sysdeps/m68k/bits/ucontext.h [moved from sysdeps/m68k/sys/ucontext.h with 96% similarity]
sysdeps/mips/bits/ucontext.h [moved from sysdeps/mips/sys/ucontext.h with 97% similarity]
sysdeps/unix/sysv/linux/aarch64/bits/procfs.h
sysdeps/unix/sysv/linux/aarch64/bits/ucontext.h [moved from sysdeps/unix/sysv/linux/aarch64/sys/ucontext.h with 95% similarity]
sysdeps/unix/sysv/linux/aarch64/sigcontextinfo.h
sysdeps/unix/sysv/linux/aarch64/ucontext_i.sym
sysdeps/unix/sysv/linux/alpha/bits/procfs-prregset.h
sysdeps/unix/sysv/linux/alpha/bits/ucontext.h [moved from sysdeps/unix/sysv/linux/alpha/sys/ucontext.h with 96% similarity]
sysdeps/unix/sysv/linux/alpha/ucontext-offsets.sym
sysdeps/unix/sysv/linux/arm/bits/ucontext.h [moved from sysdeps/unix/sysv/linux/arm/sys/ucontext.h with 97% similarity]
sysdeps/unix/sysv/linux/arm/register-dump.h
sysdeps/unix/sysv/linux/arm/ucontext_i.sym
sysdeps/unix/sysv/linux/csky/abiv2/ucontext_i.sym
sysdeps/unix/sysv/linux/csky/bits/ucontext.h [moved from sysdeps/unix/sysv/linux/csky/sys/ucontext.h with 96% similarity]
sysdeps/unix/sysv/linux/csky/register-dump.h
sysdeps/unix/sysv/linux/hppa/bits/ucontext.h [moved from sysdeps/unix/sysv/linux/hppa/sys/ucontext.h with 96% similarity]
sysdeps/unix/sysv/linux/hppa/ucontext_i.sym
sysdeps/unix/sysv/linux/i386/ucontext_i.sym
sysdeps/unix/sysv/linux/ia64/Makefile
sysdeps/unix/sysv/linux/ia64/bits/procfs.h
sysdeps/unix/sysv/linux/ia64/bits/sigcontext.h
sysdeps/unix/sysv/linux/ia64/bits/types/__ia64_fpreg.h [new file with mode: 0644]
sysdeps/unix/sysv/linux/ia64/bits/ucontext.h [moved from sysdeps/unix/sysv/linux/ia64/sys/ucontext.h with 91% similarity]
sysdeps/unix/sysv/linux/ia64/sigcontext-offsets.sym
sysdeps/unix/sysv/linux/ia64/sys/ptrace.h
sysdeps/unix/sysv/linux/m68k/bits/ucontext.h [moved from sysdeps/unix/sysv/linux/m68k/sys/ucontext.h with 97% similarity]
sysdeps/unix/sysv/linux/m68k/m680x0/ucontext_i.sym
sysdeps/unix/sysv/linux/microblaze/bits/ucontext.h [moved from sysdeps/unix/sysv/linux/microblaze/sys/ucontext.h with 96% similarity]
sysdeps/unix/sysv/linux/mips/bits/ucontext.h [moved from sysdeps/unix/sysv/linux/mips/sys/ucontext.h with 97% similarity]
sysdeps/unix/sysv/linux/mips/ucontext_i.sym
sysdeps/unix/sysv/linux/nios2/bits/ucontext.h [moved from sysdeps/unix/sysv/linux/nios2/sys/ucontext.h with 95% similarity]
sysdeps/unix/sysv/linux/nios2/ucontext_i.sym
sysdeps/unix/sysv/linux/powerpc/bits/ucontext.h [moved from sysdeps/unix/sysv/linux/powerpc/sys/ucontext.h with 98% similarity]
sysdeps/unix/sysv/linux/powerpc/powerpc32/ucontext_i.sym
sysdeps/unix/sysv/linux/powerpc/powerpc64/ucontext_i.sym
sysdeps/unix/sysv/linux/riscv/bits/procfs.h
sysdeps/unix/sysv/linux/riscv/bits/ucontext.h [moved from sysdeps/unix/sysv/linux/riscv/sys/ucontext.h with 97% similarity]
sysdeps/unix/sysv/linux/riscv/makecontext.c
sysdeps/unix/sysv/linux/riscv/sigcontextinfo.h
sysdeps/unix/sysv/linux/riscv/ucontext_i.sym
sysdeps/unix/sysv/linux/s390/bits/procfs.h
sysdeps/unix/sysv/linux/s390/bits/ucontext.h [moved from sysdeps/unix/sysv/linux/s390/sys/ucontext.h with 96% similarity]
sysdeps/unix/sysv/linux/s390/tst-ptrace-singleblock.c
sysdeps/unix/sysv/linux/s390/ucontext_i.sym
sysdeps/unix/sysv/linux/sh/bits/ucontext.h [moved from sysdeps/unix/sysv/linux/sh/sys/ucontext.h with 97% similarity]
sysdeps/unix/sysv/linux/sh/sh3/ucontext_i.sym
sysdeps/unix/sysv/linux/sh/sh4/ucontext_i.sym
sysdeps/unix/sysv/linux/sparc/bits/ucontext.h [moved from sysdeps/unix/sysv/linux/sparc/sys/ucontext.h with 99% similarity]
sysdeps/unix/sysv/linux/sparc/sparc32/ucontext_i.sym
sysdeps/unix/sysv/linux/x86/bits/ucontext.h [moved from sysdeps/unix/sysv/linux/x86/sys/ucontext.h with 98% similarity]
sysdeps/unix/sysv/linux/x86_64/ucontext_i.sym

similarity index 95%
rename from sysdeps/generic/sys/ucontext.h
rename to bits/ucontext.h
index 5d042b8cf880c4e8dfafe686447d40e8a98571d6..ee2cff76092dff275c85b95becd61c1b305fa4c7 100644 (file)
@@ -21,8 +21,8 @@
    use of struct sigcontext does not conform to POSIX namespace
    requirements.  */
 
-#ifndef _SYS_UCONTEXT_H
-#define _SYS_UCONTEXT_H        1
+#ifndef _BITS_UCONTEXT_H
+#define _BITS_UCONTEXT_H       1
 
 #include <features.h>
 
@@ -51,4 +51,4 @@ typedef struct ucontext_t
 
 #undef __ctx
 
-#endif /* sys/ucontext.h */
+#endif /* bits/ucontext.h */
diff --git a/include/sys/ucontext.h b/include/sys/ucontext.h
new file mode 100644 (file)
index 0000000..1450bae
--- /dev/null
@@ -0,0 +1 @@
+#include <stdlib/sys/ucontext.h>
index c6ce674a5a2a3020297371159668e58b7e58ca2c..65dc98fea8964c0ec5eb7209f6fcad247ef96c71 100755 (executable)
@@ -504,24 +504,25 @@ HEADER_ALLOWED_INCLUDES = {
     #           tgmath.h   -> complex.h, math.h
     #           threads.h  -> time.h
     "inttypes.h":                  [ "stdint.h" ],
-    "signal.h":                    [ "sys/ucontext.h" ],
-    "stdlib.h":                    [ "alloca.h", "sys/types.h" ],
     "tgmath.h":                    [ "complex.h", "math.h" ],
     "threads.h":                   [ "time.h" ],
+    # necessary for backward compatibility with old GNU extensions
+    "stdlib.h":                    [ "alloca.h", "sys/types.h" ],
 
     # POSIX top-level headers
     # mandated: pthread.h -> sched.h, time.h
+    "pthread.h":                   [ "sched.h", "time.h" ],
     # allowed:  ftw.h -> sys/stat.h
     #           mqueue.h -> fcntl.h
     #           sched.h -> time.h
     #           spawn.h -> sched.h
     "ftw.h":                       [ "sys/stat.h" ],
-    "langinfo.h":                  [ "nl_types.h" ],
     "mqueue.h":                    [ "fcntl.h" ],
-    "pthread.h":                   [ "sched.h", "time.h" ],
-    "regex.h":                     [ "limits.h", "sys/types.h" ],
     "sched.h":                     [ "time.h" ],
     "spawn.h":                     [ "sched.h" ],
+    # not yet analyzed
+    "langinfo.h":                  [ "nl_types.h" ],
+    "regex.h":                     [ "limits.h", "sys/types.h" ],
     "termios.h":                   [ "sys/ttydefaults.h" ],
     "utmpx.h":                     [ "paths.h" ],
 
@@ -562,7 +563,6 @@ HEADER_ALLOWED_INCLUDES = {
     "shadow.h":                    [ "paths.h" ],
     "stdio_ext.h":                 [ "stdio.h" ],
     "thread_db.h":                 [ "pthread.h", "stdint.h", "sys/procfs.h" ],
-    "ucontext.h":                  [ "sys/ucontext.h" ],
     "utmp.h":                      [ "paths.h" ],
     "values.h":                    [ "float.h", "limits.h" ],
 
@@ -574,12 +574,10 @@ HEADER_ALLOWED_INCLUDES = {
     "sys/mount.h":                 [ "sys/ioctl.h" ],
     "sys/mtio.h":                  [ "sys/ioctl.h" ],
     "sys/param.h":                 [ "endian.h", "limits.h", "sys/types.h" ],
-    "sys/procfs.h":                [ "sys/ucontext.h", "sys/user.h" ],
-    "sys/ptrace.h":                [ "sys/ucontext.h" ],
+    "sys/procfs.h":                [ "sys/user.h" ],
     "sys/raw.h":                   [ "sys/ioctl.h" ],
     "sys/timerfd.h":               [ "time.h" ],
     "sys/ttychars.h":              [ "sys/ttydefaults.h" ],
-    "sys/ucontext.h":              [ "sys/procfs.h" ],
     "sys/vfs.h":                   [ "sys/statfs.h" ],
 
     # Nonstandardized headers that do nothing but include some other
@@ -597,6 +595,7 @@ HEADER_ALLOWED_INCLUDES = {
     "sys/socketvar.h":             [ "sys/socket.h" ],
     "sys/syslog.h":                [ "syslog.h" ],
     "sys/termios.h":               [ "termios.h" ],
+    "sys/ucontext.h":              [ "ucontext.h" ],
     "sys/unistd.h":                [ "unistd.h" ],
     "syscall.h":                   [ "sys/syscall.h" ],
     "termio.h":                    [ "sys/ioctl.h", "termios.h" ],
@@ -623,8 +622,6 @@ HEADER_ALLOWED_INCLUDES = {
     "features.h":                  [ "gnu/stubs.h", "stdc-predef.h",
                                      "sys/cdefs.h" ],
 
-    "bits/procfs.h":               [ "signal.h", "sys/ucontext.h" ],
-
     "bits/types/__va_list.h":      [ "stdarg.h" ],
     "bits/types/ptrdiff_t.h":      [ "stddef.h" ],
     "bits/types/size_t.h":         [ "stddef.h" ],
@@ -670,8 +667,8 @@ SYSDEP_ALLOWED_INCLUDES = {
         "bits/ioctls.h":           [ "asm/ioctls.h", "linux/sockios.h" ],
         "bits/local_lim.h":        [ "linux/limits.h" ],
         "bits/param.h":            [ "linux/limits.h", "linux/param.h" ],
-        "bits/procfs.h":           [ "asm/elf.h", "asm/ptrace.h" ],
-        "bits/procfs-prregset.h":  [ "sys/ucontext.h" ],
+        "bits/procfs.h":           [ "asm/elf.h", "asm/ptrace.h",
+                                     "sys/user.h" ],
         "bits/sigcontext.h":       [ "asm/sigcontext.h" ],
         "bits/socket.h":           [ "asm/socket.h" ],
     },
@@ -689,7 +686,6 @@ SYSDEP_ALLOWED_INCLUDES = {
         "sys/fpregdef.h":          [ "sgidefs.h" ],
         "sys/regdef.h":            [ "sgidefs.h" ],
         "sys/tas.h":               [ "sgidefs.h" ],
-        "sys/ucontext.h":          [ "sgidefs.h" ],
         "sys/user.h":              [ "sgidefs.h" ],
 
         "bits/fcntl.h":            [ "sgidefs.h" ],
@@ -699,6 +695,7 @@ SYSDEP_ALLOWED_INCLUDES = {
         "bits/setjmp.h":           [ "sgidefs.h" ],
         "bits/sigcontext.h":       [ "sgidefs.h" ],
         "bits/stat.h":             [ "sgidefs.h" ],
+        "bits/ucontext.h":         [ "sgidefs.h" ],
         "bits/wordsize.h":         [ "sgidefs.h" ],
     },
 }
index ae40b903914e8db37a17acf50d98ea3b06a5c62e..a6dd2800f7e1a5924bf079b6dc151f14dd2aa8be 100644 (file)
@@ -293,7 +293,7 @@ extern int sigreturn (struct sigcontext *__scp) __THROW;
 # include <bits/types/stack_t.h>
 # if defined __USE_XOPEN || defined __USE_XOPEN2K8
 /* This will define `ucontext_t' and `mcontext_t'.  */
-#  include <sys/ucontext.h>
+#  include <bits/ucontext.h>
 # endif
 #endif /* Use POSIX.1-2008 or X/Open Unix.  */
 
index 6f8e6ba31d26ed29a297e426422948ba6f249cd7..f5ea81f0e8410fff829eeaf562391ec5fa3ac5a6 100644 (file)
@@ -26,7 +26,7 @@ headers       := stdlib.h bits/stdlib.h bits/stdlib-ldbl.h bits/stdlib-float.h      \
           monetary.h bits/monetary-ldbl.h                                    \
           inttypes.h stdint.h bits/wordsize.h bits/timesize.h                \
           errno.h sys/errno.h bits/errno.h bits/types/error_t.h              \
-          ucontext.h sys/ucontext.h bits/indirect-return.h                   \
+          ucontext.h sys/ucontext.h bits/ucontext.h bits/indirect-return.h   \
           alloca.h fmtmsg.h                                                  \
           bits/stdlib-bsearch.h sys/random.h bits/stdint-intn.h              \
           bits/stdint-uintn.h bits/time64.h bits/NULL.h                      \
diff --git a/stdlib/sys/ucontext.h b/stdlib/sys/ucontext.h
new file mode 100644 (file)
index 0000000..5fdbd63
--- /dev/null
@@ -0,0 +1 @@
+#include <ucontext.h>
index b38d0190764c5d00cfca3dc9772f5ff83c55ffd3..0230a7577402455025526f0d7bc670a7d1ee2ef2 100644 (file)
@@ -26,7 +26,7 @@
 #include <bits/indirect-return.h>
 
 /* Get machine dependent definition of data structures.  */
-#include <sys/ucontext.h>
+#include <bits/ucontext.h>
 
 __BEGIN_DECLS
 
similarity index 96%
rename from sysdeps/arm/sys/ucontext.h
rename to sysdeps/arm/bits/ucontext.h
index d082693e7768dbc11cc77b6e092d37d6bbd1c56c..236924384c21cf8692e2c7c6caec864c11b1dd93 100644 (file)
@@ -17,8 +17,8 @@
 
 /* System V/ARM ABI compliant context switching support.  */
 
-#ifndef _SYS_UCONTEXT_H
-#define _SYS_UCONTEXT_H        1
+#ifndef _BITS_UCONTEXT_H
+#define _BITS_UCONTEXT_H       1
 
 #include <features.h>
 
@@ -107,4 +107,4 @@ typedef struct ucontext_t
 
 #undef __ctx
 
-#endif /* sys/ucontext.h */
+#endif /* bits/ucontext.h */
similarity index 97%
rename from sysdeps/i386/sys/ucontext.h
rename to sysdeps/i386/bits/ucontext.h
index ee98042325fc548549f0689baa56db71e9410dfc..721878134c7b439aa4a412e64533427ed9e8c387 100644 (file)
@@ -17,8 +17,8 @@
 
 /* System V/i386 ABI compliant context switching support.  */
 
-#ifndef _SYS_UCONTEXT_H
-#define _SYS_UCONTEXT_H        1
+#ifndef _BITS_UCONTEXT_H
+#define _BITS_UCONTEXT_H       1
 
 #include <features.h>
 
@@ -135,4 +135,4 @@ typedef struct ucontext_t
 #undef __ctx
 #undef __ctxt
 
-#endif /* sys/ucontext.h */
+#endif /* bits/ucontext.h */
similarity index 96%
rename from sysdeps/m68k/sys/ucontext.h
rename to sysdeps/m68k/bits/ucontext.h
index 48277ab823bf6d43c3b725fa3d133c3a376bbf42..6cf1e3647df6f84fe203961ae9419ce3ddf478d3 100644 (file)
@@ -17,8 +17,8 @@
 
 /* System V/m68k ABI compliant context switching support.  */
 
-#ifndef _SYS_UCONTEXT_H
-#define _SYS_UCONTEXT_H        1
+#ifndef _BITS_UCONTEXT_H
+#define _BITS_UCONTEXT_H       1
 
 #include <features.h>
 
@@ -122,4 +122,4 @@ typedef struct ucontext_t
 
 #undef __ctx
 
-#endif /* sys/ucontext.h */
+#endif /* bits/ucontext.h */
similarity index 97%
rename from sysdeps/mips/sys/ucontext.h
rename to sysdeps/mips/bits/ucontext.h
index cdb3e8b3befa502980432f16fcce5716c3846398..2452926915a2c372804086e105e2c405d6fe52c2 100644 (file)
@@ -17,8 +17,8 @@
 
 /* System V/mips ABI compliant context switching support.  */
 
-#ifndef _SYS_UCONTEXT_H
-#define _SYS_UCONTEXT_H        1
+#ifndef _BITS_UCONTEXT_H
+#define _BITS_UCONTEXT_H       1
 
 #include <features.h>
 
@@ -173,4 +173,4 @@ typedef struct ucontext_t
 
 #undef __ctx
 
-#endif /* sys/ucontext.h */
+#endif /* bits/ucontext.h */
index 51571cddaaebc18dbeb8460f0e7524eaaf3bdea8..a30263d82629fa07344c1080a7e3f88f223dd8b3 100644 (file)
 #ifndef _BITS_PROCFS_H
 #define _BITS_PROCFS_H 1
 
-#ifndef _SYS_PROCFS_H
+#if !defined _SYS_PROCFS_H && !defined _BITS_UCONTEXT_H
 # error "Never include <bits/procfs.h> directly; use <sys/procfs.h> instead."
 #endif
 
 #include <bits/types.h>
+#include <sys/user.h>
 
 /* Type for a general-purpose register.  */
 typedef __uint64_t elf_greg_t;
similarity index 95%
rename from sysdeps/unix/sysv/linux/aarch64/sys/ucontext.h
rename to sysdeps/unix/sysv/linux/aarch64/bits/ucontext.h
index 5699c0caf98a0b3dd52d857795459fb2338b9471..b790a6c08507c82cca93886be9f8a5205064ba34 100644 (file)
@@ -18,8 +18,8 @@
 
 /* System V/AArch64 ABI compliant context switching support.  */
 
-#ifndef _SYS_UCONTEXT_H
-#define _SYS_UCONTEXT_H        1
+#ifndef _BITS_UCONTEXT_H
+#define _BITS_UCONTEXT_H       1
 
 #include <features.h>
 
@@ -33,7 +33,7 @@
 #endif
 
 #ifdef __USE_MISC
-# include <sys/procfs.h>
+# include <bits/procfs.h>
 
 
 typedef elf_greg_t greg_t;
@@ -75,4 +75,4 @@ typedef struct ucontext_t
 
 #undef __ctx
 
-#endif /* sys/ucontext.h */
+#endif /* bits/ucontext.h */
index 6af928fc2218664a97b2e67b1444c98e5f886419..52c3fd6d318a36e92dd2c0e2f0caa0cbcd9c03a8 100644 (file)
@@ -20,7 +20,7 @@
 #define _SIGCONTEXTINFO_H
 
 #include <stdint.h>
-#include <sys/ucontext.h>
+#include <signal.h>
 
 static inline uintptr_t
 sigcontext_get_pc (const ucontext_t *ctx)
index ab3930c173c87c620447d1578f21322ea9fc11b8..7d5c4a1117a7e3479056c3f37d51760b8ddd8cba 100644 (file)
@@ -1,8 +1,5 @@
-#include <inttypes.h>
-#include <signal.h>
 #include <stddef.h>
-#include <sys/ucontext.h>
-#include <asm/sigcontext.h>
+#include <signal.h>
 
 #include "kernel_rt_sigframe.h"
 
index cc748653774d8728933d07d0ff0921c8fc950dad..f62df7dadfe87cb6566a95950ce1628242eef6da 100644 (file)
@@ -25,8 +25,8 @@
 #endif
 
 /* For gregset_t and fpregset_t.  FIXME: sys/procfs.h should not
-   expose all of sys/ucontext.h.  */
-#include <sys/ucontext.h>
+   expose all of bits/ucontext.h.  */
+#include <bits/ucontext.h>
 
 typedef gregset_t __prgregset_t;
 typedef fpregset_t __prfpregset_t;
similarity index 96%
rename from sysdeps/unix/sysv/linux/alpha/sys/ucontext.h
rename to sysdeps/unix/sysv/linux/alpha/bits/ucontext.h
index c997cb03d306762dd22ba3a3866a923a6da77489..12b23f01defaccb7b6a85202772c862d65bae7cc 100644 (file)
@@ -15,8 +15,8 @@
    License along with the GNU C Library.  If not, see
    <https://www.gnu.org/licenses/>.  */
 
-#ifndef _SYS_UCONTEXT_H
-#define _SYS_UCONTEXT_H        1
+#ifndef _BITS_UCONTEXT_H
+#define _BITS_UCONTEXT_H       1
 
 #include <features.h>
 
@@ -91,4 +91,4 @@ typedef struct ucontext_t
 
 #undef __ctx
 
-#endif /* sys/ucontext.h */
+#endif /* bits/ucontext.h */
index 9e86f8a7ca66ba87d3098d48c52e8ae2f674e0db..f57c779f5be8a4f9c10b611308aa495d65c8c3b6 100644 (file)
@@ -1,5 +1,5 @@
 #include <stddef.h>
-#include <sys/ucontext.h>
+#include <signal.h>
 
 --
 UC_LINK                offsetof (ucontext_t, uc_link)
similarity index 97%
rename from sysdeps/unix/sysv/linux/arm/sys/ucontext.h
rename to sysdeps/unix/sysv/linux/arm/bits/ucontext.h
index d6934affebd5e262bea6dd8bd25e7213fa5448ca..81371ca4d0de4fc286f9986236f0ab8c4bce985d 100644 (file)
@@ -17,8 +17,8 @@
 
 /* System V/ARM ABI compliant context switching support.  */
 
-#ifndef _SYS_UCONTEXT_H
-#define _SYS_UCONTEXT_H        1
+#ifndef _BITS_UCONTEXT_H
+#define _BITS_UCONTEXT_H       1
 
 #include <features.h>
 
@@ -141,4 +141,4 @@ typedef struct ucontext_t
 
 #undef __ctx
 
-#endif /* sys/ucontext.h */
+#endif /* bits/ucontext.h */
index 26c6e57982150a8c794ce249277773cd1c4acc15..11e5be7e0b5e906586bdd378186edb74e3b09873 100644 (file)
@@ -19,7 +19,7 @@
 
 #include <sys/uio.h>
 #include <_itoa.h>
-#include <sys/ucontext.h>
+#include <ucontext.h>
 
 /* We will print the register dump in this format:
 
index 306292f1f821d5dc4897c7f5ad57ca0b8e8b6de9..ccf555d2abcf0b909d0ef82039ffed4222951051 100644 (file)
@@ -1,7 +1,5 @@
-#include <inttypes.h>
-#include <signal.h>
 #include <stddef.h>
-#include <sys/ucontext.h>
+#include <signal.h>
 
 SIG_BLOCK
 SIG_SETMASK
index 4581b65e49bd9835810104c9b426b5923f8461f5..0ee6dd05842fbcc96980241008891c68d5f8c1fd 100644 (file)
@@ -1,7 +1,5 @@
-#include <inttypes.h>
-#include <signal.h>
 #include <stddef.h>
-#include <sys/ucontext.h>
+#include <signal.h>
 
 SIG_BLOCK
 SIG_SETMASK
similarity index 96%
rename from sysdeps/unix/sysv/linux/csky/sys/ucontext.h
rename to sysdeps/unix/sysv/linux/csky/bits/ucontext.h
index 7f932aac0e83ae4754a4c962159350ae9e2a3672..cf3b0bfcfcbcb5194c772f86903d924dc313fe51 100644 (file)
@@ -16,8 +16,8 @@
    License along with the GNU C Library.  If not, see
    <https://www.gnu.org/licenses/>.  */
 
-#ifndef _SYS_UCONTEXT_H
-#define _SYS_UCONTEXT_H        1
+#ifndef _BITS_UCONTEXT_H
+#define _BITS_UCONTEXT_H       1
 
 #include <features.h>
 
@@ -86,4 +86,4 @@ typedef struct ucontext_t
 #undef __ctx
 
 
-#endif /* sys/ucontext.h */
+#endif /* bits/ucontext.h */
index f81ed095311e046c95492ac9b1c09a8dfa4b3487..a4cc5d48f65391647e2d08dfca03c701985664d3 100644 (file)
@@ -19,7 +19,7 @@
 #include <sys/uio.h>
 #include <_itoa.h>
 #include <bits/sigcontext.h>
-#include <sys/ucontext.h>
+#include <ucontext.h>
 
 /* abiv1 register dump in this format:
 
similarity index 96%
rename from sysdeps/unix/sysv/linux/hppa/sys/ucontext.h
rename to sysdeps/unix/sysv/linux/hppa/bits/ucontext.h
index 4fdd9e29ca946631bf65d0481060ae7a46c7beac..1d65187dbbc58b34fe67b67188f0b4e077dbe67a 100644 (file)
@@ -17,8 +17,8 @@
 
 /* Don't rely on this, the interface is currently messed up and may need to
    be broken to be fixed.  */
-#ifndef _SYS_UCONTEXT_H
-#define _SYS_UCONTEXT_H        1
+#ifndef _BITS_UCONTEXT_H
+#define _BITS_UCONTEXT_H       1
 
 #include <features.h>
 
@@ -79,4 +79,4 @@ typedef struct ucontext_t
 
 #undef __ctx
 
-#endif /* sys/ucontext.h */
+#endif /* bits/ucontext.h */
index ee33029a07ace7ec2018c5a5fc6dc9257c0d7f70..1ec474c75903f3c27739df9767a6c13a6474fa0a 100644 (file)
@@ -1,6 +1,5 @@
 #include <stddef.h>
 #include <signal.h>
-#include <sys/ucontext.h>
 
 --
 
index b11a5509cd469b320b4c92bdcb429b6e2470c756..79d95709f29c5d4bc7cdf03829b8e7e769c445c9 100644 (file)
@@ -1,6 +1,5 @@
 #include <stddef.h>
 #include <signal.h>
-#include <sys/ucontext.h>
 
 --
 
index 97fc7df0b122d6a020582d429ba073a4cdf75ad8..36240a6057626cbc73a01458798950f5c4823052 100644 (file)
@@ -1,5 +1,5 @@
-ifeq ($(subdir),misc)
-sysdep_headers += sys/rse.h
+ifeq ($(subdir),signal)
+sysdep_headers += bits/types/__ia64_fpreg.h
 endif
 
 ifeq ($(subdir),stdlib)
@@ -8,7 +8,7 @@ gen-as-const-headers += sigcontext-offsets.sym
 endif
 
 ifeq ($(subdir),misc)
-sysdep_headers += sys/io.h
+sysdep_headers += sys/io.h sys/rse.h
 sysdep_routines += ioperm clone2
 gen-as-const-headers += sigaltstack-offsets.sym
 endif
index 45d553c16f987e8518340307a4f9d5483fc51ca6..8351f2394d91af70d2f82381e32a635add6c6c6b 100644 (file)
 # error "Never include <bits/procfs.h> directly; use <sys/procfs.h> instead."
 #endif
 
-/* For struct __ia64_fpreg.  FIXME: sys/procfs.h should not expose all
-   of sys/ucontext.h.  */
-#include <sys/ucontext.h>
-#include <bits/sigcontext.h>
+#include <bits/types/__ia64_fpreg.h>
 
 /* We really need just 72 but let's leave some headroom...  */
 #define ELF_NGREG      128
index 252eff321c90ff3e35263fd4e90b0dd06d47ae1a..eac745fc803d954ed7290db5b287e46706e3da5d 100644 (file)
 #include <bits/types/size_t.h>
 #include <bits/types/struct_sigstack.h>
 #include <bits/types/stack_t.h>
+#include <bits/types/__ia64_fpreg.h>
 #include <bits/sigstack.h>
 #include <bits/ss_flags.h>
 
-struct __ia64_fpreg
-  {
-    union
-      {
-       unsigned long bits[2];
-      } u;
-  } __attribute__ ((__aligned__ (16)));
-
 struct sigcontext
 {
   unsigned long int sc_flags;  /* see manifest constants below */
diff --git a/sysdeps/unix/sysv/linux/ia64/bits/types/__ia64_fpreg.h b/sysdeps/unix/sysv/linux/ia64/bits/types/__ia64_fpreg.h
new file mode 100644 (file)
index 0000000..6d69586
--- /dev/null
@@ -0,0 +1,22 @@
+#ifndef ____ia64_fpreg_defined
+#define ____ia64_fpreg_defined
+
+#include <features.h>
+
+#ifdef __USE_MISC
+# define __ctx(fld) fld
+#else
+# define __ctx(fld) __ ## fld
+#endif
+
+struct __ia64_fpreg
+  {
+    union
+      {
+       unsigned long __ctx(bits)[2];
+      } __ctx(u);
+  } __attribute__ ((__aligned__ (16)));
+
+#undef __ctx
+
+#endif /* __ia64_fpreg */
similarity index 91%
rename from sysdeps/unix/sysv/linux/ia64/sys/ucontext.h
rename to sysdeps/unix/sysv/linux/ia64/bits/ucontext.h
index c88e880219e2c9bf34d2d7eaa92be0b4bcea864b..ce1503368d408dc981c0c84e477c3a01264fa582 100644 (file)
    License along with the GNU C Library; if not, see
    <https://www.gnu.org/licenses/>.  */
 
-#ifndef _SYS_UCONTEXT_H
-#define _SYS_UCONTEXT_H        1
+#ifndef _BITS_UCONTEXT_H
+#define _BITS_UCONTEXT_H       1
 
 #include <features.h>
 
 #include <bits/types/sigset_t.h>
 #include <bits/types/stack_t.h>
-
+#include <bits/types/__ia64_fpreg.h>
 
 #ifdef __USE_MISC
 # define __ctx(fld) fld
  * "ucontext_t" as all the necessary info is inside the former.
  */
 
-struct __ia64_fpreg_mcontext
-  {
-    union
-      {
-       unsigned long __ctx(bits)[2];
-      } __ctx(u);
-  } __attribute__ ((__aligned__ (16)));
-
 typedef struct
   {
     unsigned long int __ctx(sc_flags);
@@ -63,7 +55,7 @@ typedef struct
     unsigned long int __ctx(sc_pr);
     unsigned long int __ctx(sc_br)[8];
     unsigned long int __ctx(sc_gr)[32];
-    struct __ia64_fpreg_mcontext __ctx(sc_fr)[128];
+    struct __ia64_fpreg __ctx(sc_fr)[128];
     unsigned long int __ctx(sc_rbs_base);
     unsigned long int __ctx(sc_loadrs);
     unsigned long int __ctx(sc_ar25);
@@ -103,4 +95,4 @@ ucontext_t;
 #define uc_stack       _u._mc.__ctx(sc_stack)
 #define uc_link                _u._uc._link
 
-#endif /* sys/ucontext.h */
+#endif /* bits/ucontext.h */
index ac3e3c8dea1744215226caf79fdbafa4396687f6..46459f7ad0f29eb9bbb0ba4586fc191a23e6a8af 100644 (file)
@@ -1,5 +1,5 @@
 #include <stddef.h>
-#include <sys/ucontext.h>
+#include <signal.h>
 
 --
 SC_NAT         offsetof (mcontext_t, sc_nat)
index b5e2de09ecb07a301a815c4727d8247fcf16653a..260a385e772c5c109b678c556ceac8f583ca8161 100644 (file)
@@ -20,9 +20,8 @@
 #define _SYS_PTRACE_H  1
 
 #include <features.h>
-#include <sys/ucontext.h>
-#include <bits/sigcontext.h>
 #include <bits/types.h>
+#include <bits/ucontext.h>
 
 __BEGIN_DECLS
 
similarity index 97%
rename from sysdeps/unix/sysv/linux/m68k/sys/ucontext.h
rename to sysdeps/unix/sysv/linux/m68k/bits/ucontext.h
index c9950b55c6a3721bf2677683f5db57ade5623bee..9b8106890d6f4c44942f21de7f43f7db126ea895 100644 (file)
@@ -17,8 +17,8 @@
 
 /* System V/m68k ABI compliant context switching support.  */
 
-#ifndef _SYS_UCONTEXT_H
-#define _SYS_UCONTEXT_H        1
+#ifndef _BITS_UCONTEXT_H
+#define _BITS_UCONTEXT_H       1
 
 #include <features.h>
 
@@ -127,4 +127,4 @@ typedef struct ucontext_t
 
 #undef __ctx
 
-#endif /* sys/ucontext.h */
+#endif /* bits/ucontext.h */
index 46bd4bf15f80d1c0700de7fe1dceb9cfb201b403..400c57b7f3169e12d6c7a134082c53272c2d0728 100644 (file)
@@ -1,6 +1,5 @@
 #include <stddef.h>
 #include <signal.h>
-#include <sys/ucontext.h>
 
 --
 
similarity index 96%
rename from sysdeps/unix/sysv/linux/microblaze/sys/ucontext.h
rename to sysdeps/unix/sysv/linux/microblaze/bits/ucontext.h
index d1c16c21e001bdda73f9547723635e1f13125b6b..c81850e2b746332d1f489c82410712462c836717 100644 (file)
@@ -16,8 +16,8 @@
    License along with the GNU C Library; if not, see
    <https://www.gnu.org/licenses/>.  */
 
-#ifndef _SYS_UCONTEXT_H
-#define _SYS_UCONTEXT_H        1
+#ifndef _BITS_UCONTEXT_H
+#define _BITS_UCONTEXT_H       1
 
 #include <features.h>
 
@@ -89,4 +89,4 @@ typedef struct ucontext_t
 
 #undef __ctx
 
-#endif /* sys/ucontext.h */
+#endif /* bits/ucontext.h */
similarity index 97%
rename from sysdeps/unix/sysv/linux/mips/sys/ucontext.h
rename to sysdeps/unix/sysv/linux/mips/bits/ucontext.h
index 5bbc8a63b9b3f56ac4d9dd0394f996acd6335735..2f4d9d786ba0ccbaa0ddb604188c70f54b992408 100644 (file)
@@ -16,8 +16,8 @@
 
 /* Don't rely on this, the interface is currently messed up and may need to
    be broken to be fixed.  */
-#ifndef _SYS_UCONTEXT_H
-#define _SYS_UCONTEXT_H        1
+#ifndef _BITS_UCONTEXT_H
+#define _BITS_UCONTEXT_H       1
 
 #include <features.h>
 
@@ -121,4 +121,4 @@ typedef struct ucontext_t
 
 #undef __ctx
 
-#endif /* sys/ucontext.h */
+#endif /* bits/ucontext.h */
index f14b88640700adf26239be594c7c22fe1162c0ba..d9692adcbabc4cc1b705a9943721b0c7138772eb 100644 (file)
@@ -1,7 +1,5 @@
-#include <inttypes.h>
 #include <signal.h>
 #include <stddef.h>
-#include <sys/ucontext.h>
 
 #include <kernel_rt_sigframe.h>
 
similarity index 95%
rename from sysdeps/unix/sysv/linux/nios2/sys/ucontext.h
rename to sysdeps/unix/sysv/linux/nios2/bits/ucontext.h
index 276fb209c088e95b33e0b8e84f86028ee694b3d4..5be92444e608a22d119c58cdb165527245d5bbd7 100644 (file)
@@ -18,8 +18,8 @@
 
 /* System V/Nios II ABI compliant context switching support.  */
 
-#ifndef _SYS_UCONTEXT_H
-#define _SYS_UCONTEXT_H        1
+#ifndef _BITS_UCONTEXT_H
+#define _BITS_UCONTEXT_H       1
 
 #include <features.h>
 
@@ -58,4 +58,4 @@ typedef struct ucontext_t
 
 #undef __ctx
 
-#endif /* sys/ucontext.h */
+#endif /* bits/ucontext.h */
index a844c9679664e6615300e3c8a599ba4d4d6f8357..5455cdb68178261f73141a2219760bc3a68aa809 100644 (file)
@@ -1,7 +1,5 @@
-#include <inttypes.h>
 #include <signal.h>
 #include <stddef.h>
-#include <sys/ucontext.h>
 
 #include "kernel_rt_sigframe.h"
 
similarity index 98%
rename from sysdeps/unix/sysv/linux/powerpc/sys/ucontext.h
rename to sysdeps/unix/sysv/linux/powerpc/bits/ucontext.h
index ad9e8f0afcc37ec3e1306a4c1035f23736e1a41f..9fbd0ad53ffbfb9b5c0c9169eca548aa039c7ec6 100644 (file)
@@ -15,8 +15,8 @@
    License along with the GNU C Library; if not, see
    <https://www.gnu.org/licenses/>.  */
 
-#ifndef _SYS_UCONTEXT_H
-#define _SYS_UCONTEXT_H        1
+#ifndef _BITS_UCONTEXT_H
+#define _BITS_UCONTEXT_H       1
 
 #include <features.h>
 
@@ -197,4 +197,4 @@ typedef struct ucontext_t
 
 #undef __ctx
 
-#endif /* sys/ucontext.h */
+#endif /* bits/ucontext.h */
index 293761f2606a2d6b312003ce61a67c961f97e557..e1b22b844ede22a4d6732bc37aea829b8b710fe5 100644 (file)
@@ -1,6 +1,5 @@
 #include <stddef.h>
 #include <signal.h>
-#include <sys/ucontext.h>
 
 --
 
index 8364e4614fb440689a3d264615bb9428a0047d70..b2d420e15e1cda7d5e7aa72aa326cf660d41fd20 100644 (file)
@@ -1,6 +1,5 @@
 #include <stddef.h>
 #include <signal.h>
-#include <sys/ucontext.h>
 
 --
 
index 167991f28f7c62174d69f302207b03d34d80da55..ef7a010490ca0d64ab3308d2999241626def9887 100644 (file)
 # error "Never include <bits/procfs.h> directly; use <sys/procfs.h> instead."
 #endif
 
-/* FIXME: sys/ucontext.h does not define NGREG or NFPREG unless
+/* FIXME: bits/ucontext.h does not define NGREG or NFPREG unless
    __USE_MISC is active, and sys/procfs.h should not expose all of
-   sys/ucontext.h.  */
-#include <sys/ucontext.h>
+   bits/ucontext.h.  */
+#include <bits/ucontext.h>
 
 /* ELF register definitions */
 #define ELF_NGREG      NGREG
similarity index 97%
rename from sysdeps/unix/sysv/linux/riscv/sys/ucontext.h
rename to sysdeps/unix/sysv/linux/riscv/bits/ucontext.h
index a4e49fe37a1397fa1babeb0dcefb77341f1e7ad1..27478372be90def00e7f74a6d1be1fe2e5654a10 100644 (file)
@@ -18,8 +18,8 @@
 
 /* Don't rely on this, the interface is currently messed up and may need to
    be broken to be fixed.  */
-#ifndef _SYS_UCONTEXT_H
-#define _SYS_UCONTEXT_H        1
+#ifndef _BITS_UCONTEXT_H
+#define _BITS_UCONTEXT_H       1
 
 #include <features.h>
 
@@ -107,4 +107,4 @@ typedef struct ucontext_t
     mcontext_t uc_mcontext;
   } ucontext_t;
 
-#endif /* sys/ucontext.h */
+#endif /* bits/ucontext.h */
index 7ae5e2cd07ce7d34b35a08d79add8917e7869cf5..bce27fdf45f0048e5bb56423c3389223fd28a722 100644 (file)
 
 #include <sysdep.h>
 #include <sys/asm.h>
-#include <sys/ucontext.h>
+#include <ucontext.h>
 #include <stdarg.h>
 #include <assert.h>
 
 void
-__makecontext (ucontext_t *ucp, void (*func) (void), int argc,
-              long int a0, long int a1, long int a2, long int a3, long int a4,
-              ...)
+__makecontext (ucontext_t *ucp, void (*func) (void), int argc, ...)
 {
   extern void __start_context (void) attribute_hidden;
   long int i, sp;
@@ -47,19 +45,13 @@ __makecontext (ucontext_t *ucp, void (*func) (void), int argc,
   ucp->uc_mcontext.__gregs[REG_PC] = (long int) &__start_context;
 
   /* Put args in a0-a7, then put any remaining args on the stack.  */
-  ucp->uc_mcontext.__gregs[REG_A0 + 0] = a0;
-  ucp->uc_mcontext.__gregs[REG_A0 + 1] = a1;
-  ucp->uc_mcontext.__gregs[REG_A0 + 2] = a2;
-  ucp->uc_mcontext.__gregs[REG_A0 + 3] = a3;
-  ucp->uc_mcontext.__gregs[REG_A0 + 4] = a4;
-
-  if (__glibc_unlikely (argc > 5))
+  if (argc > 0)
     {
       va_list vl;
-      va_start (vl, a4);
+      va_start (vl, argc);
 
       long reg_args = argc < REG_NARGS ? argc : REG_NARGS;
-      for (i = 5; i < reg_args; i++)
+      for (i = 0; i < reg_args; i++)
         ucp->uc_mcontext.__gregs[REG_A0 + i] = va_arg (vl, long);
 
       long int stack_args = argc - reg_args;
index a420531d5110bc816aacf650f02a9b136775ed01..730c7e2f1a52bf439cd6c845468e537a704ccaf0 100644 (file)
@@ -19,7 +19,7 @@
 #ifndef _SIGCONTEXTINFO_H
 #define _SIGCONTEXTINFO_H
 
-#include <sys/ucontext.h>
+#include <signal.h>
 
 static inline uintptr_t
 sigcontext_get_pc (const ucontext_t *ctx)
index be55b26310bb743c59acac22e86dd8e35601a409..105b5386849203661b2d778c32deee12f3fafb83 100644 (file)
@@ -1,7 +1,5 @@
-#include <inttypes.h>
-#include <signal.h>
 #include <stddef.h>
-#include <sys/ucontext.h>
+#include <signal.h>
 
 -- Constants used by the rt_sigprocmask call.
 
index 633b8f6346351fb1bed29b42e3a464b1c6884552..813493047850e8d08bb3529cd251f4458d0dda97 100644 (file)
@@ -23,9 +23,9 @@
 # error "Never include <bits/procfs.h> directly; use <sys/procfs.h> instead."
 #endif
 
-/* FIXME: sys/ucontext.h does not define NGREG unless __USE_MISC is
-   active, and sys/procfs.h should not expose all of sys/ucontext.h.  */
-#include <sys/ucontext.h>
+/* FIXME: bits/ucontext.h does not define NGREG unless __USE_MISC is
+   active, and sys/procfs.h should not expose all of bits/ucontext.h.  */
+#include <bits/ucontext.h>
 
 typedef greg_t elf_greg_t;
 #define ELF_NGREG NGREG
similarity index 96%
rename from sysdeps/unix/sysv/linux/s390/sys/ucontext.h
rename to sysdeps/unix/sysv/linux/s390/bits/ucontext.h
index 769386ff95771da5a9f02252237ee2cce3d569bb..580f01c03e3ab40a3ac945b657270bed03afd676 100644 (file)
@@ -16,8 +16,8 @@
    License along with the GNU C Library; if not, see
    <https://www.gnu.org/licenses/>.  */
 
-#ifndef _SYS_UCONTEXT_H
-#define _SYS_UCONTEXT_H        1
+#ifndef _BITS_UCONTEXT_H
+#define _BITS_UCONTEXT_H       1
 
 #include <features.h>
 
@@ -92,4 +92,4 @@ typedef struct ucontext_t
 #undef __ctx
 
 
-#endif /* sys/ucontext.h */
+#endif /* bits/ucontext.h */
index adbe4271694ed813586874bc9cc7a25ac26c3f00..c456db109cec809d5e46d6ad32a36276b8bc8c47 100644 (file)
    License along with the GNU C Library; if not, see
    <https://www.gnu.org/licenses/>.  */
 
+#include <elf.h>
+#include <errno.h>
 #include <signal.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
 #include <unistd.h>
-#include <sys/wait.h>
 #include <sys/types.h>
 #include <sys/uio.h>
-#include <elf.h>
-#include <support/xunistd.h>
+#include <sys/wait.h>
+
 #include <support/check.h>
-#include <string.h>
-#include <errno.h>
+#include <support/xunistd.h>
 
 /* Ensure that we use the PTRACE_SINGLEBLOCK definition from glibc ptrace.h
    in tracer_func.  We need the kernel ptrace.h for structs ptrace_area
index 6cc9f196245efbcad4e7ad56f96f6a0a31c50aca..5b9855504975e0381d7704d3fa694fc09fe33f3a 100644 (file)
@@ -1,6 +1,5 @@
 #include <stddef.h>
 #include <signal.h>
-#include <sys/ucontext.h>
 
 --
 
similarity index 97%
rename from sysdeps/unix/sysv/linux/sh/sys/ucontext.h
rename to sysdeps/unix/sysv/linux/sh/bits/ucontext.h
index f83292a23ce1080f88a546f6b9826f1ec5ad98fc..ac7b8941e3153c46fefcdbeecfe3b3b8a8d0bac4 100644 (file)
@@ -17,8 +17,8 @@
 
 /* Where is System V/SH ABI?  */
 
-#ifndef _SYS_UCONTEXT_H
-#define _SYS_UCONTEXT_H        1
+#ifndef _BITS_UCONTEXT_H
+#define _BITS_UCONTEXT_H       1
 
 #include <features.h>
 
@@ -123,4 +123,4 @@ typedef struct ucontext_t
 
 #undef __ctx
 
-#endif /* sys/ucontext.h */
+#endif /* bits/ucontext.h */
index 25f914a93bfeb896c0ce542682e0ccaa9f4632b9..4cd312ac5d135645062ea70b11a58c75b0fc7c20 100644 (file)
@@ -1,6 +1,5 @@
 #include <stddef.h>
 #include <signal.h>
-#include <sys/ucontext.h>
 
 --
 
index 130f60cd96c984b09c8e165b395ffed2fa89a1d7..530a06f6d0ab8f9b2cdcd182c5b9bebefba84037 100644 (file)
@@ -1,6 +1,5 @@
 #include <stddef.h>
 #include <signal.h>
-#include <sys/ucontext.h>
 
 --
 
similarity index 99%
rename from sysdeps/unix/sysv/linux/sparc/sys/ucontext.h
rename to sysdeps/unix/sysv/linux/sparc/bits/ucontext.h
index 7075f705824a23b44c3c7e9b529304d4cb4f553f..4760a6a6850cdcbaa98c79e95d293e1654a77891 100644 (file)
@@ -15,8 +15,8 @@
    License along with the GNU C Library; if not, see
    <https://www.gnu.org/licenses/>.  */
 
-#ifndef _SYS_UCONTEXT_H
-#define _SYS_UCONTEXT_H        1
+#ifndef _BITS_UCONTEXT_H
+#define _BITS_UCONTEXT_H       1
 
 #include <features.h>
 
@@ -301,4 +301,4 @@ typedef struct ucontext_t
   } ucontext_t;
 
 #endif /* __WORDSIZE == 32 */
-#endif /* sys/ucontext.h */
+#endif /* bits/ucontext.h */
index 8a7cb5ab84eb7aa805909d04193a9761af971c1d..0fe920d35af247d0e48a344eb5e0275d306a4174 100644 (file)
@@ -1,6 +1,5 @@
 #include <stddef.h>
 #include <signal.h>
-#include <sys/ucontext.h>
 
 --
 
similarity index 98%
rename from sysdeps/unix/sysv/linux/x86/sys/ucontext.h
rename to sysdeps/unix/sysv/linux/x86/bits/ucontext.h
index ca9fdb4713de3f1f5214d581a5abafc546a4b4ce..fe5cbae8fc4d671e2137a3c8fa570ceb080908fe 100644 (file)
@@ -15,8 +15,8 @@
    License along with the GNU C Library; if not, see
    <https://www.gnu.org/licenses/>.  */
 
-#ifndef _SYS_UCONTEXT_H
-#define _SYS_UCONTEXT_H        1
+#ifndef _BITS_UCONTEXT_H
+#define _BITS_UCONTEXT_H       1
 
 #include <features.h>
 
@@ -259,4 +259,4 @@ typedef struct ucontext_t
 
 #undef __ctx
 
-#endif /* sys/ucontext.h */
+#endif /* bits/ucontext.h */
index c08b3b8b47d4802345c85274304658ff3077b775..4bffe048a01dde9666fb5129458c3cdd3c08a442 100644 (file)
@@ -1,6 +1,5 @@
 #include <stddef.h>
 #include <signal.h>
-#include <sys/ucontext.h>
 
 --