]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Create a new module, m_vkiscnums, and move all the system call numbers
authorJulian Seward <jseward@acm.org>
Sat, 14 Oct 2006 15:51:32 +0000 (15:51 +0000)
committerJulian Seward <jseward@acm.org>
Sat, 14 Oct 2006 15:51:32 +0000 (15:51 +0000)
into that.  Mostly this means moving vki_unistd-<plat>.h to
include/vki/vki-scnums-<plat>.h.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6224

21 files changed:
coregrind/Makefile.am
coregrind/m_aspacemgr/aspacemgr.c
coregrind/m_libcassert.c
coregrind/m_libcfile.c
coregrind/m_libcproc.c
coregrind/m_libcsignal.c
coregrind/m_scheduler/scheduler.c
coregrind/m_signals.c
coregrind/m_syswrap/syscall-x86-linux.S
coregrind/m_syswrap/syswrap-generic.c
coregrind/m_syswrap/syswrap-linux.c
coregrind/m_syswrap/syswrap-x86-linux.c
coregrind/m_trampoline.S
coregrind/m_ume.c
include/Makefile.am
include/pub_tool_vkiscnums.h [moved from coregrind/vki_unistd.h with 50% similarity]
include/vki/vki-scnums-amd64-linux.h [moved from coregrind/vki_unistd-amd64-linux.h with 95% similarity]
include/vki/vki-scnums-ppc32-linux.h [moved from coregrind/vki_unistd-ppc32-linux.h with 93% similarity]
include/vki/vki-scnums-ppc64-linux.h [moved from coregrind/vki_unistd-ppc64-linux.h with 94% similarity]
include/vki/vki-scnums-x86-linux.h [moved from coregrind/vki_unistd-x86-linux.h with 94% similarity]
memcheck/tests/x86/scalar.h

index 4727318dd6702b538b69b8b82b4064ec747edba8..8d216b3928782a6c4e4fb826c06a5ccd275f4cbb 100644 (file)
@@ -108,11 +108,7 @@ noinst_HEADERS = \
        pub_core_transtab.h     \
        pub_core_transtab_asm.h \
        pub_core_ume.h          \
-       vki_unistd.h            \
-       vki_unistd-amd64-linux.h\
-       vki_unistd-ppc32-linux.h\
-       vki_unistd-ppc64-linux.h\
-       vki_unistd-x86-linux.h  \
+       pub_core_vkiscnums.h    \
        m_coredump/priv_elf.h   \
        m_debuginfo/priv_storage.h      \
        m_debuginfo/priv_readstabs.h    \
@@ -166,6 +162,7 @@ COREGRIND_SOURCES_COMMON = \
        m_translate.c \
        m_transtab.c \
        m_ume.c \
+       m_vkiscnums.c \
        m_aspacemgr/aspacemgr.c \
        m_debuginfo/storage.c \
        m_debuginfo/readdwarf.c \
index c410deccb4081008dba86d3a3d7d87dd3ec2a12a..0e857cd134e52582471e6cefaf6579088717155a 100644 (file)
@@ -48,7 +48,7 @@
 
 #include "pub_core_options.h"    // VG_(clo_sanity_level)
 
-#include "vki_unistd.h"          // __NR_* constants
+#include "pub_core_vkiscnums.h"  // __NR_* constants
 
 #include "pub_core_aspacemgr.h"  // self
 
index eb39e5d10825d506250ab201f80c2db411c798f3..5e4c5ed05bd2455374afb8a58d178cd1c5114d40 100644 (file)
@@ -38,7 +38,7 @@
 #include "pub_core_syscall.h"
 #include "pub_core_tooliface.h"     // For VG_(details).{name,bug_reports_to}
 #include "pub_core_options.h"       // For VG_(clo_xml)
-#include "vki_unistd.h"
+#include "pub_core_vkiscnums.h"
 
 /* ---------------------------------------------------------------------
    Assertery.
index 4afe9cfd51b243e8cd3b6bfc67f7098fe6d335b4..ec455841f572f8c6fc160499d710643e249611ba 100644 (file)
@@ -36,7 +36,7 @@
 #include "pub_core_libcproc.h"      // VG_(getpid), VG_(getppid)
 #include "pub_core_clientstate.h"   // VG_(fd_hard_limit)
 #include "pub_core_syscall.h"
-#include "vki_unistd.h"
+#include "pub_core_vkiscnums.h"
 
 /* ---------------------------------------------------------------------
    File stuff
index d6fe29fa7ec2a6719554f98b6fed079503838518..16efd4da1e0cee1e2ec21877876d9bcfd3428ef3 100644 (file)
@@ -36,7 +36,7 @@
 #include "pub_core_mallocfree.h"
 #include "pub_core_syscall.h"
 #include "pub_core_clientstate.h"
-#include "vki_unistd.h"
+#include "pub_core_vkiscnums.h"
 
 /* ---------------------------------------------------------------------
    Command line and environment stuff
index c62220b0959590c0cd05077c57a78c945840fafd..39c81cdb9624372024a65ab5386b09ce538f6b87 100644 (file)
@@ -33,7 +33,7 @@
 #include "pub_core_libcassert.h"
 #include "pub_core_libcsignal.h"
 #include "pub_core_syscall.h"
-#include "vki_unistd.h"
+#include "pub_core_vkiscnums.h"
 
 /* sigemptyset, sigfullset, sigaddset and sigdelset return 0 on
    success and -1 on error.  */
index d50e9e2c10ec6dc283c03f8422ca19ea67d430e3..c2f4333b8a1e3c0a7514f3de16720070e928377a 100644 (file)
@@ -81,7 +81,7 @@
 #include "pub_core_tooliface.h"
 #include "pub_core_translate.h"     // For VG_(translate)()
 #include "pub_core_transtab.h"
-#include "vki_unistd.h"
+#include "pub_core_vkiscnums.h"
 #include "priv_sema.h"
 
 /* #include "pub_core_debuginfo.h" */   // DEBUGGING HACK ONLY
index cb4153e11b29aea8296edff7a537a5d77be377d3..3ca1398688384a4026d0e2578f38d540b79c94a8 100644 (file)
 #include "pub_core_syswrap.h"
 #include "pub_core_tooliface.h"
 #include "pub_core_coredump.h"
-#include "vki_unistd.h"
+#include "pub_core_vkiscnums.h"
 
 
 /* ---------------------------------------------------------------------
index 117fa1f42457332b75478f915a5c9bf6a089d67e..7432edbd8a41c7fac87a0a97f15ea741bc72101f 100644 (file)
@@ -29,7 +29,7 @@
 */
 
 #include "pub_core_basics_asm.h"
-#include "vki_unistd.h"
+#include "pub_core_vkiscnums.h"
 #include "libvex_guest_offsets.h"
                
        
index 5801afce17f119b408b54fa5076da916e3ee309d..3812e19631565d1d9846c4000b4be1f690f336af 100644 (file)
@@ -55,7 +55,7 @@
 #include "priv_types_n_macros.h"
 #include "priv_syswrap-generic.h"
 
-#include "vki_unistd.h"              /* for the __NR_* constants */
+#include "pub_core_vkiscnums.h"     /* for the __NR_* constants */
 
 
 /* Returns True iff address range is something the client can
index 7a774458c40f07cc9489cadc7117aae2257951c0..de5e7371d20c476502411dc65e919f12177bb5c2 100644 (file)
@@ -53,7 +53,7 @@
 #include "priv_syswrap-generic.h"
 #include "priv_syswrap-linux.h"
 
-#include "vki_unistd.h"              /* for the __NR_* constants */
+#include "pub_core_vkiscnums.h"    /* for the __NR_* constants */
 
 // Run a thread from beginning to end and return the thread's
 // scheduler-return-code.
index 228fb47d9ed38fda3a01c63d0f362d63b0f700cf..a782af15d6427025265ffdfcdfb73996f0df8086 100644 (file)
@@ -58,7 +58,7 @@
 #include "priv_syswrap-linux-variants.h" /* decls of linux variant wrappers */
 #include "priv_syswrap-main.h"
 
