From mboxrd@z Thu Jan 1 00:00:00 1970 From: Graeme Russ Date: Tue, 28 Aug 2012 10:18:02 +1000 Subject: [U-Boot] [PATCHv2 1/1] [RFC] DM: early_malloc for DM added. In-Reply-To: References: <1346069529-27397-1-git-send-email-tmshlvck@gmail.com> <1346071331-28989-1-git-send-email-tmshlvck@gmail.com> Message-ID: List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hi Tomas, Another small correction... On Tue, Aug 28, 2012 at 9:02 AM, Graeme Russ 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