mirror of
https://github.com/kanjitalk755/macemu.git
synced 2024-12-27 00:29:40 +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
|
* uint32 call_macos1(uint32 tvect{r3}, uint32 arg1{r4}) ... - Call MacOS routines
|
||||||
*/
|
*/
|
||||||
|
|
||||||
.macro prolog
|
ASM_MACRO_START prolog
|
||||||
mflr r0
|
mflr r0
|
||||||
stw r0,4(r1)
|
stw r0,4(r1)
|
||||||
stwu r1,-64(r1)
|
stwu r1,-64(r1)
|
||||||
.endm
|
ASM_MACRO_END
|
||||||
|
|
||||||
.macro epilog
|
ASM_MACRO_START epilog
|
||||||
lwz r13,XLM_TOC(0)
|
lwz r13,XLM_TOC(0)
|
||||||
lwz r0,64+4(r1)
|
lwz r0,64+4(r1)
|
||||||
mtlr r0
|
mtlr r0
|
||||||
addi r1,r1,64
|
addi r1,r1,64
|
||||||
blr
|
blr
|
||||||
.endm
|
ASM_MACRO_END
|
||||||
|
|
||||||
ASM_GLOBAL_DIRECTIVE C_SYMBOL_NAME(call_macos)
|
ASM_GLOBAL_DIRECTIVE C_SYMBOL_NAME(call_macos)
|
||||||
C_SYMBOL_NAME(call_macos):
|
C_SYMBOL_NAME(call_macos):
|
||||||
|
@ -165,6 +165,9 @@ struct sigregs {
|
|||||||
};
|
};
|
||||||
|
|
||||||
#if defined(__linux__)
|
#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
|
struct machine_regs : public pt_regs
|
||||||
{
|
{
|
||||||
u_long & cr() { return pt_regs::ccr; }
|
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]; }
|
u_long & gpr(int i) { return pt_regs::gpr[i]; }
|
||||||
uint32 gpr(int i) const { 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
|
#endif
|
||||||
|
|
||||||
#if defined(__APPLE__) && defined(__MACH__)
|
#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
|
struct machine_regs : public mcontext
|
||||||
{
|
{
|
||||||
uint32 & cr() { return ss.cr; }
|
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) { return (&ss.r0)[i]; }
|
||||||
uint32 gpr(int i) const { 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
|
#endif
|
||||||
|
|
||||||
static void build_sigregs(sigregs *srp, machine_regs *mrp)
|
static void build_sigregs(sigregs *srp, machine_regs *mrp)
|
||||||
|
@ -1,8 +1,17 @@
|
|||||||
#if (defined(__APPLE__) && defined(__MACH__))
|
#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
|
#endif
|
||||||
#ifndef C_SYMBOL_NAME
|
#ifndef C_SYMBOL_NAME
|
||||||
#define C_SYMBOL_NAME(X) X
|
#define C_SYMBOL_NAME(NAME) NAME
|
||||||
#endif
|
#endif
|
||||||
#ifndef ASM_GLOBAL_DIRECTIVE
|
#ifndef ASM_GLOBAL_DIRECTIVE
|
||||||
#define ASM_GLOBAL_DIRECTIVE .globl
|
#define ASM_GLOBAL_DIRECTIVE .globl
|
||||||
|
Loading…
Reference in New Issue
Block a user