1296614Sbr/*-
2296614Sbr * Copyright (c) 2016 Ruslan Bukin <br@bsdpad.com>
3296614Sbr * All rights reserved.
4296614Sbr *
5296614Sbr * Portions of this software were developed by SRI International and the
6296614Sbr * University of Cambridge Computer Laboratory under DARPA/AFRL contract
7296614Sbr * FA8750-10-C-0237 ("CTSRD"), as part of the DARPA CRASH research programme.
8296614Sbr *
9296614Sbr * Portions of this software were developed by the University of Cambridge
10296614Sbr * Computer Laboratory as part of the CTSRD Project, with support from the
11296614Sbr * UK Higher Education Innovation Fund (HEIF).
12296614Sbr *
13296614Sbr * Redistribution and use in source and binary forms, with or without
14296614Sbr * modification, are permitted provided that the following conditions
15296614Sbr * are met:
16296614Sbr * 1. Redistributions of source code must retain the above copyright
17296614Sbr *    notice, this list of conditions and the following disclaimer.
18296614Sbr * 2. Redistributions in binary form must reproduce the above copyright
19296614Sbr *    notice, this list of conditions and the following disclaimer in the
20296614Sbr *    documentation and/or other materials provided with the distribution.
21296614Sbr *
22296614Sbr * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
23296614Sbr * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24296614Sbr * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25296614Sbr * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
26296614Sbr * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
27296614Sbr * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
28296614Sbr * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
29296614Sbr * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30296614Sbr * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
31296614Sbr * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32296614Sbr * SUCH DAMAGE.
33296614Sbr *
34296614Sbr * $FreeBSD$
35296614Sbr */
36296614Sbr
37296614Sbr#ifndef _MACHINE_STACK_H_
38296614Sbr#define	_MACHINE_STACK_H_
39296614Sbr
40296614Sbr#define	INKERNEL(va)	((va) >= VM_MIN_KERNEL_ADDRESS && \
41296614Sbr			 (va) <= VM_MAX_KERNEL_ADDRESS)
42296614Sbr
43296614Sbrstruct unwind_state {
44296614Sbr	uint64_t fp;
45296614Sbr	uint64_t sp;
46296614Sbr	uint64_t pc;
47296614Sbr};
48296614Sbr
49296614Sbrint unwind_frame(struct unwind_state *);
50296614Sbr
51296614Sbr#endif /* !_MACHINE_STACK_H_ */
52