From: "Philippe Mathieu-Daudé" <f4bug@amsat.org>
To: qemu-devel@nongnu.org
Cc: "Peter Maydell" <peter.maydell@linaro.org>,
"Philippe Mathieu-Daudé" <f4bug@amsat.org>,
"Richard Henderson" <rth@twiddle.net>,
"Gerd Hoffmann" <kraxel@redhat.com>,
"Paolo Bonzini" <pbonzini@redhat.com>
Subject: [PATCH 3/3] exec/cpu-common: Move MUSB specific typedefs to 'hw/usb/musb.h'
Date: Mon, 1 Jun 2020 09:54:00 +0200 [thread overview]
Message-ID: <20200601075400.2043-4-f4bug@amsat.org> (raw)
In-Reply-To: <20200601075400.2043-1-f4bug@amsat.org>
The CPUReadMemoryFunc/CPUWriteMemoryFunc typedefs are legacy
remnant from before the conversion to MemoryRegions.
Since they are now only used in tusb6010.c and hcd-musb.c,
move them to "hw/usb/musb.h" and rename them appropriately.
Suggested-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
include/exec/cpu-common.h | 3 ---
include/hw/usb/musb.h | 9 +++++----
hw/usb/hcd-musb.c | 4 ++--
3 files changed, 7 insertions(+), 9 deletions(-)
diff --git a/include/exec/cpu-common.h b/include/exec/cpu-common.h
index b47e5630e7..d5e285d2b5 100644
--- a/include/exec/cpu-common.h
+++ b/include/exec/cpu-common.h
@@ -43,9 +43,6 @@ extern ram_addr_t ram_size;
/* memory API */
-typedef void CPUWriteMemoryFunc(void *opaque, hwaddr addr, uint32_t value);
-typedef uint32_t CPUReadMemoryFunc(void *opaque, hwaddr addr);
-
void qemu_ram_remap(ram_addr_t addr, ram_addr_t length);
/* This should not be used by devices. */
ram_addr_t qemu_ram_addr_from_host(void *ptr);
diff --git a/include/hw/usb/musb.h b/include/hw/usb/musb.h
index 26b50132ff..c874b9f292 100644
--- a/include/hw/usb/musb.h
+++ b/include/hw/usb/musb.h
@@ -13,8 +13,6 @@
#ifndef HW_USB_MUSB_H
#define HW_USB_MUSB_H
-#include "exec/cpu-common.h"
-
enum musb_irq_source_e {
musb_irq_suspend = 0,
musb_irq_resume,
@@ -32,8 +30,11 @@ enum musb_irq_source_e {
musb_irq_max /* total number of interrupts defined */
};
-extern CPUReadMemoryFunc * const musb_read[];
-extern CPUWriteMemoryFunc * const musb_write[];
+/* TODO convert hcd-musb to QOM/qdev and remove MUSBReadFunc/MUSBWriteFunc */
+typedef void MUSBWriteFunc(void *opaque, hwaddr addr, uint32_t value);
+typedef uint32_t MUSBReadFunc(void *opaque, hwaddr addr);
+extern MUSBReadFunc * const musb_read[];
+extern MUSBWriteFunc * const musb_write[];
typedef struct MUSBState MUSBState;
diff --git a/hw/usb/hcd-musb.c b/hw/usb/hcd-musb.c
index ea7a89fd0c..82865abe65 100644
--- a/hw/usb/hcd-musb.c
+++ b/hw/usb/hcd-musb.c
@@ -1540,13 +1540,13 @@ static void musb_writew(void *opaque, hwaddr addr, uint32_t value)
};
}
-CPUReadMemoryFunc * const musb_read[] = {
+MUSBReadFunc * const musb_read[] = {
musb_readb,
musb_readh,
musb_readw,
};
-CPUWriteMemoryFunc * const musb_write[] = {
+MUSBWriteFunc * const musb_write[] = {
musb_writeb,
musb_writeh,
musb_writew,
--
2.21.3
next prev parent reply other threads:[~2020-06-01 7:56 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-01 7:53 [PATCH 0/3] exec: Kill CPUReadMemoryFunc/CPUWriteMemoryFunc typedefs Philippe Mathieu-Daudé
2020-06-01 7:53 ` [PATCH 1/3] exec/memory: Remove unused MemoryRegionMmio type Philippe Mathieu-Daudé
2020-06-01 7:53 ` [PATCH 2/3] hw/usb: Move device-specific declarations to new 'musb.h' header Philippe Mathieu-Daudé
2020-06-01 7:54 ` Philippe Mathieu-Daudé [this message]
2020-06-01 10:35 ` [PATCH 0/3] exec: Kill CPUReadMemoryFunc/CPUWriteMemoryFunc typedefs Peter Maydell
2020-06-01 11:21 ` Philippe Mathieu-Daudé
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=20200601075400.2043-4-f4bug@amsat.org \
--to=f4bug@amsat.org \
--cc=kraxel@redhat.com \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=rth@twiddle.net \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).