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(); } |
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 |
265 void dmaRead(Addr addr, int size, Event *event, uint8_t *data) 266 { 267 dmaPort->dmaAction(MemCmd::ReadReq, addr, size, event, data); 268 } |
269 270 bool dmaPending() { return dmaPort->dmaPending(); } 271 272 virtual unsigned int drain(Event *de); 273 |
274 int cacheBlockSize() { return dmaPort->cacheBlockSize(); } 275 |
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 --- |