io_device.cc (8914:8c3bd7bea667) io_device.cc (8922:17f037ad8918)
1/*
2 * Copyright (c) 2006 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;

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

66void
67PioDevice::init()
68{
69 if (!pioPort.isConnected())
70 panic("Pio port of %s not connected to anything!", name());
71 pioPort.sendRangeChange();
72}
73
1/*
2 * Copyright (c) 2006 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;

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

66void
67PioDevice::init()
68{
69 if (!pioPort.isConnected())
70 panic("Pio port of %s not connected to anything!", name());
71 pioPort.sendRangeChange();
72}
73
74Port *
75PioDevice::getPort(const std::string &if_name, int idx)
74SlavePort &
75PioDevice::getSlavePort(const std::string &if_name, int idx)
76{
77 if (if_name == "pio") {
76{
77 if (if_name == "pio") {
78 return &pioPort;
78 return pioPort;
79 }
79 }
80 panic("PioDevice %s has no port named %s\n", name(), if_name);
81 return NULL;
80 return MemObject::getSlavePort(if_name, idx);
82}
83
84unsigned int
85PioDevice::drain(Event *de)
86{
87 unsigned int count;
88 count = pioPort.drain(de);
89 if (count)

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

106 DPRINTF(BusAddrRanges, "registering range: %#x-%#x\n", pioAddr, pioSize);
107 ranges.push_back(RangeSize(pioAddr, pioSize));
108 return ranges;
109}
110
111
112DmaPort::DmaPort(MemObject *dev, System *s, Tick min_backoff, Tick max_backoff,
113 bool recv_snoops)
81}
82
83unsigned int
84PioDevice::drain(Event *de)
85{
86 unsigned int count;
87 count = pioPort.drain(de);
88 if (count)

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

105 DPRINTF(BusAddrRanges, "registering range: %#x-%#x\n", pioAddr, pioSize);
106 ranges.push_back(RangeSize(pioAddr, pioSize));
107 return ranges;
108}
109
110
111DmaPort::DmaPort(MemObject *dev, System *s, Tick min_backoff, Tick max_backoff,
112 bool recv_snoops)
114 : Port(dev->name() + "-dmaport", dev), device(dev), sys(s),
113 : MasterPort(dev->name() + "-dmaport", dev), device(dev), sys(s),
115 masterId(s->getMasterId(dev->name())),
116 pendingCount(0), actionInProgress(0), drainEvent(NULL),
117 backoffTime(0), minBackoffDelay(min_backoff),
118 maxBackoffDelay(max_backoff), inRetry(false), recvSnoops(recv_snoops),
119 backoffEvent(this)
120{ }
121
122bool

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

365 panic("Unknown memory command state.");
366}
367
368DmaDevice::~DmaDevice()
369{
370}
371
372
114 masterId(s->getMasterId(dev->name())),
115 pendingCount(0), actionInProgress(0), drainEvent(NULL),
116 backoffTime(0), minBackoffDelay(min_backoff),
117 maxBackoffDelay(max_backoff), inRetry(false), recvSnoops(recv_snoops),
118 backoffEvent(this)
119{ }
120
121bool

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

364 panic("Unknown memory command state.");
365}
366
367DmaDevice::~DmaDevice()
368{
369}
370
371
373Port *
374DmaDevice::getPort(const std::string &if_name, int idx)
372MasterPort &
373DmaDevice::getMasterPort(const std::string &if_name, int idx)
375{
376 if (if_name == "dma") {
374{
375 if (if_name == "dma") {
377 return &dmaPort;
376 return dmaPort;
378 }
377 }
379 return PioDevice::getPort(if_name, idx);
378 return PioDevice::getMasterPort(if_name, idx);
380}
381
379}
380