Create a new module, m_vkiscnums, and move all the system call numbers

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
This commit is contained in:
Julian Seward 2006-10-14 15:51:32 +00:00
parent 7239541177
commit 4b572a567e
21 changed files with 104 additions and 47 deletions

View 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 \

View 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

View 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.

View 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

View 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

View 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. */

View 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

View File

@ -103,7 +103,7 @@
#include "pub_core_syswrap.h"
#include "pub_core_tooliface.h"
#include "pub_core_coredump.h"
#include "vki_unistd.h"
#include "pub_core_vkiscnums.h"
/* ---------------------------------------------------------------------

View 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"

View 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

View 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.

View 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 */
/* ---------------------------------------------------------------------

View File

@ -29,7 +29,7 @@
*/
#include "pub_core_basics_asm.h"
#include "vki_unistd.h"
#include "pub_core_vkiscnums.h"
/* ------------------ SIMULATED CPU HELPERS ------------------ */
/*

View 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"

View 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

View 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
@ -29,22 +31,42 @@
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 ---*/

View 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
@ -356,4 +361,8 @@
#define __NR_sync_file_range 277
#define __NR_vmsplice 278
#endif /* __VKI_UNISTD_AMD64_LINUX_H */
#endif /* __VKI_SCNUMS_AMD64_LINUX_H */
/*--------------------------------------------------------------------*/
/*--- end ---*/
/*--------------------------------------------------------------------*/

View 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
@ -340,4 +346,8 @@
#define __NR_syscalls 301
#endif /* __VKI_UNISTD_PPC32_LINUX_H */
#endif /* __VKI_SCNUMS_PPC32_LINUX_H */
/*--------------------------------------------------------------------*/
/*--- end ---*/
/*--------------------------------------------------------------------*/

View 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
@ -331,4 +336,8 @@
#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 ---*/
/*--------------------------------------------------------------------*/

View 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
@ -347,4 +352,8 @@
#define __NR_tee 315
#define __NR_vmsplice 316
#endif /* __VKI_UNISTD_X86_LINUX_H */
#endif /* __VKI_SCNUMS_X86_LINUX_H */
/*--------------------------------------------------------------------*/
/*--- end ---*/
/*--------------------------------------------------------------------*/

View 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>