linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] POWERPC: Change mem.c to support large physical addresses on 32-bit
@ 2008-08-22 16:49 Becky Bruce
  2008-09-23 17:23 ` Becky Bruce
  0 siblings, 1 reply; 2+ messages in thread
From: Becky Bruce @ 2008-08-22 16:49 UTC (permalink / raw)
  To: linuxppc-dev

Use phys_addr_t for sizes and addresses where appropriate.

Signed-off-by: Becky Bruce <becky.bruce@freescale.com>
---
 arch/powerpc/mm/mem.c |   19 ++++++++++---------
 1 files changed, 10 insertions(+), 9 deletions(-)

diff --git a/arch/powerpc/mm/mem.c b/arch/powerpc/mm/mem.c
index 1c93c25..89dc32b 100644
--- a/arch/powerpc/mm/mem.c
+++ b/arch/powerpc/mm/mem.c
@@ -75,14 +75,14 @@ static inline pte_t *virt_to_kpte(unsigned long vaddr)
 
 int page_is_ram(unsigned long pfn)
 {
-	unsigned long paddr = (pfn << PAGE_SHIFT);
+	phys_addr_t paddr = ((phys_addr_t)pfn << PAGE_SHIFT);
 
 #ifndef CONFIG_PPC64	/* XXX for now */
 	return paddr < __pa(high_memory);
 #else
 	int i;
 	for (i=0; i < lmb.memory.cnt; i++) {
-		unsigned long base;
+		phys_addr_t base;
 
 		base = lmb.memory.region[i].base;
 
@@ -195,7 +195,8 @@ EXPORT_SYMBOL_GPL(walk_memory_resource);
 void __init do_init_bootmem(void)
 {
 	unsigned long i;
-	unsigned long start, bootmap_pages;
+	phys_addr_t start;
+	unsigned long bootmap_pages;
 	unsigned long total_pages;
 	int boot_mapsize;
 
@@ -234,8 +235,8 @@ void __init do_init_bootmem(void)
 
 	/* reserve the sections we're already using */
 	for (i = 0; i < lmb.reserved.cnt; i++) {
-		unsigned long addr = lmb.reserved.region[i].base +
-				     lmb_size_bytes(&lmb.reserved, i) - 1;
+		phys_addr_t addr = lmb.reserved.region[i].base +
+			lmb_size_bytes(&lmb.reserved, i) - 1;
 		if (addr < lowmem_end_addr)
 			reserve_bootmem(lmb.reserved.region[i].base,
 					lmb_size_bytes(&lmb.reserved, i),
@@ -290,7 +291,7 @@ static int __init mark_nonram_nosave(void)
  */
 void __init paging_init(void)
 {
-	unsigned long total_ram = lmb_phys_mem_size();
+	phys_addr_t total_ram = lmb_phys_mem_size();
 	phys_addr_t top_of_ram = lmb_end_of_DRAM();
 	unsigned long max_zone_pfns[MAX_NR_ZONES];
 
@@ -310,10 +311,10 @@ void __init paging_init(void)
 	kmap_prot = PAGE_KERNEL;
 #endif /* CONFIG_HIGHMEM */
 
-	printk(KERN_DEBUG "Top of RAM: 0x%llx, Total RAM: 0x%lx\n",
-	       (unsigned long long)top_of_ram, total_ram);
+	printk(KERN_DEBUG "Top of RAM: 0x%llx, Total RAM: 0x%llx\n",
+	       (unsigned long long)top_of_ram, (unsigned long long)total_ram);
 	printk(KERN_DEBUG "Memory hole size: %ldMB\n",
-	       (long int)((top_of_ram - total_ram) >> 20));
+	       (unsigned long)((top_of_ram - total_ram) >> 20));
 	memset(max_zone_pfns, 0, sizeof(max_zone_pfns));
 #ifdef CONFIG_HIGHMEM
 	max_zone_pfns[ZONE_DMA] = lowmem_end_addr >> PAGE_SHIFT;
-- 
1.5.5.1

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] POWERPC: Change mem.c to support large physical addresses on 32-bit
  2008-08-22 16:49 [PATCH] POWERPC: Change mem.c to support large physical addresses on 32-bit Becky Bruce
@ 2008-09-23 17:23 ` Becky Bruce
  0 siblings, 0 replies; 2+ messages in thread
From: Becky Bruce @ 2008-09-23 17:23 UTC (permalink / raw)
  To: Paul Mackerras; +Cc: linuxppc-dev

This seems to have gotten dropped.....  Are there issues with this, or  
did I get lost in the patchwork shuffle?

Cheers,
Becky

On Aug 22, 2008, at 11:49 AM, Becky Bruce wrote:

> Use phys_addr_t for sizes and addresses where appropriate.
>
> Signed-off-by: Becky Bruce <becky.bruce@freescale.com>
> ---
> arch/powerpc/mm/mem.c |   19 ++++++++++---------
> 1 files changed, 10 insertions(+), 9 deletions(-)
>
> diff --git a/arch/powerpc/mm/mem.c b/arch/powerpc/mm/mem.c
> index 1c93c25..89dc32b 100644
> --- a/arch/powerpc/mm/mem.c
> +++ b/arch/powerpc/mm/mem.c
> @@ -75,14 +75,14 @@ static inline pte_t *virt_to_kpte(unsigned long  
> vaddr)
>
> int page_is_ram(unsigned long pfn)
> {
> -	unsigned long paddr = (pfn << PAGE_SHIFT);
> +	phys_addr_t paddr = ((phys_addr_t)pfn << PAGE_SHIFT);
>
> #ifndef CONFIG_PPC64	/* XXX for now */
> 	return paddr < __pa(high_memory);
> #else
> 	int i;
> 	for (i=0; i < lmb.memory.cnt; i++) {
> -		unsigned long base;
> +		phys_addr_t base;
>
> 		base = lmb.memory.region[i].base;
>
> @@ -195,7 +195,8 @@ EXPORT_SYMBOL_GPL(walk_memory_resource);
> void __init do_init_bootmem(void)
> {
> 	unsigned long i;
> -	unsigned long start, bootmap_pages;
> +	phys_addr_t start;
> +	unsigned long bootmap_pages;
> 	unsigned long total_pages;
> 	int boot_mapsize;
>
> @@ -234,8 +235,8 @@ void __init do_init_bootmem(void)
>
> 	/* reserve the sections we're already using */
> 	for (i = 0; i < lmb.reserved.cnt; i++) {
> -		unsigned long addr = lmb.reserved.region[i].base +
> -				     lmb_size_bytes(&lmb.reserved, i) - 1;
> +		phys_addr_t addr = lmb.reserved.region[i].base +
> +			lmb_size_bytes(&lmb.reserved, i) - 1;
> 		if (addr < lowmem_end_addr)
> 			reserve_bootmem(lmb.reserved.region[i].base,
> 					lmb_size_bytes(&lmb.reserved, i),
> @@ -290,7 +291,7 @@ static int __init mark_nonram_nosave(void)
>  */
> void __init paging_init(void)
> {
> -	unsigned long total_ram = lmb_phys_mem_size();
> +	phys_addr_t total_ram = lmb_phys_mem_size();
> 	phys_addr_t top_of_ram = lmb_end_of_DRAM();
> 	unsigned long max_zone_pfns[MAX_NR_ZONES];
>
> @@ -310,10 +311,10 @@ void __init paging_init(void)
> 	kmap_prot = PAGE_KERNEL;
> #endif /* CONFIG_HIGHMEM */
>
> -	printk(KERN_DEBUG "Top of RAM: 0x%llx, Total RAM: 0x%lx\n",
> -	       (unsigned long long)top_of_ram, total_ram);
> +	printk(KERN_DEBUG "Top of RAM: 0x%llx, Total RAM: 0x%llx\n",
> +	       (unsigned long long)top_of_ram, (unsigned long  
> long)total_ram);
> 	printk(KERN_DEBUG "Memory hole size: %ldMB\n",
> -	       (long int)((top_of_ram - total_ram) >> 20));
> +	       (unsigned long)((top_of_ram - total_ram) >> 20));
> 	memset(max_zone_pfns, 0, sizeof(max_zone_pfns));
> #ifdef CONFIG_HIGHMEM
> 	max_zone_pfns[ZONE_DMA] = lowmem_end_addr >> PAGE_SHIFT;
> -- 
> 1.5.5.1

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-09-23 17:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-08-22 16:49 [PATCH] POWERPC: Change mem.c to support large physical addresses on 32-bit Becky Bruce
2008-09-23 17:23 ` Becky Bruce

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).