|
@@ -37,6 +37,7 @@
|
|
|
|
|
|
#include <linux/list.h>
|
|
#include <linux/list.h>
|
|
#include <linux/mod_devicetable.h>
|
|
#include <linux/mod_devicetable.h>
|
|
|
|
+#include <linux/dynamic_debug.h>
|
|
|
|
|
|
#include <acpi/acpi.h>
|
|
#include <acpi/acpi.h>
|
|
#include <acpi/acpi_bus.h>
|
|
#include <acpi/acpi_bus.h>
|
|
@@ -589,6 +590,14 @@ static inline __printf(3, 4) void
|
|
acpi_handle_printk(const char *level, void *handle, const char *fmt, ...) {}
|
|
acpi_handle_printk(const char *level, void *handle, const char *fmt, ...) {}
|
|
#endif /* !CONFIG_ACPI */
|
|
#endif /* !CONFIG_ACPI */
|
|
|
|
|
|
|
|
+#if defined(CONFIG_ACPI) && defined(CONFIG_DYNAMIC_DEBUG)
|
|
|
|
+__printf(3, 4)
|
|
|
|
+void __acpi_handle_debug(struct _ddebug *descriptor, acpi_handle handle, const char *fmt, ...);
|
|
|
|
+#else
|
|
|
|
+#define __acpi_handle_debug(descriptor, handle, fmt, ...) \
|
|
|
|
+ acpi_handle_printk(KERN_DEBUG, handle, fmt, ##__VA_ARGS__);
|
|
|
|
+#endif
|
|
|
|
+
|
|
/*
|
|
/*
|
|
* acpi_handle_<level>: Print message with ACPI prefix and object path
|
|
* acpi_handle_<level>: Print message with ACPI prefix and object path
|
|
*
|
|
*
|
|
@@ -610,11 +619,19 @@ acpi_handle_printk(const char *level, void *handle, const char *fmt, ...) {}
|
|
#define acpi_handle_info(handle, fmt, ...) \
|
|
#define acpi_handle_info(handle, fmt, ...) \
|
|
acpi_handle_printk(KERN_INFO, handle, fmt, ##__VA_ARGS__)
|
|
acpi_handle_printk(KERN_INFO, handle, fmt, ##__VA_ARGS__)
|
|
|
|
|
|
-/* REVISIT: Support CONFIG_DYNAMIC_DEBUG when necessary */
|
|
|
|
-#if defined(DEBUG) || defined(CONFIG_DYNAMIC_DEBUG)
|
|
|
|
|
|
+#if defined(DEBUG)
|
|
#define acpi_handle_debug(handle, fmt, ...) \
|
|
#define acpi_handle_debug(handle, fmt, ...) \
|
|
acpi_handle_printk(KERN_DEBUG, handle, fmt, ##__VA_ARGS__)
|
|
acpi_handle_printk(KERN_DEBUG, handle, fmt, ##__VA_ARGS__)
|
|
#else
|
|
#else
|
|
|
|
+#if defined(CONFIG_DYNAMIC_DEBUG)
|
|
|
|
+#define acpi_handle_debug(handle, fmt, ...) \
|
|
|
|
+do { \
|
|
|
|
+ DEFINE_DYNAMIC_DEBUG_METADATA(descriptor, fmt); \
|
|
|
|
+ if (unlikely(descriptor.flags & _DPRINTK_FLAGS_PRINT)) \
|
|
|
|
+ __acpi_handle_debug(&descriptor, handle, pr_fmt(fmt), \
|
|
|
|
+ ##__VA_ARGS__); \
|
|
|
|
+} while (0)
|
|
|
|
+#else
|
|
#define acpi_handle_debug(handle, fmt, ...) \
|
|
#define acpi_handle_debug(handle, fmt, ...) \
|
|
({ \
|
|
({ \
|
|
if (0) \
|
|
if (0) \
|
|
@@ -622,5 +639,6 @@ acpi_handle_printk(const char *level, void *handle, const char *fmt, ...) {}
|
|
0; \
|
|
0; \
|
|
})
|
|
})
|
|
#endif
|
|
#endif
|
|
|
|
+#endif
|
|
|
|
|
|
#endif /*_LINUX_ACPI_H*/
|
|
#endif /*_LINUX_ACPI_H*/
|