提交 058cc1f3 编写于 作者: E Eugene (jno) Dvurechenski 提交者: Cornelia Huck

pc-bios/s390-ccw: Add fill_hex_val func to provide better msgs

Factor out helper function for dumping a hex value into a buffer.
Acked-by: NChristian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: NEugene (jno) Dvurechenski <jno@linux.vnet.ibm.com>
Signed-off-by: NJens Freimann <jfrei@linux.vnet.ibm.com>
Signed-off-by: NCornelia Huck <cornelia.huck@de.ibm.com>
上级 60612d5c
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册