mirror of https://github.com/xemu-project/xemu.git
cuda: don't allow writes to port output pins
Use the direction registers as a mask to ensure that only input pins are updated upon write. Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> Reviewed-by: Laurent Vivier <lvivier@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
This commit is contained in:
parent
8d0ef282ed
commit
ae14d81757
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue