LinuxPPC-Dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Becky Bruce <becky.bruce@freescale.com>
To: linuxppc-dev@ozlabs.org
Subject: [PATCH] POWERPC: Change mem.c to support large physical addresses on 32-bit
Date: Fri, 22 Aug 2008 11:49:42 -0500	[thread overview]
Message-ID: <1219423782-17509-1-git-send-email-becky.bruce@freescale.com> (raw)

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

             reply	other threads:[~2008-08-22 16:49 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-22 16:49 Becky Bruce [this message]
2008-09-23 17:23 ` [PATCH] POWERPC: Change mem.c to support large physical addresses on 32-bit Becky Bruce

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1219423782-17509-1-git-send-email-becky.bruce@freescale.com \
    --to=becky.bruce@freescale.com \
    --cc=linuxppc-dev@ozlabs.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox