aboutsummaryrefslogtreecommitdiff
path: root/os_specific/service_layers/osunixxf.c
diff options
context:
space:
mode:
Diffstat (limited to 'os_specific/service_layers/osunixxf.c')
-rw-r--r--os_specific/service_layers/osunixxf.c120
1 files changed, 62 insertions, 58 deletions
diff --git a/os_specific/service_layers/osunixxf.c b/os_specific/service_layers/osunixxf.c
index 434e5fe1a41e..2ad9780ef42c 100644
--- a/os_specific/service_layers/osunixxf.c
+++ b/os_specific/service_layers/osunixxf.c
@@ -48,6 +48,12 @@
*
* Note: Use #define __APPLE__ for OS X generation.
*/
+#include "acpi.h"
+#include "accommon.h"
+#include "amlcode.h"
+#include "acparser.h"
+#include "acdebug.h"
+
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
@@ -57,12 +63,6 @@
#include <pthread.h>
#include <errno.h>
-#include "acpi.h"
-#include "accommon.h"
-#include "amlcode.h"
-#include "acparser.h"
-#include "acdebug.h"
-
#define _COMPONENT ACPI_OS_SERVICES
ACPI_MODULE_NAME ("osunixxf")
@@ -815,39 +815,6 @@ AcpiOsRemoveInterruptHandler (
/******************************************************************************
*
- * FUNCTION: AcpiOsExecute
- *
- * PARAMETERS: Type - Type of execution
- * Function - Address of the function to execute
- * Context - Passed as a parameter to the function
- *
- * RETURN: Status.
- *
- * DESCRIPTION: Execute a new thread
- *
- *****************************************************************************/
-
-ACPI_STATUS
-AcpiOsExecute (
- ACPI_EXECUTE_TYPE Type,
- ACPI_OSD_EXEC_CALLBACK Function,
- void *Context)
-{
- pthread_t thread;
- int ret;
-
-
- ret = pthread_create (&thread, NULL, (PTHREAD_CALLBACK) Function, Context);
- if (ret)
- {
- AcpiOsPrintf("Create thread failed");
- }
- return (0);
-}
-
-
-/******************************************************************************
- *
* FUNCTION: AcpiOsStall
*
* PARAMETERS: microseconds - Time to sleep
@@ -1154,6 +1121,43 @@ AcpiOsWritable (
/******************************************************************************
*
+ * FUNCTION: AcpiOsSignal
+ *
+ * PARAMETERS: Function - ACPI CA signal function code
+ * Info - Pointer to function-dependent structure
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Miscellaneous functions. Example implementation only.
+ *
+ *****************************************************************************/
+
+ACPI_STATUS
+AcpiOsSignal (
+ UINT32 Function,
+ void *Info)
+{
+
+ switch (Function)
+ {
+ case ACPI_SIGNAL_FATAL:
+ break;
+
+ case ACPI_SIGNAL_BREAKPOINT:
+ break;
+
+ default:
+ break;
+ }
+
+ return (AE_OK);
+}
+
+/* Optional multi-thread support */
+
+#ifndef ACPI_SINGLE_THREADED
+/******************************************************************************
+ *
* FUNCTION: AcpiOsGetThreadId
*
* PARAMETERS: None
@@ -1175,34 +1179,34 @@ AcpiOsGetThreadId (
/******************************************************************************
*
- * FUNCTION: AcpiOsSignal
+ * FUNCTION: AcpiOsExecute
*
- * PARAMETERS: Function - ACPI CA signal function code
- * Info - Pointer to function-dependent structure
+ * PARAMETERS: Type - Type of execution
+ * Function - Address of the function to execute
+ * Context - Passed as a parameter to the function
*
- * RETURN: Status
+ * RETURN: Status.
*
- * DESCRIPTION: Miscellaneous functions. Example implementation only.
+ * DESCRIPTION: Execute a new thread
*
*****************************************************************************/
ACPI_STATUS
-AcpiOsSignal (
- UINT32 Function,
- void *Info)
+AcpiOsExecute (
+ ACPI_EXECUTE_TYPE Type,
+ ACPI_OSD_EXEC_CALLBACK Function,
+ void *Context)
{
+ pthread_t thread;
+ int ret;
- switch (Function)
- {
- case ACPI_SIGNAL_FATAL:
- break;
-
- case ACPI_SIGNAL_BREAKPOINT:
- break;
- default:
- break;
+ ret = pthread_create (&thread, NULL, (PTHREAD_CALLBACK) Function, Context);
+ if (ret)
+ {
+ AcpiOsPrintf("Create thread failed");
}
-
- return (AE_OK);
+ return (0);
}
+
+#endif /* ACPI_SINGLE_THREADED */