blob: 743257c6316a808ba7c81bb25ffe2b610de84759 [file] [log] [blame]
sewardjcc4f4672006-10-14 19:32:16 +00001
2/*--------------------------------------------------------------------*/
njnd61bc2a2009-05-20 06:42:59 +00003/*--- Syscall numbers and related operations. pub_core_vkiscnums.h ---*/
sewardjcc4f4672006-10-14 19:32:16 +00004/*--------------------------------------------------------------------*/
5
6/*
7 This file is part of Valgrind, a dynamic binary instrumentation
8 framework.
9
sewardj9eecbbb2010-05-03 21:37:12 +000010 Copyright (C) 2000-2010 Julian Seward
sewardjcc4f4672006-10-14 19:32:16 +000011 jseward@acm.org
sewardj9eecbbb2010-05-03 21:37:12 +000012 Copyright (C) 2005-2010 Nicholas Nethercote
sewardjcc4f4672006-10-14 19:32:16 +000013 njn@valgrind.org
sewardj9eecbbb2010-05-03 21:37:12 +000014 Copyright (C) 2006-2010 OpenWorks LLP
sewardjcc4f4672006-10-14 19:32:16 +000015 info@open-works.co.uk
16
17 This program is free software; you can redistribute it and/or
18 modify it under the terms of the GNU General Public License as
19 published by the Free Software Foundation; either version 2 of the
20 License, or (at your option) any later version.
21
22 This program is distributed in the hope that it will be useful, but
23 WITHOUT ANY WARRANTY; without even the implied warranty of
24 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
25 General Public License for more details.
26
27 You should have received a copy of the GNU General Public License
28 along with this program; if not, write to the Free Software
29 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
30 02111-1307, USA.
31
32 The GNU General Public License is contained in the file COPYING.
33*/
34
35#ifndef __PUB_CORE_VKISCNUMS_H
36#define __PUB_CORE_VKISCNUMS_H
37
njn1a1e95c2009-06-03 06:50:06 +000038//--------------------------------------------------------------------
39// PURPOSE: This module holds all the syscall numbers, and a handful of
40// operations relating to them.
41//
42// On Linux they are a bunch of #define'd constants of the form
43// __NR_name, and this file must contain nothing else, since it will
44// be included in assembly code (m_trampoline.S).
45//
46// On AIX the __NR_name consts are renamings of global variables which
47// tell us the number for each syscall. This elaboration is necessary
48// because on AIX the syscall numbers are not constant; they can be
49// different for each process (in principle; in practice they rarely
50// change). 32- and 64-bit AIX5 share a common "implementation".
51//
52// On Darwin the __NR_name consts are #define'd constants which are
53// encoded using various macros. 32- and 64-bit Darwin share a common
54// "implementation" also.
55//
56// Note that most of the actual code for this module is in include/vki/, but
57// you should not directly #include any file in include/vki; instead #include
58// only one of pub_{core,tool}_vkiscnums{,_asm}.h.
59//--------------------------------------------------------------------
60
sewardjcc4f4672006-10-14 19:32:16 +000061/* Most unfortunately, all the kernel decls are visible to tools. Not
62 really necessary, but to avoid this would require some tedious
63 refactoring of the sources. Anyway, we live with this kludge, and
64 that means the only thing to be done here is ... */
65
njn1a1e95c2009-06-03 06:50:06 +000066#include "pub_core_vkiscnums_asm.h"
sewardjcc4f4672006-10-14 19:32:16 +000067#include "pub_tool_vkiscnums.h"
68
69
njnd61bc2a2009-05-20 06:42:59 +000070#if defined(VGO_linux)
71 // Nothing
72
73#elif defined(VGO_aix5)
sewardjcc4f4672006-10-14 19:32:16 +000074/* Bind the given syscall name to the given number. Returns True if
75 successful, False if the name is unknown. */
76extern Bool VG_(aix5_register_syscall)( Int, UChar* );
sewardjcc4f4672006-10-14 19:32:16 +000077
njnf76d27a2009-05-28 01:53:07 +000078#elif defined(VGO_darwin)
njn1a1e95c2009-06-03 06:50:06 +000079 // Nothing
njnf76d27a2009-05-28 01:53:07 +000080
njnd61bc2a2009-05-20 06:42:59 +000081#else
82# error Unknown OS
njn1a1e95c2009-06-03 06:50:06 +000083#endif
sewardjcc4f4672006-10-14 19:32:16 +000084
85#endif // __PUB_CORE_VKISCNUMS_H
86
87/*--------------------------------------------------------------------*/
88/*--- end ---*/
89/*--------------------------------------------------------------------*/