GIC 中断控制器驱动
More...
#include <gic.h>
|
| auto | SetUp () const -> void |
| | 初始化当前 CPU 的 GIC 配置
|
| |
| auto | Spi (uint32_t intid, uint32_t cpuid) const -> void |
| | 配置共享外设中断 (SPI)
|
| |
| auto | Ppi (uint32_t intid, uint32_t cpuid) const -> void |
| | 配置私有外设中断 (PPI)
|
| |
| auto | Sgi (uint32_t intid, uint32_t cpuid) const -> void |
| | 配置软件生成中断 (SGI)
|
| |
|
| | Gic (uint64_t gicd_base_addr, uint64_t gicr_base_addr) |
| | 构造函数
|
| |
| | Gic ()=default |
| |
| | Gic (const Gic &)=delete |
| |
| | Gic (Gic &&)=delete |
| |
| auto | operator= (const Gic &) -> Gic &=delete |
| |
| auto | operator= (Gic &&) -> Gic &=default |
| |
| | ~Gic ()=default |
| |
◆ Gic() [1/4]
| Gic::Gic |
( |
uint64_t |
gicd_base_addr, |
|
|
uint64_t |
gicr_base_addr |
|
) |
| |
|
explicit |
构造函数
- Parameters
-
| gicd_base_addr | GIC Distributor 地址 |
| gicr_base_addr | GIC Redistributor 地址 |
- Copyright
- Copyright The SimpleKernel Contributors
Definition at line 13 of file gic.cpp.
14 :
gicd_(gicd_base_addr),
gicr_(gicr_base_addr) {
15 cpu_io::ICC_IGRPEN1_EL1::Enable::Clear();
16 cpu_io::ICC_PMR_EL1::Priority::Set();
17
19
21}
auto EnableGrp1Ns() const -> void
允许 no-sec group1 中断
Gicr gicr_
Redistributor 实例
auto Info(etl::format_string< Args... > fmt, Args &&... args) -> void
以 INFO 级别记录日志
◆ Gic() [2/4]
◆ Gic() [3/4]
◆ Gic() [4/4]
◆ ~Gic()
◆ operator=() [1/2]
| auto Gic::operator= |
( |
const Gic & |
| ) |
-> Gic &=delete |
|
delete |
◆ operator=() [2/2]
| auto Gic::operator= |
( |
Gic && |
| ) |
-> Gic &=default |
|
default |
◆ Ppi()
| auto Gic::Ppi |
( |
uint32_t |
intid, |
|
|
uint32_t |
cpuid |
|
) |
| const -> void |
配置私有外设中断 (PPI)
- Parameters
-
Definition at line 35 of file gic.cpp.
35 {
37}
auto SetupPpi(uint32_t intid, uint32_t cpuid) const -> void
设置指定 PPI 中断 PPI: private peripheral interrupt, 私有外设中断,该中断来源于外设,但是该中断只对指定的 core 有效
◆ SetUp()
| auto Gic::SetUp |
( |
| ) |
const -> void |
初始化当前 CPU 的 GIC 配置
Definition at line 23 of file gic.cpp.
23 {
24 cpu_io::ICC_IGRPEN1_EL1::Enable::Clear();
25 cpu_io::ICC_PMR_EL1::Priority::Set();
27
29}
auto SetUp() const -> void
初始化 gicr,在多核场景使用
◆ Sgi()
| auto Gic::Sgi |
( |
uint32_t |
intid, |
|
|
uint32_t |
cpuid |
|
) |
| const -> void |
配置软件生成中断 (SGI)
- Parameters
-
Definition at line 39 of file gic.cpp.
39 {
41}
auto SetupSgi(uint32_t intid, uint32_t cpuid) const -> void
设置指定 SGI 中断 SGI: Software Generated Interrupt, 软件生成中断,用于处理器间通信
◆ Spi()
| auto Gic::Spi |
( |
uint32_t |
intid, |
|
|
uint32_t |
cpuid |
|
) |
| const -> void |
配置共享外设中断 (SPI)
- Parameters
-
Definition at line 31 of file gic.cpp.
31 {
33}
auto SetupSpi(uint32_t intid, uint32_t cpuid) const -> void
设置指定 SPI 中断 SPI: shared peripheral interrupt, 共享外设中断,该中断来源于外设,但是该中断可以对所有的 core 有效
◆ gicd_
Distributor 实例
Definition at line 678 of file gic.h.
◆ gicr_
Redistributor 实例
Definition at line 680 of file gic.h.
◆ kCompatibleName
| constexpr const char* Gic::kCompatibleName = "arm,gic-v3" |
|
staticconstexpr |
Definition at line 19 of file gic.h.
◆ kPpiBase
| constexpr size_t Gic::kPpiBase = 16 |
|
staticconstexpr |
Definition at line 23 of file gic.h.
◆ kPpiCount
| constexpr size_t Gic::kPpiCount = 16 |
|
staticconstexpr |
Definition at line 24 of file gic.h.
◆ kSgiBase
| constexpr size_t Gic::kSgiBase = 0 |
|
staticconstexpr |
Definition at line 21 of file gic.h.
◆ kSgiCount
| constexpr size_t Gic::kSgiCount = 16 |
|
staticconstexpr |
Definition at line 22 of file gic.h.
◆ kSpiBase
| constexpr size_t Gic::kSpiBase = 32 |
|
staticconstexpr |
Definition at line 25 of file gic.h.
◆ kSpiCount
| constexpr size_t Gic::kSpiCount = 988 |
|
staticconstexpr |
Definition at line 26 of file gic.h.
The documentation for this class was generated from the following files:
- /workspaces/SimpleKernel/src/arch/aarch64/gic/include/gic.h
- /workspaces/SimpleKernel/src/arch/aarch64/gic/gic.cpp