Subject: Re: yamt-idlelwp fallout for mips/cobalt?
To: Izumi Tsutsui <tsutsui@ceres.dti.ne.jp>
From: Andrew Doran <ad@netbsd.org>
List: port-cobalt
Date: 05/23/2007 13:57:08
On Wed, May 23, 2007 at 06:54:13PM +0900, Izumi Tsutsui wrote:

> Anyway I'll commit the following change if there is no objection.
> (some other mips ports may need the similar fix)

..

> +		/*
> +		 * XXX
> +		 * lwp0 and cpu_info_store are allocated in BSS
> +		 * and initialized before mach_init() is called,
> +		 * so restore them again.
> +		 */
> +		lwp0.l_cpu = &cpu_info_store;
> +		cpu_info_store.ci_curlwp = &lwp0;

Can you try forcing them into the data segment and see if that works? Eg:

struct cpu_info cpu_info_store = { .ci_curlwp = &lwp0 };
lwp_t lwp0 = { .l_stat = LSONPROC };

I think cpu_info_store should live somewhere else, like mips_machdep.c.
I can have a look once I have 'net connectivity again.

Andrew