root/arch/mips/kernel/tynedma.c

/* [previous][next][first][last][top][bottom][index][help] */

DEFINITIONS

This source file includes following definitions.
  1. deskstation_tyne_dma_alloc
  2. deskstation_tyne_dma_init

   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)
     /* [previous][next][first][last][top][bottom][index][help] */
  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)
     /* [previous][next][first][last][top][bottom][index][help] */
  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 */

/* [previous][next][first][last][top][bottom][index][help] */