home *** CD-ROM | disk | FTP | other *** search
/ NeXTSTEP 3.2 (Developer) / NS_dev_3.2.iso / NextDeveloper / Headers / bsd / dev / m68k / dma.h < prev    next >
C/C++ Source or Header  |  1993-10-19  |  2KB  |  51 lines

  1. /*    @(#)dma.h    1.0    08/12/87    (c) 1987 NeXT    */
  2.  
  3. /* 
  4.  **********************************************************************
  5.  * HISTORY
  6.  *
  7.  * 26-Sep-89  John Seamons (jks) at NeXT
  8.  *    Made dd_csr in struct dma_dev an int (and changed the corresponding
  9.  *    register #defines) because this register responds as a 32-bit device
  10.  *    and therefore needs to be accessed this way to work on the 68040.
  11.  *
  12.  * 12-Apr-88  John Seamons (jks) at NeXT
  13.  *    Changes to support DMA chip 313.
  14.  *
  15.  * 12-Aug-87  Mike DeMoney (mike) at NeXT
  16.  *    Created.
  17.  *
  18.  **********************************************************************
  19.  */ 
  20.  
  21. /*
  22.  * dma.h -- description of NeXT dma structures
  23.  */
  24.  
  25. #ifndef    _M68K_DEV_DMA_
  26. #define    _M68K_DEV_DMA_
  27.  
  28. #define    MAX_DMA_LEN    (64*1024)    /* max DMA transfer size */
  29. #define    MAX_CHAIN_LEN    (8*1024)    /* max DMA transfer size per chain */
  30.  
  31. #define    DMA_BEGINALIGNMENT    16    /* initial buffer must be on quad 
  32.                      * longword */
  33. #define    DMA_ENDALIGNMENT    16    /* DMA must end on quad longword */
  34. #define    DMA_LONGALIGNMENT    4    /* sound and enet tx channels support 
  35.                      * long alignment */
  36.  
  37. #define    DMA_BEGINALIGN(type, addr)    \
  38.     ((type)(((unsigned)(addr)+DMA_BEGINALIGNMENT-1) \
  39.         &~(DMA_BEGINALIGNMENT-1)))
  40.  
  41. #define    DMA_ENDALIGN(type, addr)    \
  42.     ((type)(((unsigned)(addr)+DMA_ENDALIGNMENT-1) \
  43.         &~(DMA_ENDALIGNMENT-1)))
  44. #define    DMA_BEGINALIGNED(addr)    (((unsigned)(addr)&(DMA_BEGINALIGNMENT-1))==0)
  45. #define    DMA_ENDALIGNED(addr)    (((unsigned)(addr)&(DMA_ENDALIGNMENT-1))==0)
  46. #define    DMA_LONGALIGNED(addr)    (((unsigned)(addr)&(DMA_LONGALIGNMENT-1))==0)
  47.  
  48.  
  49. #endif    _M68K_DEV_DMA_
  50.  
  51.