On 17/06/15 22:10, Segher Boessenkool wrote:
On Wed, Jun 17, 2015 at 03:19:41PM -0500, Cormac O'Brien wrote:
The 'phys' argument to mem_claim() and 'virt' argument to mmu_claim() are now only popped from the stack if the 'align' argument is provided.
You probably also want to mention you no longer THROW when the return value is -1 (and explain why).
I'm not too worried about missing the throw here right now. As OpenBIOS randomly switches between C and Forth at various points, not all of them pick up the throw/catch across the boundaries correctly and make it back to the caller.
One of the more recent changes I managed to do was to unmap page 0 on all 3 of SPARC32, SPARC64 and PPC and still have everything boot. By combining this with a default value of -1 for the OFMEM allocations it means we die the first time a bad allocation is accessed, and it's easy to work out where this happened with CONFIG_DEBUG_OFMEM enabled and looking for values of -1.
- phys_addr_t phys = -1UL;
Is this the common style in this code? Will "long int" always fit phys_addr_t? Seems shaky.
In the original OFMEM implementation sizeof(phys_addr_t) == sizeof(virt) == word size of machine. The only reason phys_addr_t is different here was since SPARC32 was switched over to OFMEM as SPARC32 has a 36-bit physical address space vs. a 32-bit virtual address space just to make things more interesting :) I haven't compile-tested this yet but if you can suggest a better alternative, please do.
ATB,
Mark.