unwind.h revision 259065
1130803Smarcel/*-
2130803Smarcel * Copyright (c) 2003 Marcel Moolenaar
3130803Smarcel * All rights reserved.
4130803Smarcel *
5130803Smarcel * Redistribution and use in source and binary forms, with or without
6130803Smarcel * modification, are permitted provided that the following conditions
7130803Smarcel * are met:
8130803Smarcel *
9130803Smarcel * 1. Redistributions of source code must retain the above copyright
10130803Smarcel *    notice, this list of conditions and the following disclaimer.
11130803Smarcel * 2. Redistributions in binary form must reproduce the above copyright
12130803Smarcel *    notice, this list of conditions and the following disclaimer in the
13130803Smarcel *    documentation and/or other materials provided with the distribution.
14130803Smarcel *
15130803Smarcel * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
16130803Smarcel * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
17130803Smarcel * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
18130803Smarcel * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
19130803Smarcel * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
20130803Smarcel * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
21130803Smarcel * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
22130803Smarcel * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23130803Smarcel * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
24130803Smarcel * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25130803Smarcel *
26130803Smarcel * $FreeBSD: releng/10.0/sys/ia64/include/unwind.h 139790 2005-01-06 22:18:23Z imp $
27130803Smarcel */
28130803Smarcel
29130803Smarcel#ifndef _MACHINE_UNWIND_H_
30130803Smarcel#define	_MACHINE_UNWIND_H_
31130803Smarcel
32130803Smarcelstruct pcb;
33130803Smarcelstruct trapframe;
34130803Smarcelstruct uwx_env;
35130803Smarcel
36130803Smarcelstruct unw_regstate {
37130803Smarcel	struct pcb	*pcb;
38130803Smarcel	struct trapframe *frame;
39130803Smarcel	struct uwx_env	*env;
40130803Smarcel	uint64_t	keyval[8];
41130803Smarcel};
42130803Smarcel
43130803Smarcelint unw_create_from_pcb(struct unw_regstate *s, struct pcb *pcb);
44130803Smarcelint unw_create_from_frame(struct unw_regstate *s, struct trapframe *tf);
45130803Smarcelvoid unw_delete(struct unw_regstate *s);
46130803Smarcelint unw_step(struct unw_regstate *s);
47130803Smarcel
48130803Smarcelint unw_get_bsp(struct unw_regstate *s, uint64_t *r);
49130803Smarcelint unw_get_cfm(struct unw_regstate *s, uint64_t *r);
50130803Smarcelint unw_get_ip(struct unw_regstate *s, uint64_t *r);
51130803Smarcelint unw_get_sp(struct unw_regstate *s, uint64_t *r);
52130803Smarcel
53130803Smarcelint unw_table_add(uint64_t, uint64_t, uint64_t);
54130803Smarcelvoid unw_table_remove(uint64_t);
55130803Smarcel
56130803Smarcel#endif /* _MACHINE_UNWIND_H_ */
57130803Smarcel