console: winstream: define as a proper console
eb2e5de01c
made this a console driver but without adding the needed
hooks. This adds the hooks to support the console interface.
Fixes #65987
Fixes #66264
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
This commit is contained in:
parent
8b80a2fd04
commit
a1e03d079a
1 changed files with 24 additions and 0 deletions
|
@ -46,6 +46,29 @@ int arch_printk_char_out(int c)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if defined(CONFIG_STDOUT_CONSOLE)
|
||||||
|
extern void __stdout_hook_install(int (*hook)(int));
|
||||||
|
#else
|
||||||
|
#define __stdout_hook_install(x) \
|
||||||
|
do {/* nothing */ \
|
||||||
|
} while ((0))
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined(CONFIG_PRINTK)
|
||||||
|
extern void __printk_hook_install(int (*fn)(int));
|
||||||
|
#else
|
||||||
|
#define __printk_hook_install(x) \
|
||||||
|
do {/* nothing */ \
|
||||||
|
} while ((0))
|
||||||
|
#endif
|
||||||
|
|
||||||
|
static void winstream_console_hook_install(void)
|
||||||
|
{
|
||||||
|
__stdout_hook_install(arch_printk_char_out);
|
||||||
|
__printk_hook_install(arch_printk_char_out);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
static int winstream_console_init(void)
|
static int winstream_console_init(void)
|
||||||
{
|
{
|
||||||
const struct device *dev = DEVICE_DT_GET(DT_CHOSEN(zephyr_console));
|
const struct device *dev = DEVICE_DT_GET(DT_CHOSEN(zephyr_console));
|
||||||
|
@ -58,6 +81,7 @@ static int winstream_console_init(void)
|
||||||
arch_xtensa_uncached_ptr((__sparse_force void __sparse_cache *)config->mem_base);
|
arch_xtensa_uncached_ptr((__sparse_force void __sparse_cache *)config->mem_base);
|
||||||
|
|
||||||
winstream = sys_winstream_init(buf, config->size);
|
winstream = sys_winstream_init(buf, config->size);
|
||||||
|
winstream_console_hook_install();
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue