aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--hw/lpc-port80h.c7
-rw-r--r--hw/test/run-port80h.c7
2 files changed, 10 insertions, 4 deletions
diff --git a/hw/lpc-port80h.c b/hw/lpc-port80h.c
index eb1378c..b373af7 100644
--- a/hw/lpc-port80h.c
+++ b/hw/lpc-port80h.c
@@ -164,9 +164,10 @@ void op_display_lpc(enum op_severity s, enum op_module m, uint16_t c)
return;
port80_val = op_display_to_port80(port80_val, s, m, c);
- lpc_outb(port80_val, 0x80);
port8x_val = op_display_to_port8x(port8x_val, s, m, c);
- lpc_outb(port8x_val >> 8, 0x81);
- lpc_outb(port8x_val & 0xFF, 0x82);
+
+ lpc_probe_write(OPAL_LPC_IO, 0x80, port80_val, 1);
+ lpc_probe_write(OPAL_LPC_IO, 0x81, port8x_val >> 8, 1);
+ lpc_probe_write(OPAL_LPC_IO, 0x82, port8x_val & 0xff, 1);
}
diff --git a/hw/test/run-port80h.c b/hw/test/run-port80h.c
index 85e8d87..a45ea46 100644
--- a/hw/test/run-port80h.c
+++ b/hw/test/run-port80h.c
@@ -10,20 +10,25 @@
#include <stdint.h>
#include <assert.h>
+#define __unused __attribute__((unused))
+
#define __LPC_H
uint8_t port80;
uint16_t port8x;
-static inline void lpc_outb(uint8_t data, uint32_t addr)
+static int64_t lpc_probe_write(int addr_type __unused, uint32_t addr,
+ uint32_t data, uint32_t sz)
{
assert((addr - 0x80) <= 2);
+ assert(sz == 1);
if (addr == 0x80)
port80 = data;
if (addr == 0x81)
port8x = data << 8 | (port8x & 0xff);
if (addr == 0x82)
port8x = (port8x & 0xff00) | data;
+ return 0;
}
#include "op-panel.h"