All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Benoît Canet" <benoit.canet@gmail.com>
To: qemu-devel@nongnu.org
Cc: "Benoît Canet" <benoit.canet@gmail.com>, avi@redhat.com
Subject: [Qemu-devel] [PATCH 1/2] applesmc: convert portio to memory API
Date: Thu,  1 Dec 2011 17:57:04 +0100	[thread overview]
Message-ID: <1322758625-15384-2-git-send-email-benoit.canet@gmail.com> (raw)
In-Reply-To: <1322758625-15384-1-git-send-email-benoit.canet@gmail.com>

Signed-off-by: Benoît Canet <benoit.canet@gmail.com>
---
 hw/applesmc.c |   20 ++++++++++++--------
 1 files changed, 12 insertions(+), 8 deletions(-)

diff --git a/hw/applesmc.c b/hw/applesmc.c
index c47b592..fb11bdf 100644
--- a/hw/applesmc.c
+++ b/hw/applesmc.c
@@ -165,6 +165,16 @@ static uint32_t applesmc_io_cmd_readb(void *opaque, uint32_t addr1)
     return s->status;
 }
 
+static const MemoryRegionPortio applesmc_portio_list[] = {
+    { APPLESMC_DATA_PORT, 4, 1,
+      .read = applesmc_io_data_readb,
+      .write = applesmc_io_data_writeb },
+    { APPLESMC_CMD_PORT, 4, 1,
+      .read = applesmc_io_cmd_readb,
+      .write = applesmc_io_cmd_writeb },
+    PORTIO_END_OF_LIST(),
+};
+
 static void applesmc_add_key(struct AppleSMCStatus *s, const char *key,
                              int len, const char *data)
 {
@@ -200,14 +210,8 @@ static int applesmc_isa_init(ISADevice *dev)
 {
     struct AppleSMCStatus *s = DO_UPCAST(struct AppleSMCStatus, dev, dev);
 
-    register_ioport_read(s->iobase + APPLESMC_DATA_PORT, 4, 1,
-                         applesmc_io_data_readb, s);
-    register_ioport_read(s->iobase + APPLESMC_CMD_PORT, 4, 1,
-                         applesmc_io_cmd_readb, s);
-    register_ioport_write(s->iobase + APPLESMC_DATA_PORT, 4, 1,
-                          applesmc_io_data_writeb, s);
-    register_ioport_write(s->iobase + APPLESMC_CMD_PORT, 4, 1,
-                          applesmc_io_cmd_writeb, s);
+    isa_register_portio_list(dev, s->iobase, applesmc_portio_list, s,
+                             "applesmc");
 
     if (!s->osk || (strlen(s->osk) != 64)) {
         fprintf(stderr, "WARNING: Using AppleSMC with invalid key\n");
-- 
1.7.7.3

  reply	other threads:[~2011-12-01 16:57 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-01 16:57 [Qemu-devel] [PATCH 0/2] ioport conversions to memory API Benoît Canet
2011-12-01 16:57 ` Benoît Canet [this message]
2011-12-01 16:57 ` [Qemu-devel] [PATCH 2/2] ppc_prep: convert ioport " Benoît Canet
2011-12-02 16:17   ` Andreas Färber
2011-12-02 16:41     ` Benoît Canet
2011-12-05  9:48     ` Benoît Canet

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1322758625-15384-2-git-send-email-benoit.canet@gmail.com \
    --to=benoit.canet@gmail.com \
    --cc=avi@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.