-#include "vki_unistd.h"              /* for the __NR_* constants */
+#include "pub_core_vkiscnums.h"      /* for the __NR_* constants */
 
 
 /* ---------------------------------------------------------------------
index a795a5962d63c0bc929f4a18d39e58a62905ac12..59f8588bf823b30045430105dfa9eddb2e3aaed1 100644 (file)
@@ -29,7 +29,7 @@
 */
 
 #include "pub_core_basics_asm.h"
-#include "vki_unistd.h"
+#include "pub_core_vkiscnums.h"
 
 /* ------------------ SIMULATED CPU HELPERS ------------------ */
 /* 
index e46a354f9223f9e4014f94c1fd278a244d4acdfa..4ff5953d7ba0592dd41b4b1efbdf42b89ca760f3 100644 (file)
@@ -48,7 +48,7 @@
 #include "pub_core_libcassert.h"  // VG_(exit), vg_assert
 #include "pub_core_mallocfree.h"  // VG_(malloc), VG_(free)
 #include "pub_core_syscall.h"     // VG_(strerror)
-#include "vki_unistd.h"           // mmap-related constants
+#include "pub_core_vkiscnums.h"   // mmap-related constants
 
 #include "pub_core_ume.h"
 
index 4fb93cb254ef37310a8fab4a1587384e9d228bf1..0331635c95a0745811b49fdba8f9179cd9f59599 100644 (file)
@@ -28,13 +28,14 @@ incinc_HEADERS = \
        pub_tool_stacktrace.h           \
        pub_tool_threadstate.h          \
        pub_tool_tooliface.h            \
+       pub_tool_vkiscnums.h            \
        valgrind.h                      \
        vki-linux.h                     \
        vki-amd64-linux.h               \
        vki-ppc32-linux.h               \
        vki-ppc64-linux.h               \
        vki-x86-linux.h                 \
-       vki_posixtypes-amd64-linux.h    \
-       vki_posixtypes-ppc32-linux.h    \
-       vki_posixtypes-ppc64-linux.h    \
-       vki_posixtypes-x86-linux.h
+       vki/vki-scnums-amd64-linux.h            \
+       vki/vki-scnums-ppc32-linux.h            \
+       vki/vki-scnums-ppc64-linux.h            \
+       vki/vki-scnums-x86-linux.h
similarity index 50%
rename from coregrind/vki_unistd.h
rename to include/pub_tool_vkiscnums.h
index 934442da0ef74ef9d3058ff514d554f2320775fd..f33c6b4f32752c5009cef85c9a03d7f45ebfbf25 100644 (file)
@@ -1,15 +1,17 @@
 
 /*--------------------------------------------------------------------*/
-/*--- Generic header for Valgrind's kernel interface.              ---*/
-/*---                                                 vki_unistd.h ---*/
+/*--- Top level for kernel interface system call numbers.          ---*/
+/*---                                         pub_tool_vkiscnums.h ---*/
 /*--------------------------------------------------------------------*/
 
 /*
    This file is part of Valgrind, a dynamic binary instrumentation
    framework.
 
-   Copyright (C) 2005 Nicholas Nethercote
+   Copyright (C) 2005-2006 Nicholas Nethercote
       njn@valgrind.org
+   Copyright (C) 2006-2006 OpenWorks LLP
+      info@open-works.co.uk
 
    This program is free software; you can redistribute it and/or
    modify it under the terms of the GNU General Public License as
    The GNU General Public License is contained in the file COPYING.
 */
 
-#ifndef __VKI_UNISTD_H
-#define __VKI_UNISTD_H
+/* This file defines the system call numbers.
+
+   On Linux they are a bunch of #define'd constants of the form
+   __NR_name, and this file must contain nothing else, since it will
+   be included in assembly code (m_trampoline.S).
+
+   On AIX the __NR_name consts are renamings of global variables which
+   tell us the number for each syscall.  This elaboration is necessary
+   because on AIX the syscall numbers are not constant; they can be
+   different for each process (in principle; in practice they rarely
+   change).  32- and 64-bit AIX5 share a common "implementation".
+
+   This file is merely a top-level "steering" file, which pulls in the
+   correct bits for the relevant platform.  You should not directly
+   #include any file in include/vki; instead #include only this one or
+   pub_core_vkiscnums.h.
+*/
+
+#ifndef __PUB_TOOL_VKISCNUMS_H
+#define __PUB_TOOL_VKISCNUMS_H
 
 #if defined(VGP_x86_linux)
-#  include "vki_unistd-x86-linux.h"   
+#  include "vki/vki-scnums-x86-linux.h"
 #elif defined(VGP_amd64_linux)
-#  include "vki_unistd-amd64-linux.h" 
+#  include "vki/vki-scnums-amd64-linux.h"
 #elif defined(VGP_ppc32_linux)
-#  include "vki_unistd-ppc32-linux.h" 
+#  include "vki/vki-scnums-ppc32-linux.h"
 #elif defined(VGP_ppc64_linux)
-#  include "vki_unistd-ppc64-linux.h" 
+#  include "vki/vki-scnums-ppc64-linux.h"
+#elif defined(VGP_ppc32_aix5) || defined(VGP_ppc64_aix5)
+#  include "vki/vki-scnums-aix5.h"
 #else
 #  error Unknown platform
 #endif
 
-#endif   // __VKI_UNISTD_H
+#endif   // __PUB_TOOL_VKISCNUMS_H
 
 /*--------------------------------------------------------------------*/
 /*--- end                                                          ---*/
similarity index 95%
rename from coregrind/vki_unistd-amd64-linux.h
rename to include/vki/vki-scnums-amd64-linux.h
index 617f6a30469b1a9f6014838bea8efc7768a33619..c2d94dea932390df85b79cde3d3b0f205465ba0d 100644 (file)
@@ -1,4 +1,9 @@
 
+/*--------------------------------------------------------------------*/
+/*--- System call numbers for amd64-linux.                         ---*/
+/*---                                     vki-scnums-amd64-linux.h ---*/
+/*--------------------------------------------------------------------*/
+
 /*
    This file is part of Valgrind, a dynamic binary instrumentation
    framework.
@@ -24,8 +29,8 @@
    The GNU General Public License is contained in the file COPYING.
 */
 
-#ifndef __VKI_UNISTD_AMD64_LINUX_H
-#define __VKI_UNISTD_AMD64_LINUX_H
+#ifndef __VKI_SCNUMS_AMD64_LINUX_H
+#define __VKI_SCNUMS_AMD64_LINUX_H
 
 // From linux-2.6.9/include/asm-x86_64/unistd.h
 
 #define __NR_sync_file_range   277
 #define __NR_vmsplice          278
 
-#endif /* __VKI_UNISTD_AMD64_LINUX_H */
+#endif /* __VKI_SCNUMS_AMD64_LINUX_H */
+
+/*--------------------------------------------------------------------*/
+/*--- end                                                          ---*/
+/*--------------------------------------------------------------------*/
similarity index 93%
rename from coregrind/vki_unistd-ppc32-linux.h
rename to include/vki/vki-scnums-ppc32-linux.h
index b5c7e68e76354002e43b0f9fd99057f1a8c031e8..9ea8199cfd68e89ca63c008bc11c123d1461a696 100644 (file)
@@ -1,8 +1,14 @@
+
+/*--------------------------------------------------------------------*/
+/*--- System call numbers for ppc32-linux.                         ---*/
+/*---                                     vki-scnums-ppc32-linux.h ---*/
+/*--------------------------------------------------------------------*/
+
 /*
    This file is part of Valgrind, a dynamic binary instrumentation
    framework.
 
-   Copyright (C) 2005 Julian Seward
+   Copyright (C) 2005-2006 Julian Seward
       jseward@acm.org
 
    This program is free software; you can redistribute it and/or
@@ -23,8 +29,8 @@
    The GNU General Public License is contained in the file COPYING.
 */
 
-#ifndef __VKI_UNISTD_PPC32_LINUX_H
-#define __VKI_UNISTD_PPC32_LINUX_H
+#ifndef __VKI_SCNUMS_PPC32_LINUX_H
+#define __VKI_SCNUMS_PPC32_LINUX_H
 
 // From linux-2.6.9/include/asm-ppc/unistd.h
 
 
 #define __NR_syscalls          301
 
-#endif /* __VKI_UNISTD_PPC32_LINUX_H */
+#endif /* __VKI_SCNUMS_PPC32_LINUX_H */
+
+/*--------------------------------------------------------------------*/
+/*--- end                                                          ---*/
+/*--------------------------------------------------------------------*/
similarity index 94%
rename from coregrind/vki_unistd-ppc64-linux.h
rename to include/vki/vki-scnums-ppc64-linux.h
index 3748a6cabc5e06938ee5b9442f1cb4cf450520a7..79f448177496a2bcae57f926e0291160d2e3441a 100644 (file)
@@ -1,9 +1,14 @@
 
+/*--------------------------------------------------------------------*/
+/*--- System call numbers for ppc64-linux.                         ---*/
+/*---                                     vki-scnums-ppc64-linux.h ---*/
+/*--------------------------------------------------------------------*/
+
 /*
    This file is part of Valgrind, a dynamic binary instrumentation
    framework.
 
-   Copyright (C) 2005 Julian Seward
+   Copyright (C) 2005-2006 Julian Seward
       jseward@acm.org
 
    This program is free software; you can redistribute it and/or
@@ -24,8 +29,8 @@
    The GNU General Public License is contained in the file COPYING.
 */
 
-#ifndef __VKI_UNISTD_PPC64_LINUX_H
-#define __VKI_UNISTD_PPC64_LINUX_H
+#ifndef __VKI_SCNUMS_PPC64_LINUX_H
+#define __VKI_SCNUMS_PPC64_LINUX_H
 
 // From linux-2.6.16-rc4/include/asm-powerpc/unistd.h
 
 #define __NR_get_robust_list   299
 #define __NR_set_robust_list   300
 
-#endif /* __VKI_UNISTD_PPC64_LINUX_H */
+#endif /* __VKI_SCNUMS_PPC64_LINUX_H */
+
+/*--------------------------------------------------------------------*/
+/*--- end                                                          ---*/
+/*--------------------------------------------------------------------*/
similarity index 94%
rename from coregrind/vki_unistd-x86-linux.h
rename to include/vki/vki-scnums-x86-linux.h
index 60f2f2f74500b0b1072b5cefb2644f652325e2d8..92473ec969a533583870d2f996b84e94879cf4b0 100644 (file)
@@ -1,4 +1,9 @@
 
+/*--------------------------------------------------------------------*/
+/*--- System call numbers for x86-linux.                           ---*/
+/*---                                       vki-scnums-x86-linux.h ---*/
+/*--------------------------------------------------------------------*/
+
 /*
    This file is part of Valgrind, a dynamic binary instrumentation
    framework.
@@ -24,8 +29,8 @@
    The GNU General Public License is contained in the file COPYING.
 */
 
-#ifndef __VKI_UNISTD_X86_LINUX_H
-#define __VKI_UNISTD_X86_LINUX_H
+#ifndef __VKI_SCNUMS_X86_LINUX_H
+#define __VKI_SCNUMS_X86_LINUX_H
 
 // From linux-2.6.9/include/asm-i386/unistd.h
 
 #define __NR_tee               315
 #define __NR_vmsplice          316
 
-#endif /* __VKI_UNISTD_X86_LINUX_H */
+#endif /* __VKI_SCNUMS_X86_LINUX_H */
+
+/*--------------------------------------------------------------------*/
+/*--- end                                                          ---*/
+/*--------------------------------------------------------------------*/
index 3fa86c9112075478c35e0fa657f846ecd880c95d..072b9c67a4e451084f43a1b942cbd7b49cec2a08 100644 (file)
@@ -1,4 +1,4 @@
-#include "../../../coregrind/vki_unistd-x86-linux.h"
+#include "../../../include/vki/vki-scnums-x86-linux.h"
 
 #include <assert.h>
 #include <errno.h>