Deleted Added
sdiff udiff text old ( 11176:741b3059946e ) new ( 11274:d9a0136ab8cc )
full compact
1/*
2 * Copyright 2015 LabWare
3 * Copyright 2014 Google, Inc.
4 * Copyright (c) 2010 ARM Limited
5 * All rights reserved
6 *
7 * The license below extends only to copyright in the software and shall
8 * not be construed as granting a license to any other intellectual
9 * property including but not limited to intellectual property relating
10 * to a hardware implementation of the functionality of the software

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

145#include "debug/GDBAcc.hh"
146#include "debug/GDBMisc.hh"
147#include "sim/byteswap.hh"
148
149using namespace std;
150using namespace PowerISA;
151
152RemoteGDB::RemoteGDB(System *_system, ThreadContext *tc)
153 : BaseRemoteGDB(_system, tc)
154{
155}
156
157/*
158 * Determine if the mapping at va..(va+len) is valid.
159 */
160bool
161RemoteGDB::acc(Addr va, size_t len)

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

167 //port proxy to read/writeBlob. I (bgs) am not convinced the first byte
168 //check is enough.
169 if (FullSystem)
170 panic("acc not implemented for POWER FS!");
171 else
172 return context->getProcessPtr()->pTable->lookup(va, entry);
173}
174
175void
176RemoteGDB::PowerGdbRegCache::getRegs(ThreadContext *context)
177{
178 DPRINTF(GDBAcc, "getRegs in remotegdb \n");
179
180 // Default order on 32-bit PowerPC:
181 // R0-R31 (32-bit each), F0-F31 (64-bit IEEE754 double),
182 // PC, MSR, CR, LR, CTR, XER (32-bit each)
183
184 for (int i = 0; i < NumIntArchRegs; i++)
185 r.gpr[i] = htobe((uint32_t)context->readIntReg(i));
186
187 for (int i = 0; i < NumFloatArchRegs; i++)
188 r.fpr[i] = context->readFloatRegBits(i);
189
190 r.pc = htobe((uint32_t)context->pcState().pc());
191 r.msr = 0; // Is MSR modeled?
192 r.cr = htobe((uint32_t)context->readIntReg(INTREG_CR));
193 r.lr = htobe((uint32_t)context->readIntReg(INTREG_LR));
194 r.ctr = htobe((uint32_t)context->readIntReg(INTREG_CTR));
195 r.xer = htobe((uint32_t)context->readIntReg(INTREG_XER));
196}
197
198void
199RemoteGDB::PowerGdbRegCache::setRegs(ThreadContext *context) const
200{
201 DPRINTF(GDBAcc, "setRegs in remotegdb \n");
202
203 for (int i = 0; i < NumIntArchRegs; i++)
204 context->setIntReg(i, betoh(r.gpr[i]));
205
206 for (int i = 0; i < NumFloatArchRegs; i++)
207 context->setFloatRegBits(i, r.fpr[i]);
208
209 context->pcState(betoh(r.pc));
210 // Is MSR modeled?
211 context->setIntReg(INTREG_CR, betoh(r.cr));
212 context->setIntReg(INTREG_LR, betoh(r.lr));
213 context->setIntReg(INTREG_CTR, betoh(r.ctr));
214 context->setIntReg(INTREG_XER, betoh(r.xer));
215}
216
217RemoteGDB::BaseGdbRegCache*
218RemoteGDB::gdbRegs() {
219 return new PowerGdbRegCache(this);
220}
221