Skip to content

Commit c97ce05

Browse files
miguelafsilva5josecm
authored andcommitted
feat(phys-irqs): add support to physical interrupts
Architectures that use hardware IRQs need to have the IPC interrupts assigned to the correct VM. Signed-off-by: Miguel Silva <[email protected]>
1 parent 36d16d5 commit c97ce05

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,9 @@ endif
204204
ifeq ($(plat_mem),non_unified)
205205
build_macros+=-DMEM_NON_UNIFIED
206206
endif
207+
ifeq ($(phys_irqs_only),y)
208+
build_macros+=-DPHYS_IRQS_ONLY
209+
endif
207210

208211
ifeq ($(CC_IS_GCC),y)
209212
build_macros+=-DCC_IS_GCC

src/core/vm.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,14 @@ static void vm_init_ipc(struct vm* vm, const struct vm_config* vm_config)
182182
WARNING("Trying to map region to smaller shared memory. Truncated");
183183
}
184184

185+
if (DEFINED(PHYS_IRQS_ONLY)) {
186+
for (size_t j = 0; j < ipc->interrupt_num; j++) {
187+
if (!interrupts_vm_assign(vm, ipc->interrupts[j])) {
188+
ERROR("Failed to assign interrupt id %d", ipc->interrupts[j]);
189+
}
190+
}
191+
}
192+
185193
spin_lock(&shmem->lock);
186194
shmem->cpu_masters |= (1UL << cpu()->id);
187195
spin_unlock(&shmem->lock);

0 commit comments

Comments
 (0)