david/ipxe
david
/
ipxe
Archived
1
0
Fork 0
Commit Graph

2 Commits

Author SHA1 Message Date
Michael Brown 46da51703a [umalloc] Avoid problems when _textdata_memsz is a multiple of 4kB
If it happens that _textdata_memsz ends up being an exact multiple of
4kB, then this will cause the .textdata section (after relocation) to
start on a page boundary.  This means that the hidden memory region
(which is rounded down to the nearest page boundary) will start
exactly at virtual address 0, i.e. UNULL.  This means that
init_eheap() will erroneously assume that it has failed to allocate a
an external heap, since it typically ends up choosing the area that
lies immediately below .textdata, which in this case will be the
region with top==UNULL.

A subsequent error is that memtop_urealloc() passes through the error
return status -ENOMEM to the caller, which (rightly) assumes that the
result represents a valid userptr_t address.

Fixed by using alternative tests for heap non-existence, and by
returning UNULL in case of an error from init_eheap().
2009-02-15 07:56:16 +00:00
Michael Brown 831e4cfc27 [umalloc] Formalise the user memory allocation API 2008-10-13 05:33:14 +01:00