cpu-hotplug: Add the function 'cpu_hotplug_inprogress'

Allows a caller to detect whether a cpu hotplug operation
is in progress. This is useful for optimizing code paths
based on this condition.

Signed-off-by: Maya Spivak <mspivak@codeaurora.org>
diff --git a/kernel/cpu.c b/kernel/cpu.c
index 4047707..ad7eaf2 100644
--- a/kernel/cpu.c
+++ b/kernel/cpu.c
@@ -123,6 +123,14 @@
 	mutex_unlock(&cpu_hotplug.lock);
 }
 
+bool cpu_hotplug_inprogress(void)
+{
+	if (cpu_hotplug.active_writer)
+		return true;
+
+	return false;
+}
+
 #else /* #if CONFIG_HOTPLUG_CPU */
 static void cpu_hotplug_begin(void) {}
 static void cpu_hotplug_done(void) {}