backdoor.cc (12239:ae1686aaebc5) backdoor.cc (13232:0e63107dae56)
1/*
2 * Copyright (c) 2001-2005 The Regents of The University of Michigan
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met: redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer;

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

115 pkt->makeAtomicResponse();
116
117 switch (pkt->getSize())
118 {
119 case sizeof(uint32_t):
120 switch (daddr)
121 {
122 case offsetof(AlphaAccess, last_offset):
1/*
2 * Copyright (c) 2001-2005 The Regents of The University of Michigan
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met: redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer;

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

115 pkt->makeAtomicResponse();
116
117 switch (pkt->getSize())
118 {
119 case sizeof(uint32_t):
120 switch (daddr)
121 {
122 case offsetof(AlphaAccess, last_offset):
123 pkt->set(alphaAccess->last_offset);
123 pkt->setLE(alphaAccess->last_offset);
124 break;
125 case offsetof(AlphaAccess, version):
124 break;
125 case offsetof(AlphaAccess, version):
126 pkt->set(alphaAccess->version);
126 pkt->setLE(alphaAccess->version);
127 break;
128 case offsetof(AlphaAccess, numCPUs):
127 break;
128 case offsetof(AlphaAccess, numCPUs):
129 pkt->set(alphaAccess->numCPUs);
129 pkt->setLE(alphaAccess->numCPUs);
130 break;
131 case offsetof(AlphaAccess, intrClockFrequency):
130 break;
131 case offsetof(AlphaAccess, intrClockFrequency):
132 pkt->set(alphaAccess->intrClockFrequency);
132 pkt->setLE(alphaAccess->intrClockFrequency);
133 break;
134 default:
135 /* Old console code read in everyting as a 32bit int
136 * we now break that for better error checking.
137 */
138 pkt->setBadAddress();
139 }
140 DPRINTF(AlphaBackdoor, "read: offset=%#x val=%#x\n", daddr,
133 break;
134 default:
135 /* Old console code read in everyting as a 32bit int
136 * we now break that for better error checking.
137 */
138 pkt->setBadAddress();
139 }
140 DPRINTF(AlphaBackdoor, "read: offset=%#x val=%#x\n", daddr,
141 pkt->get());
141 pkt->getLE<uint32_t>());
142 break;
143 case sizeof(uint64_t):
144 switch (daddr)
145 {
146 case offsetof(AlphaAccess, inputChar):
142 break;
143 case sizeof(uint64_t):
144 switch (daddr)
145 {
146 case offsetof(AlphaAccess, inputChar):
147 pkt->set(terminal->console_in());
147 pkt->setLE(terminal->console_in());
148 break;
149 case offsetof(AlphaAccess, cpuClock):
148 break;
149 case offsetof(AlphaAccess, cpuClock):
150 pkt->set(alphaAccess->cpuClock);
150 pkt->setLE(alphaAccess->cpuClock);
151 break;
152 case offsetof(AlphaAccess, mem_size):
151 break;
152 case offsetof(AlphaAccess, mem_size):
153 pkt->set(alphaAccess->mem_size);
153 pkt->setLE(alphaAccess->mem_size);
154 break;
155 case offsetof(AlphaAccess, kernStart):
154 break;
155 case offsetof(AlphaAccess, kernStart):
156 pkt->set(alphaAccess->kernStart);
156 pkt->setLE(alphaAccess->kernStart);
157 break;
158 case offsetof(AlphaAccess, kernEnd):
157 break;
158 case offsetof(AlphaAccess, kernEnd):
159 pkt->set(alphaAccess->kernEnd);
159 pkt->setLE(alphaAccess->kernEnd);
160 break;
161 case offsetof(AlphaAccess, entryPoint):
160 break;
161 case offsetof(AlphaAccess, entryPoint):
162 pkt->set(alphaAccess->entryPoint);
162 pkt->setLE(alphaAccess->entryPoint);
163 break;
164 case offsetof(AlphaAccess, diskUnit):
163 break;
164 case offsetof(AlphaAccess, diskUnit):
165 pkt->set(alphaAccess->diskUnit);
165 pkt->setLE(alphaAccess->diskUnit);
166 break;
167 case offsetof(AlphaAccess, diskCount):
166 break;
167 case offsetof(AlphaAccess, diskCount):
168 pkt->set(alphaAccess->diskCount);
168 pkt->setLE(alphaAccess->diskCount);
169 break;
170 case offsetof(AlphaAccess, diskPAddr):
169 break;
170 case offsetof(AlphaAccess, diskPAddr):
171 pkt->set(alphaAccess->diskPAddr);
171 pkt->setLE(alphaAccess->diskPAddr);
172 break;
173 case offsetof(AlphaAccess, diskBlock):
172 break;
173 case offsetof(AlphaAccess, diskBlock):
174 pkt->set(alphaAccess->diskBlock);
174 pkt->setLE(alphaAccess->diskBlock);
175 break;
176 case offsetof(AlphaAccess, diskOperation):
175 break;
176 case offsetof(AlphaAccess, diskOperation):
177 pkt->set(alphaAccess->diskOperation);
177 pkt->setLE(alphaAccess->diskOperation);
178 break;
179 case offsetof(AlphaAccess, outputChar):
178 break;
179 case offsetof(AlphaAccess, outputChar):
180 pkt->set(alphaAccess->outputChar);
180 pkt->setLE(alphaAccess->outputChar);
181 break;
182 default:
183 int cpunum = (daddr - offsetof(AlphaAccess, cpuStack)) /
184 sizeof(alphaAccess->cpuStack[0]);
185
186 if (cpunum >= 0 && cpunum < 64)
181 break;
182 default:
183 int cpunum = (daddr - offsetof(AlphaAccess, cpuStack)) /
184 sizeof(alphaAccess->cpuStack[0]);
185
186 if (cpunum >= 0 && cpunum < 64)
187 pkt->set(alphaAccess->cpuStack[cpunum]);
187 pkt->setLE(alphaAccess->cpuStack[cpunum]);
188 else
189 panic("Unknown 64bit access, %#x\n", daddr);
190 }
191 DPRINTF(AlphaBackdoor, "read: offset=%#x val=%#x\n", daddr,
188 else
189 panic("Unknown 64bit access, %#x\n", daddr);
190 }
191 DPRINTF(AlphaBackdoor, "read: offset=%#x val=%#x\n", daddr,
192 pkt->get());
192 pkt->getLE<uint64_t>());
193 break;
194 default:
195 pkt->setBadAddress();
196 }
197 return pioDelay;
198}
199
200Tick
201AlphaBackdoor::write(PacketPtr pkt)
202{
203 assert(pkt->getAddr() >= pioAddr && pkt->getAddr() < pioAddr + pioSize);
204 Addr daddr = pkt->getAddr() - pioAddr;
205
193 break;
194 default:
195 pkt->setBadAddress();
196 }
197 return pioDelay;
198}
199
200Tick
201AlphaBackdoor::write(PacketPtr pkt)
202{
203 assert(pkt->getAddr() >= pioAddr && pkt->getAddr() < pioAddr + pioSize);
204 Addr daddr = pkt->getAddr() - pioAddr;
205
206 uint64_t val = pkt->get();
206 uint64_t val = pkt->getLE<uint64_t>();
207 assert(pkt->getSize() == sizeof(uint64_t));
208
209 switch (daddr) {
210 case offsetof(AlphaAccess, diskUnit):
211 alphaAccess->diskUnit = val;
212 break;
213
214 case offsetof(AlphaAccess, diskCount):

--- 101 unchanged lines hidden ---
207 assert(pkt->getSize() == sizeof(uint64_t));
208
209 switch (daddr) {
210 case offsetof(AlphaAccess, diskUnit):
211 alphaAccess->diskUnit = val;
212 break;
213
214 case offsetof(AlphaAccess, diskCount):

--- 101 unchanged lines hidden ---