From: Robert Picco <Robert.Picco@hp.com>
To: linux-ia64@vger.kernel.org
Subject: [PATCH] boot parameters mem and max_addr
Date: Wed, 05 May 2004 17:01:27 +0000 [thread overview]
Message-ID: <40991DE7.7010401@hp.com> (raw)
The boot parameter "mem=" will behave like it does for other LINUX
architectures. The boot parameter "max_addr" can be used to limit the
maximum physical address like the old "mem=" feature.
--- linux-2.6.5-orig/arch/ia64/kernel/efi.c 2004-04-03 22:36:15.000000000 -0500
+++ linux-2.6.5-mem/arch/ia64/kernel/efi.c 2004-05-04 11:56:42.000000000 -0400
@@ -53,7 +53,7 @@
EXPORT_SYMBOL(efi_dir);
#endif
-static unsigned long mem_limit = ~0UL;
+static unsigned long mem_limit = ~0UL, max_addr = ~0UL;
#define efi_call_virt(f, args...) (*(f))(args)
@@ -304,6 +304,7 @@
void *efi_map_start, *efi_map_end, *p, *q;
efi_memory_desc_t *md, *check_md;
u64 efi_desc_size, start, end, granule_addr, last_granule_addr, first_non_wb_addr = 0;
+ unsigned long total_mem = 0;
efi_map_start = __va(ia64_boot_param->efi_memmap);
efi_map_end = efi_map_start + ia64_boot_param->efi_memmap_size;
@@ -345,12 +346,18 @@
trim_top(md, last_granule_addr);
if (is_available_memory(md)) {
- if (md->phys_addr + (md->num_pages << EFI_PAGE_SHIFT) > mem_limit) {
- if (md->phys_addr > mem_limit)
+ if (md->phys_addr + (md->num_pages << EFI_PAGE_SHIFT) > max_addr) {
+ if (md->phys_addr > max_addr)
continue;
- md->num_pages = (mem_limit - md->phys_addr) >> EFI_PAGE_SHIFT;
+ md->num_pages = (max_addr - md->phys_addr) >> EFI_PAGE_SHIFT;
}
+ if (total_mem >= mem_limit)
+ continue;
+ total_mem += (md->num_pages << EFI_PAGE_SHIFT);
+ if (total_mem > mem_limit)
+ md->num_pages -= ((total_mem - mem_limit) >> EFI_PAGE_SHIFT);
+
if (md->num_pages = 0)
continue;
@@ -484,7 +491,13 @@
for (cp = saved_command_line; *cp; ) {
if (memcmp(cp, "mem=", 4) = 0) {
cp += 4;
- mem_limit = memparse(cp, &end) - 1;
+ mem_limit = memparse(cp, &end) - 2;
+ if (end != cp)
+ break;
+ cp = end;
+ } else if (memcmp(cp, "max_addr=", 9) = 0) {
+ cp += 9;
+ max_addr = memparse(cp, &end) - 1;
if (end != cp)
break;
cp = end;
@@ -495,8 +508,8 @@
++cp;
}
}
- if (mem_limit != ~0UL)
- printk(KERN_INFO "Ignoring memory above %luMB\n", mem_limit >> 20);
+ if (max_addr != ~0UL)
+ printk(KERN_INFO "Ignoring memory above %luMB\n", max_addr >> 20);
efi.systab = __va(ia64_boot_param->efi_systab);
next reply other threads:[~2004-05-05 17:01 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-05-05 17:01 Robert Picco [this message]
2004-05-05 17:07 ` [PATCH] boot parameters mem and max_addr Jesse Barnes
2004-05-05 17:10 ` Randy.Dunlap
2004-05-05 18:46 ` Robert Picco
2004-05-05 23:33 ` David Mosberger
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=40991DE7.7010401@hp.com \
--to=robert.picco@hp.com \
--cc=linux-ia64@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.