On 13.02.2018 17:23, David Hildenbrand wrote: > We now have the range of free memory, let's initialize the physical > allocator. It is now possible to use use malloc and memalign, based on the > early-ops. alloc_pages() cannot be used yet (as it has to be initialized > via free_pages() - e.g. via setup_vm() - first) > > Signed-off-by: David Hildenbrand <david@xxxxxxxxxx> > --- > lib/s390x/sclp.c | 12 ++++++++++++ > s390x/Makefile | 3 +++ > 2 files changed, 15 insertions(+) > > diff --git a/lib/s390x/sclp.c b/lib/s390x/sclp.c > index 199405c..c7471b1 100644 > --- a/lib/s390x/sclp.c > +++ b/lib/s390x/sclp.c > @@ -15,11 +15,21 @@ > #include <asm/arch_def.h> > #include <asm/interrupt.h> > #include "sclp.h" > +#include <alloc_phys.h> > + > +extern unsigned long stacktop; > > static uint64_t storage_increment_size; > static uint64_t max_ram_size; > static uint64_t ram_size; > > +static void mem_init(phys_addr_t mem_end) > +{ > + phys_addr_t freemem_start = (phys_addr_t)&stacktop & PAGE_MASK; Should be ok since stacktop should be aligned. Otherwise this should maybe better be (stacktop + PAGE_SIZE - 1) & PAGE_MASK ? Thomas