diff options
author | Jonathan Gray <jsg@cvs.openbsd.org> | 2018-01-30 08:25:07 +0000 |
---|---|---|
committer | Jonathan Gray <jsg@cvs.openbsd.org> | 2018-01-30 08:25:07 +0000 |
commit | fc25521843c9bc6c13cf3734b42fee956abd321b (patch) | |
tree | 2aad3590fbe45809ecbb680da0ac06a69ce0abca /sys/dev/pci/drm | |
parent | 834a6c0e63eedd0d5f09cb876809d90493dfb556 (diff) |
add more endian macros
Diffstat (limited to 'sys/dev/pci/drm')
-rw-r--r-- | sys/dev/pci/drm/drm_linux.h | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/sys/dev/pci/drm/drm_linux.h b/sys/dev/pci/drm/drm_linux.h index 64ea410476f..2321c51edc0 100644 --- a/sys/dev/pci/drm/drm_linux.h +++ b/sys/dev/pci/drm/drm_linux.h @@ -1,4 +1,4 @@ -/* $OpenBSD: drm_linux.h,v 1.67 2018/01/15 22:24:17 kettenis Exp $ */ +/* $OpenBSD: drm_linux.h,v 1.68 2018/01/30 08:25:06 jsg Exp $ */ /* * Copyright (c) 2013, 2014, 2015 Mark Kettenis * Copyright (c) 2017 Martin Pieuchot @@ -104,10 +104,17 @@ typedef off_t loff_t; #define le16_to_cpu(x) letoh16(x) #define le32_to_cpu(x) letoh32(x) +#define be16_to_cpu(x) betoh16(x) +#define be32_to_cpu(x) betoh32(x) +#define le16_to_cpup(x) lemtoh16(x) +#define le32_to_cpup(x) lemtoh32(x) +#define be16_to_cpup(x) bemtoh16(x) +#define be32_to_cpup(x) bemtoh32(x) +#define get_unaligned_le32(x) lemtoh32(x) #define cpu_to_le16(x) htole16(x) #define cpu_to_le32(x) htole32(x) - -#define be32_to_cpup(x) betoh32(*x) +#define cpu_to_be16(x) htobe16(x) +#define cpu_to_be32(x) htobe32(x) static inline uint8_t hweight8(uint32_t x) |