mirror of
git://nv-tegra.nvidia.com/linux-hwpm.git
synced 2025-12-23 01:35:10 +03:00
tegra: hwpm: os: linux: update kernel vers. check
This is needed when building HWPM driver locally without
NVIDIA build system.
- driver.c: use kernel version check to select the correct
signature of class:devnode
- mem_mgmt_utils.c:
- use kernel version check to provide correct parameter
of MODULE_IMPORT_NS macro
- use kernel version check to select the correct signature
of get_user_pages function
- mem_mgmt_utils.h: use kernel version check to select
between iosys-map or dma-buf-map
Bug 5120925
Change-Id: Ib33afc4d99056d5b872f0d4362e0e6c25eb7b64a
Signed-off-by: Besar Wicaksono <bwicaksono@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-hwpm/+/3306471
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Yifei Wan <ywan@nvidia.com>
Reviewed-by: Vasuki Shankar <vasukis@nvidia.com>
This commit is contained in:
committed by
mobile promotions
parent
47aa6ea0b9
commit
547508653d
@@ -1,6 +1,6 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||
/*
|
||||
* SPDX-FileCopyrightText: Copyright (c) 2022-2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
|
||||
* SPDX-FileCopyrightText: Copyright (c) 2022-2025 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,
|
||||
@@ -23,8 +23,10 @@
|
||||
|
||||
#include <linux/types.h>
|
||||
#include <linux/version.h>
|
||||
#if defined(NV_LINUX_IOSYS_MAP_H_PRESENT)
|
||||
#if defined(NV_LINUX_IOSYS_MAP_H_PRESENT) || \
|
||||
LINUX_VERSION_CODE >= KERNEL_VERSION(5, 18, 0)
|
||||
#include <linux/iosys-map.h>
|
||||
#define HWPM_IOSYS_MAP_PRESENT 1
|
||||
#else
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 11, 0)
|
||||
#include <linux/dma-buf-map.h>
|
||||
@@ -53,13 +55,11 @@ struct tegra_hwpm_mem_mgmt {
|
||||
struct dma_buf *mem_bytes_dma_buf;
|
||||
struct dma_buf_attachment *mem_bytes_attach;
|
||||
void *mem_bytes_kernel;
|
||||
#if defined(NV_LINUX_IOSYS_MAP_H_PRESENT)
|
||||
#if defined(HWPM_IOSYS_MAP_PRESENT)
|
||||
struct iosys_map mem_bytes_map;
|
||||
#else
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 11, 0)
|
||||
struct dma_buf_map mem_bytes_map;
|
||||
#endif
|
||||
#endif
|
||||
};
|
||||
|
||||
struct tegra_hwpm_allowlist_map {
|
||||
|
||||
Reference in New Issue
Block a user