summaryrefslogtreecommitdiffhomepage
path: root/src/arch/nt64/unwind.c
blob: 4f54ed337da48778b71d816afb451ff05338b3e8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
/**************************************************************************/
/*  mmglue: midipix architecture- and target-specific bits for musl libc  */
/*  Copyright (C) 2013--2023  SysDeer Technologies, LLC                   */
/*  Released under the Standard MIT License; see COPYING.MMGLUE.          */
/**************************************************************************/

#include <stdint.h>
#include <signal.h>
#include <sys/unwind.h>
#include "psxseh.h"

extern const struct __seh_vtbl * __eh_vtbl;


int __unwind_exception_filter(
	struct __exception_record * erec,
	void * fctx,
	mcontext_t * tctx,
	struct __dispatcher_context * dctx,
	__unwind_personality_routine uw_routine)
{
	return __eh_vtbl->seh_exception_filter(
		erec,fctx,tctx,dctx,uw_routine);
}


int __unwind_exception_handler(
	struct __exception_record * erec,
	uintptr_t fbase,
	mcontext_t * tctx,
	struct __dispatcher_context * dctx)
{
	return __eh_vtbl->seh_exception_handler(
		erec,fbase,tctx,dctx);
}


int __unwind_raise_exception(struct __unwind_exception * e)
{
	return __eh_vtbl->seh_unwind_raise_exception(e);
}


void __unwind_delete_exception(struct __unwind_exception * e)
{
	return __eh_vtbl->seh_unwind_delete_exception(e);
}


void __unwind_resume(struct __unwind_exception * e)
{
	return __eh_vtbl->seh_unwind_resume(e);
}


int __unwind_resume_or_rethrow(struct __unwind_exception * e)
{
	return __eh_vtbl->seh_unwind_resume_or_rethrow(e);
}


int __unwind_force(
	struct __unwind_exception * e,
	int (*stop_fn)(
		int, int, uintptr_t,
		struct __unwind_exception *,
		struct __unwind_context *,
		void *),
	void * ctx)
{
	return __eh_vtbl->seh_unwind_force(e,stop_fn,ctx);
}


void * __unwind_get_language_specific_data(struct __unwind_context * uwctx)
{
	return __eh_vtbl->seh_unwind_get_language_specific_data(uwctx);
}


int __unwind_backtrace(
	enum __unwind_reason_code (*trace_fn)(
		struct __unwind_context *,
		void *),
	void * ctx)
{
	return __eh_vtbl->seh_unwind_backtrace(trace_fn,ctx);
}


int __unwind_calltrace()
{
	return __eh_vtbl->seh_unwind_calltrace();
}


uintptr_t __unwind_get_ip(const struct __unwind_context * uwctx)
{
	return __eh_vtbl->seh_unwind_get_ip(uwctx);
}


void __unwind_set_ip(struct __unwind_context * uwctx, uintptr_t ip)
{
	return __eh_vtbl->seh_unwind_set_ip(uwctx,ip);
}


uintptr_t __unwind_get_gr(const struct __unwind_context * uwctx, int idx)
{
	return __eh_vtbl->seh_unwind_get_gr(uwctx,idx);
}


void __unwind_set_gr(struct __unwind_context * uwctx, int idx, uintptr_t rval)
{
	return __eh_vtbl->seh_unwind_set_gr(uwctx,idx,rval);
}


uintptr_t __unwind_get_data_rel_base(const struct __unwind_context * uwctx)
{
	return __eh_vtbl->seh_unwind_get_data_rel_base(uwctx);
}


uintptr_t __unwind_get_text_rel_base(const struct __unwind_context * uwctx)
{
	return __eh_vtbl->seh_unwind_get_text_rel_base(uwctx);
}


uintptr_t __unwind_get_cfa(const struct __unwind_context * uwctx)
{
	return __eh_vtbl->seh_unwind_get_cfa(uwctx);
}


uintptr_t __unwind_get_ip_info(const struct __unwind_context * uwctx, int * pinfo)
{
	return __eh_vtbl->seh_unwind_get_ip_info(uwctx,pinfo);
}


uintptr_t __unwind_get_region_start(const struct __unwind_context * uwctx)
{
	return __eh_vtbl->seh_unwind_get_region_start(uwctx);
}


void * __unwind_find_enclosing_function(const void * addr)
{
	return __eh_vtbl->seh_unwind_find_enclosing_function(addr);
}