kernel/arm64: reuse existing GICv2 driver
Change-Id: I68d6978d1f4c3bf8d5d53674f794948a9771729b Reviewed-on: https://review.haiku-os.org/c/haiku/+/5276 Tested-by: Commit checker robot <[email protected]> Reviewed-by: Adrien Destugues <[email protected]>
This commit is contained in:
@@ -23,7 +23,7 @@ KernelMergeObject kernel_arch_arm64.o :
|
|||||||
arch_real_time_clock.cpp
|
arch_real_time_clock.cpp
|
||||||
arch_platform.cpp
|
arch_platform.cpp
|
||||||
arch_asm.S
|
arch_asm.S
|
||||||
|
arch_int_gicv2.cpp
|
||||||
soc.cpp
|
soc.cpp
|
||||||
|
|
||||||
VMSAv8TranslationMap.cpp
|
VMSAv8TranslationMap.cpp
|
||||||
|
|||||||
@@ -24,6 +24,7 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#include "soc.h"
|
#include "soc.h"
|
||||||
|
#include "arch_int_gicv2.h"
|
||||||
|
|
||||||
#define TRACE_ARCH_INT
|
#define TRACE_ARCH_INT
|
||||||
#ifdef TRACE_ARCH_INT
|
#ifdef TRACE_ARCH_INT
|
||||||
@@ -36,12 +37,18 @@
|
|||||||
void
|
void
|
||||||
arch_int_enable_io_interrupt(int irq)
|
arch_int_enable_io_interrupt(int irq)
|
||||||
{
|
{
|
||||||
|
InterruptController *ic = InterruptController::Get();
|
||||||
|
if (ic != NULL)
|
||||||
|
ic->EnableInterrupt(irq);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
arch_int_disable_io_interrupt(int irq)
|
arch_int_disable_io_interrupt(int irq)
|
||||||
{
|
{
|
||||||
|
InterruptController *ic = InterruptController::Get();
|
||||||
|
if (ic != NULL)
|
||||||
|
ic->DisableInterrupt(irq);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -64,6 +71,16 @@ arch_int_init(kernel_args *args)
|
|||||||
status_t
|
status_t
|
||||||
arch_int_init_post_vm(kernel_args *args)
|
arch_int_init_post_vm(kernel_args *args)
|
||||||
{
|
{
|
||||||
|
InterruptController *ic = NULL;
|
||||||
|
if (strcmp(args->arch_args.interrupt_controller.kind, INTC_KIND_GICV2) == 0) {
|
||||||
|
ic = new(std::nothrow) GICv2InterruptController(
|
||||||
|
args->arch_args.interrupt_controller.regs1.start,
|
||||||
|
args->arch_args.interrupt_controller.regs2.start);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ic == NULL)
|
||||||
|
return B_ERROR;
|
||||||
|
|
||||||
return B_OK;
|
return B_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user