vtophys.hh revision 6019
16019Shines@cs.fsu.edu/* 26019Shines@cs.fsu.edu * Copyright (c) 2002-2005 The Regents of The University of Michigan 36019Shines@cs.fsu.edu * Copyright (c) 2007-2008 The Florida State University 46019Shines@cs.fsu.edu * All rights reserved. 56019Shines@cs.fsu.edu * 66019Shines@cs.fsu.edu * Redistribution and use in source and binary forms, with or without 76019Shines@cs.fsu.edu * modification, are permitted provided that the following conditions are 86019Shines@cs.fsu.edu * met: redistributions of source code must retain the above copyright 96019Shines@cs.fsu.edu * notice, this list of conditions and the following disclaimer; 106019Shines@cs.fsu.edu * redistributions in binary form must reproduce the above copyright 116019Shines@cs.fsu.edu * notice, this list of conditions and the following disclaimer in the 126019Shines@cs.fsu.edu * documentation and/or other materials provided with the distribution; 136019Shines@cs.fsu.edu * neither the name of the copyright holders nor the names of its 146019Shines@cs.fsu.edu * contributors may be used to endorse or promote products derived from 156019Shines@cs.fsu.edu * this software without specific prior written permission. 166019Shines@cs.fsu.edu * 176019Shines@cs.fsu.edu * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 186019Shines@cs.fsu.edu * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 196019Shines@cs.fsu.edu * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 206019Shines@cs.fsu.edu * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 216019Shines@cs.fsu.edu * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 226019Shines@cs.fsu.edu * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 236019Shines@cs.fsu.edu * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 246019Shines@cs.fsu.edu * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 256019Shines@cs.fsu.edu * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 266019Shines@cs.fsu.edu * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 276019Shines@cs.fsu.edu * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 286019Shines@cs.fsu.edu * 296019Shines@cs.fsu.edu * Authors: Ali Saidi 306019Shines@cs.fsu.edu * Nathan Binkert 316019Shines@cs.fsu.edu * Stephen Hines 326019Shines@cs.fsu.edu */ 336019Shines@cs.fsu.edu 346019Shines@cs.fsu.edu#ifndef __ARCH_ARM_VTOPHYS_H__ 356019Shines@cs.fsu.edu#define __ARCH_ARM_VTOPHYS_H__ 366019Shines@cs.fsu.edu 376019Shines@cs.fsu.edu#include "arch/arm/isa_traits.hh" 386019Shines@cs.fsu.edu#include "arch/arm/utility.hh" 396019Shines@cs.fsu.edu 406019Shines@cs.fsu.edu 416019Shines@cs.fsu.educlass ThreadContext; 426019Shines@cs.fsu.educlass FunctionalPort; 436019Shines@cs.fsu.edu 446019Shines@cs.fsu.edunamespace ArmISA { 456019Shines@cs.fsu.edu inline Addr PteAddr(Addr a) { return (a & PteMask) << PteShift; } 466019Shines@cs.fsu.edu 476019Shines@cs.fsu.edu // User Virtual 486019Shines@cs.fsu.edu inline bool IsUSeg(Addr a) { return USegBase <= a && a <= USegEnd; } 496019Shines@cs.fsu.edu 506019Shines@cs.fsu.edu inline bool IsKSeg0(Addr a) { return KSeg0Base <= a && a <= KSeg0End; } 516019Shines@cs.fsu.edu 526019Shines@cs.fsu.edu inline Addr KSeg02Phys(Addr addr) { return addr & KSeg0Mask; } 536019Shines@cs.fsu.edu 546019Shines@cs.fsu.edu Addr vtophys(Addr vaddr); 556019Shines@cs.fsu.edu Addr vtophys(ThreadContext *tc, Addr vaddr); 566019Shines@cs.fsu.edu}; 576019Shines@cs.fsu.edu 586019Shines@cs.fsu.edu#endif // __ARCH_ARM_VTOPHYS_H__ 596019Shines@cs.fsu.edu 60