1174195Srwatson/*-
2174195Srwatson * Copyright (c) 2000, 2001 Ben Harris
3174195Srwatson * Copyright (c) 1996 Scott K. Stevens
4174195Srwatson *
5174195Srwatson * Mach Operating System
6174195Srwatson * Copyright (c) 1991,1990 Carnegie Mellon University
7174195Srwatson * All Rights Reserved.
8236992Simp *
9174195Srwatson * Permission to use, copy, modify and distribute this software and its
10174195Srwatson * documentation is hereby granted, provided that both the copyright
11174195Srwatson * notice and this permission notice appear in all copies of the
12174195Srwatson * software, derivative works or modified versions, and any portions
13174195Srwatson * thereof, and that both notices appear in supporting documentation.
14236992Simp *
15174195Srwatson * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
16174195Srwatson * CONDITION.  CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
17174195Srwatson * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
18236992Simp *
19174195Srwatson * Carnegie Mellon requests users of this software to return to
20236992Simp *
21174195Srwatson *  Software Distribution Coordinator  or  Software.Distribution@CS.CMU.EDU
22174195Srwatson *  School of Computer Science
23174195Srwatson *  Carnegie Mellon University
24174195Srwatson *  Pittsburgh PA 15213-3890
25236992Simp *
26174195Srwatson * any improvements or extensions that they make and grant Carnegie the
27174195Srwatson * rights to redistribute these changes.
28174195Srwatson *
29174195Srwatson * $FreeBSD$
30174195Srwatson */
31174195Srwatson
32174195Srwatson#ifndef _MACHINE_STACK_H_
33174195Srwatson#define	_MACHINE_STACK_H_
34174195Srwatson
35174195Srwatson#define INKERNEL(va)	(((vm_offset_t)(va)) >= VM_MIN_KERNEL_ADDRESS)
36174195Srwatson
37174195Srwatson#define FR_SCP	(0)
38174195Srwatson#define FR_RLV	(-1)
39174195Srwatson#define FR_RSP	(-2)
40174195Srwatson#define FR_RFP	(-3)
41174195Srwatson
42278895Sandrew/* The state of the unwind process */
43278895Sandrewstruct unwind_state {
44278895Sandrew	uint32_t registers[16];
45278895Sandrew	uint32_t start_pc;
46278895Sandrew	uint32_t *insn;
47278895Sandrew	u_int entries;
48278895Sandrew	u_int byte;
49278895Sandrew	uint16_t update_mask;
50278895Sandrew};
51278895Sandrew
52278895Sandrew/* The register names */
53278895Sandrew#define	FP	11
54278895Sandrew#define	SP	13
55278895Sandrew#define	LR	14
56278895Sandrew#define	PC	15
57278895Sandrew
58278996Sandrewint unwind_stack_one(struct unwind_state *, int);
59278895Sandrew
60174195Srwatson#endif /* !_MACHINE_STACK_H_ */
61