Deleted Added
sdiff udiff text old ( 10558:426665ec11a9 ) new ( 10905:a6ca6831e775 )
full compact
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

--- 23 unchanged lines hidden (view full) ---

32 */
33
34/**
35 * @file
36 * Definitions of functional page table.
37 */
38#include <fstream>
39#include <map>
40#include <memory>
41#include <string>
42
43#include "base/bitfield.hh"
44#include "base/intmath.hh"
45#include "base/trace.hh"
46#include "config/the_isa.hh"
47#include "debug/MMU.hh"
48#include "mem/page_table.hh"

--- 143 unchanged lines hidden (view full) ---

192 if ((paddr & (pageSize - 1)) + req->getSize() > pageSize) {
193 panic("Request spans page boundaries!\n");
194 return NoFault;
195 }
196 return NoFault;
197}
198
199void
200FuncPageTable::serialize(CheckpointOut &cp) const
201{
202 paramOut(cp, "ptable.size", pTable.size());
203
204 PTable::size_type count = 0;
205 for (auto &pte : pTable) {
206 ScopedCheckpointSection sec(cp, csprintf("Entry%d", count++));
207
208 paramOut(cp, "vaddr", pte.first);
209 pte.second.serialize(cp);
210 }
211 assert(count == pTable.size());
212}
213
214void
215FuncPageTable::unserialize(CheckpointIn &cp)
216{
217 int count;
218 paramIn(cp, "ptable.size", count);
219
220 for (int i = 0; i < count; ++i) {
221 ScopedCheckpointSection sec(cp, csprintf("Entry%d", i));
222
223 std::unique_ptr<TheISA::TlbEntry> entry;
224 Addr vaddr;
225
226 paramIn(cp, "vaddr", vaddr);
227 entry.reset(new TheISA::TlbEntry());
228 entry->unserialize(cp);
229
230 pTable[vaddr] = *entry;
231 }
232}
233