aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@suse.de>2006-06-12 20:06:02 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2006-06-27 12:24:00 -0400
commite31dd6e4520439ceae4753f32dd2da2c345e929a (patch)
treefea87cfb0077135c6dcaf7849e518ee31733b0fc /drivers
parentd75fc8bbccf7c019994bcfd6255d5b56335ed21d (diff)
[PATCH] 64bit resource: change pci core and arch code to use resource_size_t
Based on a patch series originally from Vivek Goyal <vgoyal@in.ibm.com> Cc: Vivek Goyal <vgoyal@in.ibm.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/pci/bus.c10
-rw-r--r--drivers/pci/pci-sysfs.c4
-rw-r--r--drivers/pci/pci.h6
-rw-r--r--drivers/pci/proc.c4
-rw-r--r--drivers/pci/rom.c10
-rw-r--r--drivers/pci/setup-res.c6
6 files changed, 20 insertions, 20 deletions
diff --git a/drivers/pci/bus.c b/drivers/pci/bus.c
index 723092682023..5f7db9d2436e 100644
--- a/drivers/pci/bus.c
+++ b/drivers/pci/bus.c
@@ -34,11 +34,11 @@
34 */ 34 */
35int 35int
36pci_bus_alloc_resource(struct pci_bus *bus, struct resource *res, 36pci_bus_alloc_resource(struct pci_bus *bus, struct resource *res,
37 unsigned long size, unsigned long align, unsigned long min, 37 resource_size_t size, resource_size_t align,
38 unsigned int type_mask, 38 resource_size_t min, unsigned int type_mask,
39 void (*alignf)(void *, struct resource *, 39 void (*alignf)(void *, struct resource *, resource_size_t,
40 unsigned long, unsigned long), 40 resource_size_t),
41 void *alignf_data) 41 void *alignf_data)
42{ 42{
43 int i, ret = -ENOMEM; 43 int i, ret = -ENOMEM;
44 44
diff --git a/drivers/pci/pci-sysfs.c b/drivers/pci/pci-sysfs.c
index bc405c035ce3..606f9b6f70eb 100644
--- a/drivers/pci/pci-sysfs.c
+++ b/drivers/pci/pci-sysfs.c
@@ -87,7 +87,7 @@ resource_show(struct device * dev, struct device_attribute *attr, char * buf)
87 char * str = buf; 87 char * str = buf;
88 int i; 88 int i;
89 int max = 7; 89 int max = 7;
90 u64 start, end; 90 resource_size_t start, end;
91 91
92 if (pci_dev->subordinate) 92 if (pci_dev->subordinate)
93 max = DEVICE_COUNT_RESOURCE; 93 max = DEVICE_COUNT_RESOURCE;
@@ -365,7 +365,7 @@ pci_mmap_resource(struct kobject *kobj, struct bin_attribute *attr,
365 struct device, kobj)); 365 struct device, kobj));
366 struct resource *res = (struct resource *)attr->private; 366 struct resource *res = (struct resource *)attr->private;
367 enum pci_mmap_state mmap_type; 367 enum pci_mmap_state mmap_type;
368 u64 start, end; 368 resource_size_t start, end;
369 int i; 369 int i;
370 370
371 for (i = 0; i < PCI_ROM_RESOURCE; i++) 371 for (i = 0; i < PCI_ROM_RESOURCE; i++)
diff --git a/drivers/pci/pci.h b/drivers/pci/pci.h
index 29bdeca031a8..9cc842b666eb 100644
--- a/drivers/pci/pci.h
+++ b/drivers/pci/pci.h
@@ -6,10 +6,10 @@ extern int pci_create_sysfs_dev_files(struct pci_dev *pdev);
6extern void pci_remove_sysfs_dev_files(struct pci_dev *pdev); 6extern void pci_remove_sysfs_dev_files(struct pci_dev *pdev);
7extern void pci_cleanup_rom(struct pci_dev *dev); 7extern void pci_cleanup_rom(struct pci_dev *dev);
8extern int pci_bus_alloc_resource(struct pci_bus *bus, struct resource *res, 8extern int pci_bus_alloc_resource(struct pci_bus *bus, struct resource *res,
9 unsigned long size, unsigned long align, 9 resource_size_t size, resource_size_t align,
10 unsigned long min, unsigned int type_mask, 10 resource_size_t min, unsigned int type_mask,
11 void (*alignf)(void *, struct resource *, 11 void (*alignf)(void *, struct resource *,
12 unsigned long, unsigned long), 12 resource_size_t, resource_size_t),
13 void *alignf_data); 13 void *alignf_data);
14/* Firmware callbacks */ 14/* Firmware callbacks */
15extern int (*platform_pci_choose_state)(struct pci_dev *dev, pm_message_t state); 15extern int (*platform_pci_choose_state)(struct pci_dev *dev, pm_message_t state);
diff --git a/drivers/pci/proc.c b/drivers/pci/proc.c
index 20dfd77bd8c2..99cf33379769 100644
--- a/drivers/pci/proc.c
+++ b/drivers/pci/proc.c
@@ -350,14 +350,14 @@ static int show_device(struct seq_file *m, void *v)
350 dev->irq); 350 dev->irq);
351 /* Here should be 7 and not PCI_NUM_RESOURCES as we need to preserve compatibility */ 351 /* Here should be 7 and not PCI_NUM_RESOURCES as we need to preserve compatibility */
352 for (i=0; i<7; i++) { 352 for (i=0; i<7; i++) {
353 u64 start, end; 353 resource_size_t start, end;
354 pci_resource_to_user(dev, i, &dev->resource[i], &start, &end); 354 pci_resource_to_user(dev, i, &dev->resource[i], &start, &end);
355 seq_printf(m, "\t%16llx", 355 seq_printf(m, "\t%16llx",
356 (unsigned long long)(start | 356 (unsigned long long)(start |
357 (dev->resource[i].flags & PCI_REGION_FLAG_MASK))); 357 (dev->resource[i].flags & PCI_REGION_FLAG_MASK)));
358 } 358 }
359 for (i=0; i<7; i++) { 359 for (i=0; i<7; i++) {
360 u64 start, end; 360 resource_size_t start, end;
361 pci_resource_to_user(dev, i, &dev->resource[i], &start, &end); 361 pci_resource_to_user(dev, i, &dev->resource[i], &start, &end);
362 seq_printf(m, "\t%16llx", 362 seq_printf(m, "\t%16llx",
363 dev->resource[i].start < dev->resource[i].end ? 363 dev->resource[i].start < dev->resource[i].end ?
diff --git a/drivers/pci/rom.c b/drivers/pci/rom.c
index 598a115cd00e..cbb69cf41311 100644
--- a/drivers/pci/rom.c
+++ b/drivers/pci/rom.c
@@ -80,8 +80,8 @@ void __iomem *pci_map_rom(struct pci_dev *pdev, size_t *size)
80 } else { 80 } else {
81 if (res->flags & IORESOURCE_ROM_COPY) { 81 if (res->flags & IORESOURCE_ROM_COPY) {
82 *size = pci_resource_len(pdev, PCI_ROM_RESOURCE); 82 *size = pci_resource_len(pdev, PCI_ROM_RESOURCE);
83 return (void __iomem *)pci_resource_start(pdev, 83 return (void __iomem *)(unsigned long)
84 PCI_ROM_RESOURCE); 84 pci_resource_start(pdev, PCI_ROM_RESOURCE);
85 } else { 85 } else {
86 /* assign the ROM an address if it doesn't have one */ 86 /* assign the ROM an address if it doesn't have one */
87 if (res->parent == NULL && 87 if (res->parent == NULL &&
@@ -170,11 +170,11 @@ void __iomem *pci_map_rom_copy(struct pci_dev *pdev, size_t *size)
170 return rom; 170 return rom;
171 171
172 res->end = res->start + *size; 172 res->end = res->start + *size;
173 memcpy_fromio((void*)res->start, rom, *size); 173 memcpy_fromio((void*)(unsigned long)res->start, rom, *size);
174 pci_unmap_rom(pdev, rom); 174 pci_unmap_rom(pdev, rom);
175 res->flags |= IORESOURCE_ROM_COPY; 175 res->flags |= IORESOURCE_ROM_COPY;
176 176
177 return (void __iomem *)res->start; 177 return (void __iomem *)(unsigned long)res->start;
178} 178}
179 179
180/** 180/**
@@ -227,7 +227,7 @@ void pci_cleanup_rom(struct pci_dev *pdev)
227{ 227{
228 struct resource *res = &pdev->resource[PCI_ROM_RESOURCE]; 228 struct resource *res = &pdev->resource[PCI_ROM_RESOURCE];
229 if (res->flags & IORESOURCE_ROM_COPY) { 229 if (res->flags & IORESOURCE_ROM_COPY) {
230 kfree((void*)res->start); 230 kfree((void*)(unsigned long)res->start);
231 res->flags &= ~IORESOURCE_ROM_COPY; 231 res->flags &= ~IORESOURCE_ROM_COPY;
232 res->start = 0; 232 res->start = 0;
233 res->end = 0; 233 res->end = 0;
diff --git a/drivers/pci/setup-res.c b/drivers/pci/setup-res.c
index f5ff0d3ba620..ab78e4bbdd83 100644
--- a/drivers/pci/setup-res.c
+++ b/drivers/pci/setup-res.c
@@ -121,7 +121,7 @@ int pci_assign_resource(struct pci_dev *dev, int resno)
121{ 121{
122 struct pci_bus *bus = dev->bus; 122 struct pci_bus *bus = dev->bus;
123 struct resource *res = dev->resource + resno; 123 struct resource *res = dev->resource + resno;
124 unsigned long size, min, align; 124 resource_size_t size, min, align;
125 int ret; 125 int ret;
126 126
127 size = res->end - res->start + 1; 127 size = res->end - res->start + 1;
@@ -209,7 +209,7 @@ pdev_sort_resources(struct pci_dev *dev, struct resource_list *head)
209 for (i = 0; i < PCI_NUM_RESOURCES; i++) { 209 for (i = 0; i < PCI_NUM_RESOURCES; i++) {
210 struct resource *r; 210 struct resource *r;
211 struct resource_list *list, *tmp; 211 struct resource_list *list, *tmp;
212 unsigned long r_align; 212 resource_size_t r_align;
213 213
214 r = &dev->resource[i]; 214 r = &dev->resource[i];
215 r_align = r->end - r->start; 215 r_align = r->end - r->start;
@@ -225,7 +225,7 @@ pdev_sort_resources(struct pci_dev *dev, struct resource_list *head)
225 } 225 }
226 r_align = (i < PCI_BRIDGE_RESOURCES) ? r_align + 1 : r->start; 226 r_align = (i < PCI_BRIDGE_RESOURCES) ? r_align + 1 : r->start;
227 for (list = head; ; list = list->next) { 227 for (list = head; ; list = list->next) {
228 unsigned long align = 0; 228 resource_size_t align = 0;
229 struct resource_list *ln = list->next; 229 struct resource_list *ln = list->next;
230 int idx; 230 int idx;
231 231