提交 80637a6a 编写于 作者: B blueswir1

Shuffle code to avoid NetBSD gcc 3.4.6 inlining bug (Rumko)


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3924 c046a42c-6fe2-441c-8c8c-71466251a162
上级 e42c20b4
...@@ -215,7 +215,6 @@ struct SerialState { ...@@ -215,7 +215,6 @@ struct SerialState {
static void handle_kbd_command(ChannelState *s, int val); static void handle_kbd_command(ChannelState *s, int val);
static int serial_can_receive(void *opaque); static int serial_can_receive(void *opaque);
static void serial_receive_byte(ChannelState *s, int ch); static void serial_receive_byte(ChannelState *s, int ch);
static inline void set_txint(ChannelState *s);
static void clear_queue(void *opaque) static void clear_queue(void *opaque)
{ {
...@@ -321,28 +320,6 @@ static void slavio_serial_reset(void *opaque) ...@@ -321,28 +320,6 @@ static void slavio_serial_reset(void *opaque)
slavio_serial_reset_chn(&s->chn[1]); slavio_serial_reset_chn(&s->chn[1]);
} }
static inline void clr_rxint(ChannelState *s)
{
s->rxint = 0;
s->rxint_under_svc = 0;
if (s->chn == chn_a) {
if (s->wregs[W_MINTR] & MINTR_STATUSHI)
s->otherchn->rregs[R_IVEC] = IVEC_HINOINT;
else
s->otherchn->rregs[R_IVEC] = IVEC_LONOINT;
s->rregs[R_INTR] &= ~INTR_RXINTA;
} else {
if (s->wregs[W_MINTR] & MINTR_STATUSHI)
s->rregs[R_IVEC] = IVEC_HINOINT;
else
s->rregs[R_IVEC] = IVEC_LONOINT;
s->otherchn->rregs[R_INTR] &= ~INTR_RXINTB;
}
if (s->txint)
set_txint(s);
slavio_serial_update_irq(s);
}
static inline void set_rxint(ChannelState *s) static inline void set_rxint(ChannelState *s)
{ {
s->rxint = 1; s->rxint = 1;
...@@ -367,46 +344,68 @@ static inline void set_rxint(ChannelState *s) ...@@ -367,46 +344,68 @@ static inline void set_rxint(ChannelState *s)
slavio_serial_update_irq(s); slavio_serial_update_irq(s);
} }
static inline void clr_txint(ChannelState *s) static inline void set_txint(ChannelState *s)
{ {
s->txint = 0; s->txint = 1;
s->txint_under_svc = 0; if (!s->rxint_under_svc) {
s->txint_under_svc = 1;
if (s->chn == chn_a) {
if (s->wregs[W_MINTR] & MINTR_STATUSHI)
s->otherchn->rregs[R_IVEC] = IVEC_HITXINTA;
else
s->otherchn->rregs[R_IVEC] = IVEC_LOTXINTA;
} else {
s->rregs[R_IVEC] = IVEC_TXINTB;
}
}
if (s->chn == chn_a)
s->rregs[R_INTR] |= INTR_TXINTA;
else
s->otherchn->rregs[R_INTR] |= INTR_TXINTB;
slavio_serial_update_irq(s);
}
static inline void clr_rxint(ChannelState *s)
{
s->rxint = 0;
s->rxint_under_svc = 0;
if (s->chn == chn_a) { if (s->chn == chn_a) {
if (s->wregs[W_MINTR] & MINTR_STATUSHI) if (s->wregs[W_MINTR] & MINTR_STATUSHI)
s->otherchn->rregs[R_IVEC] = IVEC_HINOINT; s->otherchn->rregs[R_IVEC] = IVEC_HINOINT;
else else
s->otherchn->rregs[R_IVEC] = IVEC_LONOINT; s->otherchn->rregs[R_IVEC] = IVEC_LONOINT;
s->rregs[R_INTR] &= ~INTR_TXINTA; s->rregs[R_INTR] &= ~INTR_RXINTA;
} else { } else {
if (s->wregs[W_MINTR] & MINTR_STATUSHI) if (s->wregs[W_MINTR] & MINTR_STATUSHI)
s->rregs[R_IVEC] = IVEC_HINOINT; s->rregs[R_IVEC] = IVEC_HINOINT;
else else
s->rregs[R_IVEC] = IVEC_LONOINT; s->rregs[R_IVEC] = IVEC_LONOINT;
s->otherchn->rregs[R_INTR] &= ~INTR_TXINTB; s->otherchn->rregs[R_INTR] &= ~INTR_RXINTB;
} }
if (s->rxint) if (s->txint)
set_rxint(s); set_txint(s);
slavio_serial_update_irq(s); slavio_serial_update_irq(s);
} }
static inline void set_txint(ChannelState *s) static inline void clr_txint(ChannelState *s)
{ {
s->txint = 1; s->txint = 0;
if (!s->rxint_under_svc) { s->txint_under_svc = 0;
s->txint_under_svc = 1;
if (s->chn == chn_a) { if (s->chn == chn_a) {
if (s->wregs[W_MINTR] & MINTR_STATUSHI) if (s->wregs[W_MINTR] & MINTR_STATUSHI)
s->otherchn->rregs[R_IVEC] = IVEC_HITXINTA; s->otherchn->rregs[R_IVEC] = IVEC_HINOINT;
else else
s->otherchn->rregs[R_IVEC] = IVEC_LOTXINTA; s->otherchn->rregs[R_IVEC] = IVEC_LONOINT;
s->rregs[R_INTR] &= ~INTR_TXINTA;
} else { } else {
s->rregs[R_IVEC] = IVEC_TXINTB; if (s->wregs[W_MINTR] & MINTR_STATUSHI)
} s->rregs[R_IVEC] = IVEC_HINOINT;
}
if (s->chn == chn_a)
s->rregs[R_INTR] |= INTR_TXINTA;
else else
s->otherchn->rregs[R_INTR] |= INTR_TXINTB; s->rregs[R_IVEC] = IVEC_LONOINT;
s->otherchn->rregs[R_INTR] &= ~INTR_TXINTB;
}
if (s->rxint)
set_rxint(s);
slavio_serial_update_irq(s); slavio_serial_update_irq(s);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册