home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 15 / 15.iso / s / s053 / 8.ddi / usr / include / sys / kmem.h < prev    next >
Encoding:
C/C++ Source or Header  |  1990-12-08  |  1.6 KB  |  59 lines

  1. /*    Copyright (c) 1990 UNIX System Laboratories, Inc.    */
  2. /*    Copyright (c) 1984, 1986, 1987, 1988, 1989, 1990 AT&T    */
  3. /*      All Rights Reserved      */
  4.  
  5. /*    THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF         */
  6. /*    UNIX System Laboratories, Inc.                         */
  7. /*    The copyright notice above does not evidence any       */
  8. /*    actual or intended publication of such source code.    */
  9.  
  10. #ifndef _SYS_KMEM_H
  11. #define _SYS_KMEM_H
  12.  
  13. #ident    "@(#)/usr/include/sys/kmem.h.sl 1.1 4.0 12/08/90 62799 AT&T-USL"
  14.  
  15. /*
  16.  *    public definitions for kernel memory allocator
  17.  */
  18.  
  19.  
  20. /*
  21.  * KM_SLEEP -- can sleep to get memory.
  22.  * KM_NOSLEEP -- cannot sleep to get memory. *MUST* agree
  23.  *            with NOSLEEP as defined in sys/immu.h
  24.  * KM_NO_DMA -- By default, the seg_kmem segment driver will return DMA able
  25.  *        pages. Since we do not want to penalize the KM allocator and
  26.  *        other guys that rely on seg_kmem segment driver - we specify
  27.  *        that they need not worry about DMAable pages.
  28.  */
  29. #define    KM_SLEEP    0
  30. #define    KM_NOSLEEP    1
  31. #define    KM_NO_DMA    2
  32.  
  33.  
  34. /* function declarations */
  35.  
  36. #if defined(__STDC__)
  37.  
  38. extern void kmem_init(void);
  39. extern _VOID * kmem_alloc(size_t, int);
  40. extern _VOID * kmem_zalloc(size_t, int);
  41. extern _VOID * kmem_fast_alloc(caddr_t *, size_t, int, int);
  42. extern _VOID * kmem_fast_zalloc(caddr_t *, size_t, int, int);
  43. extern void kmem_free(_VOID *, size_t);
  44. extern void kmem_fast_free(caddr_t *, caddr_t);
  45.  
  46. #else
  47.  
  48. extern void kmem_init();
  49. extern _VOID *kmem_alloc();
  50. extern _VOID *kmem_zalloc();
  51. extern _VOID *kmem_fast_alloc();
  52. extern _VOID *kmem_fast_zalloc();
  53. extern void kmem_free();
  54. extern void kmem_fast_free();
  55.  
  56. #endif
  57.  
  58. #endif    /* _SYS_KMEM_H */
  59.