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

  1. /*
  2.  * $Header: /ax/networking:include/sys/newvm.h:networking  1.1  $
  3.  * $Source: /ax/networking:include/sys/newvm.h: $
  4.  *
  5.  * Copyright (c) 1988 Acorn Computers Ltd., Cambridge, England
  6.  *
  7.  * $Log:    newvm.h,v $
  8.  * Revision 1.1  95/01/11  10:19:30  kwelton
  9.  * Initial revision
  10.  * 
  11.  * Revision 1.3  88/06/17  20:20:06  beta
  12.  * Acorn Unix initial beta version
  13.  * 
  14.  */
  15. /* terminal types */
  16.  
  17. typedef    char    *va_t;
  18.  
  19.  
  20.  
  21. /* page table and entries therein */
  22.  
  23. #define    FSBLKSIZE    8192
  24. #define    DBLKC        (NBPG/FSBLKSIZE)
  25.  
  26. /* page states */
  27.  
  28. #define    PS_INVALID    0    /* page is not defined (default state after allocation        */
  29. #define    PS_FROMPROTO    1    /* should be paged-in from ptototype inode copy            */
  30. #define    PS_FROMPAGE    2    /* should be paged-in from paging inode copy            */
  31. #define    PS_VALID    3    /* page is paged-in                        */
  32.  
  33. /* pages */
  34.  
  35. typedef struct page
  36. {
  37.     char    last;        /* last entry in table flag                    */
  38.     char    valid;        /* page validity flag                        */
  39.     char    ppn;        /* physical page number when valid                */
  40.     char    state;        /* page state                            */
  41.     int    pdblks[DBLKC];    /* disk block numbers of prototype inode copy            */
  42.     int    sdblks[DBLKC];    /* disk block numbers of paging inode copy            */
  43. } pg, *pg_ref;
  44.  
  45.  
  46.  
  47. /* segment descriptors and their states */
  48.  
  49. /* segment states */
  50.  
  51. #define    SS_PRIVATE    0    /* segment is private to this process                */
  52. #define    SS_SHARED    1    /* segment is shared with other processes            */
  53. #define    SS_COW        2    /* segment is copy on write                    */
  54.  
  55. /* segments */
  56.  
  57. typedef struct segd
  58. {
  59.     va_t    base;        /* base virtual address of segment                */
  60.     int    size;        /* size of segment (in pages)                    */
  61.     int    prot;        /* protextion of segment                    */
  62.     int    usec;        /* usage count                            */
  63.     int    state;        /* state of segment                        */
  64.     pg_ref    pages;        /* page table for segment                    */
  65. } segd, *segd_ref;
  66.  
  67.  
  68.  
  69. /* 'proc' structure extensions */
  70.  
  71. typedef struct proc_ext
  72. {
  73.     struct inode
  74.         *proto_ip,    /* prototyping inode                        */
  75.         *page_ip;    /* paging inode                            */
  76.     segd_ref
  77.         text_seg,    /* read-only code segment reference                */
  78.         data_seg,    /* read-write initialised data segment                */
  79.         bss_seg,    /* read-write uninitialised data segment            */
  80.         stack_seg,    /* read-write control/data stack segment            */
  81.         uarea_seg,    /* read-only (user) / read-write (kernel) u-area segment    */
  82.         lib_segs,    /* read-only library code segments                */
  83.         region_segs;    /* read-write SVID region segments                */
  84. } proc_ext, *proc_ext_ref;
  85.  
  86. /* EOF newvm.h */
  87.