Subject: Re: kauth machdep actions (Re: CVS commit: src)
To: None <elad@NetBSD.org>
From: YAMAMOTO Takashi <yamt@mwd.biglobe.ne.jp>
List: tech-kern
Date: 12/22/2006 21:01:00
> YAMAMOTO Takashi wrote:
> 
> > isn't it better to make KAUTH_REQ_MACHDEP_xxx actions?
> 
> do you mean, so that there's only one 'set' of machdep requests, and
> there are no arch-specific actions/requests?

yes.

> > ie. define __HAVE_KAUTH_MACHDEP_xxx in MD headers, say, machine/kauth.h,
> > so that listeners can do something like the following.
> > 
> > 	switch (action) {
> > 	case KAUTH_MACHDEP_UNMANAGEDMEM
> > #if defined(__HAVE_KAUTH_MACHDEP_UNMANAGEDMEM)
> > 			:
> > 			:
> > 		break;
> > #else
> > 		panic();
> > #endif
> > 	case KAUTH_MACHDEP_IOPL
> > #if defined(__HAVE_KAUTH_MACHDEP_IOPL)
> > 			:
> > 			:
> > 		break;
> > #else
> > 		panic();
> > #endif
> > 	}
> 
> I'd rather keep it as it is now, and avoid #ifdef mess.
> 
> -e.

it's better than having code which never be used, IMO.
but you can do it without #ifdef if you want, by doing
unifdef -D the above example.

YAMAMOTO Takashi