mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-22 17:36:20 +03:00
nvgpu: userspace: bundle mocked IO space definitions into library
At present each nvgpu test unit defines its own mocked IO space. This is used to intialize the qnx/posix IO framework. This results in unwanted redefinitions, bloating of the binary. This patch creates a shared library which contains all the mocked IO space definitions and it exports a function which enable units to query, get access to the mocked IO space. Jira: NVGPU-4520 Change-Id: Ied19f14e25274953e15a785b3a73053d84012b80 Signed-off-by: Antony Clince Alex <aalex@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/2260042 Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
committed by
Alex Waterman
parent
b1e4c0ef72
commit
8ffbd7faff
@@ -128,6 +128,7 @@ NV_REPOSITORY_COMPONENTS += userspace/units/acr
|
||||
NV_REPOSITORY_COMPONENTS += userspace/units/ce
|
||||
NV_REPOSITORY_COMPONENTS += userspace/units/cg
|
||||
NV_REPOSITORY_COMPONENTS += userspace/units/sync
|
||||
NV_REPOSITORY_COMPONENTS += userspace/units/mock-iospace
|
||||
endif
|
||||
|
||||
# Local Variables:
|
||||
|
||||
@@ -135,4 +135,5 @@ UNITS := \
|
||||
$(UNIT_SRC)/acr \
|
||||
$(UNIT_SRC)/ce \
|
||||
$(UNIT_SRC)/cg \
|
||||
$(UNIT_SRC)/sync
|
||||
$(UNIT_SRC)/sync \
|
||||
$(UNIT_SRC)/mock-iospace
|
||||
|
||||
27
userspace/units/mock-iospace/Makefile
Normal file
27
userspace/units/mock-iospace/Makefile
Normal file
@@ -0,0 +1,27 @@
|
||||
# Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved.
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a
|
||||
# copy of this software and associated documentation files (the "Software"),
|
||||
# to deal in the Software without restriction, including without limitation
|
||||
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
# and/or sell copies of the Software, and to permit persons to whom the
|
||||
# Software is furnished to do so, subject to the following conditions:
|
||||
#
|
||||
# The above copyright notice and this permission notice shall be included in
|
||||
# all copies or substantial portions of the Software.
|
||||
#
|
||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
# DEALINGS IN THE SOFTWARE.
|
||||
|
||||
.SUFFIXES:
|
||||
|
||||
OBJS = gv11b_mock_regs.o
|
||||
|
||||
MODULE = mock-iospace
|
||||
|
||||
include ../Makefile.units
|
||||
25
userspace/units/mock-iospace/Makefile.interface.tmk
Normal file
25
userspace/units/mock-iospace/Makefile.interface.tmk
Normal file
@@ -0,0 +1,25 @@
|
||||
################################### tell Emacs this is a -*- makefile-gmake -*-
|
||||
#
|
||||
# Copyright (c) 2019, NVIDIA CORPORATION. All Rights Reserved.
|
||||
#
|
||||
# NVIDIA CORPORATION and its licensors retain all intellectual property
|
||||
# and proprietary rights in and to this software, related documentation
|
||||
# and any modifications thereto. Any use, reproduction, disclosure or
|
||||
# distribution of this software and related documentation without an express
|
||||
# license agreement from NVIDIA CORPORATION is strictly prohibited.
|
||||
#
|
||||
# tmake for SW Mobile component makefile
|
||||
#
|
||||
###############################################################################
|
||||
|
||||
ifdef NV_INTERFACE_FLAG_SHARED_LIBRARY_SECTION
|
||||
NV_INTERFACE_NAME := mock-iospace
|
||||
NV_INTERFACE_EXPORTS := lib$(NV_INTERFACE_NAME)
|
||||
NV_INTERFACE_PUBLIC_INCLUDES := include
|
||||
endif
|
||||
|
||||
# Local Variables:
|
||||
# indent-tabs-mode: t
|
||||
# tab-width: 8
|
||||
# End:
|
||||
# vi: set tabstop=8 noexpandtab:
|
||||
36
userspace/units/mock-iospace/Makefile.tmk
Normal file
36
userspace/units/mock-iospace/Makefile.tmk
Normal file
@@ -0,0 +1,36 @@
|
||||
################################### tell Emacs this is a -*- makefile-gmake -*-
|
||||
#
|
||||
# Copyright (c) 2019, NVIDIA CORPORATION. All Rights Reserved.
|
||||
#
|
||||
# NVIDIA CORPORATION and its licensors retain all intellectual property
|
||||
# and proprietary rights in and to this software, related documentation
|
||||
# and any modifications thereto. Any use, reproduction, disclosure or
|
||||
# distribution of this software and related documentation without an express
|
||||
# license agreement from NVIDIA CORPORATION is strictly prohibited.
|
||||
#
|
||||
# tmake for SW Mobile
|
||||
#
|
||||
###############################################################################
|
||||
ifdef NV_COMPONENT_FLAG_SHARED_LIBRARY_SECTION
|
||||
include $(NV_BUILD_START_COMPONENT)
|
||||
|
||||
NV_COMPONENT_NAME := mock-iospace
|
||||
NV_COMPONENT_OWN_INTERFACE_DIR := .
|
||||
|
||||
NV_COMPONENT_SOURCES := gv11b_mock_regs.c
|
||||
|
||||
NV_COMPONENT_SYSTEMIMAGE_DIR := $(NV_SYSTEMIMAGE_TEST_EXECUTABLE_DIR)/nvgpu_unit/
|
||||
systemimage:: $(NV_COMPONENT_SYSTEMIMAGE_DIR)
|
||||
$(NV_COMPONENT_SYSTEMIMAGE_DIR) : $(NV_SYSTEMIMAGE_TEST_EXECUTABLE_DIR)
|
||||
$(MKDIR_P) $@
|
||||
NV_COMPONENT_SYSTEMIMAGE_NAME := libmock-iospace.so
|
||||
|
||||
include $(NV_BUILD_SHARED_LIBRARY)
|
||||
|
||||
endif
|
||||
|
||||
# Local Variables:
|
||||
# indent-tabs-mode: t
|
||||
# tab-width: 8
|
||||
# End:
|
||||
# vi: set tabstop=8 noexpandtab:
|
||||
144605
userspace/units/mock-iospace/gv11b_mock_regs.c
Normal file
144605
userspace/units/mock-iospace/gv11b_mock_regs.c
Normal file
File diff suppressed because it is too large
Load Diff
32
userspace/units/mock-iospace/include/gv11b_mock_regs.h
Normal file
32
userspace/units/mock-iospace/include/gv11b_mock_regs.h
Normal file
@@ -0,0 +1,32 @@
|
||||
/*
|
||||
* Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved.
|
||||
*
|
||||
* NVIDIA Corporation and its licensors retain all intellectual property and
|
||||
* proprietary rights in and to this software and related documentation. Any
|
||||
* use, reproduction, disclosure or distribution of this software and related
|
||||
* documentation without an express license agreement from NVIDIA Corporation
|
||||
* is strictly prohibited.
|
||||
*/
|
||||
#ifndef NVGPU_GV11B_IOSPACE_H
|
||||
#define NVVGPU_GV11b_IOSPACE_H
|
||||
|
||||
struct mock_iospace {
|
||||
const uint32_t *data;
|
||||
size_t size;
|
||||
};
|
||||
|
||||
enum gv11b_reg_idx {
|
||||
gv11b_gr_reg_idx = 0,
|
||||
gv11b_fuse_reg_idx,
|
||||
gv11b_master_reg_idx,
|
||||
gv11b_top_reg_idx,
|
||||
gv11b_fifo_reg_idx,
|
||||
gv11b_pri_reg_idx,
|
||||
gv11b_pbdma_reg_idx,
|
||||
gv11b_ccsr_reg_idx,
|
||||
gv11b_last_reg_idx,
|
||||
};
|
||||
|
||||
int gv11b_get_mock_iospace(int reg_idx, struct mock_iospace *iospace);
|
||||
|
||||
#endif
|
||||
2
userspace/units/mock-iospace/libmock-iospace.export
Normal file
2
userspace/units/mock-iospace/libmock-iospace.export
Normal file
@@ -0,0 +1,2 @@
|
||||
# Copyright (c) 2019, NVIDIA CORPORATION. All Rights Reserved.
|
||||
gv11b_get_mock_iospace
|
||||
Reference in New Issue
Block a user