mirror of
https://github.com/cirosantilli/linux-kernel-module-cheat.git
synced 2026-01-23 02:05:57 +01:00
irq: move doc to readme.
Cleanup, interlink, retest and update observations.
This commit is contained in:
@@ -1,42 +1,10 @@
|
||||
/*
|
||||
Brute force monitor every shared interrupt that will accept us.
|
||||
|
||||
I.e. only works if for IRQs for which the other handlers are registered as IRQF_SHARED.
|
||||
|
||||
Usage:
|
||||
|
||||
1. insmod and then use the keyboard and mouse. Those handlers are shared,
|
||||
and the messages show up whenever you do something.
|
||||
|
||||
Does not work in text mode of course.
|
||||
|
||||
2. insmod some module that generates interrupts after insmod irq.,
|
||||
e.g. pci_min or platform_device.
|
||||
|
||||
TODO: why does insmod in ARM lead to infinitely many interrupts handler irq = 45 dev = 252
|
||||
and blocks the board? Is the ARM timer shared, and x86 isn't?
|
||||
|
||||
TODO: properly understand how each IRQ maps to what.
|
||||
|
||||
The Linux kernel mainline also has dummy-irq for monitoring a single IRQ.
|
||||
|
||||
Inside QEMU, also try:
|
||||
|
||||
watch -n 1 cat /proc/interrupts
|
||||
|
||||
Then see how clicking the mouse and keyboard affect the interrupts. This will point you to:
|
||||
|
||||
- 1: keyboard
|
||||
- 12: mouse click and drags
|
||||
*/
|
||||
|
||||
#include <linux/fs.h>
|
||||
#include <linux/interrupt.h>
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/uaccess.h> /* copy_from_user, copy_to_user */
|
||||
|
||||
#define NAME "lkmc_character_device"
|
||||
#define NAME "lkmc_irq"
|
||||
#define MAX_IRQS 256
|
||||
|
||||
static int irqs[MAX_IRQS];
|
||||
|
||||
Reference in New Issue
Block a user