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->setLE(alphaAccess->last_offset); |
124 break; 125 case offsetof(AlphaAccess, version): |
126 pkt->setLE(alphaAccess->version); |
127 break; 128 case offsetof(AlphaAccess, numCPUs): |
129 pkt->setLE(alphaAccess->numCPUs); |
130 break; 131 case offsetof(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, |
141 pkt->getLE<uint32_t>()); |
142 break; 143 case sizeof(uint64_t): 144 switch (daddr) 145 { 146 case offsetof(AlphaAccess, inputChar): |
147 pkt->setLE(terminal->console_in()); |
148 break; 149 case offsetof(AlphaAccess, cpuClock): |
150 pkt->setLE(alphaAccess->cpuClock); |
151 break; 152 case offsetof(AlphaAccess, mem_size): |
153 pkt->setLE(alphaAccess->mem_size); |
154 break; 155 case offsetof(AlphaAccess, kernStart): |
156 pkt->setLE(alphaAccess->kernStart); |
157 break; 158 case offsetof(AlphaAccess, kernEnd): |
159 pkt->setLE(alphaAccess->kernEnd); |
160 break; 161 case offsetof(AlphaAccess, entryPoint): |
162 pkt->setLE(alphaAccess->entryPoint); |
163 break; 164 case offsetof(AlphaAccess, diskUnit): |
165 pkt->setLE(alphaAccess->diskUnit); |
166 break; 167 case offsetof(AlphaAccess, diskCount): |
168 pkt->setLE(alphaAccess->diskCount); |
169 break; 170 case offsetof(AlphaAccess, diskPAddr): |
171 pkt->setLE(alphaAccess->diskPAddr); |
172 break; 173 case offsetof(AlphaAccess, diskBlock): |
174 pkt->setLE(alphaAccess->diskBlock); |
175 break; 176 case offsetof(AlphaAccess, diskOperation): |
177 pkt->setLE(alphaAccess->diskOperation); |
178 break; 179 case offsetof(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) |
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, |
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 |
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 --- |