Skip to content

Commit

Permalink
Update submodules
Browse files Browse the repository at this point in the history
  • Loading branch information
liaocj committed Nov 21, 2024
1 parent cc738e7 commit 9aec253
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 2 deletions.
29 changes: 28 additions & 1 deletion linux/内核-驱动/中断/硬中断--数据结构.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,5 +103,32 @@ struct irq_chip {

unsigned long flags;
};

struct irq_domain {
struct list_head link; // 常规操作,所有的 irq_domain 连接到全局链表上
const char *name;
const struct irq_domain_ops *ops; // 这个应该是不同的控制器操作函数不同
void *host_data;
unsigned int flags;
unsigned int mapcount; // 管理的中断源数量

/* Optional data */
struct fwnode_handle *fwnode; // 从 DTS 或 ACPI 获取的
enum irq_domain_bus_token bus_token;
struct irq_domain_chip_generic *gc;
#ifdef CONFIG_IRQ_DOMAIN_HIERARCHY
struct irq_domain *parent; // 这个应该就是多个中断控制器级联成树状结构
#endif

/* reverse map data. The linear map gets appended to the irq_domain */
irq_hw_number_t hwirq_max; // 最大支持的中断数量
unsigned int revmap_size; // 线性映射的大小
struct radix_tree_root revmap_tree; // 基数树映射的根节点
struct mutex revmap_mutex;
struct irq_data __rcu *revmap[]; // 线性映射用到的查找表
};
```
![alt text](../../../../medias/images_0/硬中断--数据结构_image.png)
![alt text](../../../../medias/images_0/硬中断--数据结构_image.png)

图的左侧紫色部分,主要在中断控制器驱动中进行初始化设置,包括各个结构中函数指针的指向等,其中 struct irq_chip 用于对中断控制器的硬件操作,struct irq_domain 与中断控制器对应,完成的工作是硬件中断号到 irq 的映射;
![alt text](../../../../medias/images_0/硬中断--数据结构_image-1.png)
2 changes: 1 addition & 1 deletion 硬件相关/pcie/PCIe ECAM介绍.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ devmem 0xd0100000就是访问01:00.0 设备偏移0寄存器

drivers/pci/ecam.c实现ECAM配置访问

# qemu 软件仿真shixian
# qemu 软件仿真实现
```c
/*
* PCI express ECAM (Enhanced Configuration Address Mapping) format.
Expand Down

0 comments on commit 9aec253

Please sign in to comment.