LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 12-09-2010, 08:45 PM   #1
eric_tj
LQ Newbie
 
Registered: Dec 2010
Posts: 1

Rep: Reputation: 0
What is the relation ship between vector and irq number?


Hi, All:

I just found in kernel-2.6.35.3, in file arch/x86/kernel/irq.c:

unsigned int __irq_entry do_IRQ(struct pt_regs *regs)
{
struct pt_regs *old_regs = set_irq_regs(regs);

/* high bit used in ret_from_ code */
unsigned vector = ~regs->orig_ax;
unsigned irq;

exit_idle();
irq_enter();

irq = __get_cpu_var(vector_irq)[vector];

if (!handle_irq(irq, regs)) {
ack_APIC_irq();

if (printk_ratelimit())
pr_emerg("%s: %d.%d No irq handler for vector (irq %d)\n",
__func__, smp_processor_id(), vector, irq);
}

irq_exit();

set_irq_regs(old_regs);
return 1;
}

Does any body know the relationship between the vector number and irq number?
 
Old 12-10-2010, 08:54 AM   #2
allend
LQ 5k Club
 
Registered: Oct 2003
Location: Melbourne
Distribution: Slackware64-15.0
Posts: 6,371

Rep: Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749
If you google "interrupt vector table" you will find full information. The essential point is that the IRQ value is used by the CPU to calculate the memory address of the interrupt vector so that it can perform a jump to an interrupt handler pointed to by the interrupt vector.
HTH and welcome to LQ!
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Wondering what "do_IRQ: .176 No Irq handler for vector (irq -1)" means 4restg Linux - Newbie 1 10-27-2009 02:41 AM
What is the difference between an IRQ and an interrupt vector? jbreaka4lyfe Linux - General 1 04-01-2008 07:20 AM
How to find irq number associated with PCI interrupt P.S.R.K.S.PRASAD Linux - Kernel 3 11-08-2006 11:33 PM
Obtain the real IRQ number for a PCI device Elliott-t Linux - Kernel 2 09-24-2006 09:05 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 09:49 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration