[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-ppc] [PULL 04/12] cuda: don't allow writes to port output pins
From: |
David Gibson |
Subject: |
[Qemu-ppc] [PULL 04/12] cuda: don't allow writes to port output pins |
Date: |
Mon, 12 Feb 2018 14:40:46 +1100 |
From: Mark Cave-Ayland <address@hidden>
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>
Signed-off-by: David Gibson <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.14.3
- [Qemu-ppc] [PULL 00/12] ppc-for-2.12 queue 20180212, David Gibson, 2018/02/11
- [Qemu-ppc] [PULL 02/12] hw/ppc: rename functions in comments, David Gibson, 2018/02/11
- [Qemu-ppc] [PULL 01/12] spapr: add missing break in h_get_cpu_characteristics(), David Gibson, 2018/02/11
- [Qemu-ppc] [PULL 05/12] spapr: set vsmt to MAX(8, smp_threads), David Gibson, 2018/02/11
- [Qemu-ppc] [PULL 08/12] cuda: minor cosmetic tidy-ups to get_next_irq_time(), David Gibson, 2018/02/11
- [Qemu-ppc] [PULL 03/12] cuda: do not use old_mmio accesses, David Gibson, 2018/02/11
- [Qemu-ppc] [PULL 09/12] cuda: don't call cuda_update() when writing to ACR register, David Gibson, 2018/02/11
- [Qemu-ppc] [PULL 11/12] cuda: factor out timebase-derived counter value and load time, David Gibson, 2018/02/11
- [Qemu-ppc] [PULL 06/12] cuda: introduce CUDAState parameter to get_counter(), David Gibson, 2018/02/11
- [Qemu-ppc] [PULL 07/12] cuda: rename frequency property to tb_frequency, David Gibson, 2018/02/11
- [Qemu-ppc] [PULL 04/12] cuda: don't allow writes to port output pins,
David Gibson <=
- [Qemu-ppc] [PULL 10/12] cuda: set timer 1 frequency property to CUDA_TIMER_FREQ, David Gibson, 2018/02/11
- [Qemu-ppc] [PULL 12/12] misc: introduce new mos6522 VIA device and enable it for ppc builds, David Gibson, 2018/02/11
- Re: [Qemu-ppc] [PULL 00/12] ppc-for-2.12 queue 20180212, Peter Maydell, 2018/02/12
- Re: [Qemu-ppc] [PULL 00/12] ppc-for-2.12 queue 20180212, Laurent Vivier, 2018/02/12