vtophys.cc revision 6019:76890d8b28f5
17404SAli.Saidi@ARM.com/* 27404SAli.Saidi@ARM.com * Copyright (c) 2002-2005 The Regents of The University of Michigan 37404SAli.Saidi@ARM.com * Copyright (c) 2007-2008 The Florida State University 47404SAli.Saidi@ARM.com * All rights reserved. 57404SAli.Saidi@ARM.com * 67404SAli.Saidi@ARM.com * Redistribution and use in source and binary forms, with or without 77404SAli.Saidi@ARM.com * modification, are permitted provided that the following conditions are 87404SAli.Saidi@ARM.com * met: redistributions of source code must retain the above copyright 97404SAli.Saidi@ARM.com * notice, this list of conditions and the following disclaimer; 107404SAli.Saidi@ARM.com * redistributions in binary form must reproduce the above copyright 117404SAli.Saidi@ARM.com * notice, this list of conditions and the following disclaimer in the 127404SAli.Saidi@ARM.com * documentation and/or other materials provided with the distribution; 137404SAli.Saidi@ARM.com * neither the name of the copyright holders nor the names of its 147404SAli.Saidi@ARM.com * contributors may be used to endorse or promote products derived from 157404SAli.Saidi@ARM.com * this software without specific prior written permission. 167404SAli.Saidi@ARM.com * 177404SAli.Saidi@ARM.com * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 187404SAli.Saidi@ARM.com * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 197404SAli.Saidi@ARM.com * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 207404SAli.Saidi@ARM.com * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 217404SAli.Saidi@ARM.com * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 227404SAli.Saidi@ARM.com * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 237404SAli.Saidi@ARM.com * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 247404SAli.Saidi@ARM.com * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 257404SAli.Saidi@ARM.com * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 267404SAli.Saidi@ARM.com * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 277404SAli.Saidi@ARM.com * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 287404SAli.Saidi@ARM.com * 297404SAli.Saidi@ARM.com * Authors: Ali Saidi 307404SAli.Saidi@ARM.com * Nathan Binkert 317404SAli.Saidi@ARM.com * Stephen Hines 327404SAli.Saidi@ARM.com */ 337404SAli.Saidi@ARM.com 347404SAli.Saidi@ARM.com#include <string> 357404SAli.Saidi@ARM.com 367404SAli.Saidi@ARM.com#include "arch/arm/vtophys.hh" 377404SAli.Saidi@ARM.com#include "base/chunk_generator.hh" 387404SAli.Saidi@ARM.com#include "base/trace.hh" 397404SAli.Saidi@ARM.com#include "cpu/thread_context.hh" 407404SAli.Saidi@ARM.com#include "mem/vport.hh" 417404SAli.Saidi@ARM.com 427404SAli.Saidi@ARM.comusing namespace std; 437728SAli.Saidi@ARM.comusing namespace ArmISA; 447404SAli.Saidi@ARM.com 458245Snate@binkert.orgAddr 469152Satgutier@umich.eduArmISA::vtophys(Addr vaddr) 478245Snate@binkert.org{ 488245Snate@binkert.org Addr paddr = 0; 497748SAli.Saidi@ARM.com if (ArmISA::IsUSeg(vaddr)) 507404SAli.Saidi@ARM.com DPRINTF(VtoPhys, "vtophys: invalid vaddr %#x", vaddr); 517404SAli.Saidi@ARM.com else if (ArmISA::IsKSeg0(vaddr)) 527404SAli.Saidi@ARM.com paddr = ArmISA::KSeg02Phys(vaddr); 537404SAli.Saidi@ARM.com else 549342SAndreas.Sandberg@arm.com panic("vtophys: ptbr is not set on virtual lookup for vaddr %#x", vaddr); 558851Sandreas.hansson@arm.com 568832SAli.Saidi@ARM.com DPRINTF(VtoPhys, "vtophys(%#x) -> %#x\n", vaddr, paddr); 579258SAli.Saidi@ARM.com 587728SAli.Saidi@ARM.com return paddr; 597439Sdam.sunwoo@arm.com} 607576SAli.Saidi@ARM.com 617439Sdam.sunwoo@arm.comAddr 627404SAli.Saidi@ARM.comArmISA::vtophys(ThreadContext *tc, Addr addr) 637404SAli.Saidi@ARM.com{ 647404SAli.Saidi@ARM.com fatal("VTOPHYS: Unimplemented on ARM\n"); 657404SAli.Saidi@ARM.com} 667404SAli.Saidi@ARM.com 677404SAli.Saidi@ARM.com