Re: [U-Boot] Early malloc() summary

2012-08-19 Thread Graeme Russ
Hi Tomas, On Sun, Aug 19, 2012 at 11:21 PM, Tomas Hlavacek wrote: > Hello Graeme! > > On Fri, Aug 17, 2012 at 3:15 AM, Graeme Russ wrote: >> dm_malloc(bytes, driver *) >> | >> +-> early_malloc(bytes, reloc_helper *) /* Pre-Relocation */ >> | | >> | +->register_helper(reloc_helpe

Re: [U-Boot] Early malloc() summary

2012-08-19 Thread Tomas Hlavacek
Hello Graeme! On Fri, Aug 17, 2012 at 3:15 AM, Graeme Russ wrote: > dm_malloc(bytes, driver *) > | > +-> early_malloc(bytes, reloc_helper *) /* Pre-Relocation */ > | | > | +->register_helper(reloc_helper *) > | | > | +->pre_reloc_malloc(size_t bytes) > | > +-> mal

Re: [U-Boot] Early malloc() summary

2012-08-16 Thread Graeme Russ
Hi Marek, On Fri, Aug 17, 2012 at 10:34 AM, Marek Vasut wrote: > Dear Graeme Russ, > >> Hi Marek, >> >> On Fri, Aug 17, 2012 at 9:32 AM, Marek Vasut wrote: >> > Dear Graeme Russ, >> > >> >> >> Hmm, I hadn't thought of that >> >> > >> >> > So, we're back to square 1 ? >> >> >> >> Nope - just a sl

Re: [U-Boot] Early malloc() summary

2012-08-16 Thread Marek Vasut
Dear Graeme Russ, > Hi Marek, > > On Fri, Aug 17, 2012 at 9:32 AM, Marek Vasut wrote: > > Dear Graeme Russ, > > > >> >> Hmm, I hadn't thought of that > >> > > >> > So, we're back to square 1 ? > >> > >> Nope - just a slight tweak is all > > > > What tweak ? > > Didn't you read the rest of m

Re: [U-Boot] Early malloc() summary

2012-08-16 Thread Graeme Russ
Hi Marek, On Fri, Aug 17, 2012 at 9:32 AM, Marek Vasut wrote: > Dear Graeme Russ, > >> >> Hmm, I hadn't thought of that >> > >> > So, we're back to square 1 ? >> >> Nope - just a slight tweak is all > > What tweak ? Didn't you read the rest of my email? Regards, Graeme ___

Re: [U-Boot] Early malloc() summary

2012-08-16 Thread Marek Vasut
Dear Graeme Russ, > Hi Marek, > > On Fri, Aug 17, 2012 at 12:50 AM, Marek Vasut wrote: > > Dear Graeme Russ, > > > > [...] > > > >> >> 2) We can pass a pointer to a driver_core struct (or whatever struct > >> >> it > >> >> > >> >> is that holds the 'reloc' helper function pointer). We

Re: [U-Boot] Early malloc() summary

2012-08-16 Thread Graeme Russ
Hi Marek, On Fri, Aug 17, 2012 at 12:52 AM, Marek Vasut wrote: > Dear Graeme Russ, > [snip] >> When you start throwing around "discontigmem", "sparsemem" and "nifty >> memory-management/model features" you are talking architecture specifics > > In uboot, not so much ... in uboot it'd be just a

Re: [U-Boot] Early malloc() summary

2012-08-16 Thread Graeme Russ
Hi Marek, On Fri, Aug 17, 2012 at 12:50 AM, Marek Vasut wrote: > Dear Graeme Russ, > > [...] > >> >> 2) We can pass a pointer to a driver_core struct (or whatever struct it >> >> >> >> is that holds the 'reloc' helper function pointer). We can't pick up >> >> misuse at compile time, but

Re: [U-Boot] Early malloc() summary

2012-08-16 Thread Marek Vasut
Dear Graeme Russ, > Hi Marek, > > On 08/15/2012 12:00 AM, Marek Vasut wrote: > > Dear Graeme Russ, > > > >> Hi Marek, > >> > >> On Tue, Aug 14, 2012 at 10:37 PM, Marek Vasut wrote: > >>> Dear Tomas Hlavacek, > >>> > Hello Marek, > > On Sun, Aug 12, 2012 at 1:16 AM, Marek Vasut

Re: [U-Boot] Early malloc() summary

2012-08-16 Thread Marek Vasut
Dear Graeme Russ, [...] > >> 2) We can pass a pointer to a driver_core struct (or whatever struct it > >> > >> is that holds the 'reloc' helper function pointer). We can't pick up > >> misuse at compile time, but dm_malloc() can print a meaningful > >> message if it is called pre-r

Re: [U-Boot] Early malloc() summary

2012-08-16 Thread Graeme Russ
Hi Tomas, On 08/15/2012 10:00 PM, Tomas Hlavacek wrote: > On Tue, Aug 14, 2012 at 3:54 PM, Graeme Russ wrote: > >>> dm_malloc you mean? I'm not happy about it, maybe Graeme can pour in some >>> crazy >>> juice in our direction again? >> >> I don't like the idea of dm_malloc() either, but it may

Re: [U-Boot] Early malloc() summary

2012-08-16 Thread Graeme Russ
Hi Marek, On 08/15/2012 09:56 AM, Marek Vasut wrote: > Dear Graeme Russ, > > [...] > >> >> Third path is dm_malloc() - Although ugly, it has a few nicities... > > Thinking about dm_malloc() ... if it's entirely different, the semantics can > be > adjusted too ... say to "int dm_malloc(void **

Re: [U-Boot] Early malloc() summary

2012-08-16 Thread Graeme Russ
Hi Marek, On 08/15/2012 12:00 AM, Marek Vasut wrote: > Dear Graeme Russ, > >> Hi Marek, >> >> On Tue, Aug 14, 2012 at 10:37 PM, Marek Vasut wrote: >>> Dear Tomas Hlavacek, >>> Hello Marek, On Sun, Aug 12, 2012 at 1:16 AM, Marek Vasut wrote: > So ... we should aim for firing u

Re: [U-Boot] Early malloc() summary

2012-08-15 Thread Tomas Hlavacek
On Tue, Aug 14, 2012 at 3:54 PM, Graeme Russ wrote: >> dm_malloc you mean? I'm not happy about it, maybe Graeme can pour in some >> crazy >> juice in our direction again? > > I don't like the idea of dm_malloc() either, but it may be the only way to > get this past Wolfgang in the initial pass..

Re: [U-Boot] Early malloc() summary

2012-08-14 Thread Marek Vasut
Dear Graeme Russ, [...] > > Third path is dm_malloc() - Although ugly, it has a few nicities... Thinking about dm_malloc() ... if it's entirely different, the semantics can be adjusted too ... say to "int dm_malloc(void **ptr, size_t size);": - return int: error code - **ptr: pointer to alloc

Re: [U-Boot] Early malloc() summary

2012-08-14 Thread Marek Vasut
Dear Albert ARIBAUD, > Hi Marek, > > On Tue, 14 Aug 2012 14:37:29 +0200, Marek Vasut wrote: > > Dear Tomas Hlavacek, > > > > > Hello Marek, > > > > > > On Sun, Aug 12, 2012 at 1:16 AM, Marek Vasut wrote: > > > > So ... we should aim for firing up the real mallocator as soon as > > > > possibl

Re: [U-Boot] Early malloc() summary

2012-08-14 Thread Marek Vasut
Dear Graeme Russ, > Hi Marek, > > On Tue, Aug 14, 2012 at 10:37 PM, Marek Vasut wrote: > > Dear Tomas Hlavacek, > > > >> Hello Marek, > >> > >> On Sun, Aug 12, 2012 at 1:16 AM, Marek Vasut wrote: > >> > So ... we should aim for firing up the real mallocator as soon as > >> > possible and mayb

Re: [U-Boot] Early malloc() summary

2012-08-14 Thread Graeme Russ
Hi Marek, On Tue, Aug 14, 2012 at 10:37 PM, Marek Vasut wrote: > Dear Tomas Hlavacek, > >> Hello Marek, >> >> On Sun, Aug 12, 2012 at 1:16 AM, Marek Vasut wrote: >> > So ... we should aim for firing up the real mallocator as soon as >> > possible and maybe implement discontigmem (sparsemem) into

Re: [U-Boot] Early malloc() summary

2012-08-14 Thread Albert ARIBAUD
Hi Marek, On Tue, 14 Aug 2012 14:37:29 +0200, Marek Vasut wrote: > Dear Tomas Hlavacek, > > > Hello Marek, > > > > On Sun, Aug 12, 2012 at 1:16 AM, Marek Vasut wrote: > > > So ... we should aim for firing up the real mallocator as soon as > > > possible and maybe implement discontigmem (sparse

Re: [U-Boot] Early malloc() summary

2012-08-14 Thread Marek Vasut
Dear Tomas Hlavacek, > Hello Marek, > > On Sun, Aug 12, 2012 at 1:16 AM, Marek Vasut wrote: > > So ... we should aim for firing up the real mallocator as soon as > > possible and maybe implement discontigmem (sparsemem) into it, so we > > don't have to bother with relocating pointers maybe? > >

Re: [U-Boot] Early malloc() summary

2012-08-14 Thread Tomas Hlavacek
Hello Marek, On Sun, Aug 12, 2012 at 1:16 AM, Marek Vasut wrote: > > So ... we should aim for firing up the real mallocator as soon as possible and > maybe implement discontigmem (sparsemem) into it, so we don't have to bother > with relocating pointers maybe? > > The only problem I see is platfo

Re: [U-Boot] Early malloc() summary

2012-08-11 Thread Marek Vasut
Dear Wolfgang Denk, > Dear Graeme Russ, > > In message you wrote: > > While the need for early malloc() came about from the driver model and > > the desire to make drivers usable before relocation, I think we can all > > agree that its scope may well not be limited to use by drivers. A few > >

Re: [U-Boot] Early malloc() summary

2012-08-09 Thread Wolfgang Denk
Dear Graeme Russ, In message you wrote: > > While the need for early malloc() came about from the driver model and > the desire to make drivers usable before relocation, I think we can all > agree that its scope may well not be limited to use by drivers. A few > examples I can think of the top

[U-Boot] Early malloc() summary

2012-08-08 Thread Graeme Russ
Hi All, While the need for early malloc() came about from the driver model and the desire to make drivers usable before relocation, I think we can all agree that its scope may well not be limited to use by drivers. A few examples I can think of the top of my head include: - pre-console buffer