Skip to contentSkip to conversation

hw/sd : move sd.h to include/hw/sd/

RFC Superseded Sai Pavan Boddu 3 participants 5 messages Sep 7, 2015 – Sep 9, 2015

v2 of 10 Superseded Latest is v10 →

lore
Share & tools
lore
#0 lore raw

RFC v2 1/2 hw/sd : move sd.h to include/hw/sd/

Create new folder in includes for sd headers.

---
 hw/sd/milkymist-memcard.c | 2 +-
 hw/sd/omap_mmc.c          | 2 +-
 hw/sd/pl181.c             | 2 +-
 hw/sd/pxa2xx_mmci.c       | 2 +-
 hw/sd/sd.c                | 2 +-
 hw/sd/sdhci.h             | 2 +-
 hw/sd/ssi-sd.c            | 2 +-
 include/hw/{ => sd}/sd.h  | 0
 8 files changed, 7 insertions(+), 7 deletions(-)
 rename include/hw/{ => sd}/sd.h (100%)
hw/sd/milkymist-memcard.c +1 -1
index 2209ef1..b430d56 100644
@@ -28,7 +28,7 @@
 #include "qemu/error-report.h"
 #include "sysemu/block-backend.h"
 #include "sysemu/blockdev.h"
-#include "hw/sd.h"
+#include "hw/sd/sd.h"
 
 enum {
     ENABLE_CMD_TX   = (1<<0),
hw/sd/omap_mmc.c +1 -1
index d072dec..3bf1fcc 100644
@@ -18,7 +18,7 @@
  */
 #include "hw/hw.h"
 #include "hw/arm/omap.h"
-#include "hw/sd.h"
+#include "hw/sd/sd.h"
 
 struct omap_mmc_s {
     qemu_irq irq;
hw/sd/pl181.c +1 -1
index 11fcd47..ddd9b6f 100644
@@ -10,7 +10,7 @@
 #include "sysemu/block-backend.h"
 #include "sysemu/blockdev.h"
 #include "hw/sysbus.h"
-#include "hw/sd.h"
+#include "hw/sd/sd.h"
 
 //#define DEBUG_PL181 1
 
hw/sd/pxa2xx_mmci.c +1 -1
index d1fe6d5..b217080 100644
@@ -12,7 +12,7 @@
 
 #include "hw/hw.h"
 #include "hw/arm/pxa.h"
-#include "hw/sd.h"
+#include "hw/sd/sd.h"
 #include "hw/qdev.h"
 
 struct PXA2xxMMCIState {
hw/sd/sd.c +1 -1
index a1ff465..0787e33 100644
@@ -31,7 +31,7 @@
 
 #include "hw/hw.h"
 #include "sysemu/block-backend.h"
-#include "hw/sd.h"
+#include "hw/sd/sd.h"
 #include "qemu/bitmap.h"
 
 //#define DEBUG_SD 1
hw/sd/sdhci.h +1 -1
index 3352d23..a45593f 100644
@@ -28,7 +28,7 @@
 #include "qemu-common.h"
 #include "hw/pci/pci.h"
 #include "hw/sysbus.h"
-#include "hw/sd.h"
+#include "hw/sd/sd.h"
 
 /* R/W SDMA System Address register 0x0 */
 #define SDHC_SYSAD                     0x00
hw/sd/ssi-sd.c +1 -1
index e4b2d4f..c49ff62 100644
@@ -13,7 +13,7 @@
 #include "sysemu/block-backend.h"
 #include "sysemu/blockdev.h"
 #include "hw/ssi.h"
-#include "hw/sd.h"
+#include "hw/sd/sd.h"
 
 //#define DEBUG_SSI_SD 1
 
include/hw/sd/sd.h renamed from include/hw/sd.h +0 -0
similarity index 100%
rename from include/hw/sd.h
rename to include/hw/sd/sd.h
Signature · 1 line
1.9.1
#1 lore raw

RFC v2 2/2 sdhci: Move sdhci.h to include/

Move sdhci.h to include/hw/sd/. Which makes easy creation of device using object_initialize.

---
Changes for V2:
Create new area in includes for sd. And move sdhci.h to same.

---
 hw/sd/sdhci.c                 | 2 +-
 {hw => include/hw}/sd/sdhci.h | 0
 2 files changed, 1 insertion(+), 1 deletion(-)
 rename {hw => include/hw}/sd/sdhci.h (100%)
hw/sd/sdhci.c +1 -1
index e63367b..811e5b0 100644
@@ -29,7 +29,7 @@
 #include "qemu/timer.h"
 #include "qemu/bitops.h"
 
-#include "sdhci.h"
+#include "hw/sd/sdhci.h"
 
 /* host controller debug messages */
 #ifndef SDHC_DEBUG
include/hw/sd/sdhci.h renamed from hw/sd/sdhci.h +0 -0
similarity index 100%
rename from hw/sd/sdhci.h
rename to include/hw/sd/sdhci.h
Signature · 1 line
1.9.1
#2 lore raw

Re: [Qemu-devel] [RFC V2 2/2] sdhci: Move sdhci.h to include/

Quoted 4 lines · Sai Pavan Boddu

Move sdhci.h to include/hw/sd/. Which makes easy creation of device using object_initialize.

Quoted 8 lines

---
Changes for V2:
Create new area in includes for sd. And move sdhci.h to same.

---
 hw/sd/sdhci.c                 | 2 +-
 {hw => include/hw}/sd/sdhci.h | 0
 2 files changed, 1 insertion(+), 1 deletion(-)
 rename {hw => include/hw}/sd/sdhci.h (100%)

Please keep hardware constants and any other device emulation internals in hw/sd/. The header files in include/ should only contain that "public" APIs that other parts of QEMU consume.

I think the declarations that need to be in include/ are:
1. typedef struct SDHCIState
2. TYPE_PCI_SDHCI and PCI_SDHCI()
3. TYPE_SYSBUS_SDHCI and SYSBUS_SDHCI()

The other declarations are internals that should be kept in hw/sd/.

This way there is a clear public API and internals (used by SD emulation code).

#3 lore raw

Re: [Qemu-devel] [RFC V2 2/2] sdhci: Move sdhci.h to include/

Hi Stefan,

Quoted 23 lines

-----Original Message-----
From: Stefan Hajnoczi [mailto:[email protected]]
Sent: Wednesday, September 09, 2015 3:08 PM
To: Sai Pavan Boddu
Cc: [email protected]; [email protected]; [email protected]; [email protected]; Sai Pavan Boddu; Edgar Iglesias; Alistair Francis
Subject: Re: [Qemu-devel] [RFC V2 2/2] sdhci: Move sdhci.h to include/

Quoted 4 lines · Sai Pavan Boddu

Move sdhci.h to include/hw/sd/. Which makes easy creation of device using object_initialize.

Quoted 8 lines

---
Changes for V2:
Create new area in includes for sd. And move sdhci.h to same.

---
 hw/sd/sdhci.c                 | 2 +-
 {hw => include/hw}/sd/sdhci.h | 0
 2 files changed, 1 insertion(+), 1 deletion(-)
 rename {hw => include/hw}/sd/sdhci.h (100%)
Quoted 8 lines

Please keep hardware constants and any other device emulation internals in hw/sd/. The header files in include/ should only contain that "public" APIs that other parts of QEMU consume.

I think the declarations that need to be in include/ are:
1. typedef struct SDHCIState
2. TYPE_PCI_SDHCI and PCI_SDHCI()
3. TYPE_SYSBUS_SDHCI and SYSBUS_SDHCI()

[Sai Pavan ] Ok sounds fair, So I will try to send out patches splitting the header into two. And moving the public content into include/.

Regards,
Sai Pavan

Quoted 5 lines

The other declarations are internals that should be kept in hw/sd/.

This way there is a clear public API and internals (used by SD emulation code).

#4 lore raw
In reply to Sai Pavan Boddu

[meta-comment]

Quoted 4 lines · Sai Pavan Boddu

Create new folder in includes for sd headers.

---

When sending a series (as evidenced by your 1/2 in the subject line), you need a 0/2 cover letter that all other messages in the series are in-reply-to. 'git config format.coverLetter auto' can make it easier to remember to write the cover letter.

More patch submission hints:
http://wiki.qemu.org/Contribute/SubmitAPatch

Signature · 2 lines
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org