home *** CD-ROM | disk | FTP | other *** search
- /*
- * $Header: /ax/networking:include/sys/region.h:networking 1.1 $
- * $Source: /ax/networking:include/sys/region.h: $
- *
- * Copyright (c) 1988 Acorn Computers Ltd., Cambridge, England
- *
- * $Log: region.h,v $
- * Revision 1.1 95/01/11 10:19:39 kwelton
- * Initial revision
- *
- * Revision 1.3 88/06/17 20:20:43 beta
- * Acorn Unix initial beta version
- *
- */
- /* @(#)region.h 1.0 12-Apr-88 4.3BSD ARMSRC */
- /*
- * Copyright (c) 1988 Acorn Computers Ltd. All rights reserved.
- *
- * @(#)region.h 1.0 (Acorn) 12-Apr-88
- */
-
- /*
- * This header defines the 'region' structure for virtual memory segments.
- */
-
- #ifndef _REGION_
- #define _REGION_
-
- /* The next definitions need centralising if regions are used other than */
- /* for shared memory segments. */
- #define MAXREGIONS (NSHMID)
- #define MAXREGPAGES (SHMMAXPAGES)
-
- struct region
- {
- struct inode *reg_linode; /* Inode for loading this region */
- struct inode *reg_pinode; /* Inode for paging this region */
- int reg_type; /* Text, data, stack or shared memory */
- int reg_npages; /* Size of region in pages */
- int reg_status; /* Status of region */
- int reg_refcount; /* No. of references to this region */
- /* i.e. no. of times attached at present */
- /* The page table for this region. Note that one page table is */
- /* sufficient, even if this region is mapped into several processes: */
- /* since a region is contiguous in virtual address space, only the base */
- /* address and access are recorded separately for each mapping. */
- struct pte reg_pt[MAXREGPAGES];
- };
-
- /* Region status flags */
-
- #define REGST_FREE 0001 /* Unused entry in region table */
- #define REGST_LOCKED 0002 /* Region structure is locked */
- #define REGST_KEEP 0004 /* Keep even if refcount falls to 0 */
- /* (used for shared memory segments) */
- #define REGST_RONLY 0010 /* Read-only region (no-one may write) */
- #define REGST_COW 0020 /* Copy on write */
-
- /* Region types */
-
- #define REG_TEXT 1 /* Text region */
- #define REG_DATA 2 /* Data region */
- #define REG_STACK 3 /* Stack region */
- #define REG_SHM 4 /* Shared memory region */
-
- #ifdef KERNEL
- extern struct region *allocreg();
- extern struct pte *reg_get_pte();
- #endif KERNEL
-
- #endif _REGION_
-
- /* EOF region.h */
-