summaryrefslogtreecommitdiff
path: root/framework
diff options
context:
space:
mode:
authorAntonio Nino Diaz <antonio.ninodiaz@arm.com>2017-11-17 16:58:33 +0000
committerSandrine Bailleux <sandrine.bailleux@arm.com>2017-11-23 10:48:52 +0000
commit82dd66df3e2e23cc2e7e227cb90ff94cffccf9f1 (patch)
tree1ee18be6a93458b511875553a9d88cb52ffc2b67 /framework
parenta4090b5754a7f448db8cca4274946fd18e9c9c13 (diff)
Ensure that PSTATE is updated right after a change
It is needed to add a isb after modifying PSTATE.{D,A,I,F} so that the effects are seen immediately. For example, this is useful to make sure that pending interrupt are handled as soon as the interrupts are enabled. Some definitions in `include/lib/aarch64/arch_helpers.h` have been moved inside the file so that isb() is defined before it is used. This commit makes it unnecesary to have a isb() after any of the functions modified by this file, so all isb() after them have been removed across the whole codebase. The fact that the old version of the functions needed a isb() made it easy to introduce bugs, as it was easy to forget about the isb(). There are some cases in the codebase as well, that are now fixed. Change-Id: If9f9335f8889f2e23900307eb6a6236143577e10 Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
Diffstat (limited to 'framework')
-rw-r--r--framework/main.c1
-rw-r--r--framework/timer/timer_framework.c4
2 files changed, 0 insertions, 5 deletions
diff --git a/framework/main.c b/framework/main.c
index b5b0182..5a032c7 100644
--- a/framework/main.c
+++ b/framework/main.c
@@ -538,7 +538,6 @@ void __dead2 tftf_cold_boot_main(void)
/* Enable the SGI used by the timer management framework */
tftf_irq_enable(IRQ_WAKE_SGI, GIC_HIGHEST_NS_PRIORITY);
enable_irq();
- isb();
if (new_test_session()) {
NOTICE("Starting a new test session\n");
diff --git a/framework/timer/timer_framework.c b/framework/timer/timer_framework.c
index 90073ec..fd44aa3 100644
--- a/framework/timer/timer_framework.c
+++ b/framework/timer/timer_framework.c
@@ -179,7 +179,6 @@ int tftf_program_timer(unsigned long time_out_ms)
flags = read_daif();
disable_irq();
- isb();
spin_lock(&timer_lock);
assert((current_prog_core < PLATFORM_CORE_COUNT) ||
@@ -240,7 +239,6 @@ int tftf_program_timer_and_suspend(unsigned long milli_secs,
/* Preserve DAIF flags. IRQs need to be disabled for this to work. */
flags = read_daif();
disable_irq();
- isb();
/*
* Even with IRQs masked, the timer IRQ will wake the CPU up.
@@ -293,7 +291,6 @@ int tftf_program_timer_and_sys_suspend(unsigned long milli_secs,
/* Preserve DAIF flags. IRQs need to be disabled for this to work. */
flags = read_daif();
disable_irq();
- isb();
/*
* Even with IRQs masked, the timer IRQ will wake the CPU up.
@@ -368,7 +365,6 @@ int tftf_cancel_timer(void)
*/
flags = read_daif();
disable_irq();
- isb();
spin_lock(&timer_lock);
interrupt_req_time[core_pos] = INVALID_TIME;