Annotation of researchv9/sys/sun3/pte.h, revision 1.1.1.1

1.1       root        1: /*      @(#)pte.h 1.1 86/02/03 SMI      */
                      2: 
                      3: /*
                      4:  * Copyright (c) 1985 by Sun Microsystems, Inc.
                      5:  */
                      6: 
                      7: /*
                      8:  * Sun 3 hardware page table entry
                      9:  *
                     10:  * There are two major kinds of pte's: those which have ever existed (and are
                     11:  * thus either now in core or on the swap device), and those which have
                     12:  * never existed, but which will be filled on demand at first reference.
                     13:  * There is a structure describing each.
                     14:  * Note that (pg_v && pg_fod) indicates a special (eg, mmapped) page: 
                     15:  * it is not paged out (not dirty), nor filled in (still valid).
                     16:  */
                     17: 
                     18: #ifndef LOCORE
                     19: struct pte {
                     20:        unsigned int    pg_v:1;         /* valid bit */
                     21:        unsigned int    pg_prot:2;      /* access protection */
                     22:        unsigned int    pg_nc:1;        /* no cache bit */
                     23:        unsigned int    pg_type:2;      /* page type */
                     24:        unsigned int    pg_r:1;         /* referenced */
                     25:        unsigned int    pg_m:1;         /* modified */
                     26:        unsigned int    :3;
                     27:        unsigned int    pg_fod:1;       /* is fill on demand (=0) */
                     28:        unsigned int    :1;
                     29:        unsigned int    pg_pfnum:19;    /* page frame number */
                     30: };
                     31: 
                     32: struct fpte {
                     33:        unsigned int    pg_v:1;         /* valid bit */
                     34:        unsigned int    pg_prot:2;      /* access protection */
                     35:        unsigned int    pg_nc:1;        /* no cache bit */
                     36:        unsigned int    pg_type:2;      /* page type */
                     37:        unsigned int    pg_source:5;    /* file mapped from or TEXT or ZERO */
                     38:        unsigned int    pg_fod:1;       /* is fill on demand (=1) */
                     39:        unsigned int    pg_blkno:20;    /* file system block number */
                     40: };
                     41: #endif
                     42: 
                     43: #define        PG_V            0x80000000      /* page is valid */
                     44: #define        PG_PROT         0x60000000      /* access protection mask */
                     45: #define                PG_W    0x40000000      /* write enable bit */
                     46: #define                PG_S    0x20000000      /* system page */
                     47: #define        PG_NC           0x10000000      /* no cache bit */
                     48: #define        PG_TYPE         0x0C000000      /* page type mask */
                     49: #define        PG_R            0x02000000      /* page referenced bit */
                     50: #define        PG_M            0x01000000      /* page modified bit */
                     51: #define        PG_FOD          0x00100000      /* page fill-on-demand bit */
                     52: #define        PG_PFNUM        0x0C07FFFF      /* page # mask - XXX includes type */
                     53: 
                     54: #define PG_FMIN                (NOFILE)
                     55: #define        PG_FZERO        (NOFILE)
                     56: #define        PG_FTEXT        (NOFILE+1)
                     57: #define        PG_FMAX         (PG_FTEXT)
                     58: 
                     59: #define        PG_KW           (PG_S|PG_W)
                     60: #define        PG_KR           PG_S
                     61: #define        PG_UW           PG_W            /* kernel can still access */
                     62: #define        PG_UWKW         PG_UW
                     63: #define        PG_UR           0               /* kernel can still access */
                     64: #define        PG_URKR         PG_UR
                     65: #define        PG_UPAGE        PG_KW           /* sun3 u pages not user accessable */
                     66: 
                     67: #define        PGT_MASK        (3<<26)
                     68: 
                     69: #define        PGT_OBMEM       (0<<26)         /* onboard memory */
                     70: #define        PGT_OBIO        (1<<26)         /* onboard I/O */
                     71: #define PGT_VME_D16    (2<<26)         /* VMEbus 16-bit data */
                     72: #define        PGT_VME_D32     (3<<26)         /* VMEbus 32-bit data */
                     73: 
                     74: /*
                     75:  * Pte related macros
                     76:  */
                     77: #define        dirty(pte)      ((pte)->pg_fod == 0 && (pte)->pg_pfnum && (pte)->pg_m)
                     78: 
                     79: #if defined(KERNEL) && !defined(LOCORE)
                     80: struct pte *vtopte();
                     81: 
                     82: /* utilities defined in locore.s */
                     83: extern struct pte Sysmap[];
                     84: extern struct pte Usrptmap[];
                     85: extern struct pte usrpt[];
                     86: extern struct pte Swapmap[];
                     87: extern struct pte Forkmap[];
                     88: extern struct pte Xswapmap[];
                     89: extern struct pte Xswap2map[];
                     90: extern struct pte Pushmap[];
                     91: extern struct pte Vfmap[];
                     92: extern struct pte mmap[];
                     93: extern struct pte msgbufmap[];
                     94: extern struct pte CMAP1[];
                     95: extern struct pte CMAP2[];
                     96: extern struct pte Prusrmap[];
                     97: #endif defined(KERNEL) && !defined(LOCORE)

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.