From 6c0b45d1ceb13cb409f8d62d712d6f0c44feab6c Mon Sep 17 00:00:00 2001 From: Andrew Thoelke Date: Fri, 20 Jun 2014 00:36:14 +0100 Subject: Correctly dimension the PSCI aff_map_node array The array of affinity nodes is currently allocated for 32 entries with the PSCI_NUM_AFFS value defined in psci.h. This is not enough for large systems, and will substantially over allocate the array for small systems. This patch introduces an optional platform definition PLATFORM_NUM_AFFS to platform_def.h. If defined this value is used for PSCI_NUM_AFFS, otherwise a value of two times the number of CPU cores is used. The FVP port defines PLATFORM_NUM_AFFS to be 10 which saves nearly 1.5KB of memory. Fixes ARM-software/tf-issues#192 Change-Id: I68e30ac950de88cfbd02982ba882a18fb69c1445 --- services/std_svc/psci/psci_private.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'services/std_svc/psci/psci_private.h') diff --git a/services/std_svc/psci/psci_private.h b/services/std_svc/psci/psci_private.h index 08a4a34a..f5340874 100644 --- a/services/std_svc/psci/psci_private.h +++ b/services/std_svc/psci/psci_private.h @@ -33,8 +33,16 @@ #include #include +#include /* for PLATFORM_NUM_AFFS */ #include +/* Number of affinity instances whose state this psci imp. can track */ +#ifdef PLATFORM_NUM_AFFS +#define PSCI_NUM_AFFS PLATFORM_NUM_AFFS +#else +#define PSCI_NUM_AFFS (2 * PLATFORM_CORE_COUNT) +#endif + /******************************************************************************* * The following two data structures hold the topology tree which in turn tracks * the state of the all the affinity instances supported by the platform. -- cgit