Home | History | Annotate | Line # | Download | only in include
pte3.h revision 1.15.4.1
      1  1.15.4.1    gwr /*	$NetBSD: pte3.h,v 1.15.4.1 1998/01/27 02:14:01 gwr Exp $	*/
      2       1.7    cgd 
      3      1.11    gwr /*-
      4      1.11    gwr  * Copyright (c) 1996 The NetBSD Foundation, Inc.
      5       1.4  glass  * All rights reserved.
      6       1.4  glass  *
      7      1.11    gwr  * This code is derived from software contributed to The NetBSD Foundation
      8      1.11    gwr  * by Adam Glass and Gordon W. Ross.
      9      1.11    gwr  *
     10       1.4  glass  * Redistribution and use in source and binary forms, with or without
     11       1.4  glass  * modification, are permitted provided that the following conditions
     12       1.4  glass  * are met:
     13       1.4  glass  * 1. Redistributions of source code must retain the above copyright
     14       1.4  glass  *    notice, this list of conditions and the following disclaimer.
     15       1.4  glass  * 2. Redistributions in binary form must reproduce the above copyright
     16       1.4  glass  *    notice, this list of conditions and the following disclaimer in the
     17       1.4  glass  *    documentation and/or other materials provided with the distribution.
     18       1.4  glass  * 3. All advertising materials mentioning features or use of this software
     19       1.4  glass  *    must display the following acknowledgement:
     20      1.11    gwr  *        This product includes software developed by the NetBSD
     21      1.11    gwr  *        Foundation, Inc. and its contributors.
     22      1.11    gwr  * 4. Neither the name of The NetBSD Foundation nor the names of its
     23      1.11    gwr  *    contributors may be used to endorse or promote products derived
     24      1.11    gwr  *    from this software without specific prior written permission.
     25       1.4  glass  *
     26      1.11    gwr  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
     27      1.11    gwr  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
     28      1.11    gwr  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
     29      1.13    gwr  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
     30      1.13    gwr  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
     31      1.11    gwr  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
     32      1.11    gwr  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
     33      1.11    gwr  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
     34      1.11    gwr  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
     35      1.11    gwr  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
     36      1.11    gwr  * POSSIBILITY OF SUCH DAMAGE.
     37       1.4  glass  */
     38       1.2  glass 
     39  1.15.4.1    gwr #ifndef _MACHINE_PTE3_H
     40  1.15.4.1    gwr #define _MACHINE_PTE3_H
     41       1.2  glass 
     42       1.1  glass #define NCONTEXT 8
     43  1.15.4.1    gwr #define NPMEG	256
     44  1.15.4.1    gwr #define SEGINV	(NPMEG-1)
     45       1.1  glass #define NPAGSEG 16
     46       1.1  glass #define NSEGMAP 2048
     47       1.1  glass 
     48       1.1  glass #define PG_VALID   0x80000000
     49       1.1  glass #define PG_WRITE   0x40000000
     50       1.1  glass #define PG_SYSTEM  0x20000000
     51       1.1  glass #define PG_NC      0x10000000
     52       1.1  glass #define PG_TYPE    0x0C000000
     53       1.8    gwr #define PG_REF     0x02000000
     54       1.1  glass #define PG_MOD     0x01000000
     55       1.2  glass 
     56       1.8    gwr #define PG_SPECIAL (PG_VALID|PG_WRITE|PG_SYSTEM|PG_NC|PG_REF|PG_MOD)
     57       1.2  glass #define PG_PERM    (PG_VALID|PG_WRITE|PG_SYSTEM|PG_NC)
     58       1.8    gwr #define	PG_MODREF  (PG_REF|PG_MOD)
     59       1.1  glass #define PG_FRAME   0x0007FFFF
     60       1.1  glass 
     61       1.2  glass #define PG_MOD_SHIFT 24
     62       1.2  glass #define PG_PERM_SHIFT 28
     63       1.2  glass 
     64       1.8    gwr #define OBMEM	0
     65       1.8    gwr #define OBIO 	1
     66       1.8    gwr #define VME_D16	2
     67       1.8    gwr #define VME_D32	3
     68       1.1  glass #define PG_TYPE_SHIFT 26
     69       1.1  glass 
     70       1.2  glass #define PG_INVAL   0x0
     71       1.2  glass 
     72       1.1  glass #define MAKE_PGTYPE(x) ((x) << PG_TYPE_SHIFT)
     73  1.15.4.1    gwr #define PG_PFNUM(pte) (pte & PG_FRAME)
     74  1.15.4.1    gwr #define PG_PA(pte) (PG_PFNUM(pte) << PGSHIFT)
     75       1.8    gwr 
     76       1.8    gwr #define	PGT_MASK	MAKE_PGTYPE(3)
     77       1.8    gwr #define	PGT_OBMEM	MAKE_PGTYPE(OBMEM)		/* onboard memory */
     78       1.8    gwr #define	PGT_OBIO	MAKE_PGTYPE(OBIO)		/* onboard I/O */
     79       1.8    gwr #define	PGT_VME_D16	MAKE_PGTYPE(VME_D16)	/* VMEbus 16-bit data */
     80       1.8    gwr #define	PGT_VME_D32	MAKE_PGTYPE(VME_D32)	/* VMEbus 32-bit data */
     81      1.10    gwr 
     82      1.10    gwr #define VA_SEGNUM(x)	((u_int)(x) >> SEGSHIFT)
     83       1.2  glass 
     84       1.2  glass #define VA_PTE_NUM_SHIFT  13
     85       1.2  glass #define VA_PTE_NUM_MASK (0xF << VA_PTE_NUM_SHIFT)
     86       1.2  glass #define VA_PTE_NUM(va) ((va & VA_PTE_NUM_MASK) >> VA_PTE_NUM_SHIFT)
     87       1.2  glass 
     88       1.9    gwr #define PA_PGNUM(pa) ((unsigned)pa >> PGSHIFT)
     89       1.2  glass 
     90  1.15.4.1    gwr #endif /* _MACHINE_PTE3_H */
     91