summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcos <cos>2022-10-15 12:19:29 +0200
committercos <cos>2022-10-15 12:27:47 +0200
commit1e4a7d3ca087e56a2a028c3c0673f1d7c16beac1 (patch)
tree8628061896e36aa237b6e61124929711d1ac46c9
parent7aeb0cf97a29a73e38a1ec42a6c277f47ee439c4 (diff)
downloadqemu-fix/guest_error_led_mask.zip
Correct bit masking on LED guest errors outputfix/guest_error_led_mask
-rw-r--r--hw/riscv/mta1_mkdf.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/hw/riscv/mta1_mkdf.c b/hw/riscv/mta1_mkdf.c
index fb5580a49c..467539543e 100644
--- a/hw/riscv/mta1_mkdf.c
+++ b/hw/riscv/mta1_mkdf.c
@@ -162,9 +162,9 @@ static void mta1_mkdf_mmio_write(void *opaque, hwaddr addr, uint64_t val, unsign
case MTA1_MKDF_MMIO_MTA1_LED:
s->led = val;
qemu_log_mask(LOG_GUEST_ERROR, "%s: MTA1_LED rgb:%c%c%c\n", __func__,
- val & MTA1_MKDF_MMIO_MTA1_LED_R_BIT ? '1' : '0',
- val & MTA1_MKDF_MMIO_MTA1_LED_G_BIT ? '1' : '0',
- val & MTA1_MKDF_MMIO_MTA1_LED_B_BIT ? '1' : '0');
+ val & (1 << MTA1_MKDF_MMIO_MTA1_LED_R_BIT) ? '1' : '0',
+ val & (1 << MTA1_MKDF_MMIO_MTA1_LED_G_BIT) ? '1' : '0',
+ val & (1 << MTA1_MKDF_MMIO_MTA1_LED_B_BIT) ? '1' : '0');
return;
case MTA1_MKDF_MMIO_TOUCH_STATUS:
// Always touched, we don't care about touch reset