[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: sending signals from xdd's



Howard writes:

> Instead of requiring another thread, you could just install your own handler
> in the vbl queue. Or perhaps we can add a queue internal to MiNT that's
> processed at regular intervals. In either case you need to be able to call
> post_sig in order for it to be useful. My patch to make Fselect work on the
> standard BIOS serial ports just checks each port's buffers during vbl
> processing and then calls wakeup or wakeselect as required. I suppose I could
> also have implemented SIGIO there at the same time...
> 
> I guess a standard queue would be nice, have every driver that uses it set up
> 2 flags (e.g. read_ready and write_ready) that cause appropriate wakeup calls
> to be made. We could even implement the Exceptional conditions for select.
> 

When addroottimeout() is included into Mint, such a queue need not be
implemented, because it is then already there -- the timeout delta list.
All what is needed to do to wake processes on input and send signals when
post_sig() is in struct kerinfo, is the following:

static int pending = 0;

void
wakeme (long proc)
{
	pending = 0;
	wakeselect (`the process');
	wake (IO_Q, (long)`wait cond');
	kerinfo->post_sig (...);
}

and to do the following at interrupt time when input arrives (probably
at spl7):

if (!pending) {
	pending = 1;
	addroottimeout (0, wakeme, 1);
}

Kay.