1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef __NVKM_OS_H__
3 #define __NVKM_OS_H__
4 #include <nvif/os.h>
5 
6 #ifdef __BIG_ENDIAN
7 #define ioread16_native ioread16be
8 #define iowrite16_native iowrite16be
9 #define ioread32_native  ioread32be
10 #define iowrite32_native iowrite32be
11 #else
12 #define ioread16_native ioread16
13 #define iowrite16_native iowrite16
14 #define ioread32_native  ioread32
15 #define iowrite32_native iowrite32
16 #endif
17 
18 #define iowrite64_native(v,p) do {                                             \
19 	u32 __iomem *_p = (u32 __iomem *)(p);				       \
20 	u64 _v = (v);							       \
21 	iowrite32_native(lower_32_bits(_v), &_p[0]);			       \
22 	iowrite32_native(upper_32_bits(_v), &_p[1]);			       \
23 } while(0)
24 #endif
25