Cactus: Refactor handling of commands

Added helper macros to define a command handler, build a command table
in which each element is a pair of the handler and respective command
ID.
Message loop has been refactored to traverse the command table looking
for the ID, and to call the respective command handler.
Available tests have been moved to their own command handler.

Signed-off-by: J-Alves <joao.alves@arm.com>
Change-Id: I38a50a8d47b083c81c21950d98341de660891c61
diff --git a/spm/cactus/cactus.ld.S b/spm/cactus/cactus.ld.S
index 11b28ba..50fc576 100644
--- a/spm/cactus/cactus.ld.S
+++ b/spm/cactus/cactus.ld.S
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017-2020, Arm Limited. All rights reserved.
+ * Copyright (c) 2017-2021, Arm Limited. All rights reserved.
  *
  * SPDX-License-Identifier: BSD-3-Clause
  */
@@ -52,6 +52,10 @@
         . = ALIGN(PAGE_SIZE);
         __DATA_START__ = .;
         *(.data*)
+        . = ALIGN(PAGE_SIZE);
+        cactus_cmd_handler_begin = .;
+        KEEP(*(.cactus_handler))
+        cactus_cmd_handler_end = .;
         . = NEXT(PAGE_SIZE);
         __DATA_END__ = .;
     }