io_device.hh (5534:9eaf72819836) io_device.hh (5578:db6756431717)
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;

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

207 virtual void init();
208
209 virtual unsigned int drain(Event *de);
210
211 virtual Port *getPort(const std::string &if_name, int idx = -1)
212 {
213 if (if_name == "pio") {
214 if (pioPort != NULL)
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;

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

207 virtual void init();
208
209 virtual unsigned int drain(Event *de);
210
211 virtual Port *getPort(const std::string &if_name, int idx = -1)
212 {
213 if (if_name == "pio") {
214 if (pioPort != NULL)
215 panic("pio port already connected to.");
215 fatal("%s: pio port already connected to %s",
216 name(), pioPort->getPeer()->name());
216 pioPort = new PioPort(this, sys);
217 return pioPort;
218 } else
219 return NULL;
220 }
221 friend class PioPort;
222
223};

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

284 virtual unsigned int drain(Event *de);
285
286 int cacheBlockSize() { return dmaPort->cacheBlockSize(); }
287
288 virtual Port *getPort(const std::string &if_name, int idx = -1)
289 {
290 if (if_name == "pio") {
291 if (pioPort != NULL)
217 pioPort = new PioPort(this, sys);
218 return pioPort;
219 } else
220 return NULL;
221 }
222 friend class PioPort;
223
224};

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

285 virtual unsigned int drain(Event *de);
286
287 int cacheBlockSize() { return dmaPort->cacheBlockSize(); }
288
289 virtual Port *getPort(const std::string &if_name, int idx = -1)
290 {
291 if (if_name == "pio") {
292 if (pioPort != NULL)
292 panic("pio port already connected to.");
293 fatal("%s: pio port already connected to %s",
294 name(), pioPort->getPeer()->name());
293 pioPort = new PioPort(this, sys);
294 return pioPort;
295 } else if (if_name == "dma") {
296 if (dmaPort != NULL)
295 pioPort = new PioPort(this, sys);
296 return pioPort;
297 } else if (if_name == "dma") {
298 if (dmaPort != NULL)
297 panic("dma port already connected to.");
299 fatal("%s: dma port already connected to %s",
300 name(), pioPort->getPeer()->name());
298 dmaPort = new DmaPort(this, sys);
299 return dmaPort;
300 } else
301 return NULL;
302 }
303
304 friend class DmaPort;
305};
306
307
308#endif // __DEV_IO_DEVICE_HH__
301 dmaPort = new DmaPort(this, sys);
302 return dmaPort;
303 } else
304 return NULL;
305 }
306
307 friend class DmaPort;
308};
309
310
311#endif // __DEV_IO_DEVICE_HH__