page_table.hh (10905:a6ca6831e775) | page_table.hh (11168:f98eb2da15a4) |
---|---|
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 --- 24 unchanged lines hidden (view full) --- 33 * @file 34 * Declarations of a non-full system Page Table. 35 */ 36 37#ifndef __MEM_PAGE_TABLE_HH__ 38#define __MEM_PAGE_TABLE_HH__ 39 40#include <string> | 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 --- 24 unchanged lines hidden (view full) --- 33 * @file 34 * Declarations of a non-full system Page Table. 35 */ 36 37#ifndef __MEM_PAGE_TABLE_HH__ 38#define __MEM_PAGE_TABLE_HH__ 39 40#include <string> |
41#include <unordered_map> |
|
41 42#include "arch/isa_traits.hh" 43#include "arch/tlb.hh" | 42 43#include "arch/isa_traits.hh" 44#include "arch/tlb.hh" |
44#include "base/hashmap.hh" | |
45#include "base/types.hh" 46#include "config/the_isa.hh" 47#include "mem/request.hh" 48#include "sim/serialize.hh" 49#include "sim/system.hh" 50 51class ThreadContext; 52 --- 142 unchanged lines hidden (view full) --- 195}; 196 197/** 198 * Declaration of functional page table. 199 */ 200class FuncPageTable : public PageTableBase 201{ 202 private: | 45#include "base/types.hh" 46#include "config/the_isa.hh" 47#include "mem/request.hh" 48#include "sim/serialize.hh" 49#include "sim/system.hh" 50 51class ThreadContext; 52 --- 142 unchanged lines hidden (view full) --- 195}; 196 197/** 198 * Declaration of functional page table. 199 */ 200class FuncPageTable : public PageTableBase 201{ 202 private: |
203 typedef m5::hash_map<Addr, TheISA::TlbEntry> PTable; | 203 typedef std::unordered_map<Addr, TheISA::TlbEntry> PTable; |
204 typedef PTable::iterator PTableItr; 205 PTable pTable; 206 207 public: 208 209 FuncPageTable(const std::string &__name, uint64_t _pid, 210 Addr _pageSize = TheISA::PageBytes); 211 --- 18 unchanged lines hidden (view full) --- 230 231 /** 232 * Lookup function 233 * @param vaddr The virtual address. 234 * @return entry The page table entry corresponding to vaddr. 235 */ 236 bool lookup(Addr vaddr, TheISA::TlbEntry &entry); 237 | 204 typedef PTable::iterator PTableItr; 205 PTable pTable; 206 207 public: 208 209 FuncPageTable(const std::string &__name, uint64_t _pid, 210 Addr _pageSize = TheISA::PageBytes); 211 --- 18 unchanged lines hidden (view full) --- 230 231 /** 232 * Lookup function 233 * @param vaddr The virtual address. 234 * @return entry The page table entry corresponding to vaddr. 235 */ 236 bool lookup(Addr vaddr, TheISA::TlbEntry &entry); 237 |
238 void serialize(CheckpointOut &cp) const M5_ATTR_OVERRIDE; 239 void unserialize(CheckpointIn &cp) M5_ATTR_OVERRIDE; | 238 void serialize(CheckpointOut &cp) const override; 239 void unserialize(CheckpointIn &cp) override; |
240}; 241 242/** 243 * Faux page table class indended to stop the usage of 244 * an architectural page table, when there is none defined 245 * for a particular ISA. 246 */ 247class NoArchPageTable : public FuncPageTable 248{ 249 public: 250 NoArchPageTable(const std::string &__name, uint64_t _pid, System *_sys, 251 Addr _pageSize = TheISA::PageBytes) : FuncPageTable(__name, _pid) 252 { 253 fatal("No architectural page table defined for this ISA.\n"); 254 } 255}; 256 257#endif // __MEM_PAGE_TABLE_HH__ | 240}; 241 242/** 243 * Faux page table class indended to stop the usage of 244 * an architectural page table, when there is none defined 245 * for a particular ISA. 246 */ 247class NoArchPageTable : public FuncPageTable 248{ 249 public: 250 NoArchPageTable(const std::string &__name, uint64_t _pid, System *_sys, 251 Addr _pageSize = TheISA::PageBytes) : FuncPageTable(__name, _pid) 252 { 253 fatal("No architectural page table defined for this ISA.\n"); 254 } 255}; 256 257#endif // __MEM_PAGE_TABLE_HH__ |