Subject: Re: netbsd-current and ibook g4: kernel freeze
To: leon zadorin <leonleon77@gmail.com>
From: leon zadorin <leonleon77@gmail.com>
List: port-macppc
Date: 02/02/2007 10:44:03
On 2/2/07, leon zadorin <leonleon77@gmail.com> wrote:
> On 2/2/07, Allen Briggs <briggs@netbsd.org> wrote:
>
> > > But where is openfirmware_entry actually defined/assigned in macppc
> > > port?
> >
> > It's set by the ofwinit() call which is called first thing on entry
> > into the kernel (__start in locore.S).
> >
>


Just a little side note (addition) to the previous post of mine, doing
"grep -R openfirmware_entry ./" in /usr/src/sys I have this in my
source tree (aside from shark, amigappc and powerpc/oea dirs):

arch/macppc/stand/ofwboot/Locore.c :

#if 0
static int
openfirmware(void *arg)
{

	__asm volatile ("sync; isync");
	openfirmware_entry(arg);
	__asm volatile ("sync; isync");
}
#endif

static void
startup(void *vpd, int res, int (*openfirm)(void *), char *arg, int argl)
{

	openfirmware = openfirm;
	setup();
	main();
	OF_exit();
}

and in arch/ofppc/stand/ofwboot/Locore.c (which seems to be more
"easier to understand for my stupid logic" as at least there is an
assignment of "openfirmware_entry" in "startup")

static int
openfirmware(void *arg)
{
	int r;

	__asm volatile ("sync; isync");
	r = openfirmware_entry(arg);
	__asm volatile ("sync; isync");

	return r;
}

static void
startup(void *vpd, int res, int (*openfirm)(void *), char *arg, int argl)
{
	extern char _end[], _edata[];

	memset(_edata, 0, (_end - _edata));
	openfirmware_entry = openfirm;
	setup();
	main();
	OF_exit();
}