[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>
This commit is contained in:
Greg Kroah-Hartman
2006-06-12 17:06:02 -07:00
parent d75fc8bbcc
commit e31dd6e452
31 changed files with 76 additions and 74 deletions
+2 -2
View File
@@ -124,12 +124,12 @@ DECLARE_PCI_FIXUP_FINAL(PCI_ANY_ID, PCI_ANY_ID, pcibios_fixup_final);
void void
pcibios_align_resource(void *data, struct resource *res, pcibios_align_resource(void *data, struct resource *res,
unsigned long size, unsigned long align) resource_size_t size, resource_size_t align)
{ {
struct pci_dev *dev = data; struct pci_dev *dev = data;
struct pci_controller *hose = dev->sysdata; struct pci_controller *hose = dev->sysdata;
unsigned long alignto; unsigned long alignto;
unsigned long start = res->start; resource_size_t start = res->start;
if (res->flags & IORESOURCE_IO) { if (res->flags & IORESOURCE_IO) {
/* Make sure we start at our min on all hoses */ /* Make sure we start at our min on all hoses */
+3 -3
View File
@@ -304,7 +304,7 @@ static inline int pdev_bad_for_parity(struct pci_dev *dev)
static void __devinit static void __devinit
pdev_fixup_device_resources(struct pci_sys_data *root, struct pci_dev *dev) pdev_fixup_device_resources(struct pci_sys_data *root, struct pci_dev *dev)
{ {
unsigned long offset; resource_size_t offset;
int i; int i;
for (i = 0; i < PCI_NUM_RESOURCES; i++) { for (i = 0; i < PCI_NUM_RESOURCES; i++) {
@@ -634,9 +634,9 @@ char * __init pcibios_setup(char *str)
* which might be mirrored at 0x0100-0x03ff.. * which might be mirrored at 0x0100-0x03ff..
*/ */
void pcibios_align_resource(void *data, struct resource *res, void pcibios_align_resource(void *data, struct resource *res,
unsigned long size, unsigned long align) resource_size_t size, resource_size_t align)
{ {
unsigned long start = res->start; resource_size_t start = res->start;
if (res->flags & IORESOURCE_IO && start & 0x300) if (res->flags & IORESOURCE_IO && start & 0x300)
start = (start + 0x3ff) & ~0x3ff; start = (start + 0x3ff) & ~0x3ff;
+2 -2
View File
@@ -43,10 +43,10 @@ int pci_mmap_page_range(struct pci_dev *dev, struct vm_area_struct *vma,
void void
pcibios_align_resource(void *data, struct resource *res, pcibios_align_resource(void *data, struct resource *res,
unsigned long size, unsigned long align) resource_size_t size, resource_size_t align)
{ {
if (res->flags & IORESOURCE_IO) { if (res->flags & IORESOURCE_IO) {
unsigned long start = res->start; resource_size_t start = res->start;
if (start & 0x300) { if (start & 0x300) {
start = (start + 0x3ff) & ~0x3ff; start = (start + 0x3ff) & ~0x3ff;
+2 -2
View File
@@ -64,10 +64,10 @@ pcibios_update_resource(struct pci_dev *dev, struct resource *root,
*/ */
void void
pcibios_align_resource(void *data, struct resource *res, pcibios_align_resource(void *data, struct resource *res,
unsigned long size, unsigned long align) resource_size_t size, resource_size_t align)
{ {
if (res->flags & IORESOURCE_IO) { if (res->flags & IORESOURCE_IO) {
unsigned long start = res->start; resource_size_t start = res->start;
if (start & 0x300) { if (start & 0x300) {
start = (start + 0x3ff) & ~0x3ff; start = (start + 0x3ff) & ~0x3ff;
+2 -2
View File
@@ -48,10 +48,10 @@
*/ */
void void
pcibios_align_resource(void *data, struct resource *res, pcibios_align_resource(void *data, struct resource *res,
unsigned long size, unsigned long align) resource_size_t size, resource_size_t align)
{ {
if (res->flags & IORESOURCE_IO) { if (res->flags & IORESOURCE_IO) {
unsigned long start = res->start; resource_size_t start = res->start;
if (start & 0x300) { if (start & 0x300) {
start = (start + 0x3ff) & ~0x3ff; start = (start + 0x3ff) & ~0x3ff;
+1 -1
View File
@@ -568,7 +568,7 @@ pcibios_disable_device (struct pci_dev *dev)
void void
pcibios_align_resource (void *data, struct resource *res, pcibios_align_resource (void *data, struct resource *res,
unsigned long size, unsigned long align) resource_size_t size, resource_size_t align)
{ {
} }
+2 -1
View File
@@ -357,7 +357,8 @@ void pcibios_fixup_bus(struct pci_bus *b)
/*****************************************************************************/ /*****************************************************************************/
void pcibios_align_resource(void *data, struct resource *res, unsigned long size, unsigned long align) void pcibios_align_resource(void *data, struct resource *res,
resource_size_t size, resource_size_t align)
{ {
} }
+2 -2
View File
@@ -51,11 +51,11 @@ unsigned long PCIBIOS_MIN_MEM = 0;
*/ */
void void
pcibios_align_resource(void *data, struct resource *res, pcibios_align_resource(void *data, struct resource *res,
unsigned long size, unsigned long align) resource_size_t size, resource_size_t align)
{ {
struct pci_dev *dev = data; struct pci_dev *dev = data;
struct pci_controller *hose = dev->sysdata; struct pci_controller *hose = dev->sysdata;
unsigned long start = res->start; resource_size_t start = res->start;
if (res->flags & IORESOURCE_IO) { if (res->flags & IORESOURCE_IO) {
/* Make sure we start at our min on all hoses */ /* Make sure we start at our min on all hoses */
+2 -2
View File
@@ -383,12 +383,12 @@ void pcibios_update_resource(struct pci_dev *dev, struct resource *root,
void pcibios_align_resource(void *data, struct resource *res, void pcibios_align_resource(void *data, struct resource *res,
unsigned long size, unsigned long align) resource_size_t size, resource_size_t align)
{ {
struct pci_dev *dev = data; struct pci_dev *dev = data;
if (res->flags & IORESOURCE_IO) { if (res->flags & IORESOURCE_IO) {
unsigned long start = res->start; resource_size_t start = res->start;
/* We need to avoid collisions with `mirrored' VGA ports /* We need to avoid collisions with `mirrored' VGA ports
and other strange ISA hardware, so we always want the and other strange ISA hardware, so we always want the
+1 -1
View File
@@ -289,7 +289,7 @@ EXPORT_SYMBOL(pcibios_bus_to_resource);
* than res->start. * than res->start.
*/ */
void pcibios_align_resource(void *data, struct resource *res, void pcibios_align_resource(void *data, struct resource *res,
unsigned long size, unsigned long alignment) resource_size_t size, resource_size_t alignment)
{ {
unsigned long mask, align; unsigned long mask, align;
+5 -5
View File
@@ -173,18 +173,18 @@ EXPORT_SYMBOL(pcibios_bus_to_resource);
* but we want to try to avoid allocating at 0x2900-0x2bff * but we want to try to avoid allocating at 0x2900-0x2bff
* which might have be mirrored at 0x0100-0x03ff.. * which might have be mirrored at 0x0100-0x03ff..
*/ */
void pcibios_align_resource(void *data, struct resource *res, unsigned long size, void pcibios_align_resource(void *data, struct resource *res,
unsigned long align) resource_size_t size, resource_size_t align)
{ {
struct pci_dev *dev = data; struct pci_dev *dev = data;
if (res->flags & IORESOURCE_IO) { if (res->flags & IORESOURCE_IO) {
unsigned long start = res->start; resource_size_t start = res->start;
if (size > 0x100) { if (size > 0x100) {
printk(KERN_ERR "PCI: I/O Region %s/%d too large" printk(KERN_ERR "PCI: I/O Region %s/%d too large"
" (%lld bytes)\n", pci_name(dev), " (%lld bytes)\n", pci_name(dev),
dev->resource - res, size); dev->resource - res, (unsigned long long)size);
} }
if (start & 0x300) { if (start & 0x300) {
@@ -1756,7 +1756,7 @@ long sys_pciconfig_iobase(long which, unsigned long bus, unsigned long devfn)
void pci_resource_to_user(const struct pci_dev *dev, int bar, void pci_resource_to_user(const struct pci_dev *dev, int bar,
const struct resource *rsrc, const struct resource *rsrc,
u64 *start, u64 *end) resource_size_t *start, resource_size_t *end)
{ {
struct pci_controller *hose = pci_bus_to_hose(dev->bus->number); struct pci_controller *hose = pci_bus_to_hose(dev->bus->number);
unsigned long offset = 0; unsigned long offset = 0;
+2 -2
View File
@@ -138,11 +138,11 @@ EXPORT_SYMBOL(pcibios_bus_to_resource);
* which might have be mirrored at 0x0100-0x03ff.. * which might have be mirrored at 0x0100-0x03ff..
*/ */
void pcibios_align_resource(void *data, struct resource *res, void pcibios_align_resource(void *data, struct resource *res,
unsigned long size, unsigned long align) resource_size_t size, resource_size_t align)
{ {
struct pci_dev *dev = data; struct pci_dev *dev = data;
struct pci_controller *hose = pci_bus_to_host(dev->bus); struct pci_controller *hose = pci_bus_to_host(dev->bus);
unsigned long start = res->start; resource_size_t start = res->start;
unsigned long alignto; unsigned long alignto;
if (res->flags & IORESOURCE_IO) { if (res->flags & IORESOURCE_IO) {
+6 -6
View File
@@ -171,13 +171,13 @@ EXPORT_SYMBOL(pcibios_bus_to_resource);
* but we want to try to avoid allocating at 0x2900-0x2bff * but we want to try to avoid allocating at 0x2900-0x2bff
* which might have be mirrored at 0x0100-0x03ff.. * which might have be mirrored at 0x0100-0x03ff..
*/ */
void pcibios_align_resource(void *data, struct resource *res, unsigned long size, void pcibios_align_resource(void *data, struct resource *res,
unsigned long align) resource_size_t size, resource_size_t align)
{ {
struct pci_dev *dev = data; struct pci_dev *dev = data;
if (res->flags & IORESOURCE_IO) { if (res->flags & IORESOURCE_IO) {
unsigned long start = res->start; resource_size_t start = res->start;
if (size > 0x100) { if (size > 0x100) {
printk(KERN_ERR "PCI: I/O Region %s/%d too large" printk(KERN_ERR "PCI: I/O Region %s/%d too large"
@@ -960,8 +960,8 @@ static pgprot_t __pci_mmap_set_pgprot(struct pci_dev *dev, struct resource *rp,
else else
prot |= _PAGE_GUARDED; prot |= _PAGE_GUARDED;
printk("PCI map for %s:%llx, prot: %llx\n", pci_name(dev), rp->start, printk("PCI map for %s:%llx, prot: %lx\n", pci_name(dev),
prot); (unsigned long long)rp->start, prot);
return __pgprot(prot); return __pgprot(prot);
} }
@@ -1130,7 +1130,7 @@ long sys_pciconfig_iobase(long which, unsigned long bus, unsigned long devfn)
void pci_resource_to_user(const struct pci_dev *dev, int bar, void pci_resource_to_user(const struct pci_dev *dev, int bar,
const struct resource *rsrc, const struct resource *rsrc,
u64 *start, u64 *end) resource_size_t *start, resource_size_t *end)
{ {
struct pci_controller *hose = pci_bus_to_hose(dev->bus->number); struct pci_controller *hose = pci_bus_to_hose(dev->bus->number);
unsigned long offset = 0; unsigned long offset = 0;
+2 -2
View File
@@ -273,9 +273,9 @@ void __init pcibios_fixup_irqs(void)
} }
void pcibios_align_resource(void *data, struct resource *res, void pcibios_align_resource(void *data, struct resource *res,
unsigned long size, unsigned long align) resource_size_t size, resource_size_t align)
{ {
unsigned long start = res->start; resource_size_t start = res->start;
if (res->flags & IORESOURCE_IO) { if (res->flags & IORESOURCE_IO) {
if (start >= 0x10000UL) { if (start >= 0x10000UL) {
+1 -1
View File
@@ -536,7 +536,7 @@ void __init pcibios_fixup_bus(struct pci_bus *bus)
} }
void pcibios_align_resource(void *data, struct resource *res, void pcibios_align_resource(void *data, struct resource *res,
unsigned long size) resource_size_t size)
{ {
} }
+3 -3
View File
@@ -75,7 +75,7 @@ pcibios_update_resource(struct pci_dev *dev, struct resource *root,
} }
void pcibios_align_resource(void *data, struct resource *res, void pcibios_align_resource(void *data, struct resource *res,
unsigned long size, unsigned long align) resource_size_t size, resource_size_t align)
__attribute__ ((weak)); __attribute__ ((weak));
/* /*
@@ -85,10 +85,10 @@ void pcibios_align_resource(void *data, struct resource *res,
* modulo 0x400. * modulo 0x400.
*/ */
void pcibios_align_resource(void *data, struct resource *res, void pcibios_align_resource(void *data, struct resource *res,
unsigned long size, unsigned long align) resource_size_t size, resource_size_t align)
{ {
if (res->flags & IORESOURCE_IO) { if (res->flags & IORESOURCE_IO) {
unsigned long start = res->start; resource_size_t start = res->start;
if (start & 0x300) { if (start & 0x300) {
start = (start + 0x3ff) & ~0x3ff; start = (start + 0x3ff) & ~0x3ff;
+2 -2
View File
@@ -69,10 +69,10 @@ pcibios_update_resource(struct pci_dev *dev, struct resource *root,
* modulo 0x400. * modulo 0x400.
*/ */
void pcibios_align_resource(void *data, struct resource *res, void pcibios_align_resource(void *data, struct resource *res,
unsigned long size, unsigned long align) resource_size_t size, resource_size_t align)
{ {
if (res->flags & IORESOURCE_IO) { if (res->flags & IORESOURCE_IO) {
unsigned long start = res->start; resource_size_t start = res->start;
if (start & 0x300) { if (start & 0x300) {
start = (start + 0x3ff) & ~0x3ff; start = (start + 0x3ff) & ~0x3ff;
+1 -1
View File
@@ -860,7 +860,7 @@ char * __init pcibios_setup(char *str)
} }
void pcibios_align_resource(void *data, struct resource *res, void pcibios_align_resource(void *data, struct resource *res,
unsigned long size, unsigned long align) resource_size_t size, resource_size_t align)
{ {
} }
+1 -1
View File
@@ -357,7 +357,7 @@ void pcibios_update_irq(struct pci_dev *pdev, int irq)
} }
void pcibios_align_resource(void *data, struct resource *res, void pcibios_align_resource(void *data, struct resource *res,
unsigned long size, unsigned long align) resource_size_t size, resource_size_t align)
{ {
} }
+1 -1
View File
@@ -329,7 +329,7 @@ void pcibios_fixup_bus(struct pci_bus *b)
void void
pcibios_align_resource (void *data, struct resource *res, pcibios_align_resource (void *data, struct resource *res,
unsigned long size, unsigned long align) resource_size_t size, resource_size_t align)
{ {
} }

Some files were not shown because too many files have changed in this diff Show More