|
SimpleKernel 1.17.0
|
GIC Distributor 接口 More...
#include <gic.h>

Classes | |
| struct | GicdCtlr |
| GICD_CTLR, Distributor Control Register. More... | |
| struct | GicdIidr |
| GICD_IIDR, Distributor Implementer Identification Register. More... | |
| struct | GicdTyper |
| GICD_TYPER, Interrupt Controller Type Register. More... | |
Public Member Functions | |
| auto | Enable (uint32_t intid) const -> void |
| 允许从 Distributor 转发到 redistributor | |
| auto | EnableGrp1Ns () const -> void |
| 允许 no-sec group1 中断 | |
| auto | Disable (uint32_t intid) const -> void |
| 禁止从 Distributor 转发到 redistributor | |
| auto | Clear (uint32_t intid) const -> void |
| 清除 intid 的中断 | |
| auto | IsEnable (uint32_t intid) const -> bool |
| 判断 intid 中断是否使能 | |
| auto | SetPrio (uint32_t intid, uint32_t prio) const -> void |
| 设置 intid 的优先级 | |
| auto | SetConfig (uint32_t intid, uint32_t config) const -> void |
| 设置 intid 的属性 | |
| auto | SetTarget (uint32_t intid, uint32_t cpuid) const -> void |
| 设置 intid 的由指定 cpu 处理 | |
| auto | SetupSpi (uint32_t intid, uint32_t cpuid) const -> void |
| 设置指定 SPI 中断 SPI: shared peripheral interrupt, 共享外设中断,该中断来源于外设,但是该中断可以对所有的 core 有效 | |
构造/析构函数 | |
| Gicd (uint64_t _base_addr) | |
| 构造函数 | |
| Gicd ()=default | |
| Gicd (const Gicd &)=delete | |
| Gicd (Gicd &&)=delete | |
| auto | operator= (const Gicd &) -> Gicd &=delete |
| auto | operator= (Gicd &&) -> Gicd &=default |
| ~Gicd ()=default | |
Private Member Functions | |
| __always_inline auto | Igrouprn (uint64_t n) const -> uint64_t |
| 计算 IGROUPR 寄存器偏移 | |
| __always_inline auto | Isenablern (uint64_t n) const -> uint64_t |
| 计算 ISENABLER 寄存器偏移 | |
| __always_inline auto | Icenablern (uint64_t n) const -> uint64_t |
| 计算 ICENABLER 寄存器偏移 | |
| __always_inline auto | Icpendrn (uint64_t n) const -> uint64_t |
| 计算 ICPENDR 寄存器偏移 | |
| __always_inline auto | Ipriorityrn (uint64_t n) const -> uint64_t |
| 计算 IPRIORITYR 寄存器偏移 | |
| __always_inline auto | Itargetsrn (uint64_t n) const -> uint64_t |
| 计算 ITARGETSR 寄存器偏移 | |
| __always_inline auto | Icfgrn (uint64_t n) const -> uint64_t |
| 计算 ICFGR 寄存器偏移 | |
| __always_inline auto | Read (uint32_t off) const -> uint32_t |
| __always_inline auto | Write (uint32_t off, uint32_t val) const -> void |
Private Attributes | |
| uint64_t | base_addr_ {0} |
| GICD 基地址 | |
Static Private Attributes | |
| static constexpr uint32_t | kCtlr = 0x0000 |
| static constexpr uint32_t | kCtlrEnableGrp1Ns = 0x2 |
| static constexpr uint32_t | kTyper = 0x0004 |
| Configuration dependent Interrupt Controller Type Register, RO. | |
| static constexpr uint32_t | kTyperItLinesNumberMask = 0x1F |
| static constexpr uint32_t | kIidr = 0x0008 |
| static constexpr uint32_t | kFctlr = 0x0020 |
| Function Control Register, RW. | |
| static constexpr uint32_t | kSac = 0x0024 |
| Tie-off dependentb Secure Access Control register, RW. | |
| static constexpr uint32_t | kSetSpiNsr = 0x0040 |
| Non-secure SPI Set Register, WO. | |
| static constexpr uint32_t | kClrSpiNsr = 0x0048 |
| Non-secure SPI Clear Register, WO. | |
| static constexpr uint32_t | kSetSpiSr = 0x0050 |
| Secure SPI Set Register, WO. | |
| static constexpr uint32_t | kClrSpiSr = 0x0058 |
| Secure SPI Clear Register, WO. | |
| static constexpr uint32_t | kIgrouprn = 0x0080 |
| static constexpr uint32_t | kIsEnablern = 0x0100 |
| static constexpr uint32_t | kIsEnablernSize = 32 |
| static constexpr uint32_t | kIcEnablern = 0x0180 |
| static constexpr uint32_t | kIcEnablernSize = 32 |
| static constexpr uint32_t | kIsPendrn = 0x0200 |
| Interrupt Set-Pending Registers, n = 0-31, but n=0 is Reserved. | |
| static constexpr uint32_t | kIcPendrn = 0x0280 |
| static constexpr uint32_t | kIcPendrnSize = 32 |
| static constexpr uint32_t | kIsActivern = 0x0300 |
| Interrupt Set-Active Registers, n = 0-31, but n=0 is Reserved. | |
| static constexpr uint32_t | kIcActivern = 0x0380 |
| Interrupt Clear-Active Registers, n = 0-31, but n=0 is Reserved. | |
| static constexpr uint32_t | kIpriorityrn = 0x0400 |
| static constexpr uint32_t | kIpriorityrnSize = 4 |
| static constexpr uint32_t | kIpriorityrnBits = 8 |
| static constexpr uint32_t | kIpriorityrnBitsMask = 0xFF |
| static constexpr uint32_t | kItargetsrn = 0x0800 |
| static constexpr uint32_t | kItargetsrnSize = 4 |
| static constexpr uint32_t | kItargetsrnBits = 8 |
| static constexpr uint32_t | kItargetsrnBitsMask = 0xFF |
| static constexpr uint32_t | kIcfgrn = 0x0C00 |
| static constexpr uint32_t | kIcfgrnSize = 16 |
| static constexpr uint32_t | kIcfgrnBits = 2 |
| static constexpr uint32_t | kIcfgrnBitsMask = 0x3 |
| static constexpr uint32_t | kIcfgrnLevelSensitive = 0 |
| static constexpr uint32_t | kIcfgrnEdgeTriggered = 1 |
| static constexpr uint32_t | kIgrpmodrn = 0x0D00 |
| static constexpr uint32_t | kNsacrn = 0x0E00 |
| static constexpr uint32_t | kIroutern = 0x6000 |
| static constexpr uint32_t | kChipsr = 0xC000 |
| P-Channel dependent Chip Status Register, RW. | |
| static constexpr uint32_t | kDchipr = 0xC004 |
| Default Chip Register, RW. | |
| static constexpr uint32_t | kChiprn = 0xC008 |
| Chip Registers, n = 0-15. Reserved in single-chip configurations. | |
| static constexpr uint32_t | kIclarn = 0xE000 |
| Interrupt Class Registers, n = 0-63, but n=0-1 are Reserved. | |
| static constexpr uint32_t | kIcerrrn = 0xE100 |
| Interrupt Clear Error Registers, n = 0-31, but n=0 is Reserved. | |
| static constexpr uint64_t | kCfgid = 0xF000 |
| Configuration dependent Configuration ID Register, RO. | |
| static constexpr uint32_t | kPidr4 = 0xFFD0 |
| Peripheral ID4 register , RO. | |
| static constexpr uint32_t | kPidr5 = 0xFFD4 |
| Peripheral ID 5 Register, RO. | |
| static constexpr uint32_t | kPidr6 = 0xFFD8 |
| Peripheral ID 6 Register, RO. | |
| static constexpr uint32_t | kPidr7 = 0xFFDC |
| Peripheral ID 7 Register, RO. | |
| static constexpr uint32_t | kPidr0 = 0xFFE0 |
| Peripheral ID0 register, RO. | |
| static constexpr uint32_t | kPidr1 = 0xFFE4 |
| Peripheral ID1 register, RO. | |
| static constexpr uint32_t | kPidr2 = 0xFFE8 |
| Peripheral ID2 register, RO. | |
| static constexpr uint32_t | kPidr3 = 0xFFEC |
| Peripheral ID3 register, RO. | |
| static constexpr uint32_t | kCidr0 = 0xFFF0 |
| Component ID 0 Register, RO. | |
| static constexpr uint32_t | kCidr1 = 0xFFF4 |
| Component ID 1 Register, RO. | |
| static constexpr uint32_t | kCidr2 = 0xFFF8 |
| Component ID 2 Register, RO. | |
| static constexpr uint32_t | kCidr3 = 0xFFFC |
| Component ID 3 Register, RO. | |
|
explicit |
构造函数
| _base_addr | GICD 基地址 |
Definition at line 43 of file gic.cpp.

|
default |
|
delete |
|
delete |
|
default |
| auto Gic::Gicd::Clear | ( | uint32_t | intid | ) | const -> void |
清除 intid 的中断
| intid | 中断号 |
Definition at line 77 of file gic.cpp.
| auto Gic::Gicd::Disable | ( | uint32_t | intid | ) | const -> void |
禁止从 Distributor 转发到 redistributor
| intid | 中断号 |
Definition at line 71 of file gic.cpp.
| auto Gic::Gicd::Enable | ( | uint32_t | intid | ) | const -> void |
允许从 Distributor 转发到 redistributor
| intid | 中断号 |
Definition at line 60 of file gic.cpp.
| auto Gic::Gicd::EnableGrp1Ns | ( | ) | const -> void |
|
inlineprivate |
|
inlineprivate |
|
inlineprivate |
|
inlineprivate |
|
inlineprivate |
| auto Gic::Gicd::IsEnable | ( | uint32_t | intid | ) | const -> bool |
|
inlineprivate |
|
inlineprivate |
|
inlineprivate |
| auto Gic::Gicd::SetConfig | ( | uint32_t | intid, |
| uint32_t | config | ||
| ) | const -> void |
设置 intid 的属性
| intid | 中断号 |
| config | 属性 |
Definition at line 96 of file gic.cpp.
| auto Gic::Gicd::SetPrio | ( | uint32_t | intid, |
| uint32_t | prio | ||
| ) | const -> void |
设置 intid 的优先级
| intid | 中断号 |
| prio | 优先级 |
Definition at line 88 of file gic.cpp.
| auto Gic::Gicd::SetTarget | ( | uint32_t | intid, |
| uint32_t | cpuid | ||
| ) | const -> void |
| auto Gic::Gicd::SetupSpi | ( | uint32_t | intid, |
| uint32_t | cpuid | ||
| ) | const -> void |
设置指定 SPI 中断 SPI: shared peripheral interrupt, 共享外设中断,该中断来源于外设,但是该中断可以对所有的 core 有效
| intid | 中断号 |
| cpuid | cpu 编号 |
Definition at line 137 of file gic.cpp.
|
inlineprivate |
|
staticconstexprprivate |
|
staticconstexprprivate |
|
staticconstexprprivate |
|
staticconstexprprivate |
|
staticconstexprprivate |
|
staticconstexprprivate |
|
staticconstexprprivate |
|
staticconstexprprivate |
|
staticconstexprprivate |
|
staticconstexprprivate |
|
staticconstexprprivate |
|
staticconstexprprivate |
|
staticconstexprprivate |
|
staticconstexprprivate |
|
staticconstexprprivate |
Interrupt Clear-Enable Registers, n = 0-31, but n=0 is Reserved
|
staticconstexprprivate |
|
staticconstexprprivate |
|
staticconstexprprivate |
Interrupt Configuration Registers, n = 0-63, but n=0-1 are Reserved
|
staticconstexprprivate |
|
staticconstexprprivate |
|
staticconstexprprivate |
|
staticconstexprprivate |
|
staticconstexprprivate |
|
staticconstexprprivate |
|
staticconstexprprivate |
Interrupt Clear-Pending Registers, n = 0-31, but n=0 is Reserved
|
staticconstexprprivate |
|
staticconstexprprivate |
Interrupt Group Registers, n = 0-31, but n=0 is Reserved
|
staticconstexprprivate |
|
staticconstexprprivate |
|
staticconstexprprivate |
Interrupt Priority Registers, n = 0-255, but n=0-7 are Reserved when affinity routing is enabled
|
staticconstexprprivate |
|
staticconstexprprivate |
|
staticconstexprprivate |
|
staticconstexprprivate |
|
staticconstexprprivate |
|
staticconstexprprivate |
Interrupt Set-Enable Registers, n = 0-31, but n=0 is Reserved
|
staticconstexprprivate |
|
staticconstexprprivate |
|
staticconstexprprivate |
Interrupt Processor Targets Registers, n = 0 - 254
|
staticconstexprprivate |
|
staticconstexprprivate |
|
staticconstexprprivate |
|
staticconstexprprivate |
|
staticconstexprprivate |
|
staticconstexprprivate |
|
staticconstexprprivate |
|
staticconstexprprivate |
|
staticconstexprprivate |
|
staticconstexprprivate |
|
staticconstexprprivate |
|
staticconstexprprivate |
|
staticconstexprprivate |
|
staticconstexprprivate |
|
staticconstexprprivate |
|
staticconstexprprivate |
|
staticconstexprprivate |