diff --git a/include/tegra_hwpm_log.h b/include/tegra_hwpm_log.h index 2bde2c4..936ef14 100644 --- a/include/tegra_hwpm_log.h +++ b/include/tegra_hwpm_log.h @@ -14,7 +14,21 @@ #ifndef TEGRA_HWPM_LOG_H #define TEGRA_HWPM_LOG_H +#ifdef __KERNEL__ #include +#include +#else +void tegra_hwpm_err_impl(struct tegra_soc_hwpm *hwpm, + const char *func, int line, const char *fmt, ...) +{ + return; +} +void tegra_hwpm_dbg_impl(struct tegra_soc_hwpm *hwpm, + u32 dbg_mask, const char *func, int line, const char *fmt, ...) +{ + return; +} +#endif #define TEGRA_SOC_HWPM_MODULE_NAME "tegra-soc-hwpm" @@ -69,11 +83,4 @@ enum tegra_soc_hwpm_log_type { #define tegra_hwpm_fn(hwpm, fmt, arg...) \ tegra_hwpm_dbg_impl(hwpm, hwpm_fn, __func__, __LINE__, fmt, ##arg) -struct tegra_soc_hwpm; - -void tegra_hwpm_err_impl(struct tegra_soc_hwpm *hwpm, - const char *func, int line, const char *fmt, ...); -void tegra_hwpm_dbg_impl(struct tegra_soc_hwpm *hwpm, - u32 dbg_mask, const char *func, int line, const char *fmt, ...); - #endif /* TEGRA_HWPM_LOG_H */ diff --git a/os/linux/log.h b/os/linux/log.h new file mode 100644 index 0000000..e827923 --- /dev/null +++ b/os/linux/log.h @@ -0,0 +1,24 @@ +/* + * Copyright (c) 2022, NVIDIA CORPORATION & AFFILIATES. All rights reserved. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + */ + +#ifndef TEGRA_HWPM_OS_LINUX_LOG_H +#define TEGRA_HWPM_OS_LINUX_LOG_H + +struct tegra_soc_hwpm; + +void tegra_hwpm_err_impl(struct tegra_soc_hwpm *hwpm, + const char *func, int line, const char *fmt, ...); +void tegra_hwpm_dbg_impl(struct tegra_soc_hwpm *hwpm, + u32 dbg_mask, const char *func, int line, const char *fmt, ...); + +#endif /* TEGRA_HWPM_OS_LINUX_LOG_H */