[OpenBIOS] [PATCH] Introduce forth_init() for trampoline initialization

Blue Swirl blauwirbel at gmail.com
Wed Nov 10 18:27:14 CET 2010

On Wed, Nov 10, 2010 at 10:52 AM, Mark Cave-Ayland
<mark.cave-ayland at siriusit.co.uk> wrote:
> Blue Swirl wrote:
>>> Are you sure it doesn't need to be initialized from anywhere else, like
>>> load_dictionary() or forth_init(), for the initialization to take effect
>>> before any of these?
>> Yes, since all uses of trampoline call setup_trampoline() before use.
>> I also renamed 't' to trampoline2 to catch all uses of it.
> I think I prefer Andreas' approach but with a slight modification - change
> the signature of init_trampoline() from:
> static void init_trampoline(void)
> to:
> static void init_trampoline(ucell *t)
> This enables the caller to pass in a pointer to the base of the trampoline
> ucell array, and so should work correctly when compiled as part of both
> bootstrap.c (host target) and the OpenBIOS output target.

Yes, good idea. I still think that adding setup_trampoline() which
just does the assignment to trampoline[1] would still be a small
cleanup, but it can be added later.

More information about the OpenBIOS mailing list