/*
*    DivaPC ARM C source
*
*    SYS.H.TRANSFER  - Header for direct data-transfer routines
*
*    03-05-96 INH  Original
*
*    This is the only place in the system where CPU module functions
*      are exported directly to other devices. All other such functions
*      are indirected via a pointer in SYS_State and a stub function in
*      SYS.H.SYS. Routines should be placed in here only if they want to
*      be made unavailable to device modules through SYS_State, e.g. for
*      reasons of documentation or likeliness to change. It is recommended
*      that nothing actually relies on these routines, and can work without
*      them (albeit slowly) if necessary.
*
*/

/* Shared-memory allocator */
/* To alloc shared memory, fill in 'len' with the desired length of the
   block, call CPU_AllocSharedMem, and it will fill in ARMaddr and PCaddr.
   Returns true if it works */

struct SharedMem
{
  BYTE *ARMaddr;
  uint  PCaddr;
  uint  length;
};


/* #define NO_TRANSFER_FNS if these functions aren't available to you */

#ifdef NO_TRANSFER_FNS
#define CPU_BlockIn(a,b,c)    0
#define CPU_BlockOut(a,b,c)   0
#define CPU_AllocSharedMem(a) false
#else
extern int CPU_BlockIn  ( int IOaddr, BYTE *buf, int maxlen );
extern int CPU_BlockOut ( int IOaddr, BYTE *buf, int maxlen );
extern bool CPU_AllocSharedMem ( struct SharedMem *pSM );
#endif



