Skip to content
Commit 4e825f57 authored by Conor Paxton's avatar Conor Paxton Committed by Carles Cufí
Browse files

drivers: intc_plic: enable contexts for all harts on a platform



The plic uses contexts to seperate irq enables, threshold priority and
claim complete registers from each core for a given platform. As well as
this, each privilege level has its own context.
for multi-core platform's, we need to be able to enable/ disable a
global interrupt for all the cores that are associated with Zephyr.

To do this, we need to make some assumptions:
1. The privilege contexts are contiguous
2. M mode context is first, followed by S mode.

We know how many cpus are used in an application and each cpu's hartid,
thanks to some very handy inline functions. So we iterate through each
cpu and use the hartid of a cpu in the calculation of the context.

While we are at it, In an effort to make the driver more readable,
allign with the macro naming convention outlined in Linux's PLIC driver

Signed-off-by: default avatarConor Paxton <conor.paxton@microchip.com>
parent 3650537a
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment