gpu: nvgpu: unify qnx bitops unit with posix

Unify qnx bitops unit with posix implementation.  Move certain defines
from bitops unit to posix types unit as part of unification.

Jira NVGPU-2149

Change-Id: I4969f9c893bef511b222f173051815ed2a504da0
Signed-off-by: ajesh <akv@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2109508
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
ajesh
2019-04-30 15:45:42 +05:30
committed by mobile promotions
parent 170d7464d6
commit 5290f3aed2
4 changed files with 14 additions and 6 deletions

View File

@@ -24,7 +24,6 @@ srcs :=
ifdef NVGPU_POSIX
srcs += os/posix/nvgpu.c \
os/posix/bitmap.c \
os/posix/log.c \
os/posix/posix-io.c \
os/posix/posix-nvgpu_mem.c \
@@ -56,6 +55,7 @@ srcs += os/posix/bug.c \
os/posix/thread.c \
os/posix/bsearch.c \
os/posix/os_sched.c \
os/posix/bitmap.c \
os/posix/kmem.c
srcs += common/sim/sim.c \

View File

@@ -36,10 +36,8 @@
#ifdef __KERNEL__
#include <linux/bitops.h>
#include <linux/bitmap.h>
#elif defined(__NVGPU_POSIX__)
#include <nvgpu/posix/bitops.h>
#else
#include <nvgpu_rmos/include/bitops.h>
#include <nvgpu/posix/bitops.h>
#endif
static inline void nvgpu_bitmap_set(unsigned long *map, unsigned int start,

View File

@@ -90,6 +90,7 @@ typedef signed long long s64;
#define MAX_SCHEDULE_TIMEOUT LONG_MAX
#define DIV_ROUND_UP(n, d) (((n) + (d) - 1U) / (d))
#define DIV_ROUND_UP_ULL DIV_ROUND_UP
#define DIV_ROUND_CLOSEST(a, divisor)( \
{ \
@@ -118,6 +119,15 @@ typedef signed long long s64;
#define ALIGN(x, a) ALIGN_MASK(x, (typeof(x))(a) - 1U)
#define PAGE_ALIGN(x) ALIGN(x, PAGE_SIZE)
#define HZ_TO_KHZ(x) ((x) / KHZ)
#define HZ_TO_MHZ(a) (u16)(a/MHZ)
#define HZ_TO_MHZ_ULL(a) ((a > 0xF414F9CD7ULL) ? 0xffff : (a >> 32) ? \
(u32) ((a * 0x10C8ULL) >> 32) : (u16) ((u32) a/MHZ))
#define KHZ_TO_HZ(x) ((x) * KHZ)
#define MHZ_TO_KHZ(x) ((x) * KHZ)
#define KHZ_TO_MHZ(a) (u16)(a/KHZ)
#define MHZ_TO_HZ_ULL(a) ((u64)a * MHZ)
/*
* Caps return at the size of the buffer not what would have been written if buf
* were arbitrarily sized.

View File

@@ -9,8 +9,6 @@ __nvgpu_log_dbg
__nvgpu_log_msg
__nvgpu_readl
__nvgpu_set_pte
nvgpu_posix_ffs
nvgpu_posix_fls
bitmap_clear
bitmap_find_next_zero_area_off
bitmap_set
@@ -129,6 +127,8 @@ nvgpu_pd_offset_from_index
nvgpu_pd_write
nvgpu_posix_cleanup
nvgpu_posix_enable_fault_injection
nvgpu_posix_ffs
nvgpu_posix_fls
nvgpu_posix_io_add_reg_space
nvgpu_posix_io_check_sequence
nvgpu_posix_io_delete_reg_space