nvethernetrm: Universal config.tmk for all OS

Issue:
Currently each OS defines OSI CFLAGS locally which
creates issues in structure memory, if mismatched

Fix:
Move all the shared CFLAGS to OSI controlled config.tmk

Bug 3759976

Change-Id: I9d957ebbc2fc8a176ef70d42b5ae6a9ccb7f342f
Signed-off-by: Bibhay Ranjan <bibhayr@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/kernel/nvethernetrm/+/2808840
Reviewed-by: Bhadram Varka <vbhadram@nvidia.com>
Reviewed-by: Nagarjuna Kristam <nkristam@nvidia.com>
Reviewed-by: Ashutosh Jha <ajha@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
This commit is contained in:
Bibhay Ranjan
2022-11-14 12:19:13 +05:30
committed by mobile promotions
parent 2065aa48d1
commit a315ac8155
3 changed files with 34 additions and 22 deletions

31
include/config.tmk Normal file
View File

@@ -0,0 +1,31 @@
# copyright (c) 2022, 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.
#
###############################################################################
ifeq ($(NV_BUILD_CONFIGURATION_IS_SAFETY),1)
NV_COMPONENT_CFLAGS += -DOSI_STRIPPED_LIB
else
NV_COMPONENT_CFLAGS += -DOSI_DEBUG
NV_COMPONENT_CFLAGS += -DDEBUG_MACSEC
endif
NV_COMPONENT_CFLAGS += -DHSI_SUPPORT
NV_COMPONENT_CFLAGS += -DMACSEC_SUPPORT
#NV_COMPONENT_CFLAGS += -DMACSEC_KEY_PROGRAM
ccflags-y += $(NV_COMPONENT_CFLAGS)

View File

@@ -47,27 +47,12 @@ NV_COMPONENT_SOURCES := \
$(NV_SOURCE)/nvethernetrm/osi/common/mgbe_common.c \
$(NV_SOURCE)/nvethernetrm/osi/core/macsec.c
NV_COMPONENT_CFLAGS += -DHSI_SUPPORT
NV_COMPONENT_CFLAGS += -DMACSEC_SUPPORT
#NV_COMPONENT_CFLAGS += -DMACSEC_KEY_PROGRAM
ifeq ($(NV_BUILD_CONFIGURATION_OS_IS_LINUX),1)
NV_COMPONENT_CFLAGS += -DLINUX_OS
else ifeq ($(NV_BUILD_CONFIGURATION_OS_IS_QNX),1)
NV_COMPONENT_CFLAGS += -DQNX_OS
endif
ifeq ($(NV_BUILD_CONFIGURATION_IS_SAFETY),0)
NV_COMPONENT_CFLAGS += -DOSI_DEBUG
NV_COMPONENT_CFLAGS += -DDEBUG_MACSEC
else
NV_COMPONENT_CFLAGS += -DOSI_STRIPPED_LIB
endif
NV_COMPONENT_INCLUDES := \
$(NV_SOURCE)/nvethernetrm/include \
$(NV_SOURCE)/nvethernetrm/osi/common/include
include $(NV_SOURCE)/nvethernetrm/include/config.tmk
include $(NV_BUILD_STATIC_LIBRARY)
endif

View File

@@ -45,11 +45,7 @@ NV_COMPONENT_INCLUDES := \
$(NV_SOURCE)/nvethernetrm/include \
$(NV_SOURCE)/nvethernetrm/osi/common/include
ifeq ($(NV_BUILD_CONFIGURATION_IS_SAFETY),0)
NV_COMPONENT_CFLAGS += -DOSI_DEBUG
else
NV_COMPONENT_CFLAGS += -DOSI_STRIPPED_LIB
endif
include $(NV_SOURCE)/nvethernetrm/include/config.tmk
include $(NV_BUILD_SHARED_LIBRARY)
endif