MCPcopy Create free account
hub / github.com/Simple-XX/SimpleKernel / InterruptInit

Function InterruptInit

src/arch/aarch64/interrupt_main.cpp:180–203  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

178}
179
180auto InterruptInit(int, const char**) -> void {
181 InterruptSingleton::create();
182
183 cpu_io::VBAR_EL1::Write(reinterpret_cast<uint64_t>(vector_table));
184
185 auto uart_intid =
186 KernelFdtSingleton::instance().GetAarch64Intid("arm,pl011").value() +
187 Gic::kSpiBase;
188
189 klog::Info("uart_intid: {}", uart_intid);
190
191 // 通过统一接口注册 UART 外部中断(先注册 handler,再启用 GIC SPI)
192 InterruptSingleton::instance()
193 .RegisterExternalInterrupt(uart_intid, cpu_io::GetCurrentCoreId(), 0,
194 InterruptDelegate::create<uart_handler>())
195 .or_else([](Error err) -> Expected<void> {
196 klog::Err("Failed to register UART IRQ: {}", err.message());
197 return std::unexpected(err);
198 });
199
200 cpu_io::EnableInterrupt();
201
202 klog::Info("Hello InterruptInit");
203}
204
205auto InterruptInitSMP(int, const char**) -> void {
206 cpu_io::VBAR_EL1::Write(reinterpret_cast<uint64_t>(vector_table));

Callers

nothing calls this directly

Calls 8

WriteFunction · 0.85
InfoFunction · 0.85
GetCurrentCoreIdFunction · 0.85
ErrFunction · 0.85
EnableInterruptFunction · 0.85
GetAarch64IntidMethod · 0.80
messageMethod · 0.80

Tested by

no test coverage detected