1139790Simp/*-
2117267Smarcel * Copyright (c) 2003 Marcel Moolenaar
385685Sdfr * All rights reserved.
485685Sdfr *
585685Sdfr * Redistribution and use in source and binary forms, with or without
685685Sdfr * modification, are permitted provided that the following conditions
785685Sdfr * are met:
8117267Smarcel *
985685Sdfr * 1. Redistributions of source code must retain the above copyright
1085685Sdfr *    notice, this list of conditions and the following disclaimer.
1185685Sdfr * 2. Redistributions in binary form must reproduce the above copyright
1285685Sdfr *    notice, this list of conditions and the following disclaimer in the
1385685Sdfr *    documentation and/or other materials provided with the distribution.
1485685Sdfr *
15117267Smarcel * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
16117267Smarcel * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
17117267Smarcel * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
18117267Smarcel * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
19117267Smarcel * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
20117267Smarcel * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
21117267Smarcel * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
22117267Smarcel * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23117267Smarcel * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
24117267Smarcel * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2585685Sdfr *
2685685Sdfr * $FreeBSD$
2785685Sdfr */
2885685Sdfr
29115084Smarcel#ifndef _MACHINE_UNWIND_H_
30115084Smarcel#define	_MACHINE_UNWIND_H_
3185685Sdfr
32131945Smarcelstruct pcb;
33131945Smarcelstruct trapframe;
34115084Smarcelstruct uwx_env;
35115084Smarcel
36115084Smarcelstruct unw_regstate {
37131945Smarcel	struct pcb	*pcb;
38115084Smarcel	struct trapframe *frame;
39115084Smarcel	struct uwx_env	*env;
40115084Smarcel	uint64_t	keyval[8];
41115084Smarcel};
42115084Smarcel
43131945Smarcelint unw_create_from_pcb(struct unw_regstate *s, struct pcb *pcb);
44131945Smarcelint unw_create_from_frame(struct unw_regstate *s, struct trapframe *tf);
45117267Smarcelvoid unw_delete(struct unw_regstate *s);
46115084Smarcelint unw_step(struct unw_regstate *s);
47115084Smarcel
48115084Smarcelint unw_get_bsp(struct unw_regstate *s, uint64_t *r);
49115084Smarcelint unw_get_cfm(struct unw_regstate *s, uint64_t *r);
50115084Smarcelint unw_get_ip(struct unw_regstate *s, uint64_t *r);
51117467Smarcelint unw_get_sp(struct unw_regstate *s, uint64_t *r);
52115084Smarcel
53115084Smarcelint unw_table_add(uint64_t, uint64_t, uint64_t);
54115084Smarcelvoid unw_table_remove(uint64_t);
55115084Smarcel
56115084Smarcel#endif /* _MACHINE_UNWIND_H_ */
57