refactor(xlat): add several refactorizations to the xlat library
This patch includes a number of refactorizations of the xlat library in
order to facilitate the implementation of unittests for the library.
Amongst the improvements there are:
* Macros to allocate and initialize the translation tables as well
as the translation context structures have been removed and
replaced with library APIs.
* Some of the library APIs have been collapsed, reducing the size
of the overall interface and presenting a more compact API to
the consumer.
* The distinction between the translation base tables and the
intermediate tables have been removed, presenting now a single
array of tables for the whole translation context.
The patch also adapts the rest of RMM to use the new library API.
Signed-off-by: Javier Almansa Sobrino <javier.almansasobrino@arm.com>
Change-Id: I2fb486c0c5bc005446b09e3fef5e7de9bf0efda0
diff --git a/lib/realm/include/buffer.h b/lib/realm/include/buffer.h
index 7fc4187..7cb0a39 100644
--- a/lib/realm/include/buffer.h
+++ b/lib/realm/include/buffer.h
@@ -56,18 +56,27 @@
/*
* Initializes and enables the VMSA for the slot buffer mechanism.
*
- * Create an empty translation context for the current CPU.
- * If the context already exists (e.g. current CPU was previously
+ * Create an empty translation context for the current PE.
+ * If the context already exists (e.g. current PE was previously
* turned on and therefore the context is already in memory),
* nothing happens.
*/
void slot_buf_setup_xlat(void);
/*
- * Finishes initializing the slot buffer mechanism.
- * This function should be called after the MMU is enabled.
+ * Initializes the slot buffer components common to all PEs. This function
+ * must only be called once during cold boot initialization.
+ *
+ * Returns 0 on success and a negative POSIX error code otherwise.
*/
-void slot_buf_init(void);
+int slot_buf_coldboot_init(void);
+
+/*
+ * Finishes initializing the slot buffer mechanism.
+ * This function should be called after the MMU is enabled, during the
+ * warmboot path.
+ */
+void slot_buf_finish_warmboot_init(void);
/******************************************************************************
* Internal APIs not meant to be invoked by generic RMM code.