Skip to contentSkip to conversation

Update pci code to use phys_addr_t

PATCH New Becky Bruce 2 participants 2 messages May 7, 2008 – May 9, 2008 PCI

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Update pci code to use phys_addr_t

Physical addrs need to be represented by phys_addr_t, not unsigned long. Otherwise, systems that use CONFIG_PHYS_64BIT are going to fail mightily.

---
 drivers/pci/pci.c |    8 ++++----
 include/pci.h     |   10 +++++-----
 2 files changed, 9 insertions(+), 9 deletions(-)
drivers/pci/pci.c +4 -4
index 7944b66..f01a75e 100644
@@ -221,7 +221,7 @@ pci_dev_t pci_find_device(unsigned int vendor, unsigned int device, int index)
  */
 
 unsigned long pci_hose_phys_to_bus (struct pci_controller *hose,
-				    unsigned long phys_addr,
+				    phys_addr_t phys_addr,
 				    unsigned long flags)
 {
 	struct pci_region *res;
@@ -253,9 +253,9 @@ Done:
 	return 0;
 }
 
-unsigned long pci_hose_bus_to_phys(struct pci_controller* hose,
-				   unsigned long bus_addr,
-				   unsigned long flags)
+phys_addr_t pci_hose_bus_to_phys(struct pci_controller* hose,
+				 unsigned long bus_addr,
+				 unsigned long flags)
 {
 	struct pci_region *res;
 	int i;
include/pci.h +5 -5
index 8e5dacc..1c8e216 100644
@@ -314,7 +314,7 @@
 
 struct pci_region {
 	unsigned long bus_start;		/* Start on the bus */
-	unsigned long phys_start;		/* Start in physical address space */
+	phys_addr_t phys_start;			/* Start in physical address space */
 	unsigned long size;			/* Size */
 	unsigned long flags;			/* Resource flags */
 
@@ -331,7 +331,7 @@ struct pci_region {
 
 extern __inline__ void pci_set_region(struct pci_region *reg,
 				      unsigned long bus_start,
-				      unsigned long phys_start,
+				      phys_addr_t phys_start,
 				      unsigned long size,
 				      unsigned long flags) {
 	reg->bus_start	= bus_start;
@@ -432,10 +432,10 @@ extern __inline__ void pci_set_ops(struct pci_controller *hose,
 
 extern void pci_setup_indirect(struct pci_controller* hose, u32 cfg_addr, u32 cfg_data);
 
-extern unsigned long pci_hose_bus_to_phys(struct pci_controller* hose,
-					  unsigned long addr, unsigned long flags);
+extern phys_addr_t pci_hose_bus_to_phys(struct pci_controller* hose,
+					unsigned long addr, unsigned long flags);
 extern unsigned long pci_hose_phys_to_bus(struct pci_controller* hose,
-					  unsigned long addr, unsigned long flags);
+					  phys_addr_t addr, unsigned long flags);
 
 #define pci_phys_to_bus(dev, addr, flags) \
 	pci_hose_phys_to_bus(pci_bus_to_hose(PCI_BUS(dev)), (addr), (flags))
Signature · 1 line
1.5.4.1
#1 lore raw

PATCH 1/1 Update pci code to use phys_addr_t

Quoted 9 lines · In message <[email protected]> you wrote:

Physical addrs need to be represented by phys_addr_t, not unsigned long. Otherwise, systems that use CONFIG_PHYS_64BIT are going to fail mightily.

---
 drivers/pci/pci.c |    8 ++++----
 include/pci.h     |   10 +++++-----
 2 files changed, 9 insertions(+), 9 deletions(-)

Applied, thanks.

Best regards,

Wolfgang Denk

Signature · 5 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
It would be illogical to kill without reason
	-- Spock, "Journey to Babel", stardate 3842.4