Date: Wed, 11 Jan 2006 08:37:45 -0800 (PST) From: kamal kc <kamal_ckk@yahoo.com> To: freebsd <freebsd-hackers@freebsd.org> Subject: Re: rescheduling tasks using swi_add() Message-ID: <20060111163745.30383.qmail@web30008.mail.mud.yahoo.com> In-Reply-To: <200601110903.18120.jhb@freebsd.org>
index | next in thread | previous in thread | raw e-mail
--- John Baldwin <jhb@freebsd.org> wrote:
> >
> > the man page discussed the swi_add() and
> swi_sched()
> > functions.
> >
> > what i don't understand is, how do i register my
> > handler
> > function ??
> > if i use the swi_add() for that purpose what
> > do i use for the void *arg argument.
> >
> > and how can i dispatch control to the software
> > interrupt handler ??
> > the swi_sched() uses only the cookie and the flags
> > arguments.
> > there is no way i can pass arguments to my handler
> > function ..
> >
> > i guess most of you are familiar with this and can
> > help me
> > out ......
>
> Queue a task to a taskqueue. Behind the scenes that
> will invoke a swi_add if
> you use the taskqueue_swi queue. However, given
> that you want to do some
> rather complicated work, you'd be better off
> creating a dedicated taskqueue
> thread and queueing tasks off to it I think.
thanks for the suggestion on the taskqueue. i tried it
on a dummy kernel module and got some output, but i
don't know if they were correct or not. i would like
to know
if i followed the right steps. here is the code i
used ::
struct taskqueue_arguments
{ int a;
int b;
};
void taskqueue_function(void *,int);
typedef void taskqueue_function_t(void *,int);
/* taskqueue function */
void taskqueue_function(void *arguments,int int_arg)
{
struct taskqueue_arguments *arg;
arg=(struct taskqueue_arguments *)arguments;
printf("\ntakqueue_function was called the args are
%d
%d",arg->a,arg->b);
return;
}
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
help
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20060111163745.30383.qmail>
