summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Cave-Ayland <mark.cave-ayland@ilande.co.uk>2019-08-18 21:16:50 +0100
committerMark Cave-Ayland <mark.cave-ayland@ilande.co.uk>2019-08-18 21:16:50 +0100
commit175271be9212360db40711ac3d5a0f16bcd5f4d1 (patch)
tree92e79e354caf1a76274ce010e64e6cede5d62cfe
parent8878220797a4ff17e9e294fa9d6a3dd9eecc6552 (diff)
downloadqemu-openbios-175271be9212360db40711ac3d5a0f16bcd5f4d1.tar.gz
pc_serial: remove separate init word
Instead use an instance value and initialise the C instance parameter within the open word. Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
-rw-r--r--drivers/pc_serial.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/drivers/pc_serial.c b/drivers/pc_serial.c
index c39afb4c..f67383db 100644
--- a/drivers/pc_serial.c
+++ b/drivers/pc_serial.c
@@ -142,19 +142,16 @@ pc_serial_close(void)
static void
pc_serial_open(unsigned long *address)
{
- RET ( -1 );
-}
-
-static void
-pc_serial_init(unsigned long *address)
-{
+ PUSH(find_ih_method("address", my_self()));
+ fword("execute");
*address = POP();
+
+ RET ( -1 );
}
DECLARE_UNNAMED_NODE(pc_serial, 0, sizeof(unsigned long));
NODE_METHODS(pc_serial) = {
- { "init", pc_serial_init },
{ "open", pc_serial_open },
{ "close", pc_serial_close },
{ "read", pc_serial_read },
@@ -201,7 +198,7 @@ ob_pc_serial_init(const char *path, const char *dev_name, uint64_t base,
BIND_NODE_METHODS(get_cur_dev(), pc_serial);
PUSH(offset);
- feval("['] init execute");
+ feval("value address");
fword("finish-device");