#include <deque>
#include <string>
+#include "base/debug.hh"
#include "base/inet.hh"
+#include "base/types.hh"
+#include "config/the_isa.hh"
#include "cpu/thread_context.hh"
+#include "debug/EthernetAll.hh"
#include "dev/etherlink.hh"
#include "dev/ns_gige.hh"
#include "dev/pciconfigall.hh"
#include "mem/packet.hh"
#include "mem/packet_access.hh"
#include "params/NSGigE.hh"
-#include "sim/debug.hh"
-#include "sim/host.hh"
#include "sim/system.hh"
const char *NsRxStateStrings[] =
interrupts, regs.isr, regs.imr);
if ((regs.isr & regs.imr)) {
- Tick when = curTick;
+ Tick when = curTick();
if ((regs.isr & regs.imr & ISR_NODELAY) == 0)
when += intrDelay;
postedInterrupts++;
regs.isr, regs.imr, regs.isr & regs.imr);
if (regs.isr & regs.imr)
- cpuIntrPost(curTick);
+ cpuIntrPost(curTick());
else
cpuIntrClear();
}
* @todo this warning should be removed and the intrTick code should
* be fixed.
*/
- assert(when >= curTick);
- assert(intrTick >= curTick || intrTick == 0);
+ assert(when >= curTick());
+ assert(intrTick >= curTick() || intrTick == 0);
if (when > intrTick && intrTick != 0) {
DPRINTF(EthernetIntr, "don't need to schedule event...intrTick=%d\n",
intrTick);
}
intrTick = when;
- if (intrTick < curTick) {
- debug_break();
- intrTick = curTick;
+ if (intrTick < curTick()) {
+ Debug::breakpoint();
+ intrTick = curTick();
}
DPRINTF(EthernetIntr, "going to schedule an interrupt for intrTick=%d\n",
if (intrEvent)
intrEvent->squash();
- intrEvent = new IntrEvent(this, intrTick, true);
+ intrEvent = new IntrEvent(this, true);
+ schedule(intrEvent, intrTick);
}
void
NSGigE::cpuInterrupt()
{
- assert(intrTick == curTick);
+ assert(intrTick == curTick());
// Whether or not there's a pending interrupt, we don't care about
// it anymore
next:
if (clock) {
- if (rxKickTick > curTick) {
+ if (rxKickTick > curTick()) {
DPRINTF(EthernetSM, "receive kick exiting, can't run till %d\n",
rxKickTick);
}
// Go to the next state machine clock tick.
- rxKickTick = curTick + ticks(1);
+ rxKickTick = curTick() + ticks(1);
}
switch(rxDmaState) {
NsRxStateStrings[rxState]);
if (clock && !rxKickEvent.scheduled())
- rxKickEvent.schedule(rxKickTick);
+ schedule(rxKickEvent, rxKickTick);
}
void
if (!txFifo.empty() && !txEvent.scheduled()) {
DPRINTF(Ethernet, "reschedule transmit\n");
- txEvent.schedule(curTick + retryTime);
+ schedule(txEvent, curTick() + retryTime);
}
}
next:
if (clock) {
- if (txKickTick > curTick) {
+ if (txKickTick > curTick()) {
DPRINTF(EthernetSM, "transmit kick exiting, can't run till %d\n",
txKickTick);
goto exit;
}
// Go to the next state machine clock tick.
- txKickTick = curTick + ticks(1);
+ txKickTick = curTick() + ticks(1);
}
switch(txDmaState) {
udp->sum(cksum(udp));
txUdpChecksums++;
} else {
- debug_break();
+ Debug::breakpoint();
warn_once("UDPPKT set, but not UDP!\n");
}
} else if (extsts & EXTSTS_TCPPKT) {
tcp->sum(cksum(tcp));
txTcpChecksums++;
} else {
- debug_break();
+ Debug::breakpoint();
warn_once("TCPPKT set, but not UDP!\n");
}
}
ip->sum(cksum(ip));
txIpChecksums++;
} else {
- debug_break();
+ Debug::breakpoint();
warn_once("IPPKT set, but not UDP!\n");
}
}
NsTxStateStrings[txState]);
if (clock && !txKickEvent.scheduled())
- txKickEvent.schedule(txKickTick);
+ schedule(txKickEvent, txKickTick);
}
/**
DPRINTF(Ethernet, "transfer complete: data in txFifo...schedule xmit\n");
- txEvent.reschedule(curTick + ticks(1), true);
+ reschedule(txEvent, curTick() + ticks(1), true);
}
bool
* If there's a pending transmit, store the time so we can
* reschedule it later
*/
- Tick transmitTick = txEvent.scheduled() ? txEvent.when() - curTick : 0;
+ Tick transmitTick = txEvent.scheduled() ? txEvent.when() - curTick() : 0;
SERIALIZE_SCALAR(transmitTick);
/*
this->txDmaState = (DmaState) txDmaState;
UNSERIALIZE_SCALAR(txKickTick);
if (txKickTick)
- txKickEvent.schedule(txKickTick);
+ schedule(txKickEvent, txKickTick);
/*
* unserialize rx state machine
this->rxDmaState = (DmaState) rxDmaState;
UNSERIALIZE_SCALAR(rxKickTick);
if (rxKickTick)
- rxKickEvent.schedule(rxKickTick);
+ schedule(rxKickEvent, rxKickTick);
/*
* Unserialize EEPROM state machine
Tick transmitTick;
UNSERIALIZE_SCALAR(transmitTick);
if (transmitTick)
- txEvent.schedule(curTick + transmitTick);
+ schedule(txEvent, curTick() + transmitTick);
/*
* unserialize receive address filter settings
Tick intrEventTick;
UNSERIALIZE_SCALAR(intrEventTick);
if (intrEventTick) {
- intrEvent = new IntrEvent(this, intrEventTick, true);
+ intrEvent = new IntrEvent(this, true);
+ schedule(intrEvent, intrEventTick);
}
}