[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 09/15] s390-bios: ptr2u32 and u32toptr
From: |
Jason J. Herne |
Subject: |
[Qemu-devel] [PATCH 09/15] s390-bios: ptr2u32 and u32toptr |
Date: |
Tue, 29 Jan 2019 08:29:16 -0500 |
Introduce inline functions to convert between pointers and unsigned 32-bit
ints. These are used to hide the ugliness required to avoid compiler
warnings.
Signed-off-by: Jason J. Herne <address@hidden>
---
pc-bios/s390-ccw/libc.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/pc-bios/s390-ccw/libc.h b/pc-bios/s390-ccw/libc.h
index 818517f..e198f0b 100644
--- a/pc-bios/s390-ccw/libc.h
+++ b/pc-bios/s390-ccw/libc.h
@@ -19,6 +19,18 @@ typedef unsigned short uint16_t;
typedef unsigned int uint32_t;
typedef unsigned long long uint64_t;
+/* Avoids compiler warnings when casting a pointer to a u32 */
+static inline uint32_t ptr2u32(void *ptr)
+{
+ return (uint32_t)(uint64_t)ptr;
+}
+
+/* Avoids compiler warnings when casting a u32 to a pointer */
+static inline void *u32toptr(uint32_t n)
+{
+ return (void *)(uint64_t)n;
+}
+
static inline void *memset(void *s, int c, size_t n)
{
size_t i;
--
2.7.4
- Re: [Qemu-devel] [PATCH 06/15] s390-bios: Clean up cio.h, (continued)
- [Qemu-devel] [PATCH 10/15] s390-bios: Support for running format-0/1 channel programs, Jason J. Herne, 2019/01/29
- [Qemu-devel] [PATCH 02/15] s390-bios: decouple cio setup from virtio, Jason J. Herne, 2019/01/29
- [Qemu-devel] [PATCH 11/15] s390-bios: cio error handling, Jason J. Herne, 2019/01/29
- [Qemu-devel] [PATCH 04/15] s390-bios: Extend find_dev() for non-virtio devices, Jason J. Herne, 2019/01/29
- [Qemu-devel] [PATCH 13/15] s390-bios: Use control unit type to determine boot method, Jason J. Herne, 2019/01/29
- [Qemu-devel] [PATCH 15/15] s390-bios: Support booting from real dasd device, Jason J. Herne, 2019/01/29
- [Qemu-devel] [PATCH 09/15] s390-bios: ptr2u32 and u32toptr,
Jason J. Herne <=
- [Qemu-devel] [PATCH 12/15] s390-bios: Refactor virtio to run channel programs via cio, Jason J. Herne, 2019/01/29
- [Qemu-devel] [PATCH 14/15] s390-bios: Add channel command codes/structs needed for dasd-ipl, Jason J. Herne, 2019/01/29
- Re: [Qemu-devel] [qemu-s390x] [PATCH 00/15] s390: vfio-ccw dasd ipl support, Jason J. Herne, 2019/01/29
- Re: [Qemu-devel] [PATCH 00/15] s390: vfio-ccw dasd ipl support, no-reply, 2019/01/31