/* ps_dmac.h
 *
 * DMA Control Function
 *
 * $Header: /smsa/bsd:include/dev/ps_dmac.h:bsd  1.4  $
 * $Source: /smsa/bsd:include/dev/ps_dmac.h: $
 *
 * Copyright (c) 1989 Acorn Computers Ltd., Cambridge, England
 */

#ifndef __dev_ps_dmac_h
#define __dev_ps_dmac_h

/*
 * Podule RAM
 * There is 64K of Podule RAM, accessible to the ARM in 4K pages. Thus there
 * are 16 seperate pages. An attempt is made to reserve a page per active device;
 * this is so that any command for that device may automatically find RAM
 * available to it. Any remaining RAM is kept as FREE; it may be used during
 * the duration of a command if extra RAM would be useful.
 */

/* flags for the Status word */
#define D_DMAC_IDLE              (1<<0)
#define D_AUTO_INIT              (1<<1)
#define D_READING                (1<<2)
#define D_INITIALISED            (1<<3)
#define D_JUNK                   (1<<4)
#define D_WRITING                (1<<5)

/* Flags for the Podule RAM Handler */
#define R_FREE                   (1<<0)
#define R_FULL                   (1<<1)

#define S_INVALID          (SCSI_PAGES)
#define OFFSET_SHIFT               (16)

/* Podule RAM Administration Interface */

extern int get_buffer( /* SCSI_System *, SCSI_Transfer *, int n */);
extern int dump_buffer( /* SCSI_System *, SCSI_Transfer * */ );
extern int free_buffer( /* SCSI_System *, SCSI_Transfer * */ );

extern void initialise_dmac( /* SCSI_System *, SCSI_Transfer */ );
extern void buffer_filled( /* SCSI_System *, SCSI_Transfer * */ );


/* DMA Control Functional Interface */

extern void initialise_dmac( /* SCSI_System, SCSI_Transfer */ );
extern void reset_dmac( /* SCSI_System */ );
extern void start_dmac( /* SCSI_System, rw */ );
extern void stop_dmac( /* SCSI_System */ );

extern void dmac_irq( /* podule */ );

#endif/*__dev_ps_dmac_h*/

/* EOF ps_dmac.h */
