]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Create a new module, m_vki, and move all knowledge about the kernel
authorJulian Seward <jseward@acm.org>
Sat, 14 Oct 2006 19:26:10 +0000 (19:26 +0000)
committerJulian Seward <jseward@acm.org>
Sat, 14 Oct 2006 19:26:10 +0000 (19:26 +0000)
interface, except for the syscall numbers, into that.  Mostly this
means moving include/vki-*.h to include/vki/vki-*.h.

include/pub_tool_basics.h previously dragged in the entire kernel
interface.  I've done away with that, so that modules which need to
see the kernel interface now have to include pub_{core,tool}_vki.h
explicitly.  This is why there are many modified .c files -- they have
all acquired an extra #include line.

This certainly breaks all platforms except x86.  Will fix shortly.

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

55 files changed:
auxprogs/valgrind-listener.c
cachegrind/cg_main.c
callgrind/global.h
coregrind/Makefile.am
coregrind/launcher.c
coregrind/m_aspacemgr/aspacemgr.c
coregrind/m_clientstate.c
coregrind/m_commandline.c
coregrind/m_coredump/coredump-elf.c
coregrind/m_coredump/coredump-x86-linux.c
coregrind/m_debugger.c
coregrind/m_debuginfo/debuginfo.c
coregrind/m_debuginfo/readelf.c
coregrind/m_errormgr.c
coregrind/m_libcassert.c
coregrind/m_libcfile.c
coregrind/m_libcprint.c
coregrind/m_libcproc.c
coregrind/m_libcsignal.c
coregrind/m_machine.c
coregrind/m_main.c
coregrind/m_mallocfree.c
coregrind/m_replacemalloc/vg_replace_malloc.c
coregrind/m_scheduler/scheduler.c
coregrind/m_scheduler/sema.c
coregrind/m_sigframe/sigframe-x86-linux.c
coregrind/m_signals.c
coregrind/m_stacktrace.c
coregrind/m_syscall.c
coregrind/m_syswrap/syswrap-generic.c
coregrind/m_syswrap/syswrap-linux-variants.c
coregrind/m_syswrap/syswrap-linux.c
coregrind/m_syswrap/syswrap-main.c
coregrind/m_syswrap/syswrap-x86-linux.c
coregrind/m_threadmodel.c
coregrind/m_threadstate.c
coregrind/m_translate.c
coregrind/m_ume.c
coregrind/m_vki.c [new file with mode: 0644]
coregrind/pub_core_vki.h [new file with mode: 0644]
helgrind/hg_main.c
include/Makefile.am
include/pub_tool_basics.h
include/pub_tool_vki.h [new file with mode: 0644]
include/vki/vki-amd64-linux.h [moved from include/vki-amd64-linux.h with 100% similarity]
include/vki/vki-linux.h [moved from include/vki-linux.h with 99% similarity]
include/vki/vki-posixtypes-amd64-linux.h [moved from include/vki_posixtypes-amd64-linux.h with 97% similarity]
include/vki/vki-posixtypes-ppc32-linux.h [moved from include/vki_posixtypes-ppc32-linux.h with 92% similarity]
include/vki/vki-posixtypes-ppc64-linux.h [moved from include/vki_posixtypes-ppc64-linux.h with 93% similarity]
include/vki/vki-posixtypes-x86-linux.h [moved from include/vki_posixtypes-x86-linux.h with 97% similarity]
include/vki/vki-ppc32-linux.h [moved from include/vki-ppc32-linux.h with 99% similarity]
include/vki/vki-ppc64-linux.h [moved from include/vki-ppc64-linux.h with 99% similarity]
include/vki/vki-x86-linux.h [moved from include/vki-x86-linux.h with 100% similarity]
massif/ms_main.c
memcheck/mc_leakcheck.c

index 4bd3edc379226117768290bc26cd1abaac7f452d..133cff10523e9dd4c75d7007a7d760e9f871ff8e 100644 (file)
@@ -46,6 +46,8 @@
 
 #include "pub_core_basics.h"
 #include "pub_core_libcassert.h"    // For VG_BUGS_TO
+#include "pub_core_vki.h"           // Avoids warnings from 
+                                    // pub_core_libcfile.h
 #include "pub_core_libcfile.h"      // For VG_CLO_DEFAULT_LOGPORT
 
 
index 6d6838703f95a92c09c9675a893913657fc4c4dd..92c3c7cbcfe58ece8e566fed3111659f982134e5 100644 (file)
@@ -30,6 +30,7 @@
 */
 
 #include "pub_tool_basics.h"
+#include "pub_tool_vki.h"
 #include "pub_tool_debuginfo.h"
 #include "pub_tool_libcbase.h"
 #include "pub_tool_libcassert.h"
