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

  1. /*
  2.  * $Header: /ax/networking:include/sys/region.h:networking  1.1  $
  3.  * $Source: /ax/networking:include/sys/region.h: $
  4.  *
  5.  * Copyright (c) 1988 Acorn Computers Ltd., Cambridge, England
  6.  *
  7.  * $Log:    region.h,v $
  8.  * Revision 1.1  95/01/11  10:19:39  kwelton
  9.  * Initial revision
  10.  * 
  11.  * Revision 1.3  88/06/17  20:20:43  beta
  12.  * Acorn Unix initial beta version
  13.  * 
  14.  */
  15. /* @(#)region.h 1.0 12-Apr-88 4.3BSD ARMSRC */
  16. /*
  17.  * Copyright (c) 1988 Acorn Computers Ltd.  All rights reserved.
  18.  *
  19.  *    @(#)region.h    1.0 (Acorn) 12-Apr-88
  20.  */
  21.  
  22. /*
  23.  * This header defines the 'region' structure for virtual memory segments. 
  24.  */
  25.  
  26. #ifndef _REGION_
  27. #define _REGION_
  28.  
  29. /* The next definitions need centralising if regions are used other than */
  30. /* for shared memory segments.                                           */
  31. #define MAXREGIONS  (NSHMID)
  32. #define MAXREGPAGES (SHMMAXPAGES)
  33.  
  34. struct region
  35. {
  36.   struct inode *reg_linode;      /* Inode for loading this region */
  37.   struct inode *reg_pinode;      /* Inode for paging this region */
  38.   int          reg_type;         /* Text, data, stack or shared memory */
  39.   int          reg_npages;       /* Size of region in pages */
  40.   int          reg_status;       /* Status of region */
  41.   int          reg_refcount;     /* No. of references to this region      */
  42.                                  /* i.e. no. of times attached at present */
  43.   /* The page table for this region. Note that one page table is          */
  44.   /* sufficient, even if this region is mapped into several processes:    */
  45.   /* since a region is contiguous in virtual address space, only the base */
  46.   /* address and access are recorded separately for each mapping.         */
  47.   struct pte   reg_pt[MAXREGPAGES]; 
  48. };
  49.  
  50. /* Region status flags */
  51.  
  52. #define REGST_FREE    0001    /* Unused entry in region table */
  53. #define REGST_LOCKED    0002    /* Region structure is locked   */
  54. #define REGST_KEEP    0004    /* Keep even if refcount falls to 0  */
  55.                                 /* (used for shared memory segments) */
  56. #define REGST_RONLY    0010    /* Read-only region (no-one may write) */
  57. #define REGST_COW    0020    /* Copy on write */
  58.  
  59. /* Region types */
  60.  
  61. #define REG_TEXT    1    /* Text region */
  62. #define REG_DATA    2    /* Data region */
  63. #define REG_STACK    3    /* Stack region */
  64. #define REG_SHM        4    /* Shared memory region */
  65.  
  66. #ifdef KERNEL
  67. extern struct region *allocreg();
  68. extern struct pte    *reg_get_pte();
  69. #endif KERNEL
  70.  
  71. #endif _REGION_
  72.  
  73. /* EOF region.h */
  74.