<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
  <title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
Paul Mackerras wrote:
<blockquote cite="mid17182.10581.159598.839256@cargo.ozlabs.ibm.com"
 type="cite">
  <pre wrap="">Mark Bellon writes:

  </pre>
  <blockquote type="cite">
    <pre wrap="">Simply put the existing code has a fixed reservation (claim) address and 
once the kernel plus initrd image are large enough to pass this address 
all sorts of bad things occur. The fix is the dynamically establish the 
first claim address above the loaded kernel plus initrd (plus some 
"padding" and rounding). If PROG_START is defined this will be used as 
the minimum safe address - currently known to be 0x01400000 for the 
firmwares tested so far.
    </pre>
  </blockquote>
  <pre wrap=""><!---->
The idea is fine, but I have some questions about the actual patch:

  </pre>
  <blockquote type="cite">
    <pre wrap="">-void *claim(unsigned int, unsigned int, unsigned int);
+void *claim(unsigned long, unsigned long, unsigned long);
    </pre>
  </blockquote>
  <pre wrap=""><!---->
What was the motivation for this change?  Since the zImage wrapper is
a 32-bit executable, int and long are both 32 bits.  I would prefer to
leave the parameters as unsigned int to force people to realize that
the parameters are 32 bits (even if said people have been working on
64-bit programs recently).
  </pre>
</blockquote>
The function, claim, is found in prom.c uses longs. The long is the
usual idiom for hiding a pointer, not an int, so I fixed accordingly.
I'm open to further discussion of course.<br>
<br>
On a 64 bit machine long and int are different sizes. This would make
things "proper" if things changed in the future.<br>
<br>
<blockquote cite="mid17182.10581.159598.839256@cargo.ozlabs.ibm.com"
 type="cite">
  <pre wrap="">
  </pre>
  <blockquote type="cite">
    <pre wrap="">+        claim_base = _ALIGN_UP((unsigned long)_end, ONE_MB);
+
+#if defined(PROG_START)
+        /*
+         * Maintain a "magic" minimum address. This keeps some older
+         * firmware platforms running.
+         */
+
+        if (claim_base &lt; PROG_START)
+                claim_base = PROG_START;
+#endif
    </pre>
  </blockquote>
  <pre wrap=""><!---->
This appears to be the meat of the patch, the rest is "cleanup", right?
  </pre>
</blockquote>
Correct. The preceding comment explains what is going on. Removing the
magic numbers seemed like a good idea.<br>
<br>
mark<br>
<br>
<blockquote cite="mid17182.10581.159598.839256@cargo.ozlabs.ibm.com"
 type="cite">
  <pre wrap="">
Paul.
  </pre>
</blockquote>
<br>
</body>
</html>