How to add a local APIC vector entry?
I'm creating a driver that would deal a little with the performance monitoring counters that are on Intel chips. I'm running a dual P3 Xeon system. Linux 2.4.26, Slackware 10.0, gcc 3.3.4. Written in C, with inline/extended assembly.
The counters are supposed to be able to fire an interrupt when they overflow; the IA-32 Intel Architecture Software Developers Manual, Volume 3 says to:
-Provide an interrupt vector for handling the counter-overflow interrupt.
-Initialize the APIC PERF local vector entry to enable handling of performance-monitor counter overflow events.
-Provide an entry in the IDT that points to a stub exception handler that returns without executing any instructions.
-Provide an event monitor driver that provides the actual interrupt handler and modifies the reserved IDT entry to point to its interrupt routine.
As I understand it, and correct me if I'm wrong, the first can be done just w/ request_irq(IRQNUMBER, &HANDLER_FUNCTION_NAME, FLAGS, NAME, NULL).
I was told that request_irq should automatically set up the IDT, is that true? (if not, how do you go about setting up the IDT) And finally, how do you initialize the apic local vector entry?
I'm a newb when it comes to kernel and driver programming, so a good reference that gives details and function names would be helpful. I've looked through O'Reilly, and of course a good dea; of googling, looking through code, etc; but most drivers with interrupts that I can understand don't have to deal with setting up specific apic vector entries, nor IDT entries.
Anything would be a great help. A reference, link; or instructions (but please include function names, that has been my biggest difficulty, finding a mention of how to generally do some small part of this with no mention of specifics).
Thanks!
-Dagda
Last edited by Dagda99; 07-27-2004 at 12:36 PM.
|