Files
linux-hwpm/include/tegra_hwpm_aperture.h
Vedashree Vidwans ae38729467 tegra: hwpm: move linux APIs in aperture to os
Perfmux/perfmon reserve and release functions use linux APIs to
map/unmap mmio apertures. In an effort to make HWPM driver OS agnostic,
add wrappers to reserve and release apertures.

Jira THWPM-59

Change-Id: I2e8e820ae0b7c46f5656e8dfd2cf7ef370f168cc
Signed-off-by: Vedashree Vidwans <vvidwans@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2738157
Reviewed-by: svc_kernel_abi <svc_kernel_abi@nvidia.com>
Reviewed-by: Vasuki Shankar <vasukis@nvidia.com>
Reviewed-by: Seema Khowala <seemaj@nvidia.com>
GVS: Gerrit_Virtual_Submit
2022-08-12 15:50:59 -07:00

52 lines
1.6 KiB
C

/*
* 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_APERTURE_H
#define TEGRA_HWPM_APERTURE_H
#ifdef __KERNEL__
#include <os/linux/aperture_utils.h>
#else
int tegra_hwpm_perfmon_reserve_impl(struct tegra_soc_hwpm *hwpm,
struct hwpm_ip_inst *ip_inst, struct hwpm_ip_aperture *perfmon)
{
return -EINVAL;
}
int tegra_hwpm_perfmux_reserve_impl(struct tegra_soc_hwpm *hwpm,
struct hwpm_ip_inst *ip_inst, struct hwpm_ip_aperture *perfmux)
{
return -EINVAL;
}
int tegra_hwpm_perfmon_release_impl(struct tegra_soc_hwpm *hwpm,
struct hwpm_ip_aperture *perfmon)
{
return -EINVAL;
}
int tegra_hwpm_perfmux_release_impl(struct tegra_soc_hwpm *hwpm,
struct hwpm_ip_aperture *perfmux)
{
return -EINVAL;
}
#endif
#define tegra_hwpm_perfmon_reserve(hwpm, ip_inst, perfmon) \
tegra_hwpm_perfmon_reserve_impl(hwpm, ip_inst, perfmon)
#define tegra_hwpm_perfmux_reserve(hwpm, ip_inst, perfmux) \
tegra_hwpm_perfmux_reserve_impl(hwpm, ip_inst, perfmux)
#define tegra_hwpm_perfmon_release(hwpm, perfmon) \
tegra_hwpm_perfmon_release_impl(hwpm, perfmon)
#define tegra_hwpm_perfmux_release(hwpm, perfmux) \
tegra_hwpm_perfmux_release_impl(hwpm, perfmux)
#endif /* TEGRA_HWPM_APERTURE_H */