Hi Michal,

>>> +void __init setup_mm(void)
>>> +{
>>> +    const struct membanks *banks = bootinfo_get_mem();
>>> +    paddr_t ram_start = INVALID_PADDR;
>>> +    paddr_t ram_end = 0;
>>> +    paddr_t ram_size = 0;
>>> +    unsigned int i;
>>> +
>>> +    init_pdx();
>>> +
>>> +    for ( i = 0; i < banks->nr_banks; i++ )
>>> +    {
>>> +        const struct membank *bank = &banks->bank[i];
>>> +        paddr_t bank_end = bank->start + bank->size;
>>> +
>>> +        ram_size = ram_size + bank->size;
>>> +        ram_start = min(ram_start, bank->start);
>>> +        ram_end = max(ram_end, bank_end);
>>> +    }
>>> +
>>> +    total_pages = ram_size >> PAGE_SHIFT;
>>> +
>>> +    /*
>>> +     * On MMU systems we need some memory to allocate the page-tables used 
>>> for
>>> +     * the directmap mappings.  But some regions may contain memory already
>>> +     * allocated for other uses (e.g. modules, reserved-memory...).
>>> +     *
>>> +     * On MPU systems we need to pre-reserve regions that were allocated 
>>> for
>>> +     * other uses (e.g. modules, reserved-memory...).
>> I'm not sure I understand this part of the comment with regards to
>> populate_boot_allocator(). Could you please explain?

Maybe here we should just write that on MPU system we are populating the boot 
allocator with the
static heap region, since static heap is mandatory for MPU.

What do you think?

e.g.

/*
 * On MMU system…
 * […]
 * 
 * On MPU system we need to populate the boot allocator with the static heap 
region, on such systems
 * the static heap feature is mandatory.
 *

Cheers,
Luca

Reply via email to