
24.01.23 최초 작성
struct irq_desc : 링크 참조struct irq_desc를 관리하는 tree 자료구조// include/linux/irqdesc.h
// tree에 irq_desc 삽입
static void irq_insert_desc(unsigned int irq, struct irq_desc *desc)
{
radix_tree_insert(&irq_desc_tree, irq, desc);
}
// tree를 순회해
struct irq_desc *irq_to_desc(unsigned int irq)
{
return radix_tree_lookup(&irq_desc_tree, irq);
}
EXPORT_SYMBOL(irq_to_desc);
static void delete_irq_desc(unsigned int irq)
{
radix_tree_delete(&irq_desc_tree, irq);
}
struct irq_action : 인터럽트 핸들러에 관련한 정보를 저장하는 자료구조// include/linux/interrupt.h
struct irqaction {
irq_handler_t handler; //인터럽트 핸들러의 주소
void *dev_id; //전달되는 매개 변수
void __percpu *percpu_dev_id;
struct irqaction *next;
irq_handler_t thread_fn; //irq스레드 처리 함수 주소
struct task_struct *thread;
struct irqaction *secondary;
unsigned int irq; //인터럽트 번호
unsigned int flags; //주요 플래그
unsigned long thread_flags;
unsigned long thread_mask;
const char *name; //인터럽트 이름
struct proc_dir_entry *dir;
} ____cacheline_internodealigned_in_smp;
irq : 인터럽트 번호에 따른 irq_desc, irq_action에 대한 주소 정보를 나타냄

irq -s : 각 cpu 코어 별로 인터럽트 발생 횟수를 나타냄

struct irq_desc[.자료구조] <irq_desc의 시작 주소> : 해당 irq_desc의 정보를 나타냄

struct irq_desc.kstat_irqs <irq_desc의 시작 주소> : 해당 인터럽트가 얼마나 발생했는지 나타냄
p *(int*)(0xffffffd175274c5c+__per_cpu_offset[n]) : n번 cpu에서 해당 인터럽트가 얼마나 발생했는지 나타냄
struct irqaction <irqaction의 시작 주소> : irqaction의 정보를 나타냄