Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 29 Oct 1998 21:22:00 +0200 (SAT)
From:      John Hay <jhay@mikom.csir.co.za>
To:        yokota@zodiac.mech.utsunomiya-u.ac.jp (Kazutaka YOKOTA)
Cc:        dfr@nlsystems.com, hackers@FreeBSD.ORG (FreeBSD-hackers)
Subject:   Re: kld screensavers
Message-ID:  <199810291922.VAA27010@zibbi.mikom.csir.co.za>
In-Reply-To: <199810291457.XAA12116@zodiac.mech.utsunomiya-u.ac.jp> from Kazutaka YOKOTA at "Oct 29, 98 11:57:19 pm"

next in thread | previous in thread | raw e-mail | index | archive | help
> 
> >It looks about right and SI_SUB_PSEUDO is sufficiently late that it
> >shouldn't disturb anything.  Any time after SI_SUB_CONFIGURE should work I
> >think.
> >
> >It would be nice if the add_scrn_saver/remove_scrn_saver goop was factored
> >into a generic module event handler which can be used by all screen
> >savers.  Have a look at the CDEV_MODULE #define in sys/conf.h for a
> >possible way of doing this.
> >
> >If the generic module handler chains onto an optional user-supplied
> >handler, then extra initialisation (allocating message in this case) can
> >be done by each saver without repeating the registration code.
> 
> You mean something like this?
> 
> 1. Define generic_screen_saver_module_handler() in syscons.c or somewhere.
> 2. Each screen saver module define its own event handler.  It will call
>    the generic handler first and then do its own extra house keeping.
> 

Is this really usefull? The simplest one is the star_saver and its
modevent function will look like this:

---------
static int
star_saver_modevent(module_t mod, modeventtype_t type, void *unused)
{
	switch (type) {
	case MOD_LOAD:
		return add_scrn_saver(star_saver);
	case MOD_UNLOAD:
		return remove_scrn_saver(star_saver);
	default:
		printf("star_saver module unknown event: 0x%x\n", type);
	}
	return 0;
}
---------

It looks silly to me to put this somewhere generic and call it from each
saver.

What might be usefull is a macro to define the moduledata_t structure
and do the DECLARE_MODULE() thingy like what is done with CDEV_MODULE,
but even there I'm not sure if you are saving that much.

But maybe I'm missing something.

John
-- 
John Hay -- John.Hay@mikom.csir.co.za

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199810291922.VAA27010>