#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
*/
#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"
#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"
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 \
m_translate.c \
m_transtab.c \
m_ume.c \
+ m_vki.c \
m_vkiscnums.c \
m_aspacemgr/aspacemgr.c \
m_debuginfo/storage.c \
#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"
minimal set of imports. */
#include "pub_core_basics.h" // types
+#include "pub_core_vki.h"
#include "pub_core_debuglog.h" // VG_(debugLog)
*/
#include "pub_core_basics.h"
+#include "pub_core_vki.h"
#include "pub_core_clientstate.h"
/*-----------------------------------------------------------------*/
*/
#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"
*/
#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"
*/
#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"
*/
#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"
*/
#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"
*/
#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"
*/
#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"
*/
#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"
*/
#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"
*/
#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"
*/
#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"
*/
#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"
*/
#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"
*/
#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"
*/
#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"
------------------------------------------------------------------ */
#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 :(
*/
#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__*
#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
*/
#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)()
*/
#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"
*/
#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"
*/
#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)()
*/
#include "pub_core_basics.h"
+#include "pub_core_vki.h"
#include "pub_core_syscall.h"
/* ---------------------------------------------------------------------
*/
#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"
#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
#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_*)
*/
#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_*)
#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.
#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"
*/
#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"
#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
*/
#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"
*/
#include "pub_core_basics.h"
+#include "pub_core_vki.h"
#include "pub_core_threadstate.h"
#include "pub_core_libcassert.h"
*/
#include "pub_core_basics.h"
+#include "pub_core_vki.h"
#include "pub_core_aspacemgr.h"
#include "pub_core_machine.h" // VG_(fnptr_to_fnentry)
// 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"
--- /dev/null
+
+/*--------------------------------------------------------------------*/
+/*--- 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 ---*/
+/*--------------------------------------------------------------------*/
--- /dev/null
+
+/*--------------------------------------------------------------------*/
+/*--- 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 ---*/
+/*--------------------------------------------------------------------*/
// 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"
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 \
// 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
--- /dev/null
+
+/*--------------------------------------------------------------------*/
+/*--- 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 ---*/
+/*--------------------------------------------------------------------*/
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
int reserved[9];
};
-#endif // __VKI_LINUX_H
-
//----------------------------------------------------------------------
// From linux-2.6.16/include/linux/vt.h
//----------------------------------------------------------------------
#define VKI_VT_LOCKSWITCH 0x560B /* disallow vt switching */
#define VKI_VT_UNLOCKSWITCH 0x560C /* allow vt switching */
+#endif // __VKI_LINUX_H
+
/*--------------------------------------------------------------------*/
/*--- end ---*/
/*--------------------------------------------------------------------*/
/*--------------------------------------------------------------------*/
/*--- AMD64/Linux-specific kernel interface: posix types. ---*/
-/*--- vki_posixtypes-amd64-linux.h ---*/
+/*--- vki-posixtypes-amd64-linux.h ---*/
/*--------------------------------------------------------------------*/
/*
/*--------------------------------------------------------------------*/
/*--- PPC32/Linux-specific kernel interface: posix types. ---*/
-/*--- vki_posixtypes-ppc32-linux.h ---*/
+/*--- vki-posixtypes-ppc32-linux.h ---*/
/*--------------------------------------------------------------------*/
/*
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
int val[2];
} __vki_kernel_fsid_t;
-#endif // __PPC32_LINUX_VKI_ARCH_POSIXTYPES_H
+#endif // __VKI_POSIXTYPES_PPC32_LINUX_H
/*--------------------------------------------------------------------*/
/*--- end ---*/
/*--------------------------------------------------------------------*/
/*--- PPC64/Linux-specific kernel interface: posix types. ---*/
-/*--- vki_posixtypes-ppc64-linux.h ---*/
+/*--- vki-posixtypes-ppc64-linux.h ---*/
/*--------------------------------------------------------------------*/
/*
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
int val[2];
} __vki_kernel_fsid_t;
-#endif // __PPC64_LINUX_VKI_ARCH_POSIXTYPES_H
+#endif // __VKI_POSIXTYPES_PPC64_LINUX_H
/*--------------------------------------------------------------------*/
/*--- end ---*/
/*--------------------------------------------------------------------*/
/*--- x86/Linux-specific kernel interface: posix types. ---*/
-/*--- vki_posixtypes-x86-linux.h ---*/
+/*--- vki-posixtypes-x86-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
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
// And that's it!
//----------------------------------------------------------------------
-#endif // __PPC32_LINUX_VKI_ARCH_H
+#endif // __VKI_PPC32_LINUX_H
/*--------------------------------------------------------------------*/
/*--- end ---*/
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
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
// end
//----------------------------------------------------------------------
-#endif // __PPC64_LINUX_VKI_ARCH_H
+#endif // __VKI_PPC64_LINUX_H
/*--------------------------------------------------------------------*/
/*--- end ---*/
// 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"
*/
#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"