mm: make memmap_init a proper function