aboutsummaryrefslogtreecommitdiff
path: root/include/console.h
diff options
context:
space:
mode:
authorRussell Currey <ruscur@russell.cc>2015-10-23 16:15:26 +1100
committerStewart Smith <stewart@linux.vnet.ibm.com>2015-11-09 14:13:25 +1100
commitdd7980e6d9ffeaac4ae440e6d2f9e8aa88e7ebc7 (patch)
tree992948033fb395bcc24186fa8f76b295dfeaaf63 /include/console.h
parenta0be766f49e1161014f0a02dc3b2fa4800592e8f (diff)
downloadskiboot-dd7980e6d9ffeaac4ae440e6d2f9e8aa88e7ebc7.zip
skiboot-dd7980e6d9ffeaac4ae440e6d2f9e8aa88e7ebc7.tar.gz
skiboot-dd7980e6d9ffeaac4ae440e6d2f9e8aa88e7ebc7.tar.bz2
console: Completely flush output buffer before power down and reboot
Completely flush the output buffer of the console driver before power down and reboot. Implements the flushing function for uart consoles, which includes the astbmc and rhesus platforms. Adds a new function, flush(), to the con_ops struct that allows each console driver to specify how their output buffers are flushed. In the cec_power_down and cec_reboot functions, the flush function of the driver is called if it exists. This fixes an issue where some console output is sometimes lost before power down or reboot in uart consoles. If this issue is also prevalent in other console types then it can be fixed later by adding a .flush to that driver's con_ops. Signed-off-by: Russell Currey <ruscur@russell.cc> [stewart@linux.vnet.ibm.com: reduce diff size, change flush function name] Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'include/console.h')
-rw-r--r--include/console.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/console.h b/include/console.h
index e426adb..45f914b 100644
--- a/include/console.h
+++ b/include/console.h
@@ -51,6 +51,7 @@ struct con_ops {
size_t (*write)(const char *buf, size_t len);
size_t (*read)(char *buf, size_t len);
bool (*poll_read)(void);
+ void (*flush)(void);
};
extern struct lock con_lock;
@@ -61,6 +62,8 @@ extern bool flush_console(void);
extern bool __flush_console(bool flush_to_drivers);
extern void set_console(struct con_ops *driver);
+extern void flush_console_driver(void);
+
extern int mambo_read(void);
extern void mambo_write(const char *buf, size_t count);
extern void enable_mambo_console(void);