io_device.hh (4022:c422464ca16e) io_device.hh (4263:1cd4e07ab60b)
1/*
2 * Copyright (c) 2004-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;

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

127 public:
128 DmaPort(DmaDevice *dev, System *s);
129
130 void dmaAction(Packet::Command cmd, Addr addr, int size, Event *event,
131 uint8_t *data = NULL);
132
133 bool dmaPending() { return pendingCount > 0; }
134
1/*
2 * Copyright (c) 2004-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;

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

127 public:
128 DmaPort(DmaDevice *dev, System *s);
129
130 void dmaAction(Packet::Command cmd, Addr addr, int size, Event *event,
131 uint8_t *data = NULL);
132
133 bool dmaPending() { return pendingCount > 0; }
134
135 int cacheBlockSize() { return peerBlockSize(); }
135 unsigned int drain(Event *de);
136};
137
138/**
139 * This device is the base class which all devices senstive to an address range
140 * inherit from. There are three pure virtual functions which all devices must
141 * implement addressRanges(), read(), and write(). The magic do choose which
142 * mode we are in, etc is handled by the PioPort so the device doesn't have to

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

256 virtual ~DmaDevice();
257
258 void dmaWrite(Addr addr, int size, Event *event, uint8_t *data)
259 {
260 dmaPort->dmaAction(MemCmd::WriteInvalidateReq,
261 addr, size, event, data);
262 }
263
136 unsigned int drain(Event *de);
137};
138
139/**
140 * This device is the base class which all devices senstive to an address range
141 * inherit from. There are three pure virtual functions which all devices must
142 * implement addressRanges(), read(), and write(). The magic do choose which
143 * mode we are in, etc is handled by the PioPort so the device doesn't have to

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

257 virtual ~DmaDevice();
258
259 void dmaWrite(Addr addr, int size, Event *event, uint8_t *data)
260 {
261 dmaPort->dmaAction(MemCmd::WriteInvalidateReq,
262 addr, size, event, data);
263 }
264
264 void dmaRead(Addr addr, int size, Event *event, uint8_t *data = NULL)
265 { dmaPort->dmaAction(MemCmd::ReadReq, addr, size, event, data); }
265 void dmaRead(Addr addr, int size, Event *event, uint8_t *data)
266 {
267 dmaPort->dmaAction(MemCmd::ReadReq, addr, size, event, data);
268 }
266
267 bool dmaPending() { return dmaPort->dmaPending(); }
268
269 virtual unsigned int drain(Event *de);
270
269
270 bool dmaPending() { return dmaPort->dmaPending(); }
271
272 virtual unsigned int drain(Event *de);
273
274 int cacheBlockSize() { return dmaPort->cacheBlockSize(); }
275
271 virtual Port *getPort(const std::string &if_name, int idx = -1)
272 {
273 if (if_name == "pio") {
274 if (pioPort != NULL)
275 panic("pio port already connected to.");
276 pioPort = new PioPort(this, sys);
277 return pioPort;
278 } else if (if_name == "dma") {

--- 13 unchanged lines hidden ---
276 virtual Port *getPort(const std::string &if_name, int idx = -1)
277 {
278 if (if_name == "pio") {
279 if (pioPort != NULL)
280 panic("pio port already connected to.");
281 pioPort = new PioPort(this, sys);
282 return pioPort;
283 } else if (if_name == "dma") {

--- 13 unchanged lines hidden ---