Commit 80637a6afd873791ba1766ba7b29b02aca7fd90c
1 parent
e42c20b4
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
Showing
1 changed file
with
43 additions
and
44 deletions
hw/slavio_serial.c
@@ -215,7 +215,6 @@ struct SerialState { | @@ -215,7 +215,6 @@ struct SerialState { | ||
215 | static void handle_kbd_command(ChannelState *s, int val); | 215 | static void handle_kbd_command(ChannelState *s, int val); |
216 | static int serial_can_receive(void *opaque); | 216 | static int serial_can_receive(void *opaque); |
217 | static void serial_receive_byte(ChannelState *s, int ch); | 217 | static void serial_receive_byte(ChannelState *s, int ch); |
218 | -static inline void set_txint(ChannelState *s); | ||
219 | 218 | ||
220 | static void clear_queue(void *opaque) | 219 | static void clear_queue(void *opaque) |
221 | { | 220 | { |
@@ -321,28 +320,6 @@ static void slavio_serial_reset(void *opaque) | @@ -321,28 +320,6 @@ static void slavio_serial_reset(void *opaque) | ||
321 | slavio_serial_reset_chn(&s->chn[1]); | 320 | slavio_serial_reset_chn(&s->chn[1]); |
322 | } | 321 | } |
323 | 322 | ||
324 | -static inline void clr_rxint(ChannelState *s) | ||
325 | -{ | ||
326 | - s->rxint = 0; | ||
327 | - s->rxint_under_svc = 0; | ||
328 | - if (s->chn == chn_a) { | ||
329 | - if (s->wregs[W_MINTR] & MINTR_STATUSHI) | ||
330 | - s->otherchn->rregs[R_IVEC] = IVEC_HINOINT; | ||
331 | - else | ||
332 | - s->otherchn->rregs[R_IVEC] = IVEC_LONOINT; | ||
333 | - s->rregs[R_INTR] &= ~INTR_RXINTA; | ||
334 | - } else { | ||
335 | - if (s->wregs[W_MINTR] & MINTR_STATUSHI) | ||
336 | - s->rregs[R_IVEC] = IVEC_HINOINT; | ||
337 | - else | ||
338 | - s->rregs[R_IVEC] = IVEC_LONOINT; | ||
339 | - s->otherchn->rregs[R_INTR] &= ~INTR_RXINTB; | ||
340 | - } | ||
341 | - if (s->txint) | ||
342 | - set_txint(s); | ||
343 | - slavio_serial_update_irq(s); | ||
344 | -} | ||
345 | - | ||
346 | static inline void set_rxint(ChannelState *s) | 323 | static inline void set_rxint(ChannelState *s) |
347 | { | 324 | { |
348 | s->rxint = 1; | 325 | s->rxint = 1; |
@@ -367,6 +344,49 @@ static inline void set_rxint(ChannelState *s) | @@ -367,6 +344,49 @@ static inline void set_rxint(ChannelState *s) | ||
367 | slavio_serial_update_irq(s); | 344 | slavio_serial_update_irq(s); |
368 | } | 345 | } |
369 | 346 | ||
347 | +static inline void set_txint(ChannelState *s) | ||
348 | +{ | ||
349 | + s->txint = 1; | ||
350 | + if (!s->rxint_under_svc) { | ||
351 | + s->txint_under_svc = 1; | ||
352 | + if (s->chn == chn_a) { | ||
353 | + if (s->wregs[W_MINTR] & MINTR_STATUSHI) | ||
354 | + s->otherchn->rregs[R_IVEC] = IVEC_HITXINTA; | ||
355 | + else | ||
356 | + s->otherchn->rregs[R_IVEC] = IVEC_LOTXINTA; | ||
357 | + } else { | ||
358 | + s->rregs[R_IVEC] = IVEC_TXINTB; | ||
359 | + } | ||
360 | + } | ||
361 | + if (s->chn == chn_a) | ||
362 | + s->rregs[R_INTR] |= INTR_TXINTA; | ||
363 | + else | ||
364 | + s->otherchn->rregs[R_INTR] |= INTR_TXINTB; | ||
365 | + slavio_serial_update_irq(s); | ||
366 | +} | ||
367 | + | ||
368 | +static inline void clr_rxint(ChannelState *s) | ||
369 | +{ | ||
370 | + s->rxint = 0; | ||
371 | + s->rxint_under_svc = 0; | ||
372 | + if (s->chn == chn_a) { | ||
373 | + if (s->wregs[W_MINTR] & MINTR_STATUSHI) | ||
374 | + s->otherchn->rregs[R_IVEC] = IVEC_HINOINT; | ||
375 | + else | ||
376 | + s->otherchn->rregs[R_IVEC] = IVEC_LONOINT; | ||
377 | + s->rregs[R_INTR] &= ~INTR_RXINTA; | ||
378 | + } else { | ||
379 | + if (s->wregs[W_MINTR] & MINTR_STATUSHI) | ||
380 | + s->rregs[R_IVEC] = IVEC_HINOINT; | ||
381 | + else | ||
382 | + s->rregs[R_IVEC] = IVEC_LONOINT; | ||
383 | + s->otherchn->rregs[R_INTR] &= ~INTR_RXINTB; | ||
384 | + } | ||
385 | + if (s->txint) | ||
386 | + set_txint(s); | ||
387 | + slavio_serial_update_irq(s); | ||
388 | +} | ||
389 | + | ||
370 | static inline void clr_txint(ChannelState *s) | 390 | static inline void clr_txint(ChannelState *s) |
371 | { | 391 | { |
372 | s->txint = 0; | 392 | s->txint = 0; |
@@ -389,27 +409,6 @@ static inline void clr_txint(ChannelState *s) | @@ -389,27 +409,6 @@ static inline void clr_txint(ChannelState *s) | ||
389 | slavio_serial_update_irq(s); | 409 | slavio_serial_update_irq(s); |
390 | } | 410 | } |
391 | 411 | ||
392 | -static inline void set_txint(ChannelState *s) | ||
393 | -{ | ||
394 | - s->txint = 1; | ||
395 | - if (!s->rxint_under_svc) { | ||
396 | - s->txint_under_svc = 1; | ||
397 | - if (s->chn == chn_a) { | ||
398 | - if (s->wregs[W_MINTR] & MINTR_STATUSHI) | ||
399 | - s->otherchn->rregs[R_IVEC] = IVEC_HITXINTA; | ||
400 | - else | ||
401 | - s->otherchn->rregs[R_IVEC] = IVEC_LOTXINTA; | ||
402 | - } else { | ||
403 | - s->rregs[R_IVEC] = IVEC_TXINTB; | ||
404 | - } | ||
405 | - } | ||
406 | - if (s->chn == chn_a) | ||
407 | - s->rregs[R_INTR] |= INTR_TXINTA; | ||
408 | - else | ||
409 | - s->otherchn->rregs[R_INTR] |= INTR_TXINTB; | ||
410 | - slavio_serial_update_irq(s); | ||
411 | -} | ||
412 | - | ||
413 | static void slavio_serial_update_parameters(ChannelState *s) | 412 | static void slavio_serial_update_parameters(ChannelState *s) |
414 | { | 413 | { |
415 | int speed, parity, data_bits, stop_bits; | 414 | int speed, parity, data_bits, stop_bits; |