index 335de14618e7927c35350aeb4115bc86e1cdba64..96d3f251c0867572547dbe8fccb0fe257ca64947 100644 (file)
@@ -8,6 +8,7 @@
 #define CLG_GLOBAL
 
 #include "pub_tool_basics.h"
+#include "pub_tool_vki.h"
 #include "pub_tool_debuginfo.h"
 #include "pub_tool_libcbase.h"
 #include "pub_tool_libcassert.h"
index 8d216b3928782a6c4e4fb826c06a5ccd275f4cbb..b2b0bf5c452965439fc717433e13e607bf295fbf 100644 (file)
@@ -108,6 +108,7 @@ noinst_HEADERS = \
        pub_core_transtab.h     \
        pub_core_transtab_asm.h \
        pub_core_ume.h          \
+       pub_core_vki.h          \
        pub_core_vkiscnums.h    \
        m_coredump/priv_elf.h   \
        m_debuginfo/priv_storage.h      \
@@ -162,6 +163,7 @@ COREGRIND_SOURCES_COMMON = \
        m_translate.c \
        m_transtab.c \
        m_ume.c \
+       m_vki.c \
        m_vkiscnums.c \
        m_aspacemgr/aspacemgr.c \
        m_debuginfo/storage.c \
index 30ed02d9ef7ec40b6e94a59b2cb6a54479a94edc..ab24345e2eca5d8ca0f51258df3ba34fa5fb6578 100644 (file)
@@ -46,6 +46,8 @@
 #include <unistd.h>
 
 #include "pub_core_debuglog.h"
+#include "pub_core_vki.h"       // Avoids warnings from
+                                // pub_core_libcfile.h
 #include "pub_core_libcproc.h"  // For VALGRIND_LIB, VALGRIND_LAUNCHER
 #include "pub_core_ume.h"
 
index 0e857cd134e52582471e6cefaf6579088717155a..28c8a46fcfa2b54f91f54df08ee648fdc71ee380 100644 (file)
@@ -35,6 +35,7 @@
    minimal set of imports. */
 
 #include "pub_core_basics.h"     // types
+#include "pub_core_vki.h"
 
 #include "pub_core_debuglog.h"   // VG_(debugLog)
 
index 2db92993003e1435601ea21727575ff0b5eb5952..fd16cffd8c5fef6632e9849505f28bc6bb61ef87 100644 (file)
@@ -31,6 +31,7 @@
 */
 
 #include "pub_core_basics.h"
+#include "pub_core_vki.h"
 #include "pub_core_clientstate.h"
 
 /*-----------------------------------------------------------------*/
index c4637f35a52ae75999d32537d2af721468c2d9dc..2d1a83fec5e1d37e9f6490b433ec521fa64cf4a6 100644 (file)
@@ -29,6 +29,7 @@
 */
 
 #include "pub_core_basics.h"
+#include "pub_core_vki.h"
 #include "pub_core_libcassert.h"
 #include "pub_core_libcbase.h"
 #include "pub_core_libcfile.h"
index 814026b699a17318f61fe1b370aefbb772f06680..87fad6f2f239bcfae8d6941efda74b3e33eff277 100644 (file)
@@ -29,6 +29,7 @@
 */
 
 #include "pub_core_basics.h"
+#include "pub_core_vki.h"
 #include "pub_core_aspacemgr.h"
 #include "pub_core_libcbase.h"
 #include "pub_core_machine.h"
index 754df98cc46ae2f407aa10c28b03dca53fc51cc0..ed2f95f95619fdd5072fb09505829e96054ab778 100644 (file)
@@ -29,6 +29,7 @@
 */
 
 #include "pub_core_basics.h"
+#include "pub_core_vki.h"
 #include "pub_core_libcbase.h"
 #include "pub_core_coredump.h"
 #include "pub_core_threadstate.h"
index 7122be85a1ce948243fde3bf8cd6ddfed5b6aed7..ae30646bb4879b0aac294fa7d50f494edb56ddd4 100644 (file)
@@ -29,6 +29,7 @@
 */
 
 #include "pub_core_basics.h"
+#include "pub_core_vki.h"
 #include "pub_core_threadstate.h"
 #include "pub_core_clientstate.h"
 #include "pub_core_debugger.h"
index d4d34f10e2b152175015f6966a0ca85b998ae6dc..23256ac3214e43738a43474dc8e6dcb48cd41fa7 100644 (file)
@@ -35,6 +35,7 @@
 */
 
 #include "pub_core_basics.h"
+#include "pub_core_vki.h"
 #include "pub_core_threadstate.h"
 #include "pub_core_debuginfo.h"   /* self */
 #include "pub_core_demangle.h"
index e3318e6b71d78edd45944479c7e13a32f7f1c8ac..49c0c1a1df7d227df38af274fb8c9b39d8446028 100644 (file)
@@ -35,6 +35,7 @@
 */
 
 #include "pub_core_basics.h"
