1178825Sdfr/* $NetBSD: pci_sgmap_pte64.h,v 1.3 2008/04/28 20:23:11 martin Exp $ */
255682Smarkm
355682Smarkm/*-
455682Smarkm * Copyright (c) 1997 The NetBSD Foundation, Inc.
5178825Sdfr * All rights reserved.
655682Smarkm *
7178825Sdfr * This code is derived from software contributed to The NetBSD Foundation
8178825Sdfr * by Jason R. Thorpe of the Numerical Aerospace Simulation Facility,
9178825Sdfr * NASA Ames Research Center.
10178825Sdfr *
11178825Sdfr * Redistribution and use in source and binary forms, with or without
12178825Sdfr * modification, are permitted provided that the following conditions
1355682Smarkm * are met:
14178825Sdfr * 1. Redistributions of source code must retain the above copyright
15178825Sdfr *    notice, this list of conditions and the following disclaimer.
1690926Snectar * 2. Redistributions in binary form must reproduce the above copyright
17178825Sdfr *    notice, this list of conditions and the following disclaimer in the
1855682Smarkm *    documentation and/or other materials provided with the distribution.
19178825Sdfr *
2055682Smarkm * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
2190926Snectar * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
2255682Smarkm * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
2355682Smarkm * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
24178825Sdfr * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
25178825Sdfr * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
2655682Smarkm * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
2755682Smarkm * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
2855682Smarkm * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
2990926Snectar * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
3055682Smarkm * POSSIBILITY OF SUCH DAMAGE.
3190926Snectar */
3255682Smarkm
33178825Sdfr#define	SGMAP_TYPE		pci_sgmap_pte64
34178825Sdfr#define	SGMAP_PTE_TYPE		uint64_t
35178825Sdfr#define	SGMAP_PTE_SPACING	1
36178825Sdfr
37178825Sdfr/*
38178825Sdfr * A 64-bit PCI SGMAP page table entry looks like this:
39178825Sdfr *
40178825Sdfr * 63                           n+1 n             1   0
41178825Sdfr * |                               | Page address | V |
42178825Sdfr *
43178825Sdfr * The page address is bits <n:13> of the physical address of the
44178825Sdfr * page.  The V bit is set if the PTE holds a valid mapping.
45178825Sdfr */
46178825Sdfr#define SGPTE_PGADDR_SHIFT      12
47178825Sdfr#define SGPTE_VALID             0x0000000000000001UL
48178825Sdfr
49178825Sdfr#include <alpha/common/sgmapvar.h>
50178825Sdfr#include <alpha/common/sgmap_typedep.h>
51178825Sdfr