irq handler

irq handler

Post by Giovanni Organtin » Thu, 20 Mar 1997 04:00:00



Hi,
I'm writing a piece of code that should use an interrupt, so that I
need to request an interrupt handler. I think the way to do this is
the following:

#include <stdio.h>
#include <linux/sched.h>
#include <linux/signal.h>
#include <linux/mm.h>
#include <asm/irq.h>
#include <asm/signal.h>

void irq_handler(int IRQ) {
  printf("CIAO\n");

Quote:}

int main() {
  void * handler = &irq_handler;
  request_irq(3,handler,SA_INTERRUPT,"test",NULL);
  return 0;

Quote:}

but when I try to compile the routine request_irq is undefined.
It should works in modules, but I want to substitute the irq handler
in a user program. Can I do it? If yes, how?
Thanks a lot.

                                           Giovanni Organtini
-------------------------------------------------------------
Universita' di Roma TRE & INFN-Roma
Via della Vasca Navale, 84
00146 Roma
Tel. +39-6-5517.7242 (Fax: +39-6-5579.303)

 
 
 

irq handler

Post by Ingo Molna » Sun, 23 Mar 1997 04:00:00


: Hi,
: I'm writing a piece of code that should use an interrupt, so that I
: need to request an interrupt handler. I think the way to do this is
: the following:

:   request_irq(3,handler,SA_INTERRUPT,"test",NULL);

IRQs can only be requested in the kernel. Write a module (which does
the same as your code).

-- mingo