io_device.hh (2641:6d9d837e2032) | io_device.hh (2657:b119b774656b) |
---|---|
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; --- 91 unchanged lines hidden (view full) --- 100 101 friend class PioPort; 102 }; 103 104 /** Schedule a sendTiming() event to be called in the future. */ 105 void sendTiming(Packet *pkt, Tick time) 106 { new PioPort::SendEvent(this, pkt, time); } 107 | 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; --- 91 unchanged lines hidden (view full) --- 100 101 friend class PioPort; 102 }; 103 104 /** Schedule a sendTiming() event to be called in the future. */ 105 void sendTiming(Packet *pkt, Tick time) 106 { new PioPort::SendEvent(this, pkt, time); } 107 |
108 /** This function pops the last element off the transmit list and sends it.*/ 109 virtual Packet *recvRetry(); | 108 /** This function is notification that the device should attempt to send a 109 * packet again. */ 110 virtual void recvRetry(); |
110 111 public: 112 PioPort(PioDevice *dev, Platform *p); 113 114 friend class PioPort::SendEvent; 115}; 116 117 --- 23 unchanged lines hidden (view full) --- 141 virtual Tick recvAtomic(Packet *pkt) 142 { panic("dma port shouldn't be used for pio access."); } 143 virtual void recvFunctional(Packet *pkt) 144 { panic("dma port shouldn't be used for pio access."); } 145 146 virtual void recvStatusChange(Status status) 147 { ; } 148 | 111 112 public: 113 PioPort(PioDevice *dev, Platform *p); 114 115 friend class PioPort::SendEvent; 116}; 117 118 --- 23 unchanged lines hidden (view full) --- 142 virtual Tick recvAtomic(Packet *pkt) 143 { panic("dma port shouldn't be used for pio access."); } 144 virtual void recvFunctional(Packet *pkt) 145 { panic("dma port shouldn't be used for pio access."); } 146 147 virtual void recvStatusChange(Status status) 148 { ; } 149 |
149 virtual Packet *recvRetry() ; | 150 virtual void recvRetry() ; |
150 151 virtual void getDeviceAddressRanges(AddrRangeList &resp, AddrRangeList &snoop) 152 { resp.clear(); snoop.clear(); } 153 | 151 152 virtual void getDeviceAddressRanges(AddrRangeList &resp, AddrRangeList &snoop) 153 { resp.clear(); snoop.clear(); } 154 |
154 class SendEvent : public Event 155 { 156 DmaPort *port; 157 Packet *packet; 158 159 SendEvent(PioPort *p, Packet *pkt, Tick t) 160 : Event(&mainEventQueue), packet(pkt) 161 { schedule(curTick + t); } 162 163 virtual void process(); 164 165 virtual const char *description() 166 { return "Future scheduled sendTiming event"; } 167 168 friend class DmaPort; 169 }; 170 | |
171 void sendDma(Packet *pkt); 172 173 public: 174 DmaPort(DmaDevice *dev, Platform *p); 175 176 void dmaAction(Packet::Command cmd, Addr addr, int size, Event *event, 177 uint8_t *data = NULL); 178 179 bool dmaPending() { return pendingCount > 0; } 180 | 155 void sendDma(Packet *pkt); 156 157 public: 158 DmaPort(DmaDevice *dev, Platform *p); 159 160 void dmaAction(Packet::Command cmd, Addr addr, int size, Event *event, 161 uint8_t *data = NULL); 162 163 bool dmaPending() { return pendingCount > 0; } 164 |
181 friend class DmaPort::SendEvent; 182 | |
183}; 184 185/** 186 * This device is the base class which all devices senstive to an address range 187 * inherit from. There are three pure virtual functions which all devices must 188 * implement addressRanges(), read(), and write(). The magic do choose which 189 * mode we are in, etc is handled by the PioPort so the device doesn't have to 190 * bother. --- 145 unchanged lines hidden --- | 165}; 166 167/** 168 * This device is the base class which all devices senstive to an address range 169 * inherit from. There are three pure virtual functions which all devices must 170 * implement addressRanges(), read(), and write(). The magic do choose which 171 * mode we are in, etc is handled by the PioPort so the device doesn't have to 172 * bother. --- 145 unchanged lines hidden --- |