gem5  v20.1.0.0
ide_ctrl.cc
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2013 ARM Limited
3  * All rights reserved
4  *
5  * The license below extends only to copyright in the software and shall
6  * not be construed as granting a license to any other intellectual
7  * property including but not limited to intellectual property relating
8  * to a hardware implementation of the functionality of the software
9  * licensed hereunder. You may use the software subject to the license
10  * terms below provided that you ensure that this notice is replicated
11  * unmodified and in its entirety in all distributions of the software,
12  * modified or unmodified, in source code or in binary form.
13  *
14  * Copyright (c) 2004-2005 The Regents of The University of Michigan
15  * All rights reserved.
16  *
17  * Redistribution and use in source and binary forms, with or without
18  * modification, are permitted provided that the following conditions are
19  * met: redistributions of source code must retain the above copyright
20  * notice, this list of conditions and the following disclaimer;
21  * redistributions in binary form must reproduce the above copyright
22  * notice, this list of conditions and the following disclaimer in the
23  * documentation and/or other materials provided with the distribution;
24  * neither the name of the copyright holders nor the names of its
25  * contributors may be used to endorse or promote products derived from
26  * this software without specific prior written permission.
27  *
28  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
29  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
30  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
31  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
32  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
33  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
34  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
35  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
36  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
37  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
38  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
39  */
40 
41 #include "dev/storage/ide_ctrl.hh"
42 
43 #include <string>
44 
45 #include "cpu/intr_control.hh"
46 #include "debug/IdeCtrl.hh"
47 #include "dev/storage/ide_disk.hh"
48 #include "mem/packet.hh"
49 #include "mem/packet_access.hh"
50 #include "params/IdeController.hh"
51 #include "sim/byteswap.hh"
52 
53 // clang complains about std::set being overloaded with Packet::set if
54 // we open up the entire namespace std
55 using std::string;
56 
57 // Bus master IDE registers
59  BMICommand = 0x0,
60  BMIStatus = 0x2,
62 };
63 
64 // PCI config space registers
66  PrimaryTiming = 0x40,
68  DeviceTiming = 0x44,
69  UDMAControl = 0x48,
70  UDMATiming = 0x4A,
71  IDEConfig = 0x54
72 };
73 
74 static const uint16_t timeRegWithDecodeEn = 0x8000;
75 
76 IdeController::Channel::Channel(
77  string newName, Addr _cmdSize, Addr _ctrlSize) :
78  _name(newName),
79  cmdAddr(0), cmdSize(_cmdSize), ctrlAddr(0), ctrlSize(_ctrlSize),
80  device0(NULL), device1(NULL), selected(NULL)
81 {
82  bmiRegs.reset();
83  bmiRegs.status.dmaCap0 = 1;
84  bmiRegs.status.dmaCap1 = 1;
85 }
86 
87 IdeController::Channel::~Channel()
88 {
89 }
90 
92  : PciDevice(p), primary(name() + ".primary", BARSize[0], BARSize[1]),
93  secondary(name() + ".secondary", BARSize[2], BARSize[3]),
94  bmiAddr(0), bmiSize(BARSize[4]),
95  primaryTiming(htole(timeRegWithDecodeEn)),
96  secondaryTiming(htole(timeRegWithDecodeEn)),
97  deviceTiming(0), udmaControl(0), udmaTiming(0), ideConfig(0),
98  ioEnabled(false), bmEnabled(false),
99  ioShift(p->io_shift), ctrlOffset(p->ctrl_offset)
100 {
101 
102  // Assign the disks to channels
103  for (int i = 0; i < params()->disks.size(); i++) {
104  if (!params()->disks[i])
105  continue;
106  switch (i) {
107  case 0:
108  primary.device0 = params()->disks[0];
109  break;
110  case 1:
111  primary.device1 = params()->disks[1];
112  break;
113  case 2:
114  secondary.device0 = params()->disks[2];
115  break;
116  case 3:
117  secondary.device1 = params()->disks[3];
118  break;
119  default:
120  panic("IDE controllers support a maximum "
121  "of 4 devices attached!\n");
122  }
123  params()->disks[i]->setController(this, sys->getPageBytes());
124  }
125 
126  primary.select(false);
127  secondary.select(false);
128 
129  if ((BARAddrs[0] & ~BAR_IO_MASK) && (!legacyIO[0] || ioShift)) {
130  primary.cmdAddr = BARAddrs[0]; primary.cmdSize = BARSize[0];
131  primary.ctrlAddr = BARAddrs[1]; primary.ctrlSize = BARSize[1];
132  }
133  if ((BARAddrs[2] & ~BAR_IO_MASK) && (!legacyIO[2] || ioShift)) {
134  secondary.cmdAddr = BARAddrs[2]; secondary.cmdSize = BARSize[2];
135  secondary.ctrlAddr = BARAddrs[3]; secondary.ctrlSize = BARSize[3];
136  }
137 
140 }
141 
142 bool
144 {
145  return (primary.selected == diskPtr || secondary.selected == diskPtr);
146 }
147 
148 void
150 {
151  primary.bmiRegs.status.intStatus = 1;
153 }
154 
155 void
157 {
158  Channel *channel;
159  if (disk == primary.device0 || disk == primary.device1) {
160  channel = &primary;
161  } else if (disk == secondary.device0 || disk == secondary.device1) {
162  channel = &secondary;
163  } else {
164  panic("Unable to find disk based on pointer %#x\n", disk);
165  }
166 
167  channel->bmiRegs.command.startStop = 0;
168  channel->bmiRegs.status.active = 0;
169  channel->bmiRegs.status.intStatus = 1;
170 }
171 
172 Tick
174 {
175  int offset = pkt->getAddr() & PCI_CONFIG_SIZE;
176  if (offset < PCI_DEVICE_SPECIFIC) {
177  return PciDevice::readConfig(pkt);
178  }
179 
180  switch (pkt->getSize()) {
181  case sizeof(uint8_t):
182  switch (offset) {
183  case DeviceTiming:
184  pkt->setLE<uint8_t>(deviceTiming);
185  break;
186  case UDMAControl:
187  pkt->setLE<uint8_t>(udmaControl);
188  break;
189  case PrimaryTiming + 1:
190  pkt->setLE<uint8_t>(bits(htole(primaryTiming), 15, 8));
191  break;
192  case SecondaryTiming + 1:
193  pkt->setLE<uint8_t>(bits(htole(secondaryTiming), 15, 8));
194  break;
195  case IDEConfig:
196  pkt->setLE<uint8_t>(bits(htole(ideConfig), 7, 0));
197  break;
198  case IDEConfig + 1:
199  pkt->setLE<uint8_t>(bits(htole(ideConfig), 15, 8));
200  break;
201  default:
202  panic("Invalid PCI configuration read for size 1 at offset: %#x!\n",
203  offset);
204  }
205  DPRINTF(IdeCtrl, "PCI read offset: %#x size: 1 data: %#x\n", offset,
206  (uint32_t)pkt->getLE<uint8_t>());
207  break;
208  case sizeof(uint16_t):
209  switch (offset) {
210  case UDMAControl:
211  pkt->setLE<uint16_t>(udmaControl);
212  break;
213  case PrimaryTiming:
214  pkt->setLE<uint16_t>(primaryTiming);
215  break;
216  case SecondaryTiming:
217  pkt->setLE<uint16_t>(secondaryTiming);
218  break;
219  case UDMATiming:
220  pkt->setLE<uint16_t>(udmaTiming);
221  break;
222  case IDEConfig:
223  pkt->setLE<uint16_t>(ideConfig);
224  break;
225  default:
226  panic("Invalid PCI configuration read for size 2 offset: %#x!\n",
227  offset);
228  }
229  DPRINTF(IdeCtrl, "PCI read offset: %#x size: 2 data: %#x\n", offset,
230  (uint32_t)pkt->getLE<uint16_t>());
231  break;
232  case sizeof(uint32_t):
233  switch (offset) {
234  case PrimaryTiming:
235  pkt->setLE<uint32_t>(primaryTiming);
236  break;
237  case IDEConfig:
238  pkt->setLE<uint32_t>(ideConfig);
239  break;
240  default:
241  panic("No 32bit reads implemented for this device.");
242  }
243  DPRINTF(IdeCtrl, "PCI read offset: %#x size: 4 data: %#x\n", offset,
244  (uint32_t)pkt->getLE<uint32_t>());
245  break;
246  default:
247  panic("invalid access size(?) for PCI configspace!\n");
248  }
249  pkt->makeAtomicResponse();
250  return configDelay;
251 }
252 
253 
254 Tick
256 {
257  int offset = pkt->getAddr() & PCI_CONFIG_SIZE;
258  if (offset < PCI_DEVICE_SPECIFIC) {
260  } else {
261  switch (pkt->getSize()) {
262  case sizeof(uint8_t):
263  switch (offset) {
264  case DeviceTiming:
265  deviceTiming = pkt->getLE<uint8_t>();
266  break;
267  case UDMAControl:
268  udmaControl = pkt->getLE<uint8_t>();
269  break;
270  case IDEConfig:
271  replaceBits(ideConfig, 7, 0, pkt->getLE<uint8_t>());
272  break;
273  case IDEConfig + 1:
274  replaceBits(ideConfig, 15, 8, pkt->getLE<uint8_t>());
275  break;
276  default:
277  panic("Invalid PCI configuration write "
278  "for size 1 offset: %#x!\n", offset);
279  }
280  DPRINTF(IdeCtrl, "PCI write offset: %#x size: 1 data: %#x\n",
281  offset, (uint32_t)pkt->getLE<uint8_t>());
282  break;
283  case sizeof(uint16_t):
284  switch (offset) {
285  case UDMAControl:
286  udmaControl = pkt->getLE<uint16_t>();
287  break;
288  case PrimaryTiming:
289  primaryTiming = pkt->getLE<uint16_t>();
290  break;
291  case SecondaryTiming:
292  secondaryTiming = pkt->getLE<uint16_t>();
293  break;
294  case UDMATiming:
295  udmaTiming = pkt->getLE<uint16_t>();
296  break;
297  case IDEConfig:
298  ideConfig = pkt->getLE<uint16_t>();
299  break;
300  default:
301  panic("Invalid PCI configuration write "
302  "for size 2 offset: %#x!\n",
303  offset);
304  }
305  DPRINTF(IdeCtrl, "PCI write offset: %#x size: 2 data: %#x\n",
306  offset, (uint32_t)pkt->getLE<uint16_t>());
307  break;
308  case sizeof(uint32_t):
309  switch (offset) {
310  case PrimaryTiming:
311  primaryTiming = pkt->getLE<uint32_t>();
312  break;
313  case IDEConfig:
314  ideConfig = pkt->getLE<uint32_t>();
315  break;
316  default:
317  panic("Write of unimplemented PCI config. register: %x\n", offset);
318  }
319  break;
320  default:
321  panic("invalid access size(?) for PCI configspace!\n");
322  }
323  pkt->makeAtomicResponse();
324  }
325 
326  /* Trap command register writes and enable IO/BM as appropriate as well as
327  * BARs. */
328  switch(offset) {
329  case PCI0_BASE_ADDR0:
330  if (BARAddrs[0] != 0)
331  primary.cmdAddr = BARAddrs[0];
332  break;
333 
334  case PCI0_BASE_ADDR1:
335  if (BARAddrs[1] != 0)
336  primary.ctrlAddr = BARAddrs[1];
337  break;
338 
339  case PCI0_BASE_ADDR2:
340  if (BARAddrs[2] != 0)
341  secondary.cmdAddr = BARAddrs[2];
342  break;
343 
344  case PCI0_BASE_ADDR3:
345  if (BARAddrs[3] != 0)
346  secondary.ctrlAddr = BARAddrs[3];
347  break;
348 
349  case PCI0_BASE_ADDR4:
350  if (BARAddrs[4] != 0)
351  bmiAddr = BARAddrs[4];
352  break;
353 
354  case PCI_COMMAND:
355  DPRINTF(IdeCtrl, "Writing to PCI Command val: %#x\n", config.command);
358  break;
359  }
360  return configDelay;
361 }
362 
363 void
364 IdeController::Channel::accessCommand(Addr offset,
365  int size, uint8_t *data, bool read)
366 {
367  const Addr SelectOffset = 6;
368  const uint8_t SelectDevBit = 0x10;
369 
370  if (!read && offset == SelectOffset)
371  select(*data & SelectDevBit);
372 
373  if (selected == NULL) {
374  assert(size == sizeof(uint8_t));
375  *data = 0;
376  } else if (read) {
377  selected->readCommand(offset, size, data);
378  } else {
379  selected->writeCommand(offset, size, data);
380  }
381 }
382 
383 void
384 IdeController::Channel::accessControl(Addr offset,
385  int size, uint8_t *data, bool read)
386 {
387  if (selected == NULL) {
388  assert(size == sizeof(uint8_t));
389  *data = 0;
390  } else if (read) {
391  selected->readControl(offset, size, data);
392  } else {
393  selected->writeControl(offset, size, data);
394  }
395 }
396 
397 void
398 IdeController::Channel::accessBMI(Addr offset,
399  int size, uint8_t *data, bool read)
400 {
401  assert(offset + size <= sizeof(BMIRegs));
402  if (read) {
403  memcpy(data, (uint8_t *)&bmiRegs + offset, size);
404  } else {
405  switch (offset) {
406  case BMICommand:
407  {
408  if (size != sizeof(uint8_t))
409  panic("Invalid BMIC write size: %x\n", size);
410 
411  BMICommandReg oldVal = bmiRegs.command;
412  BMICommandReg newVal = *data;
413 
414  // if a DMA transfer is in progress, R/W control cannot change
415  if (oldVal.startStop && oldVal.rw != newVal.rw)
416  oldVal.rw = newVal.rw;
417 
418  if (oldVal.startStop != newVal.startStop) {
419  if (selected == NULL)
420  panic("DMA start for disk which does not exist\n");
421 
422  if (oldVal.startStop) {
423  DPRINTF(IdeCtrl, "Stopping DMA transfer\n");
424  bmiRegs.status.active = 0;
425 
426  selected->abortDma();
427  } else {
428  DPRINTF(IdeCtrl, "Starting DMA transfer\n");
429  bmiRegs.status.active = 1;
430 
431  selected->startDma(letoh(bmiRegs.bmidtp));
432  }
433  }
434 
435  bmiRegs.command = newVal;
436  }
437  break;
438  case BMIStatus:
439  {
440  if (size != sizeof(uint8_t))
441  panic("Invalid BMIS write size: %x\n", size);
442 
443  BMIStatusReg oldVal = bmiRegs.status;
444  BMIStatusReg newVal = *data;
445 
446  // the BMIDEA bit is read only
447  newVal.active = oldVal.active;
448 
449  // to reset (set 0) IDEINTS and IDEDMAE, write 1 to each
450  if ((oldVal.intStatus == 1) && (newVal.intStatus == 1)) {
451  newVal.intStatus = 0; // clear the interrupt?
452  } else {
453  // Assigning two bitunion fields to each other does not
454  // work as intended, so we need to use this temporary variable
455  // to get around the bug.
456  uint8_t tmp = oldVal.intStatus;
457  newVal.intStatus = tmp;
458  }
459  if ((oldVal.dmaError == 1) && (newVal.dmaError == 1)) {
460  newVal.dmaError = 0;
461  } else {
462  uint8_t tmp = oldVal.dmaError;
463  newVal.dmaError = tmp;
464  }
465 
466  bmiRegs.status = newVal;
467  }
468  break;
469  case BMIDescTablePtr:
470  if (size != sizeof(uint32_t))
471  panic("Invalid BMIDTP write size: %x\n", size);
472  bmiRegs.bmidtp = htole(*(uint32_t *)data & ~0x3);
473  break;
474  default:
475  if (size != sizeof(uint8_t) && size != sizeof(uint16_t) &&
476  size != sizeof(uint32_t))
477  panic("IDE controller write of invalid write size: %x\n", size);
478  memcpy((uint8_t *)&bmiRegs + offset, data, size);
479  }
480  }
481 }
482 
483 void
485 {
486  if (pkt->getSize() != 1 && pkt->getSize() != 2 && pkt->getSize() !=4)
487  panic("Bad IDE read size: %d\n", pkt->getSize());
488 
489  if (!ioEnabled) {
490  pkt->makeAtomicResponse();
491  DPRINTF(IdeCtrl, "io not enabled\n");
492  return;
493  }
494 
495  Addr addr = pkt->getAddr();
496  int size = pkt->getSize();
497  uint8_t *dataPtr = pkt->getPtr<uint8_t>();
498 
499  if (addr >= primary.cmdAddr &&
500  addr < (primary.cmdAddr + primary.cmdSize)) {
501  addr -= primary.cmdAddr;
502  // linux may have shifted the address by ioShift,
503  // here we shift it back, similarly for ctrlOffset.
504  addr >>= ioShift;
505  primary.accessCommand(addr, size, dataPtr, read);
506  } else if (addr >= primary.ctrlAddr &&
507  addr < (primary.ctrlAddr + primary.ctrlSize)) {
508  addr -= primary.ctrlAddr;
509  addr += ctrlOffset;
510  primary.accessControl(addr, size, dataPtr, read);
511  } else if (addr >= secondary.cmdAddr &&
512  addr < (secondary.cmdAddr + secondary.cmdSize)) {
513  addr -= secondary.cmdAddr;
514  secondary.accessCommand(addr, size, dataPtr, read);
515  } else if (addr >= secondary.ctrlAddr &&
516  addr < (secondary.ctrlAddr + secondary.ctrlSize)) {
517  addr -= secondary.ctrlAddr;
518  secondary.accessControl(addr, size, dataPtr, read);
519  } else if (addr >= bmiAddr && addr < (bmiAddr + bmiSize)) {
520  if (!read && !bmEnabled)
521  return;
522  addr -= bmiAddr;
523  if (addr < sizeof(Channel::BMIRegs)) {
524  primary.accessBMI(addr, size, dataPtr, read);
525  } else {
526  addr -= sizeof(Channel::BMIRegs);
527  secondary.accessBMI(addr, size, dataPtr, read);
528  }
529  } else {
530  panic("IDE controller access to invalid address: %#x\n", addr);
531  }
532 
533 #ifndef NDEBUG
534  uint32_t data;
535  if (pkt->getSize() == 1)
536  data = pkt->getLE<uint8_t>();
537  else if (pkt->getSize() == 2)
538  data = pkt->getLE<uint16_t>();
539  else
540  data = pkt->getLE<uint32_t>();
541  DPRINTF(IdeCtrl, "%s from offset: %#x size: %#x data: %#x\n",
542  read ? "Read" : "Write", pkt->getAddr(), pkt->getSize(), data);
543 #endif
544 
545  pkt->makeAtomicResponse();
546 }
547 
548 Tick
550 {
551  dispatchAccess(pkt, true);
552  return pioDelay;
553 }
554 
555 Tick
557 {
558  dispatchAccess(pkt, false);
559  return pioDelay;
560 }
561 
562 void
564 {
565  // Serialize the PciDevice base class
567 
568  // Serialize channels
569  primary.serialize("primary", cp);
570  secondary.serialize("secondary", cp);
571 
572  // Serialize config registers
579 
580  // Serialize internal state
585 }
586 
587 void
588 IdeController::Channel::serialize(const std::string &base,
589  CheckpointOut &cp) const
590 {
591  paramOut(cp, base + ".cmdAddr", cmdAddr);
592  paramOut(cp, base + ".cmdSize", cmdSize);
593  paramOut(cp, base + ".ctrlAddr", ctrlAddr);
594  paramOut(cp, base + ".ctrlSize", ctrlSize);
595  uint8_t command = bmiRegs.command;
596  paramOut(cp, base + ".bmiRegs.command", command);
597  paramOut(cp, base + ".bmiRegs.reserved0", bmiRegs.reserved0);
598  uint8_t status = bmiRegs.status;
599  paramOut(cp, base + ".bmiRegs.status", status);
600  paramOut(cp, base + ".bmiRegs.reserved1", bmiRegs.reserved1);
601  paramOut(cp, base + ".bmiRegs.bmidtp", bmiRegs.bmidtp);
602  paramOut(cp, base + ".selectBit", selectBit);
603 }
604 
605 void
607 {
608  // Unserialize the PciDevice base class
610 
611  // Unserialize channels
612  primary.unserialize("primary", cp);
613  secondary.unserialize("secondary", cp);
614 
615  // Unserialize config registers
622 
623  // Unserialize internal state
628 }
629 
630 void
632 {
633  paramIn(cp, base + ".cmdAddr", cmdAddr);
634  paramIn(cp, base + ".cmdSize", cmdSize);
635  paramIn(cp, base + ".ctrlAddr", ctrlAddr);
636  paramIn(cp, base + ".ctrlSize", ctrlSize);
637  uint8_t command;
638  paramIn(cp, base +".bmiRegs.command", command);
639  bmiRegs.command = command;
640  paramIn(cp, base + ".bmiRegs.reserved0", bmiRegs.reserved0);
641  uint8_t status;
642  paramIn(cp, base + ".bmiRegs.status", status);
643  bmiRegs.status = status;
644  paramIn(cp, base + ".bmiRegs.reserved1", bmiRegs.reserved1);
645  paramIn(cp, base + ".bmiRegs.bmidtp", bmiRegs.bmidtp);
646  paramIn(cp, base + ".selectBit", selectBit);
647  select(selectBit);
648 }
649 
651 IdeControllerParams::create()
652 {
653  return new IdeController(this);
654 }
UDMAControl
@ UDMAControl
Definition: ide_ctrl.cc:69
ConfRegOffset
ConfRegOffset
Definition: ide_ctrl.cc:65
ArmISA::status
Bitfield< 5, 0 > status
Definition: miscregs_types.hh:417
Packet::makeAtomicResponse
void makeAtomicResponse()
Definition: packet.hh:1016
BMIStatus
@ BMIStatus
Definition: ide_ctrl.cc:60
replaceBits
void replaceBits(T &val, int first, int last, B bit_val)
A convenience function to replace bits first to last of val with bit_val in place.
Definition: bitfield.hh:179
BMICommand
@ BMICommand
Definition: ide_ctrl.cc:59
IdeController::ctrlOffset
uint32_t ctrlOffset
Definition: ide_ctrl.hh:140
data
const char data[]
Definition: circlebuf.test.cc:42
UNSERIALIZE_SCALAR
#define UNSERIALIZE_SCALAR(scalar)
Definition: serialize.hh:797
Packet::getAddr
Addr getAddr() const
Definition: packet.hh:754
timeRegWithDecodeEn
static const uint16_t timeRegWithDecodeEn
Definition: ide_ctrl.cc:74
IdeController
Device model for an Intel PIIX4 IDE controller.
Definition: ide_ctrl.hh:48
ArmISA::i
Bitfield< 7 > i
Definition: miscregs_types.hh:63
System::getPageBytes
Addr getPageBytes() const
Get the page bytes for the ISA.
Definition: system.hh:396
PCI_CMD_BME
#define PCI_CMD_BME
Definition: pcireg.h:101
PciDevice::writeConfig
virtual Tick writeConfig(PacketPtr pkt)
Write to the PCI config space data that is stored locally.
Definition: device.cc:284
IdeController::serialize
void serialize(CheckpointOut &cp) const override
Serialize this object to the given output stream.
Definition: ide_ctrl.cc:563
htole
T htole(T value)
Definition: byteswap.hh:140
PciDevice::readConfig
virtual Tick readConfig(PacketPtr pkt)
Read from the PCI config space data that is stored locally.
Definition: device.cc:216
IdeController::IdeController
IdeController(Params *p)
Definition: ide_ctrl.cc:91
Tick
uint64_t Tick
Tick count type.
Definition: types.hh:63
IdeController::udmaTiming
uint16_t udmaTiming
Definition: ide_ctrl.hh:133
IdeController::write
Tick write(PacketPtr pkt) override
Pure virtual function that the device must implement.
Definition: ide_ctrl.cc:556
IdeController::udmaControl
uint8_t udmaControl
Definition: ide_ctrl.hh:132
serialize
void serialize(const ThreadContext &tc, CheckpointOut &cp)
Thread context serialization helpers.
Definition: thread_context.cc:142
PCI0_BASE_ADDR4
#define PCI0_BASE_ADDR4
Definition: pcireg.h:110
PciDevice::config
PCIConfig config
The current config space.
Definition: device.hh:72
X86ISA::base
Bitfield< 51, 12 > base
Definition: pagetable.hh:141
IdeController::secondaryTiming
uint16_t secondaryTiming
Definition: ide_ctrl.hh:130
Packet::getSize
unsigned getSize() const
Definition: packet.hh:764
PCI_COMMAND
#define PCI_COMMAND
Definition: pcireg.h:89
IdeController::bmiSize
Addr bmiSize
Definition: ide_ctrl.hh:127
paramOut
void paramOut(CheckpointOut &cp, const string &name, ExtMachInst const &machInst)
Definition: types.cc:38
IdeController::read
Tick read(PacketPtr pkt) override
Pure virtual function that the device must implement.
Definition: ide_ctrl.cc:549
PCI_DEVICE_SPECIFIC
#define PCI_DEVICE_SPECIFIC
Definition: pcireg.h:148
IdeController::deviceTiming
uint8_t deviceTiming
Definition: ide_ctrl.hh:131
unserialize
void unserialize(ThreadContext &tc, CheckpointIn &cp)
Definition: thread_context.cc:183
packet.hh
PioDevice::sys
System * sys
Definition: io_device.hh:102
letoh
T letoh(T value)
Definition: byteswap.hh:141
IdeController::isDiskSelected
bool isDiskSelected(IdeDisk *diskPtr)
See if a disk is selected based on its pointer.
Definition: ide_ctrl.cc:143
cp
Definition: cprintf.cc:40
PCI0_BASE_ADDR0
#define PCI0_BASE_ADDR0
Definition: pcireg.h:106
PciDevice::BARSize
uint32_t BARSize[6]
The size of the BARs.
Definition: device.hh:106
IdeController::dispatchAccess
void dispatchAccess(PacketPtr pkt, bool read)
Definition: ide_ctrl.cc:484
IdeController::setDmaComplete
void setDmaComplete(IdeDisk *disk)
Definition: ide_ctrl.cc:156
DPRINTF
#define DPRINTF(x,...)
Definition: trace.hh:234
PciDevice::serialize
void serialize(CheckpointOut &cp) const override
Serialize this object to the given output stream.
Definition: device.cc:442
IdeController::params
const Params * params() const
Definition: ide_ctrl.hh:146
ide_disk.hh
DeviceTiming
@ DeviceTiming
Definition: ide_ctrl.cc:68
PciDevice::unserialize
void unserialize(CheckpointIn &cp) override
Reconstruct the state of this object from a checkpoint.
Definition: device.cc:507
PCI_CMD_IOSE
#define PCI_CMD_IOSE
Definition: pcireg.h:103
IdeController::ioEnabled
bool ioEnabled
Definition: ide_ctrl.hh:137
PrimaryTiming
@ PrimaryTiming
Definition: ide_ctrl.cc:66
BMIRegOffset
BMIRegOffset
Definition: ide_ctrl.cc:58
Addr
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
Definition: types.hh:142
UDMATiming
@ UDMATiming
Definition: ide_ctrl.cc:70
IdeController::writeConfig
Tick writeConfig(PacketPtr pkt) override
Write to the PCI config space data that is stored locally.
Definition: ide_ctrl.cc:255
name
const std::string & name()
Definition: trace.cc:50
SERIALIZE_SCALAR
#define SERIALIZE_SCALAR(scalar)
Definition: serialize.hh:790
IdeDisk
IDE Disk device model.
Definition: ide_disk.hh:205
packet_access.hh
IdeController::ioShift
uint32_t ioShift
Definition: ide_ctrl.hh:140
PciDevice::configDelay
Tick configDelay
Definition: device.hh:191
IDEConfig
@ IDEConfig
Definition: ide_ctrl.cc:71
IdeController::primary
Channel primary
Definition: ide_ctrl.hh:121
IdeController::ideConfig
uint16_t ideConfig
Definition: ide_ctrl.hh:134
SecondaryTiming
@ SecondaryTiming
Definition: ide_ctrl.cc:67
Packet::getLE
T getLE() const
Get the data in the packet byte swapped from little endian to host endian.
Definition: packet_access.hh:75
IdeController::readConfig
Tick readConfig(PacketPtr pkt) override
Read from the PCI config space data that is stored locally.
Definition: ide_ctrl.cc:173
intr_control.hh
Packet
A Packet is used to encapsulate a transfer between two objects in the memory system (e....
Definition: packet.hh:257
IdeController::bmiAddr
Addr bmiAddr
Bus master interface (BMI) registers.
Definition: ide_ctrl.hh:127
BAR_IO_MASK
#define BAR_IO_MASK
Definition: device.hh:57
addr
ip6_addr_t addr
Definition: inet.hh:423
PCIConfig::command
uint16_t command
Definition: pcireg.h:59
ide_ctrl.hh
paramIn
void paramIn(CheckpointIn &cp, const string &name, ExtMachInst &machInst)
Definition: types.cc:69
IdeController::primaryTiming
uint16_t primaryTiming
Registers used in device specific PCI configuration.
Definition: ide_ctrl.hh:130
Packet::setLE
void setLE(T v)
Set the value in the data pointer to v as little endian.
Definition: packet_access.hh:105
Packet::getPtr
T * getPtr()
get a pointer to the data ptr.
Definition: packet.hh:1157
PciDevice::pioDelay
Tick pioDelay
Definition: device.hh:190
PCI0_BASE_ADDR1
#define PCI0_BASE_ADDR1
Definition: pcireg.h:107
CheckpointOut
std::ostream CheckpointOut
Definition: serialize.hh:63
PciDevice::intrPost
void intrPost()
Definition: device.hh:198
IdeController::intrPost
void intrPost()
Definition: ide_ctrl.cc:149
IdeController::secondary
Channel secondary
Definition: ide_ctrl.hh:124
MipsISA::p
Bitfield< 0 > p
Definition: pra_constants.hh:323
PCI_CONFIG_SIZE
#define PCI_CONFIG_SIZE
Definition: pcireg.h:149
BMIDescTablePtr
@ BMIDescTablePtr
Definition: ide_ctrl.cc:61
PciDevice::BARAddrs
Addr BARAddrs[6]
The current address mapping of the BARs.
Definition: device.hh:109
CheckpointIn
Definition: serialize.hh:67
PCI0_BASE_ADDR3
#define PCI0_BASE_ADDR3
Definition: pcireg.h:109
PciDevice::legacyIO
bool legacyIO[6]
Whether the BARs are really hardwired legacy IO locations.
Definition: device.hh:112
PciDevice
PCI device, base implementation is only config space.
Definition: device.hh:66
DmaDevice::Params
DmaDeviceParams Params
Definition: dma_device.hh:171
IdeController::unserialize
void unserialize(CheckpointIn &cp) override
Reconstruct the state of this object from a checkpoint.
Definition: ide_ctrl.cc:606
byteswap.hh
panic
#define panic(...)
This implements a cprintf based panic() function.
Definition: logging.hh:171
ArmISA::offset
Bitfield< 23, 0 > offset
Definition: types.hh:153
IdeController::bmEnabled
bool bmEnabled
Definition: ide_ctrl.hh:138
bits
T bits(T val, int first, int last)
Extract the bitfield from position 'first' to 'last' (inclusive) from 'val' and right justify it.
Definition: bitfield.hh:75
PCI0_BASE_ADDR2
#define PCI0_BASE_ADDR2
Definition: pcireg.h:108

Generated on Wed Sep 30 2020 14:02:11 for gem5 by doxygen 1.8.17