/* * linux/kernel/avm_printk.c * * Copyright (c) 2017 AVM */ #include #include #ifdef CONFIG_PRINTK int force_printk_avm; static bool no_avm_printk = false; core_param(no_avm_printk, no_avm_printk, bool, 0644); asmlinkage int printk_linux(const char *fmt, ...) { va_list args; int r; va_start(args, fmt); r = vprintk_emit(FORCE_PRINTK_LINUX_FACILITIES_VALUE, -1, NULL, 0, fmt, args); va_end(args); return r; } EXPORT_SYMBOL(printk_linux); /** * printk_avm_console_bend -- set Linux or avm console print functionality * @activate: 0: Linux default printk, 1: AVM bended * * Returns previous mode */ int printk_avm_console_bend(unsigned int activate) { int ret = 0; if (IS_ENABLED(CONFIG_AVM_ENHANCED)) { ret = force_printk_avm; if (activate && no_avm_printk) pr_notice_once("AVM printk disabled by cmdline (no_avm_printk)\n"); else force_printk_avm = activate ? 1 : 0; } return ret; } EXPORT_SYMBOL(printk_avm_console_bend); #else static int no_vprintk(const char *fmt, va_list args) { return 0; } asmlinkage int (*vprintk)(const char *fmt, va_list args) = no_vprintk; int printk_avm_console_bend(unsigned int activate) { return 0; } #endif /* CONFIG_PRINTK */ /* vim: set ts=8 sw=8 noet cino=>8\:0l1(0: */