[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-ppc] [PATCHv2 02/12] cuda: don't allow writes to port output pins
From: |
Mark Cave-Ayland |
Subject: |
[Qemu-ppc] [PATCHv2 02/12] cuda: don't allow writes to port output pins |
Date: |
Fri, 9 Feb 2018 18:51:32 +0000 |
Use the direction registers as a mask to ensure that only input pins are
updated upon write.
Signed-off-by: Mark Cave-Ayland <address@hidden>
Reviewed-by: Laurent Vivier <address@hidden>
Reviewed-by: Philippe Mathieu-Daudé <address@hidden>
---
hw/misc/macio/cuda.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/hw/misc/macio/cuda.c b/hw/misc/macio/cuda.c
index 6631017ca2..eaa8924f49 100644
--- a/hw/misc/macio/cuda.c
+++ b/hw/misc/macio/cuda.c
@@ -359,11 +359,11 @@ static void cuda_write(void *opaque, hwaddr addr,
uint64_t val, unsigned size)
switch(addr) {
case CUDA_REG_B:
- s->b = val;
+ s->b = (s->b & ~s->dirb) | (val & s->dirb);
cuda_update(s);
break;
case CUDA_REG_A:
- s->a = val;
+ s->a = (s->a & ~s->dira) | (val & s->dira);
break;
case CUDA_REG_DIRB:
s->dirb = val;
--
2.11.0
- [Qemu-ppc] [PATCHv2 00/12] cuda: various fixes, tidy-ups, and move 6522 to separate device, Mark Cave-Ayland, 2018/02/09
- [Qemu-ppc] [PATCHv2 02/12] cuda: don't allow writes to port output pins,
Mark Cave-Ayland <=
- [Qemu-ppc] [PATCHv2 03/12] cuda: don't call cuda_update() when writing to ACR register, Mark Cave-Ayland, 2018/02/09
- [Qemu-ppc] [PATCHv2 07/12] cuda: set timer 1 frequency property to CUDA_TIMER_FREQ, Mark Cave-Ayland, 2018/02/09
- [Qemu-ppc] [PATCHv2 06/12] cuda: minor cosmetic tidy-ups to get_next_irq_time(), Mark Cave-Ayland, 2018/02/09
- [Qemu-ppc] [PATCHv2 08/12] cuda: factor out timebase-derived counter value and load time, Mark Cave-Ayland, 2018/02/09
- [Qemu-ppc] [PATCHv2 05/12] cuda: rename frequency property to tb_frequency, Mark Cave-Ayland, 2018/02/09