From 21ee355ca760c062fa4acfd90e39ab77f7aad133 Mon Sep 17 00:00:00 2001 From: Laurent Vivier Date: Fri, 29 Dec 2006 20:27:15 +0000 Subject: [PATCH] add #ifdef __mc68000__ for inlined asm functions --- libmacos/macos/devices.h | 4 ++-- libmacos/macos/errors.h | 4 ++-- libmacos/macos/events.h | 2 ++ libmacos/macos/files.h | 4 ++-- libmacos/macos/gestalt.h | 4 ++-- libmacos/macos/init.h | 2 ++ libmacos/macos/memory.h | 2 ++ libmacos/macos/osutils.h | 2 ++ libmacos/macos/quickdraw.h | 2 ++ libmacos/macos/scsi.h | 2 ++ libmacos/macos/slotmanager.h | 2 ++ 11 files changed, 22 insertions(+), 8 deletions(-) diff --git a/libmacos/macos/devices.h b/libmacos/macos/devices.h index 7a02963..0a358e9 100644 --- a/libmacos/macos/devices.h +++ b/libmacos/macos/devices.h @@ -49,7 +49,7 @@ typedef struct DCtlEntry DCtlEntry; typedef DCtlEntry * DCtlPtr; typedef DCtlPtr * DCtlHandle; -#ifdef ARCH_M68K +#ifdef __mc68000__ static inline OSErr PBCloseSync(ParmBlkPtr paramBlock) { register OSErr ret asm("%%d0"); @@ -129,5 +129,5 @@ static inline OSErr DrvrRemove(int refNum) extern OSErr OpenDriver(ConstStr255Param name, short *drvrRefNum); extern OSErr CloseDriver(short refNum); extern OSErr SerGetBuf(short refNum, long *count); -#endif /* ARCH_M68K */ +#endif /* __mc68000__ */ #endif /* __MACOS_DEVICES_H__ */ diff --git a/libmacos/macos/errors.h b/libmacos/macos/errors.h index 676cdbc..f772be8 100644 --- a/libmacos/macos/errors.h +++ b/libmacos/macos/errors.h @@ -34,12 +34,12 @@ enum { smNoMoresRsrcs = -344, }; -#ifdef ARCH_M68K +#ifdef __mc68000__ static inline void SysError(short errorCode) { asm("move.l %0, %%d0\n" Trap(_SysError) :: "g" (errorCode) : "%%d0", UNPRESERVED_REGS); } -#endif /* ARCH_M68K */ +#endif /* __mc68000__ */ #endif /* __MACOS_ERRORS_H__ */ diff --git a/libmacos/macos/events.h b/libmacos/macos/events.h index 2f513e9..39d4bd6 100644 --- a/libmacos/macos/events.h +++ b/libmacos/macos/events.h @@ -11,10 +11,12 @@ typedef u_int32_t KeyMap[4]; +#ifdef __mc68000__ static inline void GetKeys(KeyMap theKeys) { asm("move.l %0, -(%%sp)\n" Trap(_GetKeys) :: "g" (theKeys) : "%%d0", UNPRESERVED_REGS ); } +#endif /* __mc68000__ */ #endif /* __MACOS_EVENTS_H__ */ diff --git a/libmacos/macos/files.h b/libmacos/macos/files.h index 409f1de..8ddf2bb 100644 --- a/libmacos/macos/files.h +++ b/libmacos/macos/files.h @@ -107,7 +107,7 @@ struct DrvQEl { typedef struct DrvQEl DrvQEl; typedef DrvQEl * DrvQElPtr; -#ifdef ARCH_M68K +#ifdef __mc68000__ static inline void FInitQueue(void) { asm(Trap(_FInitQueue) ::: "%%d0", UNPRESERVED_REGS); @@ -134,5 +134,5 @@ static inline OSErr PBMountVol(ParmBlkPtr paramBlock) return ret; } -#endif /* ARCH_M68K */ +#endif /* __mc68000__ */ #endif /* __MACOS_FILES_H__ */ diff --git a/libmacos/macos/gestalt.h b/libmacos/macos/gestalt.h index 48204ed..c88f9a5 100644 --- a/libmacos/macos/gestalt.h +++ b/libmacos/macos/gestalt.h @@ -207,7 +207,7 @@ enum { gestaltHasEnhancedLtalk = 30 /* Do we have Enhanced LocalTalk? */ }; -#ifdef ARCH_M68K +#ifdef __mc68000__ static inline OSErr Gestalt(OSType selector, long * response) { register OSErr ret asm("%%d0"); @@ -219,5 +219,5 @@ static inline OSErr Gestalt(OSType selector, long * response) return ret; } -#endif /* ARCH_M68K */ +#endif /* __mc68000__ */ #endif /* __MACOS_GESTALT_H__ */ diff --git a/libmacos/macos/init.h b/libmacos/macos/init.h index 5fb5c90..740ac50 100644 --- a/libmacos/macos/init.h +++ b/libmacos/macos/init.h @@ -9,6 +9,7 @@ #include +#ifdef __mc68000__ statis inline void InitEvents(short CntEvts) { asm("move.l %0, %%d0\n" @@ -22,4 +23,5 @@ static inline void InitFS(short CntFCBs) Trap(_InitFs) :: "g" (CntFCBs) : "%%d0", UNPRESERVED_REGS); } +#endif /* __mc68000__ */ #endif /* __MACOS_INIT_H__ */ diff --git a/libmacos/macos/memory.h b/libmacos/macos/memory.h index a054954..37289b2 100644 --- a/libmacos/macos/memory.h +++ b/libmacos/macos/memory.h @@ -9,6 +9,7 @@ #include +#ifdef __mc68000__ static inline void DisposePtr(void* ptr) { asm("move.l %0, %%a0\n" @@ -27,4 +28,5 @@ static inline void* NewPtr(unsigned long byteCount) return ptr; } +#endif /* __mc68000__ */ #endif /* __MACOS_MEMORY_H__ */ diff --git a/libmacos/macos/osutils.h b/libmacos/macos/osutils.h index bb09f80..6ab8d92 100644 --- a/libmacos/macos/osutils.h +++ b/libmacos/macos/osutils.h @@ -30,10 +30,12 @@ struct MachineLocation }; typedef struct MachineLocation MachineLocation; +#ifdef __mc68000__ static inline void ReadLocation(MachineLocation * loc) { asm("move.l %0, %%a0\n" XPRam(_ReadLocation) :: "g" (loc) : "%%d0", UNPRESERVED_REGS); } +#endif /* __mc68000__ */ #endif /* __MACOS_OSUTILS_H__ */ diff --git a/libmacos/macos/quickdraw.h b/libmacos/macos/quickdraw.h index 1e6f202..ba95fed 100644 --- a/libmacos/macos/quickdraw.h +++ b/libmacos/macos/quickdraw.h @@ -54,6 +54,7 @@ typedef struct QDGlobals QDGlobals; typedef struct QDGlobals* QDGlobalsPtr; typedef struct QDGlobalsPtr* QDGlobalsHandle; +#ifdef __mc68000__ static inline void InitGraf(void * port) { asm("move.l %0, -(%%sp)\n" @@ -61,4 +62,5 @@ static inline void InitGraf(void * port) " addq.l #4, %%sp" :: "g" (port) : "%%d0", UNPRESERVED_REGS); } +#endif /* __mc68000__ */ #endif /* __MACOS_QUICKDRAW_H__ */ diff --git a/libmacos/macos/scsi.h b/libmacos/macos/scsi.h index d21b685..51845f5 100644 --- a/libmacos/macos/scsi.h +++ b/libmacos/macos/scsi.h @@ -41,6 +41,7 @@ typedef struct TIB { /* Transfer Instruction Block */ int param2; /* 2nd parameter */ } __attribute__((packed)) TIB_t; +#ifdef __mc68000__ static inline OSErr SCSICmd(void* buffer, short count) { register OSErr ret asm("%%d0"); @@ -126,4 +127,5 @@ static inline OSErr SCSIStat(void) return ret; } +#endif /* __mc68000__ */ #endif /* __MACOS_SCSI_H__ */ diff --git a/libmacos/macos/slotmanager.h b/libmacos/macos/slotmanager.h index 5983899..6c636f6 100644 --- a/libmacos/macos/slotmanager.h +++ b/libmacos/macos/slotmanager.h @@ -53,6 +53,7 @@ enum { /* flags for spParamData */ fnext = 2, }; +#ifdef __mc68000__ static inline OSErr SGetCString(SpBlockPtr spBlkPtr) { register OSErr ret asm("%%d0"); @@ -85,4 +86,5 @@ static inline OSErr SRsrcInfo(SpBlockPtr spBlkPtr) return ret; } +#endif /* __mc68000__ */ #endif /* __MACOS_SLOTMANAGER_H__ */