Skip to contentSkip to conversation

PCI MMConfig: Share what's shareable.

PATCH In review Olivier Galibert 2 participants 7 messages Dec 7, 2006

lore
Share & tools
lore
#0 lore raw

PATCH 1/5 PCI MMConfig: Share what's shareable.

i386 and x86-64 pci mmconfig code have a lot in common. So share what's shareable between the two.

---
 arch/i386/pci/Makefile          |    2 +-
 arch/i386/pci/mmconfig-shared.c |   88 +++++++++++++++++++++++++++++++++++++++
 arch/i386/pci/mmconfig.c        |   70 ++-----------------------------
 arch/x86_64/pci/Makefile        |    3 +-
 arch/x86_64/pci/mmconfig.c      |   64 +++-------------------------
 5 files changed, 102 insertions(+), 125 deletions(-)
arch/i386/pci/Makefile +1 -1
index 1594d2f..44650e0 100644
@@ -1,7 +1,7 @@
 obj-y				:= i386.o init.o
 
 obj-$(CONFIG_PCI_BIOS)		+= pcbios.o
-obj-$(CONFIG_PCI_MMCONFIG)	+= mmconfig.o direct.o
+obj-$(CONFIG_PCI_MMCONFIG)	+= mmconfig.o direct.o mmconfig-shared.o
 obj-$(CONFIG_PCI_DIRECT)	+= direct.o
 
 pci-y				:= fixup.o
arch/i386/pci/mmconfig-shared.c new file +88 -0

88 lines not on this page · raw message

arch/i386/pci/mmconfig.c +4 -66

95 lines not on this page · raw message

arch/x86_64/pci/Makefile +2 -1
index 149aba0..c9eddc8 100644
@@ -11,7 +11,7 @@ obj-y		+= fixup.o init.o
 obj-$(CONFIG_ACPI)	+= acpi.o
 obj-y			+= legacy.o irq.o common.o early.o
 # mmconfig has a 64bit special
-obj-$(CONFIG_PCI_MMCONFIG) += mmconfig.o direct.o
+obj-$(CONFIG_PCI_MMCONFIG) += mmconfig.o direct.o mmconfig-shared.o
 
 obj-$(CONFIG_NUMA)	+= k8-bus.o
 
@@ -24,3 +24,4 @@ fixup-y  += ../../i386/pci/fixup.o
 i386-y  += ../../i386/pci/i386.o
 init-y += ../../i386/pci/init.o
 early-y += ../../i386/pci/early.o
+mmconfig-shared-y += ../../i386/pci/mmconfig-shared.o
arch/x86_64/pci/mmconfig.c +7 -57

97 lines not on this page · raw message

Signature · 1 line
1.4.4.1.g278f
#1 lore raw

arch/i386/pci/mmconfig-shared.c line 60

Quoted 3 lines · Olivier Galibert
arch/i386/pci/mmconfig-shared.c new file +3 -0
+void __init pci_mmcfg_init(int type)
+{
+	extern int pci_mmcfg_arch_init(void);

Please put this in a suitable header file.

arch/i386/pci/mmconfig.c line 26

Quoted 6 lines
arch/i386/pci/mmconfig.c +1 -1
@@ -27,7 +23,7 @@
 /* The base address of the last MMCONFIG device accessed */
 static u32 mmcfg_last_accessed_device;
 
-static DECLARE_BITMAP(fallback_slots, MAX_CHECK_BUS*32);
+extern DECLARE_BITMAP(pci_mmcfg_fallback_slots, MAX_CHECK_BUS*32);

... and this (also occurs in another place).

Cheers,
Muli

#2 lore raw
Quoted 7 lines · Muli Ben-Yehuda

arch/i386/pci/mmconfig-shared.c line 60

Quoted 3 lines · Olivier Galibert
arch/i386/pci/mmconfig-shared.c new file +3 -0
+void __init pci_mmcfg_init(int type)
+{
+	extern int pci_mmcfg_arch_init(void);

Please put this in a suitable header file.

Sure, which ?

OG.

#3 lore raw
Quoted 10 lines · Olivier Galibert
Quoted 7 lines · Muli Ben-Yehuda

arch/i386/pci/mmconfig-shared.c line 60

Quoted 3 lines · Olivier Galibert
arch/i386/pci/mmconfig-shared.c new file +3 -0
+void __init pci_mmcfg_init(int type)
+{
+	extern int pci_mmcfg_arch_init(void);

Please put this in a suitable header file.

Sure, which ?

arch/i386/pci/pci.h seems the least-inappropriate.

Also, forgot to mention, please get rid of C++ style comments in the code.

Cheers,
Muli

#4 lore raw
Quoted 1 line · Muli Ben-Yehuda

arch/i386/pci/pci.h seems the least-inappropriate.

Ok, will do.

Quoted 2 lines

Also, forgot to mention, please get rid of C++ style comments in the code.

# git grep '//' -- '*.c' |fgrep -v 'http://' |wc -l
14333

You lost that war ages ago. Come join us in this millenia, line-comments exist officially in C since 1999, and were supported way before that.

OG.

#5 lore raw
Quoted 6 lines · Olivier Galibert
# git grep '//' -- '*.c' |fgrep -v 'http://' |wc -l
14333

You lost that war ages ago. Come join us in this millenia, line-comments exist officially in C since 1999, and were supported way before that.

If I was bored, I might've counted how many /* */ style comments we had in the source, then used it to construct an elaborate argument why C++-style comments are evil and Conformance is Goodness, but I'm not, so I won't.

Cheers,
Muli

#6 lore raw
Quoted 11 lines · Muli Ben-Yehuda
Quoted 6 lines · Olivier Galibert
# git grep '//' -- '*.c' |fgrep -v 'http://' |wc -l
14333

You lost that war ages ago. Come join us in this millenia, line-comments exist officially in C since 1999, and were supported way before that.

If I was bored, I might've counted how many /* */ style comments we had in the source,

426K or so.

Quoted 3 lines

then used it to construct an elaborate argument why C++-style comments are evil and Conformance is Goodness, but I'm not, so I won't.

I've yet to see an actual technical argument against them. I find them more readable by making it perfectly obvious what their application range is, contrary to /* where you need to find the closing */. But that's just me.

OG.