SPM: Record schedule attempt in PendSV if scheduler is locked
'ipc_schedule' checks scheduler_lock in backend and skips thread
switch if scheduler is locked. This makes thrd_next() futile
and wastes CPU resources.
Move scheduler_lock into architecture scope. The new scheduler
model on isolation level 1 is:
1. lock scheduler before entering crossing call
2. In SPM, if tfm_arch_trigger_pendsv is called, record
the trigger attempt.
3. At the end of crossing call exiting, unlock scheduler and
check the state of schduler_lock. If it equals SCHEDULER_ATTEMPTED,
trigger PendSV.
The change checks the need of scheduler in advance to save the
resources.
Signed-off-by: Jianliang Shen <jianliang.shen@arm.com>
Change-Id: I27c530993fcf16592ac826c565de8c2083cf742e
7 files changed