Re: [U-Boot] early_malloc outline

2012-08-09 Thread Tomas Hlavacek
Hi Graeme, On Thu, Aug 9, 2012 at 1:33 AM, Graeme Russ graeme.r...@gmail.com wrote: OK, this got me to thinking about the 'relocation' function in the driver structure and how we can make the early heap more generic. My thoughts tie into the DM tree structure being discussed in another

Re: [U-Boot] early_malloc outline

2012-08-09 Thread Graeme Russ
Hi Thomas, On 08/09/2012 06:58 PM, Tomas Hlavacek wrote: Hi Graeme, On Thu, Aug 9, 2012 at 1:33 AM, Graeme Russ graeme.r...@gmail.com wrote: OK, this got me to thinking about the 'relocation' function in the driver structure and how we can make the early heap more generic. My thoughts

Re: [U-Boot] early_malloc outline

2012-08-09 Thread Wolfgang Denk
Dear Graeme Russ, In message calbutck7cxjy6fg8ym2ao8tvrd5htihgwav+tf8y9qne62m...@mail.gmail.com you wrote: I pointed out that those pointers can only by in either GD or the early malloc heap. But either way, there is no generic way to adjust them. Any code that uses the early malloc heap

Re: [U-Boot] early_malloc outline

2012-08-08 Thread Tomas Hlavacek
Dear Wolfgang, On Tue, Aug 7, 2012 at 11:07 PM, Wolfgang Denk w...@denx.de wrote: But relocation means that you have to add the address difference (aka relocation offset) to _all_ pointers pointing into this area. And there is no way to keep track of _all_ such pointers. Sure there is no way

Re: [U-Boot] early_malloc outline

2012-08-08 Thread Wolfgang Denk
Dear Tomas Hlavacek, In message caeb7qld3kszx8r9q-gox8aww6woihkqd-avcu_ux7vy7v7t...@mail.gmail.com you wrote: But relocation means that you have to add the address difference (aka relocation offset) to _all_ pointers pointing into this area. And there is no way to keep track of _all_

Re: [U-Boot] early_malloc outline

2012-08-08 Thread Graeme Russ
Hi Tomas Wolfgang, On Thu, Aug 9, 2012 at 5:32 AM, Wolfgang Denk w...@denx.de wrote: Dear Tomas Hlavacek, In message caeb7qld3kszx8r9q-gox8aww6woihkqd-avcu_ux7vy7v7t...@mail.gmail.com you wrote: [snip] If so, my argument goes, you must not use the standard malloc() / calloc() / free()

Re: [U-Boot] early_malloc outline

2012-08-07 Thread Wolfgang Denk
Dear Tomas, In message caeb7qlananotlqfzpaj2nmgndpv6qinczntvbz6fhg2yv99...@mail.gmail.com you wrote: Dear Wolfgang, On Wed, Aug 1, 2012 at 9:09 PM, Wolfgang Denk w...@denx.de wrote: Hm... I have to admit that I am not really happy about such an explanation. The statement that other

Re: [U-Boot] early_malloc outline

2012-08-01 Thread Tomas Hlavacek
Hi Graeme, On Wed, Aug 1, 2012 at 4:57 AM, Graeme Russ graeme.r...@gmail.com wrote: More specifically, we must not assume that we have a single, contiguous region of memory capable of holding pre-relocations early stack, pre-relocation global data, pre-console buffer, and early

Re: [U-Boot] early_malloc outline

2012-08-01 Thread Tomas Hlavacek
Dear Wolfgang, On Tue, Jul 31, 2012 at 9:52 PM, Wolfgang Denk w...@denx.de wrote: Can/should we use some existing mechanism? Or would it be considered a viable option to choose different beginning address for early heap, use it (in architecture-specific way) and keep the pointer to the

Re: [U-Boot] early_malloc outline

2012-08-01 Thread Wolfgang Denk
Dear Tomas, In message CAEB7QLCieZFKpam2TumS3Gqb=5mclvufhm_pxbzfyvpdnwh...@mail.gmail.com you wrote: It is difficult (or actually impossible) to answer this, if you do not explain which concept you are talking about here, or why two copy operations would be needed, what in case of DM

Re: [U-Boot] early_malloc outline

2012-08-01 Thread Tomas Hlavacek
Dear Wolfgang, On Wed, Aug 1, 2012 at 9:09 PM, Wolfgang Denk w...@denx.de wrote: Hm... I have to admit that I am not really happy about such an explanation. The statement that other guys want something is not exactly an explanation of a concept that I can understand, and without being able

[U-Boot] early_malloc outline

2012-07-31 Thread Tomas Hlavacek
Hello all! In u-boot-dm mailinglist we had a discussion about implementation of early_malloc (not only) for U-Boot Driver Model. The intention is to have a simple malloc() function in the early stage of init before relocation and before RAM is up and running. There was an experimental patch that

Re: [U-Boot] early_malloc outline

2012-07-31 Thread Wolfgang Denk
Dear Tomas Hlavacek, In message caeb7qlchvgarx3cpde4tgq01bewozr6anhqnrjp02p6dznn...@mail.gmail.com you wrote: Can/should we use some existing mechanism? Or would it be considered a viable option to choose different beginning address for early heap, use it (in architecture-specific way) and

Re: [U-Boot] early_malloc outline

2012-07-31 Thread Graeme Russ
Hi Thomas, On 08/01/2012 01:30 AM, Tomas Hlavacek wrote: Hello all! In u-boot-dm mailinglist we had a discussion about implementation of early_malloc (not only) for U-Boot Driver Model. The intention is to have a simple malloc() function in the early stage of init before relocation and