home *** CD-ROM | disk | FTP | other *** search
/ The Datafile PD-CD 4 / DATAFILE_PDCD4.iso / utilities / utilss / sockets / include / sys / h / map < prev    next >
Encoding:
Text File  |  1995-01-11  |  2.5 KB  |  85 lines

  1. /*
  2.  * $Header: /ax/networking:include/sys/map.h:networking  1.1  $
  3.  * $Source: /ax/networking:include/sys/map.h: $
  4.  *
  5.  * Copyright (c) 1988 Acorn Computers Ltd., Cambridge, England
  6.  *
  7.  * $Log:    map.h,v $
  8.  * Revision 1.1  95/01/11  10:19:20  kwelton
  9.  * Initial revision
  10.  * 
  11.  * Revision 1.3  88/06/17  20:19:38  beta
  12.  * Acorn Unix initial beta version
  13.  * 
  14.  */
  15. /* @(#)map.h    1.2 87/05/15 3.2/4.3NFSSRC */
  16. /*
  17.  * Copyright (c) 1982, 1986 Regents of the University of California.
  18.  * All rights reserved.  The Berkeley software License Agreement
  19.  * specifies the terms and conditions for redistribution.
  20.  *
  21.  *    @(#)map.h    7.1 (Berkeley) 6/4/86
  22.  */
  23.  
  24. #ifndef _MAP_
  25. #define _MAP_
  26. /*
  27.  * Resource Allocation Maps.
  28.  *
  29.  * Associated routines manage sub-allocation of an address space using
  30.  * an array of segment descriptors.  The first element of this array
  31.  * is a map structure, describing the arrays extent and the name
  32.  * of the controlled object.  Each additional structure represents
  33.  * a free segment of the address space.
  34.  *
  35.  * A call to rminit initializes a resource map and may also be used
  36.  * to free some address space for the map.  Subsequent calls to rmalloc
  37.  * and rmfree allocate and free space in the resource map.  If the resource
  38.  * map becomes too fragmented to be described in the available space,
  39.  * then some of the resource is discarded.  This may lead to critical
  40.  * shortages, but is better than not checking (as the previous versions
  41.  * of these routines did) or giving up and calling panic().  The routines
  42.  * could use linked lists and call a memory allocator when they run
  43.  * out of space, but that would not solve the out of space problem when
  44.  * called at interrupt time.
  45.  *
  46.  * N.B.: The address 0 in the resource address space is not available
  47.  * as it is used internally by the resource map routines.
  48.  */
  49. struct map {
  50.     struct    mapent *m_limit;    /* address of last slot in map */
  51.     char    *m_name;        /* name of resource */
  52. /* we use m_name when the map overflows, in warning messages */
  53. };
  54. struct mapent
  55. {
  56.     int    m_size;        /* size of this segment of the map */
  57.     int    m_addr;        /* resource-space addr of start of segment */
  58. };
  59.  
  60. #ifdef    KERNEL
  61. #define    ARGMAPSIZE    16
  62. #ifndef    DYNALLOC
  63. struct  map swapmap[NSWAPMAP];
  64. #ifdef    notneeded
  65. struct    map argmap[ARGMAPSIZE];
  66. #endif    notneeded
  67. #ifdef    GARBAGE
  68. struct  map kernelmap[NKERNELMAP];
  69. struct    map mbmap[NMBCLUSTERS/4];
  70. #endif    GARBAGE
  71. #else
  72. struct    map *swapmap;
  73. #ifdef    notneeded
  74. struct    map *argmap;
  75. #endif    notneeded
  76. struct    map *kernelmap;
  77. struct    map *mbmap;
  78. #endif DYNALLOC
  79. int    nswapmap;
  80. #endif
  81.  
  82. #endif
  83.  
  84. /* EOF map.h */
  85.