home *** CD-ROM | disk | FTP | other *** search
/ Il CD di internet / CD.iso / SOURCE / KERNEL-S / V1.2 / LINUX-1.2 / LINUX-1 / linux / arch / mips / kernel / tynedma.c < prev    next >
Encoding:
C/C++ Source or Header  |  1995-01-25  |  726 b   |  36 lines

  1. /*
  2.  * Tiny Tyne DMA buffer allocator
  3.  *
  4.  * Copyright (C) 1995 Ralf Baechle
  5.  */
  6. #include <linux/autoconf.h>
  7. #include <linux/types.h>
  8. #include <asm/bootinfo.h>
  9.  
  10. #ifdef CONFIG_DESKSTATION_TYNE
  11.  
  12. static unsigned long allocated;
  13.  
  14. /*
  15.  * Not very sophisticated, but should suffice for now...
  16.  */
  17. unsigned long deskstation_tyne_dma_alloc(size_t size)
  18. {
  19.     unsigned long ret = allocated;
  20.     allocated += size;
  21.     if (allocated > boot_info.dma_cache_size)
  22.         ret = -1;
  23.     return ret;
  24. }
  25.  
  26. void deskstation_tyne_dma_init(void)
  27. {
  28.     if (boot_info.machtype != MACH_DESKSTATION_TYNE)
  29.         return;
  30.     allocated = 0;
  31.     printk ("Deskstation Tyne DMA (%luk) buffer initialized.\n",
  32.             boot_info.dma_cache_size >> 10);
  33. }
  34.  
  35. #endif /* CONFIG_DESKSTATION_TYNE */
  36.