vtophys.hh revision 8759
12SN/A/* 21762SN/A * Copyright (c) 2002-2005 The Regents of The University of Michigan 32SN/A * Copyright (c) 2007-2008 The Florida State University 42SN/A * Copyright (c) 2009 The University of Edinburgh 52SN/A * All rights reserved. 62SN/A * 72SN/A * Redistribution and use in source and binary forms, with or without 82SN/A * modification, are permitted provided that the following conditions are 92SN/A * met: redistributions of source code must retain the above copyright 102SN/A * notice, this list of conditions and the following disclaimer; 112SN/A * redistributions in binary form must reproduce the above copyright 122SN/A * notice, this list of conditions and the following disclaimer in the 132SN/A * documentation and/or other materials provided with the distribution; 142SN/A * neither the name of the copyright holders nor the names of its 152SN/A * contributors may be used to endorse or promote products derived from 162SN/A * this software without specific prior written permission. 172SN/A * 182SN/A * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 192SN/A * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 202SN/A * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 212SN/A * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 222SN/A * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 232SN/A * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 242SN/A * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 252SN/A * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 262SN/A * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 272665Ssaidi@eecs.umich.edu * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 282665Ssaidi@eecs.umich.edu * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 292SN/A * 302SN/A * Authors: Ali Saidi 315882Snate@binkert.org * Nathan Binkert 325882Snate@binkert.org * Stephen Hines 332SN/A * Timothy M. Jones 346214Snate@binkert.org */ 355512SMichael.Adler@intel.com 368278SAli.Saidi@ARM.com#ifndef __ARCH_POWER_VTOPHYS_HH__ 378278SAli.Saidi@ARM.com#define __ARCH_POWER_VTOPHYS_HH__ 388278SAli.Saidi@ARM.com 398278SAli.Saidi@ARM.com#include "arch/power/isa_traits.hh" 408278SAli.Saidi@ARM.com#include "arch/power/utility.hh" 418278SAli.Saidi@ARM.com 428278SAli.Saidi@ARM.comclass ThreadContext; 438278SAli.Saidi@ARM.comclass FunctionalPort; 448278SAli.Saidi@ARM.com 455512SMichael.Adler@intel.comnamespace PowerISA { 462SN/A 478278SAli.Saidi@ARM.comAddr vtophys(Addr vaddr); 488278SAli.Saidi@ARM.comAddr vtophys(ThreadContext *tc, Addr vaddr); 498278SAli.Saidi@ARM.com 508278SAli.Saidi@ARM.cominline Addr 518278SAli.Saidi@ARM.comPteAddr(Addr a) 528278SAli.Saidi@ARM.com{ 538278SAli.Saidi@ARM.com return (a & PteMask) << PteShift; 548278SAli.Saidi@ARM.com} 558278SAli.Saidi@ARM.com 565512SMichael.Adler@intel.com} // namespace PowerISA 575512SMichael.Adler@intel.com 585512SMichael.Adler@intel.com#endif // __ARCH_POWER_VTOPHYS_HH__ 595512SMichael.Adler@intel.com 605882Snate@binkert.org