diff --git a/libmacos/macos/devices.h b/libmacos/macos/devices.h index 7434944..7a02963 100644 --- a/libmacos/macos/devices.h +++ b/libmacos/macos/devices.h @@ -116,6 +116,16 @@ static inline OSErr PBWriteSync(ParamBlockRec_t* paramBlock) return ret; } +static inline OSErr DrvrRemove(int refNum) +{ + register OSErr ret asm("%%d0"); + asm("move.l %1, %%d0\n" + Trap(_DrvrRemove) + : "=d" (ret) : "g" (refNum) : UNPRESERVED_REGS); + + return ret; +} + extern OSErr OpenDriver(ConstStr255Param name, short *drvrRefNum); extern OSErr CloseDriver(short refNum); extern OSErr SerGetBuf(short refNum, long *count); diff --git a/libmacos/macos/traps.h b/libmacos/macos/traps.h index 6d126eb..fd9c6a3 100644 --- a/libmacos/macos/traps.h +++ b/libmacos/macos/traps.h @@ -23,6 +23,7 @@ #define _PBReadSync 0xA002 #define _PBWriteSync 0xA003 #define _PBStatusSync 0xA005 +#define _DvrRemove 0xA03E #define _ReadXPRam 0xA051 #define _SlotManager 0xA06E #define _SCSIDispatch 0xA815