diff options
author | Marc Jones <marcjones@sysproconsulting.com> | 2020-10-12 11:58:46 -0600 |
---|---|---|
committer | Marc Jones <marc@marcjonesconsulting.com> | 2020-10-29 16:44:19 +0000 |
commit | 8b522db474f1573e7f68cdb046d5dc4d789e084b (patch) | |
tree | 8cfa9f18aba19fcf4472122ca49028bb6b8e7565 /src/include | |
parent | 5b5c52e8ded9e6ef320bc01fec63ed042cac90c1 (diff) |
soc/intel/xeon_sp: Move function debug macros
Move the macros for printing debug information to debug.h in the
common console include directory and device include file.
These are available if the platform selects DEFAULT_CONSOLE_LOGLEVEL_8.
The macros could be used by any platform.
Change-Id: Ie237bdf8cdc42c76f38a0c820fdc92e81095f47c
Signed-off-by: Marc Jones <marcjones@sysproconsulting.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/46093
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Jay Talbott <JayTalbott@sysproconsulting.com>
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/console/debug.h | 22 | ||||
-rw-r--r-- | src/include/device/device.h | 14 |
2 files changed, 36 insertions, 0 deletions
diff --git a/src/include/console/debug.h b/src/include/console/debug.h new file mode 100644 index 0000000000..174c287c6a --- /dev/null +++ b/src/include/console/debug.h @@ -0,0 +1,22 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ + +#ifndef _CONSOLE_DEBUG_H_ +#define _CONSOLE_DEBUG_H_ + +#if CONFIG(DEBUG_FUNC) +#include <console/console.h> + +#define FUNC_ENTER() \ + printk(BIOS_SPEW, "%s:%s:%d: ENTER\n", __FILE__, __func__, __LINE__) + +#define FUNC_EXIT() \ + printk(BIOS_SPEW, "%s:%s:%d: EXIT\n", __FILE__, __func__, __LINE__) + +#else /* FUNC_DEBUG */ + +#define FUNC_ENTER() +#define FUNC_EXIT() + +#endif /* FUNC_DEBUG */ + +#endif diff --git a/src/include/device/device.h b/src/include/device/device.h index eb9ef42eef..8a481b2ca2 100644 --- a/src/include/device/device.h +++ b/src/include/device/device.h @@ -279,6 +279,20 @@ void show_all_devs_resources(int debug_level, const char *msg); #define LOG_IO_RESOURCE(type, dev, index, base, size) #endif /* DEBUG_RESOURCES*/ +#if CONFIG(DEBUG_FUNC) +#include <console/console.h> +#define DEV_FUNC_ENTER(dev) \ + printk(BIOS_SPEW, "%s:%s:%d: ENTER (dev: %s)\n", \ + __FILE__, __func__, __LINE__, dev_path(dev)) + +#define DEV_FUNC_EXIT(dev) \ + printk(BIOS_SPEW, "%s:%s:%d: EXIT (dev: %s)\n", __FILE__, \ + __func__, __LINE__, dev_path(dev)) +#else /* DEBUG_FUNC */ +#define DEV_FUNC_ENTER(dev) +#define DEV_FUNC_EXIT(dev) +#endif /* DEBUG_FUNC */ + /* Rounding for boundaries. * Due to some chip bugs, go ahead and round IO to 16 */ |