#ifndef CLIB_POWERPC_SPROTOS_H
#define CLIB_POWERPC_SPROTOS_H

#ifndef UTILITY_TAGITEM_H
#include <utility/tagitem.h>
#endif

#ifndef DEVICES_TIMER_H
#include <devices/timer.h>
#endif

#ifndef POWERPC_PORTSPPC_H
#include <powerpc/portsPPC.h>
#endif

#ifndef POWERPC_TASKS_H
#include <powerpc/tasksppc.h>
#endif

#ifndef POWERPC_SEMAPHORES_H
#include <powerpc/semaphoresppc.h>
#endif

#ifndef POWERPC_POWERPC_H
#include <powerpc/powerpc.h>
#endif

#ifdef __PPC__

#ifdef __cplusplus
#define POWERPC_SPROTOS_CPP
#else
#pragma +
#endif

/*
Attention: The names for this PPC functions (all have a suffix "_"
           are subject to change. As soon as the StormC PPC compiler
           is able to add the "struct Library *" by default for
           shared library functions the names will loose the suffix.

           Please use the __inline functions from the end of this file.

        Ok, the Problem with the "_" in the definition has been
        solved by overloading the names. Works only for a C++ Compiler.
        M.Rock, 10.3.1998
*/

extern "library=PowerPCBase" {

        /* *** call 68K */
        ULONG Run68K(struct Library *, struct PPCArgs *) ;
        ULONG WaitFor68K(struct Library *, struct PPCArgs *) ;

        /* *** debugging */
        VOID SPrintF(struct Library *, STRPTR, APTR) ;

        /* *** memory */
        APTR AllocVecPPC(struct Library *, ULONG, ULONG, ULONG) ;
        LONG FreeVecPPC(struct Library *, APTR) ;

        /* *** time measurement */
        VOID GetSysTimePPC(struct Library*, struct timeval *) ;
        VOID AddTimePPC(struct Library*, struct timeval *, struct timeval *) ;
        VOID SubTimePPC(struct Library*, struct timeval *, struct timeval *) ;
        LONG CmpTimePPC(struct Library*, struct timeval *, struct timeval *) ;

#ifndef POWERPCLIB_V7
        /* *** more debugging */
        ULONG SnoopTask(struct Library *, struct TagItem *) ;
        VOID EndSnoopTask(struct Library *, ULONG) ;

        /* *** more memory */
        VOID FreeAllMem(struct Library *) ;
        VOID CopyMemPPC(struct Library *, APTR, APTR, ULONG) ;
	VOID* CreatePPoolPPC(struct Library *,ULONG, ULONG, ULONG);
	VOID DeletePoolPPC(struct Library *,VOID*);
	VOID* AllocPooledPPC(struct Library *,VOID*,ULONG);
	VOID FreePooledPPC(struct Library *,VOID*, VOID*, ULONG);	

        /* *** lists */
        VOID AddHeadPPC(struct Library *, struct List *, struct Node *) ;
        VOID AddTailPPC(struct Library *, struct List *, struct Node *) ;
        VOID EnqueuePPC(struct Library *, struct List *, struct Node *) ;
        struct Node *FindNamePPC(struct Library *, struct List *, STRPTR) ;
        VOID InsertPPC(struct Library *, struct Node *, struct Node *) ;
        struct Node *RemHeadPPC(struct Library *, struct List *) ;
        VOID RemovePPC(struct Library *, struct Node *) ;
        struct Node *RemTailPPC(struct Library *, struct Node *) ;
	VOID NewListPPC(struct Library *,struct List *);

        /* *** semaphores */
        VOID AddSemaphorePPC(struct Library *, struct SignalSemaphorePPC *) ;
        LONG AttemptSemaphorePPC(struct Library *, struct SignalSemaphorePPC *) ;
        struct SignalSemaphorePPC *FindSemaphorePPC(struct Library *, STRPTR) ;
        VOID FreeSemaphorePPC(struct Library *, struct SignalSemaphorePPC *) ;
        LONG InitSemaphorePPC(struct Library *, struct SignalSemaphorePPC *) ;
        VOID ObtainSemaphorePPC(struct Library *, struct SignalSemaphorePPC *) ;
        VOID ReleaseSemaphorePPC(struct Library *, struct SignalSemaphorePPC *) ;
        VOID RemSemaphorePPC(struct Library *, struct SignalSemaphorePPC *) ;
	LONG TrySemaphorePPC(struct Library *,struct SignalSemaphorePPC *, ULONG);
	VOID ObtainSemaphoreSharedPPC(struct Library *,struct SignalSemaphorePPC *);
	LONG AttemptSemaphoreSharedPPC(struct Library *,struct SignalSemaphorePPC *);
	VOID ProcurePPC(struct Library *,struct SignalSemaphorePPC *, struct SemaphoreMessage *);
	VOID VacatePPC(struct Library *,struct SignalSemaphorePPC *, struct SemaphoreMessage *);
	LONG AddUniqueSemaphorePPC(struct Library *,struct SignalSemaphorePPC *);


        /* *** signals */
        LONG AllocSignalPPC(struct Library *, LONG) ;
        VOID FreeSignalPPC(struct Library *, LONG) ;
        ULONG SetSignalPPC(struct Library *, ULONG, ULONG) ;
        VOID SignalPPC(struct Library *, struct TaskPPC *, ULONG) ;
        ULONG WaitPPC(struct Library *, ULONG) ;
        ULONG WaitTime(struct Library *, ULONG, ULONG) ;
	ULONG SetExceptPPC(struct Library *,ULONG,ULONG,ULONG);

        /* *** tasks */
        struct TaskPPC *CreateTaskPPC(struct Library *, struct TagItem *) ;
        VOID DeleteTaskPPC(struct Library *, struct TaskPPC *) ;
        struct TaskPPC *FindTaskPPC(struct Library *, STRPTR) ;
        struct TaskPtr *LockTaskList(struct Library *) ;
        LONG SetTaskPriPPC(struct Library *, struct TaskPPC *, LONG) ;
        VOID UnLockTaskList(struct Library *) ;
        struct TaskPPC *FindTaskByID(struct Library *, LONG) ;
        LONG SetNiceValue(struct Library *, struct TaskPPC *, LONG) ;

        /* *** ports */
        VOID AddPortPPC(struct Library *, struct MsgPortPPC *) ;
        struct MsgPortPPC *CreateMsgPortPPC(struct Library *) ;
        VOID DeleteMsgPortPPC(struct Library *, struct MsgPortPPC *) ;
        struct MsgPortPPC *FindPortPPC(struct Library *, STRPTR) ;
        struct Message *GetMsgPPC(struct Library *, struct MsgPortPPC *) ;
        VOID PutMsgPPC(struct Library *, struct MsgPortPPC *, struct Message *) ;
        struct Message *WaitPortPPC(struct Library *, struct MsgPortPPC *) ;
        VOID RemPortPPC(struct Library *, struct MsgPortPPC *) ;
        VOID ReplyMsgPPC(struct Library *, struct Message *) ;
        struct Message *AllocXMsgPPC(struct Library *, ULONG, struct MsgPortPPC *) ;
        VOID FreeXMsgPPC(struct Library *, struct Message *) ;
        VOID PutXMsgPPC(struct Library *, struct MsgPort *, struct Message *) ;
        struct MsgPortPPC *SetReplyPortPPC(struct Library *, struct Message *, struct MsgPortPPC *) ;
	LONG PutPublicMsgPPC(struct Library *,STRPTR, struct Message *);
	LONG AddUniquePortPPC(struct Library *,struct MsgPortPPC *);


        /* *** tag items */
        struct TagItem *FindTagItemPPC(struct Library *, ULONG, struct TagItem *) ;
        ULONG GetTagDataPPC(struct Library *, ULONG, ULONG, struct TagItem *) ;
        struct TagItem *NextTagItemPPC(struct Library *, struct TagItem **) ;

        /* *** hardware */
        VOID ChangeMMU(struct Library *, ULONG) ;
        VOID GetInfo(struct Library *, struct TagItem *) ;
        VOID SetCache(struct Library *, ULONG, APTR, ULONG) ;
        ULONG SetHardware(struct Library *, ULONG, APTR) ;
        VOID GetHALInfo(struct Library *, struct TagItem *) ;
        VOID SetScheduling(struct Library *, struct TagItem *) ;

        /* *** exceptions */
        VOID ModifyFPExc(struct Library *, ULONG) ;
        VOID RemExcHandler(struct Library *, APTR) ;
        APTR SetExcHandler(struct Library *, struct TagItem *) ;
        VOID SetExcMMU(struct Library *) ;
        VOID ClearExcMMU(struct Library *) ;
	VOID CauseInterrupt(struct Library *);
	BOOL IsExceptionMode(struct Library *);


        /* *** supervisor */
        ULONG Super(struct Library *) ;
        VOID User(struct Library *, ULONG) ;

        /* *** 68K connection */
        VOID Signal68K(struct Library *, struct Task *, ULONG) ;

	APTR RawDoFmtPPC(struct Library *,STRPTR, APTR, void (*)(void), APTR);


#endif /* POWERPCLIB_V7 */
};

__inline ULONG Run68K(struct PPCArgs *a1)
{
        extern struct Library *PowerPCBase;
        return Run68K(PowerPCBase,a1);
}
__inline ULONG WaitFor68K(struct PPCArgs *a1)
{
        extern struct Library *PowerPCBase;
        return WaitFor68K(PowerPCBase,a1);
}
__inline VOID SPrintF(STRPTR a1, APTR a2)
{
        extern struct Library *PowerPCBase;
        SPrintF(PowerPCBase,a1,a2);
}
__inline APTR AllocVecPPC(ULONG a1, ULONG a2, ULONG a3)
{
        extern struct Library *PowerPCBase;
        return AllocVecPPC(PowerPCBase,a1,a2,a3);
}
__inline VOID GetSysTimePPC(struct timeval *a1)
{
        extern struct Library *PowerPCBase;
        GetSysTimePPC(PowerPCBase,a1);
}

__inline VOID AddTimePPC(struct timeval *a1, struct timeval *a2)
{
        extern struct Library *PowerPCBase;
        AddTimePPC(PowerPCBase,a1,a2);
}

__inline VOID SubTimePPC(struct timeval *a1, struct timeval *a2)
{
        extern struct Library *PowerPCBase;
        SubTimePPC(PowerPCBase,a1,a2);
}

__inline LONG CmpTimePPC(struct timeval *a1, struct timeval *a2)
{
        extern struct Library *PowerPCBase;
        return CmpTimePPC(PowerPCBase,a1,a2);
}

__inline VOID FreeVecPPC(APTR a1)
{
        extern struct Library *PowerPCBase;
        FreeVecPPC(PowerPCBase,a1);
}

#ifndef POWERPCLIB_V7
__inline ULONG SnoopTask(struct TagItem *a1)
{
        extern struct Library *PowerPCBase;
        return SnoopTask(PowerPCBase,a1);
}
__inline ULONG SnoopTaskTags(Tag tag1, ...)
{
        extern struct Library *PowerPCBase;
        return SnoopTask(PowerPCBase,(struct TagItem *) &tag1);
}
__inline VOID EndSnoopTask(ULONG a1)
{
        extern struct Library *PowerPCBase;
        EndSnoopTask(PowerPCBase,a1);
}
__inline VOID FreeAllMem()
{
        extern struct Library *PowerPCBase;
        FreeAllMem(PowerPCBase);
}
__inline VOID CopyMemPPC(APTR a1, APTR a2, ULONG a3)
{
        extern struct Library *PowerPCBase;
        CopyMemPPC(PowerPCBase,a1,a2,a3);
}
__inline VOID *CreatePoolPPC(ULONG a1, ULONG a2, ULONG a3)
{
	extern struct Library *PowerPCBase;
	return CreatePoolPPC(PowerPCBase,a1,a2,a3);
}
__inline VOID DeletePoolPPC(VOID *a1)
{
	extern struct Library *PowerPCBase;
	DeletePoolPPC(PowerPCBase,a1);
}
__inline VOID *AllocPooledPPC(VOID *a1,ULONG a2)
{
	extern struct Library *PowerPCBase;
	return AllocPooledPPC(PowerPCBase,a1,a2);
}
__inline VOID FreePooledPPC(VOID *a1,VOID *a2,ULONG a3)
{
	extern struct Library *PowerPCBase;
	FreePooledPPC(PowerPCBase,a1,a2,a3);
}
__inline VOID AddHeadPPC(struct List *a1, struct Node *a2)
{
        extern struct Library *PowerPCBase;
        AddHeadPPC(PowerPCBase,a1,a2);
}
__inline VOID AddTailPPC(struct List *a1, struct Node *a2)
{
        extern struct Library *PowerPCBase;
        AddTailPPC(PowerPCBase,a1,a2);
}
__inline VOID EnqueuePPC(struct List *a1, struct Node *a2)
{
        extern struct Library *PowerPCBase;
        EnqueuePPC(PowerPCBase,a1,a2);
}
__inline struct Node *FindNamePPC(struct List *a1, STRPTR a2)
{
        extern struct Library *PowerPCBase;
        return FindNamePPC(PowerPCBase,a1,a2);
}
__inline VOID InsertPPC(struct Node *a1, struct Node *a2)
{
        extern struct Library *PowerPCBase;
        InsertPPC(PowerPCBase,a1,a2);
}
__inline struct Node *RemHeadPPC(struct List *a1)
{
        extern struct Library *PowerPCBase;
        return RemHeadPPC(PowerPCBase,a1);
}
__inline VOID RemovePPC(struct Node *a1)
{
        extern struct Library *PowerPCBase;
        RemovePPC(PowerPCBase,a1);
}
__inline struct Node *RemTailPPC(struct Node *a1)
{
        extern struct Library *PowerPCBase;
        return RemTailPPC(PowerPCBase,a1);
}
__inline VOID NewListPPC(struct List *a1)
{
	extern struct Library *PowerPCBase;
	NewListPPC(PowerPCBase,a1);
}
__inline VOID AddSemaphorePPC(struct SignalSemaphorePPC *a1)
{
        extern struct Library *PowerPCBase;
        AddSemaphorePPC(PowerPCBase,a1);
}
__inline LONG AttemptSemaphorePPC(struct SignalSemaphorePPC *a1)
{
        extern struct Library *PowerPCBase;
        return AttemptSemaphorePPC(PowerPCBase,a1);
}
__inline struct SignalSemaphorePPC *FindSemaphorePPC(STRPTR a1)
{
        extern struct Library *PowerPCBase;
        return FindSemaphorePPC(PowerPCBase,a1);
}
__inline VOID FreeSemaphorePPC(struct SignalSemaphorePPC *a1)
{
        extern struct Library *PowerPCBase;
        FreeSemaphorePPC(PowerPCBase,a1);
}
__inline LONG InitSemaphorePPC(struct SignalSemaphorePPC *a1)
{
        extern struct Library *PowerPCBase;
        return InitSemaphorePPC(PowerPCBase,a1);
}
__inline VOID ObtainSemaphorePPC(struct SignalSemaphorePPC *a1)
{
        extern struct Library *PowerPCBase;
        ObtainSemaphorePPC(PowerPCBase,a1);
}
__inline VOID ReleaseSemaphorePPC(struct SignalSemaphorePPC *a1)
{
        extern struct Library *PowerPCBase;
        ReleaseSemaphorePPC(PowerPCBase,a1);
}
__inline VOID RemSemaphorePPC(struct SignalSemaphorePPC *a1)
{
        extern struct Library *PowerPCBase;
        RemSemaphorePPC(PowerPCBase,a1);
}
__inline LONG TrySemaphorePPC(struct SignalSemaphorePPC *a1,ULONG a2)
{
	extern struct Library *PowerPCBase;
	return TrySemaphorePPC(PowerPCBase,a1,a2);
}
__inline VOID ObtainSemaphoreSharedPPC(struct SignalSemaphorePPC *a1)
{
	extern struct Library *PowerPCBase;
	ObtainSemaphoreSharedPPC(PowerPCBase,a1);
}
__inline LONG AttemptSemaphoreSharedPPC(struct SignalSemaphorePPC *a1)
{
	extern struct Library *PowerPCBase;
	return AttemptSemaphoreSharedPPC(PowerPCBase,a1);
}
__inline VOID ProcurePPC(struct SignalSemaphorePPC *a1,struct SemaphoreMessage *a2)
{
	extern struct Library *PowerPCBase;
	ProcurePPC(PowerPCBase,a1,a2);
}
__inline VOID VacatePPC(struct SignalSemaphorePPC *a1,struct SemaphoreMessage *a2)
{
	extern struct Library *PowerPCBase;
	VacatePPC(PowerPCBase,a1,a2);
}
__inline LONG AddUniqueSemaphorePPC(struct SignalSemaphorePPC *a1)
{
	extern struct Library *PowerPCBase;
	return AddUniqueSemaphorePPC(PowerPCBase,a1);
}
__inline LONG AllocSignalPPC(LONG a1)
{
        extern struct Library *PowerPCBase;
        return AllocSignalPPC(PowerPCBase,a1);
}
__inline VOID FreeSignalPPC(LONG a1)
{
        extern struct Library *PowerPCBase;
        FreeSignalPPC(PowerPCBase,a1);
}
__inline ULONG SetSignalPPC(ULONG a1, ULONG a2)
{
        extern struct Library *PowerPCBase;
        return SetSignalPPC(PowerPCBase,a1,a2);
}
__inline VOID SignalPPC(struct TaskPPC *a1, ULONG a2)
{
        extern struct Library *PowerPCBase;
        SignalPPC(PowerPCBase,a1,a2);
}
__inline ULONG WaitPPC(ULONG a1)
{
        extern struct Library *PowerPCBase;
        return WaitPPC(PowerPCBase,a1);
}
__inline ULONG WaitTime(ULONG a1, ULONG a2)
{
        extern struct Library *PowerPCBase;
        return WaitTime(PowerPCBase,a1,a2);
}
__inline ULONG SetExceptPPC(ULONG a1, ULONG a2, ULONG a3)
{
	extern struct Library *PowerPCBase;
	return SetExceptPPC(PowerPCBase,a1,a2,a3);
}
__inline struct TaskPPC *CreateTaskPPC(struct TagItem *a1)
{
        extern struct Library *PowerPCBase;
        return CreateTaskPPC(PowerPCBase,a1);
}
__inline struct TaskPPC *CreateTaskPPCTags(Tag tag1, ...)
{
        extern struct Library *PowerPCBase;
        return CreateTaskPPC(PowerPCBase,(struct TagItem *) &tag1);
}
__inline VOID DeleteTaskPPC(struct TaskPPC *a1)
{
        extern struct Library *PowerPCBase;
        DeleteTaskPPC(PowerPCBase,a1);
}
__inline struct TaskPPC *FindTaskPPC(STRPTR a1)
{
        extern struct Library *PowerPCBase;
        return FindTaskPPC(PowerPCBase,a1);
}
__inline struct TaskPtr *LockTaskList()
{
        extern struct Library *PowerPCBase;
        return LockTaskList(PowerPCBase);
}
__inline LONG SetTaskPriPPC(struct TaskPPC *a1, LONG a2)
{
        extern struct Library *PowerPCBase;
        return SetTaskPriPPC(PowerPCBase,a1,a2);
}
__inline VOID UnLockTaskList()
{
        extern struct Library *PowerPCBase;
        UnLockTaskList(PowerPCBase);
}
__inline struct TaskPPC *FindTaskByID(LONG a1)
{
        extern struct Library *PowerPCBase;
        return FindTaskByID(PowerPCBase,a1);
}
__inline LONG SetNiceValue(struct TaskPPC *a1, LONG a2)
{
        extern struct Library *PowerPCBase;
        return SetNiceValue(PowerPCBase,a1,a2);
}
__inline VOID AddPortPPC(struct MsgPortPPC *a1)
{
        extern struct Library *PowerPCBase;
        AddPortPPC(PowerPCBase,a1);
}
__inline struct MsgPortPPC *CreateMsgPortPPC()
{
        extern struct Library *PowerPCBase;
        return CreateMsgPortPPC(PowerPCBase);
}
__inline VOID DeleteMsgPortPPC(struct MsgPortPPC *a1)
{
        extern struct Library *PowerPCBase;
        DeleteMsgPortPPC(PowerPCBase,a1);
}
__inline struct MsgPortPPC *FindPortPPC(STRPTR a1)
{
        extern struct Library *PowerPCBase;
        return FindPortPPC(PowerPCBase,a1);
}
__inline struct Message *GetMsgPPC(struct MsgPortPPC *a1)
{
        extern struct Library *PowerPCBase;
        return GetMsgPPC(PowerPCBase,a1);
}
__inline VOID PutMsgPPC(struct MsgPortPPC *a1, struct Message *a2)
{
        extern struct Library *PowerPCBase;
        PutMsgPPC(PowerPCBase,a1,a2);
}
__inline struct Message *WaitPortPPC(struct MsgPortPPC *a1)
{
	extern struct Library *PowerPCBase;
	return WaitPortPPC(PowerPCBase,a1);
}
__inline VOID RemPortPPC(struct MsgPortPPC *a1)
{
        extern struct Library *PowerPCBase;
        RemPortPPC(PowerPCBase,a1);
}
__inline VOID ReplyMsgPPC(struct Message *a1)
{
        extern struct Library *PowerPCBase;
        ReplyMsgPPC(PowerPCBase,a1);
}
__inline struct Message *AllocXMsgPPC(ULONG a1, struct MsgPortPPC *a2)
{
        extern struct Library *PowerPCBase;
        return AllocXMsgPPC(PowerPCBase,a1,a2);
}
__inline VOID FreeXMsgPPC(struct Message *a1)
{
        extern struct Library *PowerPCBase;
        FreeXMsgPPC(PowerPCBase,a1);
}
__inline VOID PutXMsgPPC(struct MsgPort *a1, struct Message *a2)
{
        extern struct Library *PowerPCBase;
        PutXMsgPPC(PowerPCBase,a1,a2);
}
__inline struct MsgPortPPC *SetReplyPortPPC(struct Message *a1, struct MsgPortPPC *a2)
{
        extern struct Library *PowerPCBase;
        return SetReplyPortPPC(PowerPCBase,a1,a2);
}
__inline LONG PutPublicMsgPPC(STRPTR a1, struct Message *a2)
{
	extern struct Library *PowerPCBase;
	return PutPublicMsgPPC(PowerPCBase,a1,a2);
}
__inline LONG AddUniquePortPPC(struct MsgPortPPC *a1)
{
	extern struct Library *PowerPCBase;
	return AddUniquePortPPC(PowerPCBase,a1);
}
__inline struct TagItem *FindTagItemPPC(ULONG a1, struct TagItem *a2)
{
        extern struct Library *PowerPCBase;
        return FindTagItemPPC(PowerPCBase,a1,a2);
}
__inline ULONG GetTagDataPPC(ULONG a1, ULONG a2, struct TagItem *a3)
{
        extern struct Library *PowerPCBase;
        return GetTagDataPPC(PowerPCBase,a1,a2,a3);
}
__inline struct TagItem *NextTagItemPPC(struct TagItem **a1)
{
        extern struct Library *PowerPCBase;
        return NextTagItemPPC(PowerPCBase,a1);
}
__inline VOID ChangeMMU(ULONG a1)
{
        extern struct Library *PowerPCBase;
        ChangeMMU(PowerPCBase,a1);
}
__inline VOID GetInfo(struct TagItem *a1)
{
        extern struct Library *PowerPCBase;
        GetInfo(PowerPCBase,a1);
}
__inline VOID SetCache(ULONG a1, APTR a2, ULONG a3)
{
        extern struct Library *PowerPCBase;
        SetCache(PowerPCBase,a1,a2,a3);
}
__inline ULONG SetHardware(ULONG a1, APTR a2)
{
        extern struct Library *PowerPCBase;
        return SetHardware(PowerPCBase,a1,a2);
}
__inline VOID GetHALInfo(struct TagItem *a1)
{
        extern struct Library *PowerPCBase;
        GetHALInfo(PowerPCBase,a1);
}
__inline VOID SetScheduling(struct TagItem *a1)
{
        extern struct Library *PowerPCBase;
        SetScheduling(PowerPCBase,a1);
}
__inline VOID ModifyFPExc(ULONG a1)
{
        extern struct Library *PowerPCBase;
        ModifyFPExc(PowerPCBase,a1);
}
__inline VOID RemExcHandler(APTR a1)
{
        extern struct Library *PowerPCBase;
        RemExcHandler(PowerPCBase,a1);
}
__inline APTR SetExcHandler(struct TagItem *a1)
{
        extern struct Library *PowerPCBase;
        return SetExcHandler(PowerPCBase,a1);
}
__inline APTR SetExcHandlerTags(Tag tag1, ...)
{
        extern struct Library *PowerPCBase;
        return SetExcHandler(PowerPCBase,(struct TagItem *) &tag1);
}
__inline VOID SetExcMMU()
{
        extern struct Library *PowerPCBase;
        SetExcMMU(PowerPCBase);
}
__inline VOID ClearExcMMU()
{
        extern struct Library *PowerPCBase;
        ClearExcMMU(PowerPCBase);
}
__inline VOID CauseInterrupt()
{
	extern struct Library *PowerPCBase;
	CauseInterrupt(PowerPCBase);
}
__inline BOOL IsExceptionMode()
{
	extern struct Library *PowerPCBase;
	return IsExceptionMode(PowerPCBase);
}
__inline ULONG Super()
{
        extern struct Library *PowerPCBase;
        return Super(PowerPCBase);
}
__inline VOID User(ULONG a1)
{
        extern struct Library *PowerPCBase;
        User(PowerPCBase,a1);
}
__inline VOID Signal68K(struct Task *a1, ULONG a2)
{
        extern struct Library *PowerPCBase;
        Signal68K(PowerPCBase,a1,a2);
}
__inline APTR RawDoFmtPPC(STRPTR a1,APTR a2, void (*)(void) a3, APTR a4)
{
	extern struct Library *PowerPCBase;
	return RawDoFmtPPC(PowerPCBase,a1,a2,a3,a4);
}
#endif /* POWERPCLIB_V7 */

