]> www.infradead.org Git - linux.git/commitdiff
x86/apic: Provide apic_printk() helpers
authorThomas Gleixner <tglx@linutronix.de>
Fri, 2 Aug 2024 16:15:39 +0000 (18:15 +0200)
committerThomas Gleixner <tglx@linutronix.de>
Wed, 7 Aug 2024 16:13:28 +0000 (18:13 +0200)
apic_printk() requires the APIC verbosity level and printk level which is
tedious and horrible to read. Provide helpers to simplify all of that.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Tested-by: Qiuxu Zhuo <qiuxu.zhuo@intel.com>
Tested-by: Breno Leitao <leitao@debian.org>
Link: https://lore.kernel.org/all/20240802155440.527510045@linutronix.de
arch/x86/include/asm/apic.h

index 9327eb00e96d092ae1e48e0674e52ddb54780db7..34eaebe2f61d7520269ca9bce0f48b4296382924 100644 (file)
 
 #define ARCH_APICTIMER_STOPS_ON_C3     1
 
+/* Macros for apic_extnmi which controls external NMI masking */
+#define APIC_EXTNMI_BSP                0 /* Default */
+#define APIC_EXTNMI_ALL                1
+#define APIC_EXTNMI_NONE       2
+
 /*
  * Debugging macros
  */
 #define APIC_VERBOSE 1
 #define APIC_DEBUG   2
 
-/* Macros for apic_extnmi which controls external NMI masking */
-#define APIC_EXTNMI_BSP                0 /* Default */
-#define APIC_EXTNMI_ALL                1
-#define APIC_EXTNMI_NONE       2
-
 /*
- * Define the default level of output to be very little
- * This can be turned up by using apic=verbose for more
- * information and apic=debug for _lots_ of information.
- * apic_verbosity is defined in apic.c
+ * Define the default level of output to be very little This can be turned
+ * up by using apic=verbose for more information and apic=debug for _lots_
+ * of information.  apic_verbosity is defined in apic.c
  */
-#define apic_printk(v, s, a...) do {       \
-               if ((v) <= apic_verbosity) \
-                       printk(s, ##a);    \
-       } while (0)
-
+#define apic_printk(v, s, a...)                        \
+do {                                           \
+       if ((v) <= apic_verbosity)              \
+               printk(s, ##a);                 \
+} while (0)
+
+#define apic_pr_verbose(s, a...)       apic_printk(APIC_VERBOSE, KERN_INFO s, ##a)
+#define apic_pr_debug(s, a...)         apic_printk(APIC_DEBUG, KERN_DEBUG s, ##a)
+#define apic_pr_debug_cont(s, a...)    apic_printk(APIC_DEBUG, KERN_CONT s, ##a)
+/* Unconditional debug prints for code which is guarded by apic_verbosity already */
+#define apic_dbg(s, a...)              printk(KERN_DEBUG s, ##a)
 
 #if defined(CONFIG_X86_LOCAL_APIC) && defined(CONFIG_X86_32)
 extern void x86_32_probe_apic(void);