diff options
author | Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com> | 2017-01-19 15:37:20 +0100 |
---|---|---|
committer | Jukka Rissanen <jukka.rissanen@linux.intel.com> | 2017-01-27 12:35:52 +0200 |
commit | a7e82666bc70923e33a5e3241437c9d4eae9333f (patch) | |
tree | 75242366d3ed5fdfd7a1c66039ad9151be05d1ab | |
parent | 4984ca742acf2814127f7bdbbd814c8e3be2675a (diff) |
misc/printk: Add a function to get the current hook function.
This can be necessary at run-time if a switch of one console to
another has to be made, with the possibility to reinstall the former
hook at some point.
Change-Id: I60efc74b1c94953bdc2585b99cc4816c46715372
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
-rw-r--r-- | misc/printk.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/misc/printk.c b/misc/printk.c index ff66f88ae..0d671e2c2 100644 --- a/misc/printk.c +++ b/misc/printk.c @@ -57,6 +57,19 @@ void __printk_hook_install(int (*fn)(int)) } /** + * @brief Get the current character output routine for printk + * + * To be called by any console driver that would like to save + * current hook - if any - for later re-installation. + * + * @return a function pointer or NULL if no hook is set + */ +void *__printk_get_hook(void) +{ + return _char_out; +} + +/** * @brief Printk internals * * See printk() for description. |