add #ifdef __mc68000__ for inlined asm functions

This commit is contained in:
Laurent Vivier 2006-12-29 20:27:15 +00:00
parent c70264f609
commit 21ee355ca7
11 changed files with 22 additions and 8 deletions

View File

@ -49,7 +49,7 @@ typedef struct DCtlEntry DCtlEntry;
typedef DCtlEntry * DCtlPtr; typedef DCtlEntry * DCtlPtr;
typedef DCtlPtr * DCtlHandle; typedef DCtlPtr * DCtlHandle;
#ifdef ARCH_M68K #ifdef __mc68000__
static inline OSErr PBCloseSync(ParmBlkPtr paramBlock) static inline OSErr PBCloseSync(ParmBlkPtr paramBlock)
{ {
register OSErr ret asm("%%d0"); register OSErr ret asm("%%d0");
@ -129,5 +129,5 @@ static inline OSErr DrvrRemove(int refNum)
extern OSErr OpenDriver(ConstStr255Param name, short *drvrRefNum); extern OSErr OpenDriver(ConstStr255Param name, short *drvrRefNum);
extern OSErr CloseDriver(short refNum); extern OSErr CloseDriver(short refNum);
extern OSErr SerGetBuf(short refNum, long *count); extern OSErr SerGetBuf(short refNum, long *count);
#endif /* ARCH_M68K */ #endif /* __mc68000__ */
#endif /* __MACOS_DEVICES_H__ */ #endif /* __MACOS_DEVICES_H__ */

View File

@ -34,12 +34,12 @@ enum {
smNoMoresRsrcs = -344, smNoMoresRsrcs = -344,
}; };
#ifdef ARCH_M68K #ifdef __mc68000__
static inline void SysError(short errorCode) static inline void SysError(short errorCode)
{ {
asm("move.l %0, %%d0\n" asm("move.l %0, %%d0\n"
Trap(_SysError) Trap(_SysError)
:: "g" (errorCode) : "%%d0", UNPRESERVED_REGS); :: "g" (errorCode) : "%%d0", UNPRESERVED_REGS);
} }
#endif /* ARCH_M68K */ #endif /* __mc68000__ */
#endif /* __MACOS_ERRORS_H__ */ #endif /* __MACOS_ERRORS_H__ */

View File

@ -11,10 +11,12 @@
typedef u_int32_t KeyMap[4]; typedef u_int32_t KeyMap[4];
#ifdef __mc68000__
static inline void GetKeys(KeyMap theKeys) static inline void GetKeys(KeyMap theKeys)
{ {
asm("move.l %0, -(%%sp)\n" asm("move.l %0, -(%%sp)\n"
Trap(_GetKeys) Trap(_GetKeys)
:: "g" (theKeys) : "%%d0", UNPRESERVED_REGS ); :: "g" (theKeys) : "%%d0", UNPRESERVED_REGS );
} }
#endif /* __mc68000__ */
#endif /* __MACOS_EVENTS_H__ */ #endif /* __MACOS_EVENTS_H__ */

View File

@ -107,7 +107,7 @@ struct DrvQEl {
typedef struct DrvQEl DrvQEl; typedef struct DrvQEl DrvQEl;
typedef DrvQEl * DrvQElPtr; typedef DrvQEl * DrvQElPtr;
#ifdef ARCH_M68K #ifdef __mc68000__
static inline void FInitQueue(void) static inline void FInitQueue(void)
{ {
asm(Trap(_FInitQueue) ::: "%%d0", UNPRESERVED_REGS); asm(Trap(_FInitQueue) ::: "%%d0", UNPRESERVED_REGS);
@ -134,5 +134,5 @@ static inline OSErr PBMountVol(ParmBlkPtr paramBlock)
return ret; return ret;
} }
#endif /* ARCH_M68K */ #endif /* __mc68000__ */
#endif /* __MACOS_FILES_H__ */ #endif /* __MACOS_FILES_H__ */

View File

@ -207,7 +207,7 @@ enum {
gestaltHasEnhancedLtalk = 30 /* Do we have Enhanced LocalTalk? */ gestaltHasEnhancedLtalk = 30 /* Do we have Enhanced LocalTalk? */
}; };
#ifdef ARCH_M68K #ifdef __mc68000__
static inline OSErr Gestalt(OSType selector, long * response) static inline OSErr Gestalt(OSType selector, long * response)
{ {
register OSErr ret asm("%%d0"); register OSErr ret asm("%%d0");
@ -219,5 +219,5 @@ static inline OSErr Gestalt(OSType selector, long * response)
return ret; return ret;
} }
#endif /* ARCH_M68K */ #endif /* __mc68000__ */
#endif /* __MACOS_GESTALT_H__ */ #endif /* __MACOS_GESTALT_H__ */

View File

@ -9,6 +9,7 @@
#include <macos/traps.h> #include <macos/traps.h>
#ifdef __mc68000__
statis inline void InitEvents(short CntEvts) statis inline void InitEvents(short CntEvts)
{ {
asm("move.l %0, %%d0\n" asm("move.l %0, %%d0\n"
@ -22,4 +23,5 @@ static inline void InitFS(short CntFCBs)
Trap(_InitFs) Trap(_InitFs)
:: "g" (CntFCBs) : "%%d0", UNPRESERVED_REGS); :: "g" (CntFCBs) : "%%d0", UNPRESERVED_REGS);
} }
#endif /* __mc68000__ */
#endif /* __MACOS_INIT_H__ */ #endif /* __MACOS_INIT_H__ */

View File

@ -9,6 +9,7 @@
#include <macos/traps.h> #include <macos/traps.h>
#ifdef __mc68000__
static inline void DisposePtr(void* ptr) static inline void DisposePtr(void* ptr)
{ {
asm("move.l %0, %%a0\n" asm("move.l %0, %%a0\n"
@ -27,4 +28,5 @@ static inline void* NewPtr(unsigned long byteCount)
return ptr; return ptr;
} }
#endif /* __mc68000__ */
#endif /* __MACOS_MEMORY_H__ */ #endif /* __MACOS_MEMORY_H__ */

View File

@ -30,10 +30,12 @@ struct MachineLocation
}; };
typedef struct MachineLocation MachineLocation; typedef struct MachineLocation MachineLocation;
#ifdef __mc68000__
static inline void ReadLocation(MachineLocation * loc) static inline void ReadLocation(MachineLocation * loc)
{ {
asm("move.l %0, %%a0\n" asm("move.l %0, %%a0\n"
XPRam(_ReadLocation) XPRam(_ReadLocation)
:: "g" (loc) : "%%d0", UNPRESERVED_REGS); :: "g" (loc) : "%%d0", UNPRESERVED_REGS);
} }
#endif /* __mc68000__ */
#endif /* __MACOS_OSUTILS_H__ */ #endif /* __MACOS_OSUTILS_H__ */

View File

@ -54,6 +54,7 @@ typedef struct QDGlobals QDGlobals;
typedef struct QDGlobals* QDGlobalsPtr; typedef struct QDGlobals* QDGlobalsPtr;
typedef struct QDGlobalsPtr* QDGlobalsHandle; typedef struct QDGlobalsPtr* QDGlobalsHandle;
#ifdef __mc68000__
static inline void InitGraf(void * port) static inline void InitGraf(void * port)
{ {
asm("move.l %0, -(%%sp)\n" asm("move.l %0, -(%%sp)\n"
@ -61,4 +62,5 @@ static inline void InitGraf(void * port)
" addq.l #4, %%sp" " addq.l #4, %%sp"
:: "g" (port) : "%%d0", UNPRESERVED_REGS); :: "g" (port) : "%%d0", UNPRESERVED_REGS);
} }
#endif /* __mc68000__ */
#endif /* __MACOS_QUICKDRAW_H__ */ #endif /* __MACOS_QUICKDRAW_H__ */

View File

@ -41,6 +41,7 @@ typedef struct TIB { /* Transfer Instruction Block */
int param2; /* 2nd parameter */ int param2; /* 2nd parameter */
} __attribute__((packed)) TIB_t; } __attribute__((packed)) TIB_t;
#ifdef __mc68000__
static inline OSErr SCSICmd(void* buffer, short count) static inline OSErr SCSICmd(void* buffer, short count)
{ {
register OSErr ret asm("%%d0"); register OSErr ret asm("%%d0");
@ -126,4 +127,5 @@ static inline OSErr SCSIStat(void)
return ret; return ret;
} }
#endif /* __mc68000__ */
#endif /* __MACOS_SCSI_H__ */ #endif /* __MACOS_SCSI_H__ */

View File

@ -53,6 +53,7 @@ enum { /* flags for spParamData */
fnext = 2, fnext = 2,
}; };
#ifdef __mc68000__
static inline OSErr SGetCString(SpBlockPtr spBlkPtr) static inline OSErr SGetCString(SpBlockPtr spBlkPtr)
{ {
register OSErr ret asm("%%d0"); register OSErr ret asm("%%d0");
@ -85,4 +86,5 @@ static inline OSErr SRsrcInfo(SpBlockPtr spBlkPtr)
return ret; return ret;
} }
#endif /* __mc68000__ */
#endif /* __MACOS_SLOTMANAGER_H__ */ #endif /* __MACOS_SLOTMANAGER_H__ */