Exemplo n.º 1
0
void
RegAlloc::invalidate(const Location& loc) {
  ContToRegMap::iterator i = m_contToRegMap.find(RegContent(loc));
  if (i != m_contToRegMap.end()) {
    freeRegInfo(physRegToInfo(i->second));
  }
}
Exemplo n.º 2
0
void
RegAlloc::markAsClean(const Location& loc) {
  PhysReg    pr = mapGet(m_contToRegMap, RegContent(loc), InvalidReg);
  if (pr != InvalidReg) {
    stateTransition(physRegToInfo(pr), RegInfo::CLEAN);
  }
}
Exemplo n.º 3
0
PhysReg
RegAlloc::getReg(const Location& loc) {
  PhysReg reg = mapGet(m_contToRegMap, RegContent(loc), InvalidReg);
  lruFront(physRegToInfo(reg));
  ASSERT(reg != InvalidReg); // Usage error; didn't call allocInputRegs()?
  return reg;
}
Exemplo n.º 4
0
irqreturn_t cs8900_interrupt(int irq, void *dev_id)
{
	volatile u16 status;
	struct net_device *dev = (struct net_device *)dev_id;
	
	while((status = cs8900_read(dev, PP_ISQ)) != 0)
	{
		switch(RegNum(status))
		{
		case RxEvent:
			cs8900_recv(dev); //接收数据
			break;
		case TxEvent:
			netif_wake_queue(dev);
			break;
		case BufEvent: //既有接收中断事件,又有发送中断事件
			if(((RegContent(status)) & TxUnderrun))
			{
				netif_wake_queue(dev);
			}
			break;
		}
	}

	return IRQ_HANDLED;
}
Exemplo n.º 5
0
void
RegAlloc::reset() {
  TRACE(1, ">>> regalloc reset! <<<\n");
  m_epoch = 0;
  m_contToRegMap.clear();
  // m_info is sparse.
  for (int i = 0; i < kMaxRegs; ++i) {
    m_info[i].m_epoch = 0;
    m_info[i].m_pReg = PhysReg(i);
    m_info[i].m_cont = RegContent();
    m_info[i].m_type = KindOfInvalid;
    m_info[i].m_state = RegInfo::INVALID;
  }
  RegSet all = m_allRegs;
  PhysReg pr;
  for (int i = 0; all.findFirst(pr); i++) {
    all.remove(pr);
    physRegToInfo(pr)->m_pReg = PhysReg(pr);
    stateTransition(physRegToInfo(pr), RegInfo::FREE);
    // Put the most favorable register last, so it is picked first.
    m_lru[(m_numRegs - 1) - i] = pr;
  }
  m_branchSynced = false;
  verify();
}
Exemplo n.º 6
0
static irqreturn_t cirrus_interrupt(int irq, void *id)
{
	struct net_device *dev = (struct net_device *) id;
	cirrus_t *priv;
	u16 status;

	if (dev->priv == NULL) {
		return IRQ_NONE;
	}

	priv = (cirrus_t *) dev->priv;

	while ((status = cirrus_read (dev,PP_ISQ))) {
		switch (RegNum (status)) {
		case RxEvent:
			cirrus_receive (dev);
			break;

		case TxEvent:
			priv->stats.collisions += ColCount (cirrus_read (dev,PP_TxCOL));
			if (!(RegContent (status) & TxOK)) {
				priv->stats.tx_errors++;
				if ((RegContent (status) & Out_of_window)) priv->stats.tx_window_errors++;
				if ((RegContent (status) & Jabber)) priv->stats.tx_aborted_errors++;
				break;
			} else if (priv->txlen) {
				priv->stats.tx_packets++;
				priv->stats.tx_bytes += priv->txlen;
			}
			priv->txlen = 0;
			netif_wake_queue (dev);
			break;

		case BufEvent:
			if ((RegContent (status) & RxMiss)) {
				u16 missed = MissCount (cirrus_read (dev,PP_RxMISS));
				priv->stats.rx_errors += missed;
				priv->stats.rx_missed_errors += missed;
			}
			if ((RegContent (status) & TxUnderrun)) {
				priv->stats.tx_errors++;
				priv->stats.tx_fifo_errors++;
			}
			/* FIXME: if Rdy4Tx, transmit last sent packet (if any) */
			priv->txlen = 0;
			netif_wake_queue (dev);
			break;

		case TxCOL:
			priv->stats.collisions += ColCount (cirrus_read (dev,PP_TxCOL));
			break;

		case RxMISS:
			status = MissCount (cirrus_read (dev,PP_RxMISS));
			priv->stats.rx_errors += status;
			priv->stats.rx_missed_errors += status;
			break;
		default:
			return IRQ_HANDLED;
		}
	}

	return IRQ_HANDLED;
}
Exemplo n.º 7
0
bool
RegAlloc::hasReg(const Location& loc) const {
  RegContent cont = RegContent(loc);
  return mapContains(m_contToRegMap, cont);
}