+#include "pub_core_vki.h"
 #include "pub_core_libcbase.h"
 #include "pub_core_libcprint.h"
 #include "pub_core_libcassert.h"
index 2fb30f47281da0fb816f59506232dcc0f56f2c03..cb71883bc02b755a0de7140bf24d9dc9cc1c0bea 100644 (file)
@@ -29,6 +29,7 @@
 */
 
 #include "pub_core_basics.h"
+#include "pub_core_vki.h"
 #include "pub_core_threadstate.h"      // For VG_N_THREADS
 #include "pub_core_debugger.h"
 #include "pub_core_debuginfo.h"
index 5e4c5ed05bd2455374afb8a58d178cd1c5114d40..1f50fedebe97c1a2399e37df8dce57fb22e918fd 100644 (file)
@@ -29,6 +29,7 @@
 */
 
 #include "pub_core_basics.h"
+#include "pub_core_vki.h"
 #include "pub_core_threadstate.h"
 #include "pub_core_libcbase.h"
 #include "pub_core_libcassert.h"
index ec455841f572f8c6fc160499d710643e249611ba..37bdb0777972524a881bc4b9dde8728ed25fbcd4 100644 (file)
@@ -29,6 +29,7 @@
 */
 
 #include "pub_core_basics.h"
+#include "pub_core_vki.h"
 #include "pub_core_libcbase.h"
 #include "pub_core_libcassert.h"
 #include "pub_core_libcfile.h"
index 118cad1e3ea9160aaba43502281beada03db1410..e4255904051b69952f449169277f814daefac962 100644 (file)
@@ -29,6 +29,7 @@
 */
 
 #include "pub_core_basics.h"
+#include "pub_core_vki.h"
 #include "pub_core_debuglog.h"
 #include "pub_core_libcbase.h"
 #include "pub_core_libcassert.h"
index 16efd4da1e0cee1e2ec21877876d9bcfd3428ef3..b3d17472ebc7c9ae624ef3ab29f57cc7b36745cb 100644 (file)
@@ -29,6 +29,7 @@
 */
 
 #include "pub_core_basics.h"
+#include "pub_core_vki.h"
 #include "pub_core_libcbase.h"
 #include "pub_core_libcassert.h"
 #include "pub_core_libcprint.h"
index 39c81cdb9624372024a65ab5386b09ce538f6b87..9e11ed04573b7b1e8fc5c51d66eb3a88afce7571 100644 (file)
@@ -29,6 +29,7 @@
 */
 
 #include "pub_core_basics.h"
+#include "pub_core_vki.h"
 #include "pub_core_libcbase.h"
 #include "pub_core_libcassert.h"
 #include "pub_core_libcsignal.h"
index f0d66301d5433a1db95b3fbc6c21029172ec7eea..357fbdbd5feae460a0f8e653465afe17009dc26a 100644 (file)
@@ -29,6 +29,7 @@
 */
 
 #include "pub_core_basics.h"
+#include "pub_core_vki.h"
 #include "pub_core_threadstate.h"
 #include "pub_core_libcassert.h"
 #include "pub_core_libcbase.h"
index 4bb7eea482fe96001b9c59d9d617740e250a4ae0..207c4edf0be5947d8831a6c15ec0c9351c43b836 100644 (file)
@@ -29,6 +29,7 @@
 */
 
 #include "pub_core_basics.h"
+#include "pub_core_vki.h"
 #include "pub_core_threadstate.h"
 #include "pub_core_clientstate.h"
 #include "pub_core_aspacemgr.h"
index f607eeb0381fbaed82f87dec698e26b377c03a98..d1bd9d13fb2d8dda3989f9e8ca92ea6254ad1485 100644 (file)
@@ -30,6 +30,7 @@
 */
 
 #include "pub_core_basics.h"
+#include "pub_core_vki.h"
 #include "pub_core_debuglog.h"
 #include "pub_core_libcbase.h"
 #include "pub_core_aspacemgr.h"
index 4d1783c8c9d7d583956aa151fa6247e32c39a87d..6d6800a9e109ce001d81b74bca3377b2f4348885 100644 (file)
@@ -45,6 +45,7 @@
    ------------------------------------------------------------------ */
 
 #include "pub_core_basics.h"
+#include "pub_core_vki.h"           // VKI_EINVAL, VKI_ENOMEM, VKI_PAGE_SIZE
 #include "pub_core_clreq.h"         // for VALGRIND_INTERNAL_PRINTF,
                                     //   VALGRIND_NON_SIMD_CALL[12]
 #include "pub_core_debuginfo.h"     // needed for pub_core_redir.h :(
index c2f4333b8a1e3c0a7514f3de16720070e928377a..6788b29bc29d064ecd2068c5a80d7c6efe847be1 100644 (file)
@@ -58,6 +58,8 @@
  */
 
 #include "pub_core_basics.h"
+#include "pub_core_vki.h"
+#include "pub_core_vkiscnums.h"
 #include "pub_core_threadstate.h"
 #include "pub_core_aspacemgr.h"
 #include "pub_core_clreq.h"         // for VG_USERREQ__*
@@ -81,7 +83,6 @@
 #include "pub_core_tooliface.h"
 #include "pub_core_translate.h"     // For VG_(translate)()
 #include "pub_core_transtab.h"
-#include "pub_core_vkiscnums.h"
 #include "priv_sema.h"
 
 /* #include "pub_core_debuginfo.h" */   // DEBUGGING HACK ONLY
index a50e0d09656769cc00b7606b000ad68e70dc8c8b..bc9fc6924cc3197b84adc187c4557f69d7c99049 100644 (file)
@@ -29,6 +29,7 @@
 */
 
 #include "pub_core_basics.h"
+#include "pub_core_vki.h"
 #include "pub_core_libcassert.h"
 #include "pub_core_libcfile.h"
 #include "pub_core_libcproc.h"      // For VG_(gettid)()
index a6a50d16b0e74b0fa1605bce77a1d6617ccb3538..6f90460c53c3d95a67b3322f4593397fda8f183a 100644 (file)
@@ -30,6 +30,7 @@
 */
 
 #include "pub_core_basics.h"
+#include "pub_core_vki.h"
 #include "pub_core_threadstate.h"
 #include "pub_core_aspacemgr.h" /* find_segment */
 #include "pub_core_libcbase.h"
index 3ca1398688384a4026d0e2578f38d540b79c94a8..5aabb68e122b14e9df6f976ca57f12d5d38ef0b3 100644 (file)
@@ -80,6 +80,7 @@
  */
 
 #include "pub_core_basics.h"
+#include "pub_core_vki.h"
 #include "pub_core_debuglog.h"
 #include "pub_core_threadstate.h"
 #include "pub_core_clientstate.h"
index c502a3f5a3edaef3e67df801ee1ba3d6e439c15a..d7d9d165fe8bf30017933000a3589298dda8d922 100644 (file)
@@ -29,6 +29,7 @@
 */
 
 #include "pub_core_basics.h"
+#include "pub_core_vki.h"
 #include "pub_core_threadstate.h"
 #include "pub_core_debuginfo.h"
 #include "pub_core_aspacemgr.h"     // For VG_(is_addressable)()
index 2514069f196d3feaa42f5ad8ef648a58d9633720..721dafaa73f2b4b290afa90be1ef2d0ae3cf978a 100644 (file)
@@ -29,6 +29,7 @@
 */
 
 #include "pub_core_basics.h"
+#include "pub_core_vki.h"
 #include "pub_core_syscall.h"
 
 /* ---------------------------------------------------------------------
index 3812e19631565d1d9846c4000b4be1f690f336af..19a694e3230163e86ccf93652ac48b9fcb1c1cd8 100644 (file)
@@ -29,6 +29,8 @@
 */
 
 #include "pub_core_basics.h"
+#include "pub_core_vki.h"
+#include "pub_core_vkiscnums.h"
 #include "pub_core_threadstate.h"
 #include "pub_core_debuginfo.h"     // VG_(di_notify_*)
 #include "pub_core_aspacemgr.h"
@@ -55,8 +57,6 @@
 #include "priv_types_n_macros.h"
 #include "priv_syswrap-generic.h"
 
-#include "pub_core_vkiscnums.h"     /* for the __NR_* constants */
-
 
 /* Returns True iff address range is something the client can
    plausibly mess with: all of it is either already belongs to the
index a4cdcca31486073cf39f29062a6e2f80ff8d3a72..d805d1f8ab6eea5978c922497f75c829a40bffce 100644 (file)
@@ -46,6 +46,7 @@
 
 
 #include "pub_core_basics.h"
+#include "pub_core_vki.h"
 #include "pub_core_threadstate.h"
 #include "pub_core_aspacemgr.h"
 #include "pub_core_debuginfo.h"    // VG_(di_notify_*)
index de5e7371d20c476502411dc65e919f12177bb5c2..cd46345747dc6846ac1b20bbcd2bd13132586f43 100644 (file)
@@ -29,6 +29,8 @@
 */
 
 #include "pub_core_basics.h"
+#include "pub_core_vki.h"
+#include "pub_core_vkiscnums.h"
 #include "pub_core_threadstate.h"
 #include "pub_core_aspacemgr.h"
 #include "pub_core_debuginfo.h"    // VG_(di_notify_*)
@@ -53,7 +55,6 @@
 #include "priv_syswrap-generic.h"
 #include "priv_syswrap-linux.h"
 
-#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 a2fb0cacf8affdc1588ace18d39221240df701e2..cc0da7d105e7497a6f7e356b3676c6479319765c 100644 (file)
@@ -30,6 +30,8 @@
 
 #include "libvex_guest_offsets.h"
 #include "pub_core_basics.h"
+#include "pub_core_vki.h"
+#include "pub_core_basics.h"
 #include "pub_core_threadstate.h"
 #include "pub_core_libcbase.h"
 #include "pub_core_libcassert.h"
index a782af15d6427025265ffdfcdfb73996f0df8086..26a0d9b8bed566173d8dd8a8d7bba9e630892a97 100644 (file)
@@ -34,6 +34,8 @@
 */
 
 #include "pub_core_basics.h"
+#include "pub_core_vki.h"
+#include "pub_core_vkiscnums.h"
 #include "pub_core_threadstate.h"
 #include "pub_core_debuginfo.h"     // VG_(di_notify_mmap)
 #include "pub_core_aspacemgr.h"
@@ -58,8 +60,6 @@
 #include "priv_syswrap-linux-variants.h" /* decls of linux variant wrappers */
 #include "priv_syswrap-main.h"
 
-#include "pub_core_vkiscnums.h"      /* for the __NR_* constants */
-
 
 /* ---------------------------------------------------------------------
    clone() handling
index 6e3c64f3a03918261d2df32975ed8a41db18324b..e7d3a09f8854639d69e7a74b61e35c14491ae4c3 100644 (file)
@@ -61,6 +61,7 @@
  */
 
 #include "pub_core_basics.h"
+#include "pub_core_vki.h"
 #include "pub_core_errormgr.h"
 #include "pub_core_execontext.h"
 #include "pub_core_libcassert.h"
index a5d0891b1b68ed4f6be444897f0999edea7cc687..1c4633eb7d132f96098bd379fe1ae2c8361c7b79 100644 (file)
@@ -29,6 +29,7 @@
 */
 
 #include "pub_core_basics.h"
+#include "pub_core_vki.h"
 #include "pub_core_threadstate.h"
 #include "pub_core_libcassert.h"
 
index baf254196c29f05485871fa3bf03efc2e2853dbf..63dbb2057d5269d7d5e2693689aee2db8265bb81 100644 (file)
@@ -30,6 +30,7 @@
 */
 
 #include "pub_core_basics.h"
+#include "pub_core_vki.h"
 #include "pub_core_aspacemgr.h"
 
 #include "pub_core_machine.h"    // VG_(fnptr_to_fnentry)
index 4ff5953d7ba0592dd41b4b1efbdf42b89ca760f3..8151267bafb73ff12564804d1df8a0e18478328f 100644 (file)
@@ -38,6 +38,7 @@
 // included ahead of the glibc ones.  This fix is a kludge;  the right
 // solution is to entirely remove the glibc dependency.
 #include "pub_core_basics.h"
+#include "pub_core_vki.h"
 #include "pub_core_aspacemgr.h"   // various mapping fns
 #include "pub_core_debuglog.h"
 #include "pub_core_libcbase.h"
diff --git a/coregrind/m_vki.c b/coregrind/m_vki.c
new file mode 100644 (file)
index 0000000..7cd88e7
--- /dev/null
@@ -0,0 +1,43 @@
+
+/*--------------------------------------------------------------------*/
+/*--- Notional "implementation" for m_vki.                         ---*/
+/*---                                                      m_vki.c ---*/
+/*--------------------------------------------------------------------*/
+
+/*
+   This file is part of Valgrind, a dynamic binary instrumentation
+   framework.
+
+   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
+   published by the Free Software Foundation; either version 2 of the
+   License, or (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful, but
+   WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307, USA.
+
+   The GNU General Public License is contained in the file COPYING.
+*/
+
+#include "pub_core_basics.h"
+#include "pub_core_vki.h"     /* self */
+
+/* We have pub_{core,tool}_vki.h.  This is the matching implementation
+   for that interface.  In fact there is no implementation, as the
+   sole purpose of the module is to export types and constants
+   describing the kernel interface, so this file is empty. */
+
+
+/*--------------------------------------------------------------------*/
+/*--- end                                                  m_vki.c ---*/
+/*--------------------------------------------------------------------*/
diff --git a/coregrind/pub_core_vki.h b/coregrind/pub_core_vki.h
new file mode 100644 (file)
index 0000000..38999bb
--- /dev/null
@@ -0,0 +1,50 @@
+
+/*--------------------------------------------------------------------*/
+/*--- Top level for kernel interface declarations.                 ---*/
+/*---                                               pub_core_vki.h ---*/
+/*--------------------------------------------------------------------*/
+
+/*
+   This file is part of Valgrind, a dynamic binary instrumentation
+   framework.
+
+   Copyright (C) 2000-2006 Julian Seward
+      jseward@acm.org
+   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
+   published by the Free Software Foundation; either version 2 of the
+   License, or (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful, but
+   WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307, USA.
+
+   The GNU General Public License is contained in the file COPYING.
+*/
+
+#ifndef __PUB_CORE_VKI_H
+#define __PUB_CORE_VKI_H
+
+/* Most unfortunately, all the kernel decls are visible to tools.  Not
+   really necessary, but to avoid this would require some tedious
+   refactoring of the sources.  Anyway, we live with this kludge, and
+   that means the only thing to be done here is ... */
+
+#include "pub_tool_vki.h"
+
+#endif // __PUB_CORE_VKI_H
+
+/*--------------------------------------------------------------------*/
+/*--- end                                                          ---*/
+/*--------------------------------------------------------------------*/
index 897b2adc683ea178751993805179e0953371baf0..9c3a3fa00e989e93c703851b88be6787cdec5960 100644 (file)
@@ -43,6 +43,7 @@
 // fundamentals in each case.
 
 #include "pub_tool_basics.h"
+#include "pub_tool_vki.h"
 #include "pub_tool_threadstate.h"
 #include "pub_tool_aspacemgr.h"
 #include "pub_tool_debuginfo.h"
index 0331635c95a0745811b49fdba8f9179cd9f59599..eaa615eb35ee2da9f52a01b931fbb7b9404472b5 100644 (file)
@@ -30,11 +30,16 @@ incinc_HEADERS = \
        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/vki-linux.h                 \
+       vki/vki-amd64-linux.h           \
+       vki/vki-ppc32-linux.h           \
+       vki/vki-ppc64-linux.h           \
+       vki/vki-x86-linux.h                     \
+       vki/vki-linux.h                         \
+       vki/vki-posixtypes-amd64-linux.h        \
+       vki/vki-posixtypes-ppc32-linux.h        \
+       vki/vki-posixtypes-ppc64-linux.h        \
+       vki/vki-posixtypes-x86-linux.h          \
        vki/vki-scnums-amd64-linux.h            \
        vki/vki-scnums-ppc32-linux.h            \
        vki/vki-scnums-ppc64-linux.h            \
index 0e8ab27e2b034d463187489b168ba2f845b45b34..3b4b8eaf6189ac5080c833e986c8ab1a4187eee3 100644 (file)
 // For varargs types
 #include <stdarg.h>
 
-// Kernel types.  Might as well have them here, they're used so broadly
-// (eg. in pub_core_threadstate.h).
-#if defined(VGO_linux)
-#  include "vki-linux.h"
-#else
-#  error Unknown OS
-#endif
 
 /* ---------------------------------------------------------------------
    builtin types
diff --git a/include/pub_tool_vki.h b/include/pub_tool_vki.h
new file mode 100644 (file)
index 0000000..25573fb
--- /dev/null
@@ -0,0 +1,62 @@
+
+/*--------------------------------------------------------------------*/
+/*--- Top level for kernel interface declarations.                 ---*/
+/*---                                               pub_tool_vki.h ---*/
+/*--------------------------------------------------------------------*/
+
+/*
+   This file is part of Valgrind, a dynamic binary instrumentation
+   framework.
+
+   Copyright (C) 2000-2006 Julian Seward
+      jseward@acm.org
+   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
+   published by the Free Software Foundation; either version 2 of the
+   License, or (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful, but
+   WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307, USA.
+
+   The GNU General Public License is contained in the file COPYING.
+*/
+
+/* This file defines types and constants for the kernel interface, and to
+   make that clear everything is prefixed VKI_/vki_.
+
+   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_vki.h.
+*/
+
+#ifndef __PUB_TOOL_VKI_H
+#define __PUB_TOOL_VKI_H
+
+#if defined(VGO_linux)
+#  include "vki/vki-linux.h"
+#elif defined(VGP_ppc32_aix5)
+#  include "vki/vki-ppc32-aix5.h"
+#elif defined(VGP_ppc64_aix5)
+#  include "vki/vki-ppc64-aix5.h"
+#else
+#  error Unknown Plat/OS
+#endif
+
+#endif // __PUB_TOOL_VKI_H
+
+/*--------------------------------------------------------------------*/
+/*--- end                                           pub_tool_vki.h ---*/
+/*--------------------------------------------------------------------*/
similarity index 99%
rename from include/vki-linux.h
rename to include/vki/vki-linux.h
index 7066709a0b9d0f344835aec273b26d0d02938e0c..007ff201a4c51fe07300b5cb4df15fd7c6211a47 100644 (file)
    definitions, which affects some of them.
 */
 
