mirror of
https://github.com/kanjitalk755/macemu.git
synced 2024-12-25 17:29:19 +00:00
Post-merge fixups: machine state wrappers, Apple assembler perticularities.
This commit is contained in:
parent
0665ab1139
commit
324fba4137
@ -566,19 +566,19 @@ C_SYMBOL_NAME(execute_68k):
|
||||
* uint32 call_macos1(uint32 tvect{r3}, uint32 arg1{r4}) ... - Call MacOS routines
|
||||
*/
|
||||
|
||||
.macro prolog
|
||||
ASM_MACRO_START prolog
|
||||
mflr r0
|
||||
stw r0,4(r1)
|
||||
stwu r1,-64(r1)
|
||||
.endm
|
||||
ASM_MACRO_END
|
||||
|
||||
.macro epilog
|
||||
ASM_MACRO_START epilog
|
||||
lwz r13,XLM_TOC(0)
|
||||
lwz r0,64+4(r1)
|
||||
mtlr r0
|
||||
addi r1,r1,64
|
||||
blr
|
||||
.endm
|
||||
ASM_MACRO_END
|
||||
|
||||
ASM_GLOBAL_DIRECTIVE C_SYMBOL_NAME(call_macos)
|
||||
C_SYMBOL_NAME(call_macos):
|
||||
|
@ -165,6 +165,9 @@ struct sigregs {
|
||||
};
|
||||
|
||||
#if defined(__linux__)
|
||||
#include <sys/ucontext.h>
|
||||
#define MACHINE_REGISTERS(scp) ((machine_regs *)(((ucontext_t *)scp)->uc_mcontext.regs))
|
||||
|
||||
struct machine_regs : public pt_regs
|
||||
{
|
||||
u_long & cr() { return pt_regs::ccr; }
|
||||
@ -179,12 +182,15 @@ struct machine_regs : public pt_regs
|
||||
u_long & gpr(int i) { return pt_regs::gpr[i]; }
|
||||
uint32 gpr(int i) const { return pt_regs::gpr[i]; }
|
||||
};
|
||||
|
||||
#include <sys/ucontext.h>
|
||||
#define MACHINE_REGISTERS(scp) ((machine_regs *)(((ucontext_t *)scp)->uc_mcontext.regs))
|
||||
#endif
|
||||
|
||||
#if defined(__APPLE__) && defined(__MACH__)
|
||||
#include <sys/signal.h>
|
||||
extern "C" int sigaltstack(const struct sigaltstack *ss, struct sigaltstack *oss);
|
||||
|
||||
#include <sys/ucontext.h>
|
||||
#define MACHINE_REGISTERS(scp) ((machine_regs *)(((ucontext_t *)scp)->uc_mcontext))
|
||||
|
||||
struct machine_regs : public mcontext
|
||||
{
|
||||
uint32 & cr() { return ss.cr; }
|
||||
@ -199,12 +205,6 @@ struct machine_regs : public mcontext
|
||||
uint32 & gpr(int i) { return (&ss.r0)[i]; }
|
||||
uint32 gpr(int i) const { return (&ss.r0)[i]; }
|
||||
};
|
||||
|
||||
#include <sys/ucontext.h>
|
||||
#define MACHINE_REGISTERS(scp) ((machine_regs *)(((ucontext_t *)scp)->uc_mcontext))
|
||||
|
||||
#include <sys/signal.h>
|
||||
extern "C" int sigaltstack(const struct sigaltstack *ss, struct sigaltstack *oss);
|
||||
#endif
|
||||
|
||||
static void build_sigregs(sigregs *srp, machine_regs *mrp)
|
||||
|
@ -1,11 +1,20 @@
|
||||
#if (defined(__APPLE__) && defined(__MACH__))
|
||||
#define C_SYMBOL_NAME(X) _ ## X
|
||||
#define C_SYMBOL_NAME(NAME) _ ## NAME
|
||||
#define ASM_MACRO_END .endmacro
|
||||
#endif
|
||||
|
||||
/* Defaults for GNU assembler */
|
||||
#ifndef ASM_MACRO_START
|
||||
#define ASM_MACRO_START .macro
|
||||
#endif
|
||||
#ifndef ASM_MACRO_END
|
||||
#define ASM_MACRO_END .endm
|
||||
#endif
|
||||
#ifndef C_SYMBOL_NAME
|
||||
#define C_SYMBOL_NAME(X) X
|
||||
#define C_SYMBOL_NAME(NAME) NAME
|
||||
#endif
|
||||
#ifndef ASM_GLOBAL_DIRECTIVE
|
||||
#define ASM_GLOBAL_DIRECTIVE .globl
|
||||
#define ASM_GLOBAL_DIRECTIVE .globl
|
||||
#endif
|
||||
|
||||
/* Register names */
|
||||
|
Loading…
Reference in New Issue
Block a user