blob: 074037b34b62f520b3a9282f90eb39b86ca19d5d [file] [log] [blame]
sewardj4eee4762006-10-14 15:51:32 +00001
2/*--------------------------------------------------------------------*/
njnf11335a2009-05-20 04:09:38 +00003/*--- Syscall numbers and related operations. pub_tool_vkiscnums.h ---*/
sewardj4eee4762006-10-14 15:51:32 +00004/*--------------------------------------------------------------------*/
5
6/*
7 This file is part of Valgrind, a dynamic binary instrumentation
8 framework.
9
sewardj03f8d3f2012-08-05 15:46:46 +000010 Copyright (C) 2005-2012 Nicholas Nethercote
sewardj4eee4762006-10-14 15:51:32 +000011 njn@valgrind.org
sewardj03f8d3f2012-08-05 15:46:46 +000012 Copyright (C) 2006-2012 OpenWorks LLP
sewardj4eee4762006-10-14 15:51:32 +000013 info@open-works.co.uk
14
15 This program is free software; you can redistribute it and/or
16 modify it under the terms of the GNU General Public License as
17 published by the Free Software Foundation; either version 2 of the
18 License, or (at your option) any later version.
19
20 This program is distributed in the hope that it will be useful, but
21 WITHOUT ANY WARRANTY; without even the implied warranty of
22 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
23 General Public License for more details.
24
25 You should have received a copy of the GNU General Public License
26 along with this program; if not, write to the Free Software
27 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
28 02111-1307, USA.
29
30 The GNU General Public License is contained in the file COPYING.
31*/
32
sewardj4eee4762006-10-14 15:51:32 +000033#ifndef __PUB_TOOL_VKISCNUMS_H
34#define __PUB_TOOL_VKISCNUMS_H
35
njn1a1e95c2009-06-03 06:50:06 +000036#include "pub_tool_vkiscnums_asm.h"
sewardj9c606bd2008-09-18 18:12:50 +000037
sewardj9c606bd2008-09-18 18:12:50 +000038
njn1a1e95c2009-06-03 06:50:06 +000039// This converts a syscall number into a string, suitable for printing. It is
sewardj6e9de462011-06-28 07:25:29 +000040// needed because some platforms (Darwin) munge sysnums in various ways.
njn1a1e95c2009-06-03 06:50:06 +000041// It is used in places where the sycall name will be printed alongside.
floriandbb35842012-10-27 18:39:11 +000042extern HChar* VG_(sysnum_string) (Word sysnum, SizeT n_buf, HChar* buf);
sewardj9c606bd2008-09-18 18:12:50 +000043
njn1a1e95c2009-06-03 06:50:06 +000044// This is like VG_(sysnum_string), but prints extra info if needed. It is
45// called in places where the syscall name will *not* be printed alongside.
floriandbb35842012-10-27 18:39:11 +000046extern HChar* VG_(sysnum_string_extra)(Word sysnum, SizeT n_buf, HChar* buf);
sewardj9c606bd2008-09-18 18:12:50 +000047
njn1a1e95c2009-06-03 06:50:06 +000048// Macros that make the above functions easier to use by declaring a local
49// buffer.
50#define VG_SYSNUM_STRING(sysnum) \
floriandbb35842012-10-27 18:39:11 +000051 ({ HChar qq_zz_buf[32]; VG_(sysnum_string)(sysnum, 32, qq_zz_buf); })
njn1a1e95c2009-06-03 06:50:06 +000052#define VG_SYSNUM_STRING_EXTRA(sysnum) \
floriandbb35842012-10-27 18:39:11 +000053 ({ HChar qq_zz_buf[64]; VG_(sysnum_string_extra)(sysnum, 64, qq_zz_buf); })
njn1a1e95c2009-06-03 06:50:06 +000054
55
sewardj4eee4762006-10-14 15:51:32 +000056#endif // __PUB_TOOL_VKISCNUMS_H
57
58/*--------------------------------------------------------------------*/
59/*--- end ---*/
60/*--------------------------------------------------------------------*/