+/* The structure is (aiui, jrs 20060504):
+
+     #include plat-specific posix types (vki-posixtypes-ARCH-linux.h)
+
+     Lots more types, structs, consts, in this file
+
+     #include other plat-specific stuff (vki-ARCH-linux.h)
+
+     Even more types, structs, consts, in this file
+
+   The system call numbers are dealt with by
+   pub_{core,tool}_vkiscnums.h, not via pub_{core,tool}_vki.h, which
+   is what this file is part of.
+*/
+
 #ifndef __VKI_LINUX_H
 #define __VKI_LINUX_H
 
 //----------------------------------------------------------------------
 
 #if defined(VGA_x86)
-#  include "vki_posixtypes-x86-linux.h"
+#  include "vki-posixtypes-x86-linux.h"
 #elif defined(VGA_amd64)
-#  include "vki_posixtypes-amd64-linux.h"
+#  include "vki-posixtypes-amd64-linux.h"
 #elif defined(VGA_ppc32)
-#  include "vki_posixtypes-ppc32-linux.h"
+#  include "vki-posixtypes-ppc32-linux.h"
 #elif defined(VGA_ppc64)
-#  include "vki_posixtypes-ppc64-linux.h"
+#  include "vki-posixtypes-ppc64-linux.h"
 #else
 #  error Unknown platform
 #endif
@@ -2121,8 +2136,6 @@ struct vki_serial_icounter_struct {
        int reserved[9];
 };
 
-#endif // __VKI_LINUX_H
-
 //----------------------------------------------------------------------
 // From linux-2.6.16/include/linux/vt.h
 //----------------------------------------------------------------------
@@ -2172,6 +2185,8 @@ struct vki_vt_consize {
 #define VKI_VT_LOCKSWITCH   0x560B  /* disallow vt switching */
 #define VKI_VT_UNLOCKSWITCH 0x560C  /* allow vt switching */
 
+#endif // __VKI_LINUX_H
+
 /*--------------------------------------------------------------------*/
 /*--- end                                                          ---*/
 /*--------------------------------------------------------------------*/
similarity index 97%
rename from include/vki_posixtypes-amd64-linux.h
rename to include/vki/vki-posixtypes-amd64-linux.h
index 6a0ab3f62cd67398a34f3aad47c1cb60a4c7f6e7..0c7bf61a2f97adbf31d60c853445b7eaff294fa6 100644 (file)
@@ -1,7 +1,7 @@
 
 /*--------------------------------------------------------------------*/
 /*--- AMD64/Linux-specific kernel interface: posix types.          ---*/
-/*---                                 vki_posixtypes-amd64-linux.h ---*/
+/*---                                 vki-posixtypes-amd64-linux.h ---*/
 /*--------------------------------------------------------------------*/
 
 /*
similarity index 92%
rename from include/vki_posixtypes-ppc32-linux.h
rename to include/vki/vki-posixtypes-ppc32-linux.h
index a4117ea040450ed71f2c5359029dc4bbde386e78..59da11018edcc0b14254655eeae4cf49712d04e2 100644 (file)
@@ -1,7 +1,7 @@
 
 /*--------------------------------------------------------------------*/
 /*--- PPC32/Linux-specific kernel interface: posix types.          ---*/
-/*---                                 vki_posixtypes-ppc32-linux.h ---*/
+/*---                                 vki-posixtypes-ppc32-linux.h ---*/
 /*--------------------------------------------------------------------*/
 
 /*
@@ -29,8 +29,8 @@
    The GNU General Public License is contained in the file COPYING.
 */
 
-#ifndef __PPC32_LINUX_VKI_ARCH_POSIXTYPES_H
-#define __PPC32_LINUX_VKI_ARCH_POSIXTYPES_H
+#ifndef __VKI_POSIXTYPES_PPC32_LINUX_H
+#define __VKI_POSIXTYPES_PPC32_LINUX_H
 
 //----------------------------------------------------------------------
 // From linux-2.6.9/include/asm-ppc/posix_types.h
@@ -61,7 +61,7 @@ typedef struct {
    int val[2];
 } __vki_kernel_fsid_t;
 
-#endif // __PPC32_LINUX_VKI_ARCH_POSIXTYPES_H
+#endif // __VKI_POSIXTYPES_PPC32_LINUX_H
 
 /*--------------------------------------------------------------------*/
 /*--- end                                                          ---*/
similarity index 93%
rename from include/vki_posixtypes-ppc64-linux.h
rename to include/vki/vki-posixtypes-ppc64-linux.h
index d9d38cbc408aa4afa409dcdc73d9f7015541606f..a4c5a0d2f2df8b08dca9e37b7381552d3791994c 100644 (file)
@@ -1,7 +1,7 @@
 
 /*--------------------------------------------------------------------*/
 /*--- PPC64/Linux-specific kernel interface: posix types.          ---*/
-/*---                                 vki_posixtypes-ppc64-linux.h ---*/
+/*---                                 vki-posixtypes-ppc64-linux.h ---*/
 /*--------------------------------------------------------------------*/
 
 /*
@@ -29,8 +29,8 @@
    The GNU General Public License is contained in the file COPYING.
 */
 
-#ifndef __PPC64_LINUX_VKI_ARCH_POSIXTYPES_H
-#define __PPC64_LINUX_VKI_ARCH_POSIXTYPES_H
+#ifndef __VKI_POSIXTYPES_PPC64_LINUX_H
+#define __VKI_POSIXTYPES_PPC64_LINUX_H
 
 //----------------------------------------------------------------------
 // From linux-2.6.13/include/asm-ppc64/posix_types.h
@@ -68,7 +68,7 @@ typedef struct {
   int     val[2];
 } __vki_kernel_fsid_t;
 
-#endif // __PPC64_LINUX_VKI_ARCH_POSIXTYPES_H
+#endif // __VKI_POSIXTYPES_PPC64_LINUX_H
 
 /*--------------------------------------------------------------------*/
 /*--- end                                                          ---*/
similarity index 97%
rename from include/vki_posixtypes-x86-linux.h
rename to include/vki/vki-posixtypes-x86-linux.h
index 6d0e551374a98e00f2d74f9ec3e352401c2b1979..23f9831c05d8b116f945e5a77cb03688aae5675b 100644 (file)
@@ -1,7 +1,7 @@
 
 /*--------------------------------------------------------------------*/
 /*--- x86/Linux-specific kernel interface: posix types.            ---*/
-/*---                                   vki_posixtypes-x86-linux.h ---*/
+/*---                                   vki-posixtypes-x86-linux.h ---*/
 /*--------------------------------------------------------------------*/
 
 /*
similarity index 99%
rename from include/vki-ppc32-linux.h
rename to include/vki/vki-ppc32-linux.h
index 8e9afa47814eed9c4189c2fc40f07ae4e988c8ab..827e13268eb5f60863a11dff8acf9df8c1cee8b0 100644 (file)
@@ -7,7 +7,7 @@
    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
@@ -28,8 +28,8 @@
    The GNU General Public License is contained in the file COPYING.
 */
 
-#ifndef __PPC32_LINUX_VKI_ARCH_H
-#define __PPC32_LINUX_VKI_ARCH_H
+#ifndef __VKI_PPC32_LINUX_H
+#define __VKI_PPC32_LINUX_H
 
 // ppc32 is big-endian.
 #define VKI_BIG_ENDIAN  1
@@ -912,7 +912,7 @@ struct vki_shminfo64 {
 // And that's it!
 //----------------------------------------------------------------------
 
-#endif // __PPC32_LINUX_VKI_ARCH_H
+#endif // __VKI_PPC32_LINUX_H
 
 /*--------------------------------------------------------------------*/
 /*--- end                                                          ---*/
similarity index 99%
rename from include/vki-ppc64-linux.h
rename to include/vki/vki-ppc64-linux.h
index afb865e19eac9908d5150c96f313e2fc9450da8f..4f1882bad3089cad85d8fcfd69ea9125467a49bc 100644 (file)
@@ -7,7 +7,7 @@
    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
@@ -28,8 +28,8 @@
    The GNU General Public License is contained in the file COPYING.
 */
 
-#ifndef __PPC64_LINUX_VKI_ARCH_H
-#define __PPC64_LINUX_VKI_ARCH_H
+#ifndef __VKI_PPC64_LINUX_H
+#define __VKI_PPC64_LINUX_H
 
 // ppc64 is big-endian.
 #define VKI_BIG_ENDIAN  1
@@ -753,7 +753,7 @@ struct vki_shminfo64 {
 // end
 //----------------------------------------------------------------------
 
-#endif // __PPC64_LINUX_VKI_ARCH_H
+#endif // __VKI_PPC64_LINUX_H
 
 /*--------------------------------------------------------------------*/
 /*--- end                                                          ---*/
index a130f43691c16fdb76c2269319ea6895c467a0f0..d8de83f32f104bc0ec8d026b5c25f696e2a73d11 100644 (file)
@@ -35,6 +35,7 @@
 // structures below for more info on how things work.
 
 #include "pub_tool_basics.h"
+#include "pub_tool_vki.h"
 #include "pub_tool_aspacemgr.h"
 #include "pub_tool_debuginfo.h"
 #include "pub_tool_hashtable.h"
index f194500720663f6ecae5be5bc8414e775460a83a..d282e62c260052bfb9a1569a636871a39175c6ed 100644 (file)
@@ -29,6 +29,7 @@
 */
 
 #include "pub_tool_basics.h"
+#include "pub_tool_vki.h"
 #include "pub_tool_aspacemgr.h"
 #include "pub_tool_execontext.h"
 #include "pub_tool_hashtable.h"