Diff for /src/sys/dev/disk/ata/ata-dma.c between versions 1.5 and 1.6

version 1.5, 2003/11/26 14:24:46 version 1.6, 2003/11/30 20:14:18
Line 34 Line 34
 #include <sys/ata.h>  #include <sys/ata.h>
 #include <sys/buf.h>  #include <sys/buf.h>
 #include <sys/malloc.h>   #include <sys/malloc.h> 
   #include <sys/mpipe.h> 
 #include <sys/bus.h>  #include <sys/bus.h>
 #include <sys/disk.h>  #include <sys/disk.h>
 #include <sys/devicestat.h>  #include <sys/devicestat.h>
Line 60  static int hpt_cable80(struct ata_channe Line 61  static int hpt_cable80(struct ata_channe
          (device == ATA_SLAVE && ch->devices & ATA_ATAPI_SLAVE))           (device == ATA_SLAVE && ch->devices & ATA_ATAPI_SLAVE))
   
 void *  void *
ata_dmaalloc(struct ata_channel *ch, int device)ata_dmaalloc(struct ata_channel *ch, int device, int flags)
 {  {
     void *dmatab;      void *dmatab;
   
    if ((dmatab = malloc(PAGE_SIZE, M_DEVBUF, M_NOWAIT))) {    KKASSERT(ch->dma_mpipe.max_count != 0);
        if (((uintptr_t)dmatab >> PAGE_SHIFT) ^    dmatab = mpipe_alloc(&ch->dma_mpipe, flags);
            (((uintptr_t)dmatab + PAGE_SIZE - 1) >> PAGE_SHIFT)) {    KKASSERT(((uintptr_t)dmatab & PAGE_MASK) == 0);
            ata_printf(ch, device, "dmatab crosses page boundary, no DMA\n");    return (dmatab);
            free(dmatab, M_DEVBUF);}
            dmatab = NULL;
        }void
    }ata_dmafree(struct ata_channel *ch, void *dmatab)
    return dmatab;{
     if (dmatab)
         mpipe_free(&ch->dma_mpipe, dmatab);
 }  }
   
 void  void

Removed from v.1.5  
changed lines
  Added in v.1.6