Contains standard definitions used by various interfaces.
Data Structures | |
union | NvData32Rec |
Union that can be used to view a 32-bit word as your choice of a 32-bit unsigned integer, a 32-bit signed integer, or an IEEE single-precision float. More... | |
union | NvData64Rec |
Generic data representation for both 32 and 64 bits data. More... | |
struct | NvPointRec |
This structure is used to determine a location on a 2-dimensional object, where the coordinate (0,0) is located at the top-left of the object. More... | |
struct | NvPointF32Rec |
struct | NvRectRec |
This structure is used to define a 2-dimensional rectangle where the rectangle is bottom right exclusive (that is, the right most column, and the bottom row of the rectangle is not included). More... | |
struct | NvRectF32Rec |
This structure is used to define a 2-dimensional rectangle with floating point coordinates. More... | |
struct | NvSizeRec |
This structure is used to define a 2-dimensional surface where the surface is determined by it's height and width in pixels. More... | |
Macros | |
#define | NV_FORCE_INLINE NV_FORCEINLINE |
Include headers that provide NULL, size_t, offsetof, and [u]intptr_t. More... | |
#define | NV_ALIGN NV_ALIGN_BYTES |
#define | NVOS_IS_WINDOWS_X86 0 |
#define | NVOS_IS_LINUX_KERNEL 0 |
#define | NV_MIN_F32 (1.1754944e-38f) |
Min/Max values for NvF32. More... | |
#define | NV_MAX_F32 (3.4028234e+38f) |
#define | NV_ALIGN_POINTER(t, f) t f |
Declares a 64-bit aligned pointer. More... | |
#define | NV_DEBUG_CODE(x) |
Function attributes are lumped in here too. More... | |
#define | NV_ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) |
Macro for determining the size of an array. More... | |
#define | NV_MIN(a, b) (((a) < (b)) ? (a) : (b)) |
Macro for taking min or max of a pair of numbers. More... | |
#define | NV_MAX(a, b) (((a) > (b)) ? (a) : (b)) |
#define | NV_OFFSETOF(type, member) ((NvUPtr)(&(((type *)0)->member))) |
Macro for determining the offset of "member" in "type". More... | |
#define | NV_SIZEOF(s, e) (sizeof(((s*)0)->e)) |
Macro for determining the size of an element e in struct s. More... | |
#define | NV_LOWEST_BIT_ONLY(v) ((NvU32)(v) & (NvU32)-(NvS32)(v)) |
Get just the lowest bit of the 32 bit number. More... | |
#define | NV_IS_POWER_OF_2(v) (NV_LOWEST_BIT_ONLY(v) == (NvU32)(v)) |
True if unsigned int v is a power of 2. More... | |
#define | NV_WAIT_INFINITE 0xFFFFFFFF |
By convention, we use this value to represent an infinite wait interval in APIs that expect a timeout argument. More... | |
#define | NV_ANALYSIS_ASSUME(x) |
Macro to help with MSVC Code Analysis false positives. More... | |
#define | NvDiv64(dividend, divisor) NvDiv64Inline(dividend, divisor) |
Typedefs | |
typedef NvU64 | NvPhysAddr64 |
A physical address type sized such that it matches the addressing support of the hardware modules with which HW drivers typically interfaces. More... | |
typedef NvU32 | NvRmPhysAddr |
This is deprecated and shouldn't be used. More... | |
typedef union NvData32Rec | NvData32 |
Union that can be used to view a 32-bit word as your choice of a 32-bit unsigned integer, a 32-bit signed integer, or an IEEE single-precision float. More... | |
typedef union NvData64Rec | NvData64 |
Generic data representation for both 32 and 64 bits data. More... | |
typedef struct NvPointRec | NvPoint |
This structure is used to determine a location on a 2-dimensional object, where the coordinate (0,0) is located at the top-left of the object. More... | |
typedef struct NvPointF32Rec | NvPointF32 |
typedef struct NvRectRec | NvRect |
This structure is used to define a 2-dimensional rectangle where the rectangle is bottom right exclusive (that is, the right most column, and the bottom row of the rectangle is not included). More... | |
typedef struct NvRectF32Rec | NvRectF32 |
This structure is used to define a 2-dimensional rectangle with floating point coordinates. More... | |
typedef struct NvSizeRec | NvSize |
This structure is used to define a 2-dimensional surface where the surface is determined by it's height and width in pixels. More... | |
Functions | |
static NV_FORCE_INLINE NvU64 | NvDiv64Inline (NvU64 dividend, NvU32 divisor) |
Performs the 64-bit division and returns the quotient. More... | |
#define NV_ALIGN NV_ALIGN_BYTES |
Definition at line 51 of file nvcommon.h.
#define NV_ALIGN_POINTER | ( | t, | |
f | |||
) | t f |
Declares a 64-bit aligned pointer.
Definition at line 82 of file nvcommon.h.
#define NV_ANALYSIS_ASSUME | ( | x | ) |
Macro to help with MSVC Code Analysis false positives.
Definition at line 185 of file nvcommon.h.
#define NV_ARRAY_SIZE | ( | x | ) | (sizeof(x) / sizeof((x)[0])) |
Macro for determining the size of an array.
Definition at line 145 of file nvcommon.h.
#define NV_DEBUG_CODE | ( | x | ) |
Function attributes are lumped in here too.
NAKED - Create a function without a prologue or an epilogue. Symbol attributes. WEAK - Define the symbol weakly so it can be overridden by the user. This macro wraps its argument with the equivalent of "#if NV_DEBUG", but also can be used where "#ifdef"'s can't, like inside a macro.
Definition at line 140 of file nvcommon.h.
#define NV_FORCE_INLINE NV_FORCEINLINE |
Include headers that provide NULL, size_t, offsetof, and [u]intptr_t.
In the event that the toolchain doesn't provide these, provide them ourselves.
Definition at line 50 of file nvcommon.h.
#define NV_IS_POWER_OF_2 | ( | v | ) | (NV_LOWEST_BIT_ONLY(v) == (NvU32)(v)) |
True if unsigned int v is a power of 2.
Definition at line 171 of file nvcommon.h.
#define NV_LOWEST_BIT_ONLY | ( | v | ) | ((NvU32)(v) & (NvU32)-(NvS32)(v)) |
Get just the lowest bit of the 32 bit number.
Definition at line 168 of file nvcommon.h.
#define NV_MAX | ( | a, | |
b | |||
) | (((a) > (b)) ? (a) : (b)) |
Definition at line 152 of file nvcommon.h.
#define NV_MAX_F32 (3.4028234e+38f) |
Definition at line 68 of file nvcommon.h.
#define NV_MIN | ( | a, | |
b | |||
) | (((a) < (b)) ? (a) : (b)) |
Macro for taking min or max of a pair of numbers.
Definition at line 149 of file nvcommon.h.
#define NV_MIN_F32 (1.1754944e-38f) |
Min/Max values for NvF32.
Definition at line 67 of file nvcommon.h.
#define NV_OFFSETOF | ( | type, | |
member | |||
) | ((NvUPtr)(&(((type *)0)->member))) |
Macro for determining the offset of "member" in "type".
Definition at line 160 of file nvcommon.h.
#define NV_SIZEOF | ( | s, | |
e | |||
) | (sizeof(((s*)0)->e)) |
Macro for determining the size of an element e in struct s.
Definition at line 165 of file nvcommon.h.
#define NV_WAIT_INFINITE 0xFFFFFFFF |
By convention, we use this value to represent an infinite wait interval in APIs that expect a timeout argument.
A value of zero should not be interpreted as infinite – it should be interpreted as "time out immediately and simply check whether the event has already happened."
Definition at line 179 of file nvcommon.h.
#define NvDiv64 | ( | dividend, | |
divisor | |||
) | NvDiv64Inline(dividend, divisor) |
Definition at line 220 of file nvcommon.h.
#define NVOS_IS_LINUX_KERNEL 0 |
Definition at line 64 of file nvcommon.h.
#define NVOS_IS_WINDOWS_X86 0 |
Definition at line 56 of file nvcommon.h.
typedef union NvData32Rec NvData32 |
Union that can be used to view a 32-bit word as your choice of a 32-bit unsigned integer, a 32-bit signed integer, or an IEEE single-precision float.
Here is an example of how you might use it to extract the (integer) bitwise representation of a floating-point number: NvData32 data; data.f = 1.0f; printf("%x", data.u);
typedef union NvData64Rec NvData64 |
Generic data representation for both 32 and 64 bits data.
typedef NvU64 NvPhysAddr64 |
A physical address type sized such that it matches the addressing support of the hardware modules with which HW drivers typically interfaces.
Definition at line 192 of file nvcommon.h.
typedef struct NvPointRec NvPoint |
This structure is used to determine a location on a 2-dimensional object, where the coordinate (0,0) is located at the top-left of the object.
The values of x and y are in pixels.
typedef struct NvPointF32Rec NvPointF32 |
This structure is used to define a 2-dimensional rectangle where the rectangle is bottom right exclusive (that is, the right most column, and the bottom row of the rectangle is not included).
typedef struct NvRectF32Rec NvRectF32 |
This structure is used to define a 2-dimensional rectangle with floating point coordinates.
typedef NvU32 NvRmPhysAddr |
This is deprecated and shouldn't be used.
NvU32 is no longer enough to hold physical address. NvPhysAddr64 should be used in place of NvRmPhysAddr.
Definition at line 200 of file nvcommon.h.
This structure is used to define a 2-dimensional surface where the surface is determined by it's height and width in pixels.
|
static |
Performs the 64-bit division and returns the quotient.
If the divisor is 0, returns 0.
It is not guaranteed to have 64-bit divide on all the platforms. So, portable code should call this function instead of using / % operators on 64-bit variables.
Definition at line 212 of file nvcommon.h.