diff options
author | Gabe Black <gabeblack@google.com> | 2019-05-02 15:33:32 -0700 |
---|---|---|
committer | Gabe Black <gabeblack@google.com> | 2019-05-18 10:20:20 +0000 |
commit | 972c38b1cc5f6f6c649a0e9923695447bc5d6255 (patch) | |
tree | ba3ca960ad12e37c38d8d17ff53b267fd5511688 /src/dev | |
parent | e2656006df442a995bf80ee03fa9700d6ec14537 (diff) | |
download | gem5-972c38b1cc5f6f6c649a0e9923695447bc5d6255.tar.xz |
arch, base, cpu, dev, mem, sim: Remove #if 0-ed out code.
This code will be preserved through version control, but otherwise
creates clutter and will rot in place since it's never compiled.
Change-Id: Id265f6deac445116843956ea5cf1210d8127274e
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/18608
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Reviewed-by: Brandon Potter <Brandon.Potter@amd.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Diffstat (limited to 'src/dev')
-rw-r--r-- | src/dev/alpha/tsunami_pchip.cc | 17 | ||||
-rw-r--r-- | src/dev/net/ns_gige.cc | 111 | ||||
-rw-r--r-- | src/dev/net/ns_gige.hh | 4 | ||||
-rw-r--r-- | src/dev/net/sinic.cc | 34 | ||||
-rw-r--r-- | src/dev/storage/simple_disk.cc | 8 |
5 files changed, 0 insertions, 174 deletions
diff --git a/src/dev/alpha/tsunami_pchip.cc b/src/dev/alpha/tsunami_pchip.cc index d8f9fd1d3..bf172209a 100644 --- a/src/dev/alpha/tsunami_pchip.cc +++ b/src/dev/alpha/tsunami_pchip.cc @@ -264,23 +264,6 @@ TsunamiPChip::dmaAddr(const PciBusAddr &dev, Addr busAddr) const Addr pteAddr; Addr dmaAddr; -#if 0 - DPRINTF(IdeDisk, "Translation for bus address: %#x\n", busAddr); - for (int i = 0; i < 4; i++) { - DPRINTF(IdeDisk, "(%d) base:%#x mask:%#x\n", - i, wsba[i], wsm[i]); - - windowBase = wsba[i]; - windowMask = ~wsm[i] & (ULL(0xfff) << 20); - - if ((busAddr & windowMask) == (windowBase & windowMask)) { - DPRINTF(IdeDisk, "Would have matched %d (wb:%#x wm:%#x --> ba&wm:%#x wb&wm:%#x)\n", - i, windowBase, windowMask, (busAddr & windowMask), - (windowBase & windowMask)); - } - } -#endif - for (int i = 0; i < 4; i++) { windowBase = wsba[i]; diff --git a/src/dev/net/ns_gige.cc b/src/dev/net/ns_gige.cc index 29e886717..e180e7c8e 100644 --- a/src/dev/net/ns_gige.cc +++ b/src/dev/net/ns_gige.cc @@ -485,41 +485,6 @@ NSGigE::write(PacketPtr pkt) CFGR_PCI64_DET); } -// all these #if 0's are because i don't THINK the kernel needs to -// have these implemented. if there is a problem relating to one of -// these, you may need to add functionality in. - -// grouped together and #if 0'ed to avoid empty if body and make clang happy -#if 0 - if (reg & CFGR_TBI_EN) ; - if (reg & CFGR_MODE_1000) ; - - if (reg & CFGR_PINT_DUPSTS || - reg & CFGR_PINT_LNKSTS || - reg & CFGR_PINT_SPDSTS) - ; - - if (reg & CFGR_TMRTEST) ; - if (reg & CFGR_MRM_DIS) ; - if (reg & CFGR_MWI_DIS) ; - - if (reg & CFGR_DATA64_EN) ; - if (reg & CFGR_M64ADDR) ; - if (reg & CFGR_PHY_RST) ; - if (reg & CFGR_PHY_DIS) ; - - if (reg & CFGR_REQALG) ; - if (reg & CFGR_SB) ; - if (reg & CFGR_POW) ; - if (reg & CFGR_EXD) ; - if (reg & CFGR_PESEL) ; - if (reg & CFGR_BROM_DIS) ; - if (reg & CFGR_EXT_125) ; - if (reg & CFGR_BEM) ; - - if (reg & CFGR_T64ADDR) ; - // panic("CFGR_T64ADDR is read only register!\n"); -#endif if (reg & CFGR_AUTO_1000) panic("CFGR_AUTO_1000 not implemented!\n"); @@ -553,13 +518,6 @@ NSGigE::write(PacketPtr pkt) eepromClk = reg & MEAR_EECLK; // since phy is completely faked, MEAR_MD* don't matter - -// grouped together and #if 0'ed to avoid empty if body and make clang happy -#if 0 - if (reg & MEAR_MDIO) ; - if (reg & MEAR_MDDIR) ; - if (reg & MEAR_MDC) ; -#endif break; case PTSCR: @@ -603,26 +561,6 @@ NSGigE::write(PacketPtr pkt) case TX_CFG: regs.txcfg = reg; -#if 0 - if (reg & TX_CFG_CSI) ; - if (reg & TX_CFG_HBI) ; - if (reg & TX_CFG_MLB) ; - if (reg & TX_CFG_ATP) ; - if (reg & TX_CFG_ECRETRY) { - /* - * this could easily be implemented, but considering - * the network is just a fake pipe, wouldn't make - * sense to do this - */ - } - - if (reg & TX_CFG_BRST_DIS) ; -#endif - -#if 0 - /* we handle our own DMA, ignore the kernel's exhortations */ - if (reg & TX_CFG_MXDMA) ; -#endif // also, we currently don't care about fill/drain // thresholds though this may change in the future with @@ -651,22 +589,6 @@ NSGigE::write(PacketPtr pkt) case RX_CFG: regs.rxcfg = reg; -#if 0 - if (reg & RX_CFG_AEP) ; - if (reg & RX_CFG_ARP) ; - if (reg & RX_CFG_STRIPCRC) ; - if (reg & RX_CFG_RX_RD) ; - if (reg & RX_CFG_ALP) ; - if (reg & RX_CFG_AIRL) ; - - /* we handle our own DMA, ignore what kernel says about it */ - if (reg & RX_CFG_MXDMA) ; - - //also, we currently don't care about fill/drain thresholds - //though this may change in the future with more realistic - //networks or a driver which changes it according to feedback - if (reg & (RX_CFG_DRTH | RX_CFG_DRTH0)) ; -#endif break; case PQCR: @@ -695,10 +617,6 @@ NSGigE::write(PacketPtr pkt) acceptArp = (reg & RFCR_AARP) ? true : false; multicastHashEnable = (reg & RFCR_MHEN) ? true : false; -#if 0 - if (reg & RFCR_APAT) - panic("RFCR_APAT not implemented!\n"); -#endif if (reg & RFCR_UHEN) panic("Unicast hash filtering not used by drivers!\n"); @@ -780,10 +698,6 @@ NSGigE::write(PacketPtr pkt) regs.tbisr |= (TBISR_MR_AN_COMPLETE | TBISR_MR_LINK_STATUS); } -#if 0 - if (reg & TBICR_MR_RESTART_AN) ; -#endif - break; case TBISR: @@ -795,11 +709,6 @@ NSGigE::write(PacketPtr pkt) regs.tanar |= reg & ~(TANAR_RF1 | TANAR_RF2 | TANAR_UNUSED); // Pause capability unimplemented -#if 0 - if (reg & TANAR_PS2) ; - if (reg & TANAR_PS1) ; -#endif - break; case TANLPAR: @@ -1309,26 +1218,6 @@ NSGigE::rxKick() cmdsts &= 0xffff0000; cmdsts += rxPacket->length; //i.e. set CMDSTS_SIZE -#if 0 - /* - * all the driver uses these are for its own stats keeping - * which we don't care about, aren't necessary for - * functionality and doing this would just slow us down. - * if they end up using this in a later version for - * functional purposes, just undef - */ - if (rxFilterEnable) { - cmdsts &= ~CMDSTS_DEST_MASK; - const EthAddr &dst = rxFifoFront()->dst(); - if (dst->unicast()) - cmdsts |= CMDSTS_DEST_SELF; - if (dst->multicast()) - cmdsts |= CMDSTS_DEST_MULTI; - if (dst->broadcast()) - cmdsts |= CMDSTS_DEST_MASK; - } -#endif - IpPtr ip(rxPacket); if (extstsEnable && ip) { extsts |= EXTSTS_IPPKT; diff --git a/src/dev/net/ns_gige.hh b/src/dev/net/ns_gige.hh index 5745c3040..7f0752a89 100644 --- a/src/dev/net/ns_gige.hh +++ b/src/dev/net/ns_gige.hh @@ -170,10 +170,6 @@ class NSGigE : public EtherDevBase /** pci settings */ bool ioEnable; -#if 0 - bool memEnable; - bool bmEnable; -#endif /*** BASIC STRUCTURES FOR TX/RX ***/ /* Data FIFOs */ diff --git a/src/dev/net/sinic.cc b/src/dev/net/sinic.cc index 8d73d1542..c6260078c 100644 --- a/src/dev/net/sinic.cc +++ b/src/dev/net/sinic.cc @@ -1170,40 +1170,6 @@ Device::rxFilter(const EthPacketPtr &packet) panic("receive filter not implemented\n"); bool drop = true; - -#if 0 - string type; - - EthHdr *eth = packet->eth(); - if (eth->unicast()) { - // If we're accepting all unicast addresses - if (acceptUnicast) - drop = false; - - // If we make a perfect match - if (acceptPerfect && params->eaddr == eth.dst()) - drop = false; - - if (acceptArp && eth->type() == ETH_TYPE_ARP) - drop = false; - - } else if (eth->broadcast()) { - // if we're accepting broadcasts - if (acceptBroadcast) - drop = false; - - } else if (eth->multicast()) { - // if we're accepting all multicasts - if (acceptMulticast) - drop = false; - - } - - if (drop) { - DPRINTF(Ethernet, "rxFilter drop\n"); - DDUMP(EthernetData, packet->data, packet->length); - } -#endif return drop; } diff --git a/src/dev/storage/simple_disk.cc b/src/dev/storage/simple_disk.cc index bc52e7ec5..26141c48c 100644 --- a/src/dev/storage/simple_disk.cc +++ b/src/dev/storage/simple_disk.cc @@ -83,14 +83,6 @@ void SimpleDisk::write(Addr addr, baddr_t block, int count) { panic("unimplemented!\n"); - -#if 0 - uint8_t *data = physmem->dma_addr(addr, count); - if (!data) - panic("dma out of range! write addr=%#x count=%d\n", addr, count); - - image->write(data, block, count); -#endif } SimpleDisk * |