[U-Boot] [PATCHv2 1/1] [RFC] DM: early_malloc for DM added.

Graeme Russ graeme.russ at gmail.com
Tue Aug 28 02:18:02 CEST 2012


Hi Tomas,

Another small correction...

On Tue, Aug 28, 2012 at 9:02 AM, Graeme Russ <graeme.russ at gmail.com> wrote:

> static struct early_heap_header *def_early_brk(size_t bytes)
> {
>         struct early_heap_header *h;
>
>         if(gd->early_heap_first)
>                 return NULL;
>
>         /* The default implementation allocates all of the reserved space */

        if (bytes > (CONFIG_SYS_EARLY_HEAP_SIZE -
                roundup(sizeof(struct early_heap_header), sizeof(phys_addr_t))
                return NULL;

>         bytes = CONFIG_SYS_EARLY_HEAP_SIZE;
>         gd->early_heap_first = bytes;
>
>         h = gd->early_heap_first;
>
>         h->free_space_pointer = (void *)(roundup((phys_addr_t)h +
>                                 sizeof(struct early_heap_header),
>                                 sizeof(phys_addr_t)));
>         h->free_bytes = bytes - roundup(sizeof(struct early_heap_header),
>                                 sizeof(phys_addr_t));
>         h->next_early_heap = NULL;
>
>         return h;
> }

Regards,

Graeme


More information about the U-Boot mailing list