summaryrefslogtreecommitdiffstats
path: root/osunixxf.c
diff options
context:
space:
mode:
authorjkim <jkim@FreeBSD.org>2010-07-06 17:18:05 +0000
committerjkim <jkim@FreeBSD.org>2010-07-06 17:18:05 +0000
commit9ef1b91c0f59a1a15565c354b3e372ab265c7b5a (patch)
tree514e3ade7be23ac83127870abf009b5e5ae1d36f /osunixxf.c
parentd54ec0eced2867779a0ed7f3c8043be7a3325934 (diff)
downloadFreeBSD-src-9ef1b91c0f59a1a15565c354b3e372ab265c7b5a.zip
FreeBSD-src-9ef1b91c0f59a1a15565c354b3e372ab265c7b5a.tar.gz
Import ACPICA 20100702.
Diffstat (limited to 'osunixxf.c')
-rw-r--r--osunixxf.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/osunixxf.c b/osunixxf.c
index b457745..70f69c9 100644
--- a/osunixxf.c
+++ b/osunixxf.c
@@ -117,6 +117,8 @@
/*
* These interfaces are required in order to compile the ASL compiler under
* Linux or other Unix-like system.
+ *
+ * Note: Use #define __APPLE__ for OS X generation.
*/
#include <stdio.h>
@@ -126,6 +128,7 @@
#include <sys/time.h>
#include <semaphore.h>
#include <pthread.h>
+#include <errno.h>
#include "acpi.h"
#include "accommon.h"
@@ -528,8 +531,15 @@ AcpiOsCreateSemaphore (
return (AE_BAD_PARAMETER);
}
- Sem = AcpiOsAllocate (sizeof (sem_t));
+#ifdef __APPLE__
+ Sem = sem_open (tmpnam (NULL), O_EXCL|O_CREAT, 0755, InitialUnits);
+ if (!Sem)
+ {
+ return (AE_NO_MEMORY);
+ }
+#else
+ Sem = AcpiOsAllocate (sizeof (sem_t));
if (!Sem)
{
return (AE_NO_MEMORY);
@@ -540,6 +550,7 @@ AcpiOsCreateSemaphore (
AcpiOsFree (Sem);
return (AE_BAD_PARAMETER);
}
+#endif
*OutHandle = (ACPI_HANDLE) Sem;
return (AE_OK);
OpenPOWER on IntegriCloud