ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/cebix/SheepShaver/src/Unix/main_unix.cpp
(Generate patch)

Comparing SheepShaver/src/Unix/main_unix.cpp (file contents):
Revision 1.58 by gbeauche, 2005-01-30T21:48:20Z vs.
Revision 1.59 by gbeauche, 2005-02-20T18:08:50Z

# Line 204 | Line 204 | struct machine_regs : public pt_regs
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);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines