feat(pmu): add PMU support for Realms
This patch adds support for using PMU in Realms.
It adds 'bool pmu_enabled' and 'unsigned int pmu_num_cnts'
variables in 'struct rd' and 'struct rec.realm_info'.
Signed-off-by: AlexeiFedorov <Alexei.Fedorov@arm.com>
Change-Id: I13aad600a0215ba66d25be12ede5f4b86e6b018a
diff --git a/lib/allocator/include/memory_alloc.h b/lib/allocator/include/memory_alloc.h
index 5346395..1ff2b9e 100644
--- a/lib/allocator/include/memory_alloc.h
+++ b/lib/allocator/include/memory_alloc.h
@@ -11,11 +11,15 @@
struct _memory_header;
typedef struct memory_header_s memory_header_t;
-/*
- * Number of pages per REC to be allocated. MbedTLS needs 8K of heap
- * for attestation usecases.
- */
+/* MbedTLS needs 8K of heap for attestation usecases */
#define REC_HEAP_PAGES 2
+#define REC_HEAP_SIZE (REC_HEAP_PAGES * SZ_4K)
+
+/* Number of pages per REC for PMU state */
+#define REC_PMU_PAGES 1
+
+/* Number of pages per REC to be allocated */
+#define REC_NUM_PAGES (REC_HEAP_PAGES + REC_PMU_PAGES)
struct buffer_alloc_ctx {
unsigned char *buf;
@@ -36,7 +40,6 @@
size_t magic2;
};
-
/*
* Function to assign a heap context to the current CPU for
* use by the MbedCrypto. In case the heap needs to be isolated