[openbeos] Re: Calling an Interrupt from within a Driver

  • From: "François Revol" <revol@xxxxxxx>
  • To: openbeos@xxxxxxxxxxxxx
  • Date: Wed, 13 Sep 2006 22:35:43 +0200 CEST

> Hi List,
> 
> I'm baffled at a small hack that the X.Org and Syllable i830
> (intel_extreme) drivers.
> I have absolutely no idea how to do this in BeOS/Haiku, other then
> using inline Assembly.
> 
> Here is the extracted code:
> http://rafb.net/paste/results/GYxYjZ90.html
> 

I'm not sure what you want exactly (that url is now invalid).

If all you want to do is call your interrupt handler yourself to 
simulate an interrupt (because some versions of the chipset doesn't 
generate them), you can just do something like:

cpu_status st;
status_t err;
st = disable_interrupts();
err = myinthandler(mydata);
restore_interrupts(st);

// optionally trigger a resched
if (err == B_INVOKE_SCHEDULER)
    snooze(1); // not sure it's the best way

If you want to do that from the accelerant or other user code you can 
add a specific ioctl() code and put that in the appropriate ioctl() 
case block.

If you want to simulate an interrupt that another driver hooked, then I 
can explain you why you don't want to (because it's not clean). It 
might be possible if really needed with some kernel insight, but you 
really shouldn't need that.

There is no generic syscall to fake interrupts/irqs that I know of, let 
alone a vm86 handler in BeOS.

François.

Other related posts: