home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 15 / 15.iso / s / s053 / 9.ddi / usr / include / vm / seg_vpix.h < prev    next >
Encoding:
C/C++ Source or Header  |  1990-12-08  |  4.1 KB  |  133 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. /*
  11.  * +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  12.  *         PROPRIETARY NOTICE (Combined)
  13.  * 
  14.  * This source code is unpublished proprietary information
  15.  * constituting, or derived under license from AT&T's UNIX(r) System V.
  16.  * In addition, portions of such source code were derived from Berkeley
  17.  * 4.3 BSD under license from the Regents of the University of
  18.  * California.
  19.  * 
  20.  * 
  21.  * 
  22.  *         Copyright Notice 
  23.  * 
  24.  * Notice of copyright on this source code product does not indicate 
  25.  * publication.
  26.  * 
  27.  *     (c) 1986,1987,1988,1989  Sun Microsystems, Inc
  28.  *     (c) 1983,1984,1985,1986,1987,1988,1989  AT&T.
  29.  *               All rights reserved.
  30.  *  
  31.  */
  32.  
  33. #ifndef _VM_SEG_VPIX_H
  34. #define _VM_SEG_VPIX_H
  35.  
  36. #ident    "@(#)/usr/include/vm/seg_vpix.h.sl 1.1 4.0 12/08/90 31924 AT&T-USL"
  37.  
  38. #include "vm/seg.h"
  39. #include "vm/anon.h"
  40. #include "vm/mp.h"
  41.  
  42. /*
  43.  * Structure whose pointer is passed to the segvpix_create routine
  44.  */
  45. struct segvpix_crargs {
  46.     u_int        n_hole;        /* # of "holes" - these are regions
  47.                        in the segment which will never
  48.                        have real memory associated with
  49.                        them. */
  50.     struct vpix_hole {
  51.         caddr_t        base;    /* start addr of hole */
  52.         u_int        size;    /* size (in bytes) of hole */
  53.     } hole[4];
  54. };
  55.  
  56. /*
  57.  * Note: we don't need a shareable anon_map, because 1) seg_vpix segments
  58.  * are always private, and 2) we don't allow seg_vpix segments to be
  59.  * partially unmapped.  We don't need protection information since seg_vpix
  60.  * pages are always read/write.
  61.  */
  62.  
  63. /*
  64.  * A seg_vpix segment supports the notion of "equivalenced" pages.  This
  65.  * refers to multiple virtual pages in the same segment mapping to the
  66.  * same physical (or anonymous) page.  We represent the equivalences by
  67.  * keeping a circular linked list for each equivalence set.  One of the
  68.  * pages in the equivalence set is (arbitrarily) considered the "primary";
  69.  * This is kept,
  70.  * along with some other per-page information, in a vpix_page structure.
  71.  */
  72.  
  73. typedef struct vpix_page vpix_page_t;
  74. struct vpix_page {    /* one for every virtual page */
  75.     u_short        eq_map;        /* "real" page this is mapped to */
  76.     u_short        eq_link;    /* link to next equivalenced vpage */
  77.     u_short        rp_eq_list;    /* 1st vpage mapped to this rpage */
  78.     u_short        rp_phys : 1;    /* this rpage is physmapped */
  79.     u_short        rp_lock : 1;    /* we locked the physical page */
  80.     u_short        rp_errata10 : 1;/* some vpage in 0x1000 - 0xF000 range,
  81.                        and thus subject to B1 Errata 10 */
  82.     u_short        rp_hole : 1;    /* this rpage has no real memory */
  83.     union {                /* actual page assignment for rpage */
  84.         struct anon *rpu_anon;        /* anonymous backing */
  85.         u_int         rpu_pfn;        /* physical map pfn */
  86.     } rp_un;
  87. };
  88.  
  89. #define rp_anon    rp_un.rpu_anon
  90. #define rp_pfn    rp_un.rpu_pfn
  91.  
  92. #define NULLEQ    ((u_short)-1)
  93.  
  94. /*
  95.  * (Semi) private data maintained by the seg_vn driver per segment mapping
  96.  */
  97. struct    segvpix_data {
  98.     mon_t    lock;
  99.     short    s_vpix;        /* hook to the v86tab structure */
  100.     vpix_page_t *vpage;    /* per-page information */
  101.     struct cred *cred;    /* mapping credentials */
  102.     u_int    swresv;        /* swap space reserved for this segment */
  103. };
  104.  
  105. #ifdef _KERNEL
  106.  
  107. #if defined(__STDC__)
  108. extern int segvpix_create(struct seg *, void *);
  109. extern int segvpix_physmap(struct seg *, u_int, u_int, u_int);
  110. extern int segvpix_unphys(struct seg *, u_int, u_int);
  111. extern int segvpix_page_equiv(struct seg *, u_int, u_int);
  112. extern int segvpix_range_equiv(struct seg *, u_int, u_int, u_int);
  113. extern int segvpix_modscan(struct seg *, u_int, u_int);
  114. #else
  115. extern int segvpix_create();
  116. extern int segvpix_physmap();
  117. extern int segvpix_unphys();
  118. extern int segvpix_page_equiv();
  119. extern int segvpix_range_equiv();
  120. extern int segvpix_modscan();
  121. #endif
  122.  
  123. extern    struct seg_ops segvpix_ops;
  124.  
  125. /*
  126.  * Provided as shorthand for creating a vanilla vpix segment.
  127.  */
  128. extern caddr_t vpix_argsp;
  129.  
  130. #endif /* _KERNEL */
  131.  
  132. #endif    /* _VM_SEG_VPIX_H */
  133.