aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gcc.c-torture/compile/pr31797.c
blob: 97958f38929f44e94dbb965cb88dc3e67466d939 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
struct GTeth_desc
{
  unsigned ed_cmdsts;
};
struct GTeth_softc
{
  struct GTeth_desc txq_desc[32];
  unsigned int txq_fi;
  unsigned int txq_nactive;
};

void
GTeth_txq_free (struct GTeth_softc *sc)
{
  struct GTeth_desc *txd = &sc->txq_desc[0];
  txd->ed_cmdsts &= ~(1U << (31));
}
void
GTeth_txq_done (struct GTeth_softc *sc)
{
  while (sc->txq_nactive > 0)
    {
      volatile struct GTeth_desc *txd = &sc->txq_desc[sc->txq_fi];
      if (txd->ed_cmdsts)
	{
	  if (sc->txq_nactive == 1)
	    return;
	}
      GTeth_txq_free (sc);
    }
}