#ifndef POWERPC_SPROTOS_CPP
#pragma -
#endif

#else

#ifdef __cplusplus
extern "C" {
#endif

/* *** ppc call */
ULONG RunPPC(struct PPCArgs *);
ULONG WaitForPPC(struct PPCArgs *);
struct TaskPPC *CreatePPCTask(struct TagItem *);
struct TaskPPC *CreatePPCTaskTags(Tag tag1, ...);

/* *** hardware */
ULONG GetCPU(VOID);
void SetCache68K(ULONG,void *,ULONG);
void CausePPCInterrupt(VOID);

/* *** debugging */
VOID PowerDebugMode(ULONG);
VOID SPrintF68K(STRPTR,APTR);

/* *** memory */
APTR AllocVec32(ULONG,ULONG);
VOID FreeVec32(APTR);

/* *** general information */
ULONG GetPPCState(VOID);

#ifndef POWERPCLIB_V7

/* *** ports */
struct Message *AllocXMsg(ULONG,struct MsgPort *);
VOID FreeXMsg(struct Message *);
VOID PutXMsg(struct MsgPortPPC *, struct Message *);

#endif /* POWERPCLIB_V7 */

#ifdef __cplusplus
};
#endif

#ifdef STORMPRAGMAS
#ifndef _INCLUDE_PRAGMA_POWERPC_LIB_H
#include <pragma/powerpc_lib.h>
#endif
#endif

#endif /* __PPC__ */

#endif /* STORMPROTOS_POWERPC_SPROTOS_H */
