Files
linux-nvgpu/drivers/gpu/nvgpu/gv11b/gr_pri_gv11b.h
Sai Nikhil 4e9e199380 gpu: nvgpu: gv11b: fix MISRA Rule 10.4 Violations
MISRA Rule 10.4 only allows the usage of arithmetic operations on
operands of the same essential type category.

Adding "U" at the end of the integer literals to have same type of
operands when an arithmetic operation is performed.

This fixes violations where an arithmetic operation is performed on
signed and unsigned int types.

JIRA NVGPU-992

Change-Id: I4f2d2b960b705690d5d23d2945816fd8f3f8fb75
Signed-off-by: Sai Nikhil <snikhil@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1831885
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Adeel Raza <araza@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2018-11-29 09:05:02 -08:00

51 lines
2.3 KiB
C

/*
* GV11B/GV100 Graphics Context Pri Register Addressing
*
* Copyright (c) 2018, 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.
*/
#ifndef GR_PRI_GV11B_H
#define GR_PRI_GV11B_H
/*
* These convenience macros are generally for use in the management/modificaiton
* of the context state store for gr/compute contexts.
*/
/* Broadcast PMM defines */
#define NV_PERF_PMMFBP_FBPGS_LTC 0x00250800U
#define NV_PERF_PMMFBP_FBPGS_ROP 0x00250A00U
#define NV_PERF_PMMGPC_GPCGS_GPCTPCA 0x00250000U
#define NV_PERF_PMMGPC_GPCGS_GPCTPCB 0x00250200U
#define NV_PERF_PMMGPC_GPCS 0x00278000U
#define NV_PERF_PMMFBP_FBPS 0x0027C000U
#define PRI_PMMGS_ADDR_WIDTH 9U
#define PRI_PMMS_ADDR_WIDTH 14U
/* Get the offset to be added to the chiplet base addr to get the unicast address */
#define PRI_PMMGS_OFFSET_MASK(addr) ((addr) & (BIT32(PRI_PMMGS_ADDR_WIDTH) - 1U))
#define PRI_PMMGS_BASE_ADDR_MASK(addr) ((addr) & (~(BIT32(PRI_PMMGS_ADDR_WIDTH) - 1U)))
#define PRI_PMMS_ADDR_MASK(addr) ((addr) & (BIT32(PRI_PMMS_ADDR_WIDTH) - 1U))
#define PRI_PMMS_BASE_ADDR_MASK(addr) ((addr) & (~(BIT32(PRI_PMMS_ADDR_WIDTH) - 1U)))
#endif /* GR_PRI_GV11B_H */