diff options
author | Scott Williams <scwilliams@nvidia.com> | 2011-04-12 17:47:52 -0700 |
---|---|---|
committer | Dan Willemsen <dwillemsen@nvidia.com> | 2011-11-30 21:45:00 -0800 |
commit | 179961e8fe89510a2cf52ea20c0a9f891234ae14 (patch) | |
tree | d72df8ead11ff36910828df1c48c0924a7aa700e /drivers/video/tegra/nvmap | |
parent | cff63fd236077b13cf3534c94d5adac491ed5fe7 (diff) |
ARM: tegra: Use proper type for physical addresses
Original-Change-Id: I158d2be97c795313e7e74ce9fb4ec0bdc7d95496
Reviewed-on: http://git-master/r/27559
Tested-by: Scott Williams <scwilliams@nvidia.com>
Reviewed-by: Hiro Sugawara <hsugawara@nvidia.com>
Reviewed-by: Jin Qian <jqian@nvidia.com>
Reviewed-by: Kaz Fukuoka <kfukuoka@nvidia.com>
Reviewed-by: Scott Williams <scwilliams@nvidia.com>
Original-Change-Id: I0ff198daa548ed2837f7fb1794013bf0adf7e5a1
Rebase-Id: R83df5f3b5104183bfe774d8eed8ce94427c9b7fc
Diffstat (limited to 'drivers/video/tegra/nvmap')
-rw-r--r-- | drivers/video/tegra/nvmap/nvmap.c | 22 | ||||
-rw-r--r-- | drivers/video/tegra/nvmap/nvmap_dev.c | 12 | ||||
-rw-r--r-- | drivers/video/tegra/nvmap/nvmap_heap.c | 2 | ||||
-rw-r--r-- | drivers/video/tegra/nvmap/nvmap_heap.h | 8 | ||||
-rw-r--r-- | drivers/video/tegra/nvmap/nvmap_ioctl.c | 4 |
5 files changed, 24 insertions, 24 deletions
diff --git a/drivers/video/tegra/nvmap/nvmap.c b/drivers/video/tegra/nvmap/nvmap.c index 50714c502194..09627145ec82 100644 --- a/drivers/video/tegra/nvmap/nvmap.c +++ b/drivers/video/tegra/nvmap/nvmap.c @@ -1,9 +1,9 @@ /* - * drivers/video/tegra/nvmap.c + * drivers/video/tegra/nvmap/nvmap.c * * Memory manager for Tegra GPU * - * Copyright (c) 2009-2010, NVIDIA Corporation. + * Copyright (c) 2009-2011, NVIDIA Corporation. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -293,9 +293,9 @@ out: return ret; } -static unsigned long handle_phys(struct nvmap_handle *h) +static phys_addr_t handle_phys(struct nvmap_handle *h) { - u32 addr; + phys_addr_t addr; if (h->heap_pgalloc && h->pgalloc.contig) { addr = page_to_phys(h->pgalloc.pages[0]); @@ -338,8 +338,8 @@ static int nvmap_reloc_pin_array(struct nvmap_client *client, for (i = 0; i < nr; i++) { struct nvmap_handle *patch; struct nvmap_handle *pin; - unsigned long reloc_addr; - unsigned long phys; + phys_addr_t reloc_addr; + phys_addr_t phys; unsigned int pfn; /* all of the handles are validated and get'ted prior to @@ -373,7 +373,7 @@ static int nvmap_reloc_pin_array(struct nvmap_client *client, pfn = __phys_to_pfn(phys); if (pfn != last_pfn) { pgprot_t prot = nvmap_pgprot(patch, pgprot_kernel); - unsigned long kaddr = (unsigned long)addr; + phys_addr_t kaddr = (phys_addr_t)addr; set_pte_at(&init_mm, kaddr, *pte, pfn_pte(pfn, prot)); flush_tlb_kernel_page(kaddr); last_pfn = pfn; @@ -538,11 +538,11 @@ int nvmap_pin_array(struct nvmap_client *client, struct nvmap_handle *gather, return count; } -unsigned long nvmap_pin(struct nvmap_client *client, +phys_addr_t nvmap_pin(struct nvmap_client *client, struct nvmap_handle_ref *ref) { struct nvmap_handle *h; - unsigned long phys; + phys_addr_t phys; int ret = 0; h = nvmap_handle_get(ref->handle); @@ -570,10 +570,10 @@ unsigned long nvmap_pin(struct nvmap_client *client, return ret ?: phys; } -unsigned long nvmap_handle_address(struct nvmap_client *c, unsigned long id) +phys_addr_t nvmap_handle_address(struct nvmap_client *c, unsigned long id) { struct nvmap_handle *h; - unsigned long phys; + phys_addr_t phys; h = nvmap_get_handle_id(c, id); if (!h) diff --git a/drivers/video/tegra/nvmap/nvmap_dev.c b/drivers/video/tegra/nvmap/nvmap_dev.c index 91ed03d0755f..c15cc1b21901 100644 --- a/drivers/video/tegra/nvmap/nvmap_dev.c +++ b/drivers/video/tegra/nvmap/nvmap_dev.c @@ -278,9 +278,9 @@ int nvmap_flush_heap_block(struct nvmap_client *client, { pte_t **pte; void *addr; - unsigned long kaddr; - unsigned long phys = block->base; - unsigned long end = block->base + len; + phys_addr_t kaddr; + phys_addr_t phys = block->base; + phys_addr_t end = block->base + len; if (prot == NVMAP_HANDLE_UNCACHEABLE || prot == NVMAP_HANDLE_WRITE_COMBINE) goto out; @@ -296,10 +296,10 @@ int nvmap_flush_heap_block(struct nvmap_client *client, if (IS_ERR(pte)) return PTR_ERR(pte); - kaddr = (unsigned long)addr; + kaddr = (phys_addr_t)addr; while (phys < end) { - unsigned long next = (phys + PAGE_SIZE) & PAGE_MASK; + phys_addr_t next = (phys + PAGE_SIZE) & PAGE_MASK; unsigned long pfn = __phys_to_pfn(phys); void *base = (void *)kaddr + (phys & ~PAGE_MASK); @@ -981,7 +981,7 @@ static void allocations_stringify(struct nvmap_client *client, struct nvmap_handle *handle = ref->handle; if (handle->alloc && !handle->heap_pgalloc) { seq_printf(s, "%-16s %-16s %8lx %10u\n", "", "", - handle->carveout->base, + (unsigned long)(handle->carveout->base), handle->size); } } diff --git a/drivers/video/tegra/nvmap/nvmap_heap.c b/drivers/video/tegra/nvmap/nvmap_heap.c index 97f4b2bdb5d7..b90a87671f98 100644 --- a/drivers/video/tegra/nvmap/nvmap_heap.c +++ b/drivers/video/tegra/nvmap/nvmap_heap.c @@ -941,7 +941,7 @@ static void heap_release(struct device *heap) * will be rounded up to be a multiple of buddy_size bytes. */ struct nvmap_heap *nvmap_heap_create(struct device *parent, const char *name, - unsigned long base, size_t len, + phys_addr_t base, size_t len, size_t buddy_size, void *arg) { struct nvmap_heap *h = NULL; diff --git a/drivers/video/tegra/nvmap/nvmap_heap.h b/drivers/video/tegra/nvmap/nvmap_heap.h index 39539762175b..a8884be218d1 100644 --- a/drivers/video/tegra/nvmap/nvmap_heap.h +++ b/drivers/video/tegra/nvmap/nvmap_heap.h @@ -1,9 +1,9 @@ /* - * drivers/video/tegra/nvmap_heap.h + * drivers/video/tegra/nvmap/nvmap_heap.h * * GPU heap allocator. * - * Copyright (c) 2010, NVIDIA Corporation. + * Copyright (c) 2010-2011, NVIDIA Corporation. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -28,7 +28,7 @@ struct nvmap_heap; struct attribute_group; struct nvmap_heap_block { - unsigned long base; + phys_addr_t base; unsigned int type; struct nvmap_handle *handle; }; @@ -36,7 +36,7 @@ struct nvmap_heap_block { #define NVMAP_HEAP_MIN_BUDDY_SIZE 8192 struct nvmap_heap *nvmap_heap_create(struct device *parent, const char *name, - unsigned long base, size_t len, + phys_addr_t base, size_t len, unsigned int buddy_size, void *arg); void nvmap_heap_destroy(struct nvmap_heap *heap); diff --git a/drivers/video/tegra/nvmap/nvmap_ioctl.c b/drivers/video/tegra/nvmap/nvmap_ioctl.c index 2c24a2f4bd38..d8868b25d9a8 100644 --- a/drivers/video/tegra/nvmap/nvmap_ioctl.c +++ b/drivers/video/tegra/nvmap/nvmap_ioctl.c @@ -632,7 +632,7 @@ out: } static int rw_handle_page(struct nvmap_handle *h, int is_read, - unsigned long start, unsigned long rw_addr, + phys_addr_t start, unsigned long rw_addr, unsigned long bytes, unsigned long kaddr, pte_t *pte) { pgprot_t prot = nvmap_pgprot(h, pgprot_kernel); @@ -641,7 +641,7 @@ static int rw_handle_page(struct nvmap_handle *h, int is_read, while (!err && start < end) { struct page *page = NULL; - unsigned long phys; + phys_addr_t phys; size_t count; void *src; |