MLECO-3070: Further HAL cleanup.

Cleaning up HAL sources by removing unnecessary redirections
with function pointers. The "platform packages" under HAL are
now streamlined enough to not need any major HAL wrapping (as
was the case before).

This allows us to have a very thin HAL layer that sits on top
of the platform and compnent packs. Also helps in getting rid
of "hal platform" pointer being passed around in the code to
use any HAL functionality.

Change-Id: I04b2057f972aad7a5cfb4a396bcdf147c9f9ef1c
Signed-off-by: Kshitij Sisodia <kshitij.sisodia@arm.com>
diff --git a/source/use_case/ad/src/MainLoop.cc b/source/use_case/ad/src/MainLoop.cc
index e858320..23d1e51 100644
--- a/source/use_case/ad/src/MainLoop.cc
+++ b/source/use_case/ad/src/MainLoop.cc
@@ -45,7 +45,7 @@
 }
 
 
-void main_loop(hal_platform& platform)
+void main_loop()
 {
     arm::app::AdModel model;  /* Model wrapper object. */
 
@@ -59,9 +59,8 @@
     /* Instantiate application context. */
     arm::app::ApplicationContext caseContext;
 
-    arm::app::Profiler profiler{&platform, "ad"};
+    arm::app::Profiler profiler{"ad"};
     caseContext.Set<arm::app::Profiler&>("profiler", profiler);
-    caseContext.Set<hal_platform&>("platform", platform);
     caseContext.Set<arm::app::Model&>("model", model);
     caseContext.Set<uint32_t>("clipIndex", 0);
     caseContext.Set<int>("frameLength", g_FrameLength);
diff --git a/source/use_case/asr/src/MainLoop.cc b/source/use_case/asr/src/MainLoop.cc
index 058211a..51b0b18 100644
--- a/source/use_case/asr/src/MainLoop.cc
+++ b/source/use_case/asr/src/MainLoop.cc
@@ -65,7 +65,7 @@
 static uint32_t GetOutputInnerLen(const arm::app::Model& model,
                                   uint32_t outputCtxLen);
 
-void main_loop(hal_platform& platform)
+void main_loop()
 {
     arm::app::Wav2LetterModel model;  /* Model wrapper object. */
 
@@ -99,9 +99,8 @@
     GetLabelsVector(labels);
     arm::app::AsrClassifier classifier;  /* Classifier wrapper object. */
 
-    arm::app::Profiler profiler{&platform, "asr"};
+    arm::app::Profiler profiler{"asr"};
     caseContext.Set<arm::app::Profiler&>("profiler", profiler);
-    caseContext.Set<hal_platform&>("platform", platform);
     caseContext.Set<arm::app::Model&>("model", model);
     caseContext.Set<uint32_t>("clipIndex", 0);
     caseContext.Set<uint32_t>("frameLength", g_FrameLength);
diff --git a/source/use_case/img_class/src/MainLoop.cc b/source/use_case/img_class/src/MainLoop.cc
index 7b67a19..d9fb925 100644
--- a/source/use_case/img_class/src/MainLoop.cc
+++ b/source/use_case/img_class/src/MainLoop.cc
@@ -25,7 +25,7 @@
 
 using ImgClassClassifier = arm::app::Classifier;
 
-void main_loop(hal_platform& platform)
+void main_loop()
 {
     arm::app::MobileNetModel model;  /* Model wrapper object. */
 
@@ -38,9 +38,8 @@
     /* Instantiate application context. */
     arm::app::ApplicationContext caseContext;
 
-    arm::app::Profiler profiler{&platform, "img_class"};
+    arm::app::Profiler profiler{"img_class"};
     caseContext.Set<arm::app::Profiler&>("profiler", profiler);
-    caseContext.Set<hal_platform&>("platform", platform);
     caseContext.Set<arm::app::Model&>("model", model);
     caseContext.Set<uint32_t>("imgIndex", 0);
 
diff --git a/source/use_case/inference_runner/src/MainLoop.cc b/source/use_case/inference_runner/src/MainLoop.cc
index cfdc520..ddff40c 100644
--- a/source/use_case/inference_runner/src/MainLoop.cc
+++ b/source/use_case/inference_runner/src/MainLoop.cc
@@ -26,7 +26,7 @@
     MENU_OPT_SHOW_MODEL_INFO,        /* Show model info. */
 };
 
-void main_loop(hal_platform& platform)
+void main_loop()
 {
     arm::app::TestModel model;  /* Model wrapper object. */
 
@@ -39,10 +39,8 @@
     /* Instantiate application context. */
     arm::app::ApplicationContext caseContext;
 
-    arm::app::Profiler profiler{&platform, "inference_runner"};
+    arm::app::Profiler profiler{"inference_runner"};
     caseContext.Set<arm::app::Profiler&>("profiler", profiler);
-
-    caseContext.Set<hal_platform&>("platform", platform);
     caseContext.Set<arm::app::Model&>("model", model);
     caseContext.Set<uint32_t>("imgIndex", 0);
 
diff --git a/source/use_case/kws/src/MainLoop.cc b/source/use_case/kws/src/MainLoop.cc
index 76dff8c..e590c4a 100644
--- a/source/use_case/kws/src/MainLoop.cc
+++ b/source/use_case/kws/src/MainLoop.cc
@@ -48,7 +48,7 @@
     fflush(stdout);
 }
 
-void main_loop(hal_platform& platform)
+void main_loop()
 {
     arm::app::MicroNetKwsModel model;  /* Model wrapper object. */
 
@@ -61,10 +61,8 @@
     /* Instantiate application context. */
     arm::app::ApplicationContext caseContext;
 
-    arm::app::Profiler profiler{&platform, "kws"};
+    arm::app::Profiler profiler{"kws"};
     caseContext.Set<arm::app::Profiler&>("profiler", profiler);
-
-    caseContext.Set<hal_platform&>("platform", platform);
     caseContext.Set<arm::app::Model&>("model", model);
     caseContext.Set<uint32_t>("clipIndex", 0);
     caseContext.Set<int>("frameLength", g_FrameLength);
diff --git a/source/use_case/kws_asr/src/MainLoop.cc b/source/use_case/kws_asr/src/MainLoop.cc
index 096c966..5c1d0e0 100644
--- a/source/use_case/kws_asr/src/MainLoop.cc
+++ b/source/use_case/kws_asr/src/MainLoop.cc
@@ -67,7 +67,7 @@
 static uint32_t GetOutputInnerLen(const arm::app::Model& model,
                                   uint32_t outputCtxLen);
 
-void main_loop(hal_platform& platform)
+void main_loop()
 {
     /* Model wrapper objects. */
     arm::app::MicroNetKwsModel kwsModel;
@@ -104,10 +104,8 @@
     /* Instantiate application context. */
     arm::app::ApplicationContext caseContext;
 
-    arm::app::Profiler profiler{&platform, "kws_asr"};
+    arm::app::Profiler profiler{"kws_asr"};
     caseContext.Set<arm::app::Profiler&>("profiler", profiler);
-
-    caseContext.Set<hal_platform&>("platform", platform);
     caseContext.Set<arm::app::Model&>("kwsmodel", kwsModel);
     caseContext.Set<arm::app::Model&>("asrmodel", asrModel);
     caseContext.Set<uint32_t>("clipIndex", 0);
diff --git a/source/use_case/noise_reduction/src/MainLoop.cc b/source/use_case/noise_reduction/src/MainLoop.cc
index bcaff6d..5fd7823 100644
--- a/source/use_case/noise_reduction/src/MainLoop.cc
+++ b/source/use_case/noise_reduction/src/MainLoop.cc
@@ -56,7 +56,7 @@
     return true;
 }
 
-void main_loop(hal_platform& platform)
+void main_loop()
 {
     arm::app::RNNoiseModel model;  /* Model wrapper object. */
 
@@ -71,10 +71,8 @@
     /* Instantiate application context. */
     arm::app::ApplicationContext caseContext;
 
-    arm::app::Profiler profiler{&platform, "noise_reduction"};
+    arm::app::Profiler profiler{"noise_reduction"};
     caseContext.Set<arm::app::Profiler&>("profiler", profiler);
-
-    caseContext.Set<hal_platform&>("platform", platform);
     caseContext.Set<uint32_t>("numInputFeatures", g_NumInputFeatures);
     caseContext.Set<uint32_t>("frameLength", g_FrameLength);
     caseContext.Set<uint32_t>("frameStride", g_FrameStride);
diff --git a/source/use_case/object_detection/src/MainLoop.cc b/source/use_case/object_detection/src/MainLoop.cc
index 0f98c8a..acfc195 100644
--- a/source/use_case/object_detection/src/MainLoop.cc
+++ b/source/use_case/object_detection/src/MainLoop.cc
@@ -36,7 +36,7 @@
     fflush(stdout);
 }
 
-void main_loop(hal_platform& platform)
+void main_loop()
 {
     arm::app::YoloFastestModel model;  /* Model wrapper object. */
 
@@ -49,9 +49,8 @@
     /* Instantiate application context. */
     arm::app::ApplicationContext caseContext;
 
-    arm::app::Profiler profiler{&platform, "object_detection"};
+    arm::app::Profiler profiler{"object_detection"};
     caseContext.Set<arm::app::Profiler&>("profiler", profiler);
-    caseContext.Set<hal_platform&>("platform", platform);
     caseContext.Set<arm::app::Model&>("model", model);
     caseContext.Set<uint32_t>("imgIndex", 0);
     arm::app::object_detection::DetectorPostprocessing postp;
diff --git a/source/use_case/vww/src/MainLoop.cc b/source/use_case/vww/src/MainLoop.cc
index 03d6196..041ea18 100644
--- a/source/use_case/vww/src/MainLoop.cc
+++ b/source/use_case/vww/src/MainLoop.cc
@@ -25,7 +25,7 @@
 
 using ViusalWakeWordClassifier = arm::app::Classifier;
 
-void main_loop(hal_platform &platform)
+void main_loop()
 {
     arm::app::VisualWakeWordModel model;  /* Model wrapper object. */
 
@@ -38,9 +38,8 @@
     /* Instantiate application context. */
     arm::app::ApplicationContext caseContext;
 
-    arm::app::Profiler profiler{&platform, "vww"};
+    arm::app::Profiler profiler{"vww"};
     caseContext.Set<arm::app::Profiler&>("profiler", profiler);
-    caseContext.Set<hal_platform&>("platform", platform);
     caseContext.Set<arm::app::Model&>("model", model);
     caseContext.Set<uint32_t>("imgIndex", 0);