diff options
author | vhanquez@kneesa.uk.xensource.com <vhanquez@kneesa.uk.xensource.com> | 2005-12-31 15:58:44 +0000 |
---|---|---|
committer | vhanquez@kneesa.uk.xensource.com <vhanquez@kneesa.uk.xensource.com> | 2005-12-31 15:58:44 +0000 |
commit | 05a04604e5aae9da507d5aa5898cb50cbd5546c6 (patch) | |
tree | 31579d78f070c590b1b7e5fc8214c14675d3cb12 | |
parent | 1b296eaa07c632a614d3d99868b27bc9d3b75bdb (diff) | |
download | xen-05a04604e5aae9da507d5aa5898cb50cbd5546c6.tar.gz xen-05a04604e5aae9da507d5aa5898cb50cbd5546c6.tar.bz2 xen-05a04604e5aae9da507d5aa5898cb50cbd5546c6.zip |
reorganize code to avoid duplication
Signed-off-by: Vincent Hanquez <vincent@xensource.com>
-rw-r--r-- | linux-2.6-xen-sparse/drivers/xen/console/console.c | 40 |
1 files changed, 16 insertions, 24 deletions
diff --git a/linux-2.6-xen-sparse/drivers/xen/console/console.c b/linux-2.6-xen-sparse/drivers/xen/console/console.c index 9183a47af8..1c838f166e 100644 --- a/linux-2.6-xen-sparse/drivers/xen/console/console.c +++ b/linux-2.6-xen-sparse/drivers/xen/console/console.c @@ -314,39 +314,31 @@ static void __xencons_tx_flush(void) { int sent, sz, work_done = 0; - if (xen_start_info->flags & SIF_INITDOMAIN) { - if (x_char) { + if (x_char) { + if (xen_start_info->flags & SIF_INITDOMAIN) { + while (x_char) + if (xencons_ring_send(&x_char, 1) == 1) + break; + } else kcons_write_dom0(NULL, &x_char, 1); - x_char = 0; - work_done = 1; - } + x_char = 0; + work_done = 1; + } - while (wc != wp) { - sz = wp - wc; - if (sz > (wbuf_size - WBUF_MASK(wc))) - sz = wbuf_size - WBUF_MASK(wc); + while (wc != wp) { + sz = wp - wc; + if (sz > (wbuf_size - WBUF_MASK(wc))) + sz = wbuf_size - WBUF_MASK(wc); + if (xen_start_info->flags & SIF_INITDOMAIN) { kcons_write_dom0(NULL, &wbuf[WBUF_MASK(wc)], sz); wc += sz; - work_done = 1; - } - } else { - while (x_char) { - if (xencons_ring_send(&x_char, 1) == 1) { - x_char = 0; - work_done = 1; - } - } - - while (wc != wp) { - sz = wp - wc; - if (sz > (wbuf_size - WBUF_MASK(wc))) - sz = wbuf_size - WBUF_MASK(wc); + } else { sent = xencons_ring_send(&wbuf[WBUF_MASK(wc)], sz); if (sent == 0) break; wc += sent; - work_done = 1; } + work_done = 1; } if (work_done && (xencons_tty != NULL)) { |