tlb.cc (5038:c996bb7f1a6d) tlb.cc (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 *

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

52 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
53 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
54 *
55 * Authors: Gabe Black
56 */
57
58#include <cstring>
59
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 *

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

52 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
53 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
54 *
55 * Authors: Gabe Black
56 */
57
58#include <cstring>
59
60#include "config/full_system.hh"
61
62#if FULL_SYSTEM
63
60#include "arch/x86/tlb.hh"
64#include "arch/x86/tlb.hh"
65#include "base/bitfield.hh"
66#include "base/trace.hh"
67#include "cpu/thread_context.hh"
68#include "cpu/base.hh"
69#include "mem/packet_access.hh"
70#include "mem/request.hh"
71#include "sim/system.hh"
72
73namespace X86ISA {
74
75TLB::TLB(const Params *p) : SimObject(p)
76{
77}
78
79Fault
80ITB::translate(RequestPtr &req, ThreadContext *tc)
81{
82 return NoFault;
83}
84
85
86
87Fault
88DTB::translate(RequestPtr &req, ThreadContext *tc, bool write)
89{
90 return NoFault;
91};
92
93#if FULL_SYSTEM
94
95Tick
96DTB::doMmuRegRead(ThreadContext *tc, Packet *pkt)
97{
98 return tc->getCpuPtr()->cycles(1);
99}
100
101Tick
102DTB::doMmuRegWrite(ThreadContext *tc, Packet *pkt)
103{
104 return tc->getCpuPtr()->cycles(1);
105}
106
107#endif
108
109void
110TLB::serialize(std::ostream &os)
111{
112}
113
114void
115TLB::unserialize(Checkpoint *cp, const std::string &section)
116{
117}
118
119void
120DTB::serialize(std::ostream &os)
121{
122 TLB::serialize(os);
123}
124
125void
126DTB::unserialize(Checkpoint *cp, const std::string &section)
127{
128 TLB::unserialize(cp, section);
129}
130
131/* end namespace X86ISA */ }
132
133#else
134
135#include <cstring>
136
137#include "arch/x86/tlb.hh"
61#include "params/X86DTB.hh"
62#include "params/X86ITB.hh"
63#include "sim/serialize.hh"
64
65namespace X86ISA {
66 void
67 TlbEntry::serialize(std::ostream &os)
68 {
69 SERIALIZE_SCALAR(pageStart);
70 }
71
72 void
73 TlbEntry::unserialize(Checkpoint *cp, const std::string &section)
74 {
75 UNSERIALIZE_SCALAR(pageStart);
76 }
77};
78
138#include "params/X86DTB.hh"
139#include "params/X86ITB.hh"
140#include "sim/serialize.hh"
141
142namespace X86ISA {
143 void
144 TlbEntry::serialize(std::ostream &os)
145 {
146 SERIALIZE_SCALAR(pageStart);
147 }
148
149 void
150 TlbEntry::unserialize(Checkpoint *cp, const std::string &section)
151 {
152 UNSERIALIZE_SCALAR(pageStart);
153 }
154};
155
156#endif
157
79X86ISA::ITB *
80X86ITBParams::create()
81{
82 return new X86ISA::ITB(this);
83}
84
85X86ISA::DTB *
86X86DTBParams::create()
87{
88 return new X86ISA::DTB(this);
89}
158X86ISA::ITB *
159X86ITBParams::create()
160{
161 return new X86ISA::ITB(this);
162}
163
164X86ISA::DTB *
165X86DTBParams::create()
166{
167 return new X86ISA::DTB(this);
168}