mirror of
https://github.com/ARM-software/arm-trusted-firmware.git
synced 2025-04-28 08:08:45 +00:00

Change-Id: I0bb5aca9bb272332340b5baefc473a01f8a27896 Signed-off-by: John Tsichritzis <john.tsichritzis@arm.com>
28 lines
717 B
C
28 lines
717 B
C
/*
|
|
* Copyright (c) 2018, ARM Limited and Contributors. All rights reserved.
|
|
*
|
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
*/
|
|
|
|
#include <cortex_ares.h>
|
|
#include <cpuamu.h>
|
|
#include <lib/el3_runtime/pubsub_events.h>
|
|
|
|
static void *cortex_ares_context_save(const void *arg)
|
|
{
|
|
if (midr_match(CORTEX_ARES_MIDR) != 0)
|
|
cpuamu_context_save(CORTEX_ARES_AMU_NR_COUNTERS);
|
|
|
|
return (void *)0;
|
|
}
|
|
|
|
static void *cortex_ares_context_restore(const void *arg)
|
|
{
|
|
if (midr_match(CORTEX_ARES_MIDR) != 0)
|
|
cpuamu_context_restore(CORTEX_ARES_AMU_NR_COUNTERS);
|
|
|
|
return (void *)0;
|
|
}
|
|
|
|
SUBSCRIBE_TO_EVENT(psci_suspend_pwrdown_start, cortex_ares_context_save);
|
|
SUBSCRIBE_TO_EVENT(psci_suspend_pwrdown_finish, cortex_ares_context_restore);
|