page_table.cc (12536:0a1d2ced2d4c) | page_table.cc (12637:bfc3cb9c7e6c) |
---|---|
1/* 2 * Copyright (c) 2014 Advanced Micro Devices, Inc. 3 * Copyright (c) 2003 The Regents of The University of Michigan 4 * All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions are 8 * met: redistributions of source code must retain the above copyright --- 31 unchanged lines hidden (view full) --- 40#include <string> 41 42#include "base/compiler.hh" 43#include "base/trace.hh" 44#include "debug/MMU.hh" 45#include "sim/faults.hh" 46#include "sim/serialize.hh" 47 | 1/* 2 * Copyright (c) 2014 Advanced Micro Devices, Inc. 3 * Copyright (c) 2003 The Regents of The University of Michigan 4 * All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions are 8 * met: redistributions of source code must retain the above copyright --- 31 unchanged lines hidden (view full) --- 40#include <string> 41 42#include "base/compiler.hh" 43#include "base/trace.hh" 44#include "debug/MMU.hh" 45#include "sim/faults.hh" 46#include "sim/serialize.hh" 47 |
48using namespace std; 49 | |
50void 51EmulationPageTable::map(Addr vaddr, Addr paddr, int64_t size, uint64_t flags) 52{ 53 bool clobber = flags & Clobber; 54 // starting address must be page aligned 55 assert(pageOffset(vaddr) == 0); 56 57 DPRINTF(MMU, "Allocating Page: %#x-%#x\n", vaddr, vaddr + size); --- 37 unchanged lines hidden (view full) --- 95 new_vaddr += pageSize; 96 } 97} 98 99void 100EmulationPageTable::getMappings(std::vector<std::pair<Addr, Addr>> *addr_maps) 101{ 102 for (auto &iter : pTable) | 48void 49EmulationPageTable::map(Addr vaddr, Addr paddr, int64_t size, uint64_t flags) 50{ 51 bool clobber = flags & Clobber; 52 // starting address must be page aligned 53 assert(pageOffset(vaddr) == 0); 54 55 DPRINTF(MMU, "Allocating Page: %#x-%#x\n", vaddr, vaddr + size); --- 37 unchanged lines hidden (view full) --- 93 new_vaddr += pageSize; 94 } 95} 96 97void 98EmulationPageTable::getMappings(std::vector<std::pair<Addr, Addr>> *addr_maps) 99{ 100 for (auto &iter : pTable) |
103 addr_maps->push_back(make_pair(iter.first, iter.second.paddr)); | 101 addr_maps->push_back(std::make_pair(iter.first, iter.second.paddr)); |
104} 105 106void 107EmulationPageTable::unmap(Addr vaddr, int64_t size) 108{ 109 assert(pageOffset(vaddr) == 0); 110 111 DPRINTF(MMU, "Unmapping page: %#x-%#x\n", vaddr, vaddr + size); --- 98 unchanged lines hidden --- | 102} 103 104void 105EmulationPageTable::unmap(Addr vaddr, int64_t size) 106{ 107 assert(pageOffset(vaddr) == 0); 108 109 DPRINTF(MMU, "Unmapping page: %#x-%#x\n", vaddr, vaddr + size); --- 98 unchanged lines hidden --- |