>From 9eaa22059450256626e57aa4aed270f70441131a Mon Sep 17 00:00:00 2001
From: Joel Sherrill <joel.sherrill@oarcorp.com>
Date: Mon, 16 Apr 2012 16:12:43 -0500
Subject: [PATCH 1/2] Add rtems_configuration_are_any_initialization_tasks_fp()

This method provides a clean way to determine if any of the configured
initialization tasks or threads across any configured API will require
floating point.
---
 cpukit/sapi/include/rtems/config.h      |    2 +
 cpukit/sapi/src/config_anyfpinittasks.c |   37 +++++++++++++++++++++++++++++++
 2 files changed, 39 insertions(+), 0 deletions(-)
 create mode 100644 cpukit/sapi/src/config_anyfpinittasks.c

diff --git a/cpukit/sapi/include/rtems/config.h b/cpukit/sapi/include/rtems/config.h
index 407b19e..9c0a071 100644
--- a/cpukit/sapi/include/rtems/config.h
+++ b/cpukit/sapi/include/rtems/config.h
@@ -345,6 +345,8 @@ extern rtems_configuration_table    Configuration;
 #define rtems_configuration_get_posix_api_configuration() \
         (&Configuration_POSIX_API)
 
+bool rtems_configuration_are_any_initialization_tasks_fp(void);
+
 #ifdef __cplusplus
 }
 #endif
diff --git a/cpukit/sapi/src/config_anyfpinittasks.c b/cpukit/sapi/src/config_anyfpinittasks.c
new file mode 100644
index 0000000..eb28038
--- /dev/null
+++ b/cpukit/sapi/src/config_anyfpinittasks.c
@@ -0,0 +1,37 @@
+/*
+ *  COPYRIGHT (c) 1989-2012.
+ *  On-Line Applications Research Corporation (OAR).
+ *
+ *  The license and distribution terms for this file may be
+ *  found in the file LICENSE in this distribution or at
+ *  http://www.rtems.com/license/LICENSE.
+ */
+
+#if HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <rtems.h>
+#include <rtems/system.h>
+
+bool rtems_configuration_are_any_initialization_tasks_fp(void)
+{
+  rtems_api_configuration_table    *config;
+  rtems_initialization_tasks_table *tasks;
+  size_t                            i;
+
+  #if defined(RTEMS_POSIX_API)
+    if (Configuration_POSIX_API.User_initialization_threads_table != NULL ) {
+      return true;
+    }
+  #endif
+
+  config = &Configuration_RTEMS_API;
+  tasks = config->User_initialization_tasks_table;
+  for ( i = 0 ; i < config->number_of_initialization_tasks; i++ ) {
+    if ( (tasks[i].attribute_set & RTEMS_FLOATING_POINT) != 0 ) {
+      return true;
+    }
+  }
+  return false;
+}
-- 
1.7.1

