204 |
|
}; |
205 |
|
#endif |
206 |
|
|
207 |
+ |
#if defined(__NetBSD__) |
208 |
+ |
#include <sys/ucontext.h> |
209 |
+ |
#define MACHINE_REGISTERS(scp) ((machine_regs *)&(((ucontext_t *)scp)->uc_mcontext)) |
210 |
+ |
|
211 |
+ |
struct machine_regs : public mcontext_t |
212 |
+ |
{ |
213 |
+ |
long & cr() { return __gregs[_REG_CR]; } |
214 |
+ |
uint32 cr() const { return __gregs[_REG_CR]; } |
215 |
+ |
uint32 lr() const { return __gregs[_REG_LR]; } |
216 |
+ |
uint32 ctr() const { return __gregs[_REG_CTR]; } |
217 |
+ |
uint32 xer() const { return __gregs[_REG_XER]; } |
218 |
+ |
uint32 msr() const { return __gregs[_REG_MSR]; } |
219 |
+ |
uint32 dar() const { return (uint32)(((siginfo_t *)(((unsigned long)this) - offsetof(ucontext_t, uc_mcontext))) - 1)->si_addr; } /* HACK */ |
220 |
+ |
long & pc() { return __gregs[_REG_PC]; } |
221 |
+ |
uint32 pc() const { return __gregs[_REG_PC]; } |
222 |
+ |
long & gpr(int i) { return __gregs[_REG_R0 + i]; } |
223 |
+ |
uint32 gpr(int i) const { return __gregs[_REG_R0 + i]; } |
224 |
+ |
}; |
225 |
+ |
#endif |
226 |
+ |
|
227 |
|
#if defined(__APPLE__) && defined(__MACH__) |
228 |
|
#include <sys/signal.h> |
229 |
|
extern "C" int sigaltstack(const struct sigaltstack *ss, struct sigaltstack *oss); |