[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 06/10] pc-bios/s390-ccw: Add fill_hex_val func to pr
From: |
Jens Freimann |
Subject: |
[Qemu-devel] [PATCH 06/10] pc-bios/s390-ccw: Add fill_hex_val func to provide better msgs |
Date: |
Thu, 26 Jun 2014 16:30:05 +0200 |
From: "Eugene (jno) Dvurechenski" <address@hidden>
Factor out helper function for dumping a hex value into a buffer.
Signed-off-by: Eugene (jno) Dvurechenski <address@hidden>
---
pc-bios/s390-ccw/s390-ccw.h | 16 +++++++++++-----
1 file changed, 11 insertions(+), 5 deletions(-)
diff --git a/pc-bios/s390-ccw/s390-ccw.h b/pc-bios/s390-ccw/s390-ccw.h
index d1c3c42..1d650d8 100644
--- a/pc-bios/s390-ccw/s390-ccw.h
+++ b/pc-bios/s390-ccw/s390-ccw.h
@@ -86,15 +86,21 @@ static inline void fill_hex(char *out, unsigned char val)
out[1] = hex[val & 0xf];
}
-static inline void print_int(const char *desc, u64 addr)
+static inline void fill_hex_val(char *out, void *ptr, unsigned size)
{
- unsigned char *addr_c = (unsigned char *)&addr;
- char out[] = ": 0xffffffffffffffff\n";
+ unsigned char *value = ptr;
unsigned int i;
- for (i = 0; i < sizeof(addr); i++) {
- fill_hex(&out[4 + (i*2)], addr_c[i]);
+ for (i = 0; i < size; i++) {
+ fill_hex(&out[i*2], value[i]);
}
+}
+
+static inline void print_int(const char *desc, u64 addr)
+{
+ char out[] = ": 0xffffffffffffffff\n";
+
+ fill_hex_val(&out[4], &addr, sizeof(addr));
sclp_print(desc);
sclp_print(out);
--
1.8.5.5
- [Qemu-devel] [PATCH 02/10] pc-bios/s390-ccw: cleanup and enhance bootmap defintions, (continued)
- [Qemu-devel] [PATCH 04/10] pc-bios/s390-ccw: add some utility code, Jens Freimann, 2014/06/26
- [Qemu-devel] [PATCH 05/10] pc-bios/s390-ccw: Unify error handling, Jens Freimann, 2014/06/26
- [Qemu-devel] [PATCH 09/10] pc-bios/s390-ccw: IPL from LDL/CMS-formatted ECKD DASD, Jens Freimann, 2014/06/26
- [Qemu-devel] [PATCH 10/10] pc-bios/s390-ccw: update binary, Jens Freimann, 2014/06/26
- [Qemu-devel] [PATCH 07/10] pc-bios/s390-ccw: factor out ipl code, Jens Freimann, 2014/06/26
- [Qemu-devel] [PATCH 06/10] pc-bios/s390-ccw: Add fill_hex_val func to provide better msgs,
Jens Freimann <=
- [Qemu-devel] [PATCH 08/10] pc-bios/s390-ccw: IPL from CDL-formatted ECKD DASD, Jens Freimann, 2014/06/26
- Re: [Qemu-devel] [PATCH 00/10] pc-bios/s390-ccw: Add DASD IPL support, Alexander Graf, 2014/06/26