strace/Makefile.am

978 lines
26 KiB
Makefile
Raw Normal View History

# Automake input for strace.
#
# Copyright (c) 2002-2009 Roland McGrath <roland@redhat.com>
# Copyright (c) 2006-2016 Dmitry V. Levin <ldv@altlinux.org>
# Copyright (c) 2008-2015 Mike Frysinger <vapier@gentoo.org>
# Copyright (c) 2015 Elvira Khabirova <lineprinter0@gmail.com>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# 3. The name of the author may not be used to endorse or promote products
# derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
if HAVE_M32_RUNTIME
TESTS_M32 = tests-m32
endif
if HAVE_MX32_RUNTIME
TESTS_MX32 = tests-mx32
endif
SUBDIRS = tests $(TESTS_M32) $(TESTS_MX32)
bin_PROGRAMS = strace
man_MANS = strace.1
bin_SCRIPTS = strace-graph strace-log-merge
OS = linux
# ARCH is `i386', `m68k', `sparc', etc.
ARCH = @arch@
ACLOCAL_AMFLAGS = -I m4
AM_CFLAGS = $(WARN_CFLAGS)
AM_CPPFLAGS = -I$(builddir)/$(OS)/$(ARCH) \
-I$(srcdir)/$(OS)/$(ARCH) \
-I$(builddir)/$(OS) \
-I$(srcdir)/$(OS) \
-I$(builddir) \
-I$(srcdir)
Makefile.am: don't confuse CFLAGS and CFLAGS_FOR_BUILD Commit dc427d50d96b15c9a64d7e78d97ce4d194622a63 enabled a number of extra warning flags through configure.ac. The configure script will determine dynamically if CC supports these flags before adding them to WARN_CFLAGS. ioctlsort is compiled with CC_FOR_BUILD, rather than CC. Nevertheless, the flags passed to this compilation also include WARN_CFLAGS (through AM_CFLAGS). This is incorrect: in a cross-compilation use case, CC and CC_FOR_BUILD are not the same. The former is the cross-compiler, the latter is the host compiler. Both may be of different versions and support different warning flags. In particular, this posed a problem when cross-compiling with a host compiler gcc 4.1, which does not support all the new flags: /usr/bin/gcc -DHAVE_CONFIG_H -I./linux/arm -I./linux/arm -I./linux -I./linux -I. -I. -I/host-sysroot/usr/include -Wall -Wempty-body -Wformat-security -Wignored-qualifiers -Winit-self -Wlogical-op -Wmissing-parameter-type -Wnested-externs -Wold-style-declaration -Wold-style-definition -Wsign-compare -Wtype-limits -Wwrite-strings -O2 -I/host-sysroot/usr/include -DIOCTLSORT_INC=\"ioctls_all0.h\" -c -o ioctlsort0.o ./ioctlsort.c cc1: error: unrecognized command line option "-Wempty-body" cc1: error: unrecognized command line option "-Wignored-qualifiers" cc1: error: unrecognized command line option "-Wlogical-op" cc1: error: unrecognized command line option "-Wmissing-parameter-type" cc1: error: unrecognized command line option "-Wold-style-declaration" cc1: error: unrecognized command line option "-Wtype-limits" make[2]: *** [ioctlsort0.o] Error 1 * Makefile.am (AM_CFLAGS_FOR_BUILD, AM_CPPFLAGS_FOR_BUILD): New variables. (ioctlsort_CPPFLAGS): Use AM_CPPFLAGS_FOR_BUILD instead of AM_CPPFLAGS. (ioctlsort_CFLAGS): Use AM_CFLAGS_FOR_BUILD instead of AM_CFLAGS. (ioctlsort_LDFLAGS): Use AM_LDFLAGS_FOR_BUILD instead of AM_LDFLAGS. * m4/ax_prog_cc_for_build.m4 (AX_PROG_CC_FOR_BUILD): Redirect WARN_CFLAGS and gl_unknown_warnings_are_errors, call st_WARN_CFLAGS, substitute WARN_CFLAGS_FOR_BUILD. Signed-off-by: Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
2016-10-18 14:42:44 +03:00
AM_CFLAGS_FOR_BUILD = $(WARN_CFLAGS_FOR_BUILD)
AM_CPPFLAGS_FOR_BUILD = $(AM_CPPFLAGS)
include xlat/Makemodule.am
Add mpers support Add a subsystem for semi-automatical definition of how parsers should work with personality-dependent (mpers) types of tracee's data. Create auxiliary libraries containing mpers syscall parsers and printer functions, one library for each possible nonnative target personality. Currently some parsers do not handle differences in definitions of data types between personalities, namely LP64 and ILP32. When this is the case, long integers, pointers, and all compound types containing long and pointer members may be printed incorrectly, because of differences in sizes, offsets and alignments. Since in most cases these are the only differences in desired behaviour of parsers and printers for different personalities, a correct way would be to compile one source code into multiple parsers, differing only in definitions of mpers types. To get a definition of a given type for nonnative personality a very basic .c file containing a declaration of a variable of this type is being compiled for this personality (using -m32 or -mx32 compiler flag). Information about the type is then being extracted from this binary's DWARF debug info with an awk script and put into a corresponding header file. Resulting headers are being used to compile mpers variations of syscall parsers and printer functions. In addition to syscall parsers, there can occur a need to create mpers printing functions, which then can be called from many places in the code (for example, printsiginfo_at). Such functions (printers) are marked in a special manner. For each possible nonnative target personality a library is being created, containing mpers variations of syscall parsers and printers. Only syscall parsers from files marked in a special manner and specially marked functions from such files are being recompiled and included in these libraries. generate_mpers_am.sh is called by bootstrap to find the files from strace_SOURCES which include MPERS_DEFS. During compilation, these files are being inspected for inclusions of DEF_MPERS_TYPE, and nonnative variations of each included type are being generated by an awk script. Mpers parser names are being modified during inclusions of syscallent headers for nonnative personalities. Pointers to printers are being stored in structs struct_printers, and a master pointer printers is being updated on every set_personality. * README-mpers: New README explaining how to use mpers support. * empty.h: New empty file. * generate_mpers_am.sh: New file. * mpers.awk: Likewise. * mpers.sh: Likewise. * mpers_test.sh: Likewise. * mpers_type.h: Likewise. * Makefile.am (strace_SOURCES): Add empty.h and mpers_type.h. (strace_CPPFLAGS, strace_LDFLAGS, strace_LDADD): Move to the beginning of the file. (strace_LDADD, noinst_LIBRARIES): Add libmpers-%.a. (EXTRA_DIST): Add mpers.awk, mpers.sh, mpers_test.sh. (BUILT_SOURCES, CLEANFILES): Add new generated files: native_printer_decls.h, native_printer_defs.h, printers.h, [HAVE_M32_MPERS] $(mpers_m32_targets), and [HAVE_MX32_MPERS] $(mpers_mx32_targets). (mpers_NAME, mpers_PREFIX, mpers_DEFS, mpers_INCLUDES, mpers_CPPFLAGS, mpers_sh_opts, libmpers_CPPFLAGS, libmpers_m[x]32_a_SOURCES, libmpers_m[x]32_a_CPPFLAGS, mpers_m[x]32_targets): New variables. (mpers-m[x]32.stamp, m[x]32_defs.h, m[x]32_funcs.h, printers.h, %_printer_decls.h, %_printer_defs.h, clean-local, native_printer_decls.h, native_printer_defs.h, $mpers_m[x]32_targets): New targets. * bootstrap: Add generate_mpers_am.sh. * configure.ac: Add AC_PROG_RANLIB. * m4/mpers.m4: Add HAVE_MPERS variable. Add $st_cv_mpers checks. * defs.h: Include mpers_type.h. Include printers.h, native_printer_decls.h, define MPERS_PRINTER_NAME. Redefine SYS_FUNC_NAME. Define MPERS_PRINTER_DECL. [HAVE_M32_MPERS]: define PERSONALITY1_INCLUDE_FUNCS, PERSONALITY1_INCLUDE_PRINTERS_DECLS, PERSONALITY1_INCLUDE_PRINTERS_DEFS for X86_64, X32. [HAVE_MX32_MPERS]: define PERSONALITY2_INCLUDE_FUNCS, PERSONALITY2_INCLUDE_PRINTERS_DECLS, PERSONALITY2_INCLUDE_PRINTERS_DEFS for X86_64. Add fallback definitions of PERSONALITY1_INCLUDE_FUNCS, PERSONALITY2_INCLUDE_FUNCS, PERSONALITY0_INCLUDE_PRINTERS_DECLS, PERSONALITY0_INCLUDE_PRINTERS_DEFS, PERSONALITY1_INCLUDE_PRINTERS_DECLS, PERSONALITY1_INCLUDE_PRINTERS_DEFS, PERSONALITY2_INCLUDE_PRINTERS_DECLS, PERSONALITY2_INCLUDE_PRINTERS_DEFS. * syscall.c: Include PERSONALITY1_INCLUDE_FUNCS, PERSONALITY2_INCLUDE_FUNCS, PERSONALITY0_INCLUDE_PRINTERS_DECLS, PERSONALITY0_INCLUDE_PRINTERS_DEFS, PERSONALITY1_INCLUDE_PRINTERS_DECLS, PERSONALITY1_INCLUDE_PRINTERS_DEFS, PERSONALITY2_INCLUDE_PRINTERS_DECLS, PERSONALITY2_INCLUDE_PRINTERS_DEFS. (printers): New struct. Update it when needed. * .gitignore: Add libmpers-m32.a, libmpers-mx32.a, m32_defs.h, m32_funcs.h, m32_printer_decls.h, m32_printer_defs.h, mpers-m32, mpers-m32.stamp, mpers-mx32, mpers-mx32.stamp, mpers.am, mx32_defs.h, mx32_funcs.h, mx32_printer_decls.h, mx32_printer_defs.h, native_printer_decls.h, native_printer_defs.h, and printers.h.
2015-08-04 01:47:02 +03:00
strace_CPPFLAGS = $(AM_CPPFLAGS)
strace_CFLAGS = $(AM_CFLAGS)
Add mpers support Add a subsystem for semi-automatical definition of how parsers should work with personality-dependent (mpers) types of tracee's data. Create auxiliary libraries containing mpers syscall parsers and printer functions, one library for each possible nonnative target personality. Currently some parsers do not handle differences in definitions of data types between personalities, namely LP64 and ILP32. When this is the case, long integers, pointers, and all compound types containing long and pointer members may be printed incorrectly, because of differences in sizes, offsets and alignments. Since in most cases these are the only differences in desired behaviour of parsers and printers for different personalities, a correct way would be to compile one source code into multiple parsers, differing only in definitions of mpers types. To get a definition of a given type for nonnative personality a very basic .c file containing a declaration of a variable of this type is being compiled for this personality (using -m32 or -mx32 compiler flag). Information about the type is then being extracted from this binary's DWARF debug info with an awk script and put into a corresponding header file. Resulting headers are being used to compile mpers variations of syscall parsers and printer functions. In addition to syscall parsers, there can occur a need to create mpers printing functions, which then can be called from many places in the code (for example, printsiginfo_at). Such functions (printers) are marked in a special manner. For each possible nonnative target personality a library is being created, containing mpers variations of syscall parsers and printers. Only syscall parsers from files marked in a special manner and specially marked functions from such files are being recompiled and included in these libraries. generate_mpers_am.sh is called by bootstrap to find the files from strace_SOURCES which include MPERS_DEFS. During compilation, these files are being inspected for inclusions of DEF_MPERS_TYPE, and nonnative variations of each included type are being generated by an awk script. Mpers parser names are being modified during inclusions of syscallent headers for nonnative personalities. Pointers to printers are being stored in structs struct_printers, and a master pointer printers is being updated on every set_personality. * README-mpers: New README explaining how to use mpers support. * empty.h: New empty file. * generate_mpers_am.sh: New file. * mpers.awk: Likewise. * mpers.sh: Likewise. * mpers_test.sh: Likewise. * mpers_type.h: Likewise. * Makefile.am (strace_SOURCES): Add empty.h and mpers_type.h. (strace_CPPFLAGS, strace_LDFLAGS, strace_LDADD): Move to the beginning of the file. (strace_LDADD, noinst_LIBRARIES): Add libmpers-%.a. (EXTRA_DIST): Add mpers.awk, mpers.sh, mpers_test.sh. (BUILT_SOURCES, CLEANFILES): Add new generated files: native_printer_decls.h, native_printer_defs.h, printers.h, [HAVE_M32_MPERS] $(mpers_m32_targets), and [HAVE_MX32_MPERS] $(mpers_mx32_targets). (mpers_NAME, mpers_PREFIX, mpers_DEFS, mpers_INCLUDES, mpers_CPPFLAGS, mpers_sh_opts, libmpers_CPPFLAGS, libmpers_m[x]32_a_SOURCES, libmpers_m[x]32_a_CPPFLAGS, mpers_m[x]32_targets): New variables. (mpers-m[x]32.stamp, m[x]32_defs.h, m[x]32_funcs.h, printers.h, %_printer_decls.h, %_printer_defs.h, clean-local, native_printer_decls.h, native_printer_defs.h, $mpers_m[x]32_targets): New targets. * bootstrap: Add generate_mpers_am.sh. * configure.ac: Add AC_PROG_RANLIB. * m4/mpers.m4: Add HAVE_MPERS variable. Add $st_cv_mpers checks. * defs.h: Include mpers_type.h. Include printers.h, native_printer_decls.h, define MPERS_PRINTER_NAME. Redefine SYS_FUNC_NAME. Define MPERS_PRINTER_DECL. [HAVE_M32_MPERS]: define PERSONALITY1_INCLUDE_FUNCS, PERSONALITY1_INCLUDE_PRINTERS_DECLS, PERSONALITY1_INCLUDE_PRINTERS_DEFS for X86_64, X32. [HAVE_MX32_MPERS]: define PERSONALITY2_INCLUDE_FUNCS, PERSONALITY2_INCLUDE_PRINTERS_DECLS, PERSONALITY2_INCLUDE_PRINTERS_DEFS for X86_64. Add fallback definitions of PERSONALITY1_INCLUDE_FUNCS, PERSONALITY2_INCLUDE_FUNCS, PERSONALITY0_INCLUDE_PRINTERS_DECLS, PERSONALITY0_INCLUDE_PRINTERS_DEFS, PERSONALITY1_INCLUDE_PRINTERS_DECLS, PERSONALITY1_INCLUDE_PRINTERS_DEFS, PERSONALITY2_INCLUDE_PRINTERS_DECLS, PERSONALITY2_INCLUDE_PRINTERS_DEFS. * syscall.c: Include PERSONALITY1_INCLUDE_FUNCS, PERSONALITY2_INCLUDE_FUNCS, PERSONALITY0_INCLUDE_PRINTERS_DECLS, PERSONALITY0_INCLUDE_PRINTERS_DEFS, PERSONALITY1_INCLUDE_PRINTERS_DECLS, PERSONALITY1_INCLUDE_PRINTERS_DEFS, PERSONALITY2_INCLUDE_PRINTERS_DECLS, PERSONALITY2_INCLUDE_PRINTERS_DEFS. (printers): New struct. Update it when needed. * .gitignore: Add libmpers-m32.a, libmpers-mx32.a, m32_defs.h, m32_funcs.h, m32_printer_decls.h, m32_printer_defs.h, mpers-m32, mpers-m32.stamp, mpers-mx32, mpers-mx32.stamp, mpers.am, mx32_defs.h, mx32_funcs.h, mx32_printer_decls.h, mx32_printer_defs.h, native_printer_decls.h, native_printer_defs.h, and printers.h.
2015-08-04 01:47:02 +03:00
strace_LDFLAGS =
strace_LDADD = libstrace.a
noinst_LIBRARIES = libstrace.a
libstrace_a_CPPFLAGS = $(strace_CPPFLAGS)
libstrace_a_CFLAGS = $(strace_CFLAGS)
libstrace_a_SOURCES = \
fstatfs.c \
fstatfs64.c \
ipc.c \
socketcall.c \
statfs.c \
statfs64.c \
sync_file_range.c \
sync_file_range2.c \
upeek.c \
upoke.c \
# end of libstrace_a_SOURCES
Add mpers support Add a subsystem for semi-automatical definition of how parsers should work with personality-dependent (mpers) types of tracee's data. Create auxiliary libraries containing mpers syscall parsers and printer functions, one library for each possible nonnative target personality. Currently some parsers do not handle differences in definitions of data types between personalities, namely LP64 and ILP32. When this is the case, long integers, pointers, and all compound types containing long and pointer members may be printed incorrectly, because of differences in sizes, offsets and alignments. Since in most cases these are the only differences in desired behaviour of parsers and printers for different personalities, a correct way would be to compile one source code into multiple parsers, differing only in definitions of mpers types. To get a definition of a given type for nonnative personality a very basic .c file containing a declaration of a variable of this type is being compiled for this personality (using -m32 or -mx32 compiler flag). Information about the type is then being extracted from this binary's DWARF debug info with an awk script and put into a corresponding header file. Resulting headers are being used to compile mpers variations of syscall parsers and printer functions. In addition to syscall parsers, there can occur a need to create mpers printing functions, which then can be called from many places in the code (for example, printsiginfo_at). Such functions (printers) are marked in a special manner. For each possible nonnative target personality a library is being created, containing mpers variations of syscall parsers and printers. Only syscall parsers from files marked in a special manner and specially marked functions from such files are being recompiled and included in these libraries. generate_mpers_am.sh is called by bootstrap to find the files from strace_SOURCES which include MPERS_DEFS. During compilation, these files are being inspected for inclusions of DEF_MPERS_TYPE, and nonnative variations of each included type are being generated by an awk script. Mpers parser names are being modified during inclusions of syscallent headers for nonnative personalities. Pointers to printers are being stored in structs struct_printers, and a master pointer printers is being updated on every set_personality. * README-mpers: New README explaining how to use mpers support. * empty.h: New empty file. * generate_mpers_am.sh: New file. * mpers.awk: Likewise. * mpers.sh: Likewise. * mpers_test.sh: Likewise. * mpers_type.h: Likewise. * Makefile.am (strace_SOURCES): Add empty.h and mpers_type.h. (strace_CPPFLAGS, strace_LDFLAGS, strace_LDADD): Move to the beginning of the file. (strace_LDADD, noinst_LIBRARIES): Add libmpers-%.a. (EXTRA_DIST): Add mpers.awk, mpers.sh, mpers_test.sh. (BUILT_SOURCES, CLEANFILES): Add new generated files: native_printer_decls.h, native_printer_defs.h, printers.h, [HAVE_M32_MPERS] $(mpers_m32_targets), and [HAVE_MX32_MPERS] $(mpers_mx32_targets). (mpers_NAME, mpers_PREFIX, mpers_DEFS, mpers_INCLUDES, mpers_CPPFLAGS, mpers_sh_opts, libmpers_CPPFLAGS, libmpers_m[x]32_a_SOURCES, libmpers_m[x]32_a_CPPFLAGS, mpers_m[x]32_targets): New variables. (mpers-m[x]32.stamp, m[x]32_defs.h, m[x]32_funcs.h, printers.h, %_printer_decls.h, %_printer_defs.h, clean-local, native_printer_decls.h, native_printer_defs.h, $mpers_m[x]32_targets): New targets. * bootstrap: Add generate_mpers_am.sh. * configure.ac: Add AC_PROG_RANLIB. * m4/mpers.m4: Add HAVE_MPERS variable. Add $st_cv_mpers checks. * defs.h: Include mpers_type.h. Include printers.h, native_printer_decls.h, define MPERS_PRINTER_NAME. Redefine SYS_FUNC_NAME. Define MPERS_PRINTER_DECL. [HAVE_M32_MPERS]: define PERSONALITY1_INCLUDE_FUNCS, PERSONALITY1_INCLUDE_PRINTERS_DECLS, PERSONALITY1_INCLUDE_PRINTERS_DEFS for X86_64, X32. [HAVE_MX32_MPERS]: define PERSONALITY2_INCLUDE_FUNCS, PERSONALITY2_INCLUDE_PRINTERS_DECLS, PERSONALITY2_INCLUDE_PRINTERS_DEFS for X86_64. Add fallback definitions of PERSONALITY1_INCLUDE_FUNCS, PERSONALITY2_INCLUDE_FUNCS, PERSONALITY0_INCLUDE_PRINTERS_DECLS, PERSONALITY0_INCLUDE_PRINTERS_DEFS, PERSONALITY1_INCLUDE_PRINTERS_DECLS, PERSONALITY1_INCLUDE_PRINTERS_DEFS, PERSONALITY2_INCLUDE_PRINTERS_DECLS, PERSONALITY2_INCLUDE_PRINTERS_DEFS. * syscall.c: Include PERSONALITY1_INCLUDE_FUNCS, PERSONALITY2_INCLUDE_FUNCS, PERSONALITY0_INCLUDE_PRINTERS_DECLS, PERSONALITY0_INCLUDE_PRINTERS_DEFS, PERSONALITY1_INCLUDE_PRINTERS_DECLS, PERSONALITY1_INCLUDE_PRINTERS_DEFS, PERSONALITY2_INCLUDE_PRINTERS_DECLS, PERSONALITY2_INCLUDE_PRINTERS_DEFS. (printers): New struct. Update it when needed. * .gitignore: Add libmpers-m32.a, libmpers-mx32.a, m32_defs.h, m32_funcs.h, m32_printer_decls.h, m32_printer_defs.h, mpers-m32, mpers-m32.stamp, mpers-mx32, mpers-mx32.stamp, mpers.am, mx32_defs.h, mx32_funcs.h, mx32_printer_decls.h, mx32_printer_defs.h, native_printer_decls.h, native_printer_defs.h, and printers.h.
2015-08-04 01:47:02 +03:00
strace_SOURCES = \
access.c \
affinity.c \
aio.c \
alpha.c \
bjm.c \
block.c \
bpf.c \
ioctl: add decoding support for btrfs ioctls * btrfs.c: New file. * file_ioctl.c: Likewise. * Makefile.am (strace_SOURCES): Add them. * configure.ac (AC_CHECK_HEADERS): Add linux/btrfs.h. (AC_CHECK_MEMBERS): Add struct btrfs_ioctl_feature_flags.compat_flags, struct btrfs_ioctl_fs_info_args.nodesize, struct btrfs_ioctl_defrag_range_args.start, and struct btrfs_ioctl_search_args_v2.buf_size. (AC_CHECK_DECLS): Add BTRFS_COMPRESS_* enums. * defs.h (btrfs_ioctl, file_ioctl): New prototypes. * ioctl.c (ioctl_decode) [HAVE_LINUX_BTRFS_H]: Use btrfs_ioctl. * xlat/btrfs_balance_args.in: New file. * xlat/btrfs_balance_ctl_cmds.in: Likewise. * xlat/btrfs_balance_flags.in: Likewise. * xlat/btrfs_balance_state.in: Likewise. * xlat/btrfs_compress_types.in: Likewise. * xlat/btrfs_defrag_flags.in: Likewise. * xlat/btrfs_dev_replace_cmds.in: Likewise. * xlat/btrfs_dev_replace_results.in: Likewise. * xlat/btrfs_dev_replace_state.in: Likewise. * xlat/btrfs_dev_stats_flags.in: Likewise. * xlat/btrfs_dev_stats_values.in: Likewise. * xlat/btrfs_features_compat.in: Likewise. * xlat/btrfs_features_compat_ro.in: Likewise. * xlat/btrfs_features_incompat.in: Likewise. * xlat/btrfs_key_types.in: Likewise. * xlat/btrfs_qgroup_ctl_cmds.in: Likewise. * xlat/btrfs_qgroup_inherit_flags.in: Likewise. * xlat/btrfs_qgroup_limit_flags.in: Likewise. * xlat/btrfs_qgroup_status_flags.in: Likewise. * xlat/btrfs_scrub_flags.in: Likewise. * xlat/btrfs_send_flags.in: Likewise. * xlat/btrfs_snap_flags_v2.in: Likewise. * xlat/btrfs_space_info_flags.in: Likewise. * xlat/btrfs_tree_objectids.in: Likewise.
2016-05-19 01:09:39 +03:00
btrfs.c \
cacheflush.c \
capability.c \
caps0.h \
caps1.h \
chdir.c \
chmod.c \
clone.c \
copy_file_range.c \
count.c \
defs.h \
desc.c \
dirent.c \
dirent64.c \
dm.c \
Add mpers support Add a subsystem for semi-automatical definition of how parsers should work with personality-dependent (mpers) types of tracee's data. Create auxiliary libraries containing mpers syscall parsers and printer functions, one library for each possible nonnative target personality. Currently some parsers do not handle differences in definitions of data types between personalities, namely LP64 and ILP32. When this is the case, long integers, pointers, and all compound types containing long and pointer members may be printed incorrectly, because of differences in sizes, offsets and alignments. Since in most cases these are the only differences in desired behaviour of parsers and printers for different personalities, a correct way would be to compile one source code into multiple parsers, differing only in definitions of mpers types. To get a definition of a given type for nonnative personality a very basic .c file containing a declaration of a variable of this type is being compiled for this personality (using -m32 or -mx32 compiler flag). Information about the type is then being extracted from this binary's DWARF debug info with an awk script and put into a corresponding header file. Resulting headers are being used to compile mpers variations of syscall parsers and printer functions. In addition to syscall parsers, there can occur a need to create mpers printing functions, which then can be called from many places in the code (for example, printsiginfo_at). Such functions (printers) are marked in a special manner. For each possible nonnative target personality a library is being created, containing mpers variations of syscall parsers and printers. Only syscall parsers from files marked in a special manner and specially marked functions from such files are being recompiled and included in these libraries. generate_mpers_am.sh is called by bootstrap to find the files from strace_SOURCES which include MPERS_DEFS. During compilation, these files are being inspected for inclusions of DEF_MPERS_TYPE, and nonnative variations of each included type are being generated by an awk script. Mpers parser names are being modified during inclusions of syscallent headers for nonnative personalities. Pointers to printers are being stored in structs struct_printers, and a master pointer printers is being updated on every set_personality. * README-mpers: New README explaining how to use mpers support. * empty.h: New empty file. * generate_mpers_am.sh: New file. * mpers.awk: Likewise. * mpers.sh: Likewise. * mpers_test.sh: Likewise. * mpers_type.h: Likewise. * Makefile.am (strace_SOURCES): Add empty.h and mpers_type.h. (strace_CPPFLAGS, strace_LDFLAGS, strace_LDADD): Move to the beginning of the file. (strace_LDADD, noinst_LIBRARIES): Add libmpers-%.a. (EXTRA_DIST): Add mpers.awk, mpers.sh, mpers_test.sh. (BUILT_SOURCES, CLEANFILES): Add new generated files: native_printer_decls.h, native_printer_defs.h, printers.h, [HAVE_M32_MPERS] $(mpers_m32_targets), and [HAVE_MX32_MPERS] $(mpers_mx32_targets). (mpers_NAME, mpers_PREFIX, mpers_DEFS, mpers_INCLUDES, mpers_CPPFLAGS, mpers_sh_opts, libmpers_CPPFLAGS, libmpers_m[x]32_a_SOURCES, libmpers_m[x]32_a_CPPFLAGS, mpers_m[x]32_targets): New variables. (mpers-m[x]32.stamp, m[x]32_defs.h, m[x]32_funcs.h, printers.h, %_printer_decls.h, %_printer_defs.h, clean-local, native_printer_decls.h, native_printer_defs.h, $mpers_m[x]32_targets): New targets. * bootstrap: Add generate_mpers_am.sh. * configure.ac: Add AC_PROG_RANLIB. * m4/mpers.m4: Add HAVE_MPERS variable. Add $st_cv_mpers checks. * defs.h: Include mpers_type.h. Include printers.h, native_printer_decls.h, define MPERS_PRINTER_NAME. Redefine SYS_FUNC_NAME. Define MPERS_PRINTER_DECL. [HAVE_M32_MPERS]: define PERSONALITY1_INCLUDE_FUNCS, PERSONALITY1_INCLUDE_PRINTERS_DECLS, PERSONALITY1_INCLUDE_PRINTERS_DEFS for X86_64, X32. [HAVE_MX32_MPERS]: define PERSONALITY2_INCLUDE_FUNCS, PERSONALITY2_INCLUDE_PRINTERS_DECLS, PERSONALITY2_INCLUDE_PRINTERS_DEFS for X86_64. Add fallback definitions of PERSONALITY1_INCLUDE_FUNCS, PERSONALITY2_INCLUDE_FUNCS, PERSONALITY0_INCLUDE_PRINTERS_DECLS, PERSONALITY0_INCLUDE_PRINTERS_DEFS, PERSONALITY1_INCLUDE_PRINTERS_DECLS, PERSONALITY1_INCLUDE_PRINTERS_DEFS, PERSONALITY2_INCLUDE_PRINTERS_DECLS, PERSONALITY2_INCLUDE_PRINTERS_DEFS. * syscall.c: Include PERSONALITY1_INCLUDE_FUNCS, PERSONALITY2_INCLUDE_FUNCS, PERSONALITY0_INCLUDE_PRINTERS_DECLS, PERSONALITY0_INCLUDE_PRINTERS_DEFS, PERSONALITY1_INCLUDE_PRINTERS_DECLS, PERSONALITY1_INCLUDE_PRINTERS_DEFS, PERSONALITY2_INCLUDE_PRINTERS_DECLS, PERSONALITY2_INCLUDE_PRINTERS_DEFS. (printers): New struct. Update it when needed. * .gitignore: Add libmpers-m32.a, libmpers-mx32.a, m32_defs.h, m32_funcs.h, m32_printer_decls.h, m32_printer_defs.h, mpers-m32, mpers-m32.stamp, mpers-mx32, mpers-mx32.stamp, mpers.am, mx32_defs.h, mx32_funcs.h, mx32_printer_decls.h, mx32_printer_defs.h, native_printer_decls.h, native_printer_defs.h, and printers.h.
2015-08-04 01:47:02 +03:00
empty.h \
epoll.c \
evdev.c \
eventfd.c \
execve.c \
fadvise.c \
fallocate.c \
fanotify.c \
fchownat.c \
fcntl.c \
fetch_seccomp_fprog.c \
fetch_struct_flock.c \
fetch_struct_mmsghdr.c \
fetch_struct_msghdr.c \
fetch_struct_stat.c \
fetch_struct_stat64.c \
fetch_struct_statfs.c \
file_handle.c \
ioctl: add decoding support for btrfs ioctls * btrfs.c: New file. * file_ioctl.c: Likewise. * Makefile.am (strace_SOURCES): Add them. * configure.ac (AC_CHECK_HEADERS): Add linux/btrfs.h. (AC_CHECK_MEMBERS): Add struct btrfs_ioctl_feature_flags.compat_flags, struct btrfs_ioctl_fs_info_args.nodesize, struct btrfs_ioctl_defrag_range_args.start, and struct btrfs_ioctl_search_args_v2.buf_size. (AC_CHECK_DECLS): Add BTRFS_COMPRESS_* enums. * defs.h (btrfs_ioctl, file_ioctl): New prototypes. * ioctl.c (ioctl_decode) [HAVE_LINUX_BTRFS_H]: Use btrfs_ioctl. * xlat/btrfs_balance_args.in: New file. * xlat/btrfs_balance_ctl_cmds.in: Likewise. * xlat/btrfs_balance_flags.in: Likewise. * xlat/btrfs_balance_state.in: Likewise. * xlat/btrfs_compress_types.in: Likewise. * xlat/btrfs_defrag_flags.in: Likewise. * xlat/btrfs_dev_replace_cmds.in: Likewise. * xlat/btrfs_dev_replace_results.in: Likewise. * xlat/btrfs_dev_replace_state.in: Likewise. * xlat/btrfs_dev_stats_flags.in: Likewise. * xlat/btrfs_dev_stats_values.in: Likewise. * xlat/btrfs_features_compat.in: Likewise. * xlat/btrfs_features_compat_ro.in: Likewise. * xlat/btrfs_features_incompat.in: Likewise. * xlat/btrfs_key_types.in: Likewise. * xlat/btrfs_qgroup_ctl_cmds.in: Likewise. * xlat/btrfs_qgroup_inherit_flags.in: Likewise. * xlat/btrfs_qgroup_limit_flags.in: Likewise. * xlat/btrfs_qgroup_status_flags.in: Likewise. * xlat/btrfs_scrub_flags.in: Likewise. * xlat/btrfs_send_flags.in: Likewise. * xlat/btrfs_snap_flags_v2.in: Likewise. * xlat/btrfs_space_info_flags.in: Likewise. * xlat/btrfs_tree_objectids.in: Likewise.
2016-05-19 01:09:39 +03:00
file_ioctl.c \
fs_x_ioctl.c \
flock.c \
flock.h \
futex.c \
gcc_compat.h \
get_robust_list.c \
getcpu.c \
getcwd.c \
getrandom.c \
hdio.c \
hostname.c \
inotify.c \
io.c \
ioctl.c \
ioperm.c \
iopl.c \
ioprio.c \
ipc_defs.h \
ipc_msg.c \
ipc_msgctl.c \
ipc_sem.c \
ipc_shm.c \
ipc_shmctl.c \
kcmp.c \
kernel_types.h \
kexec.c \
keyctl.c \
ldt.c \
link.c \
linux/asm_stat.h \
linux/x32/asm_stat.h \
linux/x86_64/asm_stat.h \
lookup_dcookie.c \
loop.c \
lseek.c \
mem.c \
membarrier.c \
memfd_create.c \
mknod.c \
mmsghdr.c \
mount.c \
Add mpers support Add a subsystem for semi-automatical definition of how parsers should work with personality-dependent (mpers) types of tracee's data. Create auxiliary libraries containing mpers syscall parsers and printer functions, one library for each possible nonnative target personality. Currently some parsers do not handle differences in definitions of data types between personalities, namely LP64 and ILP32. When this is the case, long integers, pointers, and all compound types containing long and pointer members may be printed incorrectly, because of differences in sizes, offsets and alignments. Since in most cases these are the only differences in desired behaviour of parsers and printers for different personalities, a correct way would be to compile one source code into multiple parsers, differing only in definitions of mpers types. To get a definition of a given type for nonnative personality a very basic .c file containing a declaration of a variable of this type is being compiled for this personality (using -m32 or -mx32 compiler flag). Information about the type is then being extracted from this binary's DWARF debug info with an awk script and put into a corresponding header file. Resulting headers are being used to compile mpers variations of syscall parsers and printer functions. In addition to syscall parsers, there can occur a need to create mpers printing functions, which then can be called from many places in the code (for example, printsiginfo_at). Such functions (printers) are marked in a special manner. For each possible nonnative target personality a library is being created, containing mpers variations of syscall parsers and printers. Only syscall parsers from files marked in a special manner and specially marked functions from such files are being recompiled and included in these libraries. generate_mpers_am.sh is called by bootstrap to find the files from strace_SOURCES which include MPERS_DEFS. During compilation, these files are being inspected for inclusions of DEF_MPERS_TYPE, and nonnative variations of each included type are being generated by an awk script. Mpers parser names are being modified during inclusions of syscallent headers for nonnative personalities. Pointers to printers are being stored in structs struct_printers, and a master pointer printers is being updated on every set_personality. * README-mpers: New README explaining how to use mpers support. * empty.h: New empty file. * generate_mpers_am.sh: New file. * mpers.awk: Likewise. * mpers.sh: Likewise. * mpers_test.sh: Likewise. * mpers_type.h: Likewise. * Makefile.am (strace_SOURCES): Add empty.h and mpers_type.h. (strace_CPPFLAGS, strace_LDFLAGS, strace_LDADD): Move to the beginning of the file. (strace_LDADD, noinst_LIBRARIES): Add libmpers-%.a. (EXTRA_DIST): Add mpers.awk, mpers.sh, mpers_test.sh. (BUILT_SOURCES, CLEANFILES): Add new generated files: native_printer_decls.h, native_printer_defs.h, printers.h, [HAVE_M32_MPERS] $(mpers_m32_targets), and [HAVE_MX32_MPERS] $(mpers_mx32_targets). (mpers_NAME, mpers_PREFIX, mpers_DEFS, mpers_INCLUDES, mpers_CPPFLAGS, mpers_sh_opts, libmpers_CPPFLAGS, libmpers_m[x]32_a_SOURCES, libmpers_m[x]32_a_CPPFLAGS, mpers_m[x]32_targets): New variables. (mpers-m[x]32.stamp, m[x]32_defs.h, m[x]32_funcs.h, printers.h, %_printer_decls.h, %_printer_defs.h, clean-local, native_printer_decls.h, native_printer_defs.h, $mpers_m[x]32_targets): New targets. * bootstrap: Add generate_mpers_am.sh. * configure.ac: Add AC_PROG_RANLIB. * m4/mpers.m4: Add HAVE_MPERS variable. Add $st_cv_mpers checks. * defs.h: Include mpers_type.h. Include printers.h, native_printer_decls.h, define MPERS_PRINTER_NAME. Redefine SYS_FUNC_NAME. Define MPERS_PRINTER_DECL. [HAVE_M32_MPERS]: define PERSONALITY1_INCLUDE_FUNCS, PERSONALITY1_INCLUDE_PRINTERS_DECLS, PERSONALITY1_INCLUDE_PRINTERS_DEFS for X86_64, X32. [HAVE_MX32_MPERS]: define PERSONALITY2_INCLUDE_FUNCS, PERSONALITY2_INCLUDE_PRINTERS_DECLS, PERSONALITY2_INCLUDE_PRINTERS_DEFS for X86_64. Add fallback definitions of PERSONALITY1_INCLUDE_FUNCS, PERSONALITY2_INCLUDE_FUNCS, PERSONALITY0_INCLUDE_PRINTERS_DECLS, PERSONALITY0_INCLUDE_PRINTERS_DEFS, PERSONALITY1_INCLUDE_PRINTERS_DECLS, PERSONALITY1_INCLUDE_PRINTERS_DEFS, PERSONALITY2_INCLUDE_PRINTERS_DECLS, PERSONALITY2_INCLUDE_PRINTERS_DEFS. * syscall.c: Include PERSONALITY1_INCLUDE_FUNCS, PERSONALITY2_INCLUDE_FUNCS, PERSONALITY0_INCLUDE_PRINTERS_DECLS, PERSONALITY0_INCLUDE_PRINTERS_DEFS, PERSONALITY1_INCLUDE_PRINTERS_DECLS, PERSONALITY1_INCLUDE_PRINTERS_DEFS, PERSONALITY2_INCLUDE_PRINTERS_DECLS, PERSONALITY2_INCLUDE_PRINTERS_DEFS. (printers): New struct. Update it when needed. * .gitignore: Add libmpers-m32.a, libmpers-mx32.a, m32_defs.h, m32_funcs.h, m32_printer_decls.h, m32_printer_defs.h, mpers-m32, mpers-m32.stamp, mpers-mx32, mpers-mx32.stamp, mpers.am, mx32_defs.h, mx32_funcs.h, mx32_printer_decls.h, mx32_printer_defs.h, native_printer_decls.h, native_printer_defs.h, and printers.h.
2015-08-04 01:47:02 +03:00
mpers_type.h \
mq.c \
msghdr.c \
msghdr.h \
mtd.c \
native_defs.h \
net.c \
netlink.c \
numa.c \
oldstat.c \
open.c \
or1k_atomic.c \
pathtrace.c \
perf.c \
perf_event_struct.h \
personality.c \
pkeys.c \
poll.c \
prctl.c \
print_mq_attr.c \
print_msgbuf.c \
print_sigevent.c \
print_statfs.c \
print_struct_stat.c \
print_time.c \
print_timespec.c \
print_timeval.c \
print_timex.c \
printmode.c \
printrusage.c \
printsiginfo.c \
printsiginfo.h \
process.c \
process_vm.c \
ptp.c \
ptrace.h \
qualify.c \
quota.c \
readahead.c \
readlink.c \
reboot.c \
regs.h \
renameat.c \
resource.c \
rtc.c \
sched.c \
scsi.c \
seccomp.c \
seccomp_fprog.h \
sendfile.c \
sigaltstack.c \
sigevent.h \
signal.c \
signalfd.c \
sigreturn.c \
sock.c \
sockaddr.c \
socketutils.c \
sram_alloc.c \
stat.c \
stat.h \
stat64.c \
statfs.c \
statfs.h \
strace.c \
swapon.c \
syscall.c \
sysctl.c \
sysinfo.c \
syslog.c \
sysmips.c \
term.c \
time.c \
times.c \
truncate.c \
ubi.c \
uid.c \
Fix decoding of 16-bit *chown and [gs]et*[gu]id syscalls Define two sets of parsers on architectures that support (either directly or via multiarch) 16-bit and 32-bit uid/gid syscalls simultaneously. Since the code in these two sets is essentially the same and the key difference between them is the size of uid_t, implement it by parametrizing uid_t and names of parser functions. * defs.h (NEED_UID16_PARSERS): New macro. * linux/syscall.h [NEED_UID16_PARSERS] (sys_chown16, sys_fchown16, sys_getresuid16, sys_getuid16, sys_setfsuid16, sys_setresuid16, sys_setreuid16, sys_setuid16): New prototypes. * linux/dummy.h (sys_geteuid16): Alias to sys_getuid16. (sys_getegid16, sys_getgid16, sys_getresgid16, sys_setfsgid16, sys_setgid16, sys_setregid16, sys_setresgid16): Alias to corresponding sys_*uid16 functions. * uid.c: Stop including <asm/posix_types.h>. Parametrize uid_t and names of all exported functions. (get_print_uid): New function. (sys_getresuid): Use it. (printuid): Check for (uid_t) -1. * uid16.c: New file. * Makefile.am (strace_SOURCES): Add it. * linux/arm/syscallent.h: Use sys_chown16, sys_fchown16, sys_getegid16, sys_geteuid16, sys_getgid16, sys_getresgid16, sys_getresuid16, sys_getuid16, sys_setfsgid16, sys_setfsuid16, sys_setgid16, sys_setregid16, sys_setresgid16, sys_setresuid16, sys_setreuid16, and sys_setuid16 parsers for *chown and [gs]et*[gu]id syscall entries. * linux/bfin/syscallent.h: Likewise. * linux/i386/syscallent.h: Likewise. * linux/m68k/syscallent.h: Likewise. * linux/microblaze/syscallent.h: Likewise. * linux/s390/syscallent.h: Likewise. * linux/sparc/syscallent.h: Likewise. * linux/sh/syscallent.h: Likewise. * linux/sh64/syscallent.h: Likewise. * tests/uid16.c: New file. * tests/uid16.test: New test. * tests/Makefile.am (CHECK_PROGRAMS): Add uid16. (TESTS): Add uid16.test. * tests/.gitignore: Add uid16.
2014-12-14 00:49:01 +03:00
uid16.c \
umask.c \
umount.c \
uname.c \
userfaultfd.c \
util.c \
utime.c \
utimes.c \
v4l2.c \
vsprintf.c \
wait.c \
xattr.c \
xlat.h \
Add mpers support Add a subsystem for semi-automatical definition of how parsers should work with personality-dependent (mpers) types of tracee's data. Create auxiliary libraries containing mpers syscall parsers and printer functions, one library for each possible nonnative target personality. Currently some parsers do not handle differences in definitions of data types between personalities, namely LP64 and ILP32. When this is the case, long integers, pointers, and all compound types containing long and pointer members may be printed incorrectly, because of differences in sizes, offsets and alignments. Since in most cases these are the only differences in desired behaviour of parsers and printers for different personalities, a correct way would be to compile one source code into multiple parsers, differing only in definitions of mpers types. To get a definition of a given type for nonnative personality a very basic .c file containing a declaration of a variable of this type is being compiled for this personality (using -m32 or -mx32 compiler flag). Information about the type is then being extracted from this binary's DWARF debug info with an awk script and put into a corresponding header file. Resulting headers are being used to compile mpers variations of syscall parsers and printer functions. In addition to syscall parsers, there can occur a need to create mpers printing functions, which then can be called from many places in the code (for example, printsiginfo_at). Such functions (printers) are marked in a special manner. For each possible nonnative target personality a library is being created, containing mpers variations of syscall parsers and printers. Only syscall parsers from files marked in a special manner and specially marked functions from such files are being recompiled and included in these libraries. generate_mpers_am.sh is called by bootstrap to find the files from strace_SOURCES which include MPERS_DEFS. During compilation, these files are being inspected for inclusions of DEF_MPERS_TYPE, and nonnative variations of each included type are being generated by an awk script. Mpers parser names are being modified during inclusions of syscallent headers for nonnative personalities. Pointers to printers are being stored in structs struct_printers, and a master pointer printers is being updated on every set_personality. * README-mpers: New README explaining how to use mpers support. * empty.h: New empty file. * generate_mpers_am.sh: New file. * mpers.awk: Likewise. * mpers.sh: Likewise. * mpers_test.sh: Likewise. * mpers_type.h: Likewise. * Makefile.am (strace_SOURCES): Add empty.h and mpers_type.h. (strace_CPPFLAGS, strace_LDFLAGS, strace_LDADD): Move to the beginning of the file. (strace_LDADD, noinst_LIBRARIES): Add libmpers-%.a. (EXTRA_DIST): Add mpers.awk, mpers.sh, mpers_test.sh. (BUILT_SOURCES, CLEANFILES): Add new generated files: native_printer_decls.h, native_printer_defs.h, printers.h, [HAVE_M32_MPERS] $(mpers_m32_targets), and [HAVE_MX32_MPERS] $(mpers_mx32_targets). (mpers_NAME, mpers_PREFIX, mpers_DEFS, mpers_INCLUDES, mpers_CPPFLAGS, mpers_sh_opts, libmpers_CPPFLAGS, libmpers_m[x]32_a_SOURCES, libmpers_m[x]32_a_CPPFLAGS, mpers_m[x]32_targets): New variables. (mpers-m[x]32.stamp, m[x]32_defs.h, m[x]32_funcs.h, printers.h, %_printer_decls.h, %_printer_defs.h, clean-local, native_printer_decls.h, native_printer_defs.h, $mpers_m[x]32_targets): New targets. * bootstrap: Add generate_mpers_am.sh. * configure.ac: Add AC_PROG_RANLIB. * m4/mpers.m4: Add HAVE_MPERS variable. Add $st_cv_mpers checks. * defs.h: Include mpers_type.h. Include printers.h, native_printer_decls.h, define MPERS_PRINTER_NAME. Redefine SYS_FUNC_NAME. Define MPERS_PRINTER_DECL. [HAVE_M32_MPERS]: define PERSONALITY1_INCLUDE_FUNCS, PERSONALITY1_INCLUDE_PRINTERS_DECLS, PERSONALITY1_INCLUDE_PRINTERS_DEFS for X86_64, X32. [HAVE_MX32_MPERS]: define PERSONALITY2_INCLUDE_FUNCS, PERSONALITY2_INCLUDE_PRINTERS_DECLS, PERSONALITY2_INCLUDE_PRINTERS_DEFS for X86_64. Add fallback definitions of PERSONALITY1_INCLUDE_FUNCS, PERSONALITY2_INCLUDE_FUNCS, PERSONALITY0_INCLUDE_PRINTERS_DECLS, PERSONALITY0_INCLUDE_PRINTERS_DEFS, PERSONALITY1_INCLUDE_PRINTERS_DECLS, PERSONALITY1_INCLUDE_PRINTERS_DEFS, PERSONALITY2_INCLUDE_PRINTERS_DECLS, PERSONALITY2_INCLUDE_PRINTERS_DEFS. * syscall.c: Include PERSONALITY1_INCLUDE_FUNCS, PERSONALITY2_INCLUDE_FUNCS, PERSONALITY0_INCLUDE_PRINTERS_DECLS, PERSONALITY0_INCLUDE_PRINTERS_DEFS, PERSONALITY1_INCLUDE_PRINTERS_DECLS, PERSONALITY1_INCLUDE_PRINTERS_DEFS, PERSONALITY2_INCLUDE_PRINTERS_DECLS, PERSONALITY2_INCLUDE_PRINTERS_DEFS. (printers): New struct. Update it when needed. * .gitignore: Add libmpers-m32.a, libmpers-mx32.a, m32_defs.h, m32_funcs.h, m32_printer_decls.h, m32_printer_defs.h, mpers-m32, mpers-m32.stamp, mpers-mx32, mpers-mx32.stamp, mpers.am, mx32_defs.h, mx32_funcs.h, mx32_printer_decls.h, mx32_printer_defs.h, native_printer_decls.h, native_printer_defs.h, and printers.h.
2015-08-04 01:47:02 +03:00
xmalloc.c \
# end of strace_SOURCES
if USE_LIBUNWIND
strace_SOURCES += unwind.c
Add mpers support Add a subsystem for semi-automatical definition of how parsers should work with personality-dependent (mpers) types of tracee's data. Create auxiliary libraries containing mpers syscall parsers and printer functions, one library for each possible nonnative target personality. Currently some parsers do not handle differences in definitions of data types between personalities, namely LP64 and ILP32. When this is the case, long integers, pointers, and all compound types containing long and pointer members may be printed incorrectly, because of differences in sizes, offsets and alignments. Since in most cases these are the only differences in desired behaviour of parsers and printers for different personalities, a correct way would be to compile one source code into multiple parsers, differing only in definitions of mpers types. To get a definition of a given type for nonnative personality a very basic .c file containing a declaration of a variable of this type is being compiled for this personality (using -m32 or -mx32 compiler flag). Information about the type is then being extracted from this binary's DWARF debug info with an awk script and put into a corresponding header file. Resulting headers are being used to compile mpers variations of syscall parsers and printer functions. In addition to syscall parsers, there can occur a need to create mpers printing functions, which then can be called from many places in the code (for example, printsiginfo_at). Such functions (printers) are marked in a special manner. For each possible nonnative target personality a library is being created, containing mpers variations of syscall parsers and printers. Only syscall parsers from files marked in a special manner and specially marked functions from such files are being recompiled and included in these libraries. generate_mpers_am.sh is called by bootstrap to find the files from strace_SOURCES which include MPERS_DEFS. During compilation, these files are being inspected for inclusions of DEF_MPERS_TYPE, and nonnative variations of each included type are being generated by an awk script. Mpers parser names are being modified during inclusions of syscallent headers for nonnative personalities. Pointers to printers are being stored in structs struct_printers, and a master pointer printers is being updated on every set_personality. * README-mpers: New README explaining how to use mpers support. * empty.h: New empty file. * generate_mpers_am.sh: New file. * mpers.awk: Likewise. * mpers.sh: Likewise. * mpers_test.sh: Likewise. * mpers_type.h: Likewise. * Makefile.am (strace_SOURCES): Add empty.h and mpers_type.h. (strace_CPPFLAGS, strace_LDFLAGS, strace_LDADD): Move to the beginning of the file. (strace_LDADD, noinst_LIBRARIES): Add libmpers-%.a. (EXTRA_DIST): Add mpers.awk, mpers.sh, mpers_test.sh. (BUILT_SOURCES, CLEANFILES): Add new generated files: native_printer_decls.h, native_printer_defs.h, printers.h, [HAVE_M32_MPERS] $(mpers_m32_targets), and [HAVE_MX32_MPERS] $(mpers_mx32_targets). (mpers_NAME, mpers_PREFIX, mpers_DEFS, mpers_INCLUDES, mpers_CPPFLAGS, mpers_sh_opts, libmpers_CPPFLAGS, libmpers_m[x]32_a_SOURCES, libmpers_m[x]32_a_CPPFLAGS, mpers_m[x]32_targets): New variables. (mpers-m[x]32.stamp, m[x]32_defs.h, m[x]32_funcs.h, printers.h, %_printer_decls.h, %_printer_defs.h, clean-local, native_printer_decls.h, native_printer_defs.h, $mpers_m[x]32_targets): New targets. * bootstrap: Add generate_mpers_am.sh. * configure.ac: Add AC_PROG_RANLIB. * m4/mpers.m4: Add HAVE_MPERS variable. Add $st_cv_mpers checks. * defs.h: Include mpers_type.h. Include printers.h, native_printer_decls.h, define MPERS_PRINTER_NAME. Redefine SYS_FUNC_NAME. Define MPERS_PRINTER_DECL. [HAVE_M32_MPERS]: define PERSONALITY1_INCLUDE_FUNCS, PERSONALITY1_INCLUDE_PRINTERS_DECLS, PERSONALITY1_INCLUDE_PRINTERS_DEFS for X86_64, X32. [HAVE_MX32_MPERS]: define PERSONALITY2_INCLUDE_FUNCS, PERSONALITY2_INCLUDE_PRINTERS_DECLS, PERSONALITY2_INCLUDE_PRINTERS_DEFS for X86_64. Add fallback definitions of PERSONALITY1_INCLUDE_FUNCS, PERSONALITY2_INCLUDE_FUNCS, PERSONALITY0_INCLUDE_PRINTERS_DECLS, PERSONALITY0_INCLUDE_PRINTERS_DEFS, PERSONALITY1_INCLUDE_PRINTERS_DECLS, PERSONALITY1_INCLUDE_PRINTERS_DEFS, PERSONALITY2_INCLUDE_PRINTERS_DECLS, PERSONALITY2_INCLUDE_PRINTERS_DEFS. * syscall.c: Include PERSONALITY1_INCLUDE_FUNCS, PERSONALITY2_INCLUDE_FUNCS, PERSONALITY0_INCLUDE_PRINTERS_DECLS, PERSONALITY0_INCLUDE_PRINTERS_DEFS, PERSONALITY1_INCLUDE_PRINTERS_DECLS, PERSONALITY1_INCLUDE_PRINTERS_DEFS, PERSONALITY2_INCLUDE_PRINTERS_DECLS, PERSONALITY2_INCLUDE_PRINTERS_DEFS. (printers): New struct. Update it when needed. * .gitignore: Add libmpers-m32.a, libmpers-mx32.a, m32_defs.h, m32_funcs.h, m32_printer_decls.h, m32_printer_defs.h, mpers-m32, mpers-m32.stamp, mpers-mx32, mpers-mx32.stamp, mpers.am, mx32_defs.h, mx32_funcs.h, mx32_printer_decls.h, mx32_printer_defs.h, native_printer_decls.h, native_printer_defs.h, and printers.h.
2015-08-04 01:47:02 +03:00
strace_CPPFLAGS += $(libunwind_CPPFLAGS)
strace_LDFLAGS += $(libunwind_LDFLAGS)
strace_LDADD += $(libunwind_LIBS)
endif
@CODE_COVERAGE_RULES@
CODE_COVERAGE_BRANCH_COVERAGE = 1
CODE_COVERAGE_GENHTML_OPTIONS = $(CODE_COVERAGE_GENHTML_OPTIONS_DEFAULT) \
--prefix $(shell cd $(abs_top_srcdir)/.. && pwd || echo .)
CODE_COVERAGE_IGNORE_PATTERN = '/usr/include/*'
strace_CPPFLAGS += $(CODE_COVERAGE_CPPFLAGS)
strace_CFLAGS += $(CODE_COVERAGE_CFLAGS)
strace_LDADD += $(CODE_COVERAGE_LDFLAGS)
# Enable this to get link map generated
#strace_LDFLAGS += -Wl,-Map=strace.mapfile
EXTRA_DIST = \
$(man_MANS) \
.version \
COPYING \
CREDITS \
ChangeLog \
ChangeLog-CVS \
README-linux-ptrace \
debian/changelog \
debian/compat \
debian/control \
debian/copyright \
debian/rules \
debian/source/format \
debian/strace-udeb.install \
debian/strace.docs \
debian/strace.examples \
debian/strace.install \
debian/strace.manpages \
debian/strace64.install \
debian/strace64.manpages \
debian/watch \
errnoent.sh \
generate_sen.sh \
ioctlsort.c \
ioctl: take all 32 bits of ioctl commands into account Historically, only 16 bits (8-bit number and 8-bit type) of 32-bit ioctl commands were used for decoding, which was the source for numerous annoying collisions like this: ioctl(0, SNDCTL_TMR_TIMEBASE or SNDRV_TIMER_IOCTL_NEXT_DEVICE or TCGETS, {B38400 opost isig icanon echo ...}) = 0 ioctl(0, MGSL_IOCGPARAMS or MMTIMER_GETRES or MTIOCTOP or SNDCTL_MIDI_MPUMODE, 0x7fffd47f7338) = -1 ENOTTY (Inappropriate ioctl for device) The solution is to use all 32 bits for decoding, not just "number" and "type", but also "size" and "direction". As some architectures override defaults that come from asm-generic/ and provide alternative definitions for some ioctl commands, we support per-architecture ioctl definitions and merge them with common definitions at build time. During the merge, we used to keep both generic and architecture-specific definitions, now architecture-specific definitions have precedence over generic ones -- ioctlsort omits definitions from asm-generic/ for those ioctl names that have different definitions in asm/. Additional bits of "direction" are architecture specific -- the number of bits and their values differ between architectures. To reduce architecture differences in the source code, we keep "direction" in symbolic form and compile it in ioctlsort. Additional bits of "size" are also architecture specific -- not only the number of bits differ between architectures, but sizes of many types depend on sizeof(long). To reduce architecture differences in the source code, we keep 32-bit and 64-bit versions of common ioctl definitions, and use the appropriate version for each architecture and personality. To implement this, the tools for generating ioctl definitions from kernel headers have been rewritten, and the source format of ioctl definitions has been extended. The final ioctlent*.h files that are included by syscall.c are now generated from source ioctls_inc*.h and ioctls_arch*.h files at build time with ioctlsort. * ioctl.c (ioctl_lookup): Use all 32 bits of ioctl command code. * ioctlsort.c: Rewritten. * linux/32/ioctls_inc.h: New file. * linux/64/ioctls_inc.h: New file. * linux/aarch64/ioctls_arch0.h: New file. * linux/aarch64/ioctls_arch1.h: New file. * linux/aarch64/ioctls_inc0.h: New file. * linux/aarch64/ioctls_inc1.h: New file. * linux/alpha/ioctls_arch0.h: New file. * linux/alpha/ioctls_inc0.h: New file. * linux/arc/ioctls_arch0.h: New file. * linux/arc/ioctls_inc0.h: New file. * linux/arm/ioctls_arch0.h: New file. * linux/arm/ioctls_inc0.h: New file. * linux/avr32/ioctls_arch0.h: New file. * linux/avr32/ioctls_inc0.h: New file. * linux/bfin/ioctls_arch0.h: New file. * linux/bfin/ioctls_inc0.h: New file. * linux/hppa/ioctls_arch0.h: New file. * linux/hppa/ioctls_inc0.h: New file. * linux/i386/ioctls_arch0.h: New file. * linux/i386/ioctls_inc0.h: New file. * linux/ia64/ioctls_arch0.h: New file. * linux/ia64/ioctls_inc0.h: New file. * linux/m68k/ioctls_arch0.h: New file. * linux/m68k/ioctls_inc0.h: New file. * linux/metag/ioctls_arch0.h: New file. * linux/metag/ioctls_inc0.h: New file. * linux/microblaze/ioctls_arch0.h: New file. * linux/microblaze/ioctls_inc0.h: New file. * linux/mips/ioctls_arch0.h: New file. * linux/mips/ioctls_inc0.h: New file. * linux/or1k/ioctls_arch0.h: New file. * linux/or1k/ioctls_inc0.h: New file. * linux/powerpc/ioctls_arch0.h: New file. * linux/powerpc/ioctls_inc0.h: New file. * linux/powerpc64/ioctls_arch0.h: New file. * linux/powerpc64/ioctls_arch1.h: New file. * linux/powerpc64/ioctls_inc0.h: New file. * linux/powerpc64/ioctls_inc1.h: New file. * linux/s390/ioctls_arch0.h: New file. * linux/s390/ioctls_inc0.h: New file. * linux/s390x/ioctls_arch0.h: New file. * linux/s390x/ioctls_inc0.h: New file. * linux/sh/ioctls_arch0.h: New file. * linux/sh/ioctls_inc0.h: New file. * linux/sh64/ioctls_arch0.h: New file. * linux/sh64/ioctls_inc0.h: New file. * linux/sparc/ioctls_arch0.h: New file. * linux/sparc/ioctls_inc0.h: New file. * linux/sparc64/ioctls_arch0.h: New file. * linux/sparc64/ioctls_arch2.h: New file. * linux/sparc64/ioctls_inc0.h: New file. * linux/sparc64/ioctls_inc2.h: New file. * linux/tile/ioctls_arch0.h: New file. * linux/tile/ioctls_arch1.h: New file. * linux/tile/ioctls_inc0.h: New file. * linux/tile/ioctls_inc1.h: New file. * linux/x32/ioctls_arch0.h: New file. * linux/x32/ioctls_arch1.h: New file. * linux/x32/ioctls_inc0.h: New file. * linux/x32/ioctls_inc1.h: New file. * linux/x86_64/ioctls_arch0.h: New file. * linux/x86_64/ioctls_arch1.h: New file. * linux/x86_64/ioctls_inc0.h: New file. * linux/x86_64/ioctls_inc1.h: New file. * linux/xtensa/ioctls_arch0.h: New file. * linux/xtensa/ioctls_inc0.h: New file. * linux/aarch64/ioctlent.h.in: Remove. * linux/aarch64/ioctlent1.h: Remove. * linux/alpha/ioctlent.h.in: Remove. * linux/arc/ioctlent.h.in: Remove. * linux/arm/ioctlent.h.in: Remove. * linux/avr32/ioctlent.h.in: Remove. * linux/bfin/ioctlent.h.in: Remove. * linux/hppa/ioctlent.h.in: Remove. * linux/i386/ioctlent.h.in: Remove. * linux/ia64/ioctlent.h.in: Remove. * linux/ioctlent.h.in: Remove. * linux/ioctlent.sh: Remove. * linux/m68k/ioctlent.h.in: Remove. * linux/metag/ioctlent.h.in: Remove. * linux/microblaze/ioctlent.h.in: Remove. * linux/mips/ioctlent.h.in: Remove. * linux/mips/ioctlent.sh: Remove. * linux/or1k/ioctlent.h.in: Remove. * linux/powerpc/ioctlent.h.in: Remove. * linux/powerpc64/ioctlent.h: Remove. * linux/powerpc64/ioctlent1.h: Remove. * linux/s390/ioctlent.h.in: Remove. * linux/s390x/ioctlent.h.in: Remove. * linux/sh/ioctlent.h.in: Remove. * linux/sh64/ioctlent.h.in: Remove. * linux/sparc/ioctlent.h.in: Remove. * linux/sparc64/ioctlent.h.in: Remove. * linux/sparc64/ioctlent2.h: Remove. * linux/tile/ioctlent.h.in: Remove. * linux/tile/ioctlent1.h: Remove. * linux/x32/ioctlent.h.in: Remove. * linux/x32/ioctlent1.h: Remove. * linux/x86_64/ioctlent.h.in: Remove. * linux/x86_64/ioctlent1.h: Remove. * linux/xtensa/ioctlent.h.in: Remove. * linux/x86_64/ioctlent2.h: Include ioctlent0.h instead of ioctlent.h. * syscall.c (struct_ioctlent ioctlent0): Likewise. * Makefile.am: Remove all ioctlent-related definitions. Define the list of ioctlent*.h files that have to be generated by presence of $(srcdir)/$(OS)/$(ARCH)/ioctls_inc*.h files. Add rules for ioctlent*.h files generation. (EXTRA_DIST): Update. * maint/ioctls_gen.sh: New file. * maint/ioctls_hex.sh: New file. * maint/ioctls_sym.sh: New file. * maint/print_ioctlent.c: New file. * HACKING-scripts: Update for ioctlent.sh -> ioctls_gen.sh migration. * .gitignore: Add ioctlent[012].h and ioctls_all[012].h. * configure.ac (AC_CHECK_HEADERS): Add linux/hiddev.h and linux/mmtimer.h for tests. * tests/ioctl.c: New file. * tests/ioctl.test: New test. * tests/Makefile.am (check_PROGRAMS): Add ioctl. (TESTS): Add ioctl.test. * tests/.gitignore: Add ioctl.
2015-01-19 20:02:16 +03:00
linux/32/ioctls_inc.h \
linux/32/ioctls_inc_align16.h \
linux/32/ioctls_inc_align32.h \
linux/32/ioctls_inc_align64.h \
linux/32/syscallent.h \
ioctl: take all 32 bits of ioctl commands into account Historically, only 16 bits (8-bit number and 8-bit type) of 32-bit ioctl commands were used for decoding, which was the source for numerous annoying collisions like this: ioctl(0, SNDCTL_TMR_TIMEBASE or SNDRV_TIMER_IOCTL_NEXT_DEVICE or TCGETS, {B38400 opost isig icanon echo ...}) = 0 ioctl(0, MGSL_IOCGPARAMS or MMTIMER_GETRES or MTIOCTOP or SNDCTL_MIDI_MPUMODE, 0x7fffd47f7338) = -1 ENOTTY (Inappropriate ioctl for device) The solution is to use all 32 bits for decoding, not just "number" and "type", but also "size" and "direction". As some architectures override defaults that come from asm-generic/ and provide alternative definitions for some ioctl commands, we support per-architecture ioctl definitions and merge them with common definitions at build time. During the merge, we used to keep both generic and architecture-specific definitions, now architecture-specific definitions have precedence over generic ones -- ioctlsort omits definitions from asm-generic/ for those ioctl names that have different definitions in asm/. Additional bits of "direction" are architecture specific -- the number of bits and their values differ between architectures. To reduce architecture differences in the source code, we keep "direction" in symbolic form and compile it in ioctlsort. Additional bits of "size" are also architecture specific -- not only the number of bits differ between architectures, but sizes of many types depend on sizeof(long). To reduce architecture differences in the source code, we keep 32-bit and 64-bit versions of common ioctl definitions, and use the appropriate version for each architecture and personality. To implement this, the tools for generating ioctl definitions from kernel headers have been rewritten, and the source format of ioctl definitions has been extended. The final ioctlent*.h files that are included by syscall.c are now generated from source ioctls_inc*.h and ioctls_arch*.h files at build time with ioctlsort. * ioctl.c (ioctl_lookup): Use all 32 bits of ioctl command code. * ioctlsort.c: Rewritten. * linux/32/ioctls_inc.h: New file. * linux/64/ioctls_inc.h: New file. * linux/aarch64/ioctls_arch0.h: New file. * linux/aarch64/ioctls_arch1.h: New file. * linux/aarch64/ioctls_inc0.h: New file. * linux/aarch64/ioctls_inc1.h: New file. * linux/alpha/ioctls_arch0.h: New file. * linux/alpha/ioctls_inc0.h: New file. * linux/arc/ioctls_arch0.h: New file. * linux/arc/ioctls_inc0.h: New file. * linux/arm/ioctls_arch0.h: New file. * linux/arm/ioctls_inc0.h: New file. * linux/avr32/ioctls_arch0.h: New file. * linux/avr32/ioctls_inc0.h: New file. * linux/bfin/ioctls_arch0.h: New file. * linux/bfin/ioctls_inc0.h: New file. * linux/hppa/ioctls_arch0.h: New file. * linux/hppa/ioctls_inc0.h: New file. * linux/i386/ioctls_arch0.h: New file. * linux/i386/ioctls_inc0.h: New file. * linux/ia64/ioctls_arch0.h: New file. * linux/ia64/ioctls_inc0.h: New file. * linux/m68k/ioctls_arch0.h: New file. * linux/m68k/ioctls_inc0.h: New file. * linux/metag/ioctls_arch0.h: New file. * linux/metag/ioctls_inc0.h: New file. * linux/microblaze/ioctls_arch0.h: New file. * linux/microblaze/ioctls_inc0.h: New file. * linux/mips/ioctls_arch0.h: New file. * linux/mips/ioctls_inc0.h: New file. * linux/or1k/ioctls_arch0.h: New file. * linux/or1k/ioctls_inc0.h: New file. * linux/powerpc/ioctls_arch0.h: New file. * linux/powerpc/ioctls_inc0.h: New file. * linux/powerpc64/ioctls_arch0.h: New file. * linux/powerpc64/ioctls_arch1.h: New file. * linux/powerpc64/ioctls_inc0.h: New file. * linux/powerpc64/ioctls_inc1.h: New file. * linux/s390/ioctls_arch0.h: New file. * linux/s390/ioctls_inc0.h: New file. * linux/s390x/ioctls_arch0.h: New file. * linux/s390x/ioctls_inc0.h: New file. * linux/sh/ioctls_arch0.h: New file. * linux/sh/ioctls_inc0.h: New file. * linux/sh64/ioctls_arch0.h: New file. * linux/sh64/ioctls_inc0.h: New file. * linux/sparc/ioctls_arch0.h: New file. * linux/sparc/ioctls_inc0.h: New file. * linux/sparc64/ioctls_arch0.h: New file. * linux/sparc64/ioctls_arch2.h: New file. * linux/sparc64/ioctls_inc0.h: New file. * linux/sparc64/ioctls_inc2.h: New file. * linux/tile/ioctls_arch0.h: New file. * linux/tile/ioctls_arch1.h: New file. * linux/tile/ioctls_inc0.h: New file. * linux/tile/ioctls_inc1.h: New file. * linux/x32/ioctls_arch0.h: New file. * linux/x32/ioctls_arch1.h: New file. * linux/x32/ioctls_inc0.h: New file. * linux/x32/ioctls_inc1.h: New file. * linux/x86_64/ioctls_arch0.h: New file. * linux/x86_64/ioctls_arch1.h: New file. * linux/x86_64/ioctls_inc0.h: New file. * linux/x86_64/ioctls_inc1.h: New file. * linux/xtensa/ioctls_arch0.h: New file. * linux/xtensa/ioctls_inc0.h: New file. * linux/aarch64/ioctlent.h.in: Remove. * linux/aarch64/ioctlent1.h: Remove. * linux/alpha/ioctlent.h.in: Remove. * linux/arc/ioctlent.h.in: Remove. * linux/arm/ioctlent.h.in: Remove. * linux/avr32/ioctlent.h.in: Remove. * linux/bfin/ioctlent.h.in: Remove. * linux/hppa/ioctlent.h.in: Remove. * linux/i386/ioctlent.h.in: Remove. * linux/ia64/ioctlent.h.in: Remove. * linux/ioctlent.h.in: Remove. * linux/ioctlent.sh: Remove. * linux/m68k/ioctlent.h.in: Remove. * linux/metag/ioctlent.h.in: Remove. * linux/microblaze/ioctlent.h.in: Remove. * linux/mips/ioctlent.h.in: Remove. * linux/mips/ioctlent.sh: Remove. * linux/or1k/ioctlent.h.in: Remove. * linux/powerpc/ioctlent.h.in: Remove. * linux/powerpc64/ioctlent.h: Remove. * linux/powerpc64/ioctlent1.h: Remove. * linux/s390/ioctlent.h.in: Remove. * linux/s390x/ioctlent.h.in: Remove. * linux/sh/ioctlent.h.in: Remove. * linux/sh64/ioctlent.h.in: Remove. * linux/sparc/ioctlent.h.in: Remove. * linux/sparc64/ioctlent.h.in: Remove. * linux/sparc64/ioctlent2.h: Remove. * linux/tile/ioctlent.h.in: Remove. * linux/tile/ioctlent1.h: Remove. * linux/x32/ioctlent.h.in: Remove. * linux/x32/ioctlent1.h: Remove. * linux/x86_64/ioctlent.h.in: Remove. * linux/x86_64/ioctlent1.h: Remove. * linux/xtensa/ioctlent.h.in: Remove. * linux/x86_64/ioctlent2.h: Include ioctlent0.h instead of ioctlent.h. * syscall.c (struct_ioctlent ioctlent0): Likewise. * Makefile.am: Remove all ioctlent-related definitions. Define the list of ioctlent*.h files that have to be generated by presence of $(srcdir)/$(OS)/$(ARCH)/ioctls_inc*.h files. Add rules for ioctlent*.h files generation. (EXTRA_DIST): Update. * maint/ioctls_gen.sh: New file. * maint/ioctls_hex.sh: New file. * maint/ioctls_sym.sh: New file. * maint/print_ioctlent.c: New file. * HACKING-scripts: Update for ioctlent.sh -> ioctls_gen.sh migration. * .gitignore: Add ioctlent[012].h and ioctls_all[012].h. * configure.ac (AC_CHECK_HEADERS): Add linux/hiddev.h and linux/mmtimer.h for tests. * tests/ioctl.c: New file. * tests/ioctl.test: New test. * tests/Makefile.am (check_PROGRAMS): Add ioctl. (TESTS): Add ioctl.test. * tests/.gitignore: Add ioctl.
2015-01-19 20:02:16 +03:00
linux/64/ioctls_inc.h \
linux/64/syscallent.h \
linux/aarch64/arch_regs.c \
linux/aarch64/arch_regs.h \
linux/aarch64/arch_sigreturn.c \
linux/aarch64/errnoent1.h \
linux/aarch64/get_error.c \
linux/aarch64/get_scno.c \
linux/aarch64/get_syscall_args.c\
ioctl: take all 32 bits of ioctl commands into account Historically, only 16 bits (8-bit number and 8-bit type) of 32-bit ioctl commands were used for decoding, which was the source for numerous annoying collisions like this: ioctl(0, SNDCTL_TMR_TIMEBASE or SNDRV_TIMER_IOCTL_NEXT_DEVICE or TCGETS, {B38400 opost isig icanon echo ...}) = 0 ioctl(0, MGSL_IOCGPARAMS or MMTIMER_GETRES or MTIOCTOP or SNDCTL_MIDI_MPUMODE, 0x7fffd47f7338) = -1 ENOTTY (Inappropriate ioctl for device) The solution is to use all 32 bits for decoding, not just "number" and "type", but also "size" and "direction". As some architectures override defaults that come from asm-generic/ and provide alternative definitions for some ioctl commands, we support per-architecture ioctl definitions and merge them with common definitions at build time. During the merge, we used to keep both generic and architecture-specific definitions, now architecture-specific definitions have precedence over generic ones -- ioctlsort omits definitions from asm-generic/ for those ioctl names that have different definitions in asm/. Additional bits of "direction" are architecture specific -- the number of bits and their values differ between architectures. To reduce architecture differences in the source code, we keep "direction" in symbolic form and compile it in ioctlsort. Additional bits of "size" are also architecture specific -- not only the number of bits differ between architectures, but sizes of many types depend on sizeof(long). To reduce architecture differences in the source code, we keep 32-bit and 64-bit versions of common ioctl definitions, and use the appropriate version for each architecture and personality. To implement this, the tools for generating ioctl definitions from kernel headers have been rewritten, and the source format of ioctl definitions has been extended. The final ioctlent*.h files that are included by syscall.c are now generated from source ioctls_inc*.h and ioctls_arch*.h files at build time with ioctlsort. * ioctl.c (ioctl_lookup): Use all 32 bits of ioctl command code. * ioctlsort.c: Rewritten. * linux/32/ioctls_inc.h: New file. * linux/64/ioctls_inc.h: New file. * linux/aarch64/ioctls_arch0.h: New file. * linux/aarch64/ioctls_arch1.h: New file. * linux/aarch64/ioctls_inc0.h: New file. * linux/aarch64/ioctls_inc1.h: New file. * linux/alpha/ioctls_arch0.h: New file. * linux/alpha/ioctls_inc0.h: New file. * linux/arc/ioctls_arch0.h: New file. * linux/arc/ioctls_inc0.h: New file. * linux/arm/ioctls_arch0.h: New file. * linux/arm/ioctls_inc0.h: New file. * linux/avr32/ioctls_arch0.h: New file. * linux/avr32/ioctls_inc0.h: New file. * linux/bfin/ioctls_arch0.h: New file. * linux/bfin/ioctls_inc0.h: New file. * linux/hppa/ioctls_arch0.h: New file. * linux/hppa/ioctls_inc0.h: New file. * linux/i386/ioctls_arch0.h: New file. * linux/i386/ioctls_inc0.h: New file. * linux/ia64/ioctls_arch0.h: New file. * linux/ia64/ioctls_inc0.h: New file. * linux/m68k/ioctls_arch0.h: New file. * linux/m68k/ioctls_inc0.h: New file. * linux/metag/ioctls_arch0.h: New file. * linux/metag/ioctls_inc0.h: New file. * linux/microblaze/ioctls_arch0.h: New file. * linux/microblaze/ioctls_inc0.h: New file. * linux/mips/ioctls_arch0.h: New file. * linux/mips/ioctls_inc0.h: New file. * linux/or1k/ioctls_arch0.h: New file. * linux/or1k/ioctls_inc0.h: New file. * linux/powerpc/ioctls_arch0.h: New file. * linux/powerpc/ioctls_inc0.h: New file. * linux/powerpc64/ioctls_arch0.h: New file. * linux/powerpc64/ioctls_arch1.h: New file. * linux/powerpc64/ioctls_inc0.h: New file. * linux/powerpc64/ioctls_inc1.h: New file. * linux/s390/ioctls_arch0.h: New file. * linux/s390/ioctls_inc0.h: New file. * linux/s390x/ioctls_arch0.h: New file. * linux/s390x/ioctls_inc0.h: New file. * linux/sh/ioctls_arch0.h: New file. * linux/sh/ioctls_inc0.h: New file. * linux/sh64/ioctls_arch0.h: New file. * linux/sh64/ioctls_inc0.h: New file. * linux/sparc/ioctls_arch0.h: New file. * linux/sparc/ioctls_inc0.h: New file. * linux/sparc64/ioctls_arch0.h: New file. * linux/sparc64/ioctls_arch2.h: New file. * linux/sparc64/ioctls_inc0.h: New file. * linux/sparc64/ioctls_inc2.h: New file. * linux/tile/ioctls_arch0.h: New file. * linux/tile/ioctls_arch1.h: New file. * linux/tile/ioctls_inc0.h: New file. * linux/tile/ioctls_inc1.h: New file. * linux/x32/ioctls_arch0.h: New file. * linux/x32/ioctls_arch1.h: New file. * linux/x32/ioctls_inc0.h: New file. * linux/x32/ioctls_inc1.h: New file. * linux/x86_64/ioctls_arch0.h: New file. * linux/x86_64/ioctls_arch1.h: New file. * linux/x86_64/ioctls_inc0.h: New file. * linux/x86_64/ioctls_inc1.h: New file. * linux/xtensa/ioctls_arch0.h: New file. * linux/xtensa/ioctls_inc0.h: New file. * linux/aarch64/ioctlent.h.in: Remove. * linux/aarch64/ioctlent1.h: Remove. * linux/alpha/ioctlent.h.in: Remove. * linux/arc/ioctlent.h.in: Remove. * linux/arm/ioctlent.h.in: Remove. * linux/avr32/ioctlent.h.in: Remove. * linux/bfin/ioctlent.h.in: Remove. * linux/hppa/ioctlent.h.in: Remove. * linux/i386/ioctlent.h.in: Remove. * linux/ia64/ioctlent.h.in: Remove. * linux/ioctlent.h.in: Remove. * linux/ioctlent.sh: Remove. * linux/m68k/ioctlent.h.in: Remove. * linux/metag/ioctlent.h.in: Remove. * linux/microblaze/ioctlent.h.in: Remove. * linux/mips/ioctlent.h.in: Remove. * linux/mips/ioctlent.sh: Remove. * linux/or1k/ioctlent.h.in: Remove. * linux/powerpc/ioctlent.h.in: Remove. * linux/powerpc64/ioctlent.h: Remove. * linux/powerpc64/ioctlent1.h: Remove. * linux/s390/ioctlent.h.in: Remove. * linux/s390x/ioctlent.h.in: Remove. * linux/sh/ioctlent.h.in: Remove. * linux/sh64/ioctlent.h.in: Remove. * linux/sparc/ioctlent.h.in: Remove. * linux/sparc64/ioctlent.h.in: Remove. * linux/sparc64/ioctlent2.h: Remove. * linux/tile/ioctlent.h.in: Remove. * linux/tile/ioctlent1.h: Remove. * linux/x32/ioctlent.h.in: Remove. * linux/x32/ioctlent1.h: Remove. * linux/x86_64/ioctlent.h.in: Remove. * linux/x86_64/ioctlent1.h: Remove. * linux/xtensa/ioctlent.h.in: Remove. * linux/x86_64/ioctlent2.h: Include ioctlent0.h instead of ioctlent.h. * syscall.c (struct_ioctlent ioctlent0): Likewise. * Makefile.am: Remove all ioctlent-related definitions. Define the list of ioctlent*.h files that have to be generated by presence of $(srcdir)/$(OS)/$(ARCH)/ioctls_inc*.h files. Add rules for ioctlent*.h files generation. (EXTRA_DIST): Update. * maint/ioctls_gen.sh: New file. * maint/ioctls_hex.sh: New file. * maint/ioctls_sym.sh: New file. * maint/print_ioctlent.c: New file. * HACKING-scripts: Update for ioctlent.sh -> ioctls_gen.sh migration. * .gitignore: Add ioctlent[012].h and ioctls_all[012].h. * configure.ac (AC_CHECK_HEADERS): Add linux/hiddev.h and linux/mmtimer.h for tests. * tests/ioctl.c: New file. * tests/ioctl.test: New test. * tests/Makefile.am (check_PROGRAMS): Add ioctl. (TESTS): Add ioctl.test. * tests/.gitignore: Add ioctl.
2015-01-19 20:02:16 +03:00
linux/aarch64/ioctls_arch0.h \
linux/aarch64/ioctls_arch1.h \
linux/aarch64/ioctls_inc0.h \
linux/aarch64/ioctls_inc1.h \
Implement arch specific methods of changing syscall number and error code This introduces arch_set_error and arch_set_scno functions for each supported architecture, needed to implement syscall fault injection. * linux/aarch64/set_error.c: New file. * linux/aarch64/set_scno.c: Likewise. * linux/alpha/set_error.c: Likewise. * linux/alpha/set_scno.c: Likewise. * linux/arc/set_error.c: Likewise. * linux/arc/set_scno.c: Likewise. * linux/arm/set_error.c: Likewise. * linux/arm/set_scno.c: Likewise. * linux/avr32/set_error.c: Likewise. * linux/avr32/set_scno.c: Likewise. * linux/bfin/set_error.c: Likewise. * linux/bfin/set_scno.c: Likewise. * linux/crisv10/set_error.c: Likewise. * linux/crisv10/set_scno.c: Likewise. * linux/crisv32/set_error.c: Likewise. * linux/crisv32/set_scno.c: Likewise. * linux/hppa/set_error.c: Likewise. * linux/hppa/set_scno.c: Likewise. * linux/i386/set_error.c: Likewise. * linux/i386/set_scno.c: Likewise. * linux/ia64/set_error.c: Likewise. * linux/ia64/set_scno.c: Likewise. * linux/m68k/set_error.c: Likewise. * linux/m68k/set_scno.c: Likewise. * linux/metag/set_error.c: Likewise. * linux/metag/set_scno.c: Likewise. * linux/microblaze/set_error.c: Likewise. * linux/microblaze/set_scno.c: Likewise. * linux/mips/set_error.c: Likewise. * linux/mips/set_scno.c: Likewise. * linux/nios2/set_error.c: Likewise. * linux/nios2/set_scno.c: Likewise. * linux/or1k/set_error.c: Likewise. * linux/or1k/set_scno.c: Likewise. * linux/powerpc/set_error.c: Likewise. * linux/powerpc/set_scno.c: Likewise. * linux/powerpc64/set_error.c: Likewise. * linux/powerpc64/set_scno.c: Likewise. * linux/riscv/set_error.c: Likewise. * linux/riscv/set_scno.c: Likewise. * linux/s390/set_error.c: Likewise. * linux/s390/set_scno.c: Likewise. * linux/s390x/set_error.c: Likewise. * linux/s390x/set_scno.c: Likewise. * linux/sh/set_error.c: Likewise. * linux/sh/set_scno.c: Likewise. * linux/sh64/set_error.c: Likewise. * linux/sh64/set_scno.c: Likewise. * linux/sparc/set_error.c: Likewise. * linux/sparc/set_scno.c: Likewise. * linux/sparc64/set_error.c: Likewise. * linux/sparc64/set_scno.c: Likewise. * linux/tile/set_error.c: Likewise. * linux/tile/set_scno.c: Likewise. * linux/x32/set_error.c: Likewise. * linux/x32/set_scno.c: Likewise. * linux/x86_64/set_error.c: Likewise. * linux/x86_64/set_scno.c: Likewise. * linux/xtensa/set_error.c: Likewise. * linux/xtensa/set_scno.c: Likewise. * Makefile.am (EXTRA_DIST): Add them.
2016-11-15 20:38:21 +03:00
linux/aarch64/set_error.c \
linux/aarch64/set_scno.c \
linux/aarch64/signalent1.h \
linux/aarch64/syscallent.h \
linux/aarch64/syscallent1.h \
linux/alpha/arch_getrval2.c \
linux/alpha/arch_regs.c \
linux/alpha/arch_regs.h \
linux/alpha/arch_sigreturn.c \
linux/alpha/errnoent.h \
linux/alpha/get_error.c \
linux/alpha/get_scno.c \
linux/alpha/get_syscall_args.c \
linux/alpha/get_syscall_result.c\
ioctl: take all 32 bits of ioctl commands into account Historically, only 16 bits (8-bit number and 8-bit type) of 32-bit ioctl commands were used for decoding, which was the source for numerous annoying collisions like this: ioctl(0, SNDCTL_TMR_TIMEBASE or SNDRV_TIMER_IOCTL_NEXT_DEVICE or TCGETS, {B38400 opost isig icanon echo ...}) = 0 ioctl(0, MGSL_IOCGPARAMS or MMTIMER_GETRES or MTIOCTOP or SNDCTL_MIDI_MPUMODE, 0x7fffd47f7338) = -1 ENOTTY (Inappropriate ioctl for device) The solution is to use all 32 bits for decoding, not just "number" and "type", but also "size" and "direction". As some architectures override defaults that come from asm-generic/ and provide alternative definitions for some ioctl commands, we support per-architecture ioctl definitions and merge them with common definitions at build time. During the merge, we used to keep both generic and architecture-specific definitions, now architecture-specific definitions have precedence over generic ones -- ioctlsort omits definitions from asm-generic/ for those ioctl names that have different definitions in asm/. Additional bits of "direction" are architecture specific -- the number of bits and their values differ between architectures. To reduce architecture differences in the source code, we keep "direction" in symbolic form and compile it in ioctlsort. Additional bits of "size" are also architecture specific -- not only the number of bits differ between architectures, but sizes of many types depend on sizeof(long). To reduce architecture differences in the source code, we keep 32-bit and 64-bit versions of common ioctl definitions, and use the appropriate version for each architecture and personality. To implement this, the tools for generating ioctl definitions from kernel headers have been rewritten, and the source format of ioctl definitions has been extended. The final ioctlent*.h files that are included by syscall.c are now generated from source ioctls_inc*.h and ioctls_arch*.h files at build time with ioctlsort. * ioctl.c (ioctl_lookup): Use all 32 bits of ioctl command code. * ioctlsort.c: Rewritten. * linux/32/ioctls_inc.h: New file. * linux/64/ioctls_inc.h: New file. * linux/aarch64/ioctls_arch0.h: New file. * linux/aarch64/ioctls_arch1.h: New file. * linux/aarch64/ioctls_inc0.h: New file. * linux/aarch64/ioctls_inc1.h: New file. * linux/alpha/ioctls_arch0.h: New file. * linux/alpha/ioctls_inc0.h: New file. * linux/arc/ioctls_arch0.h: New file. * linux/arc/ioctls_inc0.h: New file. * linux/arm/ioctls_arch0.h: New file. * linux/arm/ioctls_inc0.h: New file. * linux/avr32/ioctls_arch0.h: New file. * linux/avr32/ioctls_inc0.h: New file. * linux/bfin/ioctls_arch0.h: New file. * linux/bfin/ioctls_inc0.h: New file. * linux/hppa/ioctls_arch0.h: New file. * linux/hppa/ioctls_inc0.h: New file. * linux/i386/ioctls_arch0.h: New file. * linux/i386/ioctls_inc0.h: New file. * linux/ia64/ioctls_arch0.h: New file. * linux/ia64/ioctls_inc0.h: New file. * linux/m68k/ioctls_arch0.h: New file. * linux/m68k/ioctls_inc0.h: New file. * linux/metag/ioctls_arch0.h: New file. * linux/metag/ioctls_inc0.h: New file. * linux/microblaze/ioctls_arch0.h: New file. * linux/microblaze/ioctls_inc0.h: New file. * linux/mips/ioctls_arch0.h: New file. * linux/mips/ioctls_inc0.h: New file. * linux/or1k/ioctls_arch0.h: New file. * linux/or1k/ioctls_inc0.h: New file. * linux/powerpc/ioctls_arch0.h: New file. * linux/powerpc/ioctls_inc0.h: New file. * linux/powerpc64/ioctls_arch0.h: New file. * linux/powerpc64/ioctls_arch1.h: New file. * linux/powerpc64/ioctls_inc0.h: New file. * linux/powerpc64/ioctls_inc1.h: New file. * linux/s390/ioctls_arch0.h: New file. * linux/s390/ioctls_inc0.h: New file. * linux/s390x/ioctls_arch0.h: New file. * linux/s390x/ioctls_inc0.h: New file. * linux/sh/ioctls_arch0.h: New file. * linux/sh/ioctls_inc0.h: New file. * linux/sh64/ioctls_arch0.h: New file. * linux/sh64/ioctls_inc0.h: New file. * linux/sparc/ioctls_arch0.h: New file. * linux/sparc/ioctls_inc0.h: New file. * linux/sparc64/ioctls_arch0.h: New file. * linux/sparc64/ioctls_arch2.h: New file. * linux/sparc64/ioctls_inc0.h: New file. * linux/sparc64/ioctls_inc2.h: New file. * linux/tile/ioctls_arch0.h: New file. * linux/tile/ioctls_arch1.h: New file. * linux/tile/ioctls_inc0.h: New file. * linux/tile/ioctls_inc1.h: New file. * linux/x32/ioctls_arch0.h: New file. * linux/x32/ioctls_arch1.h: New file. * linux/x32/ioctls_inc0.h: New file. * linux/x32/ioctls_inc1.h: New file. * linux/x86_64/ioctls_arch0.h: New file. * linux/x86_64/ioctls_arch1.h: New file. * linux/x86_64/ioctls_inc0.h: New file. * linux/x86_64/ioctls_inc1.h: New file. * linux/xtensa/ioctls_arch0.h: New file. * linux/xtensa/ioctls_inc0.h: New file. * linux/aarch64/ioctlent.h.in: Remove. * linux/aarch64/ioctlent1.h: Remove. * linux/alpha/ioctlent.h.in: Remove. * linux/arc/ioctlent.h.in: Remove. * linux/arm/ioctlent.h.in: Remove. * linux/avr32/ioctlent.h.in: Remove. * linux/bfin/ioctlent.h.in: Remove. * linux/hppa/ioctlent.h.in: Remove. * linux/i386/ioctlent.h.in: Remove. * linux/ia64/ioctlent.h.in: Remove. * linux/ioctlent.h.in: Remove. * linux/ioctlent.sh: Remove. * linux/m68k/ioctlent.h.in: Remove. * linux/metag/ioctlent.h.in: Remove. * linux/microblaze/ioctlent.h.in: Remove. * linux/mips/ioctlent.h.in: Remove. * linux/mips/ioctlent.sh: Remove. * linux/or1k/ioctlent.h.in: Remove. * linux/powerpc/ioctlent.h.in: Remove. * linux/powerpc64/ioctlent.h: Remove. * linux/powerpc64/ioctlent1.h: Remove. * linux/s390/ioctlent.h.in: Remove. * linux/s390x/ioctlent.h.in: Remove. * linux/sh/ioctlent.h.in: Remove. * linux/sh64/ioctlent.h.in: Remove. * linux/sparc/ioctlent.h.in: Remove. * linux/sparc64/ioctlent.h.in: Remove. * linux/sparc64/ioctlent2.h: Remove. * linux/tile/ioctlent.h.in: Remove. * linux/tile/ioctlent1.h: Remove. * linux/x32/ioctlent.h.in: Remove. * linux/x32/ioctlent1.h: Remove. * linux/x86_64/ioctlent.h.in: Remove. * linux/x86_64/ioctlent1.h: Remove. * linux/xtensa/ioctlent.h.in: Remove. * linux/x86_64/ioctlent2.h: Include ioctlent0.h instead of ioctlent.h. * syscall.c (struct_ioctlent ioctlent0): Likewise. * Makefile.am: Remove all ioctlent-related definitions. Define the list of ioctlent*.h files that have to be generated by presence of $(srcdir)/$(OS)/$(ARCH)/ioctls_inc*.h files. Add rules for ioctlent*.h files generation. (EXTRA_DIST): Update. * maint/ioctls_gen.sh: New file. * maint/ioctls_hex.sh: New file. * maint/ioctls_sym.sh: New file. * maint/print_ioctlent.c: New file. * HACKING-scripts: Update for ioctlent.sh -> ioctls_gen.sh migration. * .gitignore: Add ioctlent[012].h and ioctls_all[012].h. * configure.ac (AC_CHECK_HEADERS): Add linux/hiddev.h and linux/mmtimer.h for tests. * tests/ioctl.c: New file. * tests/ioctl.test: New test. * tests/Makefile.am (check_PROGRAMS): Add ioctl. (TESTS): Add ioctl.test. * tests/.gitignore: Add ioctl.
2015-01-19 20:02:16 +03:00
linux/alpha/ioctls_arch0.h \
linux/alpha/ioctls_inc0.h \
Implement arch specific methods of changing syscall number and error code This introduces arch_set_error and arch_set_scno functions for each supported architecture, needed to implement syscall fault injection. * linux/aarch64/set_error.c: New file. * linux/aarch64/set_scno.c: Likewise. * linux/alpha/set_error.c: Likewise. * linux/alpha/set_scno.c: Likewise. * linux/arc/set_error.c: Likewise. * linux/arc/set_scno.c: Likewise. * linux/arm/set_error.c: Likewise. * linux/arm/set_scno.c: Likewise. * linux/avr32/set_error.c: Likewise. * linux/avr32/set_scno.c: Likewise. * linux/bfin/set_error.c: Likewise. * linux/bfin/set_scno.c: Likewise. * linux/crisv10/set_error.c: Likewise. * linux/crisv10/set_scno.c: Likewise. * linux/crisv32/set_error.c: Likewise. * linux/crisv32/set_scno.c: Likewise. * linux/hppa/set_error.c: Likewise. * linux/hppa/set_scno.c: Likewise. * linux/i386/set_error.c: Likewise. * linux/i386/set_scno.c: Likewise. * linux/ia64/set_error.c: Likewise. * linux/ia64/set_scno.c: Likewise. * linux/m68k/set_error.c: Likewise. * linux/m68k/set_scno.c: Likewise. * linux/metag/set_error.c: Likewise. * linux/metag/set_scno.c: Likewise. * linux/microblaze/set_error.c: Likewise. * linux/microblaze/set_scno.c: Likewise. * linux/mips/set_error.c: Likewise. * linux/mips/set_scno.c: Likewise. * linux/nios2/set_error.c: Likewise. * linux/nios2/set_scno.c: Likewise. * linux/or1k/set_error.c: Likewise. * linux/or1k/set_scno.c: Likewise. * linux/powerpc/set_error.c: Likewise. * linux/powerpc/set_scno.c: Likewise. * linux/powerpc64/set_error.c: Likewise. * linux/powerpc64/set_scno.c: Likewise. * linux/riscv/set_error.c: Likewise. * linux/riscv/set_scno.c: Likewise. * linux/s390/set_error.c: Likewise. * linux/s390/set_scno.c: Likewise. * linux/s390x/set_error.c: Likewise. * linux/s390x/set_scno.c: Likewise. * linux/sh/set_error.c: Likewise. * linux/sh/set_scno.c: Likewise. * linux/sh64/set_error.c: Likewise. * linux/sh64/set_scno.c: Likewise. * linux/sparc/set_error.c: Likewise. * linux/sparc/set_scno.c: Likewise. * linux/sparc64/set_error.c: Likewise. * linux/sparc64/set_scno.c: Likewise. * linux/tile/set_error.c: Likewise. * linux/tile/set_scno.c: Likewise. * linux/x32/set_error.c: Likewise. * linux/x32/set_scno.c: Likewise. * linux/x86_64/set_error.c: Likewise. * linux/x86_64/set_scno.c: Likewise. * linux/xtensa/set_error.c: Likewise. * linux/xtensa/set_scno.c: Likewise. * Makefile.am (EXTRA_DIST): Add them.
2016-11-15 20:38:21 +03:00
linux/alpha/set_error.c \
linux/alpha/set_scno.c \
linux/alpha/signalent.h \
linux/alpha/syscallent.h \
linux/alpha/userent.h \
linux/arc/arch_regs.c \
linux/arc/get_error.c \
linux/arc/get_scno.c \
linux/arc/get_syscall_args.c \
ioctl: take all 32 bits of ioctl commands into account Historically, only 16 bits (8-bit number and 8-bit type) of 32-bit ioctl commands were used for decoding, which was the source for numerous annoying collisions like this: ioctl(0, SNDCTL_TMR_TIMEBASE or SNDRV_TIMER_IOCTL_NEXT_DEVICE or TCGETS, {B38400 opost isig icanon echo ...}) = 0 ioctl(0, MGSL_IOCGPARAMS or MMTIMER_GETRES or MTIOCTOP or SNDCTL_MIDI_MPUMODE, 0x7fffd47f7338) = -1 ENOTTY (Inappropriate ioctl for device) The solution is to use all 32 bits for decoding, not just "number" and "type", but also "size" and "direction". As some architectures override defaults that come from asm-generic/ and provide alternative definitions for some ioctl commands, we support per-architecture ioctl definitions and merge them with common definitions at build time. During the merge, we used to keep both generic and architecture-specific definitions, now architecture-specific definitions have precedence over generic ones -- ioctlsort omits definitions from asm-generic/ for those ioctl names that have different definitions in asm/. Additional bits of "direction" are architecture specific -- the number of bits and their values differ between architectures. To reduce architecture differences in the source code, we keep "direction" in symbolic form and compile it in ioctlsort. Additional bits of "size" are also architecture specific -- not only the number of bits differ between architectures, but sizes of many types depend on sizeof(long). To reduce architecture differences in the source code, we keep 32-bit and 64-bit versions of common ioctl definitions, and use the appropriate version for each architecture and personality. To implement this, the tools for generating ioctl definitions from kernel headers have been rewritten, and the source format of ioctl definitions has been extended. The final ioctlent*.h files that are included by syscall.c are now generated from source ioctls_inc*.h and ioctls_arch*.h files at build time with ioctlsort. * ioctl.c (ioctl_lookup): Use all 32 bits of ioctl command code. * ioctlsort.c: Rewritten. * linux/32/ioctls_inc.h: New file. * linux/64/ioctls_inc.h: New file. * linux/aarch64/ioctls_arch0.h: New file. * linux/aarch64/ioctls_arch1.h: New file. * linux/aarch64/ioctls_inc0.h: New file. * linux/aarch64/ioctls_inc1.h: New file. * linux/alpha/ioctls_arch0.h: New file. * linux/alpha/ioctls_inc0.h: New file. * linux/arc/ioctls_arch0.h: New file. * linux/arc/ioctls_inc0.h: New file. * linux/arm/ioctls_arch0.h: New file. * linux/arm/ioctls_inc0.h: New file. * linux/avr32/ioctls_arch0.h: New file. * linux/avr32/ioctls_inc0.h: New file. * linux/bfin/ioctls_arch0.h: New file. * linux/bfin/ioctls_inc0.h: New file. * linux/hppa/ioctls_arch0.h: New file. * linux/hppa/ioctls_inc0.h: New file. * linux/i386/ioctls_arch0.h: New file. * linux/i386/ioctls_inc0.h: New file. * linux/ia64/ioctls_arch0.h: New file. * linux/ia64/ioctls_inc0.h: New file. * linux/m68k/ioctls_arch0.h: New file. * linux/m68k/ioctls_inc0.h: New file. * linux/metag/ioctls_arch0.h: New file. * linux/metag/ioctls_inc0.h: New file. * linux/microblaze/ioctls_arch0.h: New file. * linux/microblaze/ioctls_inc0.h: New file. * linux/mips/ioctls_arch0.h: New file. * linux/mips/ioctls_inc0.h: New file. * linux/or1k/ioctls_arch0.h: New file. * linux/or1k/ioctls_inc0.h: New file. * linux/powerpc/ioctls_arch0.h: New file. * linux/powerpc/ioctls_inc0.h: New file. * linux/powerpc64/ioctls_arch0.h: New file. * linux/powerpc64/ioctls_arch1.h: New file. * linux/powerpc64/ioctls_inc0.h: New file. * linux/powerpc64/ioctls_inc1.h: New file. * linux/s390/ioctls_arch0.h: New file. * linux/s390/ioctls_inc0.h: New file. * linux/s390x/ioctls_arch0.h: New file. * linux/s390x/ioctls_inc0.h: New file. * linux/sh/ioctls_arch0.h: New file. * linux/sh/ioctls_inc0.h: New file. * linux/sh64/ioctls_arch0.h: New file. * linux/sh64/ioctls_inc0.h: New file. * linux/sparc/ioctls_arch0.h: New file. * linux/sparc/ioctls_inc0.h: New file. * linux/sparc64/ioctls_arch0.h: New file. * linux/sparc64/ioctls_arch2.h: New file. * linux/sparc64/ioctls_inc0.h: New file. * linux/sparc64/ioctls_inc2.h: New file. * linux/tile/ioctls_arch0.h: New file. * linux/tile/ioctls_arch1.h: New file. * linux/tile/ioctls_inc0.h: New file. * linux/tile/ioctls_inc1.h: New file. * linux/x32/ioctls_arch0.h: New file. * linux/x32/ioctls_arch1.h: New file. * linux/x32/ioctls_inc0.h: New file. * linux/x32/ioctls_inc1.h: New file. * linux/x86_64/ioctls_arch0.h: New file. * linux/x86_64/ioctls_arch1.h: New file. * linux/x86_64/ioctls_inc0.h: New file. * linux/x86_64/ioctls_inc1.h: New file. * linux/xtensa/ioctls_arch0.h: New file. * linux/xtensa/ioctls_inc0.h: New file. * linux/aarch64/ioctlent.h.in: Remove. * linux/aarch64/ioctlent1.h: Remove. * linux/alpha/ioctlent.h.in: Remove. * linux/arc/ioctlent.h.in: Remove. * linux/arm/ioctlent.h.in: Remove. * linux/avr32/ioctlent.h.in: Remove. * linux/bfin/ioctlent.h.in: Remove. * linux/hppa/ioctlent.h.in: Remove. * linux/i386/ioctlent.h.in: Remove. * linux/ia64/ioctlent.h.in: Remove. * linux/ioctlent.h.in: Remove. * linux/ioctlent.sh: Remove. * linux/m68k/ioctlent.h.in: Remove. * linux/metag/ioctlent.h.in: Remove. * linux/microblaze/ioctlent.h.in: Remove. * linux/mips/ioctlent.h.in: Remove. * linux/mips/ioctlent.sh: Remove. * linux/or1k/ioctlent.h.in: Remove. * linux/powerpc/ioctlent.h.in: Remove. * linux/powerpc64/ioctlent.h: Remove. * linux/powerpc64/ioctlent1.h: Remove. * linux/s390/ioctlent.h.in: Remove. * linux/s390x/ioctlent.h.in: Remove. * linux/sh/ioctlent.h.in: Remove. * linux/sh64/ioctlent.h.in: Remove. * linux/sparc/ioctlent.h.in: Remove. * linux/sparc64/ioctlent.h.in: Remove. * linux/sparc64/ioctlent2.h: Remove. * linux/tile/ioctlent.h.in: Remove. * linux/tile/ioctlent1.h: Remove. * linux/x32/ioctlent.h.in: Remove. * linux/x32/ioctlent1.h: Remove. * linux/x86_64/ioctlent.h.in: Remove. * linux/x86_64/ioctlent1.h: Remove. * linux/xtensa/ioctlent.h.in: Remove. * linux/x86_64/ioctlent2.h: Include ioctlent0.h instead of ioctlent.h. * syscall.c (struct_ioctlent ioctlent0): Likewise. * Makefile.am: Remove all ioctlent-related definitions. Define the list of ioctlent*.h files that have to be generated by presence of $(srcdir)/$(OS)/$(ARCH)/ioctls_inc*.h files. Add rules for ioctlent*.h files generation. (EXTRA_DIST): Update. * maint/ioctls_gen.sh: New file. * maint/ioctls_hex.sh: New file. * maint/ioctls_sym.sh: New file. * maint/print_ioctlent.c: New file. * HACKING-scripts: Update for ioctlent.sh -> ioctls_gen.sh migration. * .gitignore: Add ioctlent[012].h and ioctls_all[012].h. * configure.ac (AC_CHECK_HEADERS): Add linux/hiddev.h and linux/mmtimer.h for tests. * tests/ioctl.c: New file. * tests/ioctl.test: New test. * tests/Makefile.am (check_PROGRAMS): Add ioctl. (TESTS): Add ioctl.test. * tests/.gitignore: Add ioctl.
2015-01-19 20:02:16 +03:00
linux/arc/ioctls_arch0.h \
linux/arc/ioctls_inc0.h \
Implement arch specific methods of changing syscall number and error code This introduces arch_set_error and arch_set_scno functions for each supported architecture, needed to implement syscall fault injection. * linux/aarch64/set_error.c: New file. * linux/aarch64/set_scno.c: Likewise. * linux/alpha/set_error.c: Likewise. * linux/alpha/set_scno.c: Likewise. * linux/arc/set_error.c: Likewise. * linux/arc/set_scno.c: Likewise. * linux/arm/set_error.c: Likewise. * linux/arm/set_scno.c: Likewise. * linux/avr32/set_error.c: Likewise. * linux/avr32/set_scno.c: Likewise. * linux/bfin/set_error.c: Likewise. * linux/bfin/set_scno.c: Likewise. * linux/crisv10/set_error.c: Likewise. * linux/crisv10/set_scno.c: Likewise. * linux/crisv32/set_error.c: Likewise. * linux/crisv32/set_scno.c: Likewise. * linux/hppa/set_error.c: Likewise. * linux/hppa/set_scno.c: Likewise. * linux/i386/set_error.c: Likewise. * linux/i386/set_scno.c: Likewise. * linux/ia64/set_error.c: Likewise. * linux/ia64/set_scno.c: Likewise. * linux/m68k/set_error.c: Likewise. * linux/m68k/set_scno.c: Likewise. * linux/metag/set_error.c: Likewise. * linux/metag/set_scno.c: Likewise. * linux/microblaze/set_error.c: Likewise. * linux/microblaze/set_scno.c: Likewise. * linux/mips/set_error.c: Likewise. * linux/mips/set_scno.c: Likewise. * linux/nios2/set_error.c: Likewise. * linux/nios2/set_scno.c: Likewise. * linux/or1k/set_error.c: Likewise. * linux/or1k/set_scno.c: Likewise. * linux/powerpc/set_error.c: Likewise. * linux/powerpc/set_scno.c: Likewise. * linux/powerpc64/set_error.c: Likewise. * linux/powerpc64/set_scno.c: Likewise. * linux/riscv/set_error.c: Likewise. * linux/riscv/set_scno.c: Likewise. * linux/s390/set_error.c: Likewise. * linux/s390/set_scno.c: Likewise. * linux/s390x/set_error.c: Likewise. * linux/s390x/set_scno.c: Likewise. * linux/sh/set_error.c: Likewise. * linux/sh/set_scno.c: Likewise. * linux/sh64/set_error.c: Likewise. * linux/sh64/set_scno.c: Likewise. * linux/sparc/set_error.c: Likewise. * linux/sparc/set_scno.c: Likewise. * linux/sparc64/set_error.c: Likewise. * linux/sparc64/set_scno.c: Likewise. * linux/tile/set_error.c: Likewise. * linux/tile/set_scno.c: Likewise. * linux/x32/set_error.c: Likewise. * linux/x32/set_scno.c: Likewise. * linux/x86_64/set_error.c: Likewise. * linux/x86_64/set_scno.c: Likewise. * linux/xtensa/set_error.c: Likewise. * linux/xtensa/set_scno.c: Likewise. * Makefile.am (EXTRA_DIST): Add them.
2016-11-15 20:38:21 +03:00
linux/arc/set_error.c \
linux/arc/set_scno.c \
linux/arc/syscallent.h \
linux/arch_regs.h \
linux/arch_sigreturn.c \
linux/arm/arch_regs.c \
linux/arm/arch_regs.h \
linux/arm/arch_sigreturn.c \
linux/arm/get_error.c \
linux/arm/get_scno.c \
linux/arm/get_syscall_args.c \
ioctl: take all 32 bits of ioctl commands into account Historically, only 16 bits (8-bit number and 8-bit type) of 32-bit ioctl commands were used for decoding, which was the source for numerous annoying collisions like this: ioctl(0, SNDCTL_TMR_TIMEBASE or SNDRV_TIMER_IOCTL_NEXT_DEVICE or TCGETS, {B38400 opost isig icanon echo ...}) = 0 ioctl(0, MGSL_IOCGPARAMS or MMTIMER_GETRES or MTIOCTOP or SNDCTL_MIDI_MPUMODE, 0x7fffd47f7338) = -1 ENOTTY (Inappropriate ioctl for device) The solution is to use all 32 bits for decoding, not just "number" and "type", but also "size" and "direction". As some architectures override defaults that come from asm-generic/ and provide alternative definitions for some ioctl commands, we support per-architecture ioctl definitions and merge them with common definitions at build time. During the merge, we used to keep both generic and architecture-specific definitions, now architecture-specific definitions have precedence over generic ones -- ioctlsort omits definitions from asm-generic/ for those ioctl names that have different definitions in asm/. Additional bits of "direction" are architecture specific -- the number of bits and their values differ between architectures. To reduce architecture differences in the source code, we keep "direction" in symbolic form and compile it in ioctlsort. Additional bits of "size" are also architecture specific -- not only the number of bits differ between architectures, but sizes of many types depend on sizeof(long). To reduce architecture differences in the source code, we keep 32-bit and 64-bit versions of common ioctl definitions, and use the appropriate version for each architecture and personality. To implement this, the tools for generating ioctl definitions from kernel headers have been rewritten, and the source format of ioctl definitions has been extended. The final ioctlent*.h files that are included by syscall.c are now generated from source ioctls_inc*.h and ioctls_arch*.h files at build time with ioctlsort. * ioctl.c (ioctl_lookup): Use all 32 bits of ioctl command code. * ioctlsort.c: Rewritten. * linux/32/ioctls_inc.h: New file. * linux/64/ioctls_inc.h: New file. * linux/aarch64/ioctls_arch0.h: New file. * linux/aarch64/ioctls_arch1.h: New file. * linux/aarch64/ioctls_inc0.h: New file. * linux/aarch64/ioctls_inc1.h: New file. * linux/alpha/ioctls_arch0.h: New file. * linux/alpha/ioctls_inc0.h: New file. * linux/arc/ioctls_arch0.h: New file. * linux/arc/ioctls_inc0.h: New file. * linux/arm/ioctls_arch0.h: New file. * linux/arm/ioctls_inc0.h: New file. * linux/avr32/ioctls_arch0.h: New file. * linux/avr32/ioctls_inc0.h: New file. * linux/bfin/ioctls_arch0.h: New file. * linux/bfin/ioctls_inc0.h: New file. * linux/hppa/ioctls_arch0.h: New file. * linux/hppa/ioctls_inc0.h: New file. * linux/i386/ioctls_arch0.h: New file. * linux/i386/ioctls_inc0.h: New file. * linux/ia64/ioctls_arch0.h: New file. * linux/ia64/ioctls_inc0.h: New file. * linux/m68k/ioctls_arch0.h: New file. * linux/m68k/ioctls_inc0.h: New file. * linux/metag/ioctls_arch0.h: New file. * linux/metag/ioctls_inc0.h: New file. * linux/microblaze/ioctls_arch0.h: New file. * linux/microblaze/ioctls_inc0.h: New file. * linux/mips/ioctls_arch0.h: New file. * linux/mips/ioctls_inc0.h: New file. * linux/or1k/ioctls_arch0.h: New file. * linux/or1k/ioctls_inc0.h: New file. * linux/powerpc/ioctls_arch0.h: New file. * linux/powerpc/ioctls_inc0.h: New file. * linux/powerpc64/ioctls_arch0.h: New file. * linux/powerpc64/ioctls_arch1.h: New file. * linux/powerpc64/ioctls_inc0.h: New file. * linux/powerpc64/ioctls_inc1.h: New file. * linux/s390/ioctls_arch0.h: New file. * linux/s390/ioctls_inc0.h: New file. * linux/s390x/ioctls_arch0.h: New file. * linux/s390x/ioctls_inc0.h: New file. * linux/sh/ioctls_arch0.h: New file. * linux/sh/ioctls_inc0.h: New file. * linux/sh64/ioctls_arch0.h: New file. * linux/sh64/ioctls_inc0.h: New file. * linux/sparc/ioctls_arch0.h: New file. * linux/sparc/ioctls_inc0.h: New file. * linux/sparc64/ioctls_arch0.h: New file. * linux/sparc64/ioctls_arch2.h: New file. * linux/sparc64/ioctls_inc0.h: New file. * linux/sparc64/ioctls_inc2.h: New file. * linux/tile/ioctls_arch0.h: New file. * linux/tile/ioctls_arch1.h: New file. * linux/tile/ioctls_inc0.h: New file. * linux/tile/ioctls_inc1.h: New file. * linux/x32/ioctls_arch0.h: New file. * linux/x32/ioctls_arch1.h: New file. * linux/x32/ioctls_inc0.h: New file. * linux/x32/ioctls_inc1.h: New file. * linux/x86_64/ioctls_arch0.h: New file. * linux/x86_64/ioctls_arch1.h: New file. * linux/x86_64/ioctls_inc0.h: New file. * linux/x86_64/ioctls_inc1.h: New file. * linux/xtensa/ioctls_arch0.h: New file. * linux/xtensa/ioctls_inc0.h: New file. * linux/aarch64/ioctlent.h.in: Remove. * linux/aarch64/ioctlent1.h: Remove. * linux/alpha/ioctlent.h.in: Remove. * linux/arc/ioctlent.h.in: Remove. * linux/arm/ioctlent.h.in: Remove. * linux/avr32/ioctlent.h.in: Remove. * linux/bfin/ioctlent.h.in: Remove. * linux/hppa/ioctlent.h.in: Remove. * linux/i386/ioctlent.h.in: Remove. * linux/ia64/ioctlent.h.in: Remove. * linux/ioctlent.h.in: Remove. * linux/ioctlent.sh: Remove. * linux/m68k/ioctlent.h.in: Remove. * linux/metag/ioctlent.h.in: Remove. * linux/microblaze/ioctlent.h.in: Remove. * linux/mips/ioctlent.h.in: Remove. * linux/mips/ioctlent.sh: Remove. * linux/or1k/ioctlent.h.in: Remove. * linux/powerpc/ioctlent.h.in: Remove. * linux/powerpc64/ioctlent.h: Remove. * linux/powerpc64/ioctlent1.h: Remove. * linux/s390/ioctlent.h.in: Remove. * linux/s390x/ioctlent.h.in: Remove. * linux/sh/ioctlent.h.in: Remove. * linux/sh64/ioctlent.h.in: Remove. * linux/sparc/ioctlent.h.in: Remove. * linux/sparc64/ioctlent.h.in: Remove. * linux/sparc64/ioctlent2.h: Remove. * linux/tile/ioctlent.h.in: Remove. * linux/tile/ioctlent1.h: Remove. * linux/x32/ioctlent.h.in: Remove. * linux/x32/ioctlent1.h: Remove. * linux/x86_64/ioctlent.h.in: Remove. * linux/x86_64/ioctlent1.h: Remove. * linux/xtensa/ioctlent.h.in: Remove. * linux/x86_64/ioctlent2.h: Include ioctlent0.h instead of ioctlent.h. * syscall.c (struct_ioctlent ioctlent0): Likewise. * Makefile.am: Remove all ioctlent-related definitions. Define the list of ioctlent*.h files that have to be generated by presence of $(srcdir)/$(OS)/$(ARCH)/ioctls_inc*.h files. Add rules for ioctlent*.h files generation. (EXTRA_DIST): Update. * maint/ioctls_gen.sh: New file. * maint/ioctls_hex.sh: New file. * maint/ioctls_sym.sh: New file. * maint/print_ioctlent.c: New file. * HACKING-scripts: Update for ioctlent.sh -> ioctls_gen.sh migration. * .gitignore: Add ioctlent[012].h and ioctls_all[012].h. * configure.ac (AC_CHECK_HEADERS): Add linux/hiddev.h and linux/mmtimer.h for tests. * tests/ioctl.c: New file. * tests/ioctl.test: New test. * tests/Makefile.am (check_PROGRAMS): Add ioctl. (TESTS): Add ioctl.test. * tests/.gitignore: Add ioctl.
2015-01-19 20:02:16 +03:00
linux/arm/ioctls_arch0.h \
linux/arm/ioctls_inc0.h \
Implement arch specific methods of changing syscall number and error code This introduces arch_set_error and arch_set_scno functions for each supported architecture, needed to implement syscall fault injection. * linux/aarch64/set_error.c: New file. * linux/aarch64/set_scno.c: Likewise. * linux/alpha/set_error.c: Likewise. * linux/alpha/set_scno.c: Likewise. * linux/arc/set_error.c: Likewise. * linux/arc/set_scno.c: Likewise. * linux/arm/set_error.c: Likewise. * linux/arm/set_scno.c: Likewise. * linux/avr32/set_error.c: Likewise. * linux/avr32/set_scno.c: Likewise. * linux/bfin/set_error.c: Likewise. * linux/bfin/set_scno.c: Likewise. * linux/crisv10/set_error.c: Likewise. * linux/crisv10/set_scno.c: Likewise. * linux/crisv32/set_error.c: Likewise. * linux/crisv32/set_scno.c: Likewise. * linux/hppa/set_error.c: Likewise. * linux/hppa/set_scno.c: Likewise. * linux/i386/set_error.c: Likewise. * linux/i386/set_scno.c: Likewise. * linux/ia64/set_error.c: Likewise. * linux/ia64/set_scno.c: Likewise. * linux/m68k/set_error.c: Likewise. * linux/m68k/set_scno.c: Likewise. * linux/metag/set_error.c: Likewise. * linux/metag/set_scno.c: Likewise. * linux/microblaze/set_error.c: Likewise. * linux/microblaze/set_scno.c: Likewise. * linux/mips/set_error.c: Likewise. * linux/mips/set_scno.c: Likewise. * linux/nios2/set_error.c: Likewise. * linux/nios2/set_scno.c: Likewise. * linux/or1k/set_error.c: Likewise. * linux/or1k/set_scno.c: Likewise. * linux/powerpc/set_error.c: Likewise. * linux/powerpc/set_scno.c: Likewise. * linux/powerpc64/set_error.c: Likewise. * linux/powerpc64/set_scno.c: Likewise. * linux/riscv/set_error.c: Likewise. * linux/riscv/set_scno.c: Likewise. * linux/s390/set_error.c: Likewise. * linux/s390/set_scno.c: Likewise. * linux/s390x/set_error.c: Likewise. * linux/s390x/set_scno.c: Likewise. * linux/sh/set_error.c: Likewise. * linux/sh/set_scno.c: Likewise. * linux/sh64/set_error.c: Likewise. * linux/sh64/set_scno.c: Likewise. * linux/sparc/set_error.c: Likewise. * linux/sparc/set_scno.c: Likewise. * linux/sparc64/set_error.c: Likewise. * linux/sparc64/set_scno.c: Likewise. * linux/tile/set_error.c: Likewise. * linux/tile/set_scno.c: Likewise. * linux/x32/set_error.c: Likewise. * linux/x32/set_scno.c: Likewise. * linux/x86_64/set_error.c: Likewise. * linux/x86_64/set_scno.c: Likewise. * linux/xtensa/set_error.c: Likewise. * linux/xtensa/set_scno.c: Likewise. * Makefile.am (EXTRA_DIST): Add them.
2016-11-15 20:38:21 +03:00
linux/arm/set_error.c \
linux/arm/set_scno.c \
linux/arm/syscallent.h \
linux/arm/userent.h \
linux/avr32/arch_regs.c \
linux/avr32/get_error.c \
linux/avr32/get_scno.c \
linux/avr32/get_syscall_args.c \
ioctl: take all 32 bits of ioctl commands into account Historically, only 16 bits (8-bit number and 8-bit type) of 32-bit ioctl commands were used for decoding, which was the source for numerous annoying collisions like this: ioctl(0, SNDCTL_TMR_TIMEBASE or SNDRV_TIMER_IOCTL_NEXT_DEVICE or TCGETS, {B38400 opost isig icanon echo ...}) = 0 ioctl(0, MGSL_IOCGPARAMS or MMTIMER_GETRES or MTIOCTOP or SNDCTL_MIDI_MPUMODE, 0x7fffd47f7338) = -1 ENOTTY (Inappropriate ioctl for device) The solution is to use all 32 bits for decoding, not just "number" and "type", but also "size" and "direction". As some architectures override defaults that come from asm-generic/ and provide alternative definitions for some ioctl commands, we support per-architecture ioctl definitions and merge them with common definitions at build time. During the merge, we used to keep both generic and architecture-specific definitions, now architecture-specific definitions have precedence over generic ones -- ioctlsort omits definitions from asm-generic/ for those ioctl names that have different definitions in asm/. Additional bits of "direction" are architecture specific -- the number of bits and their values differ between architectures. To reduce architecture differences in the source code, we keep "direction" in symbolic form and compile it in ioctlsort. Additional bits of "size" are also architecture specific -- not only the number of bits differ between architectures, but sizes of many types depend on sizeof(long). To reduce architecture differences in the source code, we keep 32-bit and 64-bit versions of common ioctl definitions, and use the appropriate version for each architecture and personality. To implement this, the tools for generating ioctl definitions from kernel headers have been rewritten, and the source format of ioctl definitions has been extended. The final ioctlent*.h files that are included by syscall.c are now generated from source ioctls_inc*.h and ioctls_arch*.h files at build time with ioctlsort. * ioctl.c (ioctl_lookup): Use all 32 bits of ioctl command code. * ioctlsort.c: Rewritten. * linux/32/ioctls_inc.h: New file. * linux/64/ioctls_inc.h: New file. * linux/aarch64/ioctls_arch0.h: New file. * linux/aarch64/ioctls_arch1.h: New file. * linux/aarch64/ioctls_inc0.h: New file. * linux/aarch64/ioctls_inc1.h: New file. * linux/alpha/ioctls_arch0.h: New file. * linux/alpha/ioctls_inc0.h: New file. * linux/arc/ioctls_arch0.h: New file. * linux/arc/ioctls_inc0.h: New file. * linux/arm/ioctls_arch0.h: New file. * linux/arm/ioctls_inc0.h: New file. * linux/avr32/ioctls_arch0.h: New file. * linux/avr32/ioctls_inc0.h: New file. * linux/bfin/ioctls_arch0.h: New file. * linux/bfin/ioctls_inc0.h: New file. * linux/hppa/ioctls_arch0.h: New file. * linux/hppa/ioctls_inc0.h: New file. * linux/i386/ioctls_arch0.h: New file. * linux/i386/ioctls_inc0.h: New file. * linux/ia64/ioctls_arch0.h: New file. * linux/ia64/ioctls_inc0.h: New file. * linux/m68k/ioctls_arch0.h: New file. * linux/m68k/ioctls_inc0.h: New file. * linux/metag/ioctls_arch0.h: New file. * linux/metag/ioctls_inc0.h: New file. * linux/microblaze/ioctls_arch0.h: New file. * linux/microblaze/ioctls_inc0.h: New file. * linux/mips/ioctls_arch0.h: New file. * linux/mips/ioctls_inc0.h: New file. * linux/or1k/ioctls_arch0.h: New file. * linux/or1k/ioctls_inc0.h: New file. * linux/powerpc/ioctls_arch0.h: New file. * linux/powerpc/ioctls_inc0.h: New file. * linux/powerpc64/ioctls_arch0.h: New file. * linux/powerpc64/ioctls_arch1.h: New file. * linux/powerpc64/ioctls_inc0.h: New file. * linux/powerpc64/ioctls_inc1.h: New file. * linux/s390/ioctls_arch0.h: New file. * linux/s390/ioctls_inc0.h: New file. * linux/s390x/ioctls_arch0.h: New file. * linux/s390x/ioctls_inc0.h: New file. * linux/sh/ioctls_arch0.h: New file. * linux/sh/ioctls_inc0.h: New file. * linux/sh64/ioctls_arch0.h: New file. * linux/sh64/ioctls_inc0.h: New file. * linux/sparc/ioctls_arch0.h: New file. * linux/sparc/ioctls_inc0.h: New file. * linux/sparc64/ioctls_arch0.h: New file. * linux/sparc64/ioctls_arch2.h: New file. * linux/sparc64/ioctls_inc0.h: New file. * linux/sparc64/ioctls_inc2.h: New file. * linux/tile/ioctls_arch0.h: New file. * linux/tile/ioctls_arch1.h: New file. * linux/tile/ioctls_inc0.h: New file. * linux/tile/ioctls_inc1.h: New file. * linux/x32/ioctls_arch0.h: New file. * linux/x32/ioctls_arch1.h: New file. * linux/x32/ioctls_inc0.h: New file. * linux/x32/ioctls_inc1.h: New file. * linux/x86_64/ioctls_arch0.h: New file. * linux/x86_64/ioctls_arch1.h: New file. * linux/x86_64/ioctls_inc0.h: New file. * linux/x86_64/ioctls_inc1.h: New file. * linux/xtensa/ioctls_arch0.h: New file. * linux/xtensa/ioctls_inc0.h: New file. * linux/aarch64/ioctlent.h.in: Remove. * linux/aarch64/ioctlent1.h: Remove. * linux/alpha/ioctlent.h.in: Remove. * linux/arc/ioctlent.h.in: Remove. * linux/arm/ioctlent.h.in: Remove. * linux/avr32/ioctlent.h.in: Remove. * linux/bfin/ioctlent.h.in: Remove. * linux/hppa/ioctlent.h.in: Remove. * linux/i386/ioctlent.h.in: Remove. * linux/ia64/ioctlent.h.in: Remove. * linux/ioctlent.h.in: Remove. * linux/ioctlent.sh: Remove. * linux/m68k/ioctlent.h.in: Remove. * linux/metag/ioctlent.h.in: Remove. * linux/microblaze/ioctlent.h.in: Remove. * linux/mips/ioctlent.h.in: Remove. * linux/mips/ioctlent.sh: Remove. * linux/or1k/ioctlent.h.in: Remove. * linux/powerpc/ioctlent.h.in: Remove. * linux/powerpc64/ioctlent.h: Remove. * linux/powerpc64/ioctlent1.h: Remove. * linux/s390/ioctlent.h.in: Remove. * linux/s390x/ioctlent.h.in: Remove. * linux/sh/ioctlent.h.in: Remove. * linux/sh64/ioctlent.h.in: Remove. * linux/sparc/ioctlent.h.in: Remove. * linux/sparc64/ioctlent.h.in: Remove. * linux/sparc64/ioctlent2.h: Remove. * linux/tile/ioctlent.h.in: Remove. * linux/tile/ioctlent1.h: Remove. * linux/x32/ioctlent.h.in: Remove. * linux/x32/ioctlent1.h: Remove. * linux/x86_64/ioctlent.h.in: Remove. * linux/x86_64/ioctlent1.h: Remove. * linux/xtensa/ioctlent.h.in: Remove. * linux/x86_64/ioctlent2.h: Include ioctlent0.h instead of ioctlent.h. * syscall.c (struct_ioctlent ioctlent0): Likewise. * Makefile.am: Remove all ioctlent-related definitions. Define the list of ioctlent*.h files that have to be generated by presence of $(srcdir)/$(OS)/$(ARCH)/ioctls_inc*.h files. Add rules for ioctlent*.h files generation. (EXTRA_DIST): Update. * maint/ioctls_gen.sh: New file. * maint/ioctls_hex.sh: New file. * maint/ioctls_sym.sh: New file. * maint/print_ioctlent.c: New file. * HACKING-scripts: Update for ioctlent.sh -> ioctls_gen.sh migration. * .gitignore: Add ioctlent[012].h and ioctls_all[012].h. * configure.ac (AC_CHECK_HEADERS): Add linux/hiddev.h and linux/mmtimer.h for tests. * tests/ioctl.c: New file. * tests/ioctl.test: New test. * tests/Makefile.am (check_PROGRAMS): Add ioctl. (TESTS): Add ioctl.test. * tests/.gitignore: Add ioctl.
2015-01-19 20:02:16 +03:00
linux/avr32/ioctls_arch0.h \
linux/avr32/ioctls_inc0.h \
Implement arch specific methods of changing syscall number and error code This introduces arch_set_error and arch_set_scno functions for each supported architecture, needed to implement syscall fault injection. * linux/aarch64/set_error.c: New file. * linux/aarch64/set_scno.c: Likewise. * linux/alpha/set_error.c: Likewise. * linux/alpha/set_scno.c: Likewise. * linux/arc/set_error.c: Likewise. * linux/arc/set_scno.c: Likewise. * linux/arm/set_error.c: Likewise. * linux/arm/set_scno.c: Likewise. * linux/avr32/set_error.c: Likewise. * linux/avr32/set_scno.c: Likewise. * linux/bfin/set_error.c: Likewise. * linux/bfin/set_scno.c: Likewise. * linux/crisv10/set_error.c: Likewise. * linux/crisv10/set_scno.c: Likewise. * linux/crisv32/set_error.c: Likewise. * linux/crisv32/set_scno.c: Likewise. * linux/hppa/set_error.c: Likewise. * linux/hppa/set_scno.c: Likewise. * linux/i386/set_error.c: Likewise. * linux/i386/set_scno.c: Likewise. * linux/ia64/set_error.c: Likewise. * linux/ia64/set_scno.c: Likewise. * linux/m68k/set_error.c: Likewise. * linux/m68k/set_scno.c: Likewise. * linux/metag/set_error.c: Likewise. * linux/metag/set_scno.c: Likewise. * linux/microblaze/set_error.c: Likewise. * linux/microblaze/set_scno.c: Likewise. * linux/mips/set_error.c: Likewise. * linux/mips/set_scno.c: Likewise. * linux/nios2/set_error.c: Likewise. * linux/nios2/set_scno.c: Likewise. * linux/or1k/set_error.c: Likewise. * linux/or1k/set_scno.c: Likewise. * linux/powerpc/set_error.c: Likewise. * linux/powerpc/set_scno.c: Likewise. * linux/powerpc64/set_error.c: Likewise. * linux/powerpc64/set_scno.c: Likewise. * linux/riscv/set_error.c: Likewise. * linux/riscv/set_scno.c: Likewise. * linux/s390/set_error.c: Likewise. * linux/s390/set_scno.c: Likewise. * linux/s390x/set_error.c: Likewise. * linux/s390x/set_scno.c: Likewise. * linux/sh/set_error.c: Likewise. * linux/sh/set_scno.c: Likewise. * linux/sh64/set_error.c: Likewise. * linux/sh64/set_scno.c: Likewise. * linux/sparc/set_error.c: Likewise. * linux/sparc/set_scno.c: Likewise. * linux/sparc64/set_error.c: Likewise. * linux/sparc64/set_scno.c: Likewise. * linux/tile/set_error.c: Likewise. * linux/tile/set_scno.c: Likewise. * linux/x32/set_error.c: Likewise. * linux/x32/set_scno.c: Likewise. * linux/x86_64/set_error.c: Likewise. * linux/x86_64/set_scno.c: Likewise. * linux/xtensa/set_error.c: Likewise. * linux/xtensa/set_scno.c: Likewise. * Makefile.am (EXTRA_DIST): Add them.
2016-11-15 20:38:21 +03:00
linux/avr32/set_error.c \
linux/avr32/set_scno.c \
linux/avr32/syscallent.h \
linux/avr32/userent.h \
linux/bfin/arch_regs.c \
linux/bfin/get_error.c \
linux/bfin/get_scno.c \
linux/bfin/get_syscall_args.c \
linux/bfin/get_syscall_result.c \
ioctl: take all 32 bits of ioctl commands into account Historically, only 16 bits (8-bit number and 8-bit type) of 32-bit ioctl commands were used for decoding, which was the source for numerous annoying collisions like this: ioctl(0, SNDCTL_TMR_TIMEBASE or SNDRV_TIMER_IOCTL_NEXT_DEVICE or TCGETS, {B38400 opost isig icanon echo ...}) = 0 ioctl(0, MGSL_IOCGPARAMS or MMTIMER_GETRES or MTIOCTOP or SNDCTL_MIDI_MPUMODE, 0x7fffd47f7338) = -1 ENOTTY (Inappropriate ioctl for device) The solution is to use all 32 bits for decoding, not just "number" and "type", but also "size" and "direction". As some architectures override defaults that come from asm-generic/ and provide alternative definitions for some ioctl commands, we support per-architecture ioctl definitions and merge them with common definitions at build time. During the merge, we used to keep both generic and architecture-specific definitions, now architecture-specific definitions have precedence over generic ones -- ioctlsort omits definitions from asm-generic/ for those ioctl names that have different definitions in asm/. Additional bits of "direction" are architecture specific -- the number of bits and their values differ between architectures. To reduce architecture differences in the source code, we keep "direction" in symbolic form and compile it in ioctlsort. Additional bits of "size" are also architecture specific -- not only the number of bits differ between architectures, but sizes of many types depend on sizeof(long). To reduce architecture differences in the source code, we keep 32-bit and 64-bit versions of common ioctl definitions, and use the appropriate version for each architecture and personality. To implement this, the tools for generating ioctl definitions from kernel headers have been rewritten, and the source format of ioctl definitions has been extended. The final ioctlent*.h files that are included by syscall.c are now generated from source ioctls_inc*.h and ioctls_arch*.h files at build time with ioctlsort. * ioctl.c (ioctl_lookup): Use all 32 bits of ioctl command code. * ioctlsort.c: Rewritten. * linux/32/ioctls_inc.h: New file. * linux/64/ioctls_inc.h: New file. * linux/aarch64/ioctls_arch0.h: New file. * linux/aarch64/ioctls_arch1.h: New file. * linux/aarch64/ioctls_inc0.h: New file. * linux/aarch64/ioctls_inc1.h: New file. * linux/alpha/ioctls_arch0.h: New file. * linux/alpha/ioctls_inc0.h: New file. * linux/arc/ioctls_arch0.h: New file. * linux/arc/ioctls_inc0.h: New file. * linux/arm/ioctls_arch0.h: New file. * linux/arm/ioctls_inc0.h: New file. * linux/avr32/ioctls_arch0.h: New file. * linux/avr32/ioctls_inc0.h: New file. * linux/bfin/ioctls_arch0.h: New file. * linux/bfin/ioctls_inc0.h: New file. * linux/hppa/ioctls_arch0.h: New file. * linux/hppa/ioctls_inc0.h: New file. * linux/i386/ioctls_arch0.h: New file. * linux/i386/ioctls_inc0.h: New file. * linux/ia64/ioctls_arch0.h: New file. * linux/ia64/ioctls_inc0.h: New file. * linux/m68k/ioctls_arch0.h: New file. * linux/m68k/ioctls_inc0.h: New file. * linux/metag/ioctls_arch0.h: New file. * linux/metag/ioctls_inc0.h: New file. * linux/microblaze/ioctls_arch0.h: New file. * linux/microblaze/ioctls_inc0.h: New file. * linux/mips/ioctls_arch0.h: New file. * linux/mips/ioctls_inc0.h: New file. * linux/or1k/ioctls_arch0.h: New file. * linux/or1k/ioctls_inc0.h: New file. * linux/powerpc/ioctls_arch0.h: New file. * linux/powerpc/ioctls_inc0.h: New file. * linux/powerpc64/ioctls_arch0.h: New file. * linux/powerpc64/ioctls_arch1.h: New file. * linux/powerpc64/ioctls_inc0.h: New file. * linux/powerpc64/ioctls_inc1.h: New file. * linux/s390/ioctls_arch0.h: New file. * linux/s390/ioctls_inc0.h: New file. * linux/s390x/ioctls_arch0.h: New file. * linux/s390x/ioctls_inc0.h: New file. * linux/sh/ioctls_arch0.h: New file. * linux/sh/ioctls_inc0.h: New file. * linux/sh64/ioctls_arch0.h: New file. * linux/sh64/ioctls_inc0.h: New file. * linux/sparc/ioctls_arch0.h: New file. * linux/sparc/ioctls_inc0.h: New file. * linux/sparc64/ioctls_arch0.h: New file. * linux/sparc64/ioctls_arch2.h: New file. * linux/sparc64/ioctls_inc0.h: New file. * linux/sparc64/ioctls_inc2.h: New file. * linux/tile/ioctls_arch0.h: New file. * linux/tile/ioctls_arch1.h: New file. * linux/tile/ioctls_inc0.h: New file. * linux/tile/ioctls_inc1.h: New file. * linux/x32/ioctls_arch0.h: New file. * linux/x32/ioctls_arch1.h: New file. * linux/x32/ioctls_inc0.h: New file. * linux/x32/ioctls_inc1.h: New file. * linux/x86_64/ioctls_arch0.h: New file. * linux/x86_64/ioctls_arch1.h: New file. * linux/x86_64/ioctls_inc0.h: New file. * linux/x86_64/ioctls_inc1.h: New file. * linux/xtensa/ioctls_arch0.h: New file. * linux/xtensa/ioctls_inc0.h: New file. * linux/aarch64/ioctlent.h.in: Remove. * linux/aarch64/ioctlent1.h: Remove. * linux/alpha/ioctlent.h.in: Remove. * linux/arc/ioctlent.h.in: Remove. * linux/arm/ioctlent.h.in: Remove. * linux/avr32/ioctlent.h.in: Remove. * linux/bfin/ioctlent.h.in: Remove. * linux/hppa/ioctlent.h.in: Remove. * linux/i386/ioctlent.h.in: Remove. * linux/ia64/ioctlent.h.in: Remove. * linux/ioctlent.h.in: Remove. * linux/ioctlent.sh: Remove. * linux/m68k/ioctlent.h.in: Remove. * linux/metag/ioctlent.h.in: Remove. * linux/microblaze/ioctlent.h.in: Remove. * linux/mips/ioctlent.h.in: Remove. * linux/mips/ioctlent.sh: Remove. * linux/or1k/ioctlent.h.in: Remove. * linux/powerpc/ioctlent.h.in: Remove. * linux/powerpc64/ioctlent.h: Remove. * linux/powerpc64/ioctlent1.h: Remove. * linux/s390/ioctlent.h.in: Remove. * linux/s390x/ioctlent.h.in: Remove. * linux/sh/ioctlent.h.in: Remove. * linux/sh64/ioctlent.h.in: Remove. * linux/sparc/ioctlent.h.in: Remove. * linux/sparc64/ioctlent.h.in: Remove. * linux/sparc64/ioctlent2.h: Remove. * linux/tile/ioctlent.h.in: Remove. * linux/tile/ioctlent1.h: Remove. * linux/x32/ioctlent.h.in: Remove. * linux/x32/ioctlent1.h: Remove. * linux/x86_64/ioctlent.h.in: Remove. * linux/x86_64/ioctlent1.h: Remove. * linux/xtensa/ioctlent.h.in: Remove. * linux/x86_64/ioctlent2.h: Include ioctlent0.h instead of ioctlent.h. * syscall.c (struct_ioctlent ioctlent0): Likewise. * Makefile.am: Remove all ioctlent-related definitions. Define the list of ioctlent*.h files that have to be generated by presence of $(srcdir)/$(OS)/$(ARCH)/ioctls_inc*.h files. Add rules for ioctlent*.h files generation. (EXTRA_DIST): Update. * maint/ioctls_gen.sh: New file. * maint/ioctls_hex.sh: New file. * maint/ioctls_sym.sh: New file. * maint/print_ioctlent.c: New file. * HACKING-scripts: Update for ioctlent.sh -> ioctls_gen.sh migration. * .gitignore: Add ioctlent[012].h and ioctls_all[012].h. * configure.ac (AC_CHECK_HEADERS): Add linux/hiddev.h and linux/mmtimer.h for tests. * tests/ioctl.c: New file. * tests/ioctl.test: New test. * tests/Makefile.am (check_PROGRAMS): Add ioctl. (TESTS): Add ioctl.test. * tests/.gitignore: Add ioctl.
2015-01-19 20:02:16 +03:00
linux/bfin/ioctls_arch0.h \
linux/bfin/ioctls_inc0.h \
Implement arch specific methods of changing syscall number and error code This introduces arch_set_error and arch_set_scno functions for each supported architecture, needed to implement syscall fault injection. * linux/aarch64/set_error.c: New file. * linux/aarch64/set_scno.c: Likewise. * linux/alpha/set_error.c: Likewise. * linux/alpha/set_scno.c: Likewise. * linux/arc/set_error.c: Likewise. * linux/arc/set_scno.c: Likewise. * linux/arm/set_error.c: Likewise. * linux/arm/set_scno.c: Likewise. * linux/avr32/set_error.c: Likewise. * linux/avr32/set_scno.c: Likewise. * linux/bfin/set_error.c: Likewise. * linux/bfin/set_scno.c: Likewise. * linux/crisv10/set_error.c: Likewise. * linux/crisv10/set_scno.c: Likewise. * linux/crisv32/set_error.c: Likewise. * linux/crisv32/set_scno.c: Likewise. * linux/hppa/set_error.c: Likewise. * linux/hppa/set_scno.c: Likewise. * linux/i386/set_error.c: Likewise. * linux/i386/set_scno.c: Likewise. * linux/ia64/set_error.c: Likewise. * linux/ia64/set_scno.c: Likewise. * linux/m68k/set_error.c: Likewise. * linux/m68k/set_scno.c: Likewise. * linux/metag/set_error.c: Likewise. * linux/metag/set_scno.c: Likewise. * linux/microblaze/set_error.c: Likewise. * linux/microblaze/set_scno.c: Likewise. * linux/mips/set_error.c: Likewise. * linux/mips/set_scno.c: Likewise. * linux/nios2/set_error.c: Likewise. * linux/nios2/set_scno.c: Likewise. * linux/or1k/set_error.c: Likewise. * linux/or1k/set_scno.c: Likewise. * linux/powerpc/set_error.c: Likewise. * linux/powerpc/set_scno.c: Likewise. * linux/powerpc64/set_error.c: Likewise. * linux/powerpc64/set_scno.c: Likewise. * linux/riscv/set_error.c: Likewise. * linux/riscv/set_scno.c: Likewise. * linux/s390/set_error.c: Likewise. * linux/s390/set_scno.c: Likewise. * linux/s390x/set_error.c: Likewise. * linux/s390x/set_scno.c: Likewise. * linux/sh/set_error.c: Likewise. * linux/sh/set_scno.c: Likewise. * linux/sh64/set_error.c: Likewise. * linux/sh64/set_scno.c: Likewise. * linux/sparc/set_error.c: Likewise. * linux/sparc/set_scno.c: Likewise. * linux/sparc64/set_error.c: Likewise. * linux/sparc64/set_scno.c: Likewise. * linux/tile/set_error.c: Likewise. * linux/tile/set_scno.c: Likewise. * linux/x32/set_error.c: Likewise. * linux/x32/set_scno.c: Likewise. * linux/x86_64/set_error.c: Likewise. * linux/x86_64/set_scno.c: Likewise. * linux/xtensa/set_error.c: Likewise. * linux/xtensa/set_scno.c: Likewise. * Makefile.am (EXTRA_DIST): Add them.
2016-11-15 20:38:21 +03:00
linux/bfin/set_error.c \
linux/bfin/set_scno.c \
linux/bfin/syscallent.h \
linux/bfin/userent.h \
linux/crisv10/arch_regs.c \
linux/crisv10/arch_sigreturn.c \
linux/crisv10/get_error.c \
linux/crisv10/get_scno.c \
linux/crisv10/get_syscall_args.c \
linux/crisv10/get_syscall_result.c \
Implement arch specific methods of changing syscall number and error code This introduces arch_set_error and arch_set_scno functions for each supported architecture, needed to implement syscall fault injection. * linux/aarch64/set_error.c: New file. * linux/aarch64/set_scno.c: Likewise. * linux/alpha/set_error.c: Likewise. * linux/alpha/set_scno.c: Likewise. * linux/arc/set_error.c: Likewise. * linux/arc/set_scno.c: Likewise. * linux/arm/set_error.c: Likewise. * linux/arm/set_scno.c: Likewise. * linux/avr32/set_error.c: Likewise. * linux/avr32/set_scno.c: Likewise. * linux/bfin/set_error.c: Likewise. * linux/bfin/set_scno.c: Likewise. * linux/crisv10/set_error.c: Likewise. * linux/crisv10/set_scno.c: Likewise. * linux/crisv32/set_error.c: Likewise. * linux/crisv32/set_scno.c: Likewise. * linux/hppa/set_error.c: Likewise. * linux/hppa/set_scno.c: Likewise. * linux/i386/set_error.c: Likewise. * linux/i386/set_scno.c: Likewise. * linux/ia64/set_error.c: Likewise. * linux/ia64/set_scno.c: Likewise. * linux/m68k/set_error.c: Likewise. * linux/m68k/set_scno.c: Likewise. * linux/metag/set_error.c: Likewise. * linux/metag/set_scno.c: Likewise. * linux/microblaze/set_error.c: Likewise. * linux/microblaze/set_scno.c: Likewise. * linux/mips/set_error.c: Likewise. * linux/mips/set_scno.c: Likewise. * linux/nios2/set_error.c: Likewise. * linux/nios2/set_scno.c: Likewise. * linux/or1k/set_error.c: Likewise. * linux/or1k/set_scno.c: Likewise. * linux/powerpc/set_error.c: Likewise. * linux/powerpc/set_scno.c: Likewise. * linux/powerpc64/set_error.c: Likewise. * linux/powerpc64/set_scno.c: Likewise. * linux/riscv/set_error.c: Likewise. * linux/riscv/set_scno.c: Likewise. * linux/s390/set_error.c: Likewise. * linux/s390/set_scno.c: Likewise. * linux/s390x/set_error.c: Likewise. * linux/s390x/set_scno.c: Likewise. * linux/sh/set_error.c: Likewise. * linux/sh/set_scno.c: Likewise. * linux/sh64/set_error.c: Likewise. * linux/sh64/set_scno.c: Likewise. * linux/sparc/set_error.c: Likewise. * linux/sparc/set_scno.c: Likewise. * linux/sparc64/set_error.c: Likewise. * linux/sparc64/set_scno.c: Likewise. * linux/tile/set_error.c: Likewise. * linux/tile/set_scno.c: Likewise. * linux/x32/set_error.c: Likewise. * linux/x32/set_scno.c: Likewise. * linux/x86_64/set_error.c: Likewise. * linux/x86_64/set_scno.c: Likewise. * linux/xtensa/set_error.c: Likewise. * linux/xtensa/set_scno.c: Likewise. * Makefile.am (EXTRA_DIST): Add them.
2016-11-15 20:38:21 +03:00
linux/crisv10/set_error.c \
linux/crisv10/set_scno.c \
linux/crisv10/syscallent.h \
linux/crisv10/userent.h \
linux/crisv32/arch_regs.c \
linux/crisv32/arch_sigreturn.c \
linux/crisv32/get_error.c \
linux/crisv32/get_scno.c \
linux/crisv32/get_syscall_args.c \
linux/crisv32/get_syscall_result.c \
Implement arch specific methods of changing syscall number and error code This introduces arch_set_error and arch_set_scno functions for each supported architecture, needed to implement syscall fault injection. * linux/aarch64/set_error.c: New file. * linux/aarch64/set_scno.c: Likewise. * linux/alpha/set_error.c: Likewise. * linux/alpha/set_scno.c: Likewise. * linux/arc/set_error.c: Likewise. * linux/arc/set_scno.c: Likewise. * linux/arm/set_error.c: Likewise. * linux/arm/set_scno.c: Likewise. * linux/avr32/set_error.c: Likewise. * linux/avr32/set_scno.c: Likewise. * linux/bfin/set_error.c: Likewise. * linux/bfin/set_scno.c: Likewise. * linux/crisv10/set_error.c: Likewise. * linux/crisv10/set_scno.c: Likewise. * linux/crisv32/set_error.c: Likewise. * linux/crisv32/set_scno.c: Likewise. * linux/hppa/set_error.c: Likewise. * linux/hppa/set_scno.c: Likewise. * linux/i386/set_error.c: Likewise. * linux/i386/set_scno.c: Likewise. * linux/ia64/set_error.c: Likewise. * linux/ia64/set_scno.c: Likewise. * linux/m68k/set_error.c: Likewise. * linux/m68k/set_scno.c: Likewise. * linux/metag/set_error.c: Likewise. * linux/metag/set_scno.c: Likewise. * linux/microblaze/set_error.c: Likewise. * linux/microblaze/set_scno.c: Likewise. * linux/mips/set_error.c: Likewise. * linux/mips/set_scno.c: Likewise. * linux/nios2/set_error.c: Likewise. * linux/nios2/set_scno.c: Likewise. * linux/or1k/set_error.c: Likewise. * linux/or1k/set_scno.c: Likewise. * linux/powerpc/set_error.c: Likewise. * linux/powerpc/set_scno.c: Likewise. * linux/powerpc64/set_error.c: Likewise. * linux/powerpc64/set_scno.c: Likewise. * linux/riscv/set_error.c: Likewise. * linux/riscv/set_scno.c: Likewise. * linux/s390/set_error.c: Likewise. * linux/s390/set_scno.c: Likewise. * linux/s390x/set_error.c: Likewise. * linux/s390x/set_scno.c: Likewise. * linux/sh/set_error.c: Likewise. * linux/sh/set_scno.c: Likewise. * linux/sh64/set_error.c: Likewise. * linux/sh64/set_scno.c: Likewise. * linux/sparc/set_error.c: Likewise. * linux/sparc/set_scno.c: Likewise. * linux/sparc64/set_error.c: Likewise. * linux/sparc64/set_scno.c: Likewise. * linux/tile/set_error.c: Likewise. * linux/tile/set_scno.c: Likewise. * linux/x32/set_error.c: Likewise. * linux/x32/set_scno.c: Likewise. * linux/x86_64/set_error.c: Likewise. * linux/x86_64/set_scno.c: Likewise. * linux/xtensa/set_error.c: Likewise. * linux/xtensa/set_scno.c: Likewise. * Makefile.am (EXTRA_DIST): Add them.
2016-11-15 20:38:21 +03:00
linux/crisv32/set_error.c \
linux/crisv32/set_scno.c \
linux/crisv32/syscallent.h \
linux/crisv32/userent.h \
linux/dummy.h \
linux/errnoent.h \
linux/getregs_old.h \
linux/hppa/arch_regs.c \
linux/hppa/arch_regs.h \
linux/hppa/errnoent.h \
linux/hppa/get_error.c \
linux/hppa/get_scno.c \
linux/hppa/get_syscall_args.c \
linux/hppa/get_syscall_result.c \
ioctl: take all 32 bits of ioctl commands into account Historically, only 16 bits (8-bit number and 8-bit type) of 32-bit ioctl commands were used for decoding, which was the source for numerous annoying collisions like this: ioctl(0, SNDCTL_TMR_TIMEBASE or SNDRV_TIMER_IOCTL_NEXT_DEVICE or TCGETS, {B38400 opost isig icanon echo ...}) = 0 ioctl(0, MGSL_IOCGPARAMS or MMTIMER_GETRES or MTIOCTOP or SNDCTL_MIDI_MPUMODE, 0x7fffd47f7338) = -1 ENOTTY (Inappropriate ioctl for device) The solution is to use all 32 bits for decoding, not just "number" and "type", but also "size" and "direction". As some architectures override defaults that come from asm-generic/ and provide alternative definitions for some ioctl commands, we support per-architecture ioctl definitions and merge them with common definitions at build time. During the merge, we used to keep both generic and architecture-specific definitions, now architecture-specific definitions have precedence over generic ones -- ioctlsort omits definitions from asm-generic/ for those ioctl names that have different definitions in asm/. Additional bits of "direction" are architecture specific -- the number of bits and their values differ between architectures. To reduce architecture differences in the source code, we keep "direction" in symbolic form and compile it in ioctlsort. Additional bits of "size" are also architecture specific -- not only the number of bits differ between architectures, but sizes of many types depend on sizeof(long). To reduce architecture differences in the source code, we keep 32-bit and 64-bit versions of common ioctl definitions, and use the appropriate version for each architecture and personality. To implement this, the tools for generating ioctl definitions from kernel headers have been rewritten, and the source format of ioctl definitions has been extended. The final ioctlent*.h files that are included by syscall.c are now generated from source ioctls_inc*.h and ioctls_arch*.h files at build time with ioctlsort. * ioctl.c (ioctl_lookup): Use all 32 bits of ioctl command code. * ioctlsort.c: Rewritten. * linux/32/ioctls_inc.h: New file. * linux/64/ioctls_inc.h: New file. * linux/aarch64/ioctls_arch0.h: New file. * linux/aarch64/ioctls_arch1.h: New file. * linux/aarch64/ioctls_inc0.h: New file. * linux/aarch64/ioctls_inc1.h: New file. * linux/alpha/ioctls_arch0.h: New file. * linux/alpha/ioctls_inc0.h: New file. * linux/arc/ioctls_arch0.h: New file. * linux/arc/ioctls_inc0.h: New file. * linux/arm/ioctls_arch0.h: New file. * linux/arm/ioctls_inc0.h: New file. * linux/avr32/ioctls_arch0.h: New file. * linux/avr32/ioctls_inc0.h: New file. * linux/bfin/ioctls_arch0.h: New file. * linux/bfin/ioctls_inc0.h: New file. * linux/hppa/ioctls_arch0.h: New file. * linux/hppa/ioctls_inc0.h: New file. * linux/i386/ioctls_arch0.h: New file. * linux/i386/ioctls_inc0.h: New file. * linux/ia64/ioctls_arch0.h: New file. * linux/ia64/ioctls_inc0.h: New file. * linux/m68k/ioctls_arch0.h: New file. * linux/m68k/ioctls_inc0.h: New file. * linux/metag/ioctls_arch0.h: New file. * linux/metag/ioctls_inc0.h: New file. * linux/microblaze/ioctls_arch0.h: New file. * linux/microblaze/ioctls_inc0.h: New file. * linux/mips/ioctls_arch0.h: New file. * linux/mips/ioctls_inc0.h: New file. * linux/or1k/ioctls_arch0.h: New file. * linux/or1k/ioctls_inc0.h: New file. * linux/powerpc/ioctls_arch0.h: New file. * linux/powerpc/ioctls_inc0.h: New file. * linux/powerpc64/ioctls_arch0.h: New file. * linux/powerpc64/ioctls_arch1.h: New file. * linux/powerpc64/ioctls_inc0.h: New file. * linux/powerpc64/ioctls_inc1.h: New file. * linux/s390/ioctls_arch0.h: New file. * linux/s390/ioctls_inc0.h: New file. * linux/s390x/ioctls_arch0.h: New file. * linux/s390x/ioctls_inc0.h: New file. * linux/sh/ioctls_arch0.h: New file. * linux/sh/ioctls_inc0.h: New file. * linux/sh64/ioctls_arch0.h: New file. * linux/sh64/ioctls_inc0.h: New file. * linux/sparc/ioctls_arch0.h: New file. * linux/sparc/ioctls_inc0.h: New file. * linux/sparc64/ioctls_arch0.h: New file. * linux/sparc64/ioctls_arch2.h: New file. * linux/sparc64/ioctls_inc0.h: New file. * linux/sparc64/ioctls_inc2.h: New file. * linux/tile/ioctls_arch0.h: New file. * linux/tile/ioctls_arch1.h: New file. * linux/tile/ioctls_inc0.h: New file. * linux/tile/ioctls_inc1.h: New file. * linux/x32/ioctls_arch0.h: New file. * linux/x32/ioctls_arch1.h: New file. * linux/x32/ioctls_inc0.h: New file. * linux/x32/ioctls_inc1.h: New file. * linux/x86_64/ioctls_arch0.h: New file. * linux/x86_64/ioctls_arch1.h: New file. * linux/x86_64/ioctls_inc0.h: New file. * linux/x86_64/ioctls_inc1.h: New file. * linux/xtensa/ioctls_arch0.h: New file. * linux/xtensa/ioctls_inc0.h: New file. * linux/aarch64/ioctlent.h.in: Remove. * linux/aarch64/ioctlent1.h: Remove. * linux/alpha/ioctlent.h.in: Remove. * linux/arc/ioctlent.h.in: Remove. * linux/arm/ioctlent.h.in: Remove. * linux/avr32/ioctlent.h.in: Remove. * linux/bfin/ioctlent.h.in: Remove. * linux/hppa/ioctlent.h.in: Remove. * linux/i386/ioctlent.h.in: Remove. * linux/ia64/ioctlent.h.in: Remove. * linux/ioctlent.h.in: Remove. * linux/ioctlent.sh: Remove. * linux/m68k/ioctlent.h.in: Remove. * linux/metag/ioctlent.h.in: Remove. * linux/microblaze/ioctlent.h.in: Remove. * linux/mips/ioctlent.h.in: Remove. * linux/mips/ioctlent.sh: Remove. * linux/or1k/ioctlent.h.in: Remove. * linux/powerpc/ioctlent.h.in: Remove. * linux/powerpc64/ioctlent.h: Remove. * linux/powerpc64/ioctlent1.h: Remove. * linux/s390/ioctlent.h.in: Remove. * linux/s390x/ioctlent.h.in: Remove. * linux/sh/ioctlent.h.in: Remove. * linux/sh64/ioctlent.h.in: Remove. * linux/sparc/ioctlent.h.in: Remove. * linux/sparc64/ioctlent.h.in: Remove. * linux/sparc64/ioctlent2.h: Remove. * linux/tile/ioctlent.h.in: Remove. * linux/tile/ioctlent1.h: Remove. * linux/x32/ioctlent.h.in: Remove. * linux/x32/ioctlent1.h: Remove. * linux/x86_64/ioctlent.h.in: Remove. * linux/x86_64/ioctlent1.h: Remove. * linux/xtensa/ioctlent.h.in: Remove. * linux/x86_64/ioctlent2.h: Include ioctlent0.h instead of ioctlent.h. * syscall.c (struct_ioctlent ioctlent0): Likewise. * Makefile.am: Remove all ioctlent-related definitions. Define the list of ioctlent*.h files that have to be generated by presence of $(srcdir)/$(OS)/$(ARCH)/ioctls_inc*.h files. Add rules for ioctlent*.h files generation. (EXTRA_DIST): Update. * maint/ioctls_gen.sh: New file. * maint/ioctls_hex.sh: New file. * maint/ioctls_sym.sh: New file. * maint/print_ioctlent.c: New file. * HACKING-scripts: Update for ioctlent.sh -> ioctls_gen.sh migration. * .gitignore: Add ioctlent[012].h and ioctls_all[012].h. * configure.ac (AC_CHECK_HEADERS): Add linux/hiddev.h and linux/mmtimer.h for tests. * tests/ioctl.c: New file. * tests/ioctl.test: New test. * tests/Makefile.am (check_PROGRAMS): Add ioctl. (TESTS): Add ioctl.test. * tests/.gitignore: Add ioctl.
2015-01-19 20:02:16 +03:00
linux/hppa/ioctls_arch0.h \
linux/hppa/ioctls_inc0.h \
Implement arch specific methods of changing syscall number and error code This introduces arch_set_error and arch_set_scno functions for each supported architecture, needed to implement syscall fault injection. * linux/aarch64/set_error.c: New file. * linux/aarch64/set_scno.c: Likewise. * linux/alpha/set_error.c: Likewise. * linux/alpha/set_scno.c: Likewise. * linux/arc/set_error.c: Likewise. * linux/arc/set_scno.c: Likewise. * linux/arm/set_error.c: Likewise. * linux/arm/set_scno.c: Likewise. * linux/avr32/set_error.c: Likewise. * linux/avr32/set_scno.c: Likewise. * linux/bfin/set_error.c: Likewise. * linux/bfin/set_scno.c: Likewise. * linux/crisv10/set_error.c: Likewise. * linux/crisv10/set_scno.c: Likewise. * linux/crisv32/set_error.c: Likewise. * linux/crisv32/set_scno.c: Likewise. * linux/hppa/set_error.c: Likewise. * linux/hppa/set_scno.c: Likewise. * linux/i386/set_error.c: Likewise. * linux/i386/set_scno.c: Likewise. * linux/ia64/set_error.c: Likewise. * linux/ia64/set_scno.c: Likewise. * linux/m68k/set_error.c: Likewise. * linux/m68k/set_scno.c: Likewise. * linux/metag/set_error.c: Likewise. * linux/metag/set_scno.c: Likewise. * linux/microblaze/set_error.c: Likewise. * linux/microblaze/set_scno.c: Likewise. * linux/mips/set_error.c: Likewise. * linux/mips/set_scno.c: Likewise. * linux/nios2/set_error.c: Likewise. * linux/nios2/set_scno.c: Likewise. * linux/or1k/set_error.c: Likewise. * linux/or1k/set_scno.c: Likewise. * linux/powerpc/set_error.c: Likewise. * linux/powerpc/set_scno.c: Likewise. * linux/powerpc64/set_error.c: Likewise. * linux/powerpc64/set_scno.c: Likewise. * linux/riscv/set_error.c: Likewise. * linux/riscv/set_scno.c: Likewise. * linux/s390/set_error.c: Likewise. * linux/s390/set_scno.c: Likewise. * linux/s390x/set_error.c: Likewise. * linux/s390x/set_scno.c: Likewise. * linux/sh/set_error.c: Likewise. * linux/sh/set_scno.c: Likewise. * linux/sh64/set_error.c: Likewise. * linux/sh64/set_scno.c: Likewise. * linux/sparc/set_error.c: Likewise. * linux/sparc/set_scno.c: Likewise. * linux/sparc64/set_error.c: Likewise. * linux/sparc64/set_scno.c: Likewise. * linux/tile/set_error.c: Likewise. * linux/tile/set_scno.c: Likewise. * linux/x32/set_error.c: Likewise. * linux/x32/set_scno.c: Likewise. * linux/x86_64/set_error.c: Likewise. * linux/x86_64/set_scno.c: Likewise. * linux/xtensa/set_error.c: Likewise. * linux/xtensa/set_scno.c: Likewise. * Makefile.am (EXTRA_DIST): Add them.
2016-11-15 20:38:21 +03:00
linux/hppa/set_error.c \
linux/hppa/set_scno.c \
linux/hppa/signalent.h \
linux/hppa/syscallent.h \
linux/i386/arch_regs.c \
linux/i386/arch_regs.h \
linux/i386/arch_sigreturn.c \
linux/i386/get_error.c \
linux/i386/get_scno.c \
linux/i386/get_syscall_args.c \
ioctl: take all 32 bits of ioctl commands into account Historically, only 16 bits (8-bit number and 8-bit type) of 32-bit ioctl commands were used for decoding, which was the source for numerous annoying collisions like this: ioctl(0, SNDCTL_TMR_TIMEBASE or SNDRV_TIMER_IOCTL_NEXT_DEVICE or TCGETS, {B38400 opost isig icanon echo ...}) = 0 ioctl(0, MGSL_IOCGPARAMS or MMTIMER_GETRES or MTIOCTOP or SNDCTL_MIDI_MPUMODE, 0x7fffd47f7338) = -1 ENOTTY (Inappropriate ioctl for device) The solution is to use all 32 bits for decoding, not just "number" and "type", but also "size" and "direction". As some architectures override defaults that come from asm-generic/ and provide alternative definitions for some ioctl commands, we support per-architecture ioctl definitions and merge them with common definitions at build time. During the merge, we used to keep both generic and architecture-specific definitions, now architecture-specific definitions have precedence over generic ones -- ioctlsort omits definitions from asm-generic/ for those ioctl names that have different definitions in asm/. Additional bits of "direction" are architecture specific -- the number of bits and their values differ between architectures. To reduce architecture differences in the source code, we keep "direction" in symbolic form and compile it in ioctlsort. Additional bits of "size" are also architecture specific -- not only the number of bits differ between architectures, but sizes of many types depend on sizeof(long). To reduce architecture differences in the source code, we keep 32-bit and 64-bit versions of common ioctl definitions, and use the appropriate version for each architecture and personality. To implement this, the tools for generating ioctl definitions from kernel headers have been rewritten, and the source format of ioctl definitions has been extended. The final ioctlent*.h files that are included by syscall.c are now generated from source ioctls_inc*.h and ioctls_arch*.h files at build time with ioctlsort. * ioctl.c (ioctl_lookup): Use all 32 bits of ioctl command code. * ioctlsort.c: Rewritten. * linux/32/ioctls_inc.h: New file. * linux/64/ioctls_inc.h: New file. * linux/aarch64/ioctls_arch0.h: New file. * linux/aarch64/ioctls_arch1.h: New file. * linux/aarch64/ioctls_inc0.h: New file. * linux/aarch64/ioctls_inc1.h: New file. * linux/alpha/ioctls_arch0.h: New file. * linux/alpha/ioctls_inc0.h: New file. * linux/arc/ioctls_arch0.h: New file. * linux/arc/ioctls_inc0.h: New file. * linux/arm/ioctls_arch0.h: New file. * linux/arm/ioctls_inc0.h: New file. * linux/avr32/ioctls_arch0.h: New file. * linux/avr32/ioctls_inc0.h: New file. * linux/bfin/ioctls_arch0.h: New file. * linux/bfin/ioctls_inc0.h: New file. * linux/hppa/ioctls_arch0.h: New file. * linux/hppa/ioctls_inc0.h: New file. * linux/i386/ioctls_arch0.h: New file. * linux/i386/ioctls_inc0.h: New file. * linux/ia64/ioctls_arch0.h: New file. * linux/ia64/ioctls_inc0.h: New file. * linux/m68k/ioctls_arch0.h: New file. * linux/m68k/ioctls_inc0.h: New file. * linux/metag/ioctls_arch0.h: New file. * linux/metag/ioctls_inc0.h: New file. * linux/microblaze/ioctls_arch0.h: New file. * linux/microblaze/ioctls_inc0.h: New file. * linux/mips/ioctls_arch0.h: New file. * linux/mips/ioctls_inc0.h: New file. * linux/or1k/ioctls_arch0.h: New file. * linux/or1k/ioctls_inc0.h: New file. * linux/powerpc/ioctls_arch0.h: New file. * linux/powerpc/ioctls_inc0.h: New file. * linux/powerpc64/ioctls_arch0.h: New file. * linux/powerpc64/ioctls_arch1.h: New file. * linux/powerpc64/ioctls_inc0.h: New file. * linux/powerpc64/ioctls_inc1.h: New file. * linux/s390/ioctls_arch0.h: New file. * linux/s390/ioctls_inc0.h: New file. * linux/s390x/ioctls_arch0.h: New file. * linux/s390x/ioctls_inc0.h: New file. * linux/sh/ioctls_arch0.h: New file. * linux/sh/ioctls_inc0.h: New file. * linux/sh64/ioctls_arch0.h: New file. * linux/sh64/ioctls_inc0.h: New file. * linux/sparc/ioctls_arch0.h: New file. * linux/sparc/ioctls_inc0.h: New file. * linux/sparc64/ioctls_arch0.h: New file. * linux/sparc64/ioctls_arch2.h: New file. * linux/sparc64/ioctls_inc0.h: New file. * linux/sparc64/ioctls_inc2.h: New file. * linux/tile/ioctls_arch0.h: New file. * linux/tile/ioctls_arch1.h: New file. * linux/tile/ioctls_inc0.h: New file. * linux/tile/ioctls_inc1.h: New file. * linux/x32/ioctls_arch0.h: New file. * linux/x32/ioctls_arch1.h: New file. * linux/x32/ioctls_inc0.h: New file. * linux/x32/ioctls_inc1.h: New file. * linux/x86_64/ioctls_arch0.h: New file. * linux/x86_64/ioctls_arch1.h: New file. * linux/x86_64/ioctls_inc0.h: New file. * linux/x86_64/ioctls_inc1.h: New file. * linux/xtensa/ioctls_arch0.h: New file. * linux/xtensa/ioctls_inc0.h: New file. * linux/aarch64/ioctlent.h.in: Remove. * linux/aarch64/ioctlent1.h: Remove. * linux/alpha/ioctlent.h.in: Remove. * linux/arc/ioctlent.h.in: Remove. * linux/arm/ioctlent.h.in: Remove. * linux/avr32/ioctlent.h.in: Remove. * linux/bfin/ioctlent.h.in: Remove. * linux/hppa/ioctlent.h.in: Remove. * linux/i386/ioctlent.h.in: Remove. * linux/ia64/ioctlent.h.in: Remove. * linux/ioctlent.h.in: Remove. * linux/ioctlent.sh: Remove. * linux/m68k/ioctlent.h.in: Remove. * linux/metag/ioctlent.h.in: Remove. * linux/microblaze/ioctlent.h.in: Remove. * linux/mips/ioctlent.h.in: Remove. * linux/mips/ioctlent.sh: Remove. * linux/or1k/ioctlent.h.in: Remove. * linux/powerpc/ioctlent.h.in: Remove. * linux/powerpc64/ioctlent.h: Remove. * linux/powerpc64/ioctlent1.h: Remove. * linux/s390/ioctlent.h.in: Remove. * linux/s390x/ioctlent.h.in: Remove. * linux/sh/ioctlent.h.in: Remove. * linux/sh64/ioctlent.h.in: Remove. * linux/sparc/ioctlent.h.in: Remove. * linux/sparc64/ioctlent.h.in: Remove. * linux/sparc64/ioctlent2.h: Remove. * linux/tile/ioctlent.h.in: Remove. * linux/tile/ioctlent1.h: Remove. * linux/x32/ioctlent.h.in: Remove. * linux/x32/ioctlent1.h: Remove. * linux/x86_64/ioctlent.h.in: Remove. * linux/x86_64/ioctlent1.h: Remove. * linux/xtensa/ioctlent.h.in: Remove. * linux/x86_64/ioctlent2.h: Include ioctlent0.h instead of ioctlent.h. * syscall.c (struct_ioctlent ioctlent0): Likewise. * Makefile.am: Remove all ioctlent-related definitions. Define the list of ioctlent*.h files that have to be generated by presence of $(srcdir)/$(OS)/$(ARCH)/ioctls_inc*.h files. Add rules for ioctlent*.h files generation. (EXTRA_DIST): Update. * maint/ioctls_gen.sh: New file. * maint/ioctls_hex.sh: New file. * maint/ioctls_sym.sh: New file. * maint/print_ioctlent.c: New file. * HACKING-scripts: Update for ioctlent.sh -> ioctls_gen.sh migration. * .gitignore: Add ioctlent[012].h and ioctls_all[012].h. * configure.ac (AC_CHECK_HEADERS): Add linux/hiddev.h and linux/mmtimer.h for tests. * tests/ioctl.c: New file. * tests/ioctl.test: New test. * tests/Makefile.am (check_PROGRAMS): Add ioctl. (TESTS): Add ioctl.test. * tests/.gitignore: Add ioctl.
2015-01-19 20:02:16 +03:00
linux/i386/ioctls_arch0.h \
linux/i386/ioctls_inc0.h \
Implement arch specific methods of changing syscall number and error code This introduces arch_set_error and arch_set_scno functions for each supported architecture, needed to implement syscall fault injection. * linux/aarch64/set_error.c: New file. * linux/aarch64/set_scno.c: Likewise. * linux/alpha/set_error.c: Likewise. * linux/alpha/set_scno.c: Likewise. * linux/arc/set_error.c: Likewise. * linux/arc/set_scno.c: Likewise. * linux/arm/set_error.c: Likewise. * linux/arm/set_scno.c: Likewise. * linux/avr32/set_error.c: Likewise. * linux/avr32/set_scno.c: Likewise. * linux/bfin/set_error.c: Likewise. * linux/bfin/set_scno.c: Likewise. * linux/crisv10/set_error.c: Likewise. * linux/crisv10/set_scno.c: Likewise. * linux/crisv32/set_error.c: Likewise. * linux/crisv32/set_scno.c: Likewise. * linux/hppa/set_error.c: Likewise. * linux/hppa/set_scno.c: Likewise. * linux/i386/set_error.c: Likewise. * linux/i386/set_scno.c: Likewise. * linux/ia64/set_error.c: Likewise. * linux/ia64/set_scno.c: Likewise. * linux/m68k/set_error.c: Likewise. * linux/m68k/set_scno.c: Likewise. * linux/metag/set_error.c: Likewise. * linux/metag/set_scno.c: Likewise. * linux/microblaze/set_error.c: Likewise. * linux/microblaze/set_scno.c: Likewise. * linux/mips/set_error.c: Likewise. * linux/mips/set_scno.c: Likewise. * linux/nios2/set_error.c: Likewise. * linux/nios2/set_scno.c: Likewise. * linux/or1k/set_error.c: Likewise. * linux/or1k/set_scno.c: Likewise. * linux/powerpc/set_error.c: Likewise. * linux/powerpc/set_scno.c: Likewise. * linux/powerpc64/set_error.c: Likewise. * linux/powerpc64/set_scno.c: Likewise. * linux/riscv/set_error.c: Likewise. * linux/riscv/set_scno.c: Likewise. * linux/s390/set_error.c: Likewise. * linux/s390/set_scno.c: Likewise. * linux/s390x/set_error.c: Likewise. * linux/s390x/set_scno.c: Likewise. * linux/sh/set_error.c: Likewise. * linux/sh/set_scno.c: Likewise. * linux/sh64/set_error.c: Likewise. * linux/sh64/set_scno.c: Likewise. * linux/sparc/set_error.c: Likewise. * linux/sparc/set_scno.c: Likewise. * linux/sparc64/set_error.c: Likewise. * linux/sparc64/set_scno.c: Likewise. * linux/tile/set_error.c: Likewise. * linux/tile/set_scno.c: Likewise. * linux/x32/set_error.c: Likewise. * linux/x32/set_scno.c: Likewise. * linux/x86_64/set_error.c: Likewise. * linux/x86_64/set_scno.c: Likewise. * linux/xtensa/set_error.c: Likewise. * linux/xtensa/set_scno.c: Likewise. * Makefile.am (EXTRA_DIST): Add them.
2016-11-15 20:38:21 +03:00
linux/i386/set_error.c \
linux/i386/set_scno.c \
linux/i386/syscallent.h \
linux/i386/userent.h \
linux/i386/userent0.h \
linux/ia64/arch_getrval2.c \
linux/ia64/arch_regs.c \
linux/ia64/arch_regs.h \
linux/ia64/arch_sigreturn.c \
linux/ia64/get_error.c \
linux/ia64/get_scno.c \
linux/ia64/get_syscall_args.c \
ioctl: take all 32 bits of ioctl commands into account Historically, only 16 bits (8-bit number and 8-bit type) of 32-bit ioctl commands were used for decoding, which was the source for numerous annoying collisions like this: ioctl(0, SNDCTL_TMR_TIMEBASE or SNDRV_TIMER_IOCTL_NEXT_DEVICE or TCGETS, {B38400 opost isig icanon echo ...}) = 0 ioctl(0, MGSL_IOCGPARAMS or MMTIMER_GETRES or MTIOCTOP or SNDCTL_MIDI_MPUMODE, 0x7fffd47f7338) = -1 ENOTTY (Inappropriate ioctl for device) The solution is to use all 32 bits for decoding, not just "number" and "type", but also "size" and "direction". As some architectures override defaults that come from asm-generic/ and provide alternative definitions for some ioctl commands, we support per-architecture ioctl definitions and merge them with common definitions at build time. During the merge, we used to keep both generic and architecture-specific definitions, now architecture-specific definitions have precedence over generic ones -- ioctlsort omits definitions from asm-generic/ for those ioctl names that have different definitions in asm/. Additional bits of "direction" are architecture specific -- the number of bits and their values differ between architectures. To reduce architecture differences in the source code, we keep "direction" in symbolic form and compile it in ioctlsort. Additional bits of "size" are also architecture specific -- not only the number of bits differ between architectures, but sizes of many types depend on sizeof(long). To reduce architecture differences in the source code, we keep 32-bit and 64-bit versions of common ioctl definitions, and use the appropriate version for each architecture and personality. To implement this, the tools for generating ioctl definitions from kernel headers have been rewritten, and the source format of ioctl definitions has been extended. The final ioctlent*.h files that are included by syscall.c are now generated from source ioctls_inc*.h and ioctls_arch*.h files at build time with ioctlsort. * ioctl.c (ioctl_lookup): Use all 32 bits of ioctl command code. * ioctlsort.c: Rewritten. * linux/32/ioctls_inc.h: New file. * linux/64/ioctls_inc.h: New file. * linux/aarch64/ioctls_arch0.h: New file. * linux/aarch64/ioctls_arch1.h: New file. * linux/aarch64/ioctls_inc0.h: New file. * linux/aarch64/ioctls_inc1.h: New file. * linux/alpha/ioctls_arch0.h: New file. * linux/alpha/ioctls_inc0.h: New file. * linux/arc/ioctls_arch0.h: New file. * linux/arc/ioctls_inc0.h: New file. * linux/arm/ioctls_arch0.h: New file. * linux/arm/ioctls_inc0.h: New file. * linux/avr32/ioctls_arch0.h: New file. * linux/avr32/ioctls_inc0.h: New file. * linux/bfin/ioctls_arch0.h: New file. * linux/bfin/ioctls_inc0.h: New file. * linux/hppa/ioctls_arch0.h: New file. * linux/hppa/ioctls_inc0.h: New file. * linux/i386/ioctls_arch0.h: New file. * linux/i386/ioctls_inc0.h: New file. * linux/ia64/ioctls_arch0.h: New file. * linux/ia64/ioctls_inc0.h: New file. * linux/m68k/ioctls_arch0.h: New file. * linux/m68k/ioctls_inc0.h: New file. * linux/metag/ioctls_arch0.h: New file. * linux/metag/ioctls_inc0.h: New file. * linux/microblaze/ioctls_arch0.h: New file. * linux/microblaze/ioctls_inc0.h: New file. * linux/mips/ioctls_arch0.h: New file. * linux/mips/ioctls_inc0.h: New file. * linux/or1k/ioctls_arch0.h: New file. * linux/or1k/ioctls_inc0.h: New file. * linux/powerpc/ioctls_arch0.h: New file. * linux/powerpc/ioctls_inc0.h: New file. * linux/powerpc64/ioctls_arch0.h: New file. * linux/powerpc64/ioctls_arch1.h: New file. * linux/powerpc64/ioctls_inc0.h: New file. * linux/powerpc64/ioctls_inc1.h: New file. * linux/s390/ioctls_arch0.h: New file. * linux/s390/ioctls_inc0.h: New file. * linux/s390x/ioctls_arch0.h: New file. * linux/s390x/ioctls_inc0.h: New file. * linux/sh/ioctls_arch0.h: New file. * linux/sh/ioctls_inc0.h: New file. * linux/sh64/ioctls_arch0.h: New file. * linux/sh64/ioctls_inc0.h: New file. * linux/sparc/ioctls_arch0.h: New file. * linux/sparc/ioctls_inc0.h: New file. * linux/sparc64/ioctls_arch0.h: New file. * linux/sparc64/ioctls_arch2.h: New file. * linux/sparc64/ioctls_inc0.h: New file. * linux/sparc64/ioctls_inc2.h: New file. * linux/tile/ioctls_arch0.h: New file. * linux/tile/ioctls_arch1.h: New file. * linux/tile/ioctls_inc0.h: New file. * linux/tile/ioctls_inc1.h: New file. * linux/x32/ioctls_arch0.h: New file. * linux/x32/ioctls_arch1.h: New file. * linux/x32/ioctls_inc0.h: New file. * linux/x32/ioctls_inc1.h: New file. * linux/x86_64/ioctls_arch0.h: New file. * linux/x86_64/ioctls_arch1.h: New file. * linux/x86_64/ioctls_inc0.h: New file. * linux/x86_64/ioctls_inc1.h: New file. * linux/xtensa/ioctls_arch0.h: New file. * linux/xtensa/ioctls_inc0.h: New file. * linux/aarch64/ioctlent.h.in: Remove. * linux/aarch64/ioctlent1.h: Remove. * linux/alpha/ioctlent.h.in: Remove. * linux/arc/ioctlent.h.in: Remove. * linux/arm/ioctlent.h.in: Remove. * linux/avr32/ioctlent.h.in: Remove. * linux/bfin/ioctlent.h.in: Remove. * linux/hppa/ioctlent.h.in: Remove. * linux/i386/ioctlent.h.in: Remove. * linux/ia64/ioctlent.h.in: Remove. * linux/ioctlent.h.in: Remove. * linux/ioctlent.sh: Remove. * linux/m68k/ioctlent.h.in: Remove. * linux/metag/ioctlent.h.in: Remove. * linux/microblaze/ioctlent.h.in: Remove. * linux/mips/ioctlent.h.in: Remove. * linux/mips/ioctlent.sh: Remove. * linux/or1k/ioctlent.h.in: Remove. * linux/powerpc/ioctlent.h.in: Remove. * linux/powerpc64/ioctlent.h: Remove. * linux/powerpc64/ioctlent1.h: Remove. * linux/s390/ioctlent.h.in: Remove. * linux/s390x/ioctlent.h.in: Remove. * linux/sh/ioctlent.h.in: Remove. * linux/sh64/ioctlent.h.in: Remove. * linux/sparc/ioctlent.h.in: Remove. * linux/sparc64/ioctlent.h.in: Remove. * linux/sparc64/ioctlent2.h: Remove. * linux/tile/ioctlent.h.in: Remove. * linux/tile/ioctlent1.h: Remove. * linux/x32/ioctlent.h.in: Remove. * linux/x32/ioctlent1.h: Remove. * linux/x86_64/ioctlent.h.in: Remove. * linux/x86_64/ioctlent1.h: Remove. * linux/xtensa/ioctlent.h.in: Remove. * linux/x86_64/ioctlent2.h: Include ioctlent0.h instead of ioctlent.h. * syscall.c (struct_ioctlent ioctlent0): Likewise. * Makefile.am: Remove all ioctlent-related definitions. Define the list of ioctlent*.h files that have to be generated by presence of $(srcdir)/$(OS)/$(ARCH)/ioctls_inc*.h files. Add rules for ioctlent*.h files generation. (EXTRA_DIST): Update. * maint/ioctls_gen.sh: New file. * maint/ioctls_hex.sh: New file. * maint/ioctls_sym.sh: New file. * maint/print_ioctlent.c: New file. * HACKING-scripts: Update for ioctlent.sh -> ioctls_gen.sh migration. * .gitignore: Add ioctlent[012].h and ioctls_all[012].h. * configure.ac (AC_CHECK_HEADERS): Add linux/hiddev.h and linux/mmtimer.h for tests. * tests/ioctl.c: New file. * tests/ioctl.test: New test. * tests/Makefile.am (check_PROGRAMS): Add ioctl. (TESTS): Add ioctl.test. * tests/.gitignore: Add ioctl.
2015-01-19 20:02:16 +03:00
linux/ia64/ioctls_arch0.h \
linux/ia64/ioctls_inc0.h \
Implement arch specific methods of changing syscall number and error code This introduces arch_set_error and arch_set_scno functions for each supported architecture, needed to implement syscall fault injection. * linux/aarch64/set_error.c: New file. * linux/aarch64/set_scno.c: Likewise. * linux/alpha/set_error.c: Likewise. * linux/alpha/set_scno.c: Likewise. * linux/arc/set_error.c: Likewise. * linux/arc/set_scno.c: Likewise. * linux/arm/set_error.c: Likewise. * linux/arm/set_scno.c: Likewise. * linux/avr32/set_error.c: Likewise. * linux/avr32/set_scno.c: Likewise. * linux/bfin/set_error.c: Likewise. * linux/bfin/set_scno.c: Likewise. * linux/crisv10/set_error.c: Likewise. * linux/crisv10/set_scno.c: Likewise. * linux/crisv32/set_error.c: Likewise. * linux/crisv32/set_scno.c: Likewise. * linux/hppa/set_error.c: Likewise. * linux/hppa/set_scno.c: Likewise. * linux/i386/set_error.c: Likewise. * linux/i386/set_scno.c: Likewise. * linux/ia64/set_error.c: Likewise. * linux/ia64/set_scno.c: Likewise. * linux/m68k/set_error.c: Likewise. * linux/m68k/set_scno.c: Likewise. * linux/metag/set_error.c: Likewise. * linux/metag/set_scno.c: Likewise. * linux/microblaze/set_error.c: Likewise. * linux/microblaze/set_scno.c: Likewise. * linux/mips/set_error.c: Likewise. * linux/mips/set_scno.c: Likewise. * linux/nios2/set_error.c: Likewise. * linux/nios2/set_scno.c: Likewise. * linux/or1k/set_error.c: Likewise. * linux/or1k/set_scno.c: Likewise. * linux/powerpc/set_error.c: Likewise. * linux/powerpc/set_scno.c: Likewise. * linux/powerpc64/set_error.c: Likewise. * linux/powerpc64/set_scno.c: Likewise. * linux/riscv/set_error.c: Likewise. * linux/riscv/set_scno.c: Likewise. * linux/s390/set_error.c: Likewise. * linux/s390/set_scno.c: Likewise. * linux/s390x/set_error.c: Likewise. * linux/s390x/set_scno.c: Likewise. * linux/sh/set_error.c: Likewise. * linux/sh/set_scno.c: Likewise. * linux/sh64/set_error.c: Likewise. * linux/sh64/set_scno.c: Likewise. * linux/sparc/set_error.c: Likewise. * linux/sparc/set_scno.c: Likewise. * linux/sparc64/set_error.c: Likewise. * linux/sparc64/set_scno.c: Likewise. * linux/tile/set_error.c: Likewise. * linux/tile/set_scno.c: Likewise. * linux/x32/set_error.c: Likewise. * linux/x32/set_scno.c: Likewise. * linux/x86_64/set_error.c: Likewise. * linux/x86_64/set_scno.c: Likewise. * linux/xtensa/set_error.c: Likewise. * linux/xtensa/set_scno.c: Likewise. * Makefile.am (EXTRA_DIST): Add them.
2016-11-15 20:38:21 +03:00
linux/ia64/set_error.c \
linux/ia64/set_scno.c \
linux/ia64/syscallent.h \
linux/ia64/userent.h \
linux/inet_diag.h \
linux/m68k/arch_regs.c \
linux/m68k/arch_regs.h \
linux/m68k/arch_sigreturn.c \
linux/m68k/get_error.c \
linux/m68k/get_scno.c \
linux/m68k/get_syscall_args.c \
ioctl: take all 32 bits of ioctl commands into account Historically, only 16 bits (8-bit number and 8-bit type) of 32-bit ioctl commands were used for decoding, which was the source for numerous annoying collisions like this: ioctl(0, SNDCTL_TMR_TIMEBASE or SNDRV_TIMER_IOCTL_NEXT_DEVICE or TCGETS, {B38400 opost isig icanon echo ...}) = 0 ioctl(0, MGSL_IOCGPARAMS or MMTIMER_GETRES or MTIOCTOP or SNDCTL_MIDI_MPUMODE, 0x7fffd47f7338) = -1 ENOTTY (Inappropriate ioctl for device) The solution is to use all 32 bits for decoding, not just "number" and "type", but also "size" and "direction". As some architectures override defaults that come from asm-generic/ and provide alternative definitions for some ioctl commands, we support per-architecture ioctl definitions and merge them with common definitions at build time. During the merge, we used to keep both generic and architecture-specific definitions, now architecture-specific definitions have precedence over generic ones -- ioctlsort omits definitions from asm-generic/ for those ioctl names that have different definitions in asm/. Additional bits of "direction" are architecture specific -- the number of bits and their values differ between architectures. To reduce architecture differences in the source code, we keep "direction" in symbolic form and compile it in ioctlsort. Additional bits of "size" are also architecture specific -- not only the number of bits differ between architectures, but sizes of many types depend on sizeof(long). To reduce architecture differences in the source code, we keep 32-bit and 64-bit versions of common ioctl definitions, and use the appropriate version for each architecture and personality. To implement this, the tools for generating ioctl definitions from kernel headers have been rewritten, and the source format of ioctl definitions has been extended. The final ioctlent*.h files that are included by syscall.c are now generated from source ioctls_inc*.h and ioctls_arch*.h files at build time with ioctlsort. * ioctl.c (ioctl_lookup): Use all 32 bits of ioctl command code. * ioctlsort.c: Rewritten. * linux/32/ioctls_inc.h: New file. * linux/64/ioctls_inc.h: New file. * linux/aarch64/ioctls_arch0.h: New file. * linux/aarch64/ioctls_arch1.h: New file. * linux/aarch64/ioctls_inc0.h: New file. * linux/aarch64/ioctls_inc1.h: New file. * linux/alpha/ioctls_arch0.h: New file. * linux/alpha/ioctls_inc0.h: New file. * linux/arc/ioctls_arch0.h: New file. * linux/arc/ioctls_inc0.h: New file. * linux/arm/ioctls_arch0.h: New file. * linux/arm/ioctls_inc0.h: New file. * linux/avr32/ioctls_arch0.h: New file. * linux/avr32/ioctls_inc0.h: New file. * linux/bfin/ioctls_arch0.h: New file. * linux/bfin/ioctls_inc0.h: New file. * linux/hppa/ioctls_arch0.h: New file. * linux/hppa/ioctls_inc0.h: New file. * linux/i386/ioctls_arch0.h: New file. * linux/i386/ioctls_inc0.h: New file. * linux/ia64/ioctls_arch0.h: New file. * linux/ia64/ioctls_inc0.h: New file. * linux/m68k/ioctls_arch0.h: New file. * linux/m68k/ioctls_inc0.h: New file. * linux/metag/ioctls_arch0.h: New file. * linux/metag/ioctls_inc0.h: New file. * linux/microblaze/ioctls_arch0.h: New file. * linux/microblaze/ioctls_inc0.h: New file. * linux/mips/ioctls_arch0.h: New file. * linux/mips/ioctls_inc0.h: New file. * linux/or1k/ioctls_arch0.h: New file. * linux/or1k/ioctls_inc0.h: New file. * linux/powerpc/ioctls_arch0.h: New file. * linux/powerpc/ioctls_inc0.h: New file. * linux/powerpc64/ioctls_arch0.h: New file. * linux/powerpc64/ioctls_arch1.h: New file. * linux/powerpc64/ioctls_inc0.h: New file. * linux/powerpc64/ioctls_inc1.h: New file. * linux/s390/ioctls_arch0.h: New file. * linux/s390/ioctls_inc0.h: New file. * linux/s390x/ioctls_arch0.h: New file. * linux/s390x/ioctls_inc0.h: New file. * linux/sh/ioctls_arch0.h: New file. * linux/sh/ioctls_inc0.h: New file. * linux/sh64/ioctls_arch0.h: New file. * linux/sh64/ioctls_inc0.h: New file. * linux/sparc/ioctls_arch0.h: New file. * linux/sparc/ioctls_inc0.h: New file. * linux/sparc64/ioctls_arch0.h: New file. * linux/sparc64/ioctls_arch2.h: New file. * linux/sparc64/ioctls_inc0.h: New file. * linux/sparc64/ioctls_inc2.h: New file. * linux/tile/ioctls_arch0.h: New file. * linux/tile/ioctls_arch1.h: New file. * linux/tile/ioctls_inc0.h: New file. * linux/tile/ioctls_inc1.h: New file. * linux/x32/ioctls_arch0.h: New file. * linux/x32/ioctls_arch1.h: New file. * linux/x32/ioctls_inc0.h: New file. * linux/x32/ioctls_inc1.h: New file. * linux/x86_64/ioctls_arch0.h: New file. * linux/x86_64/ioctls_arch1.h: New file. * linux/x86_64/ioctls_inc0.h: New file. * linux/x86_64/ioctls_inc1.h: New file. * linux/xtensa/ioctls_arch0.h: New file. * linux/xtensa/ioctls_inc0.h: New file. * linux/aarch64/ioctlent.h.in: Remove. * linux/aarch64/ioctlent1.h: Remove. * linux/alpha/ioctlent.h.in: Remove. * linux/arc/ioctlent.h.in: Remove. * linux/arm/ioctlent.h.in: Remove. * linux/avr32/ioctlent.h.in: Remove. * linux/bfin/ioctlent.h.in: Remove. * linux/hppa/ioctlent.h.in: Remove. * linux/i386/ioctlent.h.in: Remove. * linux/ia64/ioctlent.h.in: Remove. * linux/ioctlent.h.in: Remove. * linux/ioctlent.sh: Remove. * linux/m68k/ioctlent.h.in: Remove. * linux/metag/ioctlent.h.in: Remove. * linux/microblaze/ioctlent.h.in: Remove. * linux/mips/ioctlent.h.in: Remove. * linux/mips/ioctlent.sh: Remove. * linux/or1k/ioctlent.h.in: Remove. * linux/powerpc/ioctlent.h.in: Remove. * linux/powerpc64/ioctlent.h: Remove. * linux/powerpc64/ioctlent1.h: Remove. * linux/s390/ioctlent.h.in: Remove. * linux/s390x/ioctlent.h.in: Remove. * linux/sh/ioctlent.h.in: Remove. * linux/sh64/ioctlent.h.in: Remove. * linux/sparc/ioctlent.h.in: Remove. * linux/sparc64/ioctlent.h.in: Remove. * linux/sparc64/ioctlent2.h: Remove. * linux/tile/ioctlent.h.in: Remove. * linux/tile/ioctlent1.h: Remove. * linux/x32/ioctlent.h.in: Remove. * linux/x32/ioctlent1.h: Remove. * linux/x86_64/ioctlent.h.in: Remove. * linux/x86_64/ioctlent1.h: Remove. * linux/xtensa/ioctlent.h.in: Remove. * linux/x86_64/ioctlent2.h: Include ioctlent0.h instead of ioctlent.h. * syscall.c (struct_ioctlent ioctlent0): Likewise. * Makefile.am: Remove all ioctlent-related definitions. Define the list of ioctlent*.h files that have to be generated by presence of $(srcdir)/$(OS)/$(ARCH)/ioctls_inc*.h files. Add rules for ioctlent*.h files generation. (EXTRA_DIST): Update. * maint/ioctls_gen.sh: New file. * maint/ioctls_hex.sh: New file. * maint/ioctls_sym.sh: New file. * maint/print_ioctlent.c: New file. * HACKING-scripts: Update for ioctlent.sh -> ioctls_gen.sh migration. * .gitignore: Add ioctlent[012].h and ioctls_all[012].h. * configure.ac (AC_CHECK_HEADERS): Add linux/hiddev.h and linux/mmtimer.h for tests. * tests/ioctl.c: New file. * tests/ioctl.test: New test. * tests/Makefile.am (check_PROGRAMS): Add ioctl. (TESTS): Add ioctl.test. * tests/.gitignore: Add ioctl.
2015-01-19 20:02:16 +03:00
linux/m68k/ioctls_arch0.h \
linux/m68k/ioctls_inc0.h \
Implement arch specific methods of changing syscall number and error code This introduces arch_set_error and arch_set_scno functions for each supported architecture, needed to implement syscall fault injection. * linux/aarch64/set_error.c: New file. * linux/aarch64/set_scno.c: Likewise. * linux/alpha/set_error.c: Likewise. * linux/alpha/set_scno.c: Likewise. * linux/arc/set_error.c: Likewise. * linux/arc/set_scno.c: Likewise. * linux/arm/set_error.c: Likewise. * linux/arm/set_scno.c: Likewise. * linux/avr32/set_error.c: Likewise. * linux/avr32/set_scno.c: Likewise. * linux/bfin/set_error.c: Likewise. * linux/bfin/set_scno.c: Likewise. * linux/crisv10/set_error.c: Likewise. * linux/crisv10/set_scno.c: Likewise. * linux/crisv32/set_error.c: Likewise. * linux/crisv32/set_scno.c: Likewise. * linux/hppa/set_error.c: Likewise. * linux/hppa/set_scno.c: Likewise. * linux/i386/set_error.c: Likewise. * linux/i386/set_scno.c: Likewise. * linux/ia64/set_error.c: Likewise. * linux/ia64/set_scno.c: Likewise. * linux/m68k/set_error.c: Likewise. * linux/m68k/set_scno.c: Likewise. * linux/metag/set_error.c: Likewise. * linux/metag/set_scno.c: Likewise. * linux/microblaze/set_error.c: Likewise. * linux/microblaze/set_scno.c: Likewise. * linux/mips/set_error.c: Likewise. * linux/mips/set_scno.c: Likewise. * linux/nios2/set_error.c: Likewise. * linux/nios2/set_scno.c: Likewise. * linux/or1k/set_error.c: Likewise. * linux/or1k/set_scno.c: Likewise. * linux/powerpc/set_error.c: Likewise. * linux/powerpc/set_scno.c: Likewise. * linux/powerpc64/set_error.c: Likewise. * linux/powerpc64/set_scno.c: Likewise. * linux/riscv/set_error.c: Likewise. * linux/riscv/set_scno.c: Likewise. * linux/s390/set_error.c: Likewise. * linux/s390/set_scno.c: Likewise. * linux/s390x/set_error.c: Likewise. * linux/s390x/set_scno.c: Likewise. * linux/sh/set_error.c: Likewise. * linux/sh/set_scno.c: Likewise. * linux/sh64/set_error.c: Likewise. * linux/sh64/set_scno.c: Likewise. * linux/sparc/set_error.c: Likewise. * linux/sparc/set_scno.c: Likewise. * linux/sparc64/set_error.c: Likewise. * linux/sparc64/set_scno.c: Likewise. * linux/tile/set_error.c: Likewise. * linux/tile/set_scno.c: Likewise. * linux/x32/set_error.c: Likewise. * linux/x32/set_scno.c: Likewise. * linux/x86_64/set_error.c: Likewise. * linux/x86_64/set_scno.c: Likewise. * linux/xtensa/set_error.c: Likewise. * linux/xtensa/set_scno.c: Likewise. * Makefile.am (EXTRA_DIST): Add them.
2016-11-15 20:38:21 +03:00
linux/m68k/set_error.c \
linux/m68k/set_scno.c \
linux/m68k/syscallent.h \
linux/m68k/userent.h \
linux/metag/arch_regs.c \
linux/metag/get_error.c \
linux/metag/get_scno.c \
linux/metag/get_syscall_args.c \
ioctl: take all 32 bits of ioctl commands into account Historically, only 16 bits (8-bit number and 8-bit type) of 32-bit ioctl commands were used for decoding, which was the source for numerous annoying collisions like this: ioctl(0, SNDCTL_TMR_TIMEBASE or SNDRV_TIMER_IOCTL_NEXT_DEVICE or TCGETS, {B38400 opost isig icanon echo ...}) = 0 ioctl(0, MGSL_IOCGPARAMS or MMTIMER_GETRES or MTIOCTOP or SNDCTL_MIDI_MPUMODE, 0x7fffd47f7338) = -1 ENOTTY (Inappropriate ioctl for device) The solution is to use all 32 bits for decoding, not just "number" and "type", but also "size" and "direction". As some architectures override defaults that come from asm-generic/ and provide alternative definitions for some ioctl commands, we support per-architecture ioctl definitions and merge them with common definitions at build time. During the merge, we used to keep both generic and architecture-specific definitions, now architecture-specific definitions have precedence over generic ones -- ioctlsort omits definitions from asm-generic/ for those ioctl names that have different definitions in asm/. Additional bits of "direction" are architecture specific -- the number of bits and their values differ between architectures. To reduce architecture differences in the source code, we keep "direction" in symbolic form and compile it in ioctlsort. Additional bits of "size" are also architecture specific -- not only the number of bits differ between architectures, but sizes of many types depend on sizeof(long). To reduce architecture differences in the source code, we keep 32-bit and 64-bit versions of common ioctl definitions, and use the appropriate version for each architecture and personality. To implement this, the tools for generating ioctl definitions from kernel headers have been rewritten, and the source format of ioctl definitions has been extended. The final ioctlent*.h files that are included by syscall.c are now generated from source ioctls_inc*.h and ioctls_arch*.h files at build time with ioctlsort. * ioctl.c (ioctl_lookup): Use all 32 bits of ioctl command code. * ioctlsort.c: Rewritten. * linux/32/ioctls_inc.h: New file. * linux/64/ioctls_inc.h: New file. * linux/aarch64/ioctls_arch0.h: New file. * linux/aarch64/ioctls_arch1.h: New file. * linux/aarch64/ioctls_inc0.h: New file. * linux/aarch64/ioctls_inc1.h: New file. * linux/alpha/ioctls_arch0.h: New file. * linux/alpha/ioctls_inc0.h: New file. * linux/arc/ioctls_arch0.h: New file. * linux/arc/ioctls_inc0.h: New file. * linux/arm/ioctls_arch0.h: New file. * linux/arm/ioctls_inc0.h: New file. * linux/avr32/ioctls_arch0.h: New file. * linux/avr32/ioctls_inc0.h: New file. * linux/bfin/ioctls_arch0.h: New file. * linux/bfin/ioctls_inc0.h: New file. * linux/hppa/ioctls_arch0.h: New file. * linux/hppa/ioctls_inc0.h: New file. * linux/i386/ioctls_arch0.h: New file. * linux/i386/ioctls_inc0.h: New file. * linux/ia64/ioctls_arch0.h: New file. * linux/ia64/ioctls_inc0.h: New file. * linux/m68k/ioctls_arch0.h: New file. * linux/m68k/ioctls_inc0.h: New file. * linux/metag/ioctls_arch0.h: New file. * linux/metag/ioctls_inc0.h: New file. * linux/microblaze/ioctls_arch0.h: New file. * linux/microblaze/ioctls_inc0.h: New file. * linux/mips/ioctls_arch0.h: New file. * linux/mips/ioctls_inc0.h: New file. * linux/or1k/ioctls_arch0.h: New file. * linux/or1k/ioctls_inc0.h: New file. * linux/powerpc/ioctls_arch0.h: New file. * linux/powerpc/ioctls_inc0.h: New file. * linux/powerpc64/ioctls_arch0.h: New file. * linux/powerpc64/ioctls_arch1.h: New file. * linux/powerpc64/ioctls_inc0.h: New file. * linux/powerpc64/ioctls_inc1.h: New file. * linux/s390/ioctls_arch0.h: New file. * linux/s390/ioctls_inc0.h: New file. * linux/s390x/ioctls_arch0.h: New file. * linux/s390x/ioctls_inc0.h: New file. * linux/sh/ioctls_arch0.h: New file. * linux/sh/ioctls_inc0.h: New file. * linux/sh64/ioctls_arch0.h: New file. * linux/sh64/ioctls_inc0.h: New file. * linux/sparc/ioctls_arch0.h: New file. * linux/sparc/ioctls_inc0.h: New file. * linux/sparc64/ioctls_arch0.h: New file. * linux/sparc64/ioctls_arch2.h: New file. * linux/sparc64/ioctls_inc0.h: New file. * linux/sparc64/ioctls_inc2.h: New file. * linux/tile/ioctls_arch0.h: New file. * linux/tile/ioctls_arch1.h: New file. * linux/tile/ioctls_inc0.h: New file. * linux/tile/ioctls_inc1.h: New file. * linux/x32/ioctls_arch0.h: New file. * linux/x32/ioctls_arch1.h: New file. * linux/x32/ioctls_inc0.h: New file. * linux/x32/ioctls_inc1.h: New file. * linux/x86_64/ioctls_arch0.h: New file. * linux/x86_64/ioctls_arch1.h: New file. * linux/x86_64/ioctls_inc0.h: New file. * linux/x86_64/ioctls_inc1.h: New file. * linux/xtensa/ioctls_arch0.h: New file. * linux/xtensa/ioctls_inc0.h: New file. * linux/aarch64/ioctlent.h.in: Remove. * linux/aarch64/ioctlent1.h: Remove. * linux/alpha/ioctlent.h.in: Remove. * linux/arc/ioctlent.h.in: Remove. * linux/arm/ioctlent.h.in: Remove. * linux/avr32/ioctlent.h.in: Remove. * linux/bfin/ioctlent.h.in: Remove. * linux/hppa/ioctlent.h.in: Remove. * linux/i386/ioctlent.h.in: Remove. * linux/ia64/ioctlent.h.in: Remove. * linux/ioctlent.h.in: Remove. * linux/ioctlent.sh: Remove. * linux/m68k/ioctlent.h.in: Remove. * linux/metag/ioctlent.h.in: Remove. * linux/microblaze/ioctlent.h.in: Remove. * linux/mips/ioctlent.h.in: Remove. * linux/mips/ioctlent.sh: Remove. * linux/or1k/ioctlent.h.in: Remove. * linux/powerpc/ioctlent.h.in: Remove. * linux/powerpc64/ioctlent.h: Remove. * linux/powerpc64/ioctlent1.h: Remove. * linux/s390/ioctlent.h.in: Remove. * linux/s390x/ioctlent.h.in: Remove. * linux/sh/ioctlent.h.in: Remove. * linux/sh64/ioctlent.h.in: Remove. * linux/sparc/ioctlent.h.in: Remove. * linux/sparc64/ioctlent.h.in: Remove. * linux/sparc64/ioctlent2.h: Remove. * linux/tile/ioctlent.h.in: Remove. * linux/tile/ioctlent1.h: Remove. * linux/x32/ioctlent.h.in: Remove. * linux/x32/ioctlent1.h: Remove. * linux/x86_64/ioctlent.h.in: Remove. * linux/x86_64/ioctlent1.h: Remove. * linux/xtensa/ioctlent.h.in: Remove. * linux/x86_64/ioctlent2.h: Include ioctlent0.h instead of ioctlent.h. * syscall.c (struct_ioctlent ioctlent0): Likewise. * Makefile.am: Remove all ioctlent-related definitions. Define the list of ioctlent*.h files that have to be generated by presence of $(srcdir)/$(OS)/$(ARCH)/ioctls_inc*.h files. Add rules for ioctlent*.h files generation. (EXTRA_DIST): Update. * maint/ioctls_gen.sh: New file. * maint/ioctls_hex.sh: New file. * maint/ioctls_sym.sh: New file. * maint/print_ioctlent.c: New file. * HACKING-scripts: Update for ioctlent.sh -> ioctls_gen.sh migration. * .gitignore: Add ioctlent[012].h and ioctls_all[012].h. * configure.ac (AC_CHECK_HEADERS): Add linux/hiddev.h and linux/mmtimer.h for tests. * tests/ioctl.c: New file. * tests/ioctl.test: New test. * tests/Makefile.am (check_PROGRAMS): Add ioctl. (TESTS): Add ioctl.test. * tests/.gitignore: Add ioctl.
2015-01-19 20:02:16 +03:00
linux/metag/ioctls_arch0.h \
linux/metag/ioctls_inc0.h \
Implement arch specific methods of changing syscall number and error code This introduces arch_set_error and arch_set_scno functions for each supported architecture, needed to implement syscall fault injection. * linux/aarch64/set_error.c: New file. * linux/aarch64/set_scno.c: Likewise. * linux/alpha/set_error.c: Likewise. * linux/alpha/set_scno.c: Likewise. * linux/arc/set_error.c: Likewise. * linux/arc/set_scno.c: Likewise. * linux/arm/set_error.c: Likewise. * linux/arm/set_scno.c: Likewise. * linux/avr32/set_error.c: Likewise. * linux/avr32/set_scno.c: Likewise. * linux/bfin/set_error.c: Likewise. * linux/bfin/set_scno.c: Likewise. * linux/crisv10/set_error.c: Likewise. * linux/crisv10/set_scno.c: Likewise. * linux/crisv32/set_error.c: Likewise. * linux/crisv32/set_scno.c: Likewise. * linux/hppa/set_error.c: Likewise. * linux/hppa/set_scno.c: Likewise. * linux/i386/set_error.c: Likewise. * linux/i386/set_scno.c: Likewise. * linux/ia64/set_error.c: Likewise. * linux/ia64/set_scno.c: Likewise. * linux/m68k/set_error.c: Likewise. * linux/m68k/set_scno.c: Likewise. * linux/metag/set_error.c: Likewise. * linux/metag/set_scno.c: Likewise. * linux/microblaze/set_error.c: Likewise. * linux/microblaze/set_scno.c: Likewise. * linux/mips/set_error.c: Likewise. * linux/mips/set_scno.c: Likewise. * linux/nios2/set_error.c: Likewise. * linux/nios2/set_scno.c: Likewise. * linux/or1k/set_error.c: Likewise. * linux/or1k/set_scno.c: Likewise. * linux/powerpc/set_error.c: Likewise. * linux/powerpc/set_scno.c: Likewise. * linux/powerpc64/set_error.c: Likewise. * linux/powerpc64/set_scno.c: Likewise. * linux/riscv/set_error.c: Likewise. * linux/riscv/set_scno.c: Likewise. * linux/s390/set_error.c: Likewise. * linux/s390/set_scno.c: Likewise. * linux/s390x/set_error.c: Likewise. * linux/s390x/set_scno.c: Likewise. * linux/sh/set_error.c: Likewise. * linux/sh/set_scno.c: Likewise. * linux/sh64/set_error.c: Likewise. * linux/sh64/set_scno.c: Likewise. * linux/sparc/set_error.c: Likewise. * linux/sparc/set_scno.c: Likewise. * linux/sparc64/set_error.c: Likewise. * linux/sparc64/set_scno.c: Likewise. * linux/tile/set_error.c: Likewise. * linux/tile/set_scno.c: Likewise. * linux/x32/set_error.c: Likewise. * linux/x32/set_scno.c: Likewise. * linux/x86_64/set_error.c: Likewise. * linux/x86_64/set_scno.c: Likewise. * linux/xtensa/set_error.c: Likewise. * linux/xtensa/set_scno.c: Likewise. * Makefile.am (EXTRA_DIST): Add them.
2016-11-15 20:38:21 +03:00
linux/metag/set_error.c \
linux/metag/set_scno.c \
linux/metag/syscallent.h \
linux/microblaze/arch_regs.c \
linux/microblaze/arch_sigreturn.c \
linux/microblaze/get_error.c \
linux/microblaze/get_scno.c \
linux/microblaze/get_syscall_args.c \
linux/microblaze/get_syscall_result.c \
ioctl: take all 32 bits of ioctl commands into account Historically, only 16 bits (8-bit number and 8-bit type) of 32-bit ioctl commands were used for decoding, which was the source for numerous annoying collisions like this: ioctl(0, SNDCTL_TMR_TIMEBASE or SNDRV_TIMER_IOCTL_NEXT_DEVICE or TCGETS, {B38400 opost isig icanon echo ...}) = 0 ioctl(0, MGSL_IOCGPARAMS or MMTIMER_GETRES or MTIOCTOP or SNDCTL_MIDI_MPUMODE, 0x7fffd47f7338) = -1 ENOTTY (Inappropriate ioctl for device) The solution is to use all 32 bits for decoding, not just "number" and "type", but also "size" and "direction". As some architectures override defaults that come from asm-generic/ and provide alternative definitions for some ioctl commands, we support per-architecture ioctl definitions and merge them with common definitions at build time. During the merge, we used to keep both generic and architecture-specific definitions, now architecture-specific definitions have precedence over generic ones -- ioctlsort omits definitions from asm-generic/ for those ioctl names that have different definitions in asm/. Additional bits of "direction" are architecture specific -- the number of bits and their values differ between architectures. To reduce architecture differences in the source code, we keep "direction" in symbolic form and compile it in ioctlsort. Additional bits of "size" are also architecture specific -- not only the number of bits differ between architectures, but sizes of many types depend on sizeof(long). To reduce architecture differences in the source code, we keep 32-bit and 64-bit versions of common ioctl definitions, and use the appropriate version for each architecture and personality. To implement this, the tools for generating ioctl definitions from kernel headers have been rewritten, and the source format of ioctl definitions has been extended. The final ioctlent*.h files that are included by syscall.c are now generated from source ioctls_inc*.h and ioctls_arch*.h files at build time with ioctlsort. * ioctl.c (ioctl_lookup): Use all 32 bits of ioctl command code. * ioctlsort.c: Rewritten. * linux/32/ioctls_inc.h: New file. * linux/64/ioctls_inc.h: New file. * linux/aarch64/ioctls_arch0.h: New file. * linux/aarch64/ioctls_arch1.h: New file. * linux/aarch64/ioctls_inc0.h: New file. * linux/aarch64/ioctls_inc1.h: New file. * linux/alpha/ioctls_arch0.h: New file. * linux/alpha/ioctls_inc0.h: New file. * linux/arc/ioctls_arch0.h: New file. * linux/arc/ioctls_inc0.h: New file. * linux/arm/ioctls_arch0.h: New file. * linux/arm/ioctls_inc0.h: New file. * linux/avr32/ioctls_arch0.h: New file. * linux/avr32/ioctls_inc0.h: New file. * linux/bfin/ioctls_arch0.h: New file. * linux/bfin/ioctls_inc0.h: New file. * linux/hppa/ioctls_arch0.h: New file. * linux/hppa/ioctls_inc0.h: New file. * linux/i386/ioctls_arch0.h: New file. * linux/i386/ioctls_inc0.h: New file. * linux/ia64/ioctls_arch0.h: New file. * linux/ia64/ioctls_inc0.h: New file. * linux/m68k/ioctls_arch0.h: New file. * linux/m68k/ioctls_inc0.h: New file. * linux/metag/ioctls_arch0.h: New file. * linux/metag/ioctls_inc0.h: New file. * linux/microblaze/ioctls_arch0.h: New file. * linux/microblaze/ioctls_inc0.h: New file. * linux/mips/ioctls_arch0.h: New file. * linux/mips/ioctls_inc0.h: New file. * linux/or1k/ioctls_arch0.h: New file. * linux/or1k/ioctls_inc0.h: New file. * linux/powerpc/ioctls_arch0.h: New file. * linux/powerpc/ioctls_inc0.h: New file. * linux/powerpc64/ioctls_arch0.h: New file. * linux/powerpc64/ioctls_arch1.h: New file. * linux/powerpc64/ioctls_inc0.h: New file. * linux/powerpc64/ioctls_inc1.h: New file. * linux/s390/ioctls_arch0.h: New file. * linux/s390/ioctls_inc0.h: New file. * linux/s390x/ioctls_arch0.h: New file. * linux/s390x/ioctls_inc0.h: New file. * linux/sh/ioctls_arch0.h: New file. * linux/sh/ioctls_inc0.h: New file. * linux/sh64/ioctls_arch0.h: New file. * linux/sh64/ioctls_inc0.h: New file. * linux/sparc/ioctls_arch0.h: New file. * linux/sparc/ioctls_inc0.h: New file. * linux/sparc64/ioctls_arch0.h: New file. * linux/sparc64/ioctls_arch2.h: New file. * linux/sparc64/ioctls_inc0.h: New file. * linux/sparc64/ioctls_inc2.h: New file. * linux/tile/ioctls_arch0.h: New file. * linux/tile/ioctls_arch1.h: New file. * linux/tile/ioctls_inc0.h: New file. * linux/tile/ioctls_inc1.h: New file. * linux/x32/ioctls_arch0.h: New file. * linux/x32/ioctls_arch1.h: New file. * linux/x32/ioctls_inc0.h: New file. * linux/x32/ioctls_inc1.h: New file. * linux/x86_64/ioctls_arch0.h: New file. * linux/x86_64/ioctls_arch1.h: New file. * linux/x86_64/ioctls_inc0.h: New file. * linux/x86_64/ioctls_inc1.h: New file. * linux/xtensa/ioctls_arch0.h: New file. * linux/xtensa/ioctls_inc0.h: New file. * linux/aarch64/ioctlent.h.in: Remove. * linux/aarch64/ioctlent1.h: Remove. * linux/alpha/ioctlent.h.in: Remove. * linux/arc/ioctlent.h.in: Remove. * linux/arm/ioctlent.h.in: Remove. * linux/avr32/ioctlent.h.in: Remove. * linux/bfin/ioctlent.h.in: Remove. * linux/hppa/ioctlent.h.in: Remove. * linux/i386/ioctlent.h.in: Remove. * linux/ia64/ioctlent.h.in: Remove. * linux/ioctlent.h.in: Remove. * linux/ioctlent.sh: Remove. * linux/m68k/ioctlent.h.in: Remove. * linux/metag/ioctlent.h.in: Remove. * linux/microblaze/ioctlent.h.in: Remove. * linux/mips/ioctlent.h.in: Remove. * linux/mips/ioctlent.sh: Remove. * linux/or1k/ioctlent.h.in: Remove. * linux/powerpc/ioctlent.h.in: Remove. * linux/powerpc64/ioctlent.h: Remove. * linux/powerpc64/ioctlent1.h: Remove. * linux/s390/ioctlent.h.in: Remove. * linux/s390x/ioctlent.h.in: Remove. * linux/sh/ioctlent.h.in: Remove. * linux/sh64/ioctlent.h.in: Remove. * linux/sparc/ioctlent.h.in: Remove. * linux/sparc64/ioctlent.h.in: Remove. * linux/sparc64/ioctlent2.h: Remove. * linux/tile/ioctlent.h.in: Remove. * linux/tile/ioctlent1.h: Remove. * linux/x32/ioctlent.h.in: Remove. * linux/x32/ioctlent1.h: Remove. * linux/x86_64/ioctlent.h.in: Remove. * linux/x86_64/ioctlent1.h: Remove. * linux/xtensa/ioctlent.h.in: Remove. * linux/x86_64/ioctlent2.h: Include ioctlent0.h instead of ioctlent.h. * syscall.c (struct_ioctlent ioctlent0): Likewise. * Makefile.am: Remove all ioctlent-related definitions. Define the list of ioctlent*.h files that have to be generated by presence of $(srcdir)/$(OS)/$(ARCH)/ioctls_inc*.h files. Add rules for ioctlent*.h files generation. (EXTRA_DIST): Update. * maint/ioctls_gen.sh: New file. * maint/ioctls_hex.sh: New file. * maint/ioctls_sym.sh: New file. * maint/print_ioctlent.c: New file. * HACKING-scripts: Update for ioctlent.sh -> ioctls_gen.sh migration. * .gitignore: Add ioctlent[012].h and ioctls_all[012].h. * configure.ac (AC_CHECK_HEADERS): Add linux/hiddev.h and linux/mmtimer.h for tests. * tests/ioctl.c: New file. * tests/ioctl.test: New test. * tests/Makefile.am (check_PROGRAMS): Add ioctl. (TESTS): Add ioctl.test. * tests/.gitignore: Add ioctl.
2015-01-19 20:02:16 +03:00
linux/microblaze/ioctls_arch0.h \
linux/microblaze/ioctls_inc0.h \
Implement arch specific methods of changing syscall number and error code This introduces arch_set_error and arch_set_scno functions for each supported architecture, needed to implement syscall fault injection. * linux/aarch64/set_error.c: New file. * linux/aarch64/set_scno.c: Likewise. * linux/alpha/set_error.c: Likewise. * linux/alpha/set_scno.c: Likewise. * linux/arc/set_error.c: Likewise. * linux/arc/set_scno.c: Likewise. * linux/arm/set_error.c: Likewise. * linux/arm/set_scno.c: Likewise. * linux/avr32/set_error.c: Likewise. * linux/avr32/set_scno.c: Likewise. * linux/bfin/set_error.c: Likewise. * linux/bfin/set_scno.c: Likewise. * linux/crisv10/set_error.c: Likewise. * linux/crisv10/set_scno.c: Likewise. * linux/crisv32/set_error.c: Likewise. * linux/crisv32/set_scno.c: Likewise. * linux/hppa/set_error.c: Likewise. * linux/hppa/set_scno.c: Likewise. * linux/i386/set_error.c: Likewise. * linux/i386/set_scno.c: Likewise. * linux/ia64/set_error.c: Likewise. * linux/ia64/set_scno.c: Likewise. * linux/m68k/set_error.c: Likewise. * linux/m68k/set_scno.c: Likewise. * linux/metag/set_error.c: Likewise. * linux/metag/set_scno.c: Likewise. * linux/microblaze/set_error.c: Likewise. * linux/microblaze/set_scno.c: Likewise. * linux/mips/set_error.c: Likewise. * linux/mips/set_scno.c: Likewise. * linux/nios2/set_error.c: Likewise. * linux/nios2/set_scno.c: Likewise. * linux/or1k/set_error.c: Likewise. * linux/or1k/set_scno.c: Likewise. * linux/powerpc/set_error.c: Likewise. * linux/powerpc/set_scno.c: Likewise. * linux/powerpc64/set_error.c: Likewise. * linux/powerpc64/set_scno.c: Likewise. * linux/riscv/set_error.c: Likewise. * linux/riscv/set_scno.c: Likewise. * linux/s390/set_error.c: Likewise. * linux/s390/set_scno.c: Likewise. * linux/s390x/set_error.c: Likewise. * linux/s390x/set_scno.c: Likewise. * linux/sh/set_error.c: Likewise. * linux/sh/set_scno.c: Likewise. * linux/sh64/set_error.c: Likewise. * linux/sh64/set_scno.c: Likewise. * linux/sparc/set_error.c: Likewise. * linux/sparc/set_scno.c: Likewise. * linux/sparc64/set_error.c: Likewise. * linux/sparc64/set_scno.c: Likewise. * linux/tile/set_error.c: Likewise. * linux/tile/set_scno.c: Likewise. * linux/x32/set_error.c: Likewise. * linux/x32/set_scno.c: Likewise. * linux/x86_64/set_error.c: Likewise. * linux/x86_64/set_scno.c: Likewise. * linux/xtensa/set_error.c: Likewise. * linux/xtensa/set_scno.c: Likewise. * Makefile.am (EXTRA_DIST): Add them.
2016-11-15 20:38:21 +03:00
linux/microblaze/set_error.c \
linux/microblaze/set_scno.c \
linux/microblaze/syscallent.h \
linux/microblaze/userent.h \
linux/mips/arch_getrval2.c \
linux/mips/arch_regs.c \
linux/mips/arch_regs.h \
linux/mips/arch_sigreturn.c \
linux/mips/errnoent.h \
linux/mips/genstub.sh \
linux/mips/get_error.c \
linux/mips/get_scno.c \
linux/mips/get_syscall_args.c \
ioctl: take all 32 bits of ioctl commands into account Historically, only 16 bits (8-bit number and 8-bit type) of 32-bit ioctl commands were used for decoding, which was the source for numerous annoying collisions like this: ioctl(0, SNDCTL_TMR_TIMEBASE or SNDRV_TIMER_IOCTL_NEXT_DEVICE or TCGETS, {B38400 opost isig icanon echo ...}) = 0 ioctl(0, MGSL_IOCGPARAMS or MMTIMER_GETRES or MTIOCTOP or SNDCTL_MIDI_MPUMODE, 0x7fffd47f7338) = -1 ENOTTY (Inappropriate ioctl for device) The solution is to use all 32 bits for decoding, not just "number" and "type", but also "size" and "direction". As some architectures override defaults that come from asm-generic/ and provide alternative definitions for some ioctl commands, we support per-architecture ioctl definitions and merge them with common definitions at build time. During the merge, we used to keep both generic and architecture-specific definitions, now architecture-specific definitions have precedence over generic ones -- ioctlsort omits definitions from asm-generic/ for those ioctl names that have different definitions in asm/. Additional bits of "direction" are architecture specific -- the number of bits and their values differ between architectures. To reduce architecture differences in the source code, we keep "direction" in symbolic form and compile it in ioctlsort. Additional bits of "size" are also architecture specific -- not only the number of bits differ between architectures, but sizes of many types depend on sizeof(long). To reduce architecture differences in the source code, we keep 32-bit and 64-bit versions of common ioctl definitions, and use the appropriate version for each architecture and personality. To implement this, the tools for generating ioctl definitions from kernel headers have been rewritten, and the source format of ioctl definitions has been extended. The final ioctlent*.h files that are included by syscall.c are now generated from source ioctls_inc*.h and ioctls_arch*.h files at build time with ioctlsort. * ioctl.c (ioctl_lookup): Use all 32 bits of ioctl command code. * ioctlsort.c: Rewritten. * linux/32/ioctls_inc.h: New file. * linux/64/ioctls_inc.h: New file. * linux/aarch64/ioctls_arch0.h: New file. * linux/aarch64/ioctls_arch1.h: New file. * linux/aarch64/ioctls_inc0.h: New file. * linux/aarch64/ioctls_inc1.h: New file. * linux/alpha/ioctls_arch0.h: New file. * linux/alpha/ioctls_inc0.h: New file. * linux/arc/ioctls_arch0.h: New file. * linux/arc/ioctls_inc0.h: New file. * linux/arm/ioctls_arch0.h: New file. * linux/arm/ioctls_inc0.h: New file. * linux/avr32/ioctls_arch0.h: New file. * linux/avr32/ioctls_inc0.h: New file. * linux/bfin/ioctls_arch0.h: New file. * linux/bfin/ioctls_inc0.h: New file. * linux/hppa/ioctls_arch0.h: New file. * linux/hppa/ioctls_inc0.h: New file. * linux/i386/ioctls_arch0.h: New file. * linux/i386/ioctls_inc0.h: New file. * linux/ia64/ioctls_arch0.h: New file. * linux/ia64/ioctls_inc0.h: New file. * linux/m68k/ioctls_arch0.h: New file. * linux/m68k/ioctls_inc0.h: New file. * linux/metag/ioctls_arch0.h: New file. * linux/metag/ioctls_inc0.h: New file. * linux/microblaze/ioctls_arch0.h: New file. * linux/microblaze/ioctls_inc0.h: New file. * linux/mips/ioctls_arch0.h: New file. * linux/mips/ioctls_inc0.h: New file. * linux/or1k/ioctls_arch0.h: New file. * linux/or1k/ioctls_inc0.h: New file. * linux/powerpc/ioctls_arch0.h: New file. * linux/powerpc/ioctls_inc0.h: New file. * linux/powerpc64/ioctls_arch0.h: New file. * linux/powerpc64/ioctls_arch1.h: New file. * linux/powerpc64/ioctls_inc0.h: New file. * linux/powerpc64/ioctls_inc1.h: New file. * linux/s390/ioctls_arch0.h: New file. * linux/s390/ioctls_inc0.h: New file. * linux/s390x/ioctls_arch0.h: New file. * linux/s390x/ioctls_inc0.h: New file. * linux/sh/ioctls_arch0.h: New file. * linux/sh/ioctls_inc0.h: New file. * linux/sh64/ioctls_arch0.h: New file. * linux/sh64/ioctls_inc0.h: New file. * linux/sparc/ioctls_arch0.h: New file. * linux/sparc/ioctls_inc0.h: New file. * linux/sparc64/ioctls_arch0.h: New file. * linux/sparc64/ioctls_arch2.h: New file. * linux/sparc64/ioctls_inc0.h: New file. * linux/sparc64/ioctls_inc2.h: New file. * linux/tile/ioctls_arch0.h: New file. * linux/tile/ioctls_arch1.h: New file. * linux/tile/ioctls_inc0.h: New file. * linux/tile/ioctls_inc1.h: New file. * linux/x32/ioctls_arch0.h: New file. * linux/x32/ioctls_arch1.h: New file. * linux/x32/ioctls_inc0.h: New file. * linux/x32/ioctls_inc1.h: New file. * linux/x86_64/ioctls_arch0.h: New file. * linux/x86_64/ioctls_arch1.h: New file. * linux/x86_64/ioctls_inc0.h: New file. * linux/x86_64/ioctls_inc1.h: New file. * linux/xtensa/ioctls_arch0.h: New file. * linux/xtensa/ioctls_inc0.h: New file. * linux/aarch64/ioctlent.h.in: Remove. * linux/aarch64/ioctlent1.h: Remove. * linux/alpha/ioctlent.h.in: Remove. * linux/arc/ioctlent.h.in: Remove. * linux/arm/ioctlent.h.in: Remove. * linux/avr32/ioctlent.h.in: Remove. * linux/bfin/ioctlent.h.in: Remove. * linux/hppa/ioctlent.h.in: Remove. * linux/i386/ioctlent.h.in: Remove. * linux/ia64/ioctlent.h.in: Remove. * linux/ioctlent.h.in: Remove. * linux/ioctlent.sh: Remove. * linux/m68k/ioctlent.h.in: Remove. * linux/metag/ioctlent.h.in: Remove. * linux/microblaze/ioctlent.h.in: Remove. * linux/mips/ioctlent.h.in: Remove. * linux/mips/ioctlent.sh: Remove. * linux/or1k/ioctlent.h.in: Remove. * linux/powerpc/ioctlent.h.in: Remove. * linux/powerpc64/ioctlent.h: Remove. * linux/powerpc64/ioctlent1.h: Remove. * linux/s390/ioctlent.h.in: Remove. * linux/s390x/ioctlent.h.in: Remove. * linux/sh/ioctlent.h.in: Remove. * linux/sh64/ioctlent.h.in: Remove. * linux/sparc/ioctlent.h.in: Remove. * linux/sparc64/ioctlent.h.in: Remove. * linux/sparc64/ioctlent2.h: Remove. * linux/tile/ioctlent.h.in: Remove. * linux/tile/ioctlent1.h: Remove. * linux/x32/ioctlent.h.in: Remove. * linux/x32/ioctlent1.h: Remove. * linux/x86_64/ioctlent.h.in: Remove. * linux/x86_64/ioctlent1.h: Remove. * linux/xtensa/ioctlent.h.in: Remove. * linux/x86_64/ioctlent2.h: Include ioctlent0.h instead of ioctlent.h. * syscall.c (struct_ioctlent ioctlent0): Likewise. * Makefile.am: Remove all ioctlent-related definitions. Define the list of ioctlent*.h files that have to be generated by presence of $(srcdir)/$(OS)/$(ARCH)/ioctls_inc*.h files. Add rules for ioctlent*.h files generation. (EXTRA_DIST): Update. * maint/ioctls_gen.sh: New file. * maint/ioctls_hex.sh: New file. * maint/ioctls_sym.sh: New file. * maint/print_ioctlent.c: New file. * HACKING-scripts: Update for ioctlent.sh -> ioctls_gen.sh migration. * .gitignore: Add ioctlent[012].h and ioctls_all[012].h. * configure.ac (AC_CHECK_HEADERS): Add linux/hiddev.h and linux/mmtimer.h for tests. * tests/ioctl.c: New file. * tests/ioctl.test: New test. * tests/Makefile.am (check_PROGRAMS): Add ioctl. (TESTS): Add ioctl.test. * tests/.gitignore: Add ioctl.
2015-01-19 20:02:16 +03:00
linux/mips/ioctls_arch0.h \
linux/mips/ioctls_inc0.h \
Implement arch specific methods of changing syscall number and error code This introduces arch_set_error and arch_set_scno functions for each supported architecture, needed to implement syscall fault injection. * linux/aarch64/set_error.c: New file. * linux/aarch64/set_scno.c: Likewise. * linux/alpha/set_error.c: Likewise. * linux/alpha/set_scno.c: Likewise. * linux/arc/set_error.c: Likewise. * linux/arc/set_scno.c: Likewise. * linux/arm/set_error.c: Likewise. * linux/arm/set_scno.c: Likewise. * linux/avr32/set_error.c: Likewise. * linux/avr32/set_scno.c: Likewise. * linux/bfin/set_error.c: Likewise. * linux/bfin/set_scno.c: Likewise. * linux/crisv10/set_error.c: Likewise. * linux/crisv10/set_scno.c: Likewise. * linux/crisv32/set_error.c: Likewise. * linux/crisv32/set_scno.c: Likewise. * linux/hppa/set_error.c: Likewise. * linux/hppa/set_scno.c: Likewise. * linux/i386/set_error.c: Likewise. * linux/i386/set_scno.c: Likewise. * linux/ia64/set_error.c: Likewise. * linux/ia64/set_scno.c: Likewise. * linux/m68k/set_error.c: Likewise. * linux/m68k/set_scno.c: Likewise. * linux/metag/set_error.c: Likewise. * linux/metag/set_scno.c: Likewise. * linux/microblaze/set_error.c: Likewise. * linux/microblaze/set_scno.c: Likewise. * linux/mips/set_error.c: Likewise. * linux/mips/set_scno.c: Likewise. * linux/nios2/set_error.c: Likewise. * linux/nios2/set_scno.c: Likewise. * linux/or1k/set_error.c: Likewise. * linux/or1k/set_scno.c: Likewise. * linux/powerpc/set_error.c: Likewise. * linux/powerpc/set_scno.c: Likewise. * linux/powerpc64/set_error.c: Likewise. * linux/powerpc64/set_scno.c: Likewise. * linux/riscv/set_error.c: Likewise. * linux/riscv/set_scno.c: Likewise. * linux/s390/set_error.c: Likewise. * linux/s390/set_scno.c: Likewise. * linux/s390x/set_error.c: Likewise. * linux/s390x/set_scno.c: Likewise. * linux/sh/set_error.c: Likewise. * linux/sh/set_scno.c: Likewise. * linux/sh64/set_error.c: Likewise. * linux/sh64/set_scno.c: Likewise. * linux/sparc/set_error.c: Likewise. * linux/sparc/set_scno.c: Likewise. * linux/sparc64/set_error.c: Likewise. * linux/sparc64/set_scno.c: Likewise. * linux/tile/set_error.c: Likewise. * linux/tile/set_scno.c: Likewise. * linux/x32/set_error.c: Likewise. * linux/x32/set_scno.c: Likewise. * linux/x86_64/set_error.c: Likewise. * linux/x86_64/set_scno.c: Likewise. * linux/xtensa/set_error.c: Likewise. * linux/xtensa/set_scno.c: Likewise. * Makefile.am (EXTRA_DIST): Add them.
2016-11-15 20:38:21 +03:00
linux/mips/set_error.c \
linux/mips/set_scno.c \
linux/mips/signalent.h \
linux/mips/syscallent-compat.h \
linux/mips/syscallent-n32.h \
linux/mips/syscallent-n64.h \
linux/mips/syscallent-o32.h \
linux/mips/syscallent.h \
linux/mips/userent.h \
linux/mtd-abi.h \
linux/netlink_diag.h \
linux/nios2/arch_regs.c \
linux/nios2/get_error.c \
linux/nios2/get_scno.c \
linux/nios2/get_syscall_args.c \
linux/nios2/ioctls_arch0.h \
linux/nios2/ioctls_inc0.h \
Implement arch specific methods of changing syscall number and error code This introduces arch_set_error and arch_set_scno functions for each supported architecture, needed to implement syscall fault injection. * linux/aarch64/set_error.c: New file. * linux/aarch64/set_scno.c: Likewise. * linux/alpha/set_error.c: Likewise. * linux/alpha/set_scno.c: Likewise. * linux/arc/set_error.c: Likewise. * linux/arc/set_scno.c: Likewise. * linux/arm/set_error.c: Likewise. * linux/arm/set_scno.c: Likewise. * linux/avr32/set_error.c: Likewise. * linux/avr32/set_scno.c: Likewise. * linux/bfin/set_error.c: Likewise. * linux/bfin/set_scno.c: Likewise. * linux/crisv10/set_error.c: Likewise. * linux/crisv10/set_scno.c: Likewise. * linux/crisv32/set_error.c: Likewise. * linux/crisv32/set_scno.c: Likewise. * linux/hppa/set_error.c: Likewise. * linux/hppa/set_scno.c: Likewise. * linux/i386/set_error.c: Likewise. * linux/i386/set_scno.c: Likewise. * linux/ia64/set_error.c: Likewise. * linux/ia64/set_scno.c: Likewise. * linux/m68k/set_error.c: Likewise. * linux/m68k/set_scno.c: Likewise. * linux/metag/set_error.c: Likewise. * linux/metag/set_scno.c: Likewise. * linux/microblaze/set_error.c: Likewise. * linux/microblaze/set_scno.c: Likewise. * linux/mips/set_error.c: Likewise. * linux/mips/set_scno.c: Likewise. * linux/nios2/set_error.c: Likewise. * linux/nios2/set_scno.c: Likewise. * linux/or1k/set_error.c: Likewise. * linux/or1k/set_scno.c: Likewise. * linux/powerpc/set_error.c: Likewise. * linux/powerpc/set_scno.c: Likewise. * linux/powerpc64/set_error.c: Likewise. * linux/powerpc64/set_scno.c: Likewise. * linux/riscv/set_error.c: Likewise. * linux/riscv/set_scno.c: Likewise. * linux/s390/set_error.c: Likewise. * linux/s390/set_scno.c: Likewise. * linux/s390x/set_error.c: Likewise. * linux/s390x/set_scno.c: Likewise. * linux/sh/set_error.c: Likewise. * linux/sh/set_scno.c: Likewise. * linux/sh64/set_error.c: Likewise. * linux/sh64/set_scno.c: Likewise. * linux/sparc/set_error.c: Likewise. * linux/sparc/set_scno.c: Likewise. * linux/sparc64/set_error.c: Likewise. * linux/sparc64/set_scno.c: Likewise. * linux/tile/set_error.c: Likewise. * linux/tile/set_scno.c: Likewise. * linux/x32/set_error.c: Likewise. * linux/x32/set_scno.c: Likewise. * linux/x86_64/set_error.c: Likewise. * linux/x86_64/set_scno.c: Likewise. * linux/xtensa/set_error.c: Likewise. * linux/xtensa/set_scno.c: Likewise. * Makefile.am (EXTRA_DIST): Add them.
2016-11-15 20:38:21 +03:00
linux/nios2/set_error.c \
linux/nios2/set_scno.c \
linux/nios2/syscallent.h \
linux/or1k/arch_regs.c \
linux/or1k/get_error.c \
linux/or1k/get_scno.c \
linux/or1k/get_syscall_args.c \
ioctl: take all 32 bits of ioctl commands into account Historically, only 16 bits (8-bit number and 8-bit type) of 32-bit ioctl commands were used for decoding, which was the source for numerous annoying collisions like this: ioctl(0, SNDCTL_TMR_TIMEBASE or SNDRV_TIMER_IOCTL_NEXT_DEVICE or TCGETS, {B38400 opost isig icanon echo ...}) = 0 ioctl(0, MGSL_IOCGPARAMS or MMTIMER_GETRES or MTIOCTOP or SNDCTL_MIDI_MPUMODE, 0x7fffd47f7338) = -1 ENOTTY (Inappropriate ioctl for device) The solution is to use all 32 bits for decoding, not just "number" and "type", but also "size" and "direction". As some architectures override defaults that come from asm-generic/ and provide alternative definitions for some ioctl commands, we support per-architecture ioctl definitions and merge them with common definitions at build time. During the merge, we used to keep both generic and architecture-specific definitions, now architecture-specific definitions have precedence over generic ones -- ioctlsort omits definitions from asm-generic/ for those ioctl names that have different definitions in asm/. Additional bits of "direction" are architecture specific -- the number of bits and their values differ between architectures. To reduce architecture differences in the source code, we keep "direction" in symbolic form and compile it in ioctlsort. Additional bits of "size" are also architecture specific -- not only the number of bits differ between architectures, but sizes of many types depend on sizeof(long). To reduce architecture differences in the source code, we keep 32-bit and 64-bit versions of common ioctl definitions, and use the appropriate version for each architecture and personality. To implement this, the tools for generating ioctl definitions from kernel headers have been rewritten, and the source format of ioctl definitions has been extended. The final ioctlent*.h files that are included by syscall.c are now generated from source ioctls_inc*.h and ioctls_arch*.h files at build time with ioctlsort. * ioctl.c (ioctl_lookup): Use all 32 bits of ioctl command code. * ioctlsort.c: Rewritten. * linux/32/ioctls_inc.h: New file. * linux/64/ioctls_inc.h: New file. * linux/aarch64/ioctls_arch0.h: New file. * linux/aarch64/ioctls_arch1.h: New file. * linux/aarch64/ioctls_inc0.h: New file. * linux/aarch64/ioctls_inc1.h: New file. * linux/alpha/ioctls_arch0.h: New file. * linux/alpha/ioctls_inc0.h: New file. * linux/arc/ioctls_arch0.h: New file. * linux/arc/ioctls_inc0.h: New file. * linux/arm/ioctls_arch0.h: New file. * linux/arm/ioctls_inc0.h: New file. * linux/avr32/ioctls_arch0.h: New file. * linux/avr32/ioctls_inc0.h: New file. * linux/bfin/ioctls_arch0.h: New file. * linux/bfin/ioctls_inc0.h: New file. * linux/hppa/ioctls_arch0.h: New file. * linux/hppa/ioctls_inc0.h: New file. * linux/i386/ioctls_arch0.h: New file. * linux/i386/ioctls_inc0.h: New file. * linux/ia64/ioctls_arch0.h: New file. * linux/ia64/ioctls_inc0.h: New file. * linux/m68k/ioctls_arch0.h: New file. * linux/m68k/ioctls_inc0.h: New file. * linux/metag/ioctls_arch0.h: New file. * linux/metag/ioctls_inc0.h: New file. * linux/microblaze/ioctls_arch0.h: New file. * linux/microblaze/ioctls_inc0.h: New file. * linux/mips/ioctls_arch0.h: New file. * linux/mips/ioctls_inc0.h: New file. * linux/or1k/ioctls_arch0.h: New file. * linux/or1k/ioctls_inc0.h: New file. * linux/powerpc/ioctls_arch0.h: New file. * linux/powerpc/ioctls_inc0.h: New file. * linux/powerpc64/ioctls_arch0.h: New file. * linux/powerpc64/ioctls_arch1.h: New file. * linux/powerpc64/ioctls_inc0.h: New file. * linux/powerpc64/ioctls_inc1.h: New file. * linux/s390/ioctls_arch0.h: New file. * linux/s390/ioctls_inc0.h: New file. * linux/s390x/ioctls_arch0.h: New file. * linux/s390x/ioctls_inc0.h: New file. * linux/sh/ioctls_arch0.h: New file. * linux/sh/ioctls_inc0.h: New file. * linux/sh64/ioctls_arch0.h: New file. * linux/sh64/ioctls_inc0.h: New file. * linux/sparc/ioctls_arch0.h: New file. * linux/sparc/ioctls_inc0.h: New file. * linux/sparc64/ioctls_arch0.h: New file. * linux/sparc64/ioctls_arch2.h: New file. * linux/sparc64/ioctls_inc0.h: New file. * linux/sparc64/ioctls_inc2.h: New file. * linux/tile/ioctls_arch0.h: New file. * linux/tile/ioctls_arch1.h: New file. * linux/tile/ioctls_inc0.h: New file. * linux/tile/ioctls_inc1.h: New file. * linux/x32/ioctls_arch0.h: New file. * linux/x32/ioctls_arch1.h: New file. * linux/x32/ioctls_inc0.h: New file. * linux/x32/ioctls_inc1.h: New file. * linux/x86_64/ioctls_arch0.h: New file. * linux/x86_64/ioctls_arch1.h: New file. * linux/x86_64/ioctls_inc0.h: New file. * linux/x86_64/ioctls_inc1.h: New file. * linux/xtensa/ioctls_arch0.h: New file. * linux/xtensa/ioctls_inc0.h: New file. * linux/aarch64/ioctlent.h.in: Remove. * linux/aarch64/ioctlent1.h: Remove. * linux/alpha/ioctlent.h.in: Remove. * linux/arc/ioctlent.h.in: Remove. * linux/arm/ioctlent.h.in: Remove. * linux/avr32/ioctlent.h.in: Remove. * linux/bfin/ioctlent.h.in: Remove. * linux/hppa/ioctlent.h.in: Remove. * linux/i386/ioctlent.h.in: Remove. * linux/ia64/ioctlent.h.in: Remove. * linux/ioctlent.h.in: Remove. * linux/ioctlent.sh: Remove. * linux/m68k/ioctlent.h.in: Remove. * linux/metag/ioctlent.h.in: Remove. * linux/microblaze/ioctlent.h.in: Remove. * linux/mips/ioctlent.h.in: Remove. * linux/mips/ioctlent.sh: Remove. * linux/or1k/ioctlent.h.in: Remove. * linux/powerpc/ioctlent.h.in: Remove. * linux/powerpc64/ioctlent.h: Remove. * linux/powerpc64/ioctlent1.h: Remove. * linux/s390/ioctlent.h.in: Remove. * linux/s390x/ioctlent.h.in: Remove. * linux/sh/ioctlent.h.in: Remove. * linux/sh64/ioctlent.h.in: Remove. * linux/sparc/ioctlent.h.in: Remove. * linux/sparc64/ioctlent.h.in: Remove. * linux/sparc64/ioctlent2.h: Remove. * linux/tile/ioctlent.h.in: Remove. * linux/tile/ioctlent1.h: Remove. * linux/x32/ioctlent.h.in: Remove. * linux/x32/ioctlent1.h: Remove. * linux/x86_64/ioctlent.h.in: Remove. * linux/x86_64/ioctlent1.h: Remove. * linux/xtensa/ioctlent.h.in: Remove. * linux/x86_64/ioctlent2.h: Include ioctlent0.h instead of ioctlent.h. * syscall.c (struct_ioctlent ioctlent0): Likewise. * Makefile.am: Remove all ioctlent-related definitions. Define the list of ioctlent*.h files that have to be generated by presence of $(srcdir)/$(OS)/$(ARCH)/ioctls_inc*.h files. Add rules for ioctlent*.h files generation. (EXTRA_DIST): Update. * maint/ioctls_gen.sh: New file. * maint/ioctls_hex.sh: New file. * maint/ioctls_sym.sh: New file. * maint/print_ioctlent.c: New file. * HACKING-scripts: Update for ioctlent.sh -> ioctls_gen.sh migration. * .gitignore: Add ioctlent[012].h and ioctls_all[012].h. * configure.ac (AC_CHECK_HEADERS): Add linux/hiddev.h and linux/mmtimer.h for tests. * tests/ioctl.c: New file. * tests/ioctl.test: New test. * tests/Makefile.am (check_PROGRAMS): Add ioctl. (TESTS): Add ioctl.test. * tests/.gitignore: Add ioctl.
2015-01-19 20:02:16 +03:00
linux/or1k/ioctls_arch0.h \
linux/or1k/ioctls_inc0.h \
Implement arch specific methods of changing syscall number and error code This introduces arch_set_error and arch_set_scno functions for each supported architecture, needed to implement syscall fault injection. * linux/aarch64/set_error.c: New file. * linux/aarch64/set_scno.c: Likewise. * linux/alpha/set_error.c: Likewise. * linux/alpha/set_scno.c: Likewise. * linux/arc/set_error.c: Likewise. * linux/arc/set_scno.c: Likewise. * linux/arm/set_error.c: Likewise. * linux/arm/set_scno.c: Likewise. * linux/avr32/set_error.c: Likewise. * linux/avr32/set_scno.c: Likewise. * linux/bfin/set_error.c: Likewise. * linux/bfin/set_scno.c: Likewise. * linux/crisv10/set_error.c: Likewise. * linux/crisv10/set_scno.c: Likewise. * linux/crisv32/set_error.c: Likewise. * linux/crisv32/set_scno.c: Likewise. * linux/hppa/set_error.c: Likewise. * linux/hppa/set_scno.c: Likewise. * linux/i386/set_error.c: Likewise. * linux/i386/set_scno.c: Likewise. * linux/ia64/set_error.c: Likewise. * linux/ia64/set_scno.c: Likewise. * linux/m68k/set_error.c: Likewise. * linux/m68k/set_scno.c: Likewise. * linux/metag/set_error.c: Likewise. * linux/metag/set_scno.c: Likewise. * linux/microblaze/set_error.c: Likewise. * linux/microblaze/set_scno.c: Likewise. * linux/mips/set_error.c: Likewise. * linux/mips/set_scno.c: Likewise. * linux/nios2/set_error.c: Likewise. * linux/nios2/set_scno.c: Likewise. * linux/or1k/set_error.c: Likewise. * linux/or1k/set_scno.c: Likewise. * linux/powerpc/set_error.c: Likewise. * linux/powerpc/set_scno.c: Likewise. * linux/powerpc64/set_error.c: Likewise. * linux/powerpc64/set_scno.c: Likewise. * linux/riscv/set_error.c: Likewise. * linux/riscv/set_scno.c: Likewise. * linux/s390/set_error.c: Likewise. * linux/s390/set_scno.c: Likewise. * linux/s390x/set_error.c: Likewise. * linux/s390x/set_scno.c: Likewise. * linux/sh/set_error.c: Likewise. * linux/sh/set_scno.c: Likewise. * linux/sh64/set_error.c: Likewise. * linux/sh64/set_scno.c: Likewise. * linux/sparc/set_error.c: Likewise. * linux/sparc/set_scno.c: Likewise. * linux/sparc64/set_error.c: Likewise. * linux/sparc64/set_scno.c: Likewise. * linux/tile/set_error.c: Likewise. * linux/tile/set_scno.c: Likewise. * linux/x32/set_error.c: Likewise. * linux/x32/set_scno.c: Likewise. * linux/x86_64/set_error.c: Likewise. * linux/x86_64/set_scno.c: Likewise. * linux/xtensa/set_error.c: Likewise. * linux/xtensa/set_scno.c: Likewise. * Makefile.am (EXTRA_DIST): Add them.
2016-11-15 20:38:21 +03:00
linux/or1k/set_error.c \
linux/or1k/set_scno.c \
linux/or1k/syscallent.h \
linux/or1k/userent.h \
linux/personality.h \
linux/powerpc/arch_regs.c \
linux/powerpc/arch_regs.h \
linux/powerpc/arch_sigreturn.c \
linux/powerpc/errnoent.h \
linux/powerpc/get_error.c \
linux/powerpc/get_scno.c \
linux/powerpc/get_syscall_args.c \
linux/powerpc/getregs_old.c \
linux/powerpc/getregs_old.h \
ioctl: take all 32 bits of ioctl commands into account Historically, only 16 bits (8-bit number and 8-bit type) of 32-bit ioctl commands were used for decoding, which was the source for numerous annoying collisions like this: ioctl(0, SNDCTL_TMR_TIMEBASE or SNDRV_TIMER_IOCTL_NEXT_DEVICE or TCGETS, {B38400 opost isig icanon echo ...}) = 0 ioctl(0, MGSL_IOCGPARAMS or MMTIMER_GETRES or MTIOCTOP or SNDCTL_MIDI_MPUMODE, 0x7fffd47f7338) = -1 ENOTTY (Inappropriate ioctl for device) The solution is to use all 32 bits for decoding, not just "number" and "type", but also "size" and "direction". As some architectures override defaults that come from asm-generic/ and provide alternative definitions for some ioctl commands, we support per-architecture ioctl definitions and merge them with common definitions at build time. During the merge, we used to keep both generic and architecture-specific definitions, now architecture-specific definitions have precedence over generic ones -- ioctlsort omits definitions from asm-generic/ for those ioctl names that have different definitions in asm/. Additional bits of "direction" are architecture specific -- the number of bits and their values differ between architectures. To reduce architecture differences in the source code, we keep "direction" in symbolic form and compile it in ioctlsort. Additional bits of "size" are also architecture specific -- not only the number of bits differ between architectures, but sizes of many types depend on sizeof(long). To reduce architecture differences in the source code, we keep 32-bit and 64-bit versions of common ioctl definitions, and use the appropriate version for each architecture and personality. To implement this, the tools for generating ioctl definitions from kernel headers have been rewritten, and the source format of ioctl definitions has been extended. The final ioctlent*.h files that are included by syscall.c are now generated from source ioctls_inc*.h and ioctls_arch*.h files at build time with ioctlsort. * ioctl.c (ioctl_lookup): Use all 32 bits of ioctl command code. * ioctlsort.c: Rewritten. * linux/32/ioctls_inc.h: New file. * linux/64/ioctls_inc.h: New file. * linux/aarch64/ioctls_arch0.h: New file. * linux/aarch64/ioctls_arch1.h: New file. * linux/aarch64/ioctls_inc0.h: New file. * linux/aarch64/ioctls_inc1.h: New file. * linux/alpha/ioctls_arch0.h: New file. * linux/alpha/ioctls_inc0.h: New file. * linux/arc/ioctls_arch0.h: New file. * linux/arc/ioctls_inc0.h: New file. * linux/arm/ioctls_arch0.h: New file. * linux/arm/ioctls_inc0.h: New file. * linux/avr32/ioctls_arch0.h: New file. * linux/avr32/ioctls_inc0.h: New file. * linux/bfin/ioctls_arch0.h: New file. * linux/bfin/ioctls_inc0.h: New file. * linux/hppa/ioctls_arch0.h: New file. * linux/hppa/ioctls_inc0.h: New file. * linux/i386/ioctls_arch0.h: New file. * linux/i386/ioctls_inc0.h: New file. * linux/ia64/ioctls_arch0.h: New file. * linux/ia64/ioctls_inc0.h: New file. * linux/m68k/ioctls_arch0.h: New file. * linux/m68k/ioctls_inc0.h: New file. * linux/metag/ioctls_arch0.h: New file. * linux/metag/ioctls_inc0.h: New file. * linux/microblaze/ioctls_arch0.h: New file. * linux/microblaze/ioctls_inc0.h: New file. * linux/mips/ioctls_arch0.h: New file. * linux/mips/ioctls_inc0.h: New file. * linux/or1k/ioctls_arch0.h: New file. * linux/or1k/ioctls_inc0.h: New file. * linux/powerpc/ioctls_arch0.h: New file. * linux/powerpc/ioctls_inc0.h: New file. * linux/powerpc64/ioctls_arch0.h: New file. * linux/powerpc64/ioctls_arch1.h: New file. * linux/powerpc64/ioctls_inc0.h: New file. * linux/powerpc64/ioctls_inc1.h: New file. * linux/s390/ioctls_arch0.h: New file. * linux/s390/ioctls_inc0.h: New file. * linux/s390x/ioctls_arch0.h: New file. * linux/s390x/ioctls_inc0.h: New file. * linux/sh/ioctls_arch0.h: New file. * linux/sh/ioctls_inc0.h: New file. * linux/sh64/ioctls_arch0.h: New file. * linux/sh64/ioctls_inc0.h: New file. * linux/sparc/ioctls_arch0.h: New file. * linux/sparc/ioctls_inc0.h: New file. * linux/sparc64/ioctls_arch0.h: New file. * linux/sparc64/ioctls_arch2.h: New file. * linux/sparc64/ioctls_inc0.h: New file. * linux/sparc64/ioctls_inc2.h: New file. * linux/tile/ioctls_arch0.h: New file. * linux/tile/ioctls_arch1.h: New file. * linux/tile/ioctls_inc0.h: New file. * linux/tile/ioctls_inc1.h: New file. * linux/x32/ioctls_arch0.h: New file. * linux/x32/ioctls_arch1.h: New file. * linux/x32/ioctls_inc0.h: New file. * linux/x32/ioctls_inc1.h: New file. * linux/x86_64/ioctls_arch0.h: New file. * linux/x86_64/ioctls_arch1.h: New file. * linux/x86_64/ioctls_inc0.h: New file. * linux/x86_64/ioctls_inc1.h: New file. * linux/xtensa/ioctls_arch0.h: New file. * linux/xtensa/ioctls_inc0.h: New file. * linux/aarch64/ioctlent.h.in: Remove. * linux/aarch64/ioctlent1.h: Remove. * linux/alpha/ioctlent.h.in: Remove. * linux/arc/ioctlent.h.in: Remove. * linux/arm/ioctlent.h.in: Remove. * linux/avr32/ioctlent.h.in: Remove. * linux/bfin/ioctlent.h.in: Remove. * linux/hppa/ioctlent.h.in: Remove. * linux/i386/ioctlent.h.in: Remove. * linux/ia64/ioctlent.h.in: Remove. * linux/ioctlent.h.in: Remove. * linux/ioctlent.sh: Remove. * linux/m68k/ioctlent.h.in: Remove. * linux/metag/ioctlent.h.in: Remove. * linux/microblaze/ioctlent.h.in: Remove. * linux/mips/ioctlent.h.in: Remove. * linux/mips/ioctlent.sh: Remove. * linux/or1k/ioctlent.h.in: Remove. * linux/powerpc/ioctlent.h.in: Remove. * linux/powerpc64/ioctlent.h: Remove. * linux/powerpc64/ioctlent1.h: Remove. * linux/s390/ioctlent.h.in: Remove. * linux/s390x/ioctlent.h.in: Remove. * linux/sh/ioctlent.h.in: Remove. * linux/sh64/ioctlent.h.in: Remove. * linux/sparc/ioctlent.h.in: Remove. * linux/sparc64/ioctlent.h.in: Remove. * linux/sparc64/ioctlent2.h: Remove. * linux/tile/ioctlent.h.in: Remove. * linux/tile/ioctlent1.h: Remove. * linux/x32/ioctlent.h.in: Remove. * linux/x32/ioctlent1.h: Remove. * linux/x86_64/ioctlent.h.in: Remove. * linux/x86_64/ioctlent1.h: Remove. * linux/xtensa/ioctlent.h.in: Remove. * linux/x86_64/ioctlent2.h: Include ioctlent0.h instead of ioctlent.h. * syscall.c (struct_ioctlent ioctlent0): Likewise. * Makefile.am: Remove all ioctlent-related definitions. Define the list of ioctlent*.h files that have to be generated by presence of $(srcdir)/$(OS)/$(ARCH)/ioctls_inc*.h files. Add rules for ioctlent*.h files generation. (EXTRA_DIST): Update. * maint/ioctls_gen.sh: New file. * maint/ioctls_hex.sh: New file. * maint/ioctls_sym.sh: New file. * maint/print_ioctlent.c: New file. * HACKING-scripts: Update for ioctlent.sh -> ioctls_gen.sh migration. * .gitignore: Add ioctlent[012].h and ioctls_all[012].h. * configure.ac (AC_CHECK_HEADERS): Add linux/hiddev.h and linux/mmtimer.h for tests. * tests/ioctl.c: New file. * tests/ioctl.test: New test. * tests/Makefile.am (check_PROGRAMS): Add ioctl. (TESTS): Add ioctl.test. * tests/.gitignore: Add ioctl.
2015-01-19 20:02:16 +03:00
linux/powerpc/ioctls_arch0.h \
linux/powerpc/ioctls_inc0.h \
Implement arch specific methods of changing syscall number and error code This introduces arch_set_error and arch_set_scno functions for each supported architecture, needed to implement syscall fault injection. * linux/aarch64/set_error.c: New file. * linux/aarch64/set_scno.c: Likewise. * linux/alpha/set_error.c: Likewise. * linux/alpha/set_scno.c: Likewise. * linux/arc/set_error.c: Likewise. * linux/arc/set_scno.c: Likewise. * linux/arm/set_error.c: Likewise. * linux/arm/set_scno.c: Likewise. * linux/avr32/set_error.c: Likewise. * linux/avr32/set_scno.c: Likewise. * linux/bfin/set_error.c: Likewise. * linux/bfin/set_scno.c: Likewise. * linux/crisv10/set_error.c: Likewise. * linux/crisv10/set_scno.c: Likewise. * linux/crisv32/set_error.c: Likewise. * linux/crisv32/set_scno.c: Likewise. * linux/hppa/set_error.c: Likewise. * linux/hppa/set_scno.c: Likewise. * linux/i386/set_error.c: Likewise. * linux/i386/set_scno.c: Likewise. * linux/ia64/set_error.c: Likewise. * linux/ia64/set_scno.c: Likewise. * linux/m68k/set_error.c: Likewise. * linux/m68k/set_scno.c: Likewise. * linux/metag/set_error.c: Likewise. * linux/metag/set_scno.c: Likewise. * linux/microblaze/set_error.c: Likewise. * linux/microblaze/set_scno.c: Likewise. * linux/mips/set_error.c: Likewise. * linux/mips/set_scno.c: Likewise. * linux/nios2/set_error.c: Likewise. * linux/nios2/set_scno.c: Likewise. * linux/or1k/set_error.c: Likewise. * linux/or1k/set_scno.c: Likewise. * linux/powerpc/set_error.c: Likewise. * linux/powerpc/set_scno.c: Likewise. * linux/powerpc64/set_error.c: Likewise. * linux/powerpc64/set_scno.c: Likewise. * linux/riscv/set_error.c: Likewise. * linux/riscv/set_scno.c: Likewise. * linux/s390/set_error.c: Likewise. * linux/s390/set_scno.c: Likewise. * linux/s390x/set_error.c: Likewise. * linux/s390x/set_scno.c: Likewise. * linux/sh/set_error.c: Likewise. * linux/sh/set_scno.c: Likewise. * linux/sh64/set_error.c: Likewise. * linux/sh64/set_scno.c: Likewise. * linux/sparc/set_error.c: Likewise. * linux/sparc/set_scno.c: Likewise. * linux/sparc64/set_error.c: Likewise. * linux/sparc64/set_scno.c: Likewise. * linux/tile/set_error.c: Likewise. * linux/tile/set_scno.c: Likewise. * linux/x32/set_error.c: Likewise. * linux/x32/set_scno.c: Likewise. * linux/x86_64/set_error.c: Likewise. * linux/x86_64/set_scno.c: Likewise. * linux/xtensa/set_error.c: Likewise. * linux/xtensa/set_scno.c: Likewise. * Makefile.am (EXTRA_DIST): Add them.
2016-11-15 20:38:21 +03:00
linux/powerpc/set_error.c \
linux/powerpc/set_scno.c \
linux/powerpc/syscallent.h \
linux/powerpc/userent.h \
linux/powerpc64/arch_regs.c \
linux/powerpc64/arch_regs.h \
linux/powerpc64/arch_sigreturn.c \
linux/powerpc64/errnoent.h \
linux/powerpc64/errnoent1.h \
linux/powerpc64/get_error.c \
linux/powerpc64/get_scno.c \
linux/powerpc64/get_syscall_args.c \
linux/powerpc64/getregs_old.c \
linux/powerpc64/getregs_old.h \
ioctl: take all 32 bits of ioctl commands into account Historically, only 16 bits (8-bit number and 8-bit type) of 32-bit ioctl commands were used for decoding, which was the source for numerous annoying collisions like this: ioctl(0, SNDCTL_TMR_TIMEBASE or SNDRV_TIMER_IOCTL_NEXT_DEVICE or TCGETS, {B38400 opost isig icanon echo ...}) = 0 ioctl(0, MGSL_IOCGPARAMS or MMTIMER_GETRES or MTIOCTOP or SNDCTL_MIDI_MPUMODE, 0x7fffd47f7338) = -1 ENOTTY (Inappropriate ioctl for device) The solution is to use all 32 bits for decoding, not just "number" and "type", but also "size" and "direction". As some architectures override defaults that come from asm-generic/ and provide alternative definitions for some ioctl commands, we support per-architecture ioctl definitions and merge them with common definitions at build time. During the merge, we used to keep both generic and architecture-specific definitions, now architecture-specific definitions have precedence over generic ones -- ioctlsort omits definitions from asm-generic/ for those ioctl names that have different definitions in asm/. Additional bits of "direction" are architecture specific -- the number of bits and their values differ between architectures. To reduce architecture differences in the source code, we keep "direction" in symbolic form and compile it in ioctlsort. Additional bits of "size" are also architecture specific -- not only the number of bits differ between architectures, but sizes of many types depend on sizeof(long). To reduce architecture differences in the source code, we keep 32-bit and 64-bit versions of common ioctl definitions, and use the appropriate version for each architecture and personality. To implement this, the tools for generating ioctl definitions from kernel headers have been rewritten, and the source format of ioctl definitions has been extended. The final ioctlent*.h files that are included by syscall.c are now generated from source ioctls_inc*.h and ioctls_arch*.h files at build time with ioctlsort. * ioctl.c (ioctl_lookup): Use all 32 bits of ioctl command code. * ioctlsort.c: Rewritten. * linux/32/ioctls_inc.h: New file. * linux/64/ioctls_inc.h: New file. * linux/aarch64/ioctls_arch0.h: New file. * linux/aarch64/ioctls_arch1.h: New file. * linux/aarch64/ioctls_inc0.h: New file. * linux/aarch64/ioctls_inc1.h: New file. * linux/alpha/ioctls_arch0.h: New file. * linux/alpha/ioctls_inc0.h: New file. * linux/arc/ioctls_arch0.h: New file. * linux/arc/ioctls_inc0.h: New file. * linux/arm/ioctls_arch0.h: New file. * linux/arm/ioctls_inc0.h: New file. * linux/avr32/ioctls_arch0.h: New file. * linux/avr32/ioctls_inc0.h: New file. * linux/bfin/ioctls_arch0.h: New file. * linux/bfin/ioctls_inc0.h: New file. * linux/hppa/ioctls_arch0.h: New file. * linux/hppa/ioctls_inc0.h: New file. * linux/i386/ioctls_arch0.h: New file. * linux/i386/ioctls_inc0.h: New file. * linux/ia64/ioctls_arch0.h: New file. * linux/ia64/ioctls_inc0.h: New file. * linux/m68k/ioctls_arch0.h: New file. * linux/m68k/ioctls_inc0.h: New file. * linux/metag/ioctls_arch0.h: New file. * linux/metag/ioctls_inc0.h: New file. * linux/microblaze/ioctls_arch0.h: New file. * linux/microblaze/ioctls_inc0.h: New file. * linux/mips/ioctls_arch0.h: New file. * linux/mips/ioctls_inc0.h: New file. * linux/or1k/ioctls_arch0.h: New file. * linux/or1k/ioctls_inc0.h: New file. * linux/powerpc/ioctls_arch0.h: New file. * linux/powerpc/ioctls_inc0.h: New file. * linux/powerpc64/ioctls_arch0.h: New file. * linux/powerpc64/ioctls_arch1.h: New file. * linux/powerpc64/ioctls_inc0.h: New file. * linux/powerpc64/ioctls_inc1.h: New file. * linux/s390/ioctls_arch0.h: New file. * linux/s390/ioctls_inc0.h: New file. * linux/s390x/ioctls_arch0.h: New file. * linux/s390x/ioctls_inc0.h: New file. * linux/sh/ioctls_arch0.h: New file. * linux/sh/ioctls_inc0.h: New file. * linux/sh64/ioctls_arch0.h: New file. * linux/sh64/ioctls_inc0.h: New file. * linux/sparc/ioctls_arch0.h: New file. * linux/sparc/ioctls_inc0.h: New file. * linux/sparc64/ioctls_arch0.h: New file. * linux/sparc64/ioctls_arch2.h: New file. * linux/sparc64/ioctls_inc0.h: New file. * linux/sparc64/ioctls_inc2.h: New file. * linux/tile/ioctls_arch0.h: New file. * linux/tile/ioctls_arch1.h: New file. * linux/tile/ioctls_inc0.h: New file. * linux/tile/ioctls_inc1.h: New file. * linux/x32/ioctls_arch0.h: New file. * linux/x32/ioctls_arch1.h: New file. * linux/x32/ioctls_inc0.h: New file. * linux/x32/ioctls_inc1.h: New file. * linux/x86_64/ioctls_arch0.h: New file. * linux/x86_64/ioctls_arch1.h: New file. * linux/x86_64/ioctls_inc0.h: New file. * linux/x86_64/ioctls_inc1.h: New file. * linux/xtensa/ioctls_arch0.h: New file. * linux/xtensa/ioctls_inc0.h: New file. * linux/aarch64/ioctlent.h.in: Remove. * linux/aarch64/ioctlent1.h: Remove. * linux/alpha/ioctlent.h.in: Remove. * linux/arc/ioctlent.h.in: Remove. * linux/arm/ioctlent.h.in: Remove. * linux/avr32/ioctlent.h.in: Remove. * linux/bfin/ioctlent.h.in: Remove. * linux/hppa/ioctlent.h.in: Remove. * linux/i386/ioctlent.h.in: Remove. * linux/ia64/ioctlent.h.in: Remove. * linux/ioctlent.h.in: Remove. * linux/ioctlent.sh: Remove. * linux/m68k/ioctlent.h.in: Remove. * linux/metag/ioctlent.h.in: Remove. * linux/microblaze/ioctlent.h.in: Remove. * linux/mips/ioctlent.h.in: Remove. * linux/mips/ioctlent.sh: Remove. * linux/or1k/ioctlent.h.in: Remove. * linux/powerpc/ioctlent.h.in: Remove. * linux/powerpc64/ioctlent.h: Remove. * linux/powerpc64/ioctlent1.h: Remove. * linux/s390/ioctlent.h.in: Remove. * linux/s390x/ioctlent.h.in: Remove. * linux/sh/ioctlent.h.in: Remove. * linux/sh64/ioctlent.h.in: Remove. * linux/sparc/ioctlent.h.in: Remove. * linux/sparc64/ioctlent.h.in: Remove. * linux/sparc64/ioctlent2.h: Remove. * linux/tile/ioctlent.h.in: Remove. * linux/tile/ioctlent1.h: Remove. * linux/x32/ioctlent.h.in: Remove. * linux/x32/ioctlent1.h: Remove. * linux/x86_64/ioctlent.h.in: Remove. * linux/x86_64/ioctlent1.h: Remove. * linux/xtensa/ioctlent.h.in: Remove. * linux/x86_64/ioctlent2.h: Include ioctlent0.h instead of ioctlent.h. * syscall.c (struct_ioctlent ioctlent0): Likewise. * Makefile.am: Remove all ioctlent-related definitions. Define the list of ioctlent*.h files that have to be generated by presence of $(srcdir)/$(OS)/$(ARCH)/ioctls_inc*.h files. Add rules for ioctlent*.h files generation. (EXTRA_DIST): Update. * maint/ioctls_gen.sh: New file. * maint/ioctls_hex.sh: New file. * maint/ioctls_sym.sh: New file. * maint/print_ioctlent.c: New file. * HACKING-scripts: Update for ioctlent.sh -> ioctls_gen.sh migration. * .gitignore: Add ioctlent[012].h and ioctls_all[012].h. * configure.ac (AC_CHECK_HEADERS): Add linux/hiddev.h and linux/mmtimer.h for tests. * tests/ioctl.c: New file. * tests/ioctl.test: New test. * tests/Makefile.am (check_PROGRAMS): Add ioctl. (TESTS): Add ioctl.test. * tests/.gitignore: Add ioctl.
2015-01-19 20:02:16 +03:00
linux/powerpc64/ioctls_arch0.h \
linux/powerpc64/ioctls_arch1.h \
linux/powerpc64/ioctls_inc0.h \
linux/powerpc64/ioctls_inc1.h \
Implement arch specific methods of changing syscall number and error code This introduces arch_set_error and arch_set_scno functions for each supported architecture, needed to implement syscall fault injection. * linux/aarch64/set_error.c: New file. * linux/aarch64/set_scno.c: Likewise. * linux/alpha/set_error.c: Likewise. * linux/alpha/set_scno.c: Likewise. * linux/arc/set_error.c: Likewise. * linux/arc/set_scno.c: Likewise. * linux/arm/set_error.c: Likewise. * linux/arm/set_scno.c: Likewise. * linux/avr32/set_error.c: Likewise. * linux/avr32/set_scno.c: Likewise. * linux/bfin/set_error.c: Likewise. * linux/bfin/set_scno.c: Likewise. * linux/crisv10/set_error.c: Likewise. * linux/crisv10/set_scno.c: Likewise. * linux/crisv32/set_error.c: Likewise. * linux/crisv32/set_scno.c: Likewise. * linux/hppa/set_error.c: Likewise. * linux/hppa/set_scno.c: Likewise. * linux/i386/set_error.c: Likewise. * linux/i386/set_scno.c: Likewise. * linux/ia64/set_error.c: Likewise. * linux/ia64/set_scno.c: Likewise. * linux/m68k/set_error.c: Likewise. * linux/m68k/set_scno.c: Likewise. * linux/metag/set_error.c: Likewise. * linux/metag/set_scno.c: Likewise. * linux/microblaze/set_error.c: Likewise. * linux/microblaze/set_scno.c: Likewise. * linux/mips/set_error.c: Likewise. * linux/mips/set_scno.c: Likewise. * linux/nios2/set_error.c: Likewise. * linux/nios2/set_scno.c: Likewise. * linux/or1k/set_error.c: Likewise. * linux/or1k/set_scno.c: Likewise. * linux/powerpc/set_error.c: Likewise. * linux/powerpc/set_scno.c: Likewise. * linux/powerpc64/set_error.c: Likewise. * linux/powerpc64/set_scno.c: Likewise. * linux/riscv/set_error.c: Likewise. * linux/riscv/set_scno.c: Likewise. * linux/s390/set_error.c: Likewise. * linux/s390/set_scno.c: Likewise. * linux/s390x/set_error.c: Likewise. * linux/s390x/set_scno.c: Likewise. * linux/sh/set_error.c: Likewise. * linux/sh/set_scno.c: Likewise. * linux/sh64/set_error.c: Likewise. * linux/sh64/set_scno.c: Likewise. * linux/sparc/set_error.c: Likewise. * linux/sparc/set_scno.c: Likewise. * linux/sparc64/set_error.c: Likewise. * linux/sparc64/set_scno.c: Likewise. * linux/tile/set_error.c: Likewise. * linux/tile/set_scno.c: Likewise. * linux/x32/set_error.c: Likewise. * linux/x32/set_scno.c: Likewise. * linux/x86_64/set_error.c: Likewise. * linux/x86_64/set_scno.c: Likewise. * linux/xtensa/set_error.c: Likewise. * linux/xtensa/set_scno.c: Likewise. * Makefile.am (EXTRA_DIST): Add them.
2016-11-15 20:38:21 +03:00
linux/powerpc64/set_error.c \
linux/powerpc64/set_scno.c \
linux/powerpc64/signalent1.h \
linux/powerpc64/syscallent.h \
linux/powerpc64/syscallent1.h \
linux/powerpc64/userent.h \
linux/ptp_clock.h \
linux/riscv/arch_regs.c \
linux/riscv/errnoent1.h \
linux/riscv/get_error.c \
linux/riscv/get_scno.c \
linux/riscv/get_syscall_args.c \
linux/riscv/ioctls_arch0.h \
linux/riscv/ioctls_arch1.h \
linux/riscv/ioctls_inc0.h \
linux/riscv/ioctls_inc1.h \
Implement arch specific methods of changing syscall number and error code This introduces arch_set_error and arch_set_scno functions for each supported architecture, needed to implement syscall fault injection. * linux/aarch64/set_error.c: New file. * linux/aarch64/set_scno.c: Likewise. * linux/alpha/set_error.c: Likewise. * linux/alpha/set_scno.c: Likewise. * linux/arc/set_error.c: Likewise. * linux/arc/set_scno.c: Likewise. * linux/arm/set_error.c: Likewise. * linux/arm/set_scno.c: Likewise. * linux/avr32/set_error.c: Likewise. * linux/avr32/set_scno.c: Likewise. * linux/bfin/set_error.c: Likewise. * linux/bfin/set_scno.c: Likewise. * linux/crisv10/set_error.c: Likewise. * linux/crisv10/set_scno.c: Likewise. * linux/crisv32/set_error.c: Likewise. * linux/crisv32/set_scno.c: Likewise. * linux/hppa/set_error.c: Likewise. * linux/hppa/set_scno.c: Likewise. * linux/i386/set_error.c: Likewise. * linux/i386/set_scno.c: Likewise. * linux/ia64/set_error.c: Likewise. * linux/ia64/set_scno.c: Likewise. * linux/m68k/set_error.c: Likewise. * linux/m68k/set_scno.c: Likewise. * linux/metag/set_error.c: Likewise. * linux/metag/set_scno.c: Likewise. * linux/microblaze/set_error.c: Likewise. * linux/microblaze/set_scno.c: Likewise. * linux/mips/set_error.c: Likewise. * linux/mips/set_scno.c: Likewise. * linux/nios2/set_error.c: Likewise. * linux/nios2/set_scno.c: Likewise. * linux/or1k/set_error.c: Likewise. * linux/or1k/set_scno.c: Likewise. * linux/powerpc/set_error.c: Likewise. * linux/powerpc/set_scno.c: Likewise. * linux/powerpc64/set_error.c: Likewise. * linux/powerpc64/set_scno.c: Likewise. * linux/riscv/set_error.c: Likewise. * linux/riscv/set_scno.c: Likewise. * linux/s390/set_error.c: Likewise. * linux/s390/set_scno.c: Likewise. * linux/s390x/set_error.c: Likewise. * linux/s390x/set_scno.c: Likewise. * linux/sh/set_error.c: Likewise. * linux/sh/set_scno.c: Likewise. * linux/sh64/set_error.c: Likewise. * linux/sh64/set_scno.c: Likewise. * linux/sparc/set_error.c: Likewise. * linux/sparc/set_scno.c: Likewise. * linux/sparc64/set_error.c: Likewise. * linux/sparc64/set_scno.c: Likewise. * linux/tile/set_error.c: Likewise. * linux/tile/set_scno.c: Likewise. * linux/x32/set_error.c: Likewise. * linux/x32/set_scno.c: Likewise. * linux/x86_64/set_error.c: Likewise. * linux/x86_64/set_scno.c: Likewise. * linux/xtensa/set_error.c: Likewise. * linux/xtensa/set_scno.c: Likewise. * Makefile.am (EXTRA_DIST): Add them.
2016-11-15 20:38:21 +03:00
linux/riscv/set_error.c \
linux/riscv/set_scno.c \
linux/riscv/signalent1.h \
linux/riscv/syscallent.h \
linux/riscv/syscallent1.h \
linux/s390/arch_regs.c \
linux/s390/arch_regs.h \
linux/s390/arch_sigreturn.c \
linux/s390/get_error.c \
linux/s390/get_scno.c \
linux/s390/get_syscall_args.c \
ioctl: take all 32 bits of ioctl commands into account Historically, only 16 bits (8-bit number and 8-bit type) of 32-bit ioctl commands were used for decoding, which was the source for numerous annoying collisions like this: ioctl(0, SNDCTL_TMR_TIMEBASE or SNDRV_TIMER_IOCTL_NEXT_DEVICE or TCGETS, {B38400 opost isig icanon echo ...}) = 0 ioctl(0, MGSL_IOCGPARAMS or MMTIMER_GETRES or MTIOCTOP or SNDCTL_MIDI_MPUMODE, 0x7fffd47f7338) = -1 ENOTTY (Inappropriate ioctl for device) The solution is to use all 32 bits for decoding, not just "number" and "type", but also "size" and "direction". As some architectures override defaults that come from asm-generic/ and provide alternative definitions for some ioctl commands, we support per-architecture ioctl definitions and merge them with common definitions at build time. During the merge, we used to keep both generic and architecture-specific definitions, now architecture-specific definitions have precedence over generic ones -- ioctlsort omits definitions from asm-generic/ for those ioctl names that have different definitions in asm/. Additional bits of "direction" are architecture specific -- the number of bits and their values differ between architectures. To reduce architecture differences in the source code, we keep "direction" in symbolic form and compile it in ioctlsort. Additional bits of "size" are also architecture specific -- not only the number of bits differ between architectures, but sizes of many types depend on sizeof(long). To reduce architecture differences in the source code, we keep 32-bit and 64-bit versions of common ioctl definitions, and use the appropriate version for each architecture and personality. To implement this, the tools for generating ioctl definitions from kernel headers have been rewritten, and the source format of ioctl definitions has been extended. The final ioctlent*.h files that are included by syscall.c are now generated from source ioctls_inc*.h and ioctls_arch*.h files at build time with ioctlsort. * ioctl.c (ioctl_lookup): Use all 32 bits of ioctl command code. * ioctlsort.c: Rewritten. * linux/32/ioctls_inc.h: New file. * linux/64/ioctls_inc.h: New file. * linux/aarch64/ioctls_arch0.h: New file. * linux/aarch64/ioctls_arch1.h: New file. * linux/aarch64/ioctls_inc0.h: New file. * linux/aarch64/ioctls_inc1.h: New file. * linux/alpha/ioctls_arch0.h: New file. * linux/alpha/ioctls_inc0.h: New file. * linux/arc/ioctls_arch0.h: New file. * linux/arc/ioctls_inc0.h: New file. * linux/arm/ioctls_arch0.h: New file. * linux/arm/ioctls_inc0.h: New file. * linux/avr32/ioctls_arch0.h: New file. * linux/avr32/ioctls_inc0.h: New file. * linux/bfin/ioctls_arch0.h: New file. * linux/bfin/ioctls_inc0.h: New file. * linux/hppa/ioctls_arch0.h: New file. * linux/hppa/ioctls_inc0.h: New file. * linux/i386/ioctls_arch0.h: New file. * linux/i386/ioctls_inc0.h: New file. * linux/ia64/ioctls_arch0.h: New file. * linux/ia64/ioctls_inc0.h: New file. * linux/m68k/ioctls_arch0.h: New file. * linux/m68k/ioctls_inc0.h: New file. * linux/metag/ioctls_arch0.h: New file. * linux/metag/ioctls_inc0.h: New file. * linux/microblaze/ioctls_arch0.h: New file. * linux/microblaze/ioctls_inc0.h: New file. * linux/mips/ioctls_arch0.h: New file. * linux/mips/ioctls_inc0.h: New file. * linux/or1k/ioctls_arch0.h: New file. * linux/or1k/ioctls_inc0.h: New file. * linux/powerpc/ioctls_arch0.h: New file. * linux/powerpc/ioctls_inc0.h: New file. * linux/powerpc64/ioctls_arch0.h: New file. * linux/powerpc64/ioctls_arch1.h: New file. * linux/powerpc64/ioctls_inc0.h: New file. * linux/powerpc64/ioctls_inc1.h: New file. * linux/s390/ioctls_arch0.h: New file. * linux/s390/ioctls_inc0.h: New file. * linux/s390x/ioctls_arch0.h: New file. * linux/s390x/ioctls_inc0.h: New file. * linux/sh/ioctls_arch0.h: New file. * linux/sh/ioctls_inc0.h: New file. * linux/sh64/ioctls_arch0.h: New file. * linux/sh64/ioctls_inc0.h: New file. * linux/sparc/ioctls_arch0.h: New file. * linux/sparc/ioctls_inc0.h: New file. * linux/sparc64/ioctls_arch0.h: New file. * linux/sparc64/ioctls_arch2.h: New file. * linux/sparc64/ioctls_inc0.h: New file. * linux/sparc64/ioctls_inc2.h: New file. * linux/tile/ioctls_arch0.h: New file. * linux/tile/ioctls_arch1.h: New file. * linux/tile/ioctls_inc0.h: New file. * linux/tile/ioctls_inc1.h: New file. * linux/x32/ioctls_arch0.h: New file. * linux/x32/ioctls_arch1.h: New file. * linux/x32/ioctls_inc0.h: New file. * linux/x32/ioctls_inc1.h: New file. * linux/x86_64/ioctls_arch0.h: New file. * linux/x86_64/ioctls_arch1.h: New file. * linux/x86_64/ioctls_inc0.h: New file. * linux/x86_64/ioctls_inc1.h: New file. * linux/xtensa/ioctls_arch0.h: New file. * linux/xtensa/ioctls_inc0.h: New file. * linux/aarch64/ioctlent.h.in: Remove. * linux/aarch64/ioctlent1.h: Remove. * linux/alpha/ioctlent.h.in: Remove. * linux/arc/ioctlent.h.in: Remove. * linux/arm/ioctlent.h.in: Remove. * linux/avr32/ioctlent.h.in: Remove. * linux/bfin/ioctlent.h.in: Remove. * linux/hppa/ioctlent.h.in: Remove. * linux/i386/ioctlent.h.in: Remove. * linux/ia64/ioctlent.h.in: Remove. * linux/ioctlent.h.in: Remove. * linux/ioctlent.sh: Remove. * linux/m68k/ioctlent.h.in: Remove. * linux/metag/ioctlent.h.in: Remove. * linux/microblaze/ioctlent.h.in: Remove. * linux/mips/ioctlent.h.in: Remove. * linux/mips/ioctlent.sh: Remove. * linux/or1k/ioctlent.h.in: Remove. * linux/powerpc/ioctlent.h.in: Remove. * linux/powerpc64/ioctlent.h: Remove. * linux/powerpc64/ioctlent1.h: Remove. * linux/s390/ioctlent.h.in: Remove. * linux/s390x/ioctlent.h.in: Remove. * linux/sh/ioctlent.h.in: Remove. * linux/sh64/ioctlent.h.in: Remove. * linux/sparc/ioctlent.h.in: Remove. * linux/sparc64/ioctlent.h.in: Remove. * linux/sparc64/ioctlent2.h: Remove. * linux/tile/ioctlent.h.in: Remove. * linux/tile/ioctlent1.h: Remove. * linux/x32/ioctlent.h.in: Remove. * linux/x32/ioctlent1.h: Remove. * linux/x86_64/ioctlent.h.in: Remove. * linux/x86_64/ioctlent1.h: Remove. * linux/xtensa/ioctlent.h.in: Remove. * linux/x86_64/ioctlent2.h: Include ioctlent0.h instead of ioctlent.h. * syscall.c (struct_ioctlent ioctlent0): Likewise. * Makefile.am: Remove all ioctlent-related definitions. Define the list of ioctlent*.h files that have to be generated by presence of $(srcdir)/$(OS)/$(ARCH)/ioctls_inc*.h files. Add rules for ioctlent*.h files generation. (EXTRA_DIST): Update. * maint/ioctls_gen.sh: New file. * maint/ioctls_hex.sh: New file. * maint/ioctls_sym.sh: New file. * maint/print_ioctlent.c: New file. * HACKING-scripts: Update for ioctlent.sh -> ioctls_gen.sh migration. * .gitignore: Add ioctlent[012].h and ioctls_all[012].h. * configure.ac (AC_CHECK_HEADERS): Add linux/hiddev.h and linux/mmtimer.h for tests. * tests/ioctl.c: New file. * tests/ioctl.test: New test. * tests/Makefile.am (check_PROGRAMS): Add ioctl. (TESTS): Add ioctl.test. * tests/.gitignore: Add ioctl.
2015-01-19 20:02:16 +03:00
linux/s390/ioctls_arch0.h \
linux/s390/ioctls_inc0.h \
Implement arch specific methods of changing syscall number and error code This introduces arch_set_error and arch_set_scno functions for each supported architecture, needed to implement syscall fault injection. * linux/aarch64/set_error.c: New file. * linux/aarch64/set_scno.c: Likewise. * linux/alpha/set_error.c: Likewise. * linux/alpha/set_scno.c: Likewise. * linux/arc/set_error.c: Likewise. * linux/arc/set_scno.c: Likewise. * linux/arm/set_error.c: Likewise. * linux/arm/set_scno.c: Likewise. * linux/avr32/set_error.c: Likewise. * linux/avr32/set_scno.c: Likewise. * linux/bfin/set_error.c: Likewise. * linux/bfin/set_scno.c: Likewise. * linux/crisv10/set_error.c: Likewise. * linux/crisv10/set_scno.c: Likewise. * linux/crisv32/set_error.c: Likewise. * linux/crisv32/set_scno.c: Likewise. * linux/hppa/set_error.c: Likewise. * linux/hppa/set_scno.c: Likewise. * linux/i386/set_error.c: Likewise. * linux/i386/set_scno.c: Likewise. * linux/ia64/set_error.c: Likewise. * linux/ia64/set_scno.c: Likewise. * linux/m68k/set_error.c: Likewise. * linux/m68k/set_scno.c: Likewise. * linux/metag/set_error.c: Likewise. * linux/metag/set_scno.c: Likewise. * linux/microblaze/set_error.c: Likewise. * linux/microblaze/set_scno.c: Likewise. * linux/mips/set_error.c: Likewise. * linux/mips/set_scno.c: Likewise. * linux/nios2/set_error.c: Likewise. * linux/nios2/set_scno.c: Likewise. * linux/or1k/set_error.c: Likewise. * linux/or1k/set_scno.c: Likewise. * linux/powerpc/set_error.c: Likewise. * linux/powerpc/set_scno.c: Likewise. * linux/powerpc64/set_error.c: Likewise. * linux/powerpc64/set_scno.c: Likewise. * linux/riscv/set_error.c: Likewise. * linux/riscv/set_scno.c: Likewise. * linux/s390/set_error.c: Likewise. * linux/s390/set_scno.c: Likewise. * linux/s390x/set_error.c: Likewise. * linux/s390x/set_scno.c: Likewise. * linux/sh/set_error.c: Likewise. * linux/sh/set_scno.c: Likewise. * linux/sh64/set_error.c: Likewise. * linux/sh64/set_scno.c: Likewise. * linux/sparc/set_error.c: Likewise. * linux/sparc/set_scno.c: Likewise. * linux/sparc64/set_error.c: Likewise. * linux/sparc64/set_scno.c: Likewise. * linux/tile/set_error.c: Likewise. * linux/tile/set_scno.c: Likewise. * linux/x32/set_error.c: Likewise. * linux/x32/set_scno.c: Likewise. * linux/x86_64/set_error.c: Likewise. * linux/x86_64/set_scno.c: Likewise. * linux/xtensa/set_error.c: Likewise. * linux/xtensa/set_scno.c: Likewise. * Makefile.am (EXTRA_DIST): Add them.
2016-11-15 20:38:21 +03:00
linux/s390/set_error.c \
linux/s390/set_scno.c \
linux/s390/syscallent.h \
linux/s390/userent.h \
linux/s390/userent0.h \
linux/s390/userent1.h \
linux/s390x/arch_regs.c \
linux/s390x/arch_regs.h \
linux/s390x/arch_sigreturn.c \
linux/s390x/get_error.c \
linux/s390x/get_scno.c \
linux/s390x/get_syscall_args.c \
ioctl: take all 32 bits of ioctl commands into account Historically, only 16 bits (8-bit number and 8-bit type) of 32-bit ioctl commands were used for decoding, which was the source for numerous annoying collisions like this: ioctl(0, SNDCTL_TMR_TIMEBASE or SNDRV_TIMER_IOCTL_NEXT_DEVICE or TCGETS, {B38400 opost isig icanon echo ...}) = 0 ioctl(0, MGSL_IOCGPARAMS or MMTIMER_GETRES or MTIOCTOP or SNDCTL_MIDI_MPUMODE, 0x7fffd47f7338) = -1 ENOTTY (Inappropriate ioctl for device) The solution is to use all 32 bits for decoding, not just "number" and "type", but also "size" and "direction". As some architectures override defaults that come from asm-generic/ and provide alternative definitions for some ioctl commands, we support per-architecture ioctl definitions and merge them with common definitions at build time. During the merge, we used to keep both generic and architecture-specific definitions, now architecture-specific definitions have precedence over generic ones -- ioctlsort omits definitions from asm-generic/ for those ioctl names that have different definitions in asm/. Additional bits of "direction" are architecture specific -- the number of bits and their values differ between architectures. To reduce architecture differences in the source code, we keep "direction" in symbolic form and compile it in ioctlsort. Additional bits of "size" are also architecture specific -- not only the number of bits differ between architectures, but sizes of many types depend on sizeof(long). To reduce architecture differences in the source code, we keep 32-bit and 64-bit versions of common ioctl definitions, and use the appropriate version for each architecture and personality. To implement this, the tools for generating ioctl definitions from kernel headers have been rewritten, and the source format of ioctl definitions has been extended. The final ioctlent*.h files that are included by syscall.c are now generated from source ioctls_inc*.h and ioctls_arch*.h files at build time with ioctlsort. * ioctl.c (ioctl_lookup): Use all 32 bits of ioctl command code. * ioctlsort.c: Rewritten. * linux/32/ioctls_inc.h: New file. * linux/64/ioctls_inc.h: New file. * linux/aarch64/ioctls_arch0.h: New file. * linux/aarch64/ioctls_arch1.h: New file. * linux/aarch64/ioctls_inc0.h: New file. * linux/aarch64/ioctls_inc1.h: New file. * linux/alpha/ioctls_arch0.h: New file. * linux/alpha/ioctls_inc0.h: New file. * linux/arc/ioctls_arch0.h: New file. * linux/arc/ioctls_inc0.h: New file. * linux/arm/ioctls_arch0.h: New file. * linux/arm/ioctls_inc0.h: New file. * linux/avr32/ioctls_arch0.h: New file. * linux/avr32/ioctls_inc0.h: New file. * linux/bfin/ioctls_arch0.h: New file. * linux/bfin/ioctls_inc0.h: New file. * linux/hppa/ioctls_arch0.h: New file. * linux/hppa/ioctls_inc0.h: New file. * linux/i386/ioctls_arch0.h: New file. * linux/i386/ioctls_inc0.h: New file. * linux/ia64/ioctls_arch0.h: New file. * linux/ia64/ioctls_inc0.h: New file. * linux/m68k/ioctls_arch0.h: New file. * linux/m68k/ioctls_inc0.h: New file. * linux/metag/ioctls_arch0.h: New file. * linux/metag/ioctls_inc0.h: New file. * linux/microblaze/ioctls_arch0.h: New file. * linux/microblaze/ioctls_inc0.h: New file. * linux/mips/ioctls_arch0.h: New file. * linux/mips/ioctls_inc0.h: New file. * linux/or1k/ioctls_arch0.h: New file. * linux/or1k/ioctls_inc0.h: New file. * linux/powerpc/ioctls_arch0.h: New file. * linux/powerpc/ioctls_inc0.h: New file. * linux/powerpc64/ioctls_arch0.h: New file. * linux/powerpc64/ioctls_arch1.h: New file. * linux/powerpc64/ioctls_inc0.h: New file. * linux/powerpc64/ioctls_inc1.h: New file. * linux/s390/ioctls_arch0.h: New file. * linux/s390/ioctls_inc0.h: New file. * linux/s390x/ioctls_arch0.h: New file. * linux/s390x/ioctls_inc0.h: New file. * linux/sh/ioctls_arch0.h: New file. * linux/sh/ioctls_inc0.h: New file. * linux/sh64/ioctls_arch0.h: New file. * linux/sh64/ioctls_inc0.h: New file. * linux/sparc/ioctls_arch0.h: New file. * linux/sparc/ioctls_inc0.h: New file. * linux/sparc64/ioctls_arch0.h: New file. * linux/sparc64/ioctls_arch2.h: New file. * linux/sparc64/ioctls_inc0.h: New file. * linux/sparc64/ioctls_inc2.h: New file. * linux/tile/ioctls_arch0.h: New file. * linux/tile/ioctls_arch1.h: New file. * linux/tile/ioctls_inc0.h: New file. * linux/tile/ioctls_inc1.h: New file. * linux/x32/ioctls_arch0.h: New file. * linux/x32/ioctls_arch1.h: New file. * linux/x32/ioctls_inc0.h: New file. * linux/x32/ioctls_inc1.h: New file. * linux/x86_64/ioctls_arch0.h: New file. * linux/x86_64/ioctls_arch1.h: New file. * linux/x86_64/ioctls_inc0.h: New file. * linux/x86_64/ioctls_inc1.h: New file. * linux/xtensa/ioctls_arch0.h: New file. * linux/xtensa/ioctls_inc0.h: New file. * linux/aarch64/ioctlent.h.in: Remove. * linux/aarch64/ioctlent1.h: Remove. * linux/alpha/ioctlent.h.in: Remove. * linux/arc/ioctlent.h.in: Remove. * linux/arm/ioctlent.h.in: Remove. * linux/avr32/ioctlent.h.in: Remove. * linux/bfin/ioctlent.h.in: Remove. * linux/hppa/ioctlent.h.in: Remove. * linux/i386/ioctlent.h.in: Remove. * linux/ia64/ioctlent.h.in: Remove. * linux/ioctlent.h.in: Remove. * linux/ioctlent.sh: Remove. * linux/m68k/ioctlent.h.in: Remove. * linux/metag/ioctlent.h.in: Remove. * linux/microblaze/ioctlent.h.in: Remove. * linux/mips/ioctlent.h.in: Remove. * linux/mips/ioctlent.sh: Remove. * linux/or1k/ioctlent.h.in: Remove. * linux/powerpc/ioctlent.h.in: Remove. * linux/powerpc64/ioctlent.h: Remove. * linux/powerpc64/ioctlent1.h: Remove. * linux/s390/ioctlent.h.in: Remove. * linux/s390x/ioctlent.h.in: Remove. * linux/sh/ioctlent.h.in: Remove. * linux/sh64/ioctlent.h.in: Remove. * linux/sparc/ioctlent.h.in: Remove. * linux/sparc64/ioctlent.h.in: Remove. * linux/sparc64/ioctlent2.h: Remove. * linux/tile/ioctlent.h.in: Remove. * linux/tile/ioctlent1.h: Remove. * linux/x32/ioctlent.h.in: Remove. * linux/x32/ioctlent1.h: Remove. * linux/x86_64/ioctlent.h.in: Remove. * linux/x86_64/ioctlent1.h: Remove. * linux/xtensa/ioctlent.h.in: Remove. * linux/x86_64/ioctlent2.h: Include ioctlent0.h instead of ioctlent.h. * syscall.c (struct_ioctlent ioctlent0): Likewise. * Makefile.am: Remove all ioctlent-related definitions. Define the list of ioctlent*.h files that have to be generated by presence of $(srcdir)/$(OS)/$(ARCH)/ioctls_inc*.h files. Add rules for ioctlent*.h files generation. (EXTRA_DIST): Update. * maint/ioctls_gen.sh: New file. * maint/ioctls_hex.sh: New file. * maint/ioctls_sym.sh: New file. * maint/print_ioctlent.c: New file. * HACKING-scripts: Update for ioctlent.sh -> ioctls_gen.sh migration. * .gitignore: Add ioctlent[012].h and ioctls_all[012].h. * configure.ac (AC_CHECK_HEADERS): Add linux/hiddev.h and linux/mmtimer.h for tests. * tests/ioctl.c: New file. * tests/ioctl.test: New test. * tests/Makefile.am (check_PROGRAMS): Add ioctl. (TESTS): Add ioctl.test. * tests/.gitignore: Add ioctl.
2015-01-19 20:02:16 +03:00
linux/s390x/ioctls_arch0.h \
linux/s390x/ioctls_inc0.h \
Implement arch specific methods of changing syscall number and error code This introduces arch_set_error and arch_set_scno functions for each supported architecture, needed to implement syscall fault injection. * linux/aarch64/set_error.c: New file. * linux/aarch64/set_scno.c: Likewise. * linux/alpha/set_error.c: Likewise. * linux/alpha/set_scno.c: Likewise. * linux/arc/set_error.c: Likewise. * linux/arc/set_scno.c: Likewise. * linux/arm/set_error.c: Likewise. * linux/arm/set_scno.c: Likewise. * linux/avr32/set_error.c: Likewise. * linux/avr32/set_scno.c: Likewise. * linux/bfin/set_error.c: Likewise. * linux/bfin/set_scno.c: Likewise. * linux/crisv10/set_error.c: Likewise. * linux/crisv10/set_scno.c: Likewise. * linux/crisv32/set_error.c: Likewise. * linux/crisv32/set_scno.c: Likewise. * linux/hppa/set_error.c: Likewise. * linux/hppa/set_scno.c: Likewise. * linux/i386/set_error.c: Likewise. * linux/i386/set_scno.c: Likewise. * linux/ia64/set_error.c: Likewise. * linux/ia64/set_scno.c: Likewise. * linux/m68k/set_error.c: Likewise. * linux/m68k/set_scno.c: Likewise. * linux/metag/set_error.c: Likewise. * linux/metag/set_scno.c: Likewise. * linux/microblaze/set_error.c: Likewise. * linux/microblaze/set_scno.c: Likewise. * linux/mips/set_error.c: Likewise. * linux/mips/set_scno.c: Likewise. * linux/nios2/set_error.c: Likewise. * linux/nios2/set_scno.c: Likewise. * linux/or1k/set_error.c: Likewise. * linux/or1k/set_scno.c: Likewise. * linux/powerpc/set_error.c: Likewise. * linux/powerpc/set_scno.c: Likewise. * linux/powerpc64/set_error.c: Likewise. * linux/powerpc64/set_scno.c: Likewise. * linux/riscv/set_error.c: Likewise. * linux/riscv/set_scno.c: Likewise. * linux/s390/set_error.c: Likewise. * linux/s390/set_scno.c: Likewise. * linux/s390x/set_error.c: Likewise. * linux/s390x/set_scno.c: Likewise. * linux/sh/set_error.c: Likewise. * linux/sh/set_scno.c: Likewise. * linux/sh64/set_error.c: Likewise. * linux/sh64/set_scno.c: Likewise. * linux/sparc/set_error.c: Likewise. * linux/sparc/set_scno.c: Likewise. * linux/sparc64/set_error.c: Likewise. * linux/sparc64/set_scno.c: Likewise. * linux/tile/set_error.c: Likewise. * linux/tile/set_scno.c: Likewise. * linux/x32/set_error.c: Likewise. * linux/x32/set_scno.c: Likewise. * linux/x86_64/set_error.c: Likewise. * linux/x86_64/set_scno.c: Likewise. * linux/xtensa/set_error.c: Likewise. * linux/xtensa/set_scno.c: Likewise. * Makefile.am (EXTRA_DIST): Add them.
2016-11-15 20:38:21 +03:00
linux/s390x/set_error.c \
linux/s390x/set_scno.c \
linux/s390x/syscallent.h \
linux/s390x/userent.h \
linux/sh/arch_getrval2.c \
linux/sh/arch_regs.c \
linux/sh/get_error.c \
linux/sh/get_scno.c \
linux/sh/get_syscall_args.c \
linux/sh/get_syscall_result.c \
ioctl: take all 32 bits of ioctl commands into account Historically, only 16 bits (8-bit number and 8-bit type) of 32-bit ioctl commands were used for decoding, which was the source for numerous annoying collisions like this: ioctl(0, SNDCTL_TMR_TIMEBASE or SNDRV_TIMER_IOCTL_NEXT_DEVICE or TCGETS, {B38400 opost isig icanon echo ...}) = 0 ioctl(0, MGSL_IOCGPARAMS or MMTIMER_GETRES or MTIOCTOP or SNDCTL_MIDI_MPUMODE, 0x7fffd47f7338) = -1 ENOTTY (Inappropriate ioctl for device) The solution is to use all 32 bits for decoding, not just "number" and "type", but also "size" and "direction". As some architectures override defaults that come from asm-generic/ and provide alternative definitions for some ioctl commands, we support per-architecture ioctl definitions and merge them with common definitions at build time. During the merge, we used to keep both generic and architecture-specific definitions, now architecture-specific definitions have precedence over generic ones -- ioctlsort omits definitions from asm-generic/ for those ioctl names that have different definitions in asm/. Additional bits of "direction" are architecture specific -- the number of bits and their values differ between architectures. To reduce architecture differences in the source code, we keep "direction" in symbolic form and compile it in ioctlsort. Additional bits of "size" are also architecture specific -- not only the number of bits differ between architectures, but sizes of many types depend on sizeof(long). To reduce architecture differences in the source code, we keep 32-bit and 64-bit versions of common ioctl definitions, and use the appropriate version for each architecture and personality. To implement this, the tools for generating ioctl definitions from kernel headers have been rewritten, and the source format of ioctl definitions has been extended. The final ioctlent*.h files that are included by syscall.c are now generated from source ioctls_inc*.h and ioctls_arch*.h files at build time with ioctlsort. * ioctl.c (ioctl_lookup): Use all 32 bits of ioctl command code. * ioctlsort.c: Rewritten. * linux/32/ioctls_inc.h: New file. * linux/64/ioctls_inc.h: New file. * linux/aarch64/ioctls_arch0.h: New file. * linux/aarch64/ioctls_arch1.h: New file. * linux/aarch64/ioctls_inc0.h: New file. * linux/aarch64/ioctls_inc1.h: New file. * linux/alpha/ioctls_arch0.h: New file. * linux/alpha/ioctls_inc0.h: New file. * linux/arc/ioctls_arch0.h: New file. * linux/arc/ioctls_inc0.h: New file. * linux/arm/ioctls_arch0.h: New file. * linux/arm/ioctls_inc0.h: New file. * linux/avr32/ioctls_arch0.h: New file. * linux/avr32/ioctls_inc0.h: New file. * linux/bfin/ioctls_arch0.h: New file. * linux/bfin/ioctls_inc0.h: New file. * linux/hppa/ioctls_arch0.h: New file. * linux/hppa/ioctls_inc0.h: New file. * linux/i386/ioctls_arch0.h: New file. * linux/i386/ioctls_inc0.h: New file. * linux/ia64/ioctls_arch0.h: New file. * linux/ia64/ioctls_inc0.h: New file. * linux/m68k/ioctls_arch0.h: New file. * linux/m68k/ioctls_inc0.h: New file. * linux/metag/ioctls_arch0.h: New file. * linux/metag/ioctls_inc0.h: New file. * linux/microblaze/ioctls_arch0.h: New file. * linux/microblaze/ioctls_inc0.h: New file. * linux/mips/ioctls_arch0.h: New file. * linux/mips/ioctls_inc0.h: New file. * linux/or1k/ioctls_arch0.h: New file. * linux/or1k/ioctls_inc0.h: New file. * linux/powerpc/ioctls_arch0.h: New file. * linux/powerpc/ioctls_inc0.h: New file. * linux/powerpc64/ioctls_arch0.h: New file. * linux/powerpc64/ioctls_arch1.h: New file. * linux/powerpc64/ioctls_inc0.h: New file. * linux/powerpc64/ioctls_inc1.h: New file. * linux/s390/ioctls_arch0.h: New file. * linux/s390/ioctls_inc0.h: New file. * linux/s390x/ioctls_arch0.h: New file. * linux/s390x/ioctls_inc0.h: New file. * linux/sh/ioctls_arch0.h: New file. * linux/sh/ioctls_inc0.h: New file. * linux/sh64/ioctls_arch0.h: New file. * linux/sh64/ioctls_inc0.h: New file. * linux/sparc/ioctls_arch0.h: New file. * linux/sparc/ioctls_inc0.h: New file. * linux/sparc64/ioctls_arch0.h: New file. * linux/sparc64/ioctls_arch2.h: New file. * linux/sparc64/ioctls_inc0.h: New file. * linux/sparc64/ioctls_inc2.h: New file. * linux/tile/ioctls_arch0.h: New file. * linux/tile/ioctls_arch1.h: New file. * linux/tile/ioctls_inc0.h: New file. * linux/tile/ioctls_inc1.h: New file. * linux/x32/ioctls_arch0.h: New file. * linux/x32/ioctls_arch1.h: New file. * linux/x32/ioctls_inc0.h: New file. * linux/x32/ioctls_inc1.h: New file. * linux/x86_64/ioctls_arch0.h: New file. * linux/x86_64/ioctls_arch1.h: New file. * linux/x86_64/ioctls_inc0.h: New file. * linux/x86_64/ioctls_inc1.h: New file. * linux/xtensa/ioctls_arch0.h: New file. * linux/xtensa/ioctls_inc0.h: New file. * linux/aarch64/ioctlent.h.in: Remove. * linux/aarch64/ioctlent1.h: Remove. * linux/alpha/ioctlent.h.in: Remove. * linux/arc/ioctlent.h.in: Remove. * linux/arm/ioctlent.h.in: Remove. * linux/avr32/ioctlent.h.in: Remove. * linux/bfin/ioctlent.h.in: Remove. * linux/hppa/ioctlent.h.in: Remove. * linux/i386/ioctlent.h.in: Remove. * linux/ia64/ioctlent.h.in: Remove. * linux/ioctlent.h.in: Remove. * linux/ioctlent.sh: Remove. * linux/m68k/ioctlent.h.in: Remove. * linux/metag/ioctlent.h.in: Remove. * linux/microblaze/ioctlent.h.in: Remove. * linux/mips/ioctlent.h.in: Remove. * linux/mips/ioctlent.sh: Remove. * linux/or1k/ioctlent.h.in: Remove. * linux/powerpc/ioctlent.h.in: Remove. * linux/powerpc64/ioctlent.h: Remove. * linux/powerpc64/ioctlent1.h: Remove. * linux/s390/ioctlent.h.in: Remove. * linux/s390x/ioctlent.h.in: Remove. * linux/sh/ioctlent.h.in: Remove. * linux/sh64/ioctlent.h.in: Remove. * linux/sparc/ioctlent.h.in: Remove. * linux/sparc64/ioctlent.h.in: Remove. * linux/sparc64/ioctlent2.h: Remove. * linux/tile/ioctlent.h.in: Remove. * linux/tile/ioctlent1.h: Remove. * linux/x32/ioctlent.h.in: Remove. * linux/x32/ioctlent1.h: Remove. * linux/x86_64/ioctlent.h.in: Remove. * linux/x86_64/ioctlent1.h: Remove. * linux/xtensa/ioctlent.h.in: Remove. * linux/x86_64/ioctlent2.h: Include ioctlent0.h instead of ioctlent.h. * syscall.c (struct_ioctlent ioctlent0): Likewise. * Makefile.am: Remove all ioctlent-related definitions. Define the list of ioctlent*.h files that have to be generated by presence of $(srcdir)/$(OS)/$(ARCH)/ioctls_inc*.h files. Add rules for ioctlent*.h files generation. (EXTRA_DIST): Update. * maint/ioctls_gen.sh: New file. * maint/ioctls_hex.sh: New file. * maint/ioctls_sym.sh: New file. * maint/print_ioctlent.c: New file. * HACKING-scripts: Update for ioctlent.sh -> ioctls_gen.sh migration. * .gitignore: Add ioctlent[012].h and ioctls_all[012].h. * configure.ac (AC_CHECK_HEADERS): Add linux/hiddev.h and linux/mmtimer.h for tests. * tests/ioctl.c: New file. * tests/ioctl.test: New test. * tests/Makefile.am (check_PROGRAMS): Add ioctl. (TESTS): Add ioctl.test. * tests/.gitignore: Add ioctl.
2015-01-19 20:02:16 +03:00
linux/sh/ioctls_arch0.h \
linux/sh/ioctls_inc0.h \
Implement arch specific methods of changing syscall number and error code This introduces arch_set_error and arch_set_scno functions for each supported architecture, needed to implement syscall fault injection. * linux/aarch64/set_error.c: New file. * linux/aarch64/set_scno.c: Likewise. * linux/alpha/set_error.c: Likewise. * linux/alpha/set_scno.c: Likewise. * linux/arc/set_error.c: Likewise. * linux/arc/set_scno.c: Likewise. * linux/arm/set_error.c: Likewise. * linux/arm/set_scno.c: Likewise. * linux/avr32/set_error.c: Likewise. * linux/avr32/set_scno.c: Likewise. * linux/bfin/set_error.c: Likewise. * linux/bfin/set_scno.c: Likewise. * linux/crisv10/set_error.c: Likewise. * linux/crisv10/set_scno.c: Likewise. * linux/crisv32/set_error.c: Likewise. * linux/crisv32/set_scno.c: Likewise. * linux/hppa/set_error.c: Likewise. * linux/hppa/set_scno.c: Likewise. * linux/i386/set_error.c: Likewise. * linux/i386/set_scno.c: Likewise. * linux/ia64/set_error.c: Likewise. * linux/ia64/set_scno.c: Likewise. * linux/m68k/set_error.c: Likewise. * linux/m68k/set_scno.c: Likewise. * linux/metag/set_error.c: Likewise. * linux/metag/set_scno.c: Likewise. * linux/microblaze/set_error.c: Likewise. * linux/microblaze/set_scno.c: Likewise. * linux/mips/set_error.c: Likewise. * linux/mips/set_scno.c: Likewise. * linux/nios2/set_error.c: Likewise. * linux/nios2/set_scno.c: Likewise. * linux/or1k/set_error.c: Likewise. * linux/or1k/set_scno.c: Likewise. * linux/powerpc/set_error.c: Likewise. * linux/powerpc/set_scno.c: Likewise. * linux/powerpc64/set_error.c: Likewise. * linux/powerpc64/set_scno.c: Likewise. * linux/riscv/set_error.c: Likewise. * linux/riscv/set_scno.c: Likewise. * linux/s390/set_error.c: Likewise. * linux/s390/set_scno.c: Likewise. * linux/s390x/set_error.c: Likewise. * linux/s390x/set_scno.c: Likewise. * linux/sh/set_error.c: Likewise. * linux/sh/set_scno.c: Likewise. * linux/sh64/set_error.c: Likewise. * linux/sh64/set_scno.c: Likewise. * linux/sparc/set_error.c: Likewise. * linux/sparc/set_scno.c: Likewise. * linux/sparc64/set_error.c: Likewise. * linux/sparc64/set_scno.c: Likewise. * linux/tile/set_error.c: Likewise. * linux/tile/set_scno.c: Likewise. * linux/x32/set_error.c: Likewise. * linux/x32/set_scno.c: Likewise. * linux/x86_64/set_error.c: Likewise. * linux/x86_64/set_scno.c: Likewise. * linux/xtensa/set_error.c: Likewise. * linux/xtensa/set_scno.c: Likewise. * Makefile.am (EXTRA_DIST): Add them.
2016-11-15 20:38:21 +03:00
linux/sh/set_error.c \
linux/sh/set_scno.c \
linux/sh/syscallent.h \
linux/sh/userent.h \
linux/sh/userent0.h \
linux/sh64/arch_regs.c \
linux/sh64/arch_regs.h \
linux/sh64/get_error.c \
linux/sh64/get_scno.c \
linux/sh64/get_syscall_args.c \
linux/sh64/get_syscall_result.c \
ioctl: take all 32 bits of ioctl commands into account Historically, only 16 bits (8-bit number and 8-bit type) of 32-bit ioctl commands were used for decoding, which was the source for numerous annoying collisions like this: ioctl(0, SNDCTL_TMR_TIMEBASE or SNDRV_TIMER_IOCTL_NEXT_DEVICE or TCGETS, {B38400 opost isig icanon echo ...}) = 0 ioctl(0, MGSL_IOCGPARAMS or MMTIMER_GETRES or MTIOCTOP or SNDCTL_MIDI_MPUMODE, 0x7fffd47f7338) = -1 ENOTTY (Inappropriate ioctl for device) The solution is to use all 32 bits for decoding, not just "number" and "type", but also "size" and "direction". As some architectures override defaults that come from asm-generic/ and provide alternative definitions for some ioctl commands, we support per-architecture ioctl definitions and merge them with common definitions at build time. During the merge, we used to keep both generic and architecture-specific definitions, now architecture-specific definitions have precedence over generic ones -- ioctlsort omits definitions from asm-generic/ for those ioctl names that have different definitions in asm/. Additional bits of "direction" are architecture specific -- the number of bits and their values differ between architectures. To reduce architecture differences in the source code, we keep "direction" in symbolic form and compile it in ioctlsort. Additional bits of "size" are also architecture specific -- not only the number of bits differ between architectures, but sizes of many types depend on sizeof(long). To reduce architecture differences in the source code, we keep 32-bit and 64-bit versions of common ioctl definitions, and use the appropriate version for each architecture and personality. To implement this, the tools for generating ioctl definitions from kernel headers have been rewritten, and the source format of ioctl definitions has been extended. The final ioctlent*.h files that are included by syscall.c are now generated from source ioctls_inc*.h and ioctls_arch*.h files at build time with ioctlsort. * ioctl.c (ioctl_lookup): Use all 32 bits of ioctl command code. * ioctlsort.c: Rewritten. * linux/32/ioctls_inc.h: New file. * linux/64/ioctls_inc.h: New file. * linux/aarch64/ioctls_arch0.h: New file. * linux/aarch64/ioctls_arch1.h: New file. * linux/aarch64/ioctls_inc0.h: New file. * linux/aarch64/ioctls_inc1.h: New file. * linux/alpha/ioctls_arch0.h: New file. * linux/alpha/ioctls_inc0.h: New file. * linux/arc/ioctls_arch0.h: New file. * linux/arc/ioctls_inc0.h: New file. * linux/arm/ioctls_arch0.h: New file. * linux/arm/ioctls_inc0.h: New file. * linux/avr32/ioctls_arch0.h: New file. * linux/avr32/ioctls_inc0.h: New file. * linux/bfin/ioctls_arch0.h: New file. * linux/bfin/ioctls_inc0.h: New file. * linux/hppa/ioctls_arch0.h: New file. * linux/hppa/ioctls_inc0.h: New file. * linux/i386/ioctls_arch0.h: New file. * linux/i386/ioctls_inc0.h: New file. * linux/ia64/ioctls_arch0.h: New file. * linux/ia64/ioctls_inc0.h: New file. * linux/m68k/ioctls_arch0.h: New file. * linux/m68k/ioctls_inc0.h: New file. * linux/metag/ioctls_arch0.h: New file. * linux/metag/ioctls_inc0.h: New file. * linux/microblaze/ioctls_arch0.h: New file. * linux/microblaze/ioctls_inc0.h: New file. * linux/mips/ioctls_arch0.h: New file. * linux/mips/ioctls_inc0.h: New file. * linux/or1k/ioctls_arch0.h: New file. * linux/or1k/ioctls_inc0.h: New file. * linux/powerpc/ioctls_arch0.h: New file. * linux/powerpc/ioctls_inc0.h: New file. * linux/powerpc64/ioctls_arch0.h: New file. * linux/powerpc64/ioctls_arch1.h: New file. * linux/powerpc64/ioctls_inc0.h: New file. * linux/powerpc64/ioctls_inc1.h: New file. * linux/s390/ioctls_arch0.h: New file. * linux/s390/ioctls_inc0.h: New file. * linux/s390x/ioctls_arch0.h: New file. * linux/s390x/ioctls_inc0.h: New file. * linux/sh/ioctls_arch0.h: New file. * linux/sh/ioctls_inc0.h: New file. * linux/sh64/ioctls_arch0.h: New file. * linux/sh64/ioctls_inc0.h: New file. * linux/sparc/ioctls_arch0.h: New file. * linux/sparc/ioctls_inc0.h: New file. * linux/sparc64/ioctls_arch0.h: New file. * linux/sparc64/ioctls_arch2.h: New file. * linux/sparc64/ioctls_inc0.h: New file. * linux/sparc64/ioctls_inc2.h: New file. * linux/tile/ioctls_arch0.h: New file. * linux/tile/ioctls_arch1.h: New file. * linux/tile/ioctls_inc0.h: New file. * linux/tile/ioctls_inc1.h: New file. * linux/x32/ioctls_arch0.h: New file. * linux/x32/ioctls_arch1.h: New file. * linux/x32/ioctls_inc0.h: New file. * linux/x32/ioctls_inc1.h: New file. * linux/x86_64/ioctls_arch0.h: New file. * linux/x86_64/ioctls_arch1.h: New file. * linux/x86_64/ioctls_inc0.h: New file. * linux/x86_64/ioctls_inc1.h: New file. * linux/xtensa/ioctls_arch0.h: New file. * linux/xtensa/ioctls_inc0.h: New file. * linux/aarch64/ioctlent.h.in: Remove. * linux/aarch64/ioctlent1.h: Remove. * linux/alpha/ioctlent.h.in: Remove. * linux/arc/ioctlent.h.in: Remove. * linux/arm/ioctlent.h.in: Remove. * linux/avr32/ioctlent.h.in: Remove. * linux/bfin/ioctlent.h.in: Remove. * linux/hppa/ioctlent.h.in: Remove. * linux/i386/ioctlent.h.in: Remove. * linux/ia64/ioctlent.h.in: Remove. * linux/ioctlent.h.in: Remove. * linux/ioctlent.sh: Remove. * linux/m68k/ioctlent.h.in: Remove. * linux/metag/ioctlent.h.in: Remove. * linux/microblaze/ioctlent.h.in: Remove. * linux/mips/ioctlent.h.in: Remove. * linux/mips/ioctlent.sh: Remove. * linux/or1k/ioctlent.h.in: Remove. * linux/powerpc/ioctlent.h.in: Remove. * linux/powerpc64/ioctlent.h: Remove. * linux/powerpc64/ioctlent1.h: Remove. * linux/s390/ioctlent.h.in: Remove. * linux/s390x/ioctlent.h.in: Remove. * linux/sh/ioctlent.h.in: Remove. * linux/sh64/ioctlent.h.in: Remove. * linux/sparc/ioctlent.h.in: Remove. * linux/sparc64/ioctlent.h.in: Remove. * linux/sparc64/ioctlent2.h: Remove. * linux/tile/ioctlent.h.in: Remove. * linux/tile/ioctlent1.h: Remove. * linux/x32/ioctlent.h.in: Remove. * linux/x32/ioctlent1.h: Remove. * linux/x86_64/ioctlent.h.in: Remove. * linux/x86_64/ioctlent1.h: Remove. * linux/xtensa/ioctlent.h.in: Remove. * linux/x86_64/ioctlent2.h: Include ioctlent0.h instead of ioctlent.h. * syscall.c (struct_ioctlent ioctlent0): Likewise. * Makefile.am: Remove all ioctlent-related definitions. Define the list of ioctlent*.h files that have to be generated by presence of $(srcdir)/$(OS)/$(ARCH)/ioctls_inc*.h files. Add rules for ioctlent*.h files generation. (EXTRA_DIST): Update. * maint/ioctls_gen.sh: New file. * maint/ioctls_hex.sh: New file. * maint/ioctls_sym.sh: New file. * maint/print_ioctlent.c: New file. * HACKING-scripts: Update for ioctlent.sh -> ioctls_gen.sh migration. * .gitignore: Add ioctlent[012].h and ioctls_all[012].h. * configure.ac (AC_CHECK_HEADERS): Add linux/hiddev.h and linux/mmtimer.h for tests. * tests/ioctl.c: New file. * tests/ioctl.test: New test. * tests/Makefile.am (check_PROGRAMS): Add ioctl. (TESTS): Add ioctl.test. * tests/.gitignore: Add ioctl.
2015-01-19 20:02:16 +03:00
linux/sh64/ioctls_arch0.h \
linux/sh64/ioctls_inc0.h \
Implement arch specific methods of changing syscall number and error code This introduces arch_set_error and arch_set_scno functions for each supported architecture, needed to implement syscall fault injection. * linux/aarch64/set_error.c: New file. * linux/aarch64/set_scno.c: Likewise. * linux/alpha/set_error.c: Likewise. * linux/alpha/set_scno.c: Likewise. * linux/arc/set_error.c: Likewise. * linux/arc/set_scno.c: Likewise. * linux/arm/set_error.c: Likewise. * linux/arm/set_scno.c: Likewise. * linux/avr32/set_error.c: Likewise. * linux/avr32/set_scno.c: Likewise. * linux/bfin/set_error.c: Likewise. * linux/bfin/set_scno.c: Likewise. * linux/crisv10/set_error.c: Likewise. * linux/crisv10/set_scno.c: Likewise. * linux/crisv32/set_error.c: Likewise. * linux/crisv32/set_scno.c: Likewise. * linux/hppa/set_error.c: Likewise. * linux/hppa/set_scno.c: Likewise. * linux/i386/set_error.c: Likewise. * linux/i386/set_scno.c: Likewise. * linux/ia64/set_error.c: Likewise. * linux/ia64/set_scno.c: Likewise. * linux/m68k/set_error.c: Likewise. * linux/m68k/set_scno.c: Likewise. * linux/metag/set_error.c: Likewise. * linux/metag/set_scno.c: Likewise. * linux/microblaze/set_error.c: Likewise. * linux/microblaze/set_scno.c: Likewise. * linux/mips/set_error.c: Likewise. * linux/mips/set_scno.c: Likewise. * linux/nios2/set_error.c: Likewise. * linux/nios2/set_scno.c: Likewise. * linux/or1k/set_error.c: Likewise. * linux/or1k/set_scno.c: Likewise. * linux/powerpc/set_error.c: Likewise. * linux/powerpc/set_scno.c: Likewise. * linux/powerpc64/set_error.c: Likewise. * linux/powerpc64/set_scno.c: Likewise. * linux/riscv/set_error.c: Likewise. * linux/riscv/set_scno.c: Likewise. * linux/s390/set_error.c: Likewise. * linux/s390/set_scno.c: Likewise. * linux/s390x/set_error.c: Likewise. * linux/s390x/set_scno.c: Likewise. * linux/sh/set_error.c: Likewise. * linux/sh/set_scno.c: Likewise. * linux/sh64/set_error.c: Likewise. * linux/sh64/set_scno.c: Likewise. * linux/sparc/set_error.c: Likewise. * linux/sparc/set_scno.c: Likewise. * linux/sparc64/set_error.c: Likewise. * linux/sparc64/set_scno.c: Likewise. * linux/tile/set_error.c: Likewise. * linux/tile/set_scno.c: Likewise. * linux/x32/set_error.c: Likewise. * linux/x32/set_scno.c: Likewise. * linux/x86_64/set_error.c: Likewise. * linux/x86_64/set_scno.c: Likewise. * linux/xtensa/set_error.c: Likewise. * linux/xtensa/set_scno.c: Likewise. * Makefile.am (EXTRA_DIST): Add them.
2016-11-15 20:38:21 +03:00
linux/sh64/set_error.c \
linux/sh64/set_scno.c \
linux/sh64/syscallent.h \
linux/sh64/userent.h \
linux/signalent.h \
linux/sock_diag.h \
linux/sparc/arch_getrval2.c \
linux/sparc/arch_regs.c \
linux/sparc/arch_regs.h \
linux/sparc/arch_sigreturn.c \
linux/sparc/errnoent.h \
linux/sparc/gen.pl \
linux/sparc/get_error.c \
linux/sparc/get_scno.c \
linux/sparc/get_syscall_args.c \
ioctl: take all 32 bits of ioctl commands into account Historically, only 16 bits (8-bit number and 8-bit type) of 32-bit ioctl commands were used for decoding, which was the source for numerous annoying collisions like this: ioctl(0, SNDCTL_TMR_TIMEBASE or SNDRV_TIMER_IOCTL_NEXT_DEVICE or TCGETS, {B38400 opost isig icanon echo ...}) = 0 ioctl(0, MGSL_IOCGPARAMS or MMTIMER_GETRES or MTIOCTOP or SNDCTL_MIDI_MPUMODE, 0x7fffd47f7338) = -1 ENOTTY (Inappropriate ioctl for device) The solution is to use all 32 bits for decoding, not just "number" and "type", but also "size" and "direction". As some architectures override defaults that come from asm-generic/ and provide alternative definitions for some ioctl commands, we support per-architecture ioctl definitions and merge them with common definitions at build time. During the merge, we used to keep both generic and architecture-specific definitions, now architecture-specific definitions have precedence over generic ones -- ioctlsort omits definitions from asm-generic/ for those ioctl names that have different definitions in asm/. Additional bits of "direction" are architecture specific -- the number of bits and their values differ between architectures. To reduce architecture differences in the source code, we keep "direction" in symbolic form and compile it in ioctlsort. Additional bits of "size" are also architecture specific -- not only the number of bits differ between architectures, but sizes of many types depend on sizeof(long). To reduce architecture differences in the source code, we keep 32-bit and 64-bit versions of common ioctl definitions, and use the appropriate version for each architecture and personality. To implement this, the tools for generating ioctl definitions from kernel headers have been rewritten, and the source format of ioctl definitions has been extended. The final ioctlent*.h files that are included by syscall.c are now generated from source ioctls_inc*.h and ioctls_arch*.h files at build time with ioctlsort. * ioctl.c (ioctl_lookup): Use all 32 bits of ioctl command code. * ioctlsort.c: Rewritten. * linux/32/ioctls_inc.h: New file. * linux/64/ioctls_inc.h: New file. * linux/aarch64/ioctls_arch0.h: New file. * linux/aarch64/ioctls_arch1.h: New file. * linux/aarch64/ioctls_inc0.h: New file. * linux/aarch64/ioctls_inc1.h: New file. * linux/alpha/ioctls_arch0.h: New file. * linux/alpha/ioctls_inc0.h: New file. * linux/arc/ioctls_arch0.h: New file. * linux/arc/ioctls_inc0.h: New file. * linux/arm/ioctls_arch0.h: New file. * linux/arm/ioctls_inc0.h: New file. * linux/avr32/ioctls_arch0.h: New file. * linux/avr32/ioctls_inc0.h: New file. * linux/bfin/ioctls_arch0.h: New file. * linux/bfin/ioctls_inc0.h: New file. * linux/hppa/ioctls_arch0.h: New file. * linux/hppa/ioctls_inc0.h: New file. * linux/i386/ioctls_arch0.h: New file. * linux/i386/ioctls_inc0.h: New file. * linux/ia64/ioctls_arch0.h: New file. * linux/ia64/ioctls_inc0.h: New file. * linux/m68k/ioctls_arch0.h: New file. * linux/m68k/ioctls_inc0.h: New file. * linux/metag/ioctls_arch0.h: New file. * linux/metag/ioctls_inc0.h: New file. * linux/microblaze/ioctls_arch0.h: New file. * linux/microblaze/ioctls_inc0.h: New file. * linux/mips/ioctls_arch0.h: New file. * linux/mips/ioctls_inc0.h: New file. * linux/or1k/ioctls_arch0.h: New file. * linux/or1k/ioctls_inc0.h: New file. * linux/powerpc/ioctls_arch0.h: New file. * linux/powerpc/ioctls_inc0.h: New file. * linux/powerpc64/ioctls_arch0.h: New file. * linux/powerpc64/ioctls_arch1.h: New file. * linux/powerpc64/ioctls_inc0.h: New file. * linux/powerpc64/ioctls_inc1.h: New file. * linux/s390/ioctls_arch0.h: New file. * linux/s390/ioctls_inc0.h: New file. * linux/s390x/ioctls_arch0.h: New file. * linux/s390x/ioctls_inc0.h: New file. * linux/sh/ioctls_arch0.h: New file. * linux/sh/ioctls_inc0.h: New file. * linux/sh64/ioctls_arch0.h: New file. * linux/sh64/ioctls_inc0.h: New file. * linux/sparc/ioctls_arch0.h: New file. * linux/sparc/ioctls_inc0.h: New file. * linux/sparc64/ioctls_arch0.h: New file. * linux/sparc64/ioctls_arch2.h: New file. * linux/sparc64/ioctls_inc0.h: New file. * linux/sparc64/ioctls_inc2.h: New file. * linux/tile/ioctls_arch0.h: New file. * linux/tile/ioctls_arch1.h: New file. * linux/tile/ioctls_inc0.h: New file. * linux/tile/ioctls_inc1.h: New file. * linux/x32/ioctls_arch0.h: New file. * linux/x32/ioctls_arch1.h: New file. * linux/x32/ioctls_inc0.h: New file. * linux/x32/ioctls_inc1.h: New file. * linux/x86_64/ioctls_arch0.h: New file. * linux/x86_64/ioctls_arch1.h: New file. * linux/x86_64/ioctls_inc0.h: New file. * linux/x86_64/ioctls_inc1.h: New file. * linux/xtensa/ioctls_arch0.h: New file. * linux/xtensa/ioctls_inc0.h: New file. * linux/aarch64/ioctlent.h.in: Remove. * linux/aarch64/ioctlent1.h: Remove. * linux/alpha/ioctlent.h.in: Remove. * linux/arc/ioctlent.h.in: Remove. * linux/arm/ioctlent.h.in: Remove. * linux/avr32/ioctlent.h.in: Remove. * linux/bfin/ioctlent.h.in: Remove. * linux/hppa/ioctlent.h.in: Remove. * linux/i386/ioctlent.h.in: Remove. * linux/ia64/ioctlent.h.in: Remove. * linux/ioctlent.h.in: Remove. * linux/ioctlent.sh: Remove. * linux/m68k/ioctlent.h.in: Remove. * linux/metag/ioctlent.h.in: Remove. * linux/microblaze/ioctlent.h.in: Remove. * linux/mips/ioctlent.h.in: Remove. * linux/mips/ioctlent.sh: Remove. * linux/or1k/ioctlent.h.in: Remove. * linux/powerpc/ioctlent.h.in: Remove. * linux/powerpc64/ioctlent.h: Remove. * linux/powerpc64/ioctlent1.h: Remove. * linux/s390/ioctlent.h.in: Remove. * linux/s390x/ioctlent.h.in: Remove. * linux/sh/ioctlent.h.in: Remove. * linux/sh64/ioctlent.h.in: Remove. * linux/sparc/ioctlent.h.in: Remove. * linux/sparc64/ioctlent.h.in: Remove. * linux/sparc64/ioctlent2.h: Remove. * linux/tile/ioctlent.h.in: Remove. * linux/tile/ioctlent1.h: Remove. * linux/x32/ioctlent.h.in: Remove. * linux/x32/ioctlent1.h: Remove. * linux/x86_64/ioctlent.h.in: Remove. * linux/x86_64/ioctlent1.h: Remove. * linux/xtensa/ioctlent.h.in: Remove. * linux/x86_64/ioctlent2.h: Include ioctlent0.h instead of ioctlent.h. * syscall.c (struct_ioctlent ioctlent0): Likewise. * Makefile.am: Remove all ioctlent-related definitions. Define the list of ioctlent*.h files that have to be generated by presence of $(srcdir)/$(OS)/$(ARCH)/ioctls_inc*.h files. Add rules for ioctlent*.h files generation. (EXTRA_DIST): Update. * maint/ioctls_gen.sh: New file. * maint/ioctls_hex.sh: New file. * maint/ioctls_sym.sh: New file. * maint/print_ioctlent.c: New file. * HACKING-scripts: Update for ioctlent.sh -> ioctls_gen.sh migration. * .gitignore: Add ioctlent[012].h and ioctls_all[012].h. * configure.ac (AC_CHECK_HEADERS): Add linux/hiddev.h and linux/mmtimer.h for tests. * tests/ioctl.c: New file. * tests/ioctl.test: New test. * tests/Makefile.am (check_PROGRAMS): Add ioctl. (TESTS): Add ioctl.test. * tests/.gitignore: Add ioctl.
2015-01-19 20:02:16 +03:00
linux/sparc/ioctls_arch0.h \
linux/sparc/ioctls_inc0.h \
Implement arch specific methods of changing syscall number and error code This introduces arch_set_error and arch_set_scno functions for each supported architecture, needed to implement syscall fault injection. * linux/aarch64/set_error.c: New file. * linux/aarch64/set_scno.c: Likewise. * linux/alpha/set_error.c: Likewise. * linux/alpha/set_scno.c: Likewise. * linux/arc/set_error.c: Likewise. * linux/arc/set_scno.c: Likewise. * linux/arm/set_error.c: Likewise. * linux/arm/set_scno.c: Likewise. * linux/avr32/set_error.c: Likewise. * linux/avr32/set_scno.c: Likewise. * linux/bfin/set_error.c: Likewise. * linux/bfin/set_scno.c: Likewise. * linux/crisv10/set_error.c: Likewise. * linux/crisv10/set_scno.c: Likewise. * linux/crisv32/set_error.c: Likewise. * linux/crisv32/set_scno.c: Likewise. * linux/hppa/set_error.c: Likewise. * linux/hppa/set_scno.c: Likewise. * linux/i386/set_error.c: Likewise. * linux/i386/set_scno.c: Likewise. * linux/ia64/set_error.c: Likewise. * linux/ia64/set_scno.c: Likewise. * linux/m68k/set_error.c: Likewise. * linux/m68k/set_scno.c: Likewise. * linux/metag/set_error.c: Likewise. * linux/metag/set_scno.c: Likewise. * linux/microblaze/set_error.c: Likewise. * linux/microblaze/set_scno.c: Likewise. * linux/mips/set_error.c: Likewise. * linux/mips/set_scno.c: Likewise. * linux/nios2/set_error.c: Likewise. * linux/nios2/set_scno.c: Likewise. * linux/or1k/set_error.c: Likewise. * linux/or1k/set_scno.c: Likewise. * linux/powerpc/set_error.c: Likewise. * linux/powerpc/set_scno.c: Likewise. * linux/powerpc64/set_error.c: Likewise. * linux/powerpc64/set_scno.c: Likewise. * linux/riscv/set_error.c: Likewise. * linux/riscv/set_scno.c: Likewise. * linux/s390/set_error.c: Likewise. * linux/s390/set_scno.c: Likewise. * linux/s390x/set_error.c: Likewise. * linux/s390x/set_scno.c: Likewise. * linux/sh/set_error.c: Likewise. * linux/sh/set_scno.c: Likewise. * linux/sh64/set_error.c: Likewise. * linux/sh64/set_scno.c: Likewise. * linux/sparc/set_error.c: Likewise. * linux/sparc/set_scno.c: Likewise. * linux/sparc64/set_error.c: Likewise. * linux/sparc64/set_scno.c: Likewise. * linux/tile/set_error.c: Likewise. * linux/tile/set_scno.c: Likewise. * linux/x32/set_error.c: Likewise. * linux/x32/set_scno.c: Likewise. * linux/x86_64/set_error.c: Likewise. * linux/x86_64/set_scno.c: Likewise. * linux/xtensa/set_error.c: Likewise. * linux/xtensa/set_scno.c: Likewise. * Makefile.am (EXTRA_DIST): Add them.
2016-11-15 20:38:21 +03:00
linux/sparc/set_error.c \
linux/sparc/set_scno.c \
linux/sparc/signalent.h \
linux/sparc/syscallent.h \
linux/sparc/userent.h \
linux/sparc64/arch_getrval2.c \
linux/sparc64/arch_regs.c \
linux/sparc64/arch_regs.h \
linux/sparc64/arch_sigreturn.c \
linux/sparc64/errnoent.h \
linux/sparc64/errnoent1.h \
linux/sparc64/get_error.c \
linux/sparc64/get_scno.c \
linux/sparc64/get_syscall_args.c\
ioctl: take all 32 bits of ioctl commands into account Historically, only 16 bits (8-bit number and 8-bit type) of 32-bit ioctl commands were used for decoding, which was the source for numerous annoying collisions like this: ioctl(0, SNDCTL_TMR_TIMEBASE or SNDRV_TIMER_IOCTL_NEXT_DEVICE or TCGETS, {B38400 opost isig icanon echo ...}) = 0 ioctl(0, MGSL_IOCGPARAMS or MMTIMER_GETRES or MTIOCTOP or SNDCTL_MIDI_MPUMODE, 0x7fffd47f7338) = -1 ENOTTY (Inappropriate ioctl for device) The solution is to use all 32 bits for decoding, not just "number" and "type", but also "size" and "direction". As some architectures override defaults that come from asm-generic/ and provide alternative definitions for some ioctl commands, we support per-architecture ioctl definitions and merge them with common definitions at build time. During the merge, we used to keep both generic and architecture-specific definitions, now architecture-specific definitions have precedence over generic ones -- ioctlsort omits definitions from asm-generic/ for those ioctl names that have different definitions in asm/. Additional bits of "direction" are architecture specific -- the number of bits and their values differ between architectures. To reduce architecture differences in the source code, we keep "direction" in symbolic form and compile it in ioctlsort. Additional bits of "size" are also architecture specific -- not only the number of bits differ between architectures, but sizes of many types depend on sizeof(long). To reduce architecture differences in the source code, we keep 32-bit and 64-bit versions of common ioctl definitions, and use the appropriate version for each architecture and personality. To implement this, the tools for generating ioctl definitions from kernel headers have been rewritten, and the source format of ioctl definitions has been extended. The final ioctlent*.h files that are included by syscall.c are now generated from source ioctls_inc*.h and ioctls_arch*.h files at build time with ioctlsort. * ioctl.c (ioctl_lookup): Use all 32 bits of ioctl command code. * ioctlsort.c: Rewritten. * linux/32/ioctls_inc.h: New file. * linux/64/ioctls_inc.h: New file. * linux/aarch64/ioctls_arch0.h: New file. * linux/aarch64/ioctls_arch1.h: New file. * linux/aarch64/ioctls_inc0.h: New file. * linux/aarch64/ioctls_inc1.h: New file. * linux/alpha/ioctls_arch0.h: New file. * linux/alpha/ioctls_inc0.h: New file. * linux/arc/ioctls_arch0.h: New file. * linux/arc/ioctls_inc0.h: New file. * linux/arm/ioctls_arch0.h: New file. * linux/arm/ioctls_inc0.h: New file. * linux/avr32/ioctls_arch0.h: New file. * linux/avr32/ioctls_inc0.h: New file. * linux/bfin/ioctls_arch0.h: New file. * linux/bfin/ioctls_inc0.h: New file. * linux/hppa/ioctls_arch0.h: New file. * linux/hppa/ioctls_inc0.h: New file. * linux/i386/ioctls_arch0.h: New file. * linux/i386/ioctls_inc0.h: New file. * linux/ia64/ioctls_arch0.h: New file. * linux/ia64/ioctls_inc0.h: New file. * linux/m68k/ioctls_arch0.h: New file. * linux/m68k/ioctls_inc0.h: New file. * linux/metag/ioctls_arch0.h: New file. * linux/metag/ioctls_inc0.h: New file. * linux/microblaze/ioctls_arch0.h: New file. * linux/microblaze/ioctls_inc0.h: New file. * linux/mips/ioctls_arch0.h: New file. * linux/mips/ioctls_inc0.h: New file. * linux/or1k/ioctls_arch0.h: New file. * linux/or1k/ioctls_inc0.h: New file. * linux/powerpc/ioctls_arch0.h: New file. * linux/powerpc/ioctls_inc0.h: New file. * linux/powerpc64/ioctls_arch0.h: New file. * linux/powerpc64/ioctls_arch1.h: New file. * linux/powerpc64/ioctls_inc0.h: New file. * linux/powerpc64/ioctls_inc1.h: New file. * linux/s390/ioctls_arch0.h: New file. * linux/s390/ioctls_inc0.h: New file. * linux/s390x/ioctls_arch0.h: New file. * linux/s390x/ioctls_inc0.h: New file. * linux/sh/ioctls_arch0.h: New file. * linux/sh/ioctls_inc0.h: New file. * linux/sh64/ioctls_arch0.h: New file. * linux/sh64/ioctls_inc0.h: New file. * linux/sparc/ioctls_arch0.h: New file. * linux/sparc/ioctls_inc0.h: New file. * linux/sparc64/ioctls_arch0.h: New file. * linux/sparc64/ioctls_arch2.h: New file. * linux/sparc64/ioctls_inc0.h: New file. * linux/sparc64/ioctls_inc2.h: New file. * linux/tile/ioctls_arch0.h: New file. * linux/tile/ioctls_arch1.h: New file. * linux/tile/ioctls_inc0.h: New file. * linux/tile/ioctls_inc1.h: New file. * linux/x32/ioctls_arch0.h: New file. * linux/x32/ioctls_arch1.h: New file. * linux/x32/ioctls_inc0.h: New file. * linux/x32/ioctls_inc1.h: New file. * linux/x86_64/ioctls_arch0.h: New file. * linux/x86_64/ioctls_arch1.h: New file. * linux/x86_64/ioctls_inc0.h: New file. * linux/x86_64/ioctls_inc1.h: New file. * linux/xtensa/ioctls_arch0.h: New file. * linux/xtensa/ioctls_inc0.h: New file. * linux/aarch64/ioctlent.h.in: Remove. * linux/aarch64/ioctlent1.h: Remove. * linux/alpha/ioctlent.h.in: Remove. * linux/arc/ioctlent.h.in: Remove. * linux/arm/ioctlent.h.in: Remove. * linux/avr32/ioctlent.h.in: Remove. * linux/bfin/ioctlent.h.in: Remove. * linux/hppa/ioctlent.h.in: Remove. * linux/i386/ioctlent.h.in: Remove. * linux/ia64/ioctlent.h.in: Remove. * linux/ioctlent.h.in: Remove. * linux/ioctlent.sh: Remove. * linux/m68k/ioctlent.h.in: Remove. * linux/metag/ioctlent.h.in: Remove. * linux/microblaze/ioctlent.h.in: Remove. * linux/mips/ioctlent.h.in: Remove. * linux/mips/ioctlent.sh: Remove. * linux/or1k/ioctlent.h.in: Remove. * linux/powerpc/ioctlent.h.in: Remove. * linux/powerpc64/ioctlent.h: Remove. * linux/powerpc64/ioctlent1.h: Remove. * linux/s390/ioctlent.h.in: Remove. * linux/s390x/ioctlent.h.in: Remove. * linux/sh/ioctlent.h.in: Remove. * linux/sh64/ioctlent.h.in: Remove. * linux/sparc/ioctlent.h.in: Remove. * linux/sparc64/ioctlent.h.in: Remove. * linux/sparc64/ioctlent2.h: Remove. * linux/tile/ioctlent.h.in: Remove. * linux/tile/ioctlent1.h: Remove. * linux/x32/ioctlent.h.in: Remove. * linux/x32/ioctlent1.h: Remove. * linux/x86_64/ioctlent.h.in: Remove. * linux/x86_64/ioctlent1.h: Remove. * linux/xtensa/ioctlent.h.in: Remove. * linux/x86_64/ioctlent2.h: Include ioctlent0.h instead of ioctlent.h. * syscall.c (struct_ioctlent ioctlent0): Likewise. * Makefile.am: Remove all ioctlent-related definitions. Define the list of ioctlent*.h files that have to be generated by presence of $(srcdir)/$(OS)/$(ARCH)/ioctls_inc*.h files. Add rules for ioctlent*.h files generation. (EXTRA_DIST): Update. * maint/ioctls_gen.sh: New file. * maint/ioctls_hex.sh: New file. * maint/ioctls_sym.sh: New file. * maint/print_ioctlent.c: New file. * HACKING-scripts: Update for ioctlent.sh -> ioctls_gen.sh migration. * .gitignore: Add ioctlent[012].h and ioctls_all[012].h. * configure.ac (AC_CHECK_HEADERS): Add linux/hiddev.h and linux/mmtimer.h for tests. * tests/ioctl.c: New file. * tests/ioctl.test: New test. * tests/Makefile.am (check_PROGRAMS): Add ioctl. (TESTS): Add ioctl.test. * tests/.gitignore: Add ioctl.
2015-01-19 20:02:16 +03:00
linux/sparc64/ioctls_arch0.h \
linux/sparc64/ioctls_arch1.h \
ioctl: take all 32 bits of ioctl commands into account Historically, only 16 bits (8-bit number and 8-bit type) of 32-bit ioctl commands were used for decoding, which was the source for numerous annoying collisions like this: ioctl(0, SNDCTL_TMR_TIMEBASE or SNDRV_TIMER_IOCTL_NEXT_DEVICE or TCGETS, {B38400 opost isig icanon echo ...}) = 0 ioctl(0, MGSL_IOCGPARAMS or MMTIMER_GETRES or MTIOCTOP or SNDCTL_MIDI_MPUMODE, 0x7fffd47f7338) = -1 ENOTTY (Inappropriate ioctl for device) The solution is to use all 32 bits for decoding, not just "number" and "type", but also "size" and "direction". As some architectures override defaults that come from asm-generic/ and provide alternative definitions for some ioctl commands, we support per-architecture ioctl definitions and merge them with common definitions at build time. During the merge, we used to keep both generic and architecture-specific definitions, now architecture-specific definitions have precedence over generic ones -- ioctlsort omits definitions from asm-generic/ for those ioctl names that have different definitions in asm/. Additional bits of "direction" are architecture specific -- the number of bits and their values differ between architectures. To reduce architecture differences in the source code, we keep "direction" in symbolic form and compile it in ioctlsort. Additional bits of "size" are also architecture specific -- not only the number of bits differ between architectures, but sizes of many types depend on sizeof(long). To reduce architecture differences in the source code, we keep 32-bit and 64-bit versions of common ioctl definitions, and use the appropriate version for each architecture and personality. To implement this, the tools for generating ioctl definitions from kernel headers have been rewritten, and the source format of ioctl definitions has been extended. The final ioctlent*.h files that are included by syscall.c are now generated from source ioctls_inc*.h and ioctls_arch*.h files at build time with ioctlsort. * ioctl.c (ioctl_lookup): Use all 32 bits of ioctl command code. * ioctlsort.c: Rewritten. * linux/32/ioctls_inc.h: New file. * linux/64/ioctls_inc.h: New file. * linux/aarch64/ioctls_arch0.h: New file. * linux/aarch64/ioctls_arch1.h: New file. * linux/aarch64/ioctls_inc0.h: New file. * linux/aarch64/ioctls_inc1.h: New file. * linux/alpha/ioctls_arch0.h: New file. * linux/alpha/ioctls_inc0.h: New file. * linux/arc/ioctls_arch0.h: New file. * linux/arc/ioctls_inc0.h: New file. * linux/arm/ioctls_arch0.h: New file. * linux/arm/ioctls_inc0.h: New file. * linux/avr32/ioctls_arch0.h: New file. * linux/avr32/ioctls_inc0.h: New file. * linux/bfin/ioctls_arch0.h: New file. * linux/bfin/ioctls_inc0.h: New file. * linux/hppa/ioctls_arch0.h: New file. * linux/hppa/ioctls_inc0.h: New file. * linux/i386/ioctls_arch0.h: New file. * linux/i386/ioctls_inc0.h: New file. * linux/ia64/ioctls_arch0.h: New file. * linux/ia64/ioctls_inc0.h: New file. * linux/m68k/ioctls_arch0.h: New file. * linux/m68k/ioctls_inc0.h: New file. * linux/metag/ioctls_arch0.h: New file. * linux/metag/ioctls_inc0.h: New file. * linux/microblaze/ioctls_arch0.h: New file. * linux/microblaze/ioctls_inc0.h: New file. * linux/mips/ioctls_arch0.h: New file. * linux/mips/ioctls_inc0.h: New file. * linux/or1k/ioctls_arch0.h: New file. * linux/or1k/ioctls_inc0.h: New file. * linux/powerpc/ioctls_arch0.h: New file. * linux/powerpc/ioctls_inc0.h: New file. * linux/powerpc64/ioctls_arch0.h: New file. * linux/powerpc64/ioctls_arch1.h: New file. * linux/powerpc64/ioctls_inc0.h: New file. * linux/powerpc64/ioctls_inc1.h: New file. * linux/s390/ioctls_arch0.h: New file. * linux/s390/ioctls_inc0.h: New file. * linux/s390x/ioctls_arch0.h: New file. * linux/s390x/ioctls_inc0.h: New file. * linux/sh/ioctls_arch0.h: New file. * linux/sh/ioctls_inc0.h: New file. * linux/sh64/ioctls_arch0.h: New file. * linux/sh64/ioctls_inc0.h: New file. * linux/sparc/ioctls_arch0.h: New file. * linux/sparc/ioctls_inc0.h: New file. * linux/sparc64/ioctls_arch0.h: New file. * linux/sparc64/ioctls_arch2.h: New file. * linux/sparc64/ioctls_inc0.h: New file. * linux/sparc64/ioctls_inc2.h: New file. * linux/tile/ioctls_arch0.h: New file. * linux/tile/ioctls_arch1.h: New file. * linux/tile/ioctls_inc0.h: New file. * linux/tile/ioctls_inc1.h: New file. * linux/x32/ioctls_arch0.h: New file. * linux/x32/ioctls_arch1.h: New file. * linux/x32/ioctls_inc0.h: New file. * linux/x32/ioctls_inc1.h: New file. * linux/x86_64/ioctls_arch0.h: New file. * linux/x86_64/ioctls_arch1.h: New file. * linux/x86_64/ioctls_inc0.h: New file. * linux/x86_64/ioctls_inc1.h: New file. * linux/xtensa/ioctls_arch0.h: New file. * linux/xtensa/ioctls_inc0.h: New file. * linux/aarch64/ioctlent.h.in: Remove. * linux/aarch64/ioctlent1.h: Remove. * linux/alpha/ioctlent.h.in: Remove. * linux/arc/ioctlent.h.in: Remove. * linux/arm/ioctlent.h.in: Remove. * linux/avr32/ioctlent.h.in: Remove. * linux/bfin/ioctlent.h.in: Remove. * linux/hppa/ioctlent.h.in: Remove. * linux/i386/ioctlent.h.in: Remove. * linux/ia64/ioctlent.h.in: Remove. * linux/ioctlent.h.in: Remove. * linux/ioctlent.sh: Remove. * linux/m68k/ioctlent.h.in: Remove. * linux/metag/ioctlent.h.in: Remove. * linux/microblaze/ioctlent.h.in: Remove. * linux/mips/ioctlent.h.in: Remove. * linux/mips/ioctlent.sh: Remove. * linux/or1k/ioctlent.h.in: Remove. * linux/powerpc/ioctlent.h.in: Remove. * linux/powerpc64/ioctlent.h: Remove. * linux/powerpc64/ioctlent1.h: Remove. * linux/s390/ioctlent.h.in: Remove. * linux/s390x/ioctlent.h.in: Remove. * linux/sh/ioctlent.h.in: Remove. * linux/sh64/ioctlent.h.in: Remove. * linux/sparc/ioctlent.h.in: Remove. * linux/sparc64/ioctlent.h.in: Remove. * linux/sparc64/ioctlent2.h: Remove. * linux/tile/ioctlent.h.in: Remove. * linux/tile/ioctlent1.h: Remove. * linux/x32/ioctlent.h.in: Remove. * linux/x32/ioctlent1.h: Remove. * linux/x86_64/ioctlent.h.in: Remove. * linux/x86_64/ioctlent1.h: Remove. * linux/xtensa/ioctlent.h.in: Remove. * linux/x86_64/ioctlent2.h: Include ioctlent0.h instead of ioctlent.h. * syscall.c (struct_ioctlent ioctlent0): Likewise. * Makefile.am: Remove all ioctlent-related definitions. Define the list of ioctlent*.h files that have to be generated by presence of $(srcdir)/$(OS)/$(ARCH)/ioctls_inc*.h files. Add rules for ioctlent*.h files generation. (EXTRA_DIST): Update. * maint/ioctls_gen.sh: New file. * maint/ioctls_hex.sh: New file. * maint/ioctls_sym.sh: New file. * maint/print_ioctlent.c: New file. * HACKING-scripts: Update for ioctlent.sh -> ioctls_gen.sh migration. * .gitignore: Add ioctlent[012].h and ioctls_all[012].h. * configure.ac (AC_CHECK_HEADERS): Add linux/hiddev.h and linux/mmtimer.h for tests. * tests/ioctl.c: New file. * tests/ioctl.test: New test. * tests/Makefile.am (check_PROGRAMS): Add ioctl. (TESTS): Add ioctl.test. * tests/.gitignore: Add ioctl.
2015-01-19 20:02:16 +03:00
linux/sparc64/ioctls_inc0.h \
linux/sparc64/ioctls_inc1.h \
Implement arch specific methods of changing syscall number and error code This introduces arch_set_error and arch_set_scno functions for each supported architecture, needed to implement syscall fault injection. * linux/aarch64/set_error.c: New file. * linux/aarch64/set_scno.c: Likewise. * linux/alpha/set_error.c: Likewise. * linux/alpha/set_scno.c: Likewise. * linux/arc/set_error.c: Likewise. * linux/arc/set_scno.c: Likewise. * linux/arm/set_error.c: Likewise. * linux/arm/set_scno.c: Likewise. * linux/avr32/set_error.c: Likewise. * linux/avr32/set_scno.c: Likewise. * linux/bfin/set_error.c: Likewise. * linux/bfin/set_scno.c: Likewise. * linux/crisv10/set_error.c: Likewise. * linux/crisv10/set_scno.c: Likewise. * linux/crisv32/set_error.c: Likewise. * linux/crisv32/set_scno.c: Likewise. * linux/hppa/set_error.c: Likewise. * linux/hppa/set_scno.c: Likewise. * linux/i386/set_error.c: Likewise. * linux/i386/set_scno.c: Likewise. * linux/ia64/set_error.c: Likewise. * linux/ia64/set_scno.c: Likewise. * linux/m68k/set_error.c: Likewise. * linux/m68k/set_scno.c: Likewise. * linux/metag/set_error.c: Likewise. * linux/metag/set_scno.c: Likewise. * linux/microblaze/set_error.c: Likewise. * linux/microblaze/set_scno.c: Likewise. * linux/mips/set_error.c: Likewise. * linux/mips/set_scno.c: Likewise. * linux/nios2/set_error.c: Likewise. * linux/nios2/set_scno.c: Likewise. * linux/or1k/set_error.c: Likewise. * linux/or1k/set_scno.c: Likewise. * linux/powerpc/set_error.c: Likewise. * linux/powerpc/set_scno.c: Likewise. * linux/powerpc64/set_error.c: Likewise. * linux/powerpc64/set_scno.c: Likewise. * linux/riscv/set_error.c: Likewise. * linux/riscv/set_scno.c: Likewise. * linux/s390/set_error.c: Likewise. * linux/s390/set_scno.c: Likewise. * linux/s390x/set_error.c: Likewise. * linux/s390x/set_scno.c: Likewise. * linux/sh/set_error.c: Likewise. * linux/sh/set_scno.c: Likewise. * linux/sh64/set_error.c: Likewise. * linux/sh64/set_scno.c: Likewise. * linux/sparc/set_error.c: Likewise. * linux/sparc/set_scno.c: Likewise. * linux/sparc64/set_error.c: Likewise. * linux/sparc64/set_scno.c: Likewise. * linux/tile/set_error.c: Likewise. * linux/tile/set_scno.c: Likewise. * linux/x32/set_error.c: Likewise. * linux/x32/set_scno.c: Likewise. * linux/x86_64/set_error.c: Likewise. * linux/x86_64/set_scno.c: Likewise. * linux/xtensa/set_error.c: Likewise. * linux/xtensa/set_scno.c: Likewise. * Makefile.am (EXTRA_DIST): Add them.
2016-11-15 20:38:21 +03:00
linux/sparc64/set_error.c \
linux/sparc64/set_scno.c \
linux/sparc64/signalent.h \
linux/sparc64/signalent1.h \
linux/sparc64/syscallent.h \
linux/sparc64/syscallent1.h \
linux/sparc64/userent.h \
linux/subcall.h \
linux/syscall.h \
linux/tile/arch_regs.c \
linux/tile/arch_regs.h \
linux/tile/arch_sigreturn.c \
linux/tile/errnoent1.h \
linux/tile/get_error.c \
linux/tile/get_scno.c \
linux/tile/get_syscall_args.c \
ioctl: take all 32 bits of ioctl commands into account Historically, only 16 bits (8-bit number and 8-bit type) of 32-bit ioctl commands were used for decoding, which was the source for numerous annoying collisions like this: ioctl(0, SNDCTL_TMR_TIMEBASE or SNDRV_TIMER_IOCTL_NEXT_DEVICE or TCGETS, {B38400 opost isig icanon echo ...}) = 0 ioctl(0, MGSL_IOCGPARAMS or MMTIMER_GETRES or MTIOCTOP or SNDCTL_MIDI_MPUMODE, 0x7fffd47f7338) = -1 ENOTTY (Inappropriate ioctl for device) The solution is to use all 32 bits for decoding, not just "number" and "type", but also "size" and "direction". As some architectures override defaults that come from asm-generic/ and provide alternative definitions for some ioctl commands, we support per-architecture ioctl definitions and merge them with common definitions at build time. During the merge, we used to keep both generic and architecture-specific definitions, now architecture-specific definitions have precedence over generic ones -- ioctlsort omits definitions from asm-generic/ for those ioctl names that have different definitions in asm/. Additional bits of "direction" are architecture specific -- the number of bits and their values differ between architectures. To reduce architecture differences in the source code, we keep "direction" in symbolic form and compile it in ioctlsort. Additional bits of "size" are also architecture specific -- not only the number of bits differ between architectures, but sizes of many types depend on sizeof(long). To reduce architecture differences in the source code, we keep 32-bit and 64-bit versions of common ioctl definitions, and use the appropriate version for each architecture and personality. To implement this, the tools for generating ioctl definitions from kernel headers have been rewritten, and the source format of ioctl definitions has been extended. The final ioctlent*.h files that are included by syscall.c are now generated from source ioctls_inc*.h and ioctls_arch*.h files at build time with ioctlsort. * ioctl.c (ioctl_lookup): Use all 32 bits of ioctl command code. * ioctlsort.c: Rewritten. * linux/32/ioctls_inc.h: New file. * linux/64/ioctls_inc.h: New file. * linux/aarch64/ioctls_arch0.h: New file. * linux/aarch64/ioctls_arch1.h: New file. * linux/aarch64/ioctls_inc0.h: New file. * linux/aarch64/ioctls_inc1.h: New file. * linux/alpha/ioctls_arch0.h: New file. * linux/alpha/ioctls_inc0.h: New file. * linux/arc/ioctls_arch0.h: New file. * linux/arc/ioctls_inc0.h: New file. * linux/arm/ioctls_arch0.h: New file. * linux/arm/ioctls_inc0.h: New file. * linux/avr32/ioctls_arch0.h: New file. * linux/avr32/ioctls_inc0.h: New file. * linux/bfin/ioctls_arch0.h: New file. * linux/bfin/ioctls_inc0.h: New file. * linux/hppa/ioctls_arch0.h: New file. * linux/hppa/ioctls_inc0.h: New file. * linux/i386/ioctls_arch0.h: New file. * linux/i386/ioctls_inc0.h: New file. * linux/ia64/ioctls_arch0.h: New file. * linux/ia64/ioctls_inc0.h: New file. * linux/m68k/ioctls_arch0.h: New file. * linux/m68k/ioctls_inc0.h: New file. * linux/metag/ioctls_arch0.h: New file. * linux/metag/ioctls_inc0.h: New file. * linux/microblaze/ioctls_arch0.h: New file. * linux/microblaze/ioctls_inc0.h: New file. * linux/mips/ioctls_arch0.h: New file. * linux/mips/ioctls_inc0.h: New file. * linux/or1k/ioctls_arch0.h: New file. * linux/or1k/ioctls_inc0.h: New file. * linux/powerpc/ioctls_arch0.h: New file. * linux/powerpc/ioctls_inc0.h: New file. * linux/powerpc64/ioctls_arch0.h: New file. * linux/powerpc64/ioctls_arch1.h: New file. * linux/powerpc64/ioctls_inc0.h: New file. * linux/powerpc64/ioctls_inc1.h: New file. * linux/s390/ioctls_arch0.h: New file. * linux/s390/ioctls_inc0.h: New file. * linux/s390x/ioctls_arch0.h: New file. * linux/s390x/ioctls_inc0.h: New file. * linux/sh/ioctls_arch0.h: New file. * linux/sh/ioctls_inc0.h: New file. * linux/sh64/ioctls_arch0.h: New file. * linux/sh64/ioctls_inc0.h: New file. * linux/sparc/ioctls_arch0.h: New file. * linux/sparc/ioctls_inc0.h: New file. * linux/sparc64/ioctls_arch0.h: New file. * linux/sparc64/ioctls_arch2.h: New file. * linux/sparc64/ioctls_inc0.h: New file. * linux/sparc64/ioctls_inc2.h: New file. * linux/tile/ioctls_arch0.h: New file. * linux/tile/ioctls_arch1.h: New file. * linux/tile/ioctls_inc0.h: New file. * linux/tile/ioctls_inc1.h: New file. * linux/x32/ioctls_arch0.h: New file. * linux/x32/ioctls_arch1.h: New file. * linux/x32/ioctls_inc0.h: New file. * linux/x32/ioctls_inc1.h: New file. * linux/x86_64/ioctls_arch0.h: New file. * linux/x86_64/ioctls_arch1.h: New file. * linux/x86_64/ioctls_inc0.h: New file. * linux/x86_64/ioctls_inc1.h: New file. * linux/xtensa/ioctls_arch0.h: New file. * linux/xtensa/ioctls_inc0.h: New file. * linux/aarch64/ioctlent.h.in: Remove. * linux/aarch64/ioctlent1.h: Remove. * linux/alpha/ioctlent.h.in: Remove. * linux/arc/ioctlent.h.in: Remove. * linux/arm/ioctlent.h.in: Remove. * linux/avr32/ioctlent.h.in: Remove. * linux/bfin/ioctlent.h.in: Remove. * linux/hppa/ioctlent.h.in: Remove. * linux/i386/ioctlent.h.in: Remove. * linux/ia64/ioctlent.h.in: Remove. * linux/ioctlent.h.in: Remove. * linux/ioctlent.sh: Remove. * linux/m68k/ioctlent.h.in: Remove. * linux/metag/ioctlent.h.in: Remove. * linux/microblaze/ioctlent.h.in: Remove. * linux/mips/ioctlent.h.in: Remove. * linux/mips/ioctlent.sh: Remove. * linux/or1k/ioctlent.h.in: Remove. * linux/powerpc/ioctlent.h.in: Remove. * linux/powerpc64/ioctlent.h: Remove. * linux/powerpc64/ioctlent1.h: Remove. * linux/s390/ioctlent.h.in: Remove. * linux/s390x/ioctlent.h.in: Remove. * linux/sh/ioctlent.h.in: Remove. * linux/sh64/ioctlent.h.in: Remove. * linux/sparc/ioctlent.h.in: Remove. * linux/sparc64/ioctlent.h.in: Remove. * linux/sparc64/ioctlent2.h: Remove. * linux/tile/ioctlent.h.in: Remove. * linux/tile/ioctlent1.h: Remove. * linux/x32/ioctlent.h.in: Remove. * linux/x32/ioctlent1.h: Remove. * linux/x86_64/ioctlent.h.in: Remove. * linux/x86_64/ioctlent1.h: Remove. * linux/xtensa/ioctlent.h.in: Remove. * linux/x86_64/ioctlent2.h: Include ioctlent0.h instead of ioctlent.h. * syscall.c (struct_ioctlent ioctlent0): Likewise. * Makefile.am: Remove all ioctlent-related definitions. Define the list of ioctlent*.h files that have to be generated by presence of $(srcdir)/$(OS)/$(ARCH)/ioctls_inc*.h files. Add rules for ioctlent*.h files generation. (EXTRA_DIST): Update. * maint/ioctls_gen.sh: New file. * maint/ioctls_hex.sh: New file. * maint/ioctls_sym.sh: New file. * maint/print_ioctlent.c: New file. * HACKING-scripts: Update for ioctlent.sh -> ioctls_gen.sh migration. * .gitignore: Add ioctlent[012].h and ioctls_all[012].h. * configure.ac (AC_CHECK_HEADERS): Add linux/hiddev.h and linux/mmtimer.h for tests. * tests/ioctl.c: New file. * tests/ioctl.test: New test. * tests/Makefile.am (check_PROGRAMS): Add ioctl. (TESTS): Add ioctl.test. * tests/.gitignore: Add ioctl.
2015-01-19 20:02:16 +03:00
linux/tile/ioctls_arch0.h \
linux/tile/ioctls_arch1.h \
linux/tile/ioctls_inc0.h \
linux/tile/ioctls_inc1.h \
Implement arch specific methods of changing syscall number and error code This introduces arch_set_error and arch_set_scno functions for each supported architecture, needed to implement syscall fault injection. * linux/aarch64/set_error.c: New file. * linux/aarch64/set_scno.c: Likewise. * linux/alpha/set_error.c: Likewise. * linux/alpha/set_scno.c: Likewise. * linux/arc/set_error.c: Likewise. * linux/arc/set_scno.c: Likewise. * linux/arm/set_error.c: Likewise. * linux/arm/set_scno.c: Likewise. * linux/avr32/set_error.c: Likewise. * linux/avr32/set_scno.c: Likewise. * linux/bfin/set_error.c: Likewise. * linux/bfin/set_scno.c: Likewise. * linux/crisv10/set_error.c: Likewise. * linux/crisv10/set_scno.c: Likewise. * linux/crisv32/set_error.c: Likewise. * linux/crisv32/set_scno.c: Likewise. * linux/hppa/set_error.c: Likewise. * linux/hppa/set_scno.c: Likewise. * linux/i386/set_error.c: Likewise. * linux/i386/set_scno.c: Likewise. * linux/ia64/set_error.c: Likewise. * linux/ia64/set_scno.c: Likewise. * linux/m68k/set_error.c: Likewise. * linux/m68k/set_scno.c: Likewise. * linux/metag/set_error.c: Likewise. * linux/metag/set_scno.c: Likewise. * linux/microblaze/set_error.c: Likewise. * linux/microblaze/set_scno.c: Likewise. * linux/mips/set_error.c: Likewise. * linux/mips/set_scno.c: Likewise. * linux/nios2/set_error.c: Likewise. * linux/nios2/set_scno.c: Likewise. * linux/or1k/set_error.c: Likewise. * linux/or1k/set_scno.c: Likewise. * linux/powerpc/set_error.c: Likewise. * linux/powerpc/set_scno.c: Likewise. * linux/powerpc64/set_error.c: Likewise. * linux/powerpc64/set_scno.c: Likewise. * linux/riscv/set_error.c: Likewise. * linux/riscv/set_scno.c: Likewise. * linux/s390/set_error.c: Likewise. * linux/s390/set_scno.c: Likewise. * linux/s390x/set_error.c: Likewise. * linux/s390x/set_scno.c: Likewise. * linux/sh/set_error.c: Likewise. * linux/sh/set_scno.c: Likewise. * linux/sh64/set_error.c: Likewise. * linux/sh64/set_scno.c: Likewise. * linux/sparc/set_error.c: Likewise. * linux/sparc/set_scno.c: Likewise. * linux/sparc64/set_error.c: Likewise. * linux/sparc64/set_scno.c: Likewise. * linux/tile/set_error.c: Likewise. * linux/tile/set_scno.c: Likewise. * linux/x32/set_error.c: Likewise. * linux/x32/set_scno.c: Likewise. * linux/x86_64/set_error.c: Likewise. * linux/x86_64/set_scno.c: Likewise. * linux/xtensa/set_error.c: Likewise. * linux/xtensa/set_scno.c: Likewise. * Makefile.am (EXTRA_DIST): Add them.
2016-11-15 20:38:21 +03:00
linux/tile/set_error.c \
linux/tile/set_scno.c \
linux/tile/signalent1.h \
linux/tile/syscallent.h \
linux/tile/syscallent1.h \
linux/tile/userent.h \
linux/ubi-user.h \
linux/unix_diag.h \
linux/userent.h \
linux/userent0.h \
linux/x32/arch_regs.c \
linux/x32/arch_regs.h \
linux/x32/arch_sigreturn.c \
linux/x32/errnoent1.h \
linux/x32/get_error.c \
linux/x32/get_scno.c \
linux/x32/get_syscall_args.c \
ioctl: take all 32 bits of ioctl commands into account Historically, only 16 bits (8-bit number and 8-bit type) of 32-bit ioctl commands were used for decoding, which was the source for numerous annoying collisions like this: ioctl(0, SNDCTL_TMR_TIMEBASE or SNDRV_TIMER_IOCTL_NEXT_DEVICE or TCGETS, {B38400 opost isig icanon echo ...}) = 0 ioctl(0, MGSL_IOCGPARAMS or MMTIMER_GETRES or MTIOCTOP or SNDCTL_MIDI_MPUMODE, 0x7fffd47f7338) = -1 ENOTTY (Inappropriate ioctl for device) The solution is to use all 32 bits for decoding, not just "number" and "type", but also "size" and "direction". As some architectures override defaults that come from asm-generic/ and provide alternative definitions for some ioctl commands, we support per-architecture ioctl definitions and merge them with common definitions at build time. During the merge, we used to keep both generic and architecture-specific definitions, now architecture-specific definitions have precedence over generic ones -- ioctlsort omits definitions from asm-generic/ for those ioctl names that have different definitions in asm/. Additional bits of "direction" are architecture specific -- the number of bits and their values differ between architectures. To reduce architecture differences in the source code, we keep "direction" in symbolic form and compile it in ioctlsort. Additional bits of "size" are also architecture specific -- not only the number of bits differ between architectures, but sizes of many types depend on sizeof(long). To reduce architecture differences in the source code, we keep 32-bit and 64-bit versions of common ioctl definitions, and use the appropriate version for each architecture and personality. To implement this, the tools for generating ioctl definitions from kernel headers have been rewritten, and the source format of ioctl definitions has been extended. The final ioctlent*.h files that are included by syscall.c are now generated from source ioctls_inc*.h and ioctls_arch*.h files at build time with ioctlsort. * ioctl.c (ioctl_lookup): Use all 32 bits of ioctl command code. * ioctlsort.c: Rewritten. * linux/32/ioctls_inc.h: New file. * linux/64/ioctls_inc.h: New file. * linux/aarch64/ioctls_arch0.h: New file. * linux/aarch64/ioctls_arch1.h: New file. * linux/aarch64/ioctls_inc0.h: New file. * linux/aarch64/ioctls_inc1.h: New file. * linux/alpha/ioctls_arch0.h: New file. * linux/alpha/ioctls_inc0.h: New file. * linux/arc/ioctls_arch0.h: New file. * linux/arc/ioctls_inc0.h: New file. * linux/arm/ioctls_arch0.h: New file. * linux/arm/ioctls_inc0.h: New file. * linux/avr32/ioctls_arch0.h: New file. * linux/avr32/ioctls_inc0.h: New file. * linux/bfin/ioctls_arch0.h: New file. * linux/bfin/ioctls_inc0.h: New file. * linux/hppa/ioctls_arch0.h: New file. * linux/hppa/ioctls_inc0.h: New file. * linux/i386/ioctls_arch0.h: New file. * linux/i386/ioctls_inc0.h: New file. * linux/ia64/ioctls_arch0.h: New file. * linux/ia64/ioctls_inc0.h: New file. * linux/m68k/ioctls_arch0.h: New file. * linux/m68k/ioctls_inc0.h: New file. * linux/metag/ioctls_arch0.h: New file. * linux/metag/ioctls_inc0.h: New file. * linux/microblaze/ioctls_arch0.h: New file. * linux/microblaze/ioctls_inc0.h: New file. * linux/mips/ioctls_arch0.h: New file. * linux/mips/ioctls_inc0.h: New file. * linux/or1k/ioctls_arch0.h: New file. * linux/or1k/ioctls_inc0.h: New file. * linux/powerpc/ioctls_arch0.h: New file. * linux/powerpc/ioctls_inc0.h: New file. * linux/powerpc64/ioctls_arch0.h: New file. * linux/powerpc64/ioctls_arch1.h: New file. * linux/powerpc64/ioctls_inc0.h: New file. * linux/powerpc64/ioctls_inc1.h: New file. * linux/s390/ioctls_arch0.h: New file. * linux/s390/ioctls_inc0.h: New file. * linux/s390x/ioctls_arch0.h: New file. * linux/s390x/ioctls_inc0.h: New file. * linux/sh/ioctls_arch0.h: New file. * linux/sh/ioctls_inc0.h: New file. * linux/sh64/ioctls_arch0.h: New file. * linux/sh64/ioctls_inc0.h: New file. * linux/sparc/ioctls_arch0.h: New file. * linux/sparc/ioctls_inc0.h: New file. * linux/sparc64/ioctls_arch0.h: New file. * linux/sparc64/ioctls_arch2.h: New file. * linux/sparc64/ioctls_inc0.h: New file. * linux/sparc64/ioctls_inc2.h: New file. * linux/tile/ioctls_arch0.h: New file. * linux/tile/ioctls_arch1.h: New file. * linux/tile/ioctls_inc0.h: New file. * linux/tile/ioctls_inc1.h: New file. * linux/x32/ioctls_arch0.h: New file. * linux/x32/ioctls_arch1.h: New file. * linux/x32/ioctls_inc0.h: New file. * linux/x32/ioctls_inc1.h: New file. * linux/x86_64/ioctls_arch0.h: New file. * linux/x86_64/ioctls_arch1.h: New file. * linux/x86_64/ioctls_inc0.h: New file. * linux/x86_64/ioctls_inc1.h: New file. * linux/xtensa/ioctls_arch0.h: New file. * linux/xtensa/ioctls_inc0.h: New file. * linux/aarch64/ioctlent.h.in: Remove. * linux/aarch64/ioctlent1.h: Remove. * linux/alpha/ioctlent.h.in: Remove. * linux/arc/ioctlent.h.in: Remove. * linux/arm/ioctlent.h.in: Remove. * linux/avr32/ioctlent.h.in: Remove. * linux/bfin/ioctlent.h.in: Remove. * linux/hppa/ioctlent.h.in: Remove. * linux/i386/ioctlent.h.in: Remove. * linux/ia64/ioctlent.h.in: Remove. * linux/ioctlent.h.in: Remove. * linux/ioctlent.sh: Remove. * linux/m68k/ioctlent.h.in: Remove. * linux/metag/ioctlent.h.in: Remove. * linux/microblaze/ioctlent.h.in: Remove. * linux/mips/ioctlent.h.in: Remove. * linux/mips/ioctlent.sh: Remove. * linux/or1k/ioctlent.h.in: Remove. * linux/powerpc/ioctlent.h.in: Remove. * linux/powerpc64/ioctlent.h: Remove. * linux/powerpc64/ioctlent1.h: Remove. * linux/s390/ioctlent.h.in: Remove. * linux/s390x/ioctlent.h.in: Remove. * linux/sh/ioctlent.h.in: Remove. * linux/sh64/ioctlent.h.in: Remove. * linux/sparc/ioctlent.h.in: Remove. * linux/sparc64/ioctlent.h.in: Remove. * linux/sparc64/ioctlent2.h: Remove. * linux/tile/ioctlent.h.in: Remove. * linux/tile/ioctlent1.h: Remove. * linux/x32/ioctlent.h.in: Remove. * linux/x32/ioctlent1.h: Remove. * linux/x86_64/ioctlent.h.in: Remove. * linux/x86_64/ioctlent1.h: Remove. * linux/xtensa/ioctlent.h.in: Remove. * linux/x86_64/ioctlent2.h: Include ioctlent0.h instead of ioctlent.h. * syscall.c (struct_ioctlent ioctlent0): Likewise. * Makefile.am: Remove all ioctlent-related definitions. Define the list of ioctlent*.h files that have to be generated by presence of $(srcdir)/$(OS)/$(ARCH)/ioctls_inc*.h files. Add rules for ioctlent*.h files generation. (EXTRA_DIST): Update. * maint/ioctls_gen.sh: New file. * maint/ioctls_hex.sh: New file. * maint/ioctls_sym.sh: New file. * maint/print_ioctlent.c: New file. * HACKING-scripts: Update for ioctlent.sh -> ioctls_gen.sh migration. * .gitignore: Add ioctlent[012].h and ioctls_all[012].h. * configure.ac (AC_CHECK_HEADERS): Add linux/hiddev.h and linux/mmtimer.h for tests. * tests/ioctl.c: New file. * tests/ioctl.test: New test. * tests/Makefile.am (check_PROGRAMS): Add ioctl. (TESTS): Add ioctl.test. * tests/.gitignore: Add ioctl.
2015-01-19 20:02:16 +03:00
linux/x32/ioctls_arch0.h \
linux/x32/ioctls_arch1.h \
linux/x32/ioctls_inc0.h \
linux/x32/ioctls_inc1.h \
Implement arch specific methods of changing syscall number and error code This introduces arch_set_error and arch_set_scno functions for each supported architecture, needed to implement syscall fault injection. * linux/aarch64/set_error.c: New file. * linux/aarch64/set_scno.c: Likewise. * linux/alpha/set_error.c: Likewise. * linux/alpha/set_scno.c: Likewise. * linux/arc/set_error.c: Likewise. * linux/arc/set_scno.c: Likewise. * linux/arm/set_error.c: Likewise. * linux/arm/set_scno.c: Likewise. * linux/avr32/set_error.c: Likewise. * linux/avr32/set_scno.c: Likewise. * linux/bfin/set_error.c: Likewise. * linux/bfin/set_scno.c: Likewise. * linux/crisv10/set_error.c: Likewise. * linux/crisv10/set_scno.c: Likewise. * linux/crisv32/set_error.c: Likewise. * linux/crisv32/set_scno.c: Likewise. * linux/hppa/set_error.c: Likewise. * linux/hppa/set_scno.c: Likewise. * linux/i386/set_error.c: Likewise. * linux/i386/set_scno.c: Likewise. * linux/ia64/set_error.c: Likewise. * linux/ia64/set_scno.c: Likewise. * linux/m68k/set_error.c: Likewise. * linux/m68k/set_scno.c: Likewise. * linux/metag/set_error.c: Likewise. * linux/metag/set_scno.c: Likewise. * linux/microblaze/set_error.c: Likewise. * linux/microblaze/set_scno.c: Likewise. * linux/mips/set_error.c: Likewise. * linux/mips/set_scno.c: Likewise. * linux/nios2/set_error.c: Likewise. * linux/nios2/set_scno.c: Likewise. * linux/or1k/set_error.c: Likewise. * linux/or1k/set_scno.c: Likewise. * linux/powerpc/set_error.c: Likewise. * linux/powerpc/set_scno.c: Likewise. * linux/powerpc64/set_error.c: Likewise. * linux/powerpc64/set_scno.c: Likewise. * linux/riscv/set_error.c: Likewise. * linux/riscv/set_scno.c: Likewise. * linux/s390/set_error.c: Likewise. * linux/s390/set_scno.c: Likewise. * linux/s390x/set_error.c: Likewise. * linux/s390x/set_scno.c: Likewise. * linux/sh/set_error.c: Likewise. * linux/sh/set_scno.c: Likewise. * linux/sh64/set_error.c: Likewise. * linux/sh64/set_scno.c: Likewise. * linux/sparc/set_error.c: Likewise. * linux/sparc/set_scno.c: Likewise. * linux/sparc64/set_error.c: Likewise. * linux/sparc64/set_scno.c: Likewise. * linux/tile/set_error.c: Likewise. * linux/tile/set_scno.c: Likewise. * linux/x32/set_error.c: Likewise. * linux/x32/set_scno.c: Likewise. * linux/x86_64/set_error.c: Likewise. * linux/x86_64/set_scno.c: Likewise. * linux/xtensa/set_error.c: Likewise. * linux/xtensa/set_scno.c: Likewise. * Makefile.am (EXTRA_DIST): Add them.
2016-11-15 20:38:21 +03:00
linux/x32/set_error.c \
linux/x32/set_scno.c \
linux/x32/signalent1.h \
linux/x32/syscallent.h \
linux/x32/syscallent1.h \
linux/x32/userent.h \
linux/x86_64/arch_regs.c \
linux/x86_64/arch_regs.h \
linux/x86_64/arch_sigreturn.c \
linux/x86_64/errnoent1.h \
linux/x86_64/errnoent2.h \
linux/x86_64/gentab.pl \
linux/x86_64/get_error.c \
linux/x86_64/get_scno.c \
linux/x86_64/get_syscall_args.c \
linux/x86_64/getregs_old.c \
linux/x86_64/getregs_old.h \
ioctl: take all 32 bits of ioctl commands into account Historically, only 16 bits (8-bit number and 8-bit type) of 32-bit ioctl commands were used for decoding, which was the source for numerous annoying collisions like this: ioctl(0, SNDCTL_TMR_TIMEBASE or SNDRV_TIMER_IOCTL_NEXT_DEVICE or TCGETS, {B38400 opost isig icanon echo ...}) = 0 ioctl(0, MGSL_IOCGPARAMS or MMTIMER_GETRES or MTIOCTOP or SNDCTL_MIDI_MPUMODE, 0x7fffd47f7338) = -1 ENOTTY (Inappropriate ioctl for device) The solution is to use all 32 bits for decoding, not just "number" and "type", but also "size" and "direction". As some architectures override defaults that come from asm-generic/ and provide alternative definitions for some ioctl commands, we support per-architecture ioctl definitions and merge them with common definitions at build time. During the merge, we used to keep both generic and architecture-specific definitions, now architecture-specific definitions have precedence over generic ones -- ioctlsort omits definitions from asm-generic/ for those ioctl names that have different definitions in asm/. Additional bits of "direction" are architecture specific -- the number of bits and their values differ between architectures. To reduce architecture differences in the source code, we keep "direction" in symbolic form and compile it in ioctlsort. Additional bits of "size" are also architecture specific -- not only the number of bits differ between architectures, but sizes of many types depend on sizeof(long). To reduce architecture differences in the source code, we keep 32-bit and 64-bit versions of common ioctl definitions, and use the appropriate version for each architecture and personality. To implement this, the tools for generating ioctl definitions from kernel headers have been rewritten, and the source format of ioctl definitions has been extended. The final ioctlent*.h files that are included by syscall.c are now generated from source ioctls_inc*.h and ioctls_arch*.h files at build time with ioctlsort. * ioctl.c (ioctl_lookup): Use all 32 bits of ioctl command code. * ioctlsort.c: Rewritten. * linux/32/ioctls_inc.h: New file. * linux/64/ioctls_inc.h: New file. * linux/aarch64/ioctls_arch0.h: New file. * linux/aarch64/ioctls_arch1.h: New file. * linux/aarch64/ioctls_inc0.h: New file. * linux/aarch64/ioctls_inc1.h: New file. * linux/alpha/ioctls_arch0.h: New file. * linux/alpha/ioctls_inc0.h: New file. * linux/arc/ioctls_arch0.h: New file. * linux/arc/ioctls_inc0.h: New file. * linux/arm/ioctls_arch0.h: New file. * linux/arm/ioctls_inc0.h: New file. * linux/avr32/ioctls_arch0.h: New file. * linux/avr32/ioctls_inc0.h: New file. * linux/bfin/ioctls_arch0.h: New file. * linux/bfin/ioctls_inc0.h: New file. * linux/hppa/ioctls_arch0.h: New file. * linux/hppa/ioctls_inc0.h: New file. * linux/i386/ioctls_arch0.h: New file. * linux/i386/ioctls_inc0.h: New file. * linux/ia64/ioctls_arch0.h: New file. * linux/ia64/ioctls_inc0.h: New file. * linux/m68k/ioctls_arch0.h: New file. * linux/m68k/ioctls_inc0.h: New file. * linux/metag/ioctls_arch0.h: New file. * linux/metag/ioctls_inc0.h: New file. * linux/microblaze/ioctls_arch0.h: New file. * linux/microblaze/ioctls_inc0.h: New file. * linux/mips/ioctls_arch0.h: New file. * linux/mips/ioctls_inc0.h: New file. * linux/or1k/ioctls_arch0.h: New file. * linux/or1k/ioctls_inc0.h: New file. * linux/powerpc/ioctls_arch0.h: New file. * linux/powerpc/ioctls_inc0.h: New file. * linux/powerpc64/ioctls_arch0.h: New file. * linux/powerpc64/ioctls_arch1.h: New file. * linux/powerpc64/ioctls_inc0.h: New file. * linux/powerpc64/ioctls_inc1.h: New file. * linux/s390/ioctls_arch0.h: New file. * linux/s390/ioctls_inc0.h: New file. * linux/s390x/ioctls_arch0.h: New file. * linux/s390x/ioctls_inc0.h: New file. * linux/sh/ioctls_arch0.h: New file. * linux/sh/ioctls_inc0.h: New file. * linux/sh64/ioctls_arch0.h: New file. * linux/sh64/ioctls_inc0.h: New file. * linux/sparc/ioctls_arch0.h: New file. * linux/sparc/ioctls_inc0.h: New file. * linux/sparc64/ioctls_arch0.h: New file. * linux/sparc64/ioctls_arch2.h: New file. * linux/sparc64/ioctls_inc0.h: New file. * linux/sparc64/ioctls_inc2.h: New file. * linux/tile/ioctls_arch0.h: New file. * linux/tile/ioctls_arch1.h: New file. * linux/tile/ioctls_inc0.h: New file. * linux/tile/ioctls_inc1.h: New file. * linux/x32/ioctls_arch0.h: New file. * linux/x32/ioctls_arch1.h: New file. * linux/x32/ioctls_inc0.h: New file. * linux/x32/ioctls_inc1.h: New file. * linux/x86_64/ioctls_arch0.h: New file. * linux/x86_64/ioctls_arch1.h: New file. * linux/x86_64/ioctls_inc0.h: New file. * linux/x86_64/ioctls_inc1.h: New file. * linux/xtensa/ioctls_arch0.h: New file. * linux/xtensa/ioctls_inc0.h: New file. * linux/aarch64/ioctlent.h.in: Remove. * linux/aarch64/ioctlent1.h: Remove. * linux/alpha/ioctlent.h.in: Remove. * linux/arc/ioctlent.h.in: Remove. * linux/arm/ioctlent.h.in: Remove. * linux/avr32/ioctlent.h.in: Remove. * linux/bfin/ioctlent.h.in: Remove. * linux/hppa/ioctlent.h.in: Remove. * linux/i386/ioctlent.h.in: Remove. * linux/ia64/ioctlent.h.in: Remove. * linux/ioctlent.h.in: Remove. * linux/ioctlent.sh: Remove. * linux/m68k/ioctlent.h.in: Remove. * linux/metag/ioctlent.h.in: Remove. * linux/microblaze/ioctlent.h.in: Remove. * linux/mips/ioctlent.h.in: Remove. * linux/mips/ioctlent.sh: Remove. * linux/or1k/ioctlent.h.in: Remove. * linux/powerpc/ioctlent.h.in: Remove. * linux/powerpc64/ioctlent.h: Remove. * linux/powerpc64/ioctlent1.h: Remove. * linux/s390/ioctlent.h.in: Remove. * linux/s390x/ioctlent.h.in: Remove. * linux/sh/ioctlent.h.in: Remove. * linux/sh64/ioctlent.h.in: Remove. * linux/sparc/ioctlent.h.in: Remove. * linux/sparc64/ioctlent.h.in: Remove. * linux/sparc64/ioctlent2.h: Remove. * linux/tile/ioctlent.h.in: Remove. * linux/tile/ioctlent1.h: Remove. * linux/x32/ioctlent.h.in: Remove. * linux/x32/ioctlent1.h: Remove. * linux/x86_64/ioctlent.h.in: Remove. * linux/x86_64/ioctlent1.h: Remove. * linux/xtensa/ioctlent.h.in: Remove. * linux/x86_64/ioctlent2.h: Include ioctlent0.h instead of ioctlent.h. * syscall.c (struct_ioctlent ioctlent0): Likewise. * Makefile.am: Remove all ioctlent-related definitions. Define the list of ioctlent*.h files that have to be generated by presence of $(srcdir)/$(OS)/$(ARCH)/ioctls_inc*.h files. Add rules for ioctlent*.h files generation. (EXTRA_DIST): Update. * maint/ioctls_gen.sh: New file. * maint/ioctls_hex.sh: New file. * maint/ioctls_sym.sh: New file. * maint/print_ioctlent.c: New file. * HACKING-scripts: Update for ioctlent.sh -> ioctls_gen.sh migration. * .gitignore: Add ioctlent[012].h and ioctls_all[012].h. * configure.ac (AC_CHECK_HEADERS): Add linux/hiddev.h and linux/mmtimer.h for tests. * tests/ioctl.c: New file. * tests/ioctl.test: New test. * tests/Makefile.am (check_PROGRAMS): Add ioctl. (TESTS): Add ioctl.test. * tests/.gitignore: Add ioctl.
2015-01-19 20:02:16 +03:00
linux/x86_64/ioctls_arch0.h \
linux/x86_64/ioctls_arch1.h \
linux/x86_64/ioctls_arch2.h \
ioctl: take all 32 bits of ioctl commands into account Historically, only 16 bits (8-bit number and 8-bit type) of 32-bit ioctl commands were used for decoding, which was the source for numerous annoying collisions like this: ioctl(0, SNDCTL_TMR_TIMEBASE or SNDRV_TIMER_IOCTL_NEXT_DEVICE or TCGETS, {B38400 opost isig icanon echo ...}) = 0 ioctl(0, MGSL_IOCGPARAMS or MMTIMER_GETRES or MTIOCTOP or SNDCTL_MIDI_MPUMODE, 0x7fffd47f7338) = -1 ENOTTY (Inappropriate ioctl for device) The solution is to use all 32 bits for decoding, not just "number" and "type", but also "size" and "direction". As some architectures override defaults that come from asm-generic/ and provide alternative definitions for some ioctl commands, we support per-architecture ioctl definitions and merge them with common definitions at build time. During the merge, we used to keep both generic and architecture-specific definitions, now architecture-specific definitions have precedence over generic ones -- ioctlsort omits definitions from asm-generic/ for those ioctl names that have different definitions in asm/. Additional bits of "direction" are architecture specific -- the number of bits and their values differ between architectures. To reduce architecture differences in the source code, we keep "direction" in symbolic form and compile it in ioctlsort. Additional bits of "size" are also architecture specific -- not only the number of bits differ between architectures, but sizes of many types depend on sizeof(long). To reduce architecture differences in the source code, we keep 32-bit and 64-bit versions of common ioctl definitions, and use the appropriate version for each architecture and personality. To implement this, the tools for generating ioctl definitions from kernel headers have been rewritten, and the source format of ioctl definitions has been extended. The final ioctlent*.h files that are included by syscall.c are now generated from source ioctls_inc*.h and ioctls_arch*.h files at build time with ioctlsort. * ioctl.c (ioctl_lookup): Use all 32 bits of ioctl command code. * ioctlsort.c: Rewritten. * linux/32/ioctls_inc.h: New file. * linux/64/ioctls_inc.h: New file. * linux/aarch64/ioctls_arch0.h: New file. * linux/aarch64/ioctls_arch1.h: New file. * linux/aarch64/ioctls_inc0.h: New file. * linux/aarch64/ioctls_inc1.h: New file. * linux/alpha/ioctls_arch0.h: New file. * linux/alpha/ioctls_inc0.h: New file. * linux/arc/ioctls_arch0.h: New file. * linux/arc/ioctls_inc0.h: New file. * linux/arm/ioctls_arch0.h: New file. * linux/arm/ioctls_inc0.h: New file. * linux/avr32/ioctls_arch0.h: New file. * linux/avr32/ioctls_inc0.h: New file. * linux/bfin/ioctls_arch0.h: New file. * linux/bfin/ioctls_inc0.h: New file. * linux/hppa/ioctls_arch0.h: New file. * linux/hppa/ioctls_inc0.h: New file. * linux/i386/ioctls_arch0.h: New file. * linux/i386/ioctls_inc0.h: New file. * linux/ia64/ioctls_arch0.h: New file. * linux/ia64/ioctls_inc0.h: New file. * linux/m68k/ioctls_arch0.h: New file. * linux/m68k/ioctls_inc0.h: New file. * linux/metag/ioctls_arch0.h: New file. * linux/metag/ioctls_inc0.h: New file. * linux/microblaze/ioctls_arch0.h: New file. * linux/microblaze/ioctls_inc0.h: New file. * linux/mips/ioctls_arch0.h: New file. * linux/mips/ioctls_inc0.h: New file. * linux/or1k/ioctls_arch0.h: New file. * linux/or1k/ioctls_inc0.h: New file. * linux/powerpc/ioctls_arch0.h: New file. * linux/powerpc/ioctls_inc0.h: New file. * linux/powerpc64/ioctls_arch0.h: New file. * linux/powerpc64/ioctls_arch1.h: New file. * linux/powerpc64/ioctls_inc0.h: New file. * linux/powerpc64/ioctls_inc1.h: New file. * linux/s390/ioctls_arch0.h: New file. * linux/s390/ioctls_inc0.h: New file. * linux/s390x/ioctls_arch0.h: New file. * linux/s390x/ioctls_inc0.h: New file. * linux/sh/ioctls_arch0.h: New file. * linux/sh/ioctls_inc0.h: New file. * linux/sh64/ioctls_arch0.h: New file. * linux/sh64/ioctls_inc0.h: New file. * linux/sparc/ioctls_arch0.h: New file. * linux/sparc/ioctls_inc0.h: New file. * linux/sparc64/ioctls_arch0.h: New file. * linux/sparc64/ioctls_arch2.h: New file. * linux/sparc64/ioctls_inc0.h: New file. * linux/sparc64/ioctls_inc2.h: New file. * linux/tile/ioctls_arch0.h: New file. * linux/tile/ioctls_arch1.h: New file. * linux/tile/ioctls_inc0.h: New file. * linux/tile/ioctls_inc1.h: New file. * linux/x32/ioctls_arch0.h: New file. * linux/x32/ioctls_arch1.h: New file. * linux/x32/ioctls_inc0.h: New file. * linux/x32/ioctls_inc1.h: New file. * linux/x86_64/ioctls_arch0.h: New file. * linux/x86_64/ioctls_arch1.h: New file. * linux/x86_64/ioctls_inc0.h: New file. * linux/x86_64/ioctls_inc1.h: New file. * linux/xtensa/ioctls_arch0.h: New file. * linux/xtensa/ioctls_inc0.h: New file. * linux/aarch64/ioctlent.h.in: Remove. * linux/aarch64/ioctlent1.h: Remove. * linux/alpha/ioctlent.h.in: Remove. * linux/arc/ioctlent.h.in: Remove. * linux/arm/ioctlent.h.in: Remove. * linux/avr32/ioctlent.h.in: Remove. * linux/bfin/ioctlent.h.in: Remove. * linux/hppa/ioctlent.h.in: Remove. * linux/i386/ioctlent.h.in: Remove. * linux/ia64/ioctlent.h.in: Remove. * linux/ioctlent.h.in: Remove. * linux/ioctlent.sh: Remove. * linux/m68k/ioctlent.h.in: Remove. * linux/metag/ioctlent.h.in: Remove. * linux/microblaze/ioctlent.h.in: Remove. * linux/mips/ioctlent.h.in: Remove. * linux/mips/ioctlent.sh: Remove. * linux/or1k/ioctlent.h.in: Remove. * linux/powerpc/ioctlent.h.in: Remove. * linux/powerpc64/ioctlent.h: Remove. * linux/powerpc64/ioctlent1.h: Remove. * linux/s390/ioctlent.h.in: Remove. * linux/s390x/ioctlent.h.in: Remove. * linux/sh/ioctlent.h.in: Remove. * linux/sh64/ioctlent.h.in: Remove. * linux/sparc/ioctlent.h.in: Remove. * linux/sparc64/ioctlent.h.in: Remove. * linux/sparc64/ioctlent2.h: Remove. * linux/tile/ioctlent.h.in: Remove. * linux/tile/ioctlent1.h: Remove. * linux/x32/ioctlent.h.in: Remove. * linux/x32/ioctlent1.h: Remove. * linux/x86_64/ioctlent.h.in: Remove. * linux/x86_64/ioctlent1.h: Remove. * linux/xtensa/ioctlent.h.in: Remove. * linux/x86_64/ioctlent2.h: Include ioctlent0.h instead of ioctlent.h. * syscall.c (struct_ioctlent ioctlent0): Likewise. * Makefile.am: Remove all ioctlent-related definitions. Define the list of ioctlent*.h files that have to be generated by presence of $(srcdir)/$(OS)/$(ARCH)/ioctls_inc*.h files. Add rules for ioctlent*.h files generation. (EXTRA_DIST): Update. * maint/ioctls_gen.sh: New file. * maint/ioctls_hex.sh: New file. * maint/ioctls_sym.sh: New file. * maint/print_ioctlent.c: New file. * HACKING-scripts: Update for ioctlent.sh -> ioctls_gen.sh migration. * .gitignore: Add ioctlent[012].h and ioctls_all[012].h. * configure.ac (AC_CHECK_HEADERS): Add linux/hiddev.h and linux/mmtimer.h for tests. * tests/ioctl.c: New file. * tests/ioctl.test: New test. * tests/Makefile.am (check_PROGRAMS): Add ioctl. (TESTS): Add ioctl.test. * tests/.gitignore: Add ioctl.
2015-01-19 20:02:16 +03:00
linux/x86_64/ioctls_inc0.h \
linux/x86_64/ioctls_inc1.h \
linux/x86_64/ioctls_inc2.h \
Implement arch specific methods of changing syscall number and error code This introduces arch_set_error and arch_set_scno functions for each supported architecture, needed to implement syscall fault injection. * linux/aarch64/set_error.c: New file. * linux/aarch64/set_scno.c: Likewise. * linux/alpha/set_error.c: Likewise. * linux/alpha/set_scno.c: Likewise. * linux/arc/set_error.c: Likewise. * linux/arc/set_scno.c: Likewise. * linux/arm/set_error.c: Likewise. * linux/arm/set_scno.c: Likewise. * linux/avr32/set_error.c: Likewise. * linux/avr32/set_scno.c: Likewise. * linux/bfin/set_error.c: Likewise. * linux/bfin/set_scno.c: Likewise. * linux/crisv10/set_error.c: Likewise. * linux/crisv10/set_scno.c: Likewise. * linux/crisv32/set_error.c: Likewise. * linux/crisv32/set_scno.c: Likewise. * linux/hppa/set_error.c: Likewise. * linux/hppa/set_scno.c: Likewise. * linux/i386/set_error.c: Likewise. * linux/i386/set_scno.c: Likewise. * linux/ia64/set_error.c: Likewise. * linux/ia64/set_scno.c: Likewise. * linux/m68k/set_error.c: Likewise. * linux/m68k/set_scno.c: Likewise. * linux/metag/set_error.c: Likewise. * linux/metag/set_scno.c: Likewise. * linux/microblaze/set_error.c: Likewise. * linux/microblaze/set_scno.c: Likewise. * linux/mips/set_error.c: Likewise. * linux/mips/set_scno.c: Likewise. * linux/nios2/set_error.c: Likewise. * linux/nios2/set_scno.c: Likewise. * linux/or1k/set_error.c: Likewise. * linux/or1k/set_scno.c: Likewise. * linux/powerpc/set_error.c: Likewise. * linux/powerpc/set_scno.c: Likewise. * linux/powerpc64/set_error.c: Likewise. * linux/powerpc64/set_scno.c: Likewise. * linux/riscv/set_error.c: Likewise. * linux/riscv/set_scno.c: Likewise. * linux/s390/set_error.c: Likewise. * linux/s390/set_scno.c: Likewise. * linux/s390x/set_error.c: Likewise. * linux/s390x/set_scno.c: Likewise. * linux/sh/set_error.c: Likewise. * linux/sh/set_scno.c: Likewise. * linux/sh64/set_error.c: Likewise. * linux/sh64/set_scno.c: Likewise. * linux/sparc/set_error.c: Likewise. * linux/sparc/set_scno.c: Likewise. * linux/sparc64/set_error.c: Likewise. * linux/sparc64/set_scno.c: Likewise. * linux/tile/set_error.c: Likewise. * linux/tile/set_scno.c: Likewise. * linux/x32/set_error.c: Likewise. * linux/x32/set_scno.c: Likewise. * linux/x86_64/set_error.c: Likewise. * linux/x86_64/set_scno.c: Likewise. * linux/xtensa/set_error.c: Likewise. * linux/xtensa/set_scno.c: Likewise. * Makefile.am (EXTRA_DIST): Add them.
2016-11-15 20:38:21 +03:00
linux/x86_64/set_error.c \
linux/x86_64/set_scno.c \
linux/x86_64/signalent1.h \
linux/x86_64/signalent2.h \
linux/x86_64/syscallent.h \
linux/x86_64/syscallent1.h \
linux/x86_64/syscallent2.h \
linux/x86_64/userent.h \
linux/xtensa/arch_regs.c \
linux/xtensa/get_error.c \
linux/xtensa/get_scno.c \
linux/xtensa/get_syscall_args.c \
linux/xtensa/get_syscall_result.c \
ioctl: take all 32 bits of ioctl commands into account Historically, only 16 bits (8-bit number and 8-bit type) of 32-bit ioctl commands were used for decoding, which was the source for numerous annoying collisions like this: ioctl(0, SNDCTL_TMR_TIMEBASE or SNDRV_TIMER_IOCTL_NEXT_DEVICE or TCGETS, {B38400 opost isig icanon echo ...}) = 0 ioctl(0, MGSL_IOCGPARAMS or MMTIMER_GETRES or MTIOCTOP or SNDCTL_MIDI_MPUMODE, 0x7fffd47f7338) = -1 ENOTTY (Inappropriate ioctl for device) The solution is to use all 32 bits for decoding, not just "number" and "type", but also "size" and "direction". As some architectures override defaults that come from asm-generic/ and provide alternative definitions for some ioctl commands, we support per-architecture ioctl definitions and merge them with common definitions at build time. During the merge, we used to keep both generic and architecture-specific definitions, now architecture-specific definitions have precedence over generic ones -- ioctlsort omits definitions from asm-generic/ for those ioctl names that have different definitions in asm/. Additional bits of "direction" are architecture specific -- the number of bits and their values differ between architectures. To reduce architecture differences in the source code, we keep "direction" in symbolic form and compile it in ioctlsort. Additional bits of "size" are also architecture specific -- not only the number of bits differ between architectures, but sizes of many types depend on sizeof(long). To reduce architecture differences in the source code, we keep 32-bit and 64-bit versions of common ioctl definitions, and use the appropriate version for each architecture and personality. To implement this, the tools for generating ioctl definitions from kernel headers have been rewritten, and the source format of ioctl definitions has been extended. The final ioctlent*.h files that are included by syscall.c are now generated from source ioctls_inc*.h and ioctls_arch*.h files at build time with ioctlsort. * ioctl.c (ioctl_lookup): Use all 32 bits of ioctl command code. * ioctlsort.c: Rewritten. * linux/32/ioctls_inc.h: New file. * linux/64/ioctls_inc.h: New file. * linux/aarch64/ioctls_arch0.h: New file. * linux/aarch64/ioctls_arch1.h: New file. * linux/aarch64/ioctls_inc0.h: New file. * linux/aarch64/ioctls_inc1.h: New file. * linux/alpha/ioctls_arch0.h: New file. * linux/alpha/ioctls_inc0.h: New file. * linux/arc/ioctls_arch0.h: New file. * linux/arc/ioctls_inc0.h: New file. * linux/arm/ioctls_arch0.h: New file. * linux/arm/ioctls_inc0.h: New file. * linux/avr32/ioctls_arch0.h: New file. * linux/avr32/ioctls_inc0.h: New file. * linux/bfin/ioctls_arch0.h: New file. * linux/bfin/ioctls_inc0.h: New file. * linux/hppa/ioctls_arch0.h: New file. * linux/hppa/ioctls_inc0.h: New file. * linux/i386/ioctls_arch0.h: New file. * linux/i386/ioctls_inc0.h: New file. * linux/ia64/ioctls_arch0.h: New file. * linux/ia64/ioctls_inc0.h: New file. * linux/m68k/ioctls_arch0.h: New file. * linux/m68k/ioctls_inc0.h: New file. * linux/metag/ioctls_arch0.h: New file. * linux/metag/ioctls_inc0.h: New file. * linux/microblaze/ioctls_arch0.h: New file. * linux/microblaze/ioctls_inc0.h: New file. * linux/mips/ioctls_arch0.h: New file. * linux/mips/ioctls_inc0.h: New file. * linux/or1k/ioctls_arch0.h: New file. * linux/or1k/ioctls_inc0.h: New file. * linux/powerpc/ioctls_arch0.h: New file. * linux/powerpc/ioctls_inc0.h: New file. * linux/powerpc64/ioctls_arch0.h: New file. * linux/powerpc64/ioctls_arch1.h: New file. * linux/powerpc64/ioctls_inc0.h: New file. * linux/powerpc64/ioctls_inc1.h: New file. * linux/s390/ioctls_arch0.h: New file. * linux/s390/ioctls_inc0.h: New file. * linux/s390x/ioctls_arch0.h: New file. * linux/s390x/ioctls_inc0.h: New file. * linux/sh/ioctls_arch0.h: New file. * linux/sh/ioctls_inc0.h: New file. * linux/sh64/ioctls_arch0.h: New file. * linux/sh64/ioctls_inc0.h: New file. * linux/sparc/ioctls_arch0.h: New file. * linux/sparc/ioctls_inc0.h: New file. * linux/sparc64/ioctls_arch0.h: New file. * linux/sparc64/ioctls_arch2.h: New file. * linux/sparc64/ioctls_inc0.h: New file. * linux/sparc64/ioctls_inc2.h: New file. * linux/tile/ioctls_arch0.h: New file. * linux/tile/ioctls_arch1.h: New file. * linux/tile/ioctls_inc0.h: New file. * linux/tile/ioctls_inc1.h: New file. * linux/x32/ioctls_arch0.h: New file. * linux/x32/ioctls_arch1.h: New file. * linux/x32/ioctls_inc0.h: New file. * linux/x32/ioctls_inc1.h: New file. * linux/x86_64/ioctls_arch0.h: New file. * linux/x86_64/ioctls_arch1.h: New file. * linux/x86_64/ioctls_inc0.h: New file. * linux/x86_64/ioctls_inc1.h: New file. * linux/xtensa/ioctls_arch0.h: New file. * linux/xtensa/ioctls_inc0.h: New file. * linux/aarch64/ioctlent.h.in: Remove. * linux/aarch64/ioctlent1.h: Remove. * linux/alpha/ioctlent.h.in: Remove. * linux/arc/ioctlent.h.in: Remove. * linux/arm/ioctlent.h.in: Remove. * linux/avr32/ioctlent.h.in: Remove. * linux/bfin/ioctlent.h.in: Remove. * linux/hppa/ioctlent.h.in: Remove. * linux/i386/ioctlent.h.in: Remove. * linux/ia64/ioctlent.h.in: Remove. * linux/ioctlent.h.in: Remove. * linux/ioctlent.sh: Remove. * linux/m68k/ioctlent.h.in: Remove. * linux/metag/ioctlent.h.in: Remove. * linux/microblaze/ioctlent.h.in: Remove. * linux/mips/ioctlent.h.in: Remove. * linux/mips/ioctlent.sh: Remove. * linux/or1k/ioctlent.h.in: Remove. * linux/powerpc/ioctlent.h.in: Remove. * linux/powerpc64/ioctlent.h: Remove. * linux/powerpc64/ioctlent1.h: Remove. * linux/s390/ioctlent.h.in: Remove. * linux/s390x/ioctlent.h.in: Remove. * linux/sh/ioctlent.h.in: Remove. * linux/sh64/ioctlent.h.in: Remove. * linux/sparc/ioctlent.h.in: Remove. * linux/sparc64/ioctlent.h.in: Remove. * linux/sparc64/ioctlent2.h: Remove. * linux/tile/ioctlent.h.in: Remove. * linux/tile/ioctlent1.h: Remove. * linux/x32/ioctlent.h.in: Remove. * linux/x32/ioctlent1.h: Remove. * linux/x86_64/ioctlent.h.in: Remove. * linux/x86_64/ioctlent1.h: Remove. * linux/xtensa/ioctlent.h.in: Remove. * linux/x86_64/ioctlent2.h: Include ioctlent0.h instead of ioctlent.h. * syscall.c (struct_ioctlent ioctlent0): Likewise. * Makefile.am: Remove all ioctlent-related definitions. Define the list of ioctlent*.h files that have to be generated by presence of $(srcdir)/$(OS)/$(ARCH)/ioctls_inc*.h files. Add rules for ioctlent*.h files generation. (EXTRA_DIST): Update. * maint/ioctls_gen.sh: New file. * maint/ioctls_hex.sh: New file. * maint/ioctls_sym.sh: New file. * maint/print_ioctlent.c: New file. * HACKING-scripts: Update for ioctlent.sh -> ioctls_gen.sh migration. * .gitignore: Add ioctlent[012].h and ioctls_all[012].h. * configure.ac (AC_CHECK_HEADERS): Add linux/hiddev.h and linux/mmtimer.h for tests. * tests/ioctl.c: New file. * tests/ioctl.test: New test. * tests/Makefile.am (check_PROGRAMS): Add ioctl. (TESTS): Add ioctl.test. * tests/.gitignore: Add ioctl.
2015-01-19 20:02:16 +03:00
linux/xtensa/ioctls_arch0.h \
linux/xtensa/ioctls_inc0.h \
Implement arch specific methods of changing syscall number and error code This introduces arch_set_error and arch_set_scno functions for each supported architecture, needed to implement syscall fault injection. * linux/aarch64/set_error.c: New file. * linux/aarch64/set_scno.c: Likewise. * linux/alpha/set_error.c: Likewise. * linux/alpha/set_scno.c: Likewise. * linux/arc/set_error.c: Likewise. * linux/arc/set_scno.c: Likewise. * linux/arm/set_error.c: Likewise. * linux/arm/set_scno.c: Likewise. * linux/avr32/set_error.c: Likewise. * linux/avr32/set_scno.c: Likewise. * linux/bfin/set_error.c: Likewise. * linux/bfin/set_scno.c: Likewise. * linux/crisv10/set_error.c: Likewise. * linux/crisv10/set_scno.c: Likewise. * linux/crisv32/set_error.c: Likewise. * linux/crisv32/set_scno.c: Likewise. * linux/hppa/set_error.c: Likewise. * linux/hppa/set_scno.c: Likewise. * linux/i386/set_error.c: Likewise. * linux/i386/set_scno.c: Likewise. * linux/ia64/set_error.c: Likewise. * linux/ia64/set_scno.c: Likewise. * linux/m68k/set_error.c: Likewise. * linux/m68k/set_scno.c: Likewise. * linux/metag/set_error.c: Likewise. * linux/metag/set_scno.c: Likewise. * linux/microblaze/set_error.c: Likewise. * linux/microblaze/set_scno.c: Likewise. * linux/mips/set_error.c: Likewise. * linux/mips/set_scno.c: Likewise. * linux/nios2/set_error.c: Likewise. * linux/nios2/set_scno.c: Likewise. * linux/or1k/set_error.c: Likewise. * linux/or1k/set_scno.c: Likewise. * linux/powerpc/set_error.c: Likewise. * linux/powerpc/set_scno.c: Likewise. * linux/powerpc64/set_error.c: Likewise. * linux/powerpc64/set_scno.c: Likewise. * linux/riscv/set_error.c: Likewise. * linux/riscv/set_scno.c: Likewise. * linux/s390/set_error.c: Likewise. * linux/s390/set_scno.c: Likewise. * linux/s390x/set_error.c: Likewise. * linux/s390x/set_scno.c: Likewise. * linux/sh/set_error.c: Likewise. * linux/sh/set_scno.c: Likewise. * linux/sh64/set_error.c: Likewise. * linux/sh64/set_scno.c: Likewise. * linux/sparc/set_error.c: Likewise. * linux/sparc/set_scno.c: Likewise. * linux/sparc64/set_error.c: Likewise. * linux/sparc64/set_scno.c: Likewise. * linux/tile/set_error.c: Likewise. * linux/tile/set_scno.c: Likewise. * linux/x32/set_error.c: Likewise. * linux/x32/set_scno.c: Likewise. * linux/x86_64/set_error.c: Likewise. * linux/x86_64/set_scno.c: Likewise. * linux/xtensa/set_error.c: Likewise. * linux/xtensa/set_scno.c: Likewise. * Makefile.am (EXTRA_DIST): Add them.
2016-11-15 20:38:21 +03:00
linux/xtensa/set_error.c \
linux/xtensa/set_scno.c \
linux/xtensa/syscallent.h \
linux/xtensa/userent.h \
ioctl: take all 32 bits of ioctl commands into account Historically, only 16 bits (8-bit number and 8-bit type) of 32-bit ioctl commands were used for decoding, which was the source for numerous annoying collisions like this: ioctl(0, SNDCTL_TMR_TIMEBASE or SNDRV_TIMER_IOCTL_NEXT_DEVICE or TCGETS, {B38400 opost isig icanon echo ...}) = 0 ioctl(0, MGSL_IOCGPARAMS or MMTIMER_GETRES or MTIOCTOP or SNDCTL_MIDI_MPUMODE, 0x7fffd47f7338) = -1 ENOTTY (Inappropriate ioctl for device) The solution is to use all 32 bits for decoding, not just "number" and "type", but also "size" and "direction". As some architectures override defaults that come from asm-generic/ and provide alternative definitions for some ioctl commands, we support per-architecture ioctl definitions and merge them with common definitions at build time. During the merge, we used to keep both generic and architecture-specific definitions, now architecture-specific definitions have precedence over generic ones -- ioctlsort omits definitions from asm-generic/ for those ioctl names that have different definitions in asm/. Additional bits of "direction" are architecture specific -- the number of bits and their values differ between architectures. To reduce architecture differences in the source code, we keep "direction" in symbolic form and compile it in ioctlsort. Additional bits of "size" are also architecture specific -- not only the number of bits differ between architectures, but sizes of many types depend on sizeof(long). To reduce architecture differences in the source code, we keep 32-bit and 64-bit versions of common ioctl definitions, and use the appropriate version for each architecture and personality. To implement this, the tools for generating ioctl definitions from kernel headers have been rewritten, and the source format of ioctl definitions has been extended. The final ioctlent*.h files that are included by syscall.c are now generated from source ioctls_inc*.h and ioctls_arch*.h files at build time with ioctlsort. * ioctl.c (ioctl_lookup): Use all 32 bits of ioctl command code. * ioctlsort.c: Rewritten. * linux/32/ioctls_inc.h: New file. * linux/64/ioctls_inc.h: New file. * linux/aarch64/ioctls_arch0.h: New file. * linux/aarch64/ioctls_arch1.h: New file. * linux/aarch64/ioctls_inc0.h: New file. * linux/aarch64/ioctls_inc1.h: New file. * linux/alpha/ioctls_arch0.h: New file. * linux/alpha/ioctls_inc0.h: New file. * linux/arc/ioctls_arch0.h: New file. * linux/arc/ioctls_inc0.h: New file. * linux/arm/ioctls_arch0.h: New file. * linux/arm/ioctls_inc0.h: New file. * linux/avr32/ioctls_arch0.h: New file. * linux/avr32/ioctls_inc0.h: New file. * linux/bfin/ioctls_arch0.h: New file. * linux/bfin/ioctls_inc0.h: New file. * linux/hppa/ioctls_arch0.h: New file. * linux/hppa/ioctls_inc0.h: New file. * linux/i386/ioctls_arch0.h: New file. * linux/i386/ioctls_inc0.h: New file. * linux/ia64/ioctls_arch0.h: New file. * linux/ia64/ioctls_inc0.h: New file. * linux/m68k/ioctls_arch0.h: New file. * linux/m68k/ioctls_inc0.h: New file. * linux/metag/ioctls_arch0.h: New file. * linux/metag/ioctls_inc0.h: New file. * linux/microblaze/ioctls_arch0.h: New file. * linux/microblaze/ioctls_inc0.h: New file. * linux/mips/ioctls_arch0.h: New file. * linux/mips/ioctls_inc0.h: New file. * linux/or1k/ioctls_arch0.h: New file. * linux/or1k/ioctls_inc0.h: New file. * linux/powerpc/ioctls_arch0.h: New file. * linux/powerpc/ioctls_inc0.h: New file. * linux/powerpc64/ioctls_arch0.h: New file. * linux/powerpc64/ioctls_arch1.h: New file. * linux/powerpc64/ioctls_inc0.h: New file. * linux/powerpc64/ioctls_inc1.h: New file. * linux/s390/ioctls_arch0.h: New file. * linux/s390/ioctls_inc0.h: New file. * linux/s390x/ioctls_arch0.h: New file. * linux/s390x/ioctls_inc0.h: New file. * linux/sh/ioctls_arch0.h: New file. * linux/sh/ioctls_inc0.h: New file. * linux/sh64/ioctls_arch0.h: New file. * linux/sh64/ioctls_inc0.h: New file. * linux/sparc/ioctls_arch0.h: New file. * linux/sparc/ioctls_inc0.h: New file. * linux/sparc64/ioctls_arch0.h: New file. * linux/sparc64/ioctls_arch2.h: New file. * linux/sparc64/ioctls_inc0.h: New file. * linux/sparc64/ioctls_inc2.h: New file. * linux/tile/ioctls_arch0.h: New file. * linux/tile/ioctls_arch1.h: New file. * linux/tile/ioctls_inc0.h: New file. * linux/tile/ioctls_inc1.h: New file. * linux/x32/ioctls_arch0.h: New file. * linux/x32/ioctls_arch1.h: New file. * linux/x32/ioctls_inc0.h: New file. * linux/x32/ioctls_inc1.h: New file. * linux/x86_64/ioctls_arch0.h: New file. * linux/x86_64/ioctls_arch1.h: New file. * linux/x86_64/ioctls_inc0.h: New file. * linux/x86_64/ioctls_inc1.h: New file. * linux/xtensa/ioctls_arch0.h: New file. * linux/xtensa/ioctls_inc0.h: New file. * linux/aarch64/ioctlent.h.in: Remove. * linux/aarch64/ioctlent1.h: Remove. * linux/alpha/ioctlent.h.in: Remove. * linux/arc/ioctlent.h.in: Remove. * linux/arm/ioctlent.h.in: Remove. * linux/avr32/ioctlent.h.in: Remove. * linux/bfin/ioctlent.h.in: Remove. * linux/hppa/ioctlent.h.in: Remove. * linux/i386/ioctlent.h.in: Remove. * linux/ia64/ioctlent.h.in: Remove. * linux/ioctlent.h.in: Remove. * linux/ioctlent.sh: Remove. * linux/m68k/ioctlent.h.in: Remove. * linux/metag/ioctlent.h.in: Remove. * linux/microblaze/ioctlent.h.in: Remove. * linux/mips/ioctlent.h.in: Remove. * linux/mips/ioctlent.sh: Remove. * linux/or1k/ioctlent.h.in: Remove. * linux/powerpc/ioctlent.h.in: Remove. * linux/powerpc64/ioctlent.h: Remove. * linux/powerpc64/ioctlent1.h: Remove. * linux/s390/ioctlent.h.in: Remove. * linux/s390x/ioctlent.h.in: Remove. * linux/sh/ioctlent.h.in: Remove. * linux/sh64/ioctlent.h.in: Remove. * linux/sparc/ioctlent.h.in: Remove. * linux/sparc64/ioctlent.h.in: Remove. * linux/sparc64/ioctlent2.h: Remove. * linux/tile/ioctlent.h.in: Remove. * linux/tile/ioctlent1.h: Remove. * linux/x32/ioctlent.h.in: Remove. * linux/x32/ioctlent1.h: Remove. * linux/x86_64/ioctlent.h.in: Remove. * linux/x86_64/ioctlent1.h: Remove. * linux/xtensa/ioctlent.h.in: Remove. * linux/x86_64/ioctlent2.h: Include ioctlent0.h instead of ioctlent.h. * syscall.c (struct_ioctlent ioctlent0): Likewise. * Makefile.am: Remove all ioctlent-related definitions. Define the list of ioctlent*.h files that have to be generated by presence of $(srcdir)/$(OS)/$(ARCH)/ioctls_inc*.h files. Add rules for ioctlent*.h files generation. (EXTRA_DIST): Update. * maint/ioctls_gen.sh: New file. * maint/ioctls_hex.sh: New file. * maint/ioctls_sym.sh: New file. * maint/print_ioctlent.c: New file. * HACKING-scripts: Update for ioctlent.sh -> ioctls_gen.sh migration. * .gitignore: Add ioctlent[012].h and ioctls_all[012].h. * configure.ac (AC_CHECK_HEADERS): Add linux/hiddev.h and linux/mmtimer.h for tests. * tests/ioctl.c: New file. * tests/ioctl.test: New test. * tests/Makefile.am (check_PROGRAMS): Add ioctl. (TESTS): Add ioctl.test. * tests/.gitignore: Add ioctl.
2015-01-19 20:02:16 +03:00
maint/ioctls_gen.sh \
maint/ioctls_hex.sh \
maint/ioctls_sym.sh \
maint/print_ioctlent.c \
Add mpers support Add a subsystem for semi-automatical definition of how parsers should work with personality-dependent (mpers) types of tracee's data. Create auxiliary libraries containing mpers syscall parsers and printer functions, one library for each possible nonnative target personality. Currently some parsers do not handle differences in definitions of data types between personalities, namely LP64 and ILP32. When this is the case, long integers, pointers, and all compound types containing long and pointer members may be printed incorrectly, because of differences in sizes, offsets and alignments. Since in most cases these are the only differences in desired behaviour of parsers and printers for different personalities, a correct way would be to compile one source code into multiple parsers, differing only in definitions of mpers types. To get a definition of a given type for nonnative personality a very basic .c file containing a declaration of a variable of this type is being compiled for this personality (using -m32 or -mx32 compiler flag). Information about the type is then being extracted from this binary's DWARF debug info with an awk script and put into a corresponding header file. Resulting headers are being used to compile mpers variations of syscall parsers and printer functions. In addition to syscall parsers, there can occur a need to create mpers printing functions, which then can be called from many places in the code (for example, printsiginfo_at). Such functions (printers) are marked in a special manner. For each possible nonnative target personality a library is being created, containing mpers variations of syscall parsers and printers. Only syscall parsers from files marked in a special manner and specially marked functions from such files are being recompiled and included in these libraries. generate_mpers_am.sh is called by bootstrap to find the files from strace_SOURCES which include MPERS_DEFS. During compilation, these files are being inspected for inclusions of DEF_MPERS_TYPE, and nonnative variations of each included type are being generated by an awk script. Mpers parser names are being modified during inclusions of syscallent headers for nonnative personalities. Pointers to printers are being stored in structs struct_printers, and a master pointer printers is being updated on every set_personality. * README-mpers: New README explaining how to use mpers support. * empty.h: New empty file. * generate_mpers_am.sh: New file. * mpers.awk: Likewise. * mpers.sh: Likewise. * mpers_test.sh: Likewise. * mpers_type.h: Likewise. * Makefile.am (strace_SOURCES): Add empty.h and mpers_type.h. (strace_CPPFLAGS, strace_LDFLAGS, strace_LDADD): Move to the beginning of the file. (strace_LDADD, noinst_LIBRARIES): Add libmpers-%.a. (EXTRA_DIST): Add mpers.awk, mpers.sh, mpers_test.sh. (BUILT_SOURCES, CLEANFILES): Add new generated files: native_printer_decls.h, native_printer_defs.h, printers.h, [HAVE_M32_MPERS] $(mpers_m32_targets), and [HAVE_MX32_MPERS] $(mpers_mx32_targets). (mpers_NAME, mpers_PREFIX, mpers_DEFS, mpers_INCLUDES, mpers_CPPFLAGS, mpers_sh_opts, libmpers_CPPFLAGS, libmpers_m[x]32_a_SOURCES, libmpers_m[x]32_a_CPPFLAGS, mpers_m[x]32_targets): New variables. (mpers-m[x]32.stamp, m[x]32_defs.h, m[x]32_funcs.h, printers.h, %_printer_decls.h, %_printer_defs.h, clean-local, native_printer_decls.h, native_printer_defs.h, $mpers_m[x]32_targets): New targets. * bootstrap: Add generate_mpers_am.sh. * configure.ac: Add AC_PROG_RANLIB. * m4/mpers.m4: Add HAVE_MPERS variable. Add $st_cv_mpers checks. * defs.h: Include mpers_type.h. Include printers.h, native_printer_decls.h, define MPERS_PRINTER_NAME. Redefine SYS_FUNC_NAME. Define MPERS_PRINTER_DECL. [HAVE_M32_MPERS]: define PERSONALITY1_INCLUDE_FUNCS, PERSONALITY1_INCLUDE_PRINTERS_DECLS, PERSONALITY1_INCLUDE_PRINTERS_DEFS for X86_64, X32. [HAVE_MX32_MPERS]: define PERSONALITY2_INCLUDE_FUNCS, PERSONALITY2_INCLUDE_PRINTERS_DECLS, PERSONALITY2_INCLUDE_PRINTERS_DEFS for X86_64. Add fallback definitions of PERSONALITY1_INCLUDE_FUNCS, PERSONALITY2_INCLUDE_FUNCS, PERSONALITY0_INCLUDE_PRINTERS_DECLS, PERSONALITY0_INCLUDE_PRINTERS_DEFS, PERSONALITY1_INCLUDE_PRINTERS_DECLS, PERSONALITY1_INCLUDE_PRINTERS_DEFS, PERSONALITY2_INCLUDE_PRINTERS_DECLS, PERSONALITY2_INCLUDE_PRINTERS_DEFS. * syscall.c: Include PERSONALITY1_INCLUDE_FUNCS, PERSONALITY2_INCLUDE_FUNCS, PERSONALITY0_INCLUDE_PRINTERS_DECLS, PERSONALITY0_INCLUDE_PRINTERS_DEFS, PERSONALITY1_INCLUDE_PRINTERS_DECLS, PERSONALITY1_INCLUDE_PRINTERS_DEFS, PERSONALITY2_INCLUDE_PRINTERS_DECLS, PERSONALITY2_INCLUDE_PRINTERS_DEFS. (printers): New struct. Update it when needed. * .gitignore: Add libmpers-m32.a, libmpers-mx32.a, m32_defs.h, m32_funcs.h, m32_printer_decls.h, m32_printer_defs.h, mpers-m32, mpers-m32.stamp, mpers-mx32, mpers-mx32.stamp, mpers.am, mx32_defs.h, mx32_funcs.h, mx32_printer_decls.h, mx32_printer_defs.h, native_printer_decls.h, native_printer_defs.h, and printers.h.
2015-08-04 01:47:02 +03:00
mpers.awk \
mpers.sh \
mpers_test.sh \
mpers: skip xlat struct definitions in mpers mode Avoid duplicate definitions of xlat structures in files compiled in mpers mode. Each xlat file defines the corresponding xlat struct with either global or local visibility using the following rules: - if xlat struct declaration is available in defs.h, a global definition is provided in regular mode, and nothing is provided in mpers mode; - otherwise, if xlat file is included by a mpers source file, a global definition is provided in regular mode (unless no mpers mode is supported on this architecture, in that case, a local definition is provided instead), and a declaration is provided in mpers mode; - otherwise, a local definition is provided in regular mode, and an error message is printed in mpers mode. Fallback definitions of constants provided by xlat files remain available in all modes. * bootstrap: Invoke generate_mpers_am.sh before xlat/gen.sh. * defs.h (adjtimex_modes, adjtimex_status, sigev_value): Remove. * generate_mpers_am.sh: Generate mpers_xlat.h. * Makefile.am (EXTRA_DIST): Add mpers_xlat.h. * print_sigevent.c: Include "xlat/sigev_value.h" unconditionally. * print_timex.c: Include "xlat/adjtimex_modes.h" and "xlat/adjtimex_status.h" unconditionally. * xlat/gen.sh (cond_xlat): Move printing of fallback definitions ... (cond_def): ... here. (gen_header): Check also mpers_xlat.h for global declarations of xlat structures. Process input file twice, first time print directives only, second time print everything. Wrap struct xlat into #ifdef IN_MPERS ... #else ... #endif. * xlat/getrandom_flags.in: Cleanup.
2015-11-20 04:43:12 +03:00
mpers_xlat.h \
signalent.sh \
strace-graph \
strace-log-merge \
strace.spec \
syscallent.sh \
$(XLAT_INPUT_FILES) \
$(XLAT_HEADER_FILES) \
xlat/gen.sh \
xlate.el
.PHONY: check-valgrind-local
check-valgrind-local:
.PHONY: srpm
srpm: dist-xz
rpmbuild --define '%_srcrpmdir .' -ts $(distdir).tar.xz
$(srcdir)/.version:
$(AM_V_GEN)echo $(VERSION) > $@-t && mv $@-t $@
strace_SOURCES_c = \
$(filter %.c,$(strace_SOURCES)) $(filter %.c,$(libstrace_a_SOURCES))
sys_func.h: $(patsubst %,$(srcdir)/%,$(strace_SOURCES_c))
for f in $^; do \
sed -n 's/^SYS_FUNC(.*/extern &;/p' $$f; \
done | sort -u > $@
syscallent_names = subcall.h syscallent.h syscallent1.h \
syscallent-n32.h syscallent-n64.h syscallent-o32.h
syscallent_patterns = $(patsubst %,\%/%,$(syscallent_names))
syscallent_files = $(filter $(syscallent_patterns),$(EXTRA_DIST))
sen.h: $(patsubst %,$(srcdir)/%,$(syscallent_files))
for f in $^; do cat -- $$f; done | \
$(srcdir)/generate_sen.sh > $@
dist-hook:
$(AM_V_GEN)echo $(VERSION) > $(distdir)/.tarball-version
today = $(shell date +%Y-%m-%d)
version_regexp = $(subst .,\.,$(VERSION))
news_check_regexp = 'Noteworthy changes in release $(version_regexp) ($(today))'
news-check: NEWS
$(AM_V_GEN)if head -1 $< | \
grep -x $(news_check_regexp) >/dev/null; then \
:; \
else \
echo >&2 '$<: check failed'; \
exit 1; \
fi
linux/ioctlent: unify them all This unifies all the ioctlent.h's in the linux subdir while still allowing each arch to maintain its own minor list. The basic method is: - each arch has linux/<arch>/ioctlent.h.in which defines only the arch-specific ioctls; - linux/ioctlent.h.in which defines only the common ioctls; - at build time, these two headers are combined and sorted to produce the linux/ioctlent.h file. This also requires a little tweaking of the include files since the common ioctlent.h is a built file. * linux/ioctlent.h: Split into linux/ioctlent.h.in and linux/i386/ioctlent.h.in, remove asm entries from the former, remove non-asm entries from the latter. * linux/alpha/ioctlent.h: Rename to linux/alpha/ioctlent.h.in, remove non-asm entries. * linux/bfin/ioctlent.h: Rename to linux/bfin/ioctlent.h.in, remove non-asm entries. * linux/hppa/ioctlent.h: Rename to linux/hppa/ioctlent.h.in, remove non-asm entries. * linux/ia64/ioctlent.h: Rename to linux/ia64/ioctlent.h.in, remove non-asm entries. * linux/mips/ioctlent.h: Rename to linux/mips/ioctlent.h.in, remove non-asm entries. * linux/powerpc/ioctlent.h: Rename to linux/powerpc/ioctlent.h.in, remove non-asm entries. * linux/s390/ioctlent.h: Rename to linux/s390/ioctlent.h.in, remove non-asm entries. * linux/sh/ioctlent.h: Rename to linux/sh/ioctlent.h.in, remove non-asm entries. * linux/sparc/ioctlent.h: Rename to linux/sparc/ioctlent.h.in, remove non-asm entries. * linux/arm/ioctlent.h.in: New file. * linux/avr32/ioctlent.h.in: Likewise. * linux/i386/ioctlent.h.in: Likewise. * linux/m68k/ioctlent.h.in: Likewise. * linux/microblaze/ioctlent.h.in: Likewise. * linux/tile/ioctlent.h.in: Likewise. * linux/x86_64/ioctlent.h.in: Likewise. * linux/s390x/ioctlent.h.in: Include ioctlent.h.in instead of ioctlent.h. * linux/sh64/ioctlent.h.in: Likewise. * linux/sparc64/ioctlent.h.in: Likewise. * linux/arm/ioctlent1.h: Update ioctlent.h include. * linux/powerpc/ioctlent1.h: Likewise. * linux/sparc/ioctlent1.h: Likewise. * linux/sparc64/ioctlent1.h: Likewise. * linux/x86_64/ioctlent1.h: Likewise. * Makefile.am (AM_CPPFLAGS): Add -I$(builddir)/$(OS). (EXTRA_DIST): Update. [MAINTAINER_MODE && LINUX]: Convert from ioctlent_h to ioctlent_h_in. [LINUX]: Add $(builddir)/$(OS)/ioctlent.h generation rules. * .gitignore: Add linux/ioctlent.h. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-02-21 07:24:22 +03:00
ioctlsort_CC = $(CC_FOR_BUILD)
ioctl: take all 32 bits of ioctl commands into account Historically, only 16 bits (8-bit number and 8-bit type) of 32-bit ioctl commands were used for decoding, which was the source for numerous annoying collisions like this: ioctl(0, SNDCTL_TMR_TIMEBASE or SNDRV_TIMER_IOCTL_NEXT_DEVICE or TCGETS, {B38400 opost isig icanon echo ...}) = 0 ioctl(0, MGSL_IOCGPARAMS or MMTIMER_GETRES or MTIOCTOP or SNDCTL_MIDI_MPUMODE, 0x7fffd47f7338) = -1 ENOTTY (Inappropriate ioctl for device) The solution is to use all 32 bits for decoding, not just "number" and "type", but also "size" and "direction". As some architectures override defaults that come from asm-generic/ and provide alternative definitions for some ioctl commands, we support per-architecture ioctl definitions and merge them with common definitions at build time. During the merge, we used to keep both generic and architecture-specific definitions, now architecture-specific definitions have precedence over generic ones -- ioctlsort omits definitions from asm-generic/ for those ioctl names that have different definitions in asm/. Additional bits of "direction" are architecture specific -- the number of bits and their values differ between architectures. To reduce architecture differences in the source code, we keep "direction" in symbolic form and compile it in ioctlsort. Additional bits of "size" are also architecture specific -- not only the number of bits differ between architectures, but sizes of many types depend on sizeof(long). To reduce architecture differences in the source code, we keep 32-bit and 64-bit versions of common ioctl definitions, and use the appropriate version for each architecture and personality. To implement this, the tools for generating ioctl definitions from kernel headers have been rewritten, and the source format of ioctl definitions has been extended. The final ioctlent*.h files that are included by syscall.c are now generated from source ioctls_inc*.h and ioctls_arch*.h files at build time with ioctlsort. * ioctl.c (ioctl_lookup): Use all 32 bits of ioctl command code. * ioctlsort.c: Rewritten. * linux/32/ioctls_inc.h: New file. * linux/64/ioctls_inc.h: New file. * linux/aarch64/ioctls_arch0.h: New file. * linux/aarch64/ioctls_arch1.h: New file. * linux/aarch64/ioctls_inc0.h: New file. * linux/aarch64/ioctls_inc1.h: New file. * linux/alpha/ioctls_arch0.h: New file. * linux/alpha/ioctls_inc0.h: New file. * linux/arc/ioctls_arch0.h: New file. * linux/arc/ioctls_inc0.h: New file. * linux/arm/ioctls_arch0.h: New file. * linux/arm/ioctls_inc0.h: New file. * linux/avr32/ioctls_arch0.h: New file. * linux/avr32/ioctls_inc0.h: New file. * linux/bfin/ioctls_arch0.h: New file. * linux/bfin/ioctls_inc0.h: New file. * linux/hppa/ioctls_arch0.h: New file. * linux/hppa/ioctls_inc0.h: New file. * linux/i386/ioctls_arch0.h: New file. * linux/i386/ioctls_inc0.h: New file. * linux/ia64/ioctls_arch0.h: New file. * linux/ia64/ioctls_inc0.h: New file. * linux/m68k/ioctls_arch0.h: New file. * linux/m68k/ioctls_inc0.h: New file. * linux/metag/ioctls_arch0.h: New file. * linux/metag/ioctls_inc0.h: New file. * linux/microblaze/ioctls_arch0.h: New file. * linux/microblaze/ioctls_inc0.h: New file. * linux/mips/ioctls_arch0.h: New file. * linux/mips/ioctls_inc0.h: New file. * linux/or1k/ioctls_arch0.h: New file. * linux/or1k/ioctls_inc0.h: New file. * linux/powerpc/ioctls_arch0.h: New file. * linux/powerpc/ioctls_inc0.h: New file. * linux/powerpc64/ioctls_arch0.h: New file. * linux/powerpc64/ioctls_arch1.h: New file. * linux/powerpc64/ioctls_inc0.h: New file. * linux/powerpc64/ioctls_inc1.h: New file. * linux/s390/ioctls_arch0.h: New file. * linux/s390/ioctls_inc0.h: New file. * linux/s390x/ioctls_arch0.h: New file. * linux/s390x/ioctls_inc0.h: New file. * linux/sh/ioctls_arch0.h: New file. * linux/sh/ioctls_inc0.h: New file. * linux/sh64/ioctls_arch0.h: New file. * linux/sh64/ioctls_inc0.h: New file. * linux/sparc/ioctls_arch0.h: New file. * linux/sparc/ioctls_inc0.h: New file. * linux/sparc64/ioctls_arch0.h: New file. * linux/sparc64/ioctls_arch2.h: New file. * linux/sparc64/ioctls_inc0.h: New file. * linux/sparc64/ioctls_inc2.h: New file. * linux/tile/ioctls_arch0.h: New file. * linux/tile/ioctls_arch1.h: New file. * linux/tile/ioctls_inc0.h: New file. * linux/tile/ioctls_inc1.h: New file. * linux/x32/ioctls_arch0.h: New file. * linux/x32/ioctls_arch1.h: New file. * linux/x32/ioctls_inc0.h: New file. * linux/x32/ioctls_inc1.h: New file. * linux/x86_64/ioctls_arch0.h: New file. * linux/x86_64/ioctls_arch1.h: New file. * linux/x86_64/ioctls_inc0.h: New file. * linux/x86_64/ioctls_inc1.h: New file. * linux/xtensa/ioctls_arch0.h: New file. * linux/xtensa/ioctls_inc0.h: New file. * linux/aarch64/ioctlent.h.in: Remove. * linux/aarch64/ioctlent1.h: Remove. * linux/alpha/ioctlent.h.in: Remove. * linux/arc/ioctlent.h.in: Remove. * linux/arm/ioctlent.h.in: Remove. * linux/avr32/ioctlent.h.in: Remove. * linux/bfin/ioctlent.h.in: Remove. * linux/hppa/ioctlent.h.in: Remove. * linux/i386/ioctlent.h.in: Remove. * linux/ia64/ioctlent.h.in: Remove. * linux/ioctlent.h.in: Remove. * linux/ioctlent.sh: Remove. * linux/m68k/ioctlent.h.in: Remove. * linux/metag/ioctlent.h.in: Remove. * linux/microblaze/ioctlent.h.in: Remove. * linux/mips/ioctlent.h.in: Remove. * linux/mips/ioctlent.sh: Remove. * linux/or1k/ioctlent.h.in: Remove. * linux/powerpc/ioctlent.h.in: Remove. * linux/powerpc64/ioctlent.h: Remove. * linux/powerpc64/ioctlent1.h: Remove. * linux/s390/ioctlent.h.in: Remove. * linux/s390x/ioctlent.h.in: Remove. * linux/sh/ioctlent.h.in: Remove. * linux/sh64/ioctlent.h.in: Remove. * linux/sparc/ioctlent.h.in: Remove. * linux/sparc64/ioctlent.h.in: Remove. * linux/sparc64/ioctlent2.h: Remove. * linux/tile/ioctlent.h.in: Remove. * linux/tile/ioctlent1.h: Remove. * linux/x32/ioctlent.h.in: Remove. * linux/x32/ioctlent1.h: Remove. * linux/x86_64/ioctlent.h.in: Remove. * linux/x86_64/ioctlent1.h: Remove. * linux/xtensa/ioctlent.h.in: Remove. * linux/x86_64/ioctlent2.h: Include ioctlent0.h instead of ioctlent.h. * syscall.c (struct_ioctlent ioctlent0): Likewise. * Makefile.am: Remove all ioctlent-related definitions. Define the list of ioctlent*.h files that have to be generated by presence of $(srcdir)/$(OS)/$(ARCH)/ioctls_inc*.h files. Add rules for ioctlent*.h files generation. (EXTRA_DIST): Update. * maint/ioctls_gen.sh: New file. * maint/ioctls_hex.sh: New file. * maint/ioctls_sym.sh: New file. * maint/print_ioctlent.c: New file. * HACKING-scripts: Update for ioctlent.sh -> ioctls_gen.sh migration. * .gitignore: Add ioctlent[012].h and ioctls_all[012].h. * configure.ac (AC_CHECK_HEADERS): Add linux/hiddev.h and linux/mmtimer.h for tests. * tests/ioctl.c: New file. * tests/ioctl.test: New test. * tests/Makefile.am (check_PROGRAMS): Add ioctl. (TESTS): Add ioctl.test. * tests/.gitignore: Add ioctl.
2015-01-19 20:02:16 +03:00
ioctlsort_DEFS = $(DEFS)
ioctlsort_INCLUDES = $(DEFAULT_INCLUDES) $(INCLUDES)
Makefile.am: don't confuse CFLAGS and CFLAGS_FOR_BUILD Commit dc427d50d96b15c9a64d7e78d97ce4d194622a63 enabled a number of extra warning flags through configure.ac. The configure script will determine dynamically if CC supports these flags before adding them to WARN_CFLAGS. ioctlsort is compiled with CC_FOR_BUILD, rather than CC. Nevertheless, the flags passed to this compilation also include WARN_CFLAGS (through AM_CFLAGS). This is incorrect: in a cross-compilation use case, CC and CC_FOR_BUILD are not the same. The former is the cross-compiler, the latter is the host compiler. Both may be of different versions and support different warning flags. In particular, this posed a problem when cross-compiling with a host compiler gcc 4.1, which does not support all the new flags: /usr/bin/gcc -DHAVE_CONFIG_H -I./linux/arm -I./linux/arm -I./linux -I./linux -I. -I. -I/host-sysroot/usr/include -Wall -Wempty-body -Wformat-security -Wignored-qualifiers -Winit-self -Wlogical-op -Wmissing-parameter-type -Wnested-externs -Wold-style-declaration -Wold-style-definition -Wsign-compare -Wtype-limits -Wwrite-strings -O2 -I/host-sysroot/usr/include -DIOCTLSORT_INC=\"ioctls_all0.h\" -c -o ioctlsort0.o ./ioctlsort.c cc1: error: unrecognized command line option "-Wempty-body" cc1: error: unrecognized command line option "-Wignored-qualifiers" cc1: error: unrecognized command line option "-Wlogical-op" cc1: error: unrecognized command line option "-Wmissing-parameter-type" cc1: error: unrecognized command line option "-Wold-style-declaration" cc1: error: unrecognized command line option "-Wtype-limits" make[2]: *** [ioctlsort0.o] Error 1 * Makefile.am (AM_CFLAGS_FOR_BUILD, AM_CPPFLAGS_FOR_BUILD): New variables. (ioctlsort_CPPFLAGS): Use AM_CPPFLAGS_FOR_BUILD instead of AM_CPPFLAGS. (ioctlsort_CFLAGS): Use AM_CFLAGS_FOR_BUILD instead of AM_CFLAGS. (ioctlsort_LDFLAGS): Use AM_LDFLAGS_FOR_BUILD instead of AM_LDFLAGS. * m4/ax_prog_cc_for_build.m4 (AX_PROG_CC_FOR_BUILD): Redirect WARN_CFLAGS and gl_unknown_warnings_are_errors, call st_WARN_CFLAGS, substitute WARN_CFLAGS_FOR_BUILD. Signed-off-by: Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
2016-10-18 14:42:44 +03:00
ioctlsort_CPPFLAGS = $(AM_CPPFLAGS_FOR_BUILD) $(CPPFLAGS_FOR_BUILD)
ioctlsort_CFLAGS = $(AM_CFLAGS_FOR_BUILD) $(CFLAGS_FOR_BUILD)
ioctlsort_LDFLAGS = $(AM_LDFLAGS_FOR_BUILD) $(LDFLAGS_FOR_BUILD)
ioctl: take all 32 bits of ioctl commands into account Historically, only 16 bits (8-bit number and 8-bit type) of 32-bit ioctl commands were used for decoding, which was the source for numerous annoying collisions like this: ioctl(0, SNDCTL_TMR_TIMEBASE or SNDRV_TIMER_IOCTL_NEXT_DEVICE or TCGETS, {B38400 opost isig icanon echo ...}) = 0 ioctl(0, MGSL_IOCGPARAMS or MMTIMER_GETRES or MTIOCTOP or SNDCTL_MIDI_MPUMODE, 0x7fffd47f7338) = -1 ENOTTY (Inappropriate ioctl for device) The solution is to use all 32 bits for decoding, not just "number" and "type", but also "size" and "direction". As some architectures override defaults that come from asm-generic/ and provide alternative definitions for some ioctl commands, we support per-architecture ioctl definitions and merge them with common definitions at build time. During the merge, we used to keep both generic and architecture-specific definitions, now architecture-specific definitions have precedence over generic ones -- ioctlsort omits definitions from asm-generic/ for those ioctl names that have different definitions in asm/. Additional bits of "direction" are architecture specific -- the number of bits and their values differ between architectures. To reduce architecture differences in the source code, we keep "direction" in symbolic form and compile it in ioctlsort. Additional bits of "size" are also architecture specific -- not only the number of bits differ between architectures, but sizes of many types depend on sizeof(long). To reduce architecture differences in the source code, we keep 32-bit and 64-bit versions of common ioctl definitions, and use the appropriate version for each architecture and personality. To implement this, the tools for generating ioctl definitions from kernel headers have been rewritten, and the source format of ioctl definitions has been extended. The final ioctlent*.h files that are included by syscall.c are now generated from source ioctls_inc*.h and ioctls_arch*.h files at build time with ioctlsort. * ioctl.c (ioctl_lookup): Use all 32 bits of ioctl command code. * ioctlsort.c: Rewritten. * linux/32/ioctls_inc.h: New file. * linux/64/ioctls_inc.h: New file. * linux/aarch64/ioctls_arch0.h: New file. * linux/aarch64/ioctls_arch1.h: New file. * linux/aarch64/ioctls_inc0.h: New file. * linux/aarch64/ioctls_inc1.h: New file. * linux/alpha/ioctls_arch0.h: New file. * linux/alpha/ioctls_inc0.h: New file. * linux/arc/ioctls_arch0.h: New file. * linux/arc/ioctls_inc0.h: New file. * linux/arm/ioctls_arch0.h: New file. * linux/arm/ioctls_inc0.h: New file. * linux/avr32/ioctls_arch0.h: New file. * linux/avr32/ioctls_inc0.h: New file. * linux/bfin/ioctls_arch0.h: New file. * linux/bfin/ioctls_inc0.h: New file. * linux/hppa/ioctls_arch0.h: New file. * linux/hppa/ioctls_inc0.h: New file. * linux/i386/ioctls_arch0.h: New file. * linux/i386/ioctls_inc0.h: New file. * linux/ia64/ioctls_arch0.h: New file. * linux/ia64/ioctls_inc0.h: New file. * linux/m68k/ioctls_arch0.h: New file. * linux/m68k/ioctls_inc0.h: New file. * linux/metag/ioctls_arch0.h: New file. * linux/metag/ioctls_inc0.h: New file. * linux/microblaze/ioctls_arch0.h: New file. * linux/microblaze/ioctls_inc0.h: New file. * linux/mips/ioctls_arch0.h: New file. * linux/mips/ioctls_inc0.h: New file. * linux/or1k/ioctls_arch0.h: New file. * linux/or1k/ioctls_inc0.h: New file. * linux/powerpc/ioctls_arch0.h: New file. * linux/powerpc/ioctls_inc0.h: New file. * linux/powerpc64/ioctls_arch0.h: New file. * linux/powerpc64/ioctls_arch1.h: New file. * linux/powerpc64/ioctls_inc0.h: New file. * linux/powerpc64/ioctls_inc1.h: New file. * linux/s390/ioctls_arch0.h: New file. * linux/s390/ioctls_inc0.h: New file. * linux/s390x/ioctls_arch0.h: New file. * linux/s390x/ioctls_inc0.h: New file. * linux/sh/ioctls_arch0.h: New file. * linux/sh/ioctls_inc0.h: New file. * linux/sh64/ioctls_arch0.h: New file. * linux/sh64/ioctls_inc0.h: New file. * linux/sparc/ioctls_arch0.h: New file. * linux/sparc/ioctls_inc0.h: New file. * linux/sparc64/ioctls_arch0.h: New file. * linux/sparc64/ioctls_arch2.h: New file. * linux/sparc64/ioctls_inc0.h: New file. * linux/sparc64/ioctls_inc2.h: New file. * linux/tile/ioctls_arch0.h: New file. * linux/tile/ioctls_arch1.h: New file. * linux/tile/ioctls_inc0.h: New file. * linux/tile/ioctls_inc1.h: New file. * linux/x32/ioctls_arch0.h: New file. * linux/x32/ioctls_arch1.h: New file. * linux/x32/ioctls_inc0.h: New file. * linux/x32/ioctls_inc1.h: New file. * linux/x86_64/ioctls_arch0.h: New file. * linux/x86_64/ioctls_arch1.h: New file. * linux/x86_64/ioctls_inc0.h: New file. * linux/x86_64/ioctls_inc1.h: New file. * linux/xtensa/ioctls_arch0.h: New file. * linux/xtensa/ioctls_inc0.h: New file. * linux/aarch64/ioctlent.h.in: Remove. * linux/aarch64/ioctlent1.h: Remove. * linux/alpha/ioctlent.h.in: Remove. * linux/arc/ioctlent.h.in: Remove. * linux/arm/ioctlent.h.in: Remove. * linux/avr32/ioctlent.h.in: Remove. * linux/bfin/ioctlent.h.in: Remove. * linux/hppa/ioctlent.h.in: Remove. * linux/i386/ioctlent.h.in: Remove. * linux/ia64/ioctlent.h.in: Remove. * linux/ioctlent.h.in: Remove. * linux/ioctlent.sh: Remove. * linux/m68k/ioctlent.h.in: Remove. * linux/metag/ioctlent.h.in: Remove. * linux/microblaze/ioctlent.h.in: Remove. * linux/mips/ioctlent.h.in: Remove. * linux/mips/ioctlent.sh: Remove. * linux/or1k/ioctlent.h.in: Remove. * linux/powerpc/ioctlent.h.in: Remove. * linux/powerpc64/ioctlent.h: Remove. * linux/powerpc64/ioctlent1.h: Remove. * linux/s390/ioctlent.h.in: Remove. * linux/s390x/ioctlent.h.in: Remove. * linux/sh/ioctlent.h.in: Remove. * linux/sh64/ioctlent.h.in: Remove. * linux/sparc/ioctlent.h.in: Remove. * linux/sparc64/ioctlent.h.in: Remove. * linux/sparc64/ioctlent2.h: Remove. * linux/tile/ioctlent.h.in: Remove. * linux/tile/ioctlent1.h: Remove. * linux/x32/ioctlent.h.in: Remove. * linux/x32/ioctlent1.h: Remove. * linux/x86_64/ioctlent.h.in: Remove. * linux/x86_64/ioctlent1.h: Remove. * linux/xtensa/ioctlent.h.in: Remove. * linux/x86_64/ioctlent2.h: Include ioctlent0.h instead of ioctlent.h. * syscall.c (struct_ioctlent ioctlent0): Likewise. * Makefile.am: Remove all ioctlent-related definitions. Define the list of ioctlent*.h files that have to be generated by presence of $(srcdir)/$(OS)/$(ARCH)/ioctls_inc*.h files. Add rules for ioctlent*.h files generation. (EXTRA_DIST): Update. * maint/ioctls_gen.sh: New file. * maint/ioctls_hex.sh: New file. * maint/ioctls_sym.sh: New file. * maint/print_ioctlent.c: New file. * HACKING-scripts: Update for ioctlent.sh -> ioctls_gen.sh migration. * .gitignore: Add ioctlent[012].h and ioctls_all[012].h. * configure.ac (AC_CHECK_HEADERS): Add linux/hiddev.h and linux/mmtimer.h for tests. * tests/ioctl.c: New file. * tests/ioctl.test: New test. * tests/Makefile.am (check_PROGRAMS): Add ioctl. (TESTS): Add ioctl.test. * tests/.gitignore: Add ioctl.
2015-01-19 20:02:16 +03:00
ioctls_inc_h = $(wildcard $(srcdir)/$(OS)/$(ARCH)/ioctls_inc*.h)
ioctlent_h = $(patsubst $(srcdir)/$(OS)/$(ARCH)/ioctls_inc%,ioctlent%,$(ioctls_inc_h))
ioctl_redefs_h = $(filter-out ioctl_redefs0.h,$(subst ioctlent,ioctl_redefs,$(ioctlent_h)))
ioctl_redefs%.h: ioctlent%.h ioctlent0.h
sort $< > $<-t
sort ioctlent0.h | comm -23 $<-t - | \
sed -r -n 's/^\{ "([^"]+)", (0x[[:xdigit:]]+) \},$$/#ifdef \1\n# undef \1\n# define \1 \2\n#endif/p' \
> $@-t
rm -f $<-t
mv $@-t $@
ioctl: take all 32 bits of ioctl commands into account Historically, only 16 bits (8-bit number and 8-bit type) of 32-bit ioctl commands were used for decoding, which was the source for numerous annoying collisions like this: ioctl(0, SNDCTL_TMR_TIMEBASE or SNDRV_TIMER_IOCTL_NEXT_DEVICE or TCGETS, {B38400 opost isig icanon echo ...}) = 0 ioctl(0, MGSL_IOCGPARAMS or MMTIMER_GETRES or MTIOCTOP or SNDCTL_MIDI_MPUMODE, 0x7fffd47f7338) = -1 ENOTTY (Inappropriate ioctl for device) The solution is to use all 32 bits for decoding, not just "number" and "type", but also "size" and "direction". As some architectures override defaults that come from asm-generic/ and provide alternative definitions for some ioctl commands, we support per-architecture ioctl definitions and merge them with common definitions at build time. During the merge, we used to keep both generic and architecture-specific definitions, now architecture-specific definitions have precedence over generic ones -- ioctlsort omits definitions from asm-generic/ for those ioctl names that have different definitions in asm/. Additional bits of "direction" are architecture specific -- the number of bits and their values differ between architectures. To reduce architecture differences in the source code, we keep "direction" in symbolic form and compile it in ioctlsort. Additional bits of "size" are also architecture specific -- not only the number of bits differ between architectures, but sizes of many types depend on sizeof(long). To reduce architecture differences in the source code, we keep 32-bit and 64-bit versions of common ioctl definitions, and use the appropriate version for each architecture and personality. To implement this, the tools for generating ioctl definitions from kernel headers have been rewritten, and the source format of ioctl definitions has been extended. The final ioctlent*.h files that are included by syscall.c are now generated from source ioctls_inc*.h and ioctls_arch*.h files at build time with ioctlsort. * ioctl.c (ioctl_lookup): Use all 32 bits of ioctl command code. * ioctlsort.c: Rewritten. * linux/32/ioctls_inc.h: New file. * linux/64/ioctls_inc.h: New file. * linux/aarch64/ioctls_arch0.h: New file. * linux/aarch64/ioctls_arch1.h: New file. * linux/aarch64/ioctls_inc0.h: New file. * linux/aarch64/ioctls_inc1.h: New file. * linux/alpha/ioctls_arch0.h: New file. * linux/alpha/ioctls_inc0.h: New file. * linux/arc/ioctls_arch0.h: New file. * linux/arc/ioctls_inc0.h: New file. * linux/arm/ioctls_arch0.h: New file. * linux/arm/ioctls_inc0.h: New file. * linux/avr32/ioctls_arch0.h: New file. * linux/avr32/ioctls_inc0.h: New file. * linux/bfin/ioctls_arch0.h: New file. * linux/bfin/ioctls_inc0.h: New file. * linux/hppa/ioctls_arch0.h: New file. * linux/hppa/ioctls_inc0.h: New file. * linux/i386/ioctls_arch0.h: New file. * linux/i386/ioctls_inc0.h: New file. * linux/ia64/ioctls_arch0.h: New file. * linux/ia64/ioctls_inc0.h: New file. * linux/m68k/ioctls_arch0.h: New file. * linux/m68k/ioctls_inc0.h: New file. * linux/metag/ioctls_arch0.h: New file. * linux/metag/ioctls_inc0.h: New file. * linux/microblaze/ioctls_arch0.h: New file. * linux/microblaze/ioctls_inc0.h: New file. * linux/mips/ioctls_arch0.h: New file. * linux/mips/ioctls_inc0.h: New file. * linux/or1k/ioctls_arch0.h: New file. * linux/or1k/ioctls_inc0.h: New file. * linux/powerpc/ioctls_arch0.h: New file. * linux/powerpc/ioctls_inc0.h: New file. * linux/powerpc64/ioctls_arch0.h: New file. * linux/powerpc64/ioctls_arch1.h: New file. * linux/powerpc64/ioctls_inc0.h: New file. * linux/powerpc64/ioctls_inc1.h: New file. * linux/s390/ioctls_arch0.h: New file. * linux/s390/ioctls_inc0.h: New file. * linux/s390x/ioctls_arch0.h: New file. * linux/s390x/ioctls_inc0.h: New file. * linux/sh/ioctls_arch0.h: New file. * linux/sh/ioctls_inc0.h: New file. * linux/sh64/ioctls_arch0.h: New file. * linux/sh64/ioctls_inc0.h: New file. * linux/sparc/ioctls_arch0.h: New file. * linux/sparc/ioctls_inc0.h: New file. * linux/sparc64/ioctls_arch0.h: New file. * linux/sparc64/ioctls_arch2.h: New file. * linux/sparc64/ioctls_inc0.h: New file. * linux/sparc64/ioctls_inc2.h: New file. * linux/tile/ioctls_arch0.h: New file. * linux/tile/ioctls_arch1.h: New file. * linux/tile/ioctls_inc0.h: New file. * linux/tile/ioctls_inc1.h: New file. * linux/x32/ioctls_arch0.h: New file. * linux/x32/ioctls_arch1.h: New file. * linux/x32/ioctls_inc0.h: New file. * linux/x32/ioctls_inc1.h: New file. * linux/x86_64/ioctls_arch0.h: New file. * linux/x86_64/ioctls_arch1.h: New file. * linux/x86_64/ioctls_inc0.h: New file. * linux/x86_64/ioctls_inc1.h: New file. * linux/xtensa/ioctls_arch0.h: New file. * linux/xtensa/ioctls_inc0.h: New file. * linux/aarch64/ioctlent.h.in: Remove. * linux/aarch64/ioctlent1.h: Remove. * linux/alpha/ioctlent.h.in: Remove. * linux/arc/ioctlent.h.in: Remove. * linux/arm/ioctlent.h.in: Remove. * linux/avr32/ioctlent.h.in: Remove. * linux/bfin/ioctlent.h.in: Remove. * linux/hppa/ioctlent.h.in: Remove. * linux/i386/ioctlent.h.in: Remove. * linux/ia64/ioctlent.h.in: Remove. * linux/ioctlent.h.in: Remove. * linux/ioctlent.sh: Remove. * linux/m68k/ioctlent.h.in: Remove. * linux/metag/ioctlent.h.in: Remove. * linux/microblaze/ioctlent.h.in: Remove. * linux/mips/ioctlent.h.in: Remove. * linux/mips/ioctlent.sh: Remove. * linux/or1k/ioctlent.h.in: Remove. * linux/powerpc/ioctlent.h.in: Remove. * linux/powerpc64/ioctlent.h: Remove. * linux/powerpc64/ioctlent1.h: Remove. * linux/s390/ioctlent.h.in: Remove. * linux/s390x/ioctlent.h.in: Remove. * linux/sh/ioctlent.h.in: Remove. * linux/sh64/ioctlent.h.in: Remove. * linux/sparc/ioctlent.h.in: Remove. * linux/sparc64/ioctlent.h.in: Remove. * linux/sparc64/ioctlent2.h: Remove. * linux/tile/ioctlent.h.in: Remove. * linux/tile/ioctlent1.h: Remove. * linux/x32/ioctlent.h.in: Remove. * linux/x32/ioctlent1.h: Remove. * linux/x86_64/ioctlent.h.in: Remove. * linux/x86_64/ioctlent1.h: Remove. * linux/xtensa/ioctlent.h.in: Remove. * linux/x86_64/ioctlent2.h: Include ioctlent0.h instead of ioctlent.h. * syscall.c (struct_ioctlent ioctlent0): Likewise. * Makefile.am: Remove all ioctlent-related definitions. Define the list of ioctlent*.h files that have to be generated by presence of $(srcdir)/$(OS)/$(ARCH)/ioctls_inc*.h files. Add rules for ioctlent*.h files generation. (EXTRA_DIST): Update. * maint/ioctls_gen.sh: New file. * maint/ioctls_hex.sh: New file. * maint/ioctls_sym.sh: New file. * maint/print_ioctlent.c: New file. * HACKING-scripts: Update for ioctlent.sh -> ioctls_gen.sh migration. * .gitignore: Add ioctlent[012].h and ioctls_all[012].h. * configure.ac (AC_CHECK_HEADERS): Add linux/hiddev.h and linux/mmtimer.h for tests. * tests/ioctl.c: New file. * tests/ioctl.test: New test. * tests/Makefile.am (check_PROGRAMS): Add ioctl. (TESTS): Add ioctl.test. * tests/.gitignore: Add ioctl.
2015-01-19 20:02:16 +03:00
ioctlent%.h: ioctlsort%
./$< > $@
ioctlsort%$(BUILD_EXEEXT): ioctlsort%.o
$(ioctlsort_CC) $(ioctlsort_CFLAGS) $(ioctlsort_LDFLAGS) $< -o $@
ioctl: take all 32 bits of ioctl commands into account Historically, only 16 bits (8-bit number and 8-bit type) of 32-bit ioctl commands were used for decoding, which was the source for numerous annoying collisions like this: ioctl(0, SNDCTL_TMR_TIMEBASE or SNDRV_TIMER_IOCTL_NEXT_DEVICE or TCGETS, {B38400 opost isig icanon echo ...}) = 0 ioctl(0, MGSL_IOCGPARAMS or MMTIMER_GETRES or MTIOCTOP or SNDCTL_MIDI_MPUMODE, 0x7fffd47f7338) = -1 ENOTTY (Inappropriate ioctl for device) The solution is to use all 32 bits for decoding, not just "number" and "type", but also "size" and "direction". As some architectures override defaults that come from asm-generic/ and provide alternative definitions for some ioctl commands, we support per-architecture ioctl definitions and merge them with common definitions at build time. During the merge, we used to keep both generic and architecture-specific definitions, now architecture-specific definitions have precedence over generic ones -- ioctlsort omits definitions from asm-generic/ for those ioctl names that have different definitions in asm/. Additional bits of "direction" are architecture specific -- the number of bits and their values differ between architectures. To reduce architecture differences in the source code, we keep "direction" in symbolic form and compile it in ioctlsort. Additional bits of "size" are also architecture specific -- not only the number of bits differ between architectures, but sizes of many types depend on sizeof(long). To reduce architecture differences in the source code, we keep 32-bit and 64-bit versions of common ioctl definitions, and use the appropriate version for each architecture and personality. To implement this, the tools for generating ioctl definitions from kernel headers have been rewritten, and the source format of ioctl definitions has been extended. The final ioctlent*.h files that are included by syscall.c are now generated from source ioctls_inc*.h and ioctls_arch*.h files at build time with ioctlsort. * ioctl.c (ioctl_lookup): Use all 32 bits of ioctl command code. * ioctlsort.c: Rewritten. * linux/32/ioctls_inc.h: New file. * linux/64/ioctls_inc.h: New file. * linux/aarch64/ioctls_arch0.h: New file. * linux/aarch64/ioctls_arch1.h: New file. * linux/aarch64/ioctls_inc0.h: New file. * linux/aarch64/ioctls_inc1.h: New file. * linux/alpha/ioctls_arch0.h: New file. * linux/alpha/ioctls_inc0.h: New file. * linux/arc/ioctls_arch0.h: New file. * linux/arc/ioctls_inc0.h: New file. * linux/arm/ioctls_arch0.h: New file. * linux/arm/ioctls_inc0.h: New file. * linux/avr32/ioctls_arch0.h: New file. * linux/avr32/ioctls_inc0.h: New file. * linux/bfin/ioctls_arch0.h: New file. * linux/bfin/ioctls_inc0.h: New file. * linux/hppa/ioctls_arch0.h: New file. * linux/hppa/ioctls_inc0.h: New file. * linux/i386/ioctls_arch0.h: New file. * linux/i386/ioctls_inc0.h: New file. * linux/ia64/ioctls_arch0.h: New file. * linux/ia64/ioctls_inc0.h: New file. * linux/m68k/ioctls_arch0.h: New file. * linux/m68k/ioctls_inc0.h: New file. * linux/metag/ioctls_arch0.h: New file. * linux/metag/ioctls_inc0.h: New file. * linux/microblaze/ioctls_arch0.h: New file. * linux/microblaze/ioctls_inc0.h: New file. * linux/mips/ioctls_arch0.h: New file. * linux/mips/ioctls_inc0.h: New file. * linux/or1k/ioctls_arch0.h: New file. * linux/or1k/ioctls_inc0.h: New file. * linux/powerpc/ioctls_arch0.h: New file. * linux/powerpc/ioctls_inc0.h: New file. * linux/powerpc64/ioctls_arch0.h: New file. * linux/powerpc64/ioctls_arch1.h: New file. * linux/powerpc64/ioctls_inc0.h: New file. * linux/powerpc64/ioctls_inc1.h: New file. * linux/s390/ioctls_arch0.h: New file. * linux/s390/ioctls_inc0.h: New file. * linux/s390x/ioctls_arch0.h: New file. * linux/s390x/ioctls_inc0.h: New file. * linux/sh/ioctls_arch0.h: New file. * linux/sh/ioctls_inc0.h: New file. * linux/sh64/ioctls_arch0.h: New file. * linux/sh64/ioctls_inc0.h: New file. * linux/sparc/ioctls_arch0.h: New file. * linux/sparc/ioctls_inc0.h: New file. * linux/sparc64/ioctls_arch0.h: New file. * linux/sparc64/ioctls_arch2.h: New file. * linux/sparc64/ioctls_inc0.h: New file. * linux/sparc64/ioctls_inc2.h: New file. * linux/tile/ioctls_arch0.h: New file. * linux/tile/ioctls_arch1.h: New file. * linux/tile/ioctls_inc0.h: New file. * linux/tile/ioctls_inc1.h: New file. * linux/x32/ioctls_arch0.h: New file. * linux/x32/ioctls_arch1.h: New file. * linux/x32/ioctls_inc0.h: New file. * linux/x32/ioctls_inc1.h: New file. * linux/x86_64/ioctls_arch0.h: New file. * linux/x86_64/ioctls_arch1.h: New file. * linux/x86_64/ioctls_inc0.h: New file. * linux/x86_64/ioctls_inc1.h: New file. * linux/xtensa/ioctls_arch0.h: New file. * linux/xtensa/ioctls_inc0.h: New file. * linux/aarch64/ioctlent.h.in: Remove. * linux/aarch64/ioctlent1.h: Remove. * linux/alpha/ioctlent.h.in: Remove. * linux/arc/ioctlent.h.in: Remove. * linux/arm/ioctlent.h.in: Remove. * linux/avr32/ioctlent.h.in: Remove. * linux/bfin/ioctlent.h.in: Remove. * linux/hppa/ioctlent.h.in: Remove. * linux/i386/ioctlent.h.in: Remove. * linux/ia64/ioctlent.h.in: Remove. * linux/ioctlent.h.in: Remove. * linux/ioctlent.sh: Remove. * linux/m68k/ioctlent.h.in: Remove. * linux/metag/ioctlent.h.in: Remove. * linux/microblaze/ioctlent.h.in: Remove. * linux/mips/ioctlent.h.in: Remove. * linux/mips/ioctlent.sh: Remove. * linux/or1k/ioctlent.h.in: Remove. * linux/powerpc/ioctlent.h.in: Remove. * linux/powerpc64/ioctlent.h: Remove. * linux/powerpc64/ioctlent1.h: Remove. * linux/s390/ioctlent.h.in: Remove. * linux/s390x/ioctlent.h.in: Remove. * linux/sh/ioctlent.h.in: Remove. * linux/sh64/ioctlent.h.in: Remove. * linux/sparc/ioctlent.h.in: Remove. * linux/sparc64/ioctlent.h.in: Remove. * linux/sparc64/ioctlent2.h: Remove. * linux/tile/ioctlent.h.in: Remove. * linux/tile/ioctlent1.h: Remove. * linux/x32/ioctlent.h.in: Remove. * linux/x32/ioctlent1.h: Remove. * linux/x86_64/ioctlent.h.in: Remove. * linux/x86_64/ioctlent1.h: Remove. * linux/xtensa/ioctlent.h.in: Remove. * linux/x86_64/ioctlent2.h: Include ioctlent0.h instead of ioctlent.h. * syscall.c (struct_ioctlent ioctlent0): Likewise. * Makefile.am: Remove all ioctlent-related definitions. Define the list of ioctlent*.h files that have to be generated by presence of $(srcdir)/$(OS)/$(ARCH)/ioctls_inc*.h files. Add rules for ioctlent*.h files generation. (EXTRA_DIST): Update. * maint/ioctls_gen.sh: New file. * maint/ioctls_hex.sh: New file. * maint/ioctls_sym.sh: New file. * maint/print_ioctlent.c: New file. * HACKING-scripts: Update for ioctlent.sh -> ioctls_gen.sh migration. * .gitignore: Add ioctlent[012].h and ioctls_all[012].h. * configure.ac (AC_CHECK_HEADERS): Add linux/hiddev.h and linux/mmtimer.h for tests. * tests/ioctl.c: New file. * tests/ioctl.test: New test. * tests/Makefile.am (check_PROGRAMS): Add ioctl. (TESTS): Add ioctl.test. * tests/.gitignore: Add ioctl.
2015-01-19 20:02:16 +03:00
ioctlsort%.o: ioctls_all%.h $(srcdir)/ioctlsort.c
$(ioctlsort_CC) $(ioctlsort_DEFS) $(ioctlsort_INCLUDES) $(ioctlsort_CPPFLAGS) $(ioctlsort_CFLAGS) -DIOCTLSORT_INC=\"$<\" -c -o $@ $(srcdir)/ioctlsort.c
ioctls_all%.h: $(srcdir)/$(OS)/$(ARCH)/ioctls_inc%.h $(srcdir)/$(OS)/$(ARCH)/ioctls_arch%.h
cat $^ > $@
BUILT_SOURCES = $(ioctl_redefs_h) $(ioctlent_h) \
native_printer_decls.h native_printer_defs.h printers.h sen.h sys_func.h .version
CLEANFILES = $(ioctl_redefs_h) $(ioctlent_h) $(mpers_preproc_files) \
native_printer_decls.h native_printer_defs.h printers.h sen.h sys_func.h
DISTCLEANFILES = gnu/stubs-32.h gnu/stubs-x32.h
Add mpers support Add a subsystem for semi-automatical definition of how parsers should work with personality-dependent (mpers) types of tracee's data. Create auxiliary libraries containing mpers syscall parsers and printer functions, one library for each possible nonnative target personality. Currently some parsers do not handle differences in definitions of data types between personalities, namely LP64 and ILP32. When this is the case, long integers, pointers, and all compound types containing long and pointer members may be printed incorrectly, because of differences in sizes, offsets and alignments. Since in most cases these are the only differences in desired behaviour of parsers and printers for different personalities, a correct way would be to compile one source code into multiple parsers, differing only in definitions of mpers types. To get a definition of a given type for nonnative personality a very basic .c file containing a declaration of a variable of this type is being compiled for this personality (using -m32 or -mx32 compiler flag). Information about the type is then being extracted from this binary's DWARF debug info with an awk script and put into a corresponding header file. Resulting headers are being used to compile mpers variations of syscall parsers and printer functions. In addition to syscall parsers, there can occur a need to create mpers printing functions, which then can be called from many places in the code (for example, printsiginfo_at). Such functions (printers) are marked in a special manner. For each possible nonnative target personality a library is being created, containing mpers variations of syscall parsers and printers. Only syscall parsers from files marked in a special manner and specially marked functions from such files are being recompiled and included in these libraries. generate_mpers_am.sh is called by bootstrap to find the files from strace_SOURCES which include MPERS_DEFS. During compilation, these files are being inspected for inclusions of DEF_MPERS_TYPE, and nonnative variations of each included type are being generated by an awk script. Mpers parser names are being modified during inclusions of syscallent headers for nonnative personalities. Pointers to printers are being stored in structs struct_printers, and a master pointer printers is being updated on every set_personality. * README-mpers: New README explaining how to use mpers support. * empty.h: New empty file. * generate_mpers_am.sh: New file. * mpers.awk: Likewise. * mpers.sh: Likewise. * mpers_test.sh: Likewise. * mpers_type.h: Likewise. * Makefile.am (strace_SOURCES): Add empty.h and mpers_type.h. (strace_CPPFLAGS, strace_LDFLAGS, strace_LDADD): Move to the beginning of the file. (strace_LDADD, noinst_LIBRARIES): Add libmpers-%.a. (EXTRA_DIST): Add mpers.awk, mpers.sh, mpers_test.sh. (BUILT_SOURCES, CLEANFILES): Add new generated files: native_printer_decls.h, native_printer_defs.h, printers.h, [HAVE_M32_MPERS] $(mpers_m32_targets), and [HAVE_MX32_MPERS] $(mpers_mx32_targets). (mpers_NAME, mpers_PREFIX, mpers_DEFS, mpers_INCLUDES, mpers_CPPFLAGS, mpers_sh_opts, libmpers_CPPFLAGS, libmpers_m[x]32_a_SOURCES, libmpers_m[x]32_a_CPPFLAGS, mpers_m[x]32_targets): New variables. (mpers-m[x]32.stamp, m[x]32_defs.h, m[x]32_funcs.h, printers.h, %_printer_decls.h, %_printer_defs.h, clean-local, native_printer_decls.h, native_printer_defs.h, $mpers_m[x]32_targets): New targets. * bootstrap: Add generate_mpers_am.sh. * configure.ac: Add AC_PROG_RANLIB. * m4/mpers.m4: Add HAVE_MPERS variable. Add $st_cv_mpers checks. * defs.h: Include mpers_type.h. Include printers.h, native_printer_decls.h, define MPERS_PRINTER_NAME. Redefine SYS_FUNC_NAME. Define MPERS_PRINTER_DECL. [HAVE_M32_MPERS]: define PERSONALITY1_INCLUDE_FUNCS, PERSONALITY1_INCLUDE_PRINTERS_DECLS, PERSONALITY1_INCLUDE_PRINTERS_DEFS for X86_64, X32. [HAVE_MX32_MPERS]: define PERSONALITY2_INCLUDE_FUNCS, PERSONALITY2_INCLUDE_PRINTERS_DECLS, PERSONALITY2_INCLUDE_PRINTERS_DEFS for X86_64. Add fallback definitions of PERSONALITY1_INCLUDE_FUNCS, PERSONALITY2_INCLUDE_FUNCS, PERSONALITY0_INCLUDE_PRINTERS_DECLS, PERSONALITY0_INCLUDE_PRINTERS_DEFS, PERSONALITY1_INCLUDE_PRINTERS_DECLS, PERSONALITY1_INCLUDE_PRINTERS_DEFS, PERSONALITY2_INCLUDE_PRINTERS_DECLS, PERSONALITY2_INCLUDE_PRINTERS_DEFS. * syscall.c: Include PERSONALITY1_INCLUDE_FUNCS, PERSONALITY2_INCLUDE_FUNCS, PERSONALITY0_INCLUDE_PRINTERS_DECLS, PERSONALITY0_INCLUDE_PRINTERS_DEFS, PERSONALITY1_INCLUDE_PRINTERS_DECLS, PERSONALITY1_INCLUDE_PRINTERS_DEFS, PERSONALITY2_INCLUDE_PRINTERS_DECLS, PERSONALITY2_INCLUDE_PRINTERS_DEFS. (printers): New struct. Update it when needed. * .gitignore: Add libmpers-m32.a, libmpers-mx32.a, m32_defs.h, m32_funcs.h, m32_printer_decls.h, m32_printer_defs.h, mpers-m32, mpers-m32.stamp, mpers-mx32, mpers-mx32.stamp, mpers.am, mx32_defs.h, mx32_funcs.h, mx32_printer_decls.h, mx32_printer_defs.h, native_printer_decls.h, native_printer_defs.h, and printers.h.
2015-08-04 01:47:02 +03:00
# defines mpers_source_files
include mpers.am
srcdir_mpers_source_files = $(patsubst %,$(srcdir)/%,$(mpers_source_files))
mpers_preproc_files = $(mpers_source_files:.c=.c.mpers.i)
Add mpers support Add a subsystem for semi-automatical definition of how parsers should work with personality-dependent (mpers) types of tracee's data. Create auxiliary libraries containing mpers syscall parsers and printer functions, one library for each possible nonnative target personality. Currently some parsers do not handle differences in definitions of data types between personalities, namely LP64 and ILP32. When this is the case, long integers, pointers, and all compound types containing long and pointer members may be printed incorrectly, because of differences in sizes, offsets and alignments. Since in most cases these are the only differences in desired behaviour of parsers and printers for different personalities, a correct way would be to compile one source code into multiple parsers, differing only in definitions of mpers types. To get a definition of a given type for nonnative personality a very basic .c file containing a declaration of a variable of this type is being compiled for this personality (using -m32 or -mx32 compiler flag). Information about the type is then being extracted from this binary's DWARF debug info with an awk script and put into a corresponding header file. Resulting headers are being used to compile mpers variations of syscall parsers and printer functions. In addition to syscall parsers, there can occur a need to create mpers printing functions, which then can be called from many places in the code (for example, printsiginfo_at). Such functions (printers) are marked in a special manner. For each possible nonnative target personality a library is being created, containing mpers variations of syscall parsers and printers. Only syscall parsers from files marked in a special manner and specially marked functions from such files are being recompiled and included in these libraries. generate_mpers_am.sh is called by bootstrap to find the files from strace_SOURCES which include MPERS_DEFS. During compilation, these files are being inspected for inclusions of DEF_MPERS_TYPE, and nonnative variations of each included type are being generated by an awk script. Mpers parser names are being modified during inclusions of syscallent headers for nonnative personalities. Pointers to printers are being stored in structs struct_printers, and a master pointer printers is being updated on every set_personality. * README-mpers: New README explaining how to use mpers support. * empty.h: New empty file. * generate_mpers_am.sh: New file. * mpers.awk: Likewise. * mpers.sh: Likewise. * mpers_test.sh: Likewise. * mpers_type.h: Likewise. * Makefile.am (strace_SOURCES): Add empty.h and mpers_type.h. (strace_CPPFLAGS, strace_LDFLAGS, strace_LDADD): Move to the beginning of the file. (strace_LDADD, noinst_LIBRARIES): Add libmpers-%.a. (EXTRA_DIST): Add mpers.awk, mpers.sh, mpers_test.sh. (BUILT_SOURCES, CLEANFILES): Add new generated files: native_printer_decls.h, native_printer_defs.h, printers.h, [HAVE_M32_MPERS] $(mpers_m32_targets), and [HAVE_MX32_MPERS] $(mpers_mx32_targets). (mpers_NAME, mpers_PREFIX, mpers_DEFS, mpers_INCLUDES, mpers_CPPFLAGS, mpers_sh_opts, libmpers_CPPFLAGS, libmpers_m[x]32_a_SOURCES, libmpers_m[x]32_a_CPPFLAGS, mpers_m[x]32_targets): New variables. (mpers-m[x]32.stamp, m[x]32_defs.h, m[x]32_funcs.h, printers.h, %_printer_decls.h, %_printer_defs.h, clean-local, native_printer_decls.h, native_printer_defs.h, $mpers_m[x]32_targets): New targets. * bootstrap: Add generate_mpers_am.sh. * configure.ac: Add AC_PROG_RANLIB. * m4/mpers.m4: Add HAVE_MPERS variable. Add $st_cv_mpers checks. * defs.h: Include mpers_type.h. Include printers.h, native_printer_decls.h, define MPERS_PRINTER_NAME. Redefine SYS_FUNC_NAME. Define MPERS_PRINTER_DECL. [HAVE_M32_MPERS]: define PERSONALITY1_INCLUDE_FUNCS, PERSONALITY1_INCLUDE_PRINTERS_DECLS, PERSONALITY1_INCLUDE_PRINTERS_DEFS for X86_64, X32. [HAVE_MX32_MPERS]: define PERSONALITY2_INCLUDE_FUNCS, PERSONALITY2_INCLUDE_PRINTERS_DECLS, PERSONALITY2_INCLUDE_PRINTERS_DEFS for X86_64. Add fallback definitions of PERSONALITY1_INCLUDE_FUNCS, PERSONALITY2_INCLUDE_FUNCS, PERSONALITY0_INCLUDE_PRINTERS_DECLS, PERSONALITY0_INCLUDE_PRINTERS_DEFS, PERSONALITY1_INCLUDE_PRINTERS_DECLS, PERSONALITY1_INCLUDE_PRINTERS_DEFS, PERSONALITY2_INCLUDE_PRINTERS_DECLS, PERSONALITY2_INCLUDE_PRINTERS_DEFS. * syscall.c: Include PERSONALITY1_INCLUDE_FUNCS, PERSONALITY2_INCLUDE_FUNCS, PERSONALITY0_INCLUDE_PRINTERS_DECLS, PERSONALITY0_INCLUDE_PRINTERS_DEFS, PERSONALITY1_INCLUDE_PRINTERS_DECLS, PERSONALITY1_INCLUDE_PRINTERS_DEFS, PERSONALITY2_INCLUDE_PRINTERS_DECLS, PERSONALITY2_INCLUDE_PRINTERS_DEFS. (printers): New struct. Update it when needed. * .gitignore: Add libmpers-m32.a, libmpers-mx32.a, m32_defs.h, m32_funcs.h, m32_printer_decls.h, m32_printer_defs.h, mpers-m32, mpers-m32.stamp, mpers-mx32, mpers-mx32.stamp, mpers.am, mx32_defs.h, mx32_funcs.h, mx32_printer_decls.h, mx32_printer_defs.h, native_printer_decls.h, native_printer_defs.h, and printers.h.
2015-08-04 01:47:02 +03:00
mpers_NAME =
mpers_PREFIX = $(mpers_NAME)_
mpers_DEFS = $(DEFS)
mpers_INCLUDES = $(DEFAULT_INCLUDES) $(INCLUDES)
mpers_CPPFLAGS = $(strace_CPPFLAGS) $(CPPFLAGS)
mpers_sh_opts = $(mpers_DEFS) $(mpers_INCLUDES) $(mpers_CPPFLAGS)
libmpers_CPPFLAGS = $(strace_CPPFLAGS) -DIN_MPERS
libmpers_CFLAGS = $(strace_CFLAGS)
Add mpers support Add a subsystem for semi-automatical definition of how parsers should work with personality-dependent (mpers) types of tracee's data. Create auxiliary libraries containing mpers syscall parsers and printer functions, one library for each possible nonnative target personality. Currently some parsers do not handle differences in definitions of data types between personalities, namely LP64 and ILP32. When this is the case, long integers, pointers, and all compound types containing long and pointer members may be printed incorrectly, because of differences in sizes, offsets and alignments. Since in most cases these are the only differences in desired behaviour of parsers and printers for different personalities, a correct way would be to compile one source code into multiple parsers, differing only in definitions of mpers types. To get a definition of a given type for nonnative personality a very basic .c file containing a declaration of a variable of this type is being compiled for this personality (using -m32 or -mx32 compiler flag). Information about the type is then being extracted from this binary's DWARF debug info with an awk script and put into a corresponding header file. Resulting headers are being used to compile mpers variations of syscall parsers and printer functions. In addition to syscall parsers, there can occur a need to create mpers printing functions, which then can be called from many places in the code (for example, printsiginfo_at). Such functions (printers) are marked in a special manner. For each possible nonnative target personality a library is being created, containing mpers variations of syscall parsers and printers. Only syscall parsers from files marked in a special manner and specially marked functions from such files are being recompiled and included in these libraries. generate_mpers_am.sh is called by bootstrap to find the files from strace_SOURCES which include MPERS_DEFS. During compilation, these files are being inspected for inclusions of DEF_MPERS_TYPE, and nonnative variations of each included type are being generated by an awk script. Mpers parser names are being modified during inclusions of syscallent headers for nonnative personalities. Pointers to printers are being stored in structs struct_printers, and a master pointer printers is being updated on every set_personality. * README-mpers: New README explaining how to use mpers support. * empty.h: New empty file. * generate_mpers_am.sh: New file. * mpers.awk: Likewise. * mpers.sh: Likewise. * mpers_test.sh: Likewise. * mpers_type.h: Likewise. * Makefile.am (strace_SOURCES): Add empty.h and mpers_type.h. (strace_CPPFLAGS, strace_LDFLAGS, strace_LDADD): Move to the beginning of the file. (strace_LDADD, noinst_LIBRARIES): Add libmpers-%.a. (EXTRA_DIST): Add mpers.awk, mpers.sh, mpers_test.sh. (BUILT_SOURCES, CLEANFILES): Add new generated files: native_printer_decls.h, native_printer_defs.h, printers.h, [HAVE_M32_MPERS] $(mpers_m32_targets), and [HAVE_MX32_MPERS] $(mpers_mx32_targets). (mpers_NAME, mpers_PREFIX, mpers_DEFS, mpers_INCLUDES, mpers_CPPFLAGS, mpers_sh_opts, libmpers_CPPFLAGS, libmpers_m[x]32_a_SOURCES, libmpers_m[x]32_a_CPPFLAGS, mpers_m[x]32_targets): New variables. (mpers-m[x]32.stamp, m[x]32_defs.h, m[x]32_funcs.h, printers.h, %_printer_decls.h, %_printer_defs.h, clean-local, native_printer_decls.h, native_printer_defs.h, $mpers_m[x]32_targets): New targets. * bootstrap: Add generate_mpers_am.sh. * configure.ac: Add AC_PROG_RANLIB. * m4/mpers.m4: Add HAVE_MPERS variable. Add $st_cv_mpers checks. * defs.h: Include mpers_type.h. Include printers.h, native_printer_decls.h, define MPERS_PRINTER_NAME. Redefine SYS_FUNC_NAME. Define MPERS_PRINTER_DECL. [HAVE_M32_MPERS]: define PERSONALITY1_INCLUDE_FUNCS, PERSONALITY1_INCLUDE_PRINTERS_DECLS, PERSONALITY1_INCLUDE_PRINTERS_DEFS for X86_64, X32. [HAVE_MX32_MPERS]: define PERSONALITY2_INCLUDE_FUNCS, PERSONALITY2_INCLUDE_PRINTERS_DECLS, PERSONALITY2_INCLUDE_PRINTERS_DEFS for X86_64. Add fallback definitions of PERSONALITY1_INCLUDE_FUNCS, PERSONALITY2_INCLUDE_FUNCS, PERSONALITY0_INCLUDE_PRINTERS_DECLS, PERSONALITY0_INCLUDE_PRINTERS_DEFS, PERSONALITY1_INCLUDE_PRINTERS_DECLS, PERSONALITY1_INCLUDE_PRINTERS_DEFS, PERSONALITY2_INCLUDE_PRINTERS_DECLS, PERSONALITY2_INCLUDE_PRINTERS_DEFS. * syscall.c: Include PERSONALITY1_INCLUDE_FUNCS, PERSONALITY2_INCLUDE_FUNCS, PERSONALITY0_INCLUDE_PRINTERS_DECLS, PERSONALITY0_INCLUDE_PRINTERS_DEFS, PERSONALITY1_INCLUDE_PRINTERS_DECLS, PERSONALITY1_INCLUDE_PRINTERS_DEFS, PERSONALITY2_INCLUDE_PRINTERS_DECLS, PERSONALITY2_INCLUDE_PRINTERS_DEFS. (printers): New struct. Update it when needed. * .gitignore: Add libmpers-m32.a, libmpers-mx32.a, m32_defs.h, m32_funcs.h, m32_printer_decls.h, m32_printer_defs.h, mpers-m32, mpers-m32.stamp, mpers-mx32, mpers-mx32.stamp, mpers.am, mx32_defs.h, mx32_funcs.h, mx32_printer_decls.h, mx32_printer_defs.h, native_printer_decls.h, native_printer_defs.h, and printers.h.
2015-08-04 01:47:02 +03:00
# mpers targets
mpers-m%.stamp: $(srcdir_mpers_source_files) | printers.h
Add mpers support Add a subsystem for semi-automatical definition of how parsers should work with personality-dependent (mpers) types of tracee's data. Create auxiliary libraries containing mpers syscall parsers and printer functions, one library for each possible nonnative target personality. Currently some parsers do not handle differences in definitions of data types between personalities, namely LP64 and ILP32. When this is the case, long integers, pointers, and all compound types containing long and pointer members may be printed incorrectly, because of differences in sizes, offsets and alignments. Since in most cases these are the only differences in desired behaviour of parsers and printers for different personalities, a correct way would be to compile one source code into multiple parsers, differing only in definitions of mpers types. To get a definition of a given type for nonnative personality a very basic .c file containing a declaration of a variable of this type is being compiled for this personality (using -m32 or -mx32 compiler flag). Information about the type is then being extracted from this binary's DWARF debug info with an awk script and put into a corresponding header file. Resulting headers are being used to compile mpers variations of syscall parsers and printer functions. In addition to syscall parsers, there can occur a need to create mpers printing functions, which then can be called from many places in the code (for example, printsiginfo_at). Such functions (printers) are marked in a special manner. For each possible nonnative target personality a library is being created, containing mpers variations of syscall parsers and printers. Only syscall parsers from files marked in a special manner and specially marked functions from such files are being recompiled and included in these libraries. generate_mpers_am.sh is called by bootstrap to find the files from strace_SOURCES which include MPERS_DEFS. During compilation, these files are being inspected for inclusions of DEF_MPERS_TYPE, and nonnative variations of each included type are being generated by an awk script. Mpers parser names are being modified during inclusions of syscallent headers for nonnative personalities. Pointers to printers are being stored in structs struct_printers, and a master pointer printers is being updated on every set_personality. * README-mpers: New README explaining how to use mpers support. * empty.h: New empty file. * generate_mpers_am.sh: New file. * mpers.awk: Likewise. * mpers.sh: Likewise. * mpers_test.sh: Likewise. * mpers_type.h: Likewise. * Makefile.am (strace_SOURCES): Add empty.h and mpers_type.h. (strace_CPPFLAGS, strace_LDFLAGS, strace_LDADD): Move to the beginning of the file. (strace_LDADD, noinst_LIBRARIES): Add libmpers-%.a. (EXTRA_DIST): Add mpers.awk, mpers.sh, mpers_test.sh. (BUILT_SOURCES, CLEANFILES): Add new generated files: native_printer_decls.h, native_printer_defs.h, printers.h, [HAVE_M32_MPERS] $(mpers_m32_targets), and [HAVE_MX32_MPERS] $(mpers_mx32_targets). (mpers_NAME, mpers_PREFIX, mpers_DEFS, mpers_INCLUDES, mpers_CPPFLAGS, mpers_sh_opts, libmpers_CPPFLAGS, libmpers_m[x]32_a_SOURCES, libmpers_m[x]32_a_CPPFLAGS, mpers_m[x]32_targets): New variables. (mpers-m[x]32.stamp, m[x]32_defs.h, m[x]32_funcs.h, printers.h, %_printer_decls.h, %_printer_defs.h, clean-local, native_printer_decls.h, native_printer_defs.h, $mpers_m[x]32_targets): New targets. * bootstrap: Add generate_mpers_am.sh. * configure.ac: Add AC_PROG_RANLIB. * m4/mpers.m4: Add HAVE_MPERS variable. Add $st_cv_mpers checks. * defs.h: Include mpers_type.h. Include printers.h, native_printer_decls.h, define MPERS_PRINTER_NAME. Redefine SYS_FUNC_NAME. Define MPERS_PRINTER_DECL. [HAVE_M32_MPERS]: define PERSONALITY1_INCLUDE_FUNCS, PERSONALITY1_INCLUDE_PRINTERS_DECLS, PERSONALITY1_INCLUDE_PRINTERS_DEFS for X86_64, X32. [HAVE_MX32_MPERS]: define PERSONALITY2_INCLUDE_FUNCS, PERSONALITY2_INCLUDE_PRINTERS_DECLS, PERSONALITY2_INCLUDE_PRINTERS_DEFS for X86_64. Add fallback definitions of PERSONALITY1_INCLUDE_FUNCS, PERSONALITY2_INCLUDE_FUNCS, PERSONALITY0_INCLUDE_PRINTERS_DECLS, PERSONALITY0_INCLUDE_PRINTERS_DEFS, PERSONALITY1_INCLUDE_PRINTERS_DECLS, PERSONALITY1_INCLUDE_PRINTERS_DEFS, PERSONALITY2_INCLUDE_PRINTERS_DECLS, PERSONALITY2_INCLUDE_PRINTERS_DEFS. * syscall.c: Include PERSONALITY1_INCLUDE_FUNCS, PERSONALITY2_INCLUDE_FUNCS, PERSONALITY0_INCLUDE_PRINTERS_DECLS, PERSONALITY0_INCLUDE_PRINTERS_DEFS, PERSONALITY1_INCLUDE_PRINTERS_DECLS, PERSONALITY1_INCLUDE_PRINTERS_DEFS, PERSONALITY2_INCLUDE_PRINTERS_DECLS, PERSONALITY2_INCLUDE_PRINTERS_DEFS. (printers): New struct. Update it when needed. * .gitignore: Add libmpers-m32.a, libmpers-mx32.a, m32_defs.h, m32_funcs.h, m32_printer_decls.h, m32_printer_defs.h, mpers-m32, mpers-m32.stamp, mpers-mx32, mpers-mx32.stamp, mpers.am, mx32_defs.h, mx32_funcs.h, mx32_printer_decls.h, mx32_printer_defs.h, native_printer_decls.h, native_printer_defs.h, and printers.h.
2015-08-04 01:47:02 +03:00
for f in $^; do \
CC="$(CC)" CFLAGS="$(mpers_sh_opts) -DMPERS_IS_$(mpers_NAME)" \
CPP="$(CPP)" CPPFLAGS="$(mpers_sh_opts) -DIN_MPERS -DMPERS_IS_$(mpers_NAME)" \
Add mpers support Add a subsystem for semi-automatical definition of how parsers should work with personality-dependent (mpers) types of tracee's data. Create auxiliary libraries containing mpers syscall parsers and printer functions, one library for each possible nonnative target personality. Currently some parsers do not handle differences in definitions of data types between personalities, namely LP64 and ILP32. When this is the case, long integers, pointers, and all compound types containing long and pointer members may be printed incorrectly, because of differences in sizes, offsets and alignments. Since in most cases these are the only differences in desired behaviour of parsers and printers for different personalities, a correct way would be to compile one source code into multiple parsers, differing only in definitions of mpers types. To get a definition of a given type for nonnative personality a very basic .c file containing a declaration of a variable of this type is being compiled for this personality (using -m32 or -mx32 compiler flag). Information about the type is then being extracted from this binary's DWARF debug info with an awk script and put into a corresponding header file. Resulting headers are being used to compile mpers variations of syscall parsers and printer functions. In addition to syscall parsers, there can occur a need to create mpers printing functions, which then can be called from many places in the code (for example, printsiginfo_at). Such functions (printers) are marked in a special manner. For each possible nonnative target personality a library is being created, containing mpers variations of syscall parsers and printers. Only syscall parsers from files marked in a special manner and specially marked functions from such files are being recompiled and included in these libraries. generate_mpers_am.sh is called by bootstrap to find the files from strace_SOURCES which include MPERS_DEFS. During compilation, these files are being inspected for inclusions of DEF_MPERS_TYPE, and nonnative variations of each included type are being generated by an awk script. Mpers parser names are being modified during inclusions of syscallent headers for nonnative personalities. Pointers to printers are being stored in structs struct_printers, and a master pointer printers is being updated on every set_personality. * README-mpers: New README explaining how to use mpers support. * empty.h: New empty file. * generate_mpers_am.sh: New file. * mpers.awk: Likewise. * mpers.sh: Likewise. * mpers_test.sh: Likewise. * mpers_type.h: Likewise. * Makefile.am (strace_SOURCES): Add empty.h and mpers_type.h. (strace_CPPFLAGS, strace_LDFLAGS, strace_LDADD): Move to the beginning of the file. (strace_LDADD, noinst_LIBRARIES): Add libmpers-%.a. (EXTRA_DIST): Add mpers.awk, mpers.sh, mpers_test.sh. (BUILT_SOURCES, CLEANFILES): Add new generated files: native_printer_decls.h, native_printer_defs.h, printers.h, [HAVE_M32_MPERS] $(mpers_m32_targets), and [HAVE_MX32_MPERS] $(mpers_mx32_targets). (mpers_NAME, mpers_PREFIX, mpers_DEFS, mpers_INCLUDES, mpers_CPPFLAGS, mpers_sh_opts, libmpers_CPPFLAGS, libmpers_m[x]32_a_SOURCES, libmpers_m[x]32_a_CPPFLAGS, mpers_m[x]32_targets): New variables. (mpers-m[x]32.stamp, m[x]32_defs.h, m[x]32_funcs.h, printers.h, %_printer_decls.h, %_printer_defs.h, clean-local, native_printer_decls.h, native_printer_defs.h, $mpers_m[x]32_targets): New targets. * bootstrap: Add generate_mpers_am.sh. * configure.ac: Add AC_PROG_RANLIB. * m4/mpers.m4: Add HAVE_MPERS variable. Add $st_cv_mpers checks. * defs.h: Include mpers_type.h. Include printers.h, native_printer_decls.h, define MPERS_PRINTER_NAME. Redefine SYS_FUNC_NAME. Define MPERS_PRINTER_DECL. [HAVE_M32_MPERS]: define PERSONALITY1_INCLUDE_FUNCS, PERSONALITY1_INCLUDE_PRINTERS_DECLS, PERSONALITY1_INCLUDE_PRINTERS_DEFS for X86_64, X32. [HAVE_MX32_MPERS]: define PERSONALITY2_INCLUDE_FUNCS, PERSONALITY2_INCLUDE_PRINTERS_DECLS, PERSONALITY2_INCLUDE_PRINTERS_DEFS for X86_64. Add fallback definitions of PERSONALITY1_INCLUDE_FUNCS, PERSONALITY2_INCLUDE_FUNCS, PERSONALITY0_INCLUDE_PRINTERS_DECLS, PERSONALITY0_INCLUDE_PRINTERS_DEFS, PERSONALITY1_INCLUDE_PRINTERS_DECLS, PERSONALITY1_INCLUDE_PRINTERS_DEFS, PERSONALITY2_INCLUDE_PRINTERS_DECLS, PERSONALITY2_INCLUDE_PRINTERS_DEFS. * syscall.c: Include PERSONALITY1_INCLUDE_FUNCS, PERSONALITY2_INCLUDE_FUNCS, PERSONALITY0_INCLUDE_PRINTERS_DECLS, PERSONALITY0_INCLUDE_PRINTERS_DEFS, PERSONALITY1_INCLUDE_PRINTERS_DECLS, PERSONALITY1_INCLUDE_PRINTERS_DEFS, PERSONALITY2_INCLUDE_PRINTERS_DECLS, PERSONALITY2_INCLUDE_PRINTERS_DEFS. (printers): New struct. Update it when needed. * .gitignore: Add libmpers-m32.a, libmpers-mx32.a, m32_defs.h, m32_funcs.h, m32_printer_decls.h, m32_printer_defs.h, mpers-m32, mpers-m32.stamp, mpers-mx32, mpers-mx32.stamp, mpers.am, mx32_defs.h, mx32_funcs.h, mx32_printer_decls.h, mx32_printer_defs.h, native_printer_decls.h, native_printer_defs.h, and printers.h.
2015-08-04 01:47:02 +03:00
$(srcdir)/mpers.sh -$(mpers_NAME) $$f || exit; \
done
> $@
m%_type_defs.h: $(srcdir_mpers_source_files)
Add mpers support Add a subsystem for semi-automatical definition of how parsers should work with personality-dependent (mpers) types of tracee's data. Create auxiliary libraries containing mpers syscall parsers and printer functions, one library for each possible nonnative target personality. Currently some parsers do not handle differences in definitions of data types between personalities, namely LP64 and ILP32. When this is the case, long integers, pointers, and all compound types containing long and pointer members may be printed incorrectly, because of differences in sizes, offsets and alignments. Since in most cases these are the only differences in desired behaviour of parsers and printers for different personalities, a correct way would be to compile one source code into multiple parsers, differing only in definitions of mpers types. To get a definition of a given type for nonnative personality a very basic .c file containing a declaration of a variable of this type is being compiled for this personality (using -m32 or -mx32 compiler flag). Information about the type is then being extracted from this binary's DWARF debug info with an awk script and put into a corresponding header file. Resulting headers are being used to compile mpers variations of syscall parsers and printer functions. In addition to syscall parsers, there can occur a need to create mpers printing functions, which then can be called from many places in the code (for example, printsiginfo_at). Such functions (printers) are marked in a special manner. For each possible nonnative target personality a library is being created, containing mpers variations of syscall parsers and printers. Only syscall parsers from files marked in a special manner and specially marked functions from such files are being recompiled and included in these libraries. generate_mpers_am.sh is called by bootstrap to find the files from strace_SOURCES which include MPERS_DEFS. During compilation, these files are being inspected for inclusions of DEF_MPERS_TYPE, and nonnative variations of each included type are being generated by an awk script. Mpers parser names are being modified during inclusions of syscallent headers for nonnative personalities. Pointers to printers are being stored in structs struct_printers, and a master pointer printers is being updated on every set_personality. * README-mpers: New README explaining how to use mpers support. * empty.h: New empty file. * generate_mpers_am.sh: New file. * mpers.awk: Likewise. * mpers.sh: Likewise. * mpers_test.sh: Likewise. * mpers_type.h: Likewise. * Makefile.am (strace_SOURCES): Add empty.h and mpers_type.h. (strace_CPPFLAGS, strace_LDFLAGS, strace_LDADD): Move to the beginning of the file. (strace_LDADD, noinst_LIBRARIES): Add libmpers-%.a. (EXTRA_DIST): Add mpers.awk, mpers.sh, mpers_test.sh. (BUILT_SOURCES, CLEANFILES): Add new generated files: native_printer_decls.h, native_printer_defs.h, printers.h, [HAVE_M32_MPERS] $(mpers_m32_targets), and [HAVE_MX32_MPERS] $(mpers_mx32_targets). (mpers_NAME, mpers_PREFIX, mpers_DEFS, mpers_INCLUDES, mpers_CPPFLAGS, mpers_sh_opts, libmpers_CPPFLAGS, libmpers_m[x]32_a_SOURCES, libmpers_m[x]32_a_CPPFLAGS, mpers_m[x]32_targets): New variables. (mpers-m[x]32.stamp, m[x]32_defs.h, m[x]32_funcs.h, printers.h, %_printer_decls.h, %_printer_defs.h, clean-local, native_printer_decls.h, native_printer_defs.h, $mpers_m[x]32_targets): New targets. * bootstrap: Add generate_mpers_am.sh. * configure.ac: Add AC_PROG_RANLIB. * m4/mpers.m4: Add HAVE_MPERS variable. Add $st_cv_mpers checks. * defs.h: Include mpers_type.h. Include printers.h, native_printer_decls.h, define MPERS_PRINTER_NAME. Redefine SYS_FUNC_NAME. Define MPERS_PRINTER_DECL. [HAVE_M32_MPERS]: define PERSONALITY1_INCLUDE_FUNCS, PERSONALITY1_INCLUDE_PRINTERS_DECLS, PERSONALITY1_INCLUDE_PRINTERS_DEFS for X86_64, X32. [HAVE_MX32_MPERS]: define PERSONALITY2_INCLUDE_FUNCS, PERSONALITY2_INCLUDE_PRINTERS_DECLS, PERSONALITY2_INCLUDE_PRINTERS_DEFS for X86_64. Add fallback definitions of PERSONALITY1_INCLUDE_FUNCS, PERSONALITY2_INCLUDE_FUNCS, PERSONALITY0_INCLUDE_PRINTERS_DECLS, PERSONALITY0_INCLUDE_PRINTERS_DEFS, PERSONALITY1_INCLUDE_PRINTERS_DECLS, PERSONALITY1_INCLUDE_PRINTERS_DEFS, PERSONALITY2_INCLUDE_PRINTERS_DECLS, PERSONALITY2_INCLUDE_PRINTERS_DEFS. * syscall.c: Include PERSONALITY1_INCLUDE_FUNCS, PERSONALITY2_INCLUDE_FUNCS, PERSONALITY0_INCLUDE_PRINTERS_DECLS, PERSONALITY0_INCLUDE_PRINTERS_DEFS, PERSONALITY1_INCLUDE_PRINTERS_DECLS, PERSONALITY1_INCLUDE_PRINTERS_DEFS, PERSONALITY2_INCLUDE_PRINTERS_DECLS, PERSONALITY2_INCLUDE_PRINTERS_DEFS. (printers): New struct. Update it when needed. * .gitignore: Add libmpers-m32.a, libmpers-mx32.a, m32_defs.h, m32_funcs.h, m32_printer_decls.h, m32_printer_defs.h, mpers-m32, mpers-m32.stamp, mpers-mx32, mpers-mx32.stamp, mpers.am, mx32_defs.h, mx32_funcs.h, mx32_printer_decls.h, mx32_printer_defs.h, native_printer_decls.h, native_printer_defs.h, and printers.h.
2015-08-04 01:47:02 +03:00
for f in $^; do \
sed -r -n 's/^#include DEF_MPERS_TYPE\(([^)]+)\)/#ifdef MPERS_$(mpers_PREFIX)\1\n# define \1 MPERS_$(mpers_PREFIX)\1\n#endif/p' $$f || exit; \
Add mpers support Add a subsystem for semi-automatical definition of how parsers should work with personality-dependent (mpers) types of tracee's data. Create auxiliary libraries containing mpers syscall parsers and printer functions, one library for each possible nonnative target personality. Currently some parsers do not handle differences in definitions of data types between personalities, namely LP64 and ILP32. When this is the case, long integers, pointers, and all compound types containing long and pointer members may be printed incorrectly, because of differences in sizes, offsets and alignments. Since in most cases these are the only differences in desired behaviour of parsers and printers for different personalities, a correct way would be to compile one source code into multiple parsers, differing only in definitions of mpers types. To get a definition of a given type for nonnative personality a very basic .c file containing a declaration of a variable of this type is being compiled for this personality (using -m32 or -mx32 compiler flag). Information about the type is then being extracted from this binary's DWARF debug info with an awk script and put into a corresponding header file. Resulting headers are being used to compile mpers variations of syscall parsers and printer functions. In addition to syscall parsers, there can occur a need to create mpers printing functions, which then can be called from many places in the code (for example, printsiginfo_at). Such functions (printers) are marked in a special manner. For each possible nonnative target personality a library is being created, containing mpers variations of syscall parsers and printers. Only syscall parsers from files marked in a special manner and specially marked functions from such files are being recompiled and included in these libraries. generate_mpers_am.sh is called by bootstrap to find the files from strace_SOURCES which include MPERS_DEFS. During compilation, these files are being inspected for inclusions of DEF_MPERS_TYPE, and nonnative variations of each included type are being generated by an awk script. Mpers parser names are being modified during inclusions of syscallent headers for nonnative personalities. Pointers to printers are being stored in structs struct_printers, and a master pointer printers is being updated on every set_personality. * README-mpers: New README explaining how to use mpers support. * empty.h: New empty file. * generate_mpers_am.sh: New file. * mpers.awk: Likewise. * mpers.sh: Likewise. * mpers_test.sh: Likewise. * mpers_type.h: Likewise. * Makefile.am (strace_SOURCES): Add empty.h and mpers_type.h. (strace_CPPFLAGS, strace_LDFLAGS, strace_LDADD): Move to the beginning of the file. (strace_LDADD, noinst_LIBRARIES): Add libmpers-%.a. (EXTRA_DIST): Add mpers.awk, mpers.sh, mpers_test.sh. (BUILT_SOURCES, CLEANFILES): Add new generated files: native_printer_decls.h, native_printer_defs.h, printers.h, [HAVE_M32_MPERS] $(mpers_m32_targets), and [HAVE_MX32_MPERS] $(mpers_mx32_targets). (mpers_NAME, mpers_PREFIX, mpers_DEFS, mpers_INCLUDES, mpers_CPPFLAGS, mpers_sh_opts, libmpers_CPPFLAGS, libmpers_m[x]32_a_SOURCES, libmpers_m[x]32_a_CPPFLAGS, mpers_m[x]32_targets): New variables. (mpers-m[x]32.stamp, m[x]32_defs.h, m[x]32_funcs.h, printers.h, %_printer_decls.h, %_printer_defs.h, clean-local, native_printer_decls.h, native_printer_defs.h, $mpers_m[x]32_targets): New targets. * bootstrap: Add generate_mpers_am.sh. * configure.ac: Add AC_PROG_RANLIB. * m4/mpers.m4: Add HAVE_MPERS variable. Add $st_cv_mpers checks. * defs.h: Include mpers_type.h. Include printers.h, native_printer_decls.h, define MPERS_PRINTER_NAME. Redefine SYS_FUNC_NAME. Define MPERS_PRINTER_DECL. [HAVE_M32_MPERS]: define PERSONALITY1_INCLUDE_FUNCS, PERSONALITY1_INCLUDE_PRINTERS_DECLS, PERSONALITY1_INCLUDE_PRINTERS_DEFS for X86_64, X32. [HAVE_MX32_MPERS]: define PERSONALITY2_INCLUDE_FUNCS, PERSONALITY2_INCLUDE_PRINTERS_DECLS, PERSONALITY2_INCLUDE_PRINTERS_DEFS for X86_64. Add fallback definitions of PERSONALITY1_INCLUDE_FUNCS, PERSONALITY2_INCLUDE_FUNCS, PERSONALITY0_INCLUDE_PRINTERS_DECLS, PERSONALITY0_INCLUDE_PRINTERS_DEFS, PERSONALITY1_INCLUDE_PRINTERS_DECLS, PERSONALITY1_INCLUDE_PRINTERS_DEFS, PERSONALITY2_INCLUDE_PRINTERS_DECLS, PERSONALITY2_INCLUDE_PRINTERS_DEFS. * syscall.c: Include PERSONALITY1_INCLUDE_FUNCS, PERSONALITY2_INCLUDE_FUNCS, PERSONALITY0_INCLUDE_PRINTERS_DECLS, PERSONALITY0_INCLUDE_PRINTERS_DEFS, PERSONALITY1_INCLUDE_PRINTERS_DECLS, PERSONALITY1_INCLUDE_PRINTERS_DEFS, PERSONALITY2_INCLUDE_PRINTERS_DECLS, PERSONALITY2_INCLUDE_PRINTERS_DEFS. (printers): New struct. Update it when needed. * .gitignore: Add libmpers-m32.a, libmpers-mx32.a, m32_defs.h, m32_funcs.h, m32_printer_decls.h, m32_printer_defs.h, mpers-m32, mpers-m32.stamp, mpers-mx32, mpers-mx32.stamp, mpers.am, mx32_defs.h, mx32_funcs.h, mx32_printer_decls.h, mx32_printer_defs.h, native_printer_decls.h, native_printer_defs.h, and printers.h.
2015-08-04 01:47:02 +03:00
done > $@-t
echo '#undef MPERS_PRINTER_NAME' >> $@-t
echo '#define MPERS_PRINTER_NAME(printer_name) printer_name' >> $@-t
echo '#include "$(mpers_PREFIX)printer_decls.h"' >> $@-t
echo '#include MPERS_$(mpers_PREFIX)IOCTL_MACROS' >> $@-t
Add mpers support Add a subsystem for semi-automatical definition of how parsers should work with personality-dependent (mpers) types of tracee's data. Create auxiliary libraries containing mpers syscall parsers and printer functions, one library for each possible nonnative target personality. Currently some parsers do not handle differences in definitions of data types between personalities, namely LP64 and ILP32. When this is the case, long integers, pointers, and all compound types containing long and pointer members may be printed incorrectly, because of differences in sizes, offsets and alignments. Since in most cases these are the only differences in desired behaviour of parsers and printers for different personalities, a correct way would be to compile one source code into multiple parsers, differing only in definitions of mpers types. To get a definition of a given type for nonnative personality a very basic .c file containing a declaration of a variable of this type is being compiled for this personality (using -m32 or -mx32 compiler flag). Information about the type is then being extracted from this binary's DWARF debug info with an awk script and put into a corresponding header file. Resulting headers are being used to compile mpers variations of syscall parsers and printer functions. In addition to syscall parsers, there can occur a need to create mpers printing functions, which then can be called from many places in the code (for example, printsiginfo_at). Such functions (printers) are marked in a special manner. For each possible nonnative target personality a library is being created, containing mpers variations of syscall parsers and printers. Only syscall parsers from files marked in a special manner and specially marked functions from such files are being recompiled and included in these libraries. generate_mpers_am.sh is called by bootstrap to find the files from strace_SOURCES which include MPERS_DEFS. During compilation, these files are being inspected for inclusions of DEF_MPERS_TYPE, and nonnative variations of each included type are being generated by an awk script. Mpers parser names are being modified during inclusions of syscallent headers for nonnative personalities. Pointers to printers are being stored in structs struct_printers, and a master pointer printers is being updated on every set_personality. * README-mpers: New README explaining how to use mpers support. * empty.h: New empty file. * generate_mpers_am.sh: New file. * mpers.awk: Likewise. * mpers.sh: Likewise. * mpers_test.sh: Likewise. * mpers_type.h: Likewise. * Makefile.am (strace_SOURCES): Add empty.h and mpers_type.h. (strace_CPPFLAGS, strace_LDFLAGS, strace_LDADD): Move to the beginning of the file. (strace_LDADD, noinst_LIBRARIES): Add libmpers-%.a. (EXTRA_DIST): Add mpers.awk, mpers.sh, mpers_test.sh. (BUILT_SOURCES, CLEANFILES): Add new generated files: native_printer_decls.h, native_printer_defs.h, printers.h, [HAVE_M32_MPERS] $(mpers_m32_targets), and [HAVE_MX32_MPERS] $(mpers_mx32_targets). (mpers_NAME, mpers_PREFIX, mpers_DEFS, mpers_INCLUDES, mpers_CPPFLAGS, mpers_sh_opts, libmpers_CPPFLAGS, libmpers_m[x]32_a_SOURCES, libmpers_m[x]32_a_CPPFLAGS, mpers_m[x]32_targets): New variables. (mpers-m[x]32.stamp, m[x]32_defs.h, m[x]32_funcs.h, printers.h, %_printer_decls.h, %_printer_defs.h, clean-local, native_printer_decls.h, native_printer_defs.h, $mpers_m[x]32_targets): New targets. * bootstrap: Add generate_mpers_am.sh. * configure.ac: Add AC_PROG_RANLIB. * m4/mpers.m4: Add HAVE_MPERS variable. Add $st_cv_mpers checks. * defs.h: Include mpers_type.h. Include printers.h, native_printer_decls.h, define MPERS_PRINTER_NAME. Redefine SYS_FUNC_NAME. Define MPERS_PRINTER_DECL. [HAVE_M32_MPERS]: define PERSONALITY1_INCLUDE_FUNCS, PERSONALITY1_INCLUDE_PRINTERS_DECLS, PERSONALITY1_INCLUDE_PRINTERS_DEFS for X86_64, X32. [HAVE_MX32_MPERS]: define PERSONALITY2_INCLUDE_FUNCS, PERSONALITY2_INCLUDE_PRINTERS_DECLS, PERSONALITY2_INCLUDE_PRINTERS_DEFS for X86_64. Add fallback definitions of PERSONALITY1_INCLUDE_FUNCS, PERSONALITY2_INCLUDE_FUNCS, PERSONALITY0_INCLUDE_PRINTERS_DECLS, PERSONALITY0_INCLUDE_PRINTERS_DEFS, PERSONALITY1_INCLUDE_PRINTERS_DECLS, PERSONALITY1_INCLUDE_PRINTERS_DEFS, PERSONALITY2_INCLUDE_PRINTERS_DECLS, PERSONALITY2_INCLUDE_PRINTERS_DEFS. * syscall.c: Include PERSONALITY1_INCLUDE_FUNCS, PERSONALITY2_INCLUDE_FUNCS, PERSONALITY0_INCLUDE_PRINTERS_DECLS, PERSONALITY0_INCLUDE_PRINTERS_DEFS, PERSONALITY1_INCLUDE_PRINTERS_DECLS, PERSONALITY1_INCLUDE_PRINTERS_DEFS, PERSONALITY2_INCLUDE_PRINTERS_DECLS, PERSONALITY2_INCLUDE_PRINTERS_DEFS. (printers): New struct. Update it when needed. * .gitignore: Add libmpers-m32.a, libmpers-mx32.a, m32_defs.h, m32_funcs.h, m32_printer_decls.h, m32_printer_defs.h, mpers-m32, mpers-m32.stamp, mpers-mx32, mpers-mx32.stamp, mpers.am, mx32_defs.h, mx32_funcs.h, mx32_printer_decls.h, mx32_printer_defs.h, native_printer_decls.h, native_printer_defs.h, and printers.h.
2015-08-04 01:47:02 +03:00
mv $@-t $@
m%_funcs.h: $(srcdir_mpers_source_files)
for f in $^; do \
sed -r -n 's/^SYS_FUNC\(([^)]+)\)/#undef sys_\1\n#define sys_\1 $(mpers_PREFIX)sys_\1/p' $$f || exit; \
Add mpers support Add a subsystem for semi-automatical definition of how parsers should work with personality-dependent (mpers) types of tracee's data. Create auxiliary libraries containing mpers syscall parsers and printer functions, one library for each possible nonnative target personality. Currently some parsers do not handle differences in definitions of data types between personalities, namely LP64 and ILP32. When this is the case, long integers, pointers, and all compound types containing long and pointer members may be printed incorrectly, because of differences in sizes, offsets and alignments. Since in most cases these are the only differences in desired behaviour of parsers and printers for different personalities, a correct way would be to compile one source code into multiple parsers, differing only in definitions of mpers types. To get a definition of a given type for nonnative personality a very basic .c file containing a declaration of a variable of this type is being compiled for this personality (using -m32 or -mx32 compiler flag). Information about the type is then being extracted from this binary's DWARF debug info with an awk script and put into a corresponding header file. Resulting headers are being used to compile mpers variations of syscall parsers and printer functions. In addition to syscall parsers, there can occur a need to create mpers printing functions, which then can be called from many places in the code (for example, printsiginfo_at). Such functions (printers) are marked in a special manner. For each possible nonnative target personality a library is being created, containing mpers variations of syscall parsers and printers. Only syscall parsers from files marked in a special manner and specially marked functions from such files are being recompiled and included in these libraries. generate_mpers_am.sh is called by bootstrap to find the files from strace_SOURCES which include MPERS_DEFS. During compilation, these files are being inspected for inclusions of DEF_MPERS_TYPE, and nonnative variations of each included type are being generated by an awk script. Mpers parser names are being modified during inclusions of syscallent headers for nonnative personalities. Pointers to printers are being stored in structs struct_printers, and a master pointer printers is being updated on every set_personality. * README-mpers: New README explaining how to use mpers support. * empty.h: New empty file. * generate_mpers_am.sh: New file. * mpers.awk: Likewise. * mpers.sh: Likewise. * mpers_test.sh: Likewise. * mpers_type.h: Likewise. * Makefile.am (strace_SOURCES): Add empty.h and mpers_type.h. (strace_CPPFLAGS, strace_LDFLAGS, strace_LDADD): Move to the beginning of the file. (strace_LDADD, noinst_LIBRARIES): Add libmpers-%.a. (EXTRA_DIST): Add mpers.awk, mpers.sh, mpers_test.sh. (BUILT_SOURCES, CLEANFILES): Add new generated files: native_printer_decls.h, native_printer_defs.h, printers.h, [HAVE_M32_MPERS] $(mpers_m32_targets), and [HAVE_MX32_MPERS] $(mpers_mx32_targets). (mpers_NAME, mpers_PREFIX, mpers_DEFS, mpers_INCLUDES, mpers_CPPFLAGS, mpers_sh_opts, libmpers_CPPFLAGS, libmpers_m[x]32_a_SOURCES, libmpers_m[x]32_a_CPPFLAGS, mpers_m[x]32_targets): New variables. (mpers-m[x]32.stamp, m[x]32_defs.h, m[x]32_funcs.h, printers.h, %_printer_decls.h, %_printer_defs.h, clean-local, native_printer_decls.h, native_printer_defs.h, $mpers_m[x]32_targets): New targets. * bootstrap: Add generate_mpers_am.sh. * configure.ac: Add AC_PROG_RANLIB. * m4/mpers.m4: Add HAVE_MPERS variable. Add $st_cv_mpers checks. * defs.h: Include mpers_type.h. Include printers.h, native_printer_decls.h, define MPERS_PRINTER_NAME. Redefine SYS_FUNC_NAME. Define MPERS_PRINTER_DECL. [HAVE_M32_MPERS]: define PERSONALITY1_INCLUDE_FUNCS, PERSONALITY1_INCLUDE_PRINTERS_DECLS, PERSONALITY1_INCLUDE_PRINTERS_DEFS for X86_64, X32. [HAVE_MX32_MPERS]: define PERSONALITY2_INCLUDE_FUNCS, PERSONALITY2_INCLUDE_PRINTERS_DECLS, PERSONALITY2_INCLUDE_PRINTERS_DEFS for X86_64. Add fallback definitions of PERSONALITY1_INCLUDE_FUNCS, PERSONALITY2_INCLUDE_FUNCS, PERSONALITY0_INCLUDE_PRINTERS_DECLS, PERSONALITY0_INCLUDE_PRINTERS_DEFS, PERSONALITY1_INCLUDE_PRINTERS_DECLS, PERSONALITY1_INCLUDE_PRINTERS_DEFS, PERSONALITY2_INCLUDE_PRINTERS_DECLS, PERSONALITY2_INCLUDE_PRINTERS_DEFS. * syscall.c: Include PERSONALITY1_INCLUDE_FUNCS, PERSONALITY2_INCLUDE_FUNCS, PERSONALITY0_INCLUDE_PRINTERS_DECLS, PERSONALITY0_INCLUDE_PRINTERS_DEFS, PERSONALITY1_INCLUDE_PRINTERS_DECLS, PERSONALITY1_INCLUDE_PRINTERS_DEFS, PERSONALITY2_INCLUDE_PRINTERS_DECLS, PERSONALITY2_INCLUDE_PRINTERS_DEFS. (printers): New struct. Update it when needed. * .gitignore: Add libmpers-m32.a, libmpers-mx32.a, m32_defs.h, m32_funcs.h, m32_printer_decls.h, m32_printer_defs.h, mpers-m32, mpers-m32.stamp, mpers-mx32, mpers-mx32.stamp, mpers.am, mx32_defs.h, mx32_funcs.h, mx32_printer_decls.h, mx32_printer_defs.h, native_printer_decls.h, native_printer_defs.h, and printers.h.
2015-08-04 01:47:02 +03:00
done > $@-t && \
echo '#include "sys_func.h"' >> $@-t
mv $@-t $@
# printers
%.c.mpers.i: $(srcdir)/%.c
$(CPP) -P $(mpers_sh_opts) -DIN_MPERS_BOOTSTRAP $< -o $@
mpers_printer_decl_pattern = ^MPERS_PRINTER_DECL\(([^,)]+),[[:space:]]*([^,)]+),[[:space:]]*([^)]+)\)$$
printers.h: $(mpers_preproc_files)
Add mpers support Add a subsystem for semi-automatical definition of how parsers should work with personality-dependent (mpers) types of tracee's data. Create auxiliary libraries containing mpers syscall parsers and printer functions, one library for each possible nonnative target personality. Currently some parsers do not handle differences in definitions of data types between personalities, namely LP64 and ILP32. When this is the case, long integers, pointers, and all compound types containing long and pointer members may be printed incorrectly, because of differences in sizes, offsets and alignments. Since in most cases these are the only differences in desired behaviour of parsers and printers for different personalities, a correct way would be to compile one source code into multiple parsers, differing only in definitions of mpers types. To get a definition of a given type for nonnative personality a very basic .c file containing a declaration of a variable of this type is being compiled for this personality (using -m32 or -mx32 compiler flag). Information about the type is then being extracted from this binary's DWARF debug info with an awk script and put into a corresponding header file. Resulting headers are being used to compile mpers variations of syscall parsers and printer functions. In addition to syscall parsers, there can occur a need to create mpers printing functions, which then can be called from many places in the code (for example, printsiginfo_at). Such functions (printers) are marked in a special manner. For each possible nonnative target personality a library is being created, containing mpers variations of syscall parsers and printers. Only syscall parsers from files marked in a special manner and specially marked functions from such files are being recompiled and included in these libraries. generate_mpers_am.sh is called by bootstrap to find the files from strace_SOURCES which include MPERS_DEFS. During compilation, these files are being inspected for inclusions of DEF_MPERS_TYPE, and nonnative variations of each included type are being generated by an awk script. Mpers parser names are being modified during inclusions of syscallent headers for nonnative personalities. Pointers to printers are being stored in structs struct_printers, and a master pointer printers is being updated on every set_personality. * README-mpers: New README explaining how to use mpers support. * empty.h: New empty file. * generate_mpers_am.sh: New file. * mpers.awk: Likewise. * mpers.sh: Likewise. * mpers_test.sh: Likewise. * mpers_type.h: Likewise. * Makefile.am (strace_SOURCES): Add empty.h and mpers_type.h. (strace_CPPFLAGS, strace_LDFLAGS, strace_LDADD): Move to the beginning of the file. (strace_LDADD, noinst_LIBRARIES): Add libmpers-%.a. (EXTRA_DIST): Add mpers.awk, mpers.sh, mpers_test.sh. (BUILT_SOURCES, CLEANFILES): Add new generated files: native_printer_decls.h, native_printer_defs.h, printers.h, [HAVE_M32_MPERS] $(mpers_m32_targets), and [HAVE_MX32_MPERS] $(mpers_mx32_targets). (mpers_NAME, mpers_PREFIX, mpers_DEFS, mpers_INCLUDES, mpers_CPPFLAGS, mpers_sh_opts, libmpers_CPPFLAGS, libmpers_m[x]32_a_SOURCES, libmpers_m[x]32_a_CPPFLAGS, mpers_m[x]32_targets): New variables. (mpers-m[x]32.stamp, m[x]32_defs.h, m[x]32_funcs.h, printers.h, %_printer_decls.h, %_printer_defs.h, clean-local, native_printer_decls.h, native_printer_defs.h, $mpers_m[x]32_targets): New targets. * bootstrap: Add generate_mpers_am.sh. * configure.ac: Add AC_PROG_RANLIB. * m4/mpers.m4: Add HAVE_MPERS variable. Add $st_cv_mpers checks. * defs.h: Include mpers_type.h. Include printers.h, native_printer_decls.h, define MPERS_PRINTER_NAME. Redefine SYS_FUNC_NAME. Define MPERS_PRINTER_DECL. [HAVE_M32_MPERS]: define PERSONALITY1_INCLUDE_FUNCS, PERSONALITY1_INCLUDE_PRINTERS_DECLS, PERSONALITY1_INCLUDE_PRINTERS_DEFS for X86_64, X32. [HAVE_MX32_MPERS]: define PERSONALITY2_INCLUDE_FUNCS, PERSONALITY2_INCLUDE_PRINTERS_DECLS, PERSONALITY2_INCLUDE_PRINTERS_DEFS for X86_64. Add fallback definitions of PERSONALITY1_INCLUDE_FUNCS, PERSONALITY2_INCLUDE_FUNCS, PERSONALITY0_INCLUDE_PRINTERS_DECLS, PERSONALITY0_INCLUDE_PRINTERS_DEFS, PERSONALITY1_INCLUDE_PRINTERS_DECLS, PERSONALITY1_INCLUDE_PRINTERS_DEFS, PERSONALITY2_INCLUDE_PRINTERS_DECLS, PERSONALITY2_INCLUDE_PRINTERS_DEFS. * syscall.c: Include PERSONALITY1_INCLUDE_FUNCS, PERSONALITY2_INCLUDE_FUNCS, PERSONALITY0_INCLUDE_PRINTERS_DECLS, PERSONALITY0_INCLUDE_PRINTERS_DEFS, PERSONALITY1_INCLUDE_PRINTERS_DECLS, PERSONALITY1_INCLUDE_PRINTERS_DEFS, PERSONALITY2_INCLUDE_PRINTERS_DECLS, PERSONALITY2_INCLUDE_PRINTERS_DEFS. (printers): New struct. Update it when needed. * .gitignore: Add libmpers-m32.a, libmpers-mx32.a, m32_defs.h, m32_funcs.h, m32_printer_decls.h, m32_printer_defs.h, mpers-m32, mpers-m32.stamp, mpers-mx32, mpers-mx32.stamp, mpers.am, mx32_defs.h, mx32_funcs.h, mx32_printer_decls.h, mx32_printer_defs.h, native_printer_decls.h, native_printer_defs.h, and printers.h.
2015-08-04 01:47:02 +03:00
echo '/* Generated by Makefile from $^; do not edit. */' > $@-t
echo 'typedef struct {' >> $@-t
for f in $^; do \
sed -r -n 's/$(mpers_printer_decl_pattern)/ \1 (*\2)(\3);\n#define \2 MPERS_PRINTER_NAME(\2)\n/p' $$f \
|| exit; \
Add mpers support Add a subsystem for semi-automatical definition of how parsers should work with personality-dependent (mpers) types of tracee's data. Create auxiliary libraries containing mpers syscall parsers and printer functions, one library for each possible nonnative target personality. Currently some parsers do not handle differences in definitions of data types between personalities, namely LP64 and ILP32. When this is the case, long integers, pointers, and all compound types containing long and pointer members may be printed incorrectly, because of differences in sizes, offsets and alignments. Since in most cases these are the only differences in desired behaviour of parsers and printers for different personalities, a correct way would be to compile one source code into multiple parsers, differing only in definitions of mpers types. To get a definition of a given type for nonnative personality a very basic .c file containing a declaration of a variable of this type is being compiled for this personality (using -m32 or -mx32 compiler flag). Information about the type is then being extracted from this binary's DWARF debug info with an awk script and put into a corresponding header file. Resulting headers are being used to compile mpers variations of syscall parsers and printer functions. In addition to syscall parsers, there can occur a need to create mpers printing functions, which then can be called from many places in the code (for example, printsiginfo_at). Such functions (printers) are marked in a special manner. For each possible nonnative target personality a library is being created, containing mpers variations of syscall parsers and printers. Only syscall parsers from files marked in a special manner and specially marked functions from such files are being recompiled and included in these libraries. generate_mpers_am.sh is called by bootstrap to find the files from strace_SOURCES which include MPERS_DEFS. During compilation, these files are being inspected for inclusions of DEF_MPERS_TYPE, and nonnative variations of each included type are being generated by an awk script. Mpers parser names are being modified during inclusions of syscallent headers for nonnative personalities. Pointers to printers are being stored in structs struct_printers, and a master pointer printers is being updated on every set_personality. * README-mpers: New README explaining how to use mpers support. * empty.h: New empty file. * generate_mpers_am.sh: New file. * mpers.awk: Likewise. * mpers.sh: Likewise. * mpers_test.sh: Likewise. * mpers_type.h: Likewise. * Makefile.am (strace_SOURCES): Add empty.h and mpers_type.h. (strace_CPPFLAGS, strace_LDFLAGS, strace_LDADD): Move to the beginning of the file. (strace_LDADD, noinst_LIBRARIES): Add libmpers-%.a. (EXTRA_DIST): Add mpers.awk, mpers.sh, mpers_test.sh. (BUILT_SOURCES, CLEANFILES): Add new generated files: native_printer_decls.h, native_printer_defs.h, printers.h, [HAVE_M32_MPERS] $(mpers_m32_targets), and [HAVE_MX32_MPERS] $(mpers_mx32_targets). (mpers_NAME, mpers_PREFIX, mpers_DEFS, mpers_INCLUDES, mpers_CPPFLAGS, mpers_sh_opts, libmpers_CPPFLAGS, libmpers_m[x]32_a_SOURCES, libmpers_m[x]32_a_CPPFLAGS, mpers_m[x]32_targets): New variables. (mpers-m[x]32.stamp, m[x]32_defs.h, m[x]32_funcs.h, printers.h, %_printer_decls.h, %_printer_defs.h, clean-local, native_printer_decls.h, native_printer_defs.h, $mpers_m[x]32_targets): New targets. * bootstrap: Add generate_mpers_am.sh. * configure.ac: Add AC_PROG_RANLIB. * m4/mpers.m4: Add HAVE_MPERS variable. Add $st_cv_mpers checks. * defs.h: Include mpers_type.h. Include printers.h, native_printer_decls.h, define MPERS_PRINTER_NAME. Redefine SYS_FUNC_NAME. Define MPERS_PRINTER_DECL. [HAVE_M32_MPERS]: define PERSONALITY1_INCLUDE_FUNCS, PERSONALITY1_INCLUDE_PRINTERS_DECLS, PERSONALITY1_INCLUDE_PRINTERS_DEFS for X86_64, X32. [HAVE_MX32_MPERS]: define PERSONALITY2_INCLUDE_FUNCS, PERSONALITY2_INCLUDE_PRINTERS_DECLS, PERSONALITY2_INCLUDE_PRINTERS_DEFS for X86_64. Add fallback definitions of PERSONALITY1_INCLUDE_FUNCS, PERSONALITY2_INCLUDE_FUNCS, PERSONALITY0_INCLUDE_PRINTERS_DECLS, PERSONALITY0_INCLUDE_PRINTERS_DEFS, PERSONALITY1_INCLUDE_PRINTERS_DECLS, PERSONALITY1_INCLUDE_PRINTERS_DEFS, PERSONALITY2_INCLUDE_PRINTERS_DECLS, PERSONALITY2_INCLUDE_PRINTERS_DEFS. * syscall.c: Include PERSONALITY1_INCLUDE_FUNCS, PERSONALITY2_INCLUDE_FUNCS, PERSONALITY0_INCLUDE_PRINTERS_DECLS, PERSONALITY0_INCLUDE_PRINTERS_DEFS, PERSONALITY1_INCLUDE_PRINTERS_DECLS, PERSONALITY1_INCLUDE_PRINTERS_DEFS, PERSONALITY2_INCLUDE_PRINTERS_DECLS, PERSONALITY2_INCLUDE_PRINTERS_DEFS. (printers): New struct. Update it when needed. * .gitignore: Add libmpers-m32.a, libmpers-mx32.a, m32_defs.h, m32_funcs.h, m32_printer_decls.h, m32_printer_defs.h, mpers-m32, mpers-m32.stamp, mpers-mx32, mpers-mx32.stamp, mpers.am, mx32_defs.h, mx32_funcs.h, mx32_printer_decls.h, mx32_printer_defs.h, native_printer_decls.h, native_printer_defs.h, and printers.h.
2015-08-04 01:47:02 +03:00
done >> $@-t
echo '} struct_printers;' >> $@-t
echo 'extern const struct_printers *printers;' >> $@-t
echo '#define MPERS_PRINTER_NAME(printer_name) printers->printer_name' >> $@-t
Add mpers support Add a subsystem for semi-automatical definition of how parsers should work with personality-dependent (mpers) types of tracee's data. Create auxiliary libraries containing mpers syscall parsers and printer functions, one library for each possible nonnative target personality. Currently some parsers do not handle differences in definitions of data types between personalities, namely LP64 and ILP32. When this is the case, long integers, pointers, and all compound types containing long and pointer members may be printed incorrectly, because of differences in sizes, offsets and alignments. Since in most cases these are the only differences in desired behaviour of parsers and printers for different personalities, a correct way would be to compile one source code into multiple parsers, differing only in definitions of mpers types. To get a definition of a given type for nonnative personality a very basic .c file containing a declaration of a variable of this type is being compiled for this personality (using -m32 or -mx32 compiler flag). Information about the type is then being extracted from this binary's DWARF debug info with an awk script and put into a corresponding header file. Resulting headers are being used to compile mpers variations of syscall parsers and printer functions. In addition to syscall parsers, there can occur a need to create mpers printing functions, which then can be called from many places in the code (for example, printsiginfo_at). Such functions (printers) are marked in a special manner. For each possible nonnative target personality a library is being created, containing mpers variations of syscall parsers and printers. Only syscall parsers from files marked in a special manner and specially marked functions from such files are being recompiled and included in these libraries. generate_mpers_am.sh is called by bootstrap to find the files from strace_SOURCES which include MPERS_DEFS. During compilation, these files are being inspected for inclusions of DEF_MPERS_TYPE, and nonnative variations of each included type are being generated by an awk script. Mpers parser names are being modified during inclusions of syscallent headers for nonnative personalities. Pointers to printers are being stored in structs struct_printers, and a master pointer printers is being updated on every set_personality. * README-mpers: New README explaining how to use mpers support. * empty.h: New empty file. * generate_mpers_am.sh: New file. * mpers.awk: Likewise. * mpers.sh: Likewise. * mpers_test.sh: Likewise. * mpers_type.h: Likewise. * Makefile.am (strace_SOURCES): Add empty.h and mpers_type.h. (strace_CPPFLAGS, strace_LDFLAGS, strace_LDADD): Move to the beginning of the file. (strace_LDADD, noinst_LIBRARIES): Add libmpers-%.a. (EXTRA_DIST): Add mpers.awk, mpers.sh, mpers_test.sh. (BUILT_SOURCES, CLEANFILES): Add new generated files: native_printer_decls.h, native_printer_defs.h, printers.h, [HAVE_M32_MPERS] $(mpers_m32_targets), and [HAVE_MX32_MPERS] $(mpers_mx32_targets). (mpers_NAME, mpers_PREFIX, mpers_DEFS, mpers_INCLUDES, mpers_CPPFLAGS, mpers_sh_opts, libmpers_CPPFLAGS, libmpers_m[x]32_a_SOURCES, libmpers_m[x]32_a_CPPFLAGS, mpers_m[x]32_targets): New variables. (mpers-m[x]32.stamp, m[x]32_defs.h, m[x]32_funcs.h, printers.h, %_printer_decls.h, %_printer_defs.h, clean-local, native_printer_decls.h, native_printer_defs.h, $mpers_m[x]32_targets): New targets. * bootstrap: Add generate_mpers_am.sh. * configure.ac: Add AC_PROG_RANLIB. * m4/mpers.m4: Add HAVE_MPERS variable. Add $st_cv_mpers checks. * defs.h: Include mpers_type.h. Include printers.h, native_printer_decls.h, define MPERS_PRINTER_NAME. Redefine SYS_FUNC_NAME. Define MPERS_PRINTER_DECL. [HAVE_M32_MPERS]: define PERSONALITY1_INCLUDE_FUNCS, PERSONALITY1_INCLUDE_PRINTERS_DECLS, PERSONALITY1_INCLUDE_PRINTERS_DEFS for X86_64, X32. [HAVE_MX32_MPERS]: define PERSONALITY2_INCLUDE_FUNCS, PERSONALITY2_INCLUDE_PRINTERS_DECLS, PERSONALITY2_INCLUDE_PRINTERS_DEFS for X86_64. Add fallback definitions of PERSONALITY1_INCLUDE_FUNCS, PERSONALITY2_INCLUDE_FUNCS, PERSONALITY0_INCLUDE_PRINTERS_DECLS, PERSONALITY0_INCLUDE_PRINTERS_DEFS, PERSONALITY1_INCLUDE_PRINTERS_DECLS, PERSONALITY1_INCLUDE_PRINTERS_DEFS, PERSONALITY2_INCLUDE_PRINTERS_DECLS, PERSONALITY2_INCLUDE_PRINTERS_DEFS. * syscall.c: Include PERSONALITY1_INCLUDE_FUNCS, PERSONALITY2_INCLUDE_FUNCS, PERSONALITY0_INCLUDE_PRINTERS_DECLS, PERSONALITY0_INCLUDE_PRINTERS_DEFS, PERSONALITY1_INCLUDE_PRINTERS_DECLS, PERSONALITY1_INCLUDE_PRINTERS_DEFS, PERSONALITY2_INCLUDE_PRINTERS_DECLS, PERSONALITY2_INCLUDE_PRINTERS_DEFS. (printers): New struct. Update it when needed. * .gitignore: Add libmpers-m32.a, libmpers-mx32.a, m32_defs.h, m32_funcs.h, m32_printer_decls.h, m32_printer_defs.h, mpers-m32, mpers-m32.stamp, mpers-mx32, mpers-mx32.stamp, mpers.am, mx32_defs.h, mx32_funcs.h, mx32_printer_decls.h, mx32_printer_defs.h, native_printer_decls.h, native_printer_defs.h, and printers.h.
2015-08-04 01:47:02 +03:00
mv $@-t $@
%_printer_decls.h: $(mpers_preproc_files)
Add mpers support Add a subsystem for semi-automatical definition of how parsers should work with personality-dependent (mpers) types of tracee's data. Create auxiliary libraries containing mpers syscall parsers and printer functions, one library for each possible nonnative target personality. Currently some parsers do not handle differences in definitions of data types between personalities, namely LP64 and ILP32. When this is the case, long integers, pointers, and all compound types containing long and pointer members may be printed incorrectly, because of differences in sizes, offsets and alignments. Since in most cases these are the only differences in desired behaviour of parsers and printers for different personalities, a correct way would be to compile one source code into multiple parsers, differing only in definitions of mpers types. To get a definition of a given type for nonnative personality a very basic .c file containing a declaration of a variable of this type is being compiled for this personality (using -m32 or -mx32 compiler flag). Information about the type is then being extracted from this binary's DWARF debug info with an awk script and put into a corresponding header file. Resulting headers are being used to compile mpers variations of syscall parsers and printer functions. In addition to syscall parsers, there can occur a need to create mpers printing functions, which then can be called from many places in the code (for example, printsiginfo_at). Such functions (printers) are marked in a special manner. For each possible nonnative target personality a library is being created, containing mpers variations of syscall parsers and printers. Only syscall parsers from files marked in a special manner and specially marked functions from such files are being recompiled and included in these libraries. generate_mpers_am.sh is called by bootstrap to find the files from strace_SOURCES which include MPERS_DEFS. During compilation, these files are being inspected for inclusions of DEF_MPERS_TYPE, and nonnative variations of each included type are being generated by an awk script. Mpers parser names are being modified during inclusions of syscallent headers for nonnative personalities. Pointers to printers are being stored in structs struct_printers, and a master pointer printers is being updated on every set_personality. * README-mpers: New README explaining how to use mpers support. * empty.h: New empty file. * generate_mpers_am.sh: New file. * mpers.awk: Likewise. * mpers.sh: Likewise. * mpers_test.sh: Likewise. * mpers_type.h: Likewise. * Makefile.am (strace_SOURCES): Add empty.h and mpers_type.h. (strace_CPPFLAGS, strace_LDFLAGS, strace_LDADD): Move to the beginning of the file. (strace_LDADD, noinst_LIBRARIES): Add libmpers-%.a. (EXTRA_DIST): Add mpers.awk, mpers.sh, mpers_test.sh. (BUILT_SOURCES, CLEANFILES): Add new generated files: native_printer_decls.h, native_printer_defs.h, printers.h, [HAVE_M32_MPERS] $(mpers_m32_targets), and [HAVE_MX32_MPERS] $(mpers_mx32_targets). (mpers_NAME, mpers_PREFIX, mpers_DEFS, mpers_INCLUDES, mpers_CPPFLAGS, mpers_sh_opts, libmpers_CPPFLAGS, libmpers_m[x]32_a_SOURCES, libmpers_m[x]32_a_CPPFLAGS, mpers_m[x]32_targets): New variables. (mpers-m[x]32.stamp, m[x]32_defs.h, m[x]32_funcs.h, printers.h, %_printer_decls.h, %_printer_defs.h, clean-local, native_printer_decls.h, native_printer_defs.h, $mpers_m[x]32_targets): New targets. * bootstrap: Add generate_mpers_am.sh. * configure.ac: Add AC_PROG_RANLIB. * m4/mpers.m4: Add HAVE_MPERS variable. Add $st_cv_mpers checks. * defs.h: Include mpers_type.h. Include printers.h, native_printer_decls.h, define MPERS_PRINTER_NAME. Redefine SYS_FUNC_NAME. Define MPERS_PRINTER_DECL. [HAVE_M32_MPERS]: define PERSONALITY1_INCLUDE_FUNCS, PERSONALITY1_INCLUDE_PRINTERS_DECLS, PERSONALITY1_INCLUDE_PRINTERS_DEFS for X86_64, X32. [HAVE_MX32_MPERS]: define PERSONALITY2_INCLUDE_FUNCS, PERSONALITY2_INCLUDE_PRINTERS_DECLS, PERSONALITY2_INCLUDE_PRINTERS_DEFS for X86_64. Add fallback definitions of PERSONALITY1_INCLUDE_FUNCS, PERSONALITY2_INCLUDE_FUNCS, PERSONALITY0_INCLUDE_PRINTERS_DECLS, PERSONALITY0_INCLUDE_PRINTERS_DEFS, PERSONALITY1_INCLUDE_PRINTERS_DECLS, PERSONALITY1_INCLUDE_PRINTERS_DEFS, PERSONALITY2_INCLUDE_PRINTERS_DECLS, PERSONALITY2_INCLUDE_PRINTERS_DEFS. * syscall.c: Include PERSONALITY1_INCLUDE_FUNCS, PERSONALITY2_INCLUDE_FUNCS, PERSONALITY0_INCLUDE_PRINTERS_DECLS, PERSONALITY0_INCLUDE_PRINTERS_DEFS, PERSONALITY1_INCLUDE_PRINTERS_DECLS, PERSONALITY1_INCLUDE_PRINTERS_DEFS, PERSONALITY2_INCLUDE_PRINTERS_DECLS, PERSONALITY2_INCLUDE_PRINTERS_DEFS. (printers): New struct. Update it when needed. * .gitignore: Add libmpers-m32.a, libmpers-mx32.a, m32_defs.h, m32_funcs.h, m32_printer_decls.h, m32_printer_defs.h, mpers-m32, mpers-m32.stamp, mpers-mx32, mpers-mx32.stamp, mpers.am, mx32_defs.h, mx32_funcs.h, mx32_printer_decls.h, mx32_printer_defs.h, native_printer_decls.h, native_printer_defs.h, and printers.h.
2015-08-04 01:47:02 +03:00
echo '/* Generated by Makefile from $^; do not edit. */' > $@-t
for f in $^; do \
sed -r -n 's/$(mpers_printer_decl_pattern)/extern \1 $(mpers_PREFIX)\2(\3);/p' $$f \
|| exit; \
Add mpers support Add a subsystem for semi-automatical definition of how parsers should work with personality-dependent (mpers) types of tracee's data. Create auxiliary libraries containing mpers syscall parsers and printer functions, one library for each possible nonnative target personality. Currently some parsers do not handle differences in definitions of data types between personalities, namely LP64 and ILP32. When this is the case, long integers, pointers, and all compound types containing long and pointer members may be printed incorrectly, because of differences in sizes, offsets and alignments. Since in most cases these are the only differences in desired behaviour of parsers and printers for different personalities, a correct way would be to compile one source code into multiple parsers, differing only in definitions of mpers types. To get a definition of a given type for nonnative personality a very basic .c file containing a declaration of a variable of this type is being compiled for this personality (using -m32 or -mx32 compiler flag). Information about the type is then being extracted from this binary's DWARF debug info with an awk script and put into a corresponding header file. Resulting headers are being used to compile mpers variations of syscall parsers and printer functions. In addition to syscall parsers, there can occur a need to create mpers printing functions, which then can be called from many places in the code (for example, printsiginfo_at). Such functions (printers) are marked in a special manner. For each possible nonnative target personality a library is being created, containing mpers variations of syscall parsers and printers. Only syscall parsers from files marked in a special manner and specially marked functions from such files are being recompiled and included in these libraries. generate_mpers_am.sh is called by bootstrap to find the files from strace_SOURCES which include MPERS_DEFS. During compilation, these files are being inspected for inclusions of DEF_MPERS_TYPE, and nonnative variations of each included type are being generated by an awk script. Mpers parser names are being modified during inclusions of syscallent headers for nonnative personalities. Pointers to printers are being stored in structs struct_printers, and a master pointer printers is being updated on every set_personality. * README-mpers: New README explaining how to use mpers support. * empty.h: New empty file. * generate_mpers_am.sh: New file. * mpers.awk: Likewise. * mpers.sh: Likewise. * mpers_test.sh: Likewise. * mpers_type.h: Likewise. * Makefile.am (strace_SOURCES): Add empty.h and mpers_type.h. (strace_CPPFLAGS, strace_LDFLAGS, strace_LDADD): Move to the beginning of the file. (strace_LDADD, noinst_LIBRARIES): Add libmpers-%.a. (EXTRA_DIST): Add mpers.awk, mpers.sh, mpers_test.sh. (BUILT_SOURCES, CLEANFILES): Add new generated files: native_printer_decls.h, native_printer_defs.h, printers.h, [HAVE_M32_MPERS] $(mpers_m32_targets), and [HAVE_MX32_MPERS] $(mpers_mx32_targets). (mpers_NAME, mpers_PREFIX, mpers_DEFS, mpers_INCLUDES, mpers_CPPFLAGS, mpers_sh_opts, libmpers_CPPFLAGS, libmpers_m[x]32_a_SOURCES, libmpers_m[x]32_a_CPPFLAGS, mpers_m[x]32_targets): New variables. (mpers-m[x]32.stamp, m[x]32_defs.h, m[x]32_funcs.h, printers.h, %_printer_decls.h, %_printer_defs.h, clean-local, native_printer_decls.h, native_printer_defs.h, $mpers_m[x]32_targets): New targets. * bootstrap: Add generate_mpers_am.sh. * configure.ac: Add AC_PROG_RANLIB. * m4/mpers.m4: Add HAVE_MPERS variable. Add $st_cv_mpers checks. * defs.h: Include mpers_type.h. Include printers.h, native_printer_decls.h, define MPERS_PRINTER_NAME. Redefine SYS_FUNC_NAME. Define MPERS_PRINTER_DECL. [HAVE_M32_MPERS]: define PERSONALITY1_INCLUDE_FUNCS, PERSONALITY1_INCLUDE_PRINTERS_DECLS, PERSONALITY1_INCLUDE_PRINTERS_DEFS for X86_64, X32. [HAVE_MX32_MPERS]: define PERSONALITY2_INCLUDE_FUNCS, PERSONALITY2_INCLUDE_PRINTERS_DECLS, PERSONALITY2_INCLUDE_PRINTERS_DEFS for X86_64. Add fallback definitions of PERSONALITY1_INCLUDE_FUNCS, PERSONALITY2_INCLUDE_FUNCS, PERSONALITY0_INCLUDE_PRINTERS_DECLS, PERSONALITY0_INCLUDE_PRINTERS_DEFS, PERSONALITY1_INCLUDE_PRINTERS_DECLS, PERSONALITY1_INCLUDE_PRINTERS_DEFS, PERSONALITY2_INCLUDE_PRINTERS_DECLS, PERSONALITY2_INCLUDE_PRINTERS_DEFS. * syscall.c: Include PERSONALITY1_INCLUDE_FUNCS, PERSONALITY2_INCLUDE_FUNCS, PERSONALITY0_INCLUDE_PRINTERS_DECLS, PERSONALITY0_INCLUDE_PRINTERS_DEFS, PERSONALITY1_INCLUDE_PRINTERS_DECLS, PERSONALITY1_INCLUDE_PRINTERS_DEFS, PERSONALITY2_INCLUDE_PRINTERS_DECLS, PERSONALITY2_INCLUDE_PRINTERS_DEFS. (printers): New struct. Update it when needed. * .gitignore: Add libmpers-m32.a, libmpers-mx32.a, m32_defs.h, m32_funcs.h, m32_printer_decls.h, m32_printer_defs.h, mpers-m32, mpers-m32.stamp, mpers-mx32, mpers-mx32.stamp, mpers.am, mx32_defs.h, mx32_funcs.h, mx32_printer_decls.h, mx32_printer_defs.h, native_printer_decls.h, native_printer_defs.h, and printers.h.
2015-08-04 01:47:02 +03:00
done >> $@-t
mv $@-t $@
%_printer_defs.h: $(mpers_preproc_files)
Add mpers support Add a subsystem for semi-automatical definition of how parsers should work with personality-dependent (mpers) types of tracee's data. Create auxiliary libraries containing mpers syscall parsers and printer functions, one library for each possible nonnative target personality. Currently some parsers do not handle differences in definitions of data types between personalities, namely LP64 and ILP32. When this is the case, long integers, pointers, and all compound types containing long and pointer members may be printed incorrectly, because of differences in sizes, offsets and alignments. Since in most cases these are the only differences in desired behaviour of parsers and printers for different personalities, a correct way would be to compile one source code into multiple parsers, differing only in definitions of mpers types. To get a definition of a given type for nonnative personality a very basic .c file containing a declaration of a variable of this type is being compiled for this personality (using -m32 or -mx32 compiler flag). Information about the type is then being extracted from this binary's DWARF debug info with an awk script and put into a corresponding header file. Resulting headers are being used to compile mpers variations of syscall parsers and printer functions. In addition to syscall parsers, there can occur a need to create mpers printing functions, which then can be called from many places in the code (for example, printsiginfo_at). Such functions (printers) are marked in a special manner. For each possible nonnative target personality a library is being created, containing mpers variations of syscall parsers and printers. Only syscall parsers from files marked in a special manner and specially marked functions from such files are being recompiled and included in these libraries. generate_mpers_am.sh is called by bootstrap to find the files from strace_SOURCES which include MPERS_DEFS. During compilation, these files are being inspected for inclusions of DEF_MPERS_TYPE, and nonnative variations of each included type are being generated by an awk script. Mpers parser names are being modified during inclusions of syscallent headers for nonnative personalities. Pointers to printers are being stored in structs struct_printers, and a master pointer printers is being updated on every set_personality. * README-mpers: New README explaining how to use mpers support. * empty.h: New empty file. * generate_mpers_am.sh: New file. * mpers.awk: Likewise. * mpers.sh: Likewise. * mpers_test.sh: Likewise. * mpers_type.h: Likewise. * Makefile.am (strace_SOURCES): Add empty.h and mpers_type.h. (strace_CPPFLAGS, strace_LDFLAGS, strace_LDADD): Move to the beginning of the file. (strace_LDADD, noinst_LIBRARIES): Add libmpers-%.a. (EXTRA_DIST): Add mpers.awk, mpers.sh, mpers_test.sh. (BUILT_SOURCES, CLEANFILES): Add new generated files: native_printer_decls.h, native_printer_defs.h, printers.h, [HAVE_M32_MPERS] $(mpers_m32_targets), and [HAVE_MX32_MPERS] $(mpers_mx32_targets). (mpers_NAME, mpers_PREFIX, mpers_DEFS, mpers_INCLUDES, mpers_CPPFLAGS, mpers_sh_opts, libmpers_CPPFLAGS, libmpers_m[x]32_a_SOURCES, libmpers_m[x]32_a_CPPFLAGS, mpers_m[x]32_targets): New variables. (mpers-m[x]32.stamp, m[x]32_defs.h, m[x]32_funcs.h, printers.h, %_printer_decls.h, %_printer_defs.h, clean-local, native_printer_decls.h, native_printer_defs.h, $mpers_m[x]32_targets): New targets. * bootstrap: Add generate_mpers_am.sh. * configure.ac: Add AC_PROG_RANLIB. * m4/mpers.m4: Add HAVE_MPERS variable. Add $st_cv_mpers checks. * defs.h: Include mpers_type.h. Include printers.h, native_printer_decls.h, define MPERS_PRINTER_NAME. Redefine SYS_FUNC_NAME. Define MPERS_PRINTER_DECL. [HAVE_M32_MPERS]: define PERSONALITY1_INCLUDE_FUNCS, PERSONALITY1_INCLUDE_PRINTERS_DECLS, PERSONALITY1_INCLUDE_PRINTERS_DEFS for X86_64, X32. [HAVE_MX32_MPERS]: define PERSONALITY2_INCLUDE_FUNCS, PERSONALITY2_INCLUDE_PRINTERS_DECLS, PERSONALITY2_INCLUDE_PRINTERS_DEFS for X86_64. Add fallback definitions of PERSONALITY1_INCLUDE_FUNCS, PERSONALITY2_INCLUDE_FUNCS, PERSONALITY0_INCLUDE_PRINTERS_DECLS, PERSONALITY0_INCLUDE_PRINTERS_DEFS, PERSONALITY1_INCLUDE_PRINTERS_DECLS, PERSONALITY1_INCLUDE_PRINTERS_DEFS, PERSONALITY2_INCLUDE_PRINTERS_DECLS, PERSONALITY2_INCLUDE_PRINTERS_DEFS. * syscall.c: Include PERSONALITY1_INCLUDE_FUNCS, PERSONALITY2_INCLUDE_FUNCS, PERSONALITY0_INCLUDE_PRINTERS_DECLS, PERSONALITY0_INCLUDE_PRINTERS_DEFS, PERSONALITY1_INCLUDE_PRINTERS_DECLS, PERSONALITY1_INCLUDE_PRINTERS_DEFS, PERSONALITY2_INCLUDE_PRINTERS_DECLS, PERSONALITY2_INCLUDE_PRINTERS_DEFS. (printers): New struct. Update it when needed. * .gitignore: Add libmpers-m32.a, libmpers-mx32.a, m32_defs.h, m32_funcs.h, m32_printer_decls.h, m32_printer_defs.h, mpers-m32, mpers-m32.stamp, mpers-mx32, mpers-mx32.stamp, mpers.am, mx32_defs.h, mx32_funcs.h, mx32_printer_decls.h, mx32_printer_defs.h, native_printer_decls.h, native_printer_defs.h, and printers.h.
2015-08-04 01:47:02 +03:00
echo '/* Generated by Makefile from $^; do not edit. */' > $@-t
for f in $^; do \
sed -r -n 's/$(mpers_printer_decl_pattern)/.\2 = $(mpers_PREFIX)\2,/p' $$f \
|| exit; \
Add mpers support Add a subsystem for semi-automatical definition of how parsers should work with personality-dependent (mpers) types of tracee's data. Create auxiliary libraries containing mpers syscall parsers and printer functions, one library for each possible nonnative target personality. Currently some parsers do not handle differences in definitions of data types between personalities, namely LP64 and ILP32. When this is the case, long integers, pointers, and all compound types containing long and pointer members may be printed incorrectly, because of differences in sizes, offsets and alignments. Since in most cases these are the only differences in desired behaviour of parsers and printers for different personalities, a correct way would be to compile one source code into multiple parsers, differing only in definitions of mpers types. To get a definition of a given type for nonnative personality a very basic .c file containing a declaration of a variable of this type is being compiled for this personality (using -m32 or -mx32 compiler flag). Information about the type is then being extracted from this binary's DWARF debug info with an awk script and put into a corresponding header file. Resulting headers are being used to compile mpers variations of syscall parsers and printer functions. In addition to syscall parsers, there can occur a need to create mpers printing functions, which then can be called from many places in the code (for example, printsiginfo_at). Such functions (printers) are marked in a special manner. For each possible nonnative target personality a library is being created, containing mpers variations of syscall parsers and printers. Only syscall parsers from files marked in a special manner and specially marked functions from such files are being recompiled and included in these libraries. generate_mpers_am.sh is called by bootstrap to find the files from strace_SOURCES which include MPERS_DEFS. During compilation, these files are being inspected for inclusions of DEF_MPERS_TYPE, and nonnative variations of each included type are being generated by an awk script. Mpers parser names are being modified during inclusions of syscallent headers for nonnative personalities. Pointers to printers are being stored in structs struct_printers, and a master pointer printers is being updated on every set_personality. * README-mpers: New README explaining how to use mpers support. * empty.h: New empty file. * generate_mpers_am.sh: New file. * mpers.awk: Likewise. * mpers.sh: Likewise. * mpers_test.sh: Likewise. * mpers_type.h: Likewise. * Makefile.am (strace_SOURCES): Add empty.h and mpers_type.h. (strace_CPPFLAGS, strace_LDFLAGS, strace_LDADD): Move to the beginning of the file. (strace_LDADD, noinst_LIBRARIES): Add libmpers-%.a. (EXTRA_DIST): Add mpers.awk, mpers.sh, mpers_test.sh. (BUILT_SOURCES, CLEANFILES): Add new generated files: native_printer_decls.h, native_printer_defs.h, printers.h, [HAVE_M32_MPERS] $(mpers_m32_targets), and [HAVE_MX32_MPERS] $(mpers_mx32_targets). (mpers_NAME, mpers_PREFIX, mpers_DEFS, mpers_INCLUDES, mpers_CPPFLAGS, mpers_sh_opts, libmpers_CPPFLAGS, libmpers_m[x]32_a_SOURCES, libmpers_m[x]32_a_CPPFLAGS, mpers_m[x]32_targets): New variables. (mpers-m[x]32.stamp, m[x]32_defs.h, m[x]32_funcs.h, printers.h, %_printer_decls.h, %_printer_defs.h, clean-local, native_printer_decls.h, native_printer_defs.h, $mpers_m[x]32_targets): New targets. * bootstrap: Add generate_mpers_am.sh. * configure.ac: Add AC_PROG_RANLIB. * m4/mpers.m4: Add HAVE_MPERS variable. Add $st_cv_mpers checks. * defs.h: Include mpers_type.h. Include printers.h, native_printer_decls.h, define MPERS_PRINTER_NAME. Redefine SYS_FUNC_NAME. Define MPERS_PRINTER_DECL. [HAVE_M32_MPERS]: define PERSONALITY1_INCLUDE_FUNCS, PERSONALITY1_INCLUDE_PRINTERS_DECLS, PERSONALITY1_INCLUDE_PRINTERS_DEFS for X86_64, X32. [HAVE_MX32_MPERS]: define PERSONALITY2_INCLUDE_FUNCS, PERSONALITY2_INCLUDE_PRINTERS_DECLS, PERSONALITY2_INCLUDE_PRINTERS_DEFS for X86_64. Add fallback definitions of PERSONALITY1_INCLUDE_FUNCS, PERSONALITY2_INCLUDE_FUNCS, PERSONALITY0_INCLUDE_PRINTERS_DECLS, PERSONALITY0_INCLUDE_PRINTERS_DEFS, PERSONALITY1_INCLUDE_PRINTERS_DECLS, PERSONALITY1_INCLUDE_PRINTERS_DEFS, PERSONALITY2_INCLUDE_PRINTERS_DECLS, PERSONALITY2_INCLUDE_PRINTERS_DEFS. * syscall.c: Include PERSONALITY1_INCLUDE_FUNCS, PERSONALITY2_INCLUDE_FUNCS, PERSONALITY0_INCLUDE_PRINTERS_DECLS, PERSONALITY0_INCLUDE_PRINTERS_DEFS, PERSONALITY1_INCLUDE_PRINTERS_DECLS, PERSONALITY1_INCLUDE_PRINTERS_DEFS, PERSONALITY2_INCLUDE_PRINTERS_DECLS, PERSONALITY2_INCLUDE_PRINTERS_DEFS. (printers): New struct. Update it when needed. * .gitignore: Add libmpers-m32.a, libmpers-mx32.a, m32_defs.h, m32_funcs.h, m32_printer_decls.h, m32_printer_defs.h, mpers-m32, mpers-m32.stamp, mpers-mx32, mpers-mx32.stamp, mpers.am, mx32_defs.h, mx32_funcs.h, mx32_printer_decls.h, mx32_printer_defs.h, native_printer_decls.h, native_printer_defs.h, and printers.h.
2015-08-04 01:47:02 +03:00
done >> $@-t
mv $@-t $@
native_printer_decls.h native_printer_defs.h: mpers_PREFIX =
if HAVE_M32_MPERS
strace_LDADD += libmpers-m32.a
noinst_LIBRARIES += libmpers-m32.a
libmpers_m32_a_SOURCES = $(mpers_source_files)
libmpers_m32_a_CPPFLAGS = $(libmpers_CPPFLAGS) -DMPERS_IS_m32 -I$(builddir)/mpers-m32
libmpers_m32_a_CFLAGS = $(libmpers_CFLAGS)
mpers_m32_targets = mpers-m32.stamp m32_type_defs.h m32_funcs.h m32_printer_decls.h m32_printer_defs.h
Add mpers support Add a subsystem for semi-automatical definition of how parsers should work with personality-dependent (mpers) types of tracee's data. Create auxiliary libraries containing mpers syscall parsers and printer functions, one library for each possible nonnative target personality. Currently some parsers do not handle differences in definitions of data types between personalities, namely LP64 and ILP32. When this is the case, long integers, pointers, and all compound types containing long and pointer members may be printed incorrectly, because of differences in sizes, offsets and alignments. Since in most cases these are the only differences in desired behaviour of parsers and printers for different personalities, a correct way would be to compile one source code into multiple parsers, differing only in definitions of mpers types. To get a definition of a given type for nonnative personality a very basic .c file containing a declaration of a variable of this type is being compiled for this personality (using -m32 or -mx32 compiler flag). Information about the type is then being extracted from this binary's DWARF debug info with an awk script and put into a corresponding header file. Resulting headers are being used to compile mpers variations of syscall parsers and printer functions. In addition to syscall parsers, there can occur a need to create mpers printing functions, which then can be called from many places in the code (for example, printsiginfo_at). Such functions (printers) are marked in a special manner. For each possible nonnative target personality a library is being created, containing mpers variations of syscall parsers and printers. Only syscall parsers from files marked in a special manner and specially marked functions from such files are being recompiled and included in these libraries. generate_mpers_am.sh is called by bootstrap to find the files from strace_SOURCES which include MPERS_DEFS. During compilation, these files are being inspected for inclusions of DEF_MPERS_TYPE, and nonnative variations of each included type are being generated by an awk script. Mpers parser names are being modified during inclusions of syscallent headers for nonnative personalities. Pointers to printers are being stored in structs struct_printers, and a master pointer printers is being updated on every set_personality. * README-mpers: New README explaining how to use mpers support. * empty.h: New empty file. * generate_mpers_am.sh: New file. * mpers.awk: Likewise. * mpers.sh: Likewise. * mpers_test.sh: Likewise. * mpers_type.h: Likewise. * Makefile.am (strace_SOURCES): Add empty.h and mpers_type.h. (strace_CPPFLAGS, strace_LDFLAGS, strace_LDADD): Move to the beginning of the file. (strace_LDADD, noinst_LIBRARIES): Add libmpers-%.a. (EXTRA_DIST): Add mpers.awk, mpers.sh, mpers_test.sh. (BUILT_SOURCES, CLEANFILES): Add new generated files: native_printer_decls.h, native_printer_defs.h, printers.h, [HAVE_M32_MPERS] $(mpers_m32_targets), and [HAVE_MX32_MPERS] $(mpers_mx32_targets). (mpers_NAME, mpers_PREFIX, mpers_DEFS, mpers_INCLUDES, mpers_CPPFLAGS, mpers_sh_opts, libmpers_CPPFLAGS, libmpers_m[x]32_a_SOURCES, libmpers_m[x]32_a_CPPFLAGS, mpers_m[x]32_targets): New variables. (mpers-m[x]32.stamp, m[x]32_defs.h, m[x]32_funcs.h, printers.h, %_printer_decls.h, %_printer_defs.h, clean-local, native_printer_decls.h, native_printer_defs.h, $mpers_m[x]32_targets): New targets. * bootstrap: Add generate_mpers_am.sh. * configure.ac: Add AC_PROG_RANLIB. * m4/mpers.m4: Add HAVE_MPERS variable. Add $st_cv_mpers checks. * defs.h: Include mpers_type.h. Include printers.h, native_printer_decls.h, define MPERS_PRINTER_NAME. Redefine SYS_FUNC_NAME. Define MPERS_PRINTER_DECL. [HAVE_M32_MPERS]: define PERSONALITY1_INCLUDE_FUNCS, PERSONALITY1_INCLUDE_PRINTERS_DECLS, PERSONALITY1_INCLUDE_PRINTERS_DEFS for X86_64, X32. [HAVE_MX32_MPERS]: define PERSONALITY2_INCLUDE_FUNCS, PERSONALITY2_INCLUDE_PRINTERS_DECLS, PERSONALITY2_INCLUDE_PRINTERS_DEFS for X86_64. Add fallback definitions of PERSONALITY1_INCLUDE_FUNCS, PERSONALITY2_INCLUDE_FUNCS, PERSONALITY0_INCLUDE_PRINTERS_DECLS, PERSONALITY0_INCLUDE_PRINTERS_DEFS, PERSONALITY1_INCLUDE_PRINTERS_DECLS, PERSONALITY1_INCLUDE_PRINTERS_DEFS, PERSONALITY2_INCLUDE_PRINTERS_DECLS, PERSONALITY2_INCLUDE_PRINTERS_DEFS. * syscall.c: Include PERSONALITY1_INCLUDE_FUNCS, PERSONALITY2_INCLUDE_FUNCS, PERSONALITY0_INCLUDE_PRINTERS_DECLS, PERSONALITY0_INCLUDE_PRINTERS_DEFS, PERSONALITY1_INCLUDE_PRINTERS_DECLS, PERSONALITY1_INCLUDE_PRINTERS_DEFS, PERSONALITY2_INCLUDE_PRINTERS_DECLS, PERSONALITY2_INCLUDE_PRINTERS_DEFS. (printers): New struct. Update it when needed. * .gitignore: Add libmpers-m32.a, libmpers-mx32.a, m32_defs.h, m32_funcs.h, m32_printer_decls.h, m32_printer_defs.h, mpers-m32, mpers-m32.stamp, mpers-mx32, mpers-mx32.stamp, mpers.am, mx32_defs.h, mx32_funcs.h, mx32_printer_decls.h, mx32_printer_defs.h, native_printer_decls.h, native_printer_defs.h, and printers.h.
2015-08-04 01:47:02 +03:00
BUILT_SOURCES += $(mpers_m32_targets)
CLEANFILES += $(mpers_m32_targets)
$(mpers_m32_targets): mpers_NAME = m32
endif # HAVE_M32_MPERS
if HAVE_MX32_MPERS
strace_LDADD += libmpers-mx32.a
noinst_LIBRARIES += libmpers-mx32.a
libmpers_mx32_a_SOURCES = $(mpers_source_files)
libmpers_mx32_a_CPPFLAGS = $(libmpers_CPPFLAGS) -DMPERS_IS_mx32 -I$(builddir)/mpers-mx32
libmpers_mx32_a_CFLAGS = $(libmpers_CFLAGS)
mpers_mx32_targets = mpers-mx32.stamp mx32_type_defs.h mx32_funcs.h mx32_printer_decls.h mx32_printer_defs.h
Add mpers support Add a subsystem for semi-automatical definition of how parsers should work with personality-dependent (mpers) types of tracee's data. Create auxiliary libraries containing mpers syscall parsers and printer functions, one library for each possible nonnative target personality. Currently some parsers do not handle differences in definitions of data types between personalities, namely LP64 and ILP32. When this is the case, long integers, pointers, and all compound types containing long and pointer members may be printed incorrectly, because of differences in sizes, offsets and alignments. Since in most cases these are the only differences in desired behaviour of parsers and printers for different personalities, a correct way would be to compile one source code into multiple parsers, differing only in definitions of mpers types. To get a definition of a given type for nonnative personality a very basic .c file containing a declaration of a variable of this type is being compiled for this personality (using -m32 or -mx32 compiler flag). Information about the type is then being extracted from this binary's DWARF debug info with an awk script and put into a corresponding header file. Resulting headers are being used to compile mpers variations of syscall parsers and printer functions. In addition to syscall parsers, there can occur a need to create mpers printing functions, which then can be called from many places in the code (for example, printsiginfo_at). Such functions (printers) are marked in a special manner. For each possible nonnative target personality a library is being created, containing mpers variations of syscall parsers and printers. Only syscall parsers from files marked in a special manner and specially marked functions from such files are being recompiled and included in these libraries. generate_mpers_am.sh is called by bootstrap to find the files from strace_SOURCES which include MPERS_DEFS. During compilation, these files are being inspected for inclusions of DEF_MPERS_TYPE, and nonnative variations of each included type are being generated by an awk script. Mpers parser names are being modified during inclusions of syscallent headers for nonnative personalities. Pointers to printers are being stored in structs struct_printers, and a master pointer printers is being updated on every set_personality. * README-mpers: New README explaining how to use mpers support. * empty.h: New empty file. * generate_mpers_am.sh: New file. * mpers.awk: Likewise. * mpers.sh: Likewise. * mpers_test.sh: Likewise. * mpers_type.h: Likewise. * Makefile.am (strace_SOURCES): Add empty.h and mpers_type.h. (strace_CPPFLAGS, strace_LDFLAGS, strace_LDADD): Move to the beginning of the file. (strace_LDADD, noinst_LIBRARIES): Add libmpers-%.a. (EXTRA_DIST): Add mpers.awk, mpers.sh, mpers_test.sh. (BUILT_SOURCES, CLEANFILES): Add new generated files: native_printer_decls.h, native_printer_defs.h, printers.h, [HAVE_M32_MPERS] $(mpers_m32_targets), and [HAVE_MX32_MPERS] $(mpers_mx32_targets). (mpers_NAME, mpers_PREFIX, mpers_DEFS, mpers_INCLUDES, mpers_CPPFLAGS, mpers_sh_opts, libmpers_CPPFLAGS, libmpers_m[x]32_a_SOURCES, libmpers_m[x]32_a_CPPFLAGS, mpers_m[x]32_targets): New variables. (mpers-m[x]32.stamp, m[x]32_defs.h, m[x]32_funcs.h, printers.h, %_printer_decls.h, %_printer_defs.h, clean-local, native_printer_decls.h, native_printer_defs.h, $mpers_m[x]32_targets): New targets. * bootstrap: Add generate_mpers_am.sh. * configure.ac: Add AC_PROG_RANLIB. * m4/mpers.m4: Add HAVE_MPERS variable. Add $st_cv_mpers checks. * defs.h: Include mpers_type.h. Include printers.h, native_printer_decls.h, define MPERS_PRINTER_NAME. Redefine SYS_FUNC_NAME. Define MPERS_PRINTER_DECL. [HAVE_M32_MPERS]: define PERSONALITY1_INCLUDE_FUNCS, PERSONALITY1_INCLUDE_PRINTERS_DECLS, PERSONALITY1_INCLUDE_PRINTERS_DEFS for X86_64, X32. [HAVE_MX32_MPERS]: define PERSONALITY2_INCLUDE_FUNCS, PERSONALITY2_INCLUDE_PRINTERS_DECLS, PERSONALITY2_INCLUDE_PRINTERS_DEFS for X86_64. Add fallback definitions of PERSONALITY1_INCLUDE_FUNCS, PERSONALITY2_INCLUDE_FUNCS, PERSONALITY0_INCLUDE_PRINTERS_DECLS, PERSONALITY0_INCLUDE_PRINTERS_DEFS, PERSONALITY1_INCLUDE_PRINTERS_DECLS, PERSONALITY1_INCLUDE_PRINTERS_DEFS, PERSONALITY2_INCLUDE_PRINTERS_DECLS, PERSONALITY2_INCLUDE_PRINTERS_DEFS. * syscall.c: Include PERSONALITY1_INCLUDE_FUNCS, PERSONALITY2_INCLUDE_FUNCS, PERSONALITY0_INCLUDE_PRINTERS_DECLS, PERSONALITY0_INCLUDE_PRINTERS_DEFS, PERSONALITY1_INCLUDE_PRINTERS_DECLS, PERSONALITY1_INCLUDE_PRINTERS_DEFS, PERSONALITY2_INCLUDE_PRINTERS_DECLS, PERSONALITY2_INCLUDE_PRINTERS_DEFS. (printers): New struct. Update it when needed. * .gitignore: Add libmpers-m32.a, libmpers-mx32.a, m32_defs.h, m32_funcs.h, m32_printer_decls.h, m32_printer_defs.h, mpers-m32, mpers-m32.stamp, mpers-mx32, mpers-mx32.stamp, mpers.am, mx32_defs.h, mx32_funcs.h, mx32_printer_decls.h, mx32_printer_defs.h, native_printer_decls.h, native_printer_defs.h, and printers.h.
2015-08-04 01:47:02 +03:00
BUILT_SOURCES += $(mpers_mx32_targets)
CLEANFILES += $(mpers_mx32_targets)
$(mpers_mx32_targets): mpers_NAME = mx32
endif # HAVE_MX32_MPERS
clean-local:
-rm -rf mpers-m32 mpers-mx32
if MAINTAINER_MODE
gen_changelog_start_date = 2009-07-08 20:00
$(srcdir)/ChangeLog: $(srcdir)/gitlog-to-changelog $(srcdir)/Makefile.in \
$(srcdir)/.version
@rm -f $@.new
(cd $(srcdir); \
./gitlog-to-changelog --append-dot \
--since='$(gen_changelog_start_date)'; \
echo; echo; echo 'See ChangeLog-CVS for older changes.' \
) > $@.new
chmod 444 $@.new
mv -f $@.new $@
$(srcdir)/CREDITS: $(srcdir)/CREDITS.in $(srcdir)/.mailmap \
$(srcdir)/Makefile.in $(srcdir)/.version
$(AM_V_GEN) \
( \
cd $(srcdir); \
sed '/^##/,$$d' CREDITS.in; \
{ sed -n '1,/^##>/d; s/ */\t/; s/^./&/p' CREDITS.in; \
git log --pretty=format:'%aN %aE'; \
} | LC_ALL=C sort -u \
| awk -F'\t' '{printf("\t%s <%s>\n",$$1,$$2)}'; \
) > $@-t && mv $@-t $@
export TAR_OPTIONS = --owner=0 --group=0 --numeric-owner --mode=go-w,go+rX
endif