tlb.hh (5038:c996bb7f1a6d) tlb.hh (5086:e7913ffb379d)
1/*
2 * Copyright (c) 2007 The Hewlett-Packard Development Company
3 * All rights reserved.
4 *
5 * Redistribution and use of this software in source and binary forms,
6 * with or without modification, are permitted provided that the
7 * following conditions are met:
8 *

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

53 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
54 *
55 * Authors: Gabe Black
56 */
57
58#ifndef __ARCH_X86_TLB_HH__
59#define __ARCH_X86_TLB_HH__
60
1/*
2 * Copyright (c) 2007 The Hewlett-Packard Development Company
3 * All rights reserved.
4 *
5 * Redistribution and use of this software in source and binary forms,
6 * with or without modification, are permitted provided that the
7 * following conditions are met:
8 *

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

53 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
54 *
55 * Authors: Gabe Black
56 */
57
58#ifndef __ARCH_X86_TLB_HH__
59#define __ARCH_X86_TLB_HH__
60
61#include "config/full_system.hh"
62
63#if FULL_SYSTEM
64
65#include "mem/request.hh"
66#include "params/X86DTB.hh"
67#include "params/X86ITB.hh"
68#include "sim/faults.hh"
69#include "sim/sim_object.hh"
70
71class ThreadContext;
72class Packet;
73
74namespace X86ISA
75{
76 struct TlbEntry
77 {
78 Addr pageStart;
79 TlbEntry() {}
80 TlbEntry(Addr paddr) : pageStart(paddr) {}
81
82 void serialize(std::ostream &os);
83 void unserialize(Checkpoint *cp, const std::string &section);
84 };
85
86class TLB : public SimObject
87{
88 public:
89 typedef X86TLBParams Params;
90 TLB(const Params *p);
91
92 void dumpAll();
93
94 // Checkpointing
95 virtual void serialize(std::ostream &os);
96 virtual void unserialize(Checkpoint *cp, const std::string &section);
97};
98
99class ITB : public TLB
100{
101 public:
102 typedef X86ITBParams Params;
103 ITB(const Params *p) : TLB(p)
104 {
105 }
106
107 Fault translate(RequestPtr &req, ThreadContext *tc);
108
109 friend class DTB;
110};
111
112class DTB : public TLB
113{
114 public:
115 typedef X86DTBParams Params;
116 DTB(const Params *p) : TLB(p)
117 {
118 }
119
120 Fault translate(RequestPtr &req, ThreadContext *tc, bool write);
121#if FULL_SYSTEM
122 Tick doMmuRegRead(ThreadContext *tc, Packet *pkt);
123 Tick doMmuRegWrite(ThreadContext *tc, Packet *pkt);
124#endif
125
126 // Checkpointing
127 virtual void serialize(std::ostream &os);
128 virtual void unserialize(Checkpoint *cp, const std::string &section);
129};
130
131}
132
133#else
134
61#include <iostream>
62
63#include "sim/host.hh"
64#include "sim/tlb.hh"
65
66class Checkpoint;
67
68namespace X86ISA

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

87 class DTB : public GenericTLB
88 {
89 public:
90 DTB(const Params *p) : GenericTLB(p)
91 {}
92 };
93};
94
135#include <iostream>
136
137#include "sim/host.hh"
138#include "sim/tlb.hh"
139
140class Checkpoint;
141
142namespace X86ISA

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

161 class DTB : public GenericTLB
162 {
163 public:
164 DTB(const Params *p) : GenericTLB(p)
165 {}
166 };
167};
168
169#endif
170
95#endif // __ARCH_X86_TLB_HH__
171#endif // __ARCH_X86_TLB_HH__