Subject: yamt-idlelwp: setting curlwp in MI code.
To: None <tech-kern@netbsd.org>
From: Matt Thomas <matt@3am-software.com>
List: tech-kern
Date: 04/05/2007 15:13:37
While I think the goal of setting curlwp in MI code is laudable, it's 
incomplete.  For PowerPC, I also need to set "curpcb" and "curpm" (which
I currently do in cpu_switchto).  I think we should have a
#deifne cpu_set_curlwp(ci, l) macro which if undefined is simply

#ifndef cpu_set_curlwp
#define cpu_set_curlwp(ci, l) ((void)((ci)->ci_curlwp = (l)))
#endif

Then on ppc, I could do
#define cpu_set_curlwp(ci, l) do { \
   (ci)->ci_curlw = (l); \
   (ci)->ci_curpcb = &l->l_addr->u_pcb; \
   (ci)->ci_curpm = (ci)->ci_curpcb->pcb_pm; \
} while (0)

I'm sure that other ports which have similar needs...
Anyone else need this?