[FOSS_TLK]kernel: task: Remove dependencies on task loading
Sharif Inamdar [Wed, 18 Feb 2015 10:39:13 +0000 (15:39 +0530)]
Previously, atleast one TA has to be present in order
for android to boot properly with TLK.

Now, if there is no TA that is loaded, we will then
skip the task initialization phase.

Change-Id: I68144f49e02d9162cd245b88fc87e474cd69936a
Signed-off-by: Sharif Inamdar <isharif@nvidia.com>
Reviewed-on: http://git-master/r/715782
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Varun Wadekar <vwadekar@nvidia.com>
Tested-by: Varun Wadekar <vwadekar@nvidia.com>

kernel/task.c

index d1c51cb..89589df 100644 (file)
@@ -875,7 +875,12 @@ void task_early_init()
 
        ASSERT(!((uint32_t)task_image_start & PAGE_MASK));
 
-       task_bootloader();
+       /*
+        * If there is no TAs that are loaded, we will then skip the
+        * task initialization phase
+        */
+       if (task_image_size != 0)
+               task_bootloader();
 }
 
 status_t task_init_one_task(task_t *task)
@@ -985,6 +990,13 @@ void task_init()
 
        list_initialize(&task_list);
 
+       /*
+        * If there is no TAs that are loaded, we will then skip the
+        * task initialization phase
+        */
+       if (task_next_index == 0)
+               return;
+
        /* convert the boot time task_blist into a run-time task_list */
 
        for (i = 0, task = task_blist; i < task_next_index; i++, task++) {