Improve NetBSD support: Allow VMA determination with fewer system calls.
[libsigsegv/ericb.git] / src / fault-netbsd.h
bloba9f2b17ca573b795965d794c36d290404c0d3ee3
1 /* Fault handler information. NetBSD version.
2 Copyright (C) 2006, 2009 Bruno Haible <bruno@clisp.org>
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2, or (at your option)
7 any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software Foundation,
16 Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
18 #include "fault-posix-ucontext.h"
20 /* _UC_MACHINE_SP is a platform independent macro.
21 Defined in <machine/mcontext.h>, see
22 http://cvsweb.netbsd.org/bsdweb.cgi/src/sys/arch/$arch/include/mcontext.h
23 Supported on alpha, amd64, i386, ia64, m68k, mips, powerpc, sparc since
24 NetBSD 2.0.
25 On i386, _UC_MACHINE_SP is the same as ->uc_mcontext.__gregs[_REG_UESP],
26 and apparently the same value as ->uc_mcontext.__gregs[_REG_ESP]. */
27 #ifdef _UC_MACHINE_SP
28 #define SIGSEGV_FAULT_STACKPOINTER _UC_MACHINE_SP ((ucontext_t *) ucp)
29 #endif