summaryrefslogtreecommitdiff
path: root/config
diff options
context:
space:
mode:
authorjoq <joq@0c269be4-1314-0410-8aa9-9f06e86f4224>2004-03-25 19:31:51 +0000
committerjoq <joq@0c269be4-1314-0410-8aa9-9f06e86f4224>2004-03-25 19:31:51 +0000
commit64930746f2920dd7bdfc6488920e21bc4decabbc (patch)
treef573097e610ff9814b66d5d211f834a094aaa5d6 /config
parent3ee51925deb1f644ae41dedfc8d3272012c65d45 (diff)
downloadjack1-64930746f2920dd7bdfc6488920e21bc4decabbc.tar.gz
[0.96.0] merge MacOSX EXP tree into HEAD
git-svn-id: svn+ssh://jackaudio.org/trunk/jack@673 0c269be4-1314-0410-8aa9-9f06e86f4224
Diffstat (limited to 'config')
-rw-r--r--config/.cvsignore10
-rw-r--r--config/Makefile.am14
-rw-r--r--config/acinclude.m441
-rw-r--r--config/configure.host159
-rw-r--r--config/cpu/alpha/atomicity.h76
-rw-r--r--config/cpu/alpha/cycles.h35
-rw-r--r--config/cpu/cris/atomicity.h78
-rw-r--r--config/cpu/generic/atomicity.h80
-rw-r--r--config/cpu/generic/cycles.h41
-rw-r--r--config/cpu/hppa/atomicity.h90
-rw-r--r--config/cpu/i386/atomicity.h76
-rw-r--r--config/cpu/i386/cycles.h24
-rw-r--r--config/cpu/i486/atomicity.h54
-rw-r--r--config/cpu/i486/cycles.h54
-rw-r--r--config/cpu/ia64/atomicity.h51
-rw-r--r--config/cpu/ia64/cycles.h36
-rw-r--r--config/cpu/ia64/ia64intrin.h130
-rw-r--r--config/cpu/m68k/atomicity.h139
-rw-r--r--config/cpu/mips/atomicity.h83
-rw-r--r--config/cpu/powerpc/atomicity.h78
-rw-r--r--config/cpu/powerpc/cycles.h55
-rw-r--r--config/cpu/s390/atomicity.h60
-rw-r--r--config/cpu/sparc/atomicity.h131
-rw-r--r--config/os/aix/atomicity.h59
-rw-r--r--config/os/generic/ipc.h28
-rw-r--r--config/os/generic/os_defines.h30
-rw-r--r--config/os/generic/poll.h28
-rw-r--r--config/os/generic/time.h42
-rw-r--r--config/os/gnu-linux/time.h97
-rw-r--r--config/os/irix/atomicity.h50
-rw-r--r--config/os/macosx/README183
-rw-r--r--config/os/macosx/fakepoll.h161
-rw-r--r--config/os/macosx/getopt.h22
-rw-r--r--config/os/macosx/ipc.h186
-rw-r--r--config/os/macosx/jack.xcode/project.pbxproj1326
-rw-r--r--config/os/macosx/mach_port.h35
-rw-r--r--config/os/macosx/os_defines.h39
-rw-r--r--config/os/macosx/pThreadUtilities.h203
-rw-r--r--config/os/macosx/poll.h29
-rw-r--r--config/os/macosx/portaudio.h28
-rw-r--r--config/os/macosx/time.h52
-rw-r--r--config/sysdeps/.cvsignore3
-rw-r--r--config/sysdeps/Makefile.am23
43 files changed, 4219 insertions, 0 deletions
diff --git a/config/.cvsignore b/config/.cvsignore
new file mode 100644
index 0000000..c0b20bc
--- /dev/null
+++ b/config/.cvsignore
@@ -0,0 +1,10 @@
+Makefile
+Makefile.in
+compile
+config.guess
+config.sub
+depcomp
+install-sh
+ltmain.sh
+missing
+mkinstalldirs
diff --git a/config/Makefile.am b/config/Makefile.am
new file mode 100644
index 0000000..64347d1
--- /dev/null
+++ b/config/Makefile.am
@@ -0,0 +1,14 @@
+# Currently, we don't actually build anything in the `cpu' and `os'
+# subdirectories. If we ever do, they will need Makefiles. For now,
+# this is sufficient. Unfortunately, their CVS subdirectories also
+# get distributed as a side-effect.
+
+EXTRA_DIST = configure.host depcomp cpu os
+MAINTAINERCLEANFILES = Makefile.in aclocal.m4 config.guess config.sub \
+ install-sh ltmain.sh missing mkinstalldirs
+
+# Link all relevant headers into the `sysdeps' directory. The order
+# of these loops determines header file precedence.
+
+SUBDIRS = sysdeps
+DIST_SUBDIRS = sysdeps
diff --git a/config/acinclude.m4 b/config/acinclude.m4
new file mode 100644
index 0000000..6a69887
--- /dev/null
+++ b/config/acinclude.m4
@@ -0,0 +1,41 @@
+dnl AS_AC_EXPAND(VAR, CONFIGURE_VAR)
+dnl example
+dnl AS_AC_EXPAND(SYSCONFDIR, $sysconfdir)
+dnl will set SYSCONFDIR to /usr/local/etc
+
+dnl written by thomas vander stichele
+
+AC_DEFUN(AS_AC_EXPAND,
+[
+ EXP_VAR=[$1]
+ FROM_VAR=[$2]
+
+ dnl first expand prefix and exec_prefix if necessary
+ prefix_save=$prefix
+ if test "x$prefix" = "xNONE"; then
+ prefix=/usr/local
+ fi
+ exec_prefix_save=$exec_prefix
+ if test "x$exec_prefix" = "xNONE"; then
+ if test "x$prefix_save" = "xNONE"; then
+ exec_prefix=/usr/local
+ else
+ exec_prefix=$prefix
+ fi
+ fi
+
+ full_var="$FROM_VAR"
+ dnl loop until it doesn't change anymore
+ while true; do
+ new_full_var="`eval echo $full_var`"
+ if test "x$new_full_var" = "x$full_var"; then break; fi
+ full_var=$new_full_var
+ done
+
+ dnl clean up
+ full_var=$new_full_var
+ [$1]=$full_var
+ prefix=$prefix_save
+ exec_prefix=$exec_prefix_save
+])
+
diff --git a/config/configure.host b/config/configure.host
new file mode 100644
index 0000000..c2dc888
--- /dev/null
+++ b/config/configure.host
@@ -0,0 +1,159 @@
+########################################################################
+#
+# configure.host -- JACK Audio Connection Kit version.
+#
+# This script and the system-dependent header directories it uses were
+# adapted for JACK from gcc/libstdc++-v3/configure.host.
+#
+# We've tried to keep it as close to the original as possible, while
+# removing a bunch of os-specific files that didn't seem relevant.
+# The primary goal has been to avoid changing the cpu-dependent
+# atomicity.h headers.
+#
+# If you need to make changes, the relevant GCC documentation may
+# prove helpful, <http://gcc.gnu.org/onlinedocs/porting>, especially
+# the <http://gcc.gnu.org/onlinedocs/porting/Thread-safety.html>
+# discussion of <atomicity.h>.
+#
+########################################################################
+
+# This shell script handles all host based configuration for libstdc++.
+# It sets various shell variables based on the the host and the
+# configuration options. You can modify this shell script without needing
+# to rerun autoconf/aclocal/etc. This file is "sourced" not executed.
+#
+# You should read docs/html/17_intro/porting.* to make sense of this file.
+#
+#
+# It uses the following shell variables as set by config.guess:
+# host The configuration host (full CPU-vendor-OS triplet)
+# host_cpu The configuration host CPU
+# host_os The configuration host OS
+#
+#
+# It sets the following shell variables:
+#
+# cpu_include_dir CPU-specific directory, defaults to cpu/generic
+# if cpu/host_cpu doesn't exist. This is
+# used to set atomicity_include_dir.
+#
+# os_include_dir OS-specific directory, defaults to os/generic.
+#
+# atomicity_include_dir location of atomicity.h,
+# defaults to cpu_include_dir
+#
+# It possibly modifies the following variables:
+#
+# OS_LDFLAGS extra flags to pass when linking the library, of
+# the form '-Wl,blah'
+# (defaults to empty in acinclude.m4)
+#
+# If the defaults will not work for your platform, you need only change the
+# variables that won't work, i.e., you do not need to explicitly set a
+# working variable to its default. Most hosts only need to change the two
+# *_include_dir variables.
+
+
+# DEFAULTS
+# Try to guess a default cpu_include_dir based on the name of the CPU. We
+# cannot do this for os_include_dir; there are too many portable operating
+# systems out there. :-)
+
+# HOST-SPECIFIC OVERRIDES
+# Set any CPU-dependent bits.
+# Here we override defaults and catch more general cases due to naming
+# conventions (e.g., chip_name* to catch all variants).
+
+# THIS TABLE IS SORTED. KEEP IT THAT WAY.
+case "${host_cpu}" in
+ alpha*)
+ try_cpu=alpha
+ ;;
+ i[3567]86 | x86_64)
+ try_cpu=i486
+ ;;
+ hppa*)
+ try_cpu=hppa
+ ;;
+ mips*)
+ # NB: cpu/mips/atomicity.h needs MIPS II or above.
+ # Of course, there is no sane way to test for this, no ABI macro,
+ # and no consistent host_cpu name differentiation. Therefore, only
+ # use it where it is known to be safe, ie it runs linux (see below).
+ try_cpu=generic
+ ;;
+ m680[246]0)
+ try_cpu=m68k
+ ;;
+ powerpc* | rs6000)
+ try_cpu=powerpc
+ ;;
+ s390x)
+ try_cpu=s390
+ ;;
+ sparc* | ultrasparc)
+ try_cpu=sparc
+ ;;
+ *)
+ if test -d $srcdir/config/cpu/${host_cpu}; then
+ try_cpu=${host_cpu}
+ else
+ try_cpu=generic
+ fi
+ ;;
+esac
+
+# Now look for the file(s) usually tied to a CPU model, and make
+# default choices for those if they haven't been explicitly set
+# already.
+cpu_include_dir="cpu/${try_cpu}"
+atomicity_include_dir=$cpu_include_dir
+
+
+# Set any OS-dependent bits.
+# Set the os_include_dir.
+# If atomic ops and/or numeric limits are OS-specific rather than
+# CPU-specifc, set those here too.
+# THIS TABLE IS SORTED. KEEP IT THAT WAY.
+case "${host_os}" in
+ aix4.[3456789]* | aix[56789]*)
+ # We set os_include_dir to os/aix only on AIX 4.3 and newer, but
+ # os/aix/atomicity.h works on earlier versions of AIX 4.*, so we
+ # explicitly duplicate the directory for 4.[<3].
+ os_include_dir="os/aix"
+ atomicity_include_dir="os/aix"
+ OS_LDFLAGS="-Wl,-G"
+ ;;
+ aix4.*)
+ os_include_dir="os/generic"
+ atomicity_include_dir="os/aix"
+ ;;
+ aix*)
+ os_include_dir="os/generic"
+ atomicity_include_dir="cpu/generic"
+ ;;
+ gnu* | linux* | kfreebsd*-gnu | knetbsd*-gnu)
+ os_include_dir="os/gnu-linux"
+ ;;
+ irix*)
+ os_include_dir="os/irix"
+ atomicity_include_dir=$os_include_dir
+ ;;
+ darwin*)
+ os_include_dir="os/macosx"
+ OS_LDFLAGS="-framework CoreAudio"
+ TRY_POSIX_SHM=yes # POSIX shm works better on darwin
+ ;;
+ *)
+ os_include_dir="os/generic"
+ ;;
+esac
+
+
+# Set any OS-dependent and CPU-dependent bits.
+# THIS TABLE IS SORTED. KEEP IT THAT WAY.
+case "${host}" in
+ mips*-*-linux*)
+ atomicity_include_dir="cpu/mips"
+ ;;
+esac
diff --git a/config/cpu/alpha/atomicity.h b/config/cpu/alpha/atomicity.h
new file mode 100644
index 0000000..cb071cd
--- /dev/null
+++ b/config/cpu/alpha/atomicity.h
@@ -0,0 +1,76 @@
+// Low-level functions for atomic operations: Alpha version -*- C++ -*-
+
+// Copyright (C) 1999, 2000, 2001, 2003 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING. If not, write to the Free
+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// As a special exception, you may use this file as part of a free software
+// library without restriction. Specifically, if other files instantiate
+// templates or use macros or inline functions from this file, or you compile
+// this file and link it with other files to produce an executable, this
+// file does not by itself cause the resulting executable to be covered by
+// the GNU General Public License. This exception does not however
+// invalidate any other reasons why the executable file might be covered by
+// the GNU General Public License.
+
+#ifndef _GLIBCXX_ATOMICITY_H
+#define _GLIBCXX_ATOMICITY_H 1
+
+/* @@@ With gas we can play nice .subsection games to get the
+ non-predicted branch pointing forward. But Digital assemblers
+ don't understand those directives. This isn't a terribly
+ important issue, so just ignore it. */
+
+typedef int _Atomic_word;
+
+static inline _Atomic_word
+__attribute__ ((__unused__))
+__exchange_and_add(volatile _Atomic_word* __mem, int __val)
+{
+ register int __result, __tmp;
+
+ __asm__ __volatile__ (
+ "\n$Lxadd_%=:\n\t"
+ "ldl_l %0,%3\n\t"
+ "addl %0,%4,%1\n\t"
+ "stl_c %1,%2\n\t"
+ "beq %1,$Lxadd_%=\n\t"
+ "mb"
+ : "=&r"(__result), "=&r"(__tmp), "=m"(*__mem)
+ : "m" (*__mem), "r"(__val));
+
+ return __result;
+}
+
+static inline void
+__attribute__ ((__unused__))
+__atomic_add(volatile _Atomic_word* __mem, int __val)
+{
+ register _Atomic_word __result;
+
+ __asm__ __volatile__ (
+ "\n$Ladd_%=:\n\t"
+ "ldl_l %0,%2\n\t"
+ "addl %0,%3,%0\n\t"
+ "stl_c %0,%1\n\t"
+ "beq %0,$Ladd_%=\n\t"
+ "mb"
+ : "=&r"(__result), "=m"(*__mem)
+ : "m" (*__mem), "r"(__val));
+}
+
+#endif /* atomicity.h */
diff --git a/config/cpu/alpha/cycles.h b/config/cpu/alpha/cycles.h
new file mode 100644
index 0000000..e746849
--- /dev/null
+++ b/config/cpu/alpha/cycles.h
@@ -0,0 +1,35 @@
+/*
+ Copyright (C) 2001 Paul Davis
+ Code derived from various headers from the Linux kernel
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+ $Id$
+*/
+
+#ifndef __jack_cycles_h__
+#define __jack_cycles_h__
+
+/* alpha */
+
+typedef unsigned int cycles_t;
+static inline cycles_t get_cycles (void)
+{
+ cycles_t ret;
+ __asm__ __volatile__ ("rpcc %0" : "=r"(ret));
+ return ret;
+}
+
+#endif /* __jack_cycles_h__ */
diff --git a/config/cpu/cris/atomicity.h b/config/cpu/cris/atomicity.h
new file mode 100644
index 0000000..fecb9dc
--- /dev/null
+++ b/config/cpu/cris/atomicity.h
@@ -0,0 +1,78 @@
+// Low-level functions for atomic operations: CRIS version -*- C++ -*-
+
+// Copyright (C) 2001, 2003 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING. If not, write to the Free
+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// As a special exception, you may use this file as part of a free software
+// library without restriction. Specifically, if other files instantiate
+// templates or use macros or inline functions from this file, or you compile
+// this file and link it with other files to produce an executable, this
+// file does not by itself cause the resulting executable to be covered by
+// the GNU General Public License. This exception does not however
+// invalidate any other reasons why the executable file might be covered by
+// the GNU General Public License.
+
+#ifndef _GLIBCXX_ATOMICITY_H
+#define _GLIBCXX_ATOMICITY_H 1
+
+// This entity must not cross a page boundary.
+typedef int _Atomic_word __attribute__ ((__aligned__ (4)));
+
+static inline _Atomic_word
+__attribute__ ((__unused__))
+__exchange_and_add(_Atomic_word* __mem, int __val)
+{
+ int __tmp;
+ _Atomic_word __result;
+
+#if (__CRIS_arch_version >= 10)
+ __asm__ __volatile__ (" clearf \n"
+ "0: \n"
+ " move.d %4,%2 \n"
+ " move.d [%3],%0 \n"
+ " add.d %0,%2 \n"
+ " ax \n"
+ " move.d %2,[%3] \n"
+ " bwf 0b \n"
+ " clearf \n"
+ : "=&r" (__result), "=m" (*__mem), "=&r" (__tmp)
+ : "r" (__mem), "g" (__val), "m" (*__mem));
+#else
+ __asm__ __volatile__ (" move $ccr,$r9 \n"
+ " di \n"
+ " move.d %4,%2 \n"
+ " move.d [%3],%0 \n"
+ " add.d %0,%2 \n"
+ " move.d %2,[%3] \n"
+ " move $r9,$ccr \n"
+ : "=&r" (__result), "=m" (*__mem), "=&r" (__tmp)
+ : "r" (__mem), "g" (__val), "m" (*__mem)
+ : "r9");
+#endif
+
+ return __result;
+}
+
+static inline void
+__attribute__ ((__unused__))
+__atomic_add(_Atomic_word* __mem, int __val)
+{
+ __exchange_and_add(__mem, __val);
+}
+
+#endif /* atomicity.h */
diff --git a/config/cpu/generic/atomicity.h b/config/cpu/generic/atomicity.h
new file mode 100644
index 0000000..ab7fad8
--- /dev/null
+++ b/config/cpu/generic/atomicity.h
@@ -0,0 +1,80 @@
+// Low-level functions for atomic operations: Generic version -*- C++ -*-
+
+// Copyright (C) 1999, 2001, 2002, 2003 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING. If not, write to the Free
+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// As a special exception, you may use this file as part of a free software
+// library without restriction. Specifically, if other files instantiate
+// templates or use macros or inline functions from this file, or you compile
+// this file and link it with other files to produce an executable, this
+// file does not by itself cause the resulting executable to be covered by
+// the GNU General Public License. This exception does not however
+// invalidate any other reasons why the executable file might be covered by
+// the GNU General Public License.
+
+#ifndef _GLIBCXX_ATOMICITY_H
+#define _GLIBCXX_ATOMICITY_H 1
+
+#warning No native atomic operations are provided for this platform.
+#warning They will be faked using a mutex, degrading performance.
+
+#include <bits/gthr.h>
+
+#define _GLIBCXX_NEED_GENERIC_MUTEX
+
+typedef int _Atomic_word;
+
+namespace __gnu_cxx
+{
+ extern __gthread_mutex_t _Atomic_add_mutex;
+
+#ifndef __GTHREAD_MUTEX_INIT
+ extern __gthread_once_t _Atomic_add_mutex_once;
+ extern void __gthread_atomic_add_mutex_once();
+#endif
+}
+
+static inline _Atomic_word
+__attribute__ ((__unused__))
+__exchange_and_add(volatile _Atomic_word* __mem, int __val)
+{
+#ifndef __GTHREAD_MUTEX_INIT
+ __gthread_once(&__gnu_cxx::_Atomic_add_mutex_once,
+ __gnu_cxx::__gthread_atomic_add_mutex_once);
+#endif
+
+ _Atomic_word __result;
+
+ __gthread_mutex_lock(&__gnu_cxx::_Atomic_add_mutex);
+
+ __result = *__mem;
+ *__mem += __val;
+
+ __gthread_mutex_unlock(&__gnu_cxx::_Atomic_add_mutex);
+ return __result;
+}
+
+
+static inline void
+__attribute__ ((__unused__))
+__atomic_add(volatile _Atomic_word* __mem, int __val)
+{
+ (void) __exchange_and_add(__mem, __val);
+}
+
+#endif /* atomicity.h */
diff --git a/config/cpu/generic/cycles.h b/config/cpu/generic/cycles.h
new file mode 100644
index 0000000..13eb204
--- /dev/null
+++ b/config/cpu/generic/cycles.h
@@ -0,0 +1,41 @@
+/*
+ Copyright (C) 2001 Paul Davis
+ Code derived from various headers from the Linux kernel
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+ $Id$
+*/
+
+#ifndef __jack_cycles_h__
+#define __jack_cycles_h__
+
+/* generic solution */
+
+#warning You are compiling JACK on a platform for which jack/cycles.h needs work
+#include <sys/time.h>
+
+typedef long cycles_t;
+extern cycles_t cacheflush_time;
+
+static inline cycles_t get_cycles(void)
+{
+ struct timeval tv;
+ gettimeofday (&tv, NULL);
+
+ return tv.tv_usec;
+}
+
+#endif /* __jack_cycles_h__ */
diff --git a/config/cpu/hppa/atomicity.h b/config/cpu/hppa/atomicity.h
new file mode 100644
index 0000000..b074142
--- /dev/null
+++ b/config/cpu/hppa/atomicity.h
@@ -0,0 +1,90 @@
+/* Low-level functions for atomic operations. PA-RISC version. -*- C++ -*-
+ Copyright 2002 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public License as
+ published by the Free Software Foundation; either version 2 of the
+ License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with the GNU C Library; see the file COPYING.LIB. If not,
+ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#ifndef _GLIBCXX_ATOMICITY_H
+#define _GLIBCXX_ATOMICITY_H 1
+
+typedef int _Atomic_word;
+
+template <int __inst>
+struct __Atomicity_lock
+{
+ static volatile int _S_atomicity_lock;
+};
+
+template <int __inst>
+volatile int
+__Atomicity_lock<__inst>::_S_atomicity_lock __attribute__ ((aligned (16))) = 1;
+
+/* Because of the lack of weak support when using the hpux
+ som linker, we explicitly instantiate the atomicity lock
+ in src/misc-inst.cc when _GLIBCXX_INST_ATOMICITY_LOCK
+ is defined. */
+#ifndef _GLIBCXX_INST_ATOMICITY_LOCK
+template volatile int __Atomicity_lock<0>::_S_atomicity_lock;
+#endif
+
+static inline int
+__attribute__ ((__unused__))
+__exchange_and_add(volatile _Atomic_word* __mem, int __val)
+{
+ _Atomic_word result;
+ int tmp;
+ volatile int& lock = __Atomicity_lock<0>::_S_atomicity_lock;
+
+ __asm__ __volatile__ ("ldcw 0(%1),%0\n\t"
+ "cmpib,<>,n 0,%0,.+20\n\t"
+ "ldw 0(%1),%0\n\t"
+ "cmpib,= 0,%0,.-4\n\t"
+ "nop\n\t"
+ "b,n .-20"
+ : "=&r" (tmp)
+ : "r" (&lock));
+
+ result = *__mem;
+ *__mem = result + __val;
+ /* Reset lock with PA 2.0 "ordered" store. */
+ __asm__ __volatile__ ("stw,ma %1,0(%0)"
+ : : "r" (&lock), "r" (tmp) : "memory");
+ return result;
+}
+
+static inline void
+__attribute__ ((__unused__))
+__atomic_add(_Atomic_word* __mem, int __val)
+{
+ int tmp;
+ volatile int& lock = __Atomicity_lock<0>::_S_atomicity_lock;
+
+ __asm__ __volatile__ ("ldcw 0(%1),%0\n\t"
+ "cmpib,<>,n 0,%0,.+20\n\t"
+ "ldw 0(%1),%0\n\t"
+ "cmpib,= 0,%0,.-4\n\t"
+ "nop\n\t"
+ "b,n .-20"
+ : "=&r" (tmp)
+ : "r" (&lock));
+
+ *__mem += __val;
+ /* Reset lock with PA 2.0 "ordered" store. */
+ __asm__ __volatile__ ("stw,ma %1,0(%0)"
+ : : "r" (&lock), "r" (tmp) : "memory");
+}
+
+#endif
diff --git a/config/cpu/i386/atomicity.h b/config/cpu/i386/atomicity.h
new file mode 100644
index 0000000..7a949c3
--- /dev/null
+++ b/config/cpu/i386/atomicity.h
@@ -0,0 +1,76 @@
+// Low-level functions for atomic operations: x86, x >= 3 version -*- C++ -*-
+
+// Copyright (C) 2003 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING. If not, write to the Free
+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// As a special exception, you may use this file as part of a free software
+// library without restriction. Specifically, if other files instantiate
+// templates or use macros or inline functions from this file, or you compile
+// this file and link it with other files to produce an executable, this
+// file does not by itself cause the resulting executable to be covered by
+// the GNU General Public License. This exception does not however
+// invalidate any other reasons why the executable file might be covered by
+// the GNU General Public License.
+
+#ifndef _GLIBCXX_ATOMICITY_H
+#define _GLIBCXX_ATOMICITY_H 1
+
+typedef int _Atomic_word;
+
+template<int __inst>
+ struct __Atomicity_lock
+ {
+ static volatile _Atomic_word _S_atomicity_lock;
+ };
+
+template<int __inst>
+volatile _Atomic_word __Atomicity_lock<__inst>::_S_atomicity_lock = 0;
+
+template volatile _Atomic_word __Atomicity_lock<0>::_S_atomicity_lock;
+
+static inline _Atomic_word
+__attribute__ ((__unused__))
+__exchange_and_add(volatile _Atomic_word* __mem, int __val)
+{
+ register _Atomic_word __result, __tmp = 1;
+
+ /* obtain the atomic exchange/add spin lock */
+ do {
+ __asm__ __volatile__ ("xchg{l} {%0,%1|%1,%0}"
+ : "=m" (__Atomicity_lock<0>::_S_atomicity_lock),
+ "+r" (__tmp)
+ : "m" (__Atomicity_lock<0>::_S_atomicity_lock));
+ } while (__tmp);
+
+ __result = *__mem;
+ *__mem += __val;
+
+ /* release spin lock */
+ __Atomicity_lock<0>::_S_atomicity_lock = 0;
+
+ return __result;
+}
+
+static inline void
+__attribute__ ((__unused__))
+__atomic_add(volatile _Atomic_word* __mem, int __val)
+{
+ __exchange_and_add(__mem, __val);
+}
+
+#endif /* atomicity.h */
diff --git a/config/cpu/i386/cycles.h b/config/cpu/i386/cycles.h
new file mode 100644
index 0000000..b75a456
--- /dev/null
+++ b/config/cpu/i386/cycles.h
@@ -0,0 +1,24 @@
+/*
+ Copyright (C) 2001 Paul Davis
+ Code derived from various headers from the Linux kernel
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+ $Id$
+*/
+
+/* the i486 version of this header is compatible */
+
+#include <config/cpu/i486/cycles.h>
diff --git a/config/cpu/i486/atomicity.h b/config/cpu/i486/atomicity.h
new file mode 100644
index 0000000..014cf62
--- /dev/null
+++ b/config/cpu/i486/atomicity.h
@@ -0,0 +1,54 @@
+// Low-level functions for atomic operations: x86, x >= 4 version -*- C++ -*-
+
+// Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING. If not, write to the Free
+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// As a special exception, you may use this file as part of a free software
+// library without restriction. Specifically, if other files instantiate
+// templates or use macros or inline functions from this file, or you compile
+// this file and link it with other files to produce an executable, this
+// file does not by itself cause the resulting executable to be covered by
+// the GNU General Public License. This exception does not however
+// invalidate any other reasons why the executable file might be covered by
+// the GNU General Public License.
+
+#ifndef _GLIBCXX_ATOMICITY_H
+#define _GLIBCXX_ATOMICITY_H 1
+
+typedef int _Atomic_word;
+
+static inline _Atomic_word
+__attribute__ ((__unused__))
+__exchange_and_add(volatile _Atomic_word* __mem, int __val)
+{
+ register _Atomic_word __result;
+ __asm__ __volatile__ ("lock; xaddl %0,%1"
+ : "=r" (__result), "=m" (*__mem)
+ : "0" (__val), "m" (*__mem));
+ return __result;
+}
+
+static inline void
+__attribute__ ((__unused__))
+__atomic_add(volatile _Atomic_word* __mem, int __val)
+{
+ __asm__ __volatile__ ("lock; addl %1,%0"
+ : "=m" (*__mem) : "ir" (__val), "m" (*__mem));
+}
+
+#endif /* atomicity.h */
diff --git a/config/cpu/i486/cycles.h b/config/cpu/i486/cycles.h
new file mode 100644
index 0000000..855dfb4
--- /dev/null
+++ b/config/cpu/i486/cycles.h
@@ -0,0 +1,54 @@
+/*
+ Copyright (C) 2001 Paul Davis
+ Code derived from various headers from the Linux kernel
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+ $Id$
+*/
+
+#ifndef __jack_cycles_h__
+#define __jack_cycles_h__
+
+/*
+ * Standard way to access the cycle counter on i586+ CPUs.
+ * Currently only used on SMP.
+ *
+ * If you really have a SMP machine with i486 chips or older,
+ * compile for that, and this will just always return zero.
+ * That's ok, it just means that the nicer scheduling heuristics
+ * won't work for you.
+ *
+ * We only use the low 32 bits, and we'd simply better make sure
+ * that we reschedule before that wraps. Scheduling at least every
+ * four billion cycles just basically sounds like a good idea,
+ * regardless of how fast the machine is.
+ */
+typedef unsigned long long cycles_t;
+
+extern cycles_t cacheflush_time;
+
+#define rdtscll(val) \
+ __asm__ __volatile__("rdtsc" : "=A" (val))
+
+static inline cycles_t get_cycles (void)
+{
+ unsigned long long ret;
+
+ rdtscll(ret);
+ return ret;
+}
+
+#endif /* __jack_cycles_h__ */
diff --git a/config/cpu/ia64/atomicity.h b/config/cpu/ia64/atomicity.h
new file mode 100644
index 0000000..d326a13
--- /dev/null
+++ b/config/cpu/ia64/atomicity.h
@@ -0,0 +1,51 @@
+// Low-level functions for atomic operations: IA64 version -*- C++ -*-
+
+// Copyright (C) 2000, 2001, 2003 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING. If not, write to the Free
+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// As a special exception, you may use this file as part of a free software
+// library without restriction. Specifically, if other files instantiate
+// templates or use macros or inline functions from this file, or you compile
+// this file and link it with other files to produce an executable, this
+// file does not by itself cause the resulting executable to be covered by
+// the GNU General Public License. This exception does not however
+// invalidate any other reasons why the executable file might be covered by
+// the GNU General Public License.
+
+#ifndef _GLIBCXX_ATOMICITY_H
+#define _GLIBCXX_ATOMICITY_H 1
+
+#include <sysdeps/ia64intrin.h>
+
+typedef int _Atomic_word;
+
+static inline _Atomic_word
+__attribute__ ((__unused__))
+__exchange_and_add(volatile _Atomic_word* __mem, int __val)
+{
+ return __sync_fetch_and_add(__mem, __val);
+}
+
+static inline void
+__attribute__ ((__unused__))
+__atomic_add(volatile _Atomic_word* __mem, int __val)
+{
+ __sync_fetch_and_add(__mem, __val);
+}
+
+#endif /* atomicity.h */
diff --git a/config/cpu/ia64/cycles.h b/config/cpu/ia64/cycles.h
new file mode 100644
index 0000000..5237363
--- /dev/null
+++ b/config/cpu/ia64/cycles.h
@@ -0,0 +1,36 @@
+/*
+ Copyright (C) 2001 Paul Davis
+ Code derived from various headers from the Linux kernel
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+ $Id$
+*/
+
+#ifndef __jack_cycles_h__
+#define __jack_cycles_h__
+
+/* ia64 */
+
+typedef unsigned long cycles_t;
+static inline cycles_t
+get_cycles (void)
+{
+ cycles_t ret;
+ __asm__ __volatile__ ("mov %0=ar.itc" : "=r"(ret));
+ return ret;
+}
+
+#endif /* __jack_cycles_h__ */
diff --git a/config/cpu/ia64/ia64intrin.h b/config/cpu/ia64/ia64intrin.h
new file mode 100644
index 0000000..262dc20
--- /dev/null
+++ b/config/cpu/ia64/ia64intrin.h
@@ -0,0 +1,130 @@
+#ifndef _IA64INTRIN_H_INCLUDED
+#define _IA64INTRIN_H_INCLUDED
+
+/* Actually, everything is a compiler builtin, but just so
+ there's no confusion... */
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+extern void __sync_synchronize (void);
+
+extern int __sync_val_compare_and_swap_si (int *, int, int);
+extern long __sync_val_compare_and_swap_di (long *, long, long);
+#define __sync_val_compare_and_swap(PTR, OLD, NEW) \
+ ((sizeof (*(PTR)) == sizeof(int)) \
+ ? (__typeof__(*(PTR))) \
+ __sync_val_compare_and_swap_si((int *)(PTR),(int)(OLD),(int)(NEW)) \
+ : (__typeof__(*(PTR))) \
+ __sync_val_compare_and_swap_di((long *)(PTR),(long)(OLD),(long)(NEW)))
+
+extern int __sync_bool_compare_and_swap_si (int *, int, int);
+extern int __sync_bool_compare_and_swap_di (long *, long, long);
+#define __sync_bool_compare_and_swap(PTR, OLD, NEW) \
+ ((sizeof (*(PTR)) == sizeof(int)) \
+ ? __sync_bool_compare_and_swap_si((int *)(PTR),(int)(OLD),(int)(NEW)) \
+ : __sync_bool_compare_and_swap_di((long *)(PTR),(long)(OLD),(long)(NEW)))
+
+extern void __sync_lock_release_si (int *);
+extern void __sync_lock_release_di (long *);
+#define __sync_lock_release(PTR) \
+ ((sizeof (*(PTR)) == sizeof(int)) \
+ ? __sync_lock_release_si((int *)(PTR)) \
+ : __sync_lock_release_di((long *)(PTR)))
+
+extern int __sync_lock_test_and_set_si (int *, int);
+extern long __sync_lock_test_and_set_di (long *, long);
+#define __sync_lock_test_and_set(PTR,VAL) \
+ ((sizeof (*(PTR)) == sizeof(int)) \
+ ? (__typeof__(*(PTR))) __sync_lock_test_and_set_si((int *)(PTR),(int)(VAL)) \
+ : (__typeof__(*(PTR))) __sync_lock_test_and_set_di((long *)(PTR),(long)(VAL)))
+
+extern int __sync_fetch_and_add_si (int *, int);
+extern long __sync_fetch_and_add_di (long *, long);
+#define __sync_fetch_and_add(PTR,VAL) \
+ ((sizeof (*(PTR)) == sizeof(int)) \
+ ? (__typeof__(*(PTR))) __sync_fetch_and_add_si((int *)(PTR),(int)(VAL)) \
+ : (__typeof__(*(PTR))) __sync_fetch_and_add_di((long *)(PTR),(long)(VAL)))
+
+extern int __sync_fetch_and_sub_si (int *, int);
+extern long __sync_fetch_and_sub_di (long *, long);
+#define __sync_fetch_and_sub(PTR,VAL) \
+ ((sizeof (*(PTR)) == sizeof(int)) \
+ ? (__typeof__(*(PTR))) __sync_fetch_and_sub_si((int *)(PTR),(int)(VAL)) \
+ : (__typeof__(*(PTR))) __sync_fetch_and_sub_di((long *)(PTR),(long)(VAL)))
+
+extern int __sync_fetch_and_and_si (int *, int);
+extern long __sync_fetch_and_and_di (long *, long);
+#define __sync_fetch_and_and(PTR,VAL) \
+ ((sizeof (*(PTR)) == sizeof(int)) \
+ ? (__typeof__(*(PTR))) __sync_fetch_and_and_si((int *)(PTR),(int)(VAL)) \
+ : (__typeof__(*(PTR))) __sync_fetch_and_and_di((long *)(PTR),(long)(VAL)))
+
+extern int __sync_fetch_and_or_si (int *, int);
+extern long __sync_fetch_and_or_di (long *, long);
+#define __sync_fetch_and_or(PTR,VAL) \
+ ((sizeof (*(PTR)) == sizeof(int)) \
+ ? (__typeof__(*(PTR))) __sync_fetch_and_or_si((int *)(PTR),(int)(VAL)) \
+ : (__typeof__(*(PTR))) __sync_fetch_and_or_di((long *)(PTR),(long)(VAL)))
+
+extern int __sync_fetch_and_xor_si (int *, int);
+extern long __sync_fetch_and_xor_di (long *, long);
+#define __sync_fetch_and_xor(PTR,VAL) \
+ ((sizeof (*(PTR)) == sizeof(int)) \
+ ? (__typeof__(*(PTR))) __sync_fetch_and_xor_si((int *)(PTR),(int)(VAL)) \
+ : (__typeof__(*(PTR))) __sync_fetch_and_xor_di((long *)(PTR),(long)(VAL)))
+
+extern int __sync_fetch_and_nand_si (int *, int);
+extern long __sync_fetch_and_nand_di (long *, long);
+#define __sync_fetch_and_nand(PTR,VAL) \
+ ((sizeof (*(PTR)) == sizeof(int)) \
+ ? (__typeof__(*(PTR))) __sync_fetch_and_nand_si((int *)(PTR),(int)(VAL)) \
+ : (__typeof__(*(PTR))) __sync_fetch_and_nand_di((long *)(PTR),(long)(VAL)))
+
+extern int __sync_add_and_fetch_si (int *, int);
+extern long __sync_add_and_fetch_di (long *, long);
+#define __sync_add_and_fetch(PTR,VAL) \
+ ((sizeof (*(PTR)) == sizeof(int)) \
+ ? (__typeof__(*(PTR))) __sync_add_and_fetch_si((int *)(PTR),(int)(VAL)) \
+ : (__typeof__(*(PTR))) __sync_add_and_fetch_di((long *)(PTR),(long)(VAL)))
+
+extern int __sync_sub_and_fetch_si (int *, int);
+extern long __sync_sub_and_fetch_di (long *, long);
+#define __sync_sub_and_fetch(PTR,VAL) \
+ ((sizeof (*(PTR)) == sizeof(int)) \
+ ? (__typeof__(*(PTR))) __sync_sub_and_fetch_si((int *)(PTR),(int)(VAL)) \
+ : (__typeof__(*(PTR))) __sync_sub_and_fetch_di((long *)(PTR),(long)(VAL)))
+
+extern int __sync_and_and_fetch_si (int *, int);
+extern long __sync_and_and_fetch_di (long *, long);
+#define __sync_and_and_fetch(PTR,VAL) \
+ ((sizeof (*(PTR)) == sizeof(int)) \
+ ? (__typeof__(*(PTR))) __sync_and_and_fetch_si((int *)(PTR),(int)(VAL)) \
+ : (__typeof__(*(PTR))) __sync_and_and_fetch_di((long *)(PTR),(long)(VAL)))
+
+extern int __sync_or_and_fetch_si (int *, int);
+extern long __sync_or_and_fetch_di (long *, long);
+#define __sync_or_and_fetch(PTR,VAL) \
+ ((sizeof (*(PTR)) == sizeof(int)) \
+ ? (__typeof__(*(PTR))) __sync_or_and_fetch_si((int *)(PTR),(int)(VAL)) \
+ : (__typeof__(*(PTR))) __sync_or_and_fetch_di((long *)(PTR),(long)(VAL)))
+
+extern int __sync_xor_and_fetch_si (int *, int);
+extern long __sync_xor_and_fetch_di (long *, long);
+#define __sync_xor_and_fetch(PTR,VAL) \
+ ((sizeof (*(PTR)) == sizeof(int)) \
+ ? (__typeof__(*(PTR))) __sync_xor_and_fetch_si((int *)(PTR),(int)(VAL)) \
+ : (__typeof__(*(PTR))) __sync_xor_and_fetch_di((long *)(PTR),(long)(VAL)))
+
+extern int __sync_nand_and_fetch_si (int *, int);
+extern long __sync_nand_and_fetch_di (long *, long);
+#define __sync_nand_and_fetch(PTR,VAL) \
+ ((sizeof (*(PTR)) == sizeof(int)) \
+ ? (__typeof__(*(PTR))) __sync_nand_and_fetch_si((int *)(PTR),(int)(VAL)) \
+ : (__typeof__(*(PTR))) __sync_nand_and_fetch_di((long *)(PTR),(long)(VAL)))
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/config/cpu/m68k/atomicity.h b/config/cpu/m68k/atomicity.h
new file mode 100644
index 0000000..eb801de
--- /dev/null
+++ b/config/cpu/m68k/atomicity.h
@@ -0,0 +1,139 @@
+// Low-level functions for atomic operations: m68k version -*- C++ -*-
+
+// Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING. If not, write to the Free
+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// As a special exception, you may use this file as part of a free software
+// library without restriction. Specifically, if other files instantiate
+// templates or use macros or inline functions from this file, or you compile
+// this file and link it with other files to produce an executable, this
+// file does not by itself cause the resulting executable to be covered by
+// the GNU General Public License. This exception does not however
+// invalidate any other reasons why the executable file might be covered by
+// the GNU General Public License.
+
+#ifndef _GLIBCXX_ATOMICITY_H
+#define _GLIBCXX_ATOMICITY_H 1
+
+typedef int _Atomic_word;
+
+#if ( defined(__mc68020__) || defined(__mc68030__) \
+ || defined(__mc68040__) || defined(__mc68060__) ) \
+ && !defined(__mcpu32__)
+// These variants support compare-and-swap.
+
+static inline _Atomic_word
+__attribute__ ((__unused__))
+__exchange_and_add(volatile _Atomic_word* __mem, int __val)
+{
+ register _Atomic_word __result = *__mem;
+ register _Atomic_word __temp;
+ __asm__ __volatile__ ("1: move%.l %0,%1\n\t"
+ "add%.l %3,%1\n\t"
+ "cas%.l %0,%1,%2\n\t"
+ "jne 1b"
+ : "=d" (__result), "=&d" (__temp), "=m" (*__mem)
+ : "d" (__val), "0" (__result), "m" (*__mem));
+ return __result;
+}
+
+#elif defined(__rtems__)
+ /*
+ * TAS/JBNE is unsafe on systems with strict priority-based scheduling.
+ * Disable interrupts, which we can do only from supervisor mode.
+ */
+static inline _Atomic_word
+__attribute__ ((__unused__))
+__exchange_and_add(volatile _Atomic_word* __mem, int __val)
+{
+ _Atomic_word __result;
+ short __level, __tmpsr;
+ __asm__ __volatile__ ("move%.w %%sr,%0\n\tor%.l %0,%1\n\tmove%.w %1,%%sr"
+ : "=d"(__level), "=d"(__tmpsr) : "1"(0x700));
+
+ __result = *__mem;
+ *__mem = __result + __val;
+
+ __asm__ __volatile__ ("move%.w %0,%%sr" : : "d"(__level));
+
+ return __result;
+}
+
+#else
+
+template<int __inst>
+ struct __Atomicity_lock
+ {
+ static volatile unsigned char _S_atomicity_lock;
+ };
+
+template<int __inst>
+volatile unsigned char __Atomicity_lock<__inst>::_S_atomicity_lock = 0;
+
+template volatile unsigned char __Atomicity_lock<0>::_S_atomicity_lock;
+
+static inline _Atomic_word
+__attribute__ ((__unused__))
+__exchange_and_add(volatile _Atomic_word* __mem, int __val)
+{
+ _Atomic_word __result;
+
+// bset with no immediate addressing (not SMP-safe)
+#if defined(__mcf5200__) || defined(__mcf5300__)
+ __asm__ __volatile__("1: bset.b #7,%0@\n\tjbne 1b"
+ : /* no outputs */
+ : "a"(&__Atomicity_lock<0>::_S_atomicity_lock)
+ : "cc", "memory");
+
+// CPU32 and MCF5400 support test-and-set (SMP-safe).
+#elif defined(__mcpu32__) || defined(__mcf5400__)
+ __asm__ __volatile__("1: tas %0\n\tjbne 1b"
+ : "+m"(__Atomicity_lock<0>::_S_atomicity_lock)
+ : /* none */
+ : "cc");
+
+// Use bset with immediate addressing for 68000/68010 (not SMP-safe)
+// NOTE: TAS is available on the 68000, but unsupported by some Amiga
+// memory controllers.
+#else
+ __asm__ __volatile__("1: bset.b #7,%0\n\tjbne 1b"
+ : "+m"(__Atomicity_lock<0>::_S_atomicity_lock)
+ : /* none */
+ : "cc");
+#endif
+
+ __result = *__mem;
+ *__mem = __result + __val;
+
+ __Atomicity_lock<0>::_S_atomicity_lock = 0;
+
+ return __result;
+}
+
+#endif /* TAS / BSET */
+
+static inline void
+__attribute__ ((__unused__))
+__atomic_add(volatile _Atomic_word* __mem, int __val)
+{
+ // Careful: using add.l with a memory destination is not
+ // architecturally guaranteed to be atomic.
+ (void) __exchange_and_add(__mem, __val);
+}
+
+#endif /* !_GLIBCXX_ATOMICITY_H */
diff --git a/config/cpu/mips/atomicity.h b/config/cpu/mips/atomicity.h
new file mode 100644
index 0000000..3d0c7a1
--- /dev/null
+++ b/config/cpu/mips/atomicity.h
@@ -0,0 +1,83 @@
+// Low-level functions for atomic operations.
+
+// Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING. If not, write to the Free
+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// As a special exception, you may use this file as part of a free software
+// library without restriction. Specifically, if other files instantiate
+// templates or use macros or inline functions from this file, or you compile
+// this file and link it with other files to produce an executable, this
+// file does not by itself cause the resulting executable to be covered by
+// the GNU General Public License. This exception does not however
+// invalidate any other reasons why the executable file might be covered by
+// the GNU General Public License.
+
+#ifndef _GLIBCXX_ATOMICITY_H
+#define _GLIBCXX_ATOMICITY_H 1
+
+typedef int _Atomic_word;
+
+static inline int
+__attribute__ ((__unused__))
+__exchange_and_add(volatile _Atomic_word* __mem, int __val)
+{
+ int __result, __tmp;
+
+ __asm__ __volatile__
+ ("/* Inline exchange & add */\n\t"
+ "1:\n\t"
+ ".set push\n\t"
+#if _MIPS_SIM == _ABIO32
+ ".set mips2\n\t"
+#endif
+ "ll %0,%3\n\t"
+ "addu %1,%4,%0\n\t"
+ "sc %1,%2\n\t"
+ ".set pop\n\t"
+ "beqz %1,1b\n\t"
+ "/* End exchange & add */"
+ : "=&r"(__result), "=&r"(__tmp), "=m"(*__mem)
+ : "m" (*__mem), "r"(__val));
+
+ return __result;
+}
+
+static inline void
+__attribute__ ((__unused__))
+__atomic_add(volatile _Atomic_word* __mem, int __val)
+{
+ int __result;
+
+ __asm__ __volatile__
+ ("/* Inline atomic add */\n\t"
+ "1:\n\t"
+ ".set push\n\t"
+#if _MIPS_SIM == _ABIO32
+ ".set mips2\n\t"
+#endif
+ "ll %0,%2\n\t"
+ "addu %0,%3,%0\n\t"
+ "sc %0,%1\n\t"
+ ".set pop\n\t"
+ "beqz %0,1b\n\t"
+ "/* End atomic add */"
+ : "=&r"(__result), "=m"(*__mem)
+ : "m" (*__mem), "r"(__val));
+}
+
+#endif /* atomicity.h */
diff --git a/config/cpu/powerpc/atomicity.h b/config/cpu/powerpc/atomicity.h
new file mode 100644
index 0000000..3b44b7d
--- /dev/null
+++ b/config/cpu/powerpc/atomicity.h
@@ -0,0 +1,78 @@
+// Low-level functions for atomic operations: PowerPC version -*- C++ -*-
+
+// Copyright (C) 1999, 2000, 2001, 2003 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING. If not, write to the Free
+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// As a special exception, you may use this file as part of a free software
+// library without restriction. Specifically, if other files instantiate
+// templates or use macros or inline functions from this file, or you compile
+// this file and link it with other files to produce an executable, this
+// file does not by itself cause the resulting executable to be covered by
+// the GNU General Public License. This exception does not however
+// invalidate any other reasons why the executable file might be covered by
+// the GNU General Public License.
+
+#ifndef _GLIBCXX_ATOMICITY_H
+#define _GLIBCXX_ATOMICITY_H 1
+
+#ifdef __PPC405__
+#define _STWCX "sync \n\tstwcx. "
+#else
+#define _STWCX "stwcx. "
+#endif
+
+typedef int _Atomic_word;
+
+static inline _Atomic_word
+__attribute__ ((__unused__))
+__exchange_and_add(volatile _Atomic_word* __mem, int __val)
+{
+ _Atomic_word __tmp, __res;
+ __asm__ __volatile__ (
+ "/* Inline exchange & add */\n"
+ "0:\t"
+ "lwarx %0,0,%3 \n\t"
+ "add%I4 %1,%0,%4 \n\t"
+ _STWCX " %1,0,%3 \n\t"
+ "bne- 0b \n\t"
+ "/* End exchange & add */"
+ : "=&b"(__res), "=&r"(__tmp), "=m" (*__mem)
+ : "r" (__mem), "Ir"(__val), "m" (*__mem)
+ : "cr0");
+ return __res;
+}
+
+static inline void
+__attribute__ ((__unused__))
+__atomic_add(volatile _Atomic_word* __mem, int __val)
+{
+ _Atomic_word __tmp;
+ __asm__ __volatile__ (
+ "/* Inline atomic add */\n"
+ "0:\t"
+ "lwarx %0,0,%2 \n\t"
+ "add%I3 %0,%0,%3 \n\t"
+ _STWCX " %0,0,%2 \n\t"
+ "bne- 0b \n\t"
+ "/* End atomic add */"
+ : "=&b"(__tmp), "=m" (*__mem)
+ : "r" (__mem), "Ir"(__val), "m" (*__mem)
+ : "cr0");
+}
+
+#endif /* atomicity.h */
diff --git a/config/cpu/powerpc/cycles.h b/config/cpu/powerpc/cycles.h
new file mode 100644
index 0000000..84486d4
--- /dev/null
+++ b/config/cpu/powerpc/cycles.h
@@ -0,0 +1,55 @@
+/*
+ Copyright (C) 2001 Paul Davis
+ Code derived from various headers from the Linux kernel
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+ $Id$
+*/
+
+#ifndef __jack_cycles_h__
+#define __jack_cycles_h__
+
+/* PowerPC */
+
+#define CPU_FTR_601 0x00000100
+
+typedef unsigned long cycles_t;
+
+/*
+ * For the "cycle" counter we use the timebase lower half.
+ * Currently only used on SMP.
+ */
+
+extern cycles_t cacheflush_time;
+
+static inline cycles_t get_cycles(void)
+{
+ cycles_t ret = 0;
+
+ __asm__ __volatile__(
+ "98: mftb %0\n"
+ "99:\n"
+ ".section __ftr_fixup,\"a\"\n"
+ " .long %1\n"
+ " .long 0\n"
+ " .long 98b\n"
+ " .long 99b\n"
+ ".previous"
+ : "=r" (ret) : "i" (CPU_FTR_601));
+ return ret;
+}
+
+#endif /* __jack_cycles_h__ */
diff --git a/config/cpu/s390/atomicity.h b/config/cpu/s390/atomicity.h
new file mode 100644
index 0000000..8647c76
--- /dev/null
+++ b/config/cpu/s390/atomicity.h
@@ -0,0 +1,60 @@
+// Low-level functions for atomic operations: S/390 version -*- C++ -*-
+
+// Copyright (C) 2001, 2003 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING. If not, write to the Free
+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// As a special exception, you may use this file as part of a free software
+// library without restriction. Specifically, if other files instantiate
+// templates or use macros or inline functions from this file, or you compile
+// this file and link it with other files to produce an executable, this
+// file does not by itself cause the resulting executable to be covered by
+// the GNU General Public License. This exception does not however
+// invalidate any other reasons why the executable file might be covered by
+// the GNU General Public License.
+
+#ifndef _GLIBCXX_ATOMICITY_H
+#define _GLIBCXX_ATOMICITY_H 1
+
+typedef int _Atomic_word;
+
+static inline _Atomic_word
+__attribute__ ((__unused__))
+__exchange_and_add(volatile _Atomic_word* __mem, int __val)
+{
+ register _Atomic_word __old_val, __new_val;
+
+ __asm__ __volatile__ (" l %0,0(%3)\n"
+ "0: lr %1,%0\n"
+ " ar %1,%4\n"
+ " cs %0,%1,0(%3)\n"
+ " jl 0b"
+ : "=&d" (__old_val), "=&d" (__new_val), "=m" (*__mem)
+ : "a" (__mem), "d" (__val), "m" (*__mem) : "cc");
+ return __old_val;
+}
+
+static inline void
+__attribute__ ((__unused__))
+__atomic_add(volatile _Atomic_word* __mem, int __val)
+{
+ __exchange_and_add(__mem, __val);
+}
+
+#endif /* atomicity.h */
+
+
diff --git a/config/cpu/sparc/atomicity.h b/config/cpu/sparc/atomicity.h
new file mode 100644
index 0000000..2db079c
--- /dev/null
+++ b/config/cpu/sparc/atomicity.h
@@ -0,0 +1,131 @@
+// Low-level functions for atomic operations: Sparc version -*- C++ -*-
+
+// Copyright (C) 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING. If not, write to the Free
+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// As a special exception, you may use this file as part of a free software
+// library without restriction. Specifically, if other files instantiate
+// templates or use macros or inline functions from this file, or you compile
+// this file and link it with other files to produce an executable, this
+// file does not by itself cause the resulting executable to be covered by
+// the GNU General Public License. This exception does not however
+// invalidate any other reasons why the executable file might be covered by
+// the GNU General Public License.
+
+#ifndef _GLIBCXX_ATOMICITY_H
+#define _GLIBCXX_ATOMICITY_H 1
+
+#ifdef __arch64__
+
+typedef long _Atomic_word;
+
+static inline _Atomic_word
+__attribute__ ((__unused__))
+__exchange_and_add(volatile _Atomic_word* __mem, int __val)
+{
+ _Atomic_word __tmp1, __tmp2;
+ _Atomic_word __val_extended = __val;
+
+ __asm__ __volatile__("1: ldx [%3], %0\n\t"
+ " add %0, %4, %1\n\t"
+ " casx [%3], %0, %1\n\t"
+ " sub %0, %1, %0\n\t"
+ " brnz,pn %0, 1b\n\t"
+ " nop"
+ : "=&r" (__tmp1), "=&r" (__tmp2), "=m" (*__mem)
+ : "r" (__mem), "r" (__val_extended), "m" (*__mem));
+ return __tmp2;
+}
+
+static inline void
+__attribute__ ((__unused__))
+__atomic_add(volatile _Atomic_word* __mem, int __val)
+{
+ _Atomic_word __tmp1, __tmp2;
+ _Atomic_word __val_extended = __val;
+
+ __asm__ __volatile__("1: ldx [%3], %0\n\t"
+ " add %0, %4, %1\n\t"
+ " casx [%3], %0, %1\n\t"
+ " sub %0, %1, %0\n\t"
+ " brnz,pn %0, 1b\n\t"
+ " nop"
+ : "=&r" (__tmp1), "=&r" (__tmp2), "=m" (*__mem)
+ : "r" (__mem), "r" (__val_extended), "m" (*__mem));
+}
+
+#else /* __arch32__ */
+
+typedef int _Atomic_word;
+
+template<int __inst>
+ struct __Atomicity_lock
+ {
+ static unsigned char _S_atomicity_lock;
+ };
+
+template<int __inst>
+unsigned char __Atomicity_lock<__inst>::_S_atomicity_lock = 0;
+
+template unsigned char __Atomicity_lock<0>::_S_atomicity_lock;
+
+static int
+__attribute__ ((__unused__))
+__exchange_and_add(volatile _Atomic_word* __mem, int __val)
+{
+ _Atomic_word __result, __tmp;
+
+ __asm__ __volatile__("1: ldstub [%1], %0\n\t"
+ " cmp %0, 0\n\t"
+ " bne 1b\n\t"
+ " nop"
+ : "=&r" (__tmp)
+ : "r" (&__Atomicity_lock<0>::_S_atomicity_lock)
+ : "memory");
+ __result = *__mem;
+ *__mem += __val;
+ __asm__ __volatile__("stb %%g0, [%0]"
+ : /* no outputs */
+ : "r" (&__Atomicity_lock<0>::_S_atomicity_lock)
+ : "memory");
+ return __result;
+}
+
+static void
+__attribute__ ((__unused__))
+__atomic_add(volatile _Atomic_word* __mem, int __val)
+{
+ _Atomic_word __tmp;
+
+ __asm__ __volatile__("1: ldstub [%1], %0\n\t"
+ " cmp %0, 0\n\t"
+ " bne 1b\n\t"
+ " nop"
+ : "=&r" (__tmp)
+ : "r" (&__Atomicity_lock<0>::_S_atomicity_lock)
+ : "memory");
+ *__mem += __val;
+ __asm__ __volatile__("stb %%g0, [%0]"
+ : /* no outputs */
+ : "r" (&__Atomicity_lock<0>::_S_atomicity_lock)
+ : "memory");
+}
+
+#endif /* __arch32__ */
+
+#endif /* atomicity.h */
diff --git a/config/os/aix/atomicity.h b/config/os/aix/atomicity.h
new file mode 100644
index 0000000..af4fa5a
--- /dev/null
+++ b/config/os/aix/atomicity.h
@@ -0,0 +1,59 @@
+// Low-level functions for atomic operations: AIX version -*- C++ -*-
+
+// Copyright (C) 2000, 2001 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING. If not, write to the Free
+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// As a special exception, you may use this file as part of a free software
+// library without restriction. Specifically, if other files instantiate
+// templates or use macros or inline functions from this file, or you compile
+// this file and link it with other files to produce an executable, this
+// file does not by itself cause the resulting executable to be covered by
+// the GNU General Public License. This exception does not however
+// invalidate any other reasons why the executable file might be covered by
+// the GNU General Public License.
+
+#ifndef _BITS_ATOMICITY_H
+#define _BITS_ATOMICITY_H 1
+
+/* We cannot use the cpu/powerpc/bits/atomicity.h inline assembly
+ definitions for these operations since they depend on operations
+ that are not available on the original POWER architecture. AIX
+ still runs on the POWER architecture, so it would be incorrect to
+ assume the existence of these instructions. */
+
+/* This should match the type pointed to by atomic_p in
+ <sys/atomic_op.h>. */
+typedef int _Atomic_word;
+
+#include <sys/atomic_op.h>
+
+static inline int
+__attribute__ ((__unused__))
+__exchange_and_add (atomic_p __mem, int __val)
+{
+ return fetch_and_add (__mem, __val);
+}
+
+static inline void
+__attribute__ ((__unused__))
+__atomic_add (atomic_p __mem, int __val)
+{
+ (void) fetch_and_add (__mem, __val);
+}
+
+#endif /* atomicity.h */
diff --git a/config/os/generic/ipc.h b/config/os/generic/ipc.h
new file mode 100644
index 0000000..bc128c0
--- /dev/null
+++ b/config/os/generic/ipc.h
@@ -0,0 +1,28 @@
+/*
+ Copyright (C) 2004 Jack O'Quin
+
+ Generic version, overridden by OS-specific defines when needed.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 2.1 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+ $Id$
+*/
+
+#ifndef _jack_sys_ipc
+#define _jack_sys_ipc 1
+
+#include <sys/ipc.h>
+
+#endif /* _jack_sys_ipc */
diff --git a/config/os/generic/os_defines.h b/config/os/generic/os_defines.h
new file mode 100644
index 0000000..456137a
--- /dev/null
+++ b/config/os/generic/os_defines.h
@@ -0,0 +1,30 @@
+/*
+ Copyright (C) 2004 Jack O'Quin
+
+ Generic version, overridden by OS-specific defines when available.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 2.1 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+ $Id$
+*/
+
+#ifndef _jack_os_defines
+#define _jack_os_defines 1
+
+#define JACK_THREAD_STACK_TOUCH 1048576
+#define PORTAUDIO_H <portaudio.h>
+#define GETOPT_H <getopt.h>
+
+#endif /* _jack_os_defines */
diff --git a/config/os/generic/poll.h b/config/os/generic/poll.h
new file mode 100644
index 0000000..3837134
--- /dev/null
+++ b/config/os/generic/poll.h
@@ -0,0 +1,28 @@
+/*
+ Copyright (C) 2004 Jack O'Quin
+
+ Generic version, overridden by OS-specific defines when needed.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 2.1 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+ $Id$
+*/
+
+#ifndef _jack_sys_poll
+#define _jack_sys_poll 1
+
+#include <sys/poll.h>
+
+#endif /* _jack_sys_poll */
diff --git a/config/os/generic/time.h b/config/os/generic/time.h
new file mode 100644
index 0000000..5a7ea49
--- /dev/null
+++ b/config/os/generic/time.h
@@ -0,0 +1,42 @@
+/*
+ Copyright (C) 2004 Jack O'Quin
+
+ Generic version, overridden by OS-specific defines when available.
+ In this case, that is necessary, because the generic version
+ hasn't been written, yet.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 2.1 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+ $Id$
+*/
+#ifndef __jack_time_h__
+#define __jack_time_h__
+
+#include <jack/internal.h>
+
+#error No generic <sysdeps/time.h> available.
+
+/* This is a kludge. We need one global instantiation of this
+ * variable in each address space. So, libjack/client.c declares the
+ * actual storage. Other source files will see it as an extern. */
+#define JACK_TIME_GLOBAL_DECL jack_time_t __jack_cpu_mhz
+extern JACK_TIME_GLOBAL_DECL;
+
+/* Need implementations. jack_init_time() should only be called ONCE
+ * per process. */
+static inline jack_time_t jack_get_microseconds (void);
+static inline void jack_init_time (void);
+
+#endif /* __jack_time_h__ */
diff --git a/config/os/gnu-linux/time.h b/config/os/gnu-linux/time.h
new file mode 100644
index 0000000..033d4a6
--- /dev/null
+++ b/config/os/gnu-linux/time.h
@@ -0,0 +1,97 @@
+/*
+ Copyright (C) 2001-2003 Paul Davis
+
+ This is the GNU/Linux version.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 2.1 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+ $Id$
+*/
+#ifndef __jack_time_h__
+#define __jack_time_h__
+
+#include <stdio.h>
+#include <jack/internal.h>
+#include <sysdeps/cycles.h>
+
+/* This is a kludge. We need one global instantiation of this
+ * variable in each address space. So, libjack/client.c declares the
+ * actual storage. Other source files will see it as an extern. */
+#define JACK_TIME_GLOBAL_DECL jack_time_t __jack_cpu_mhz
+extern JACK_TIME_GLOBAL_DECL;
+
+static inline jack_time_t
+jack_get_microseconds (void) {
+ return get_cycles() / __jack_cpu_mhz;
+}
+
+/*
+ * This is another kludge. It looks CPU-dependent, but actually it
+ * reflects the lack of standards for the Linux kernel formatting of
+ * /proc/cpuinfo.
+ */
+static inline jack_time_t
+jack_get_mhz (void)
+{
+ FILE *f = fopen("/proc/cpuinfo", "r");
+ if (f == 0)
+ {
+ perror("can't open /proc/cpuinfo\n");
+ exit(1);
+ }
+
+ for ( ; ; )
+ {
+ jack_time_t mhz;
+ int ret;
+ char buf[1000];
+
+ if (fgets(buf, sizeof(buf), f) == NULL) {
+ jack_error ("FATAL: cannot locate cpu MHz in "
+ "/proc/cpuinfo\n");
+ exit(1);
+ }
+
+#if defined(__powerpc__)
+ ret = sscanf(buf, "clock\t: %" SCNu64 "MHz", &mhz);
+#elif defined( __i386__ ) || defined (__hppa__) || defined (__ia64__) || \
+ defined(__x86_64__)
+ ret = sscanf(buf, "cpu MHz : %" SCNu64, &mhz);
+#elif defined( __sparc__ )
+ ret = sscanf(buf, "Cpu0Bogo : %" SCNu64, &mhz);
+#elif defined( __mc68000__ )
+ ret = sscanf(buf, "Clocking: %" SCNu64, &mhz);
+#elif defined( __s390__ )
+ ret = sscanf(buf, "bogomips per cpu: %" SCNu64, &mhz);
+#else /* MIPS, ARM, alpha */
+ ret = sscanf(buf, "BogoMIPS : %" SCNu64, &mhz);
+#endif
+
+ if (ret == 1)
+ {
+ fclose(f);
+ return (jack_time_t)mhz;
+ }
+ }
+}
+
+/* This should only be called ONCE per process. */
+static inline void
+jack_init_time ()
+{
+ __jack_cpu_mhz = jack_get_mhz ();
+}
+
+#endif /* __jack_time_h__ */
diff --git a/config/os/irix/atomicity.h b/config/os/irix/atomicity.h
new file mode 100644
index 0000000..c7f5c83
--- /dev/null
+++ b/config/os/irix/atomicity.h
@@ -0,0 +1,50 @@
+// Low-level functions for atomic operations: IRIX version -*- C++ -*-
+
+// Copyright (C) 2000, 2001 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING. If not, write to the Free
+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// As a special exception, you may use this file as part of a free software
+// library without restriction. Specifically, if other files instantiate
+// templates or use macros or inline functions from this file, or you compile
+// this file and link it with other files to produce an executable, this
+// file does not by itself cause the resulting executable to be covered by
+// the GNU General Public License. This exception does not however
+// invalidate any other reasons why the executable file might be covered by
+// the GNU General Public License.
+
+#ifndef _BITS_ATOMICITY_H
+#define _BITS_ATOMICITY_H 1
+
+#include <mutex.h>
+
+typedef long _Atomic_word;
+
+static inline _Atomic_word
+__exchange_and_add (_Atomic_word* __mem, int __val)
+{
+ return (_Atomic_word) test_then_add ((unsigned long*) __mem, __val);
+}
+
+
+static inline void
+__atomic_add (_Atomic_word* __mem, int __val)
+{
+ __exchange_and_add (__mem, __val);
+}
+
+#endif /* atomicity.h */
diff --git a/config/os/macosx/README b/config/os/macosx/README
new file mode 100644
index 0000000..33f5692
--- /dev/null
+++ b/config/os/macosx/README
@@ -0,0 +1,183 @@
+
+Darwin/MacOSX port for Jack : architecture changes in the implementation
+========================================================================
+
+Build Dependencies
+==================
+
+Apple Developer Tools
+ gcc 2.95.x or 3.x, the standard OSX 10.3 gcc-3.3 compiler works fine
+ MacOSX10.3 SDK package
+
+GNU tools
+ autoconf >= 2.57
+ automake >= 1.6.3
+
+optional tools
+ libtool >= 1.5 (to build from CVS)
+ pkg-config >= 0.15.0 (to build from CVS)
+ doxygen (to build documentation)
+ libsndfile >= 1.0.0 (for some example-clients)
+ GNU readline (for some example-clients)
+
+All non-Apple tools are available from `fink' or `darwinports'.
+
+Since fink is not well-integrated with OS X, you must define a bunch
+of environment variables...
+
+ export ACLOCAL_FLAGS="-I /sw/share/aclocal"
+ export CFLAGS="-I/sw/include"
+ export CPPFLAGS=$CFLAGS
+ export LDFLAGS="-L/sw/lib"
+ export PKG_CONFIG_PATH="/sw/lib/pkgconfig:/usr/lib/pkgconfig:/usr/local/lib/pkgconfig:/opt/local/lib/pkgconfig"
+
+
+Shared memory
+=============
+
+The system V shared memory is not very reliable on Darwin/MacOSX, so
+POSIX shared memory API is the preferred default. To override, use...
+
+ ./configure --disable-posix-shm
+
+
+Jack server audio cycle
+========================
+
+On Linux, the jack server audio cycle (jack_run_cycle function) is
+called in a real-time SCHED_FIFO thread. On Darwin/MacOSX, the
+jack_run_cycle is directly called inside the CoreAudio audio callback.
+
+
+External client activation
+===========================
+
+Jack Linux implementation use system fifo/pipe to trigger the clients
+real-time callback from the server : the first client of an external
+subgraph is triggered, does it's job and wakes up the next one in the
+list, and so on until the last client that wakes up the Jack
+server. This avoid uneeded context switches between the server and
+clients and thus is more efficient.
+
+This Linux implementation works also on Darwin/MacOSX but is not very
+efficient : audio gliches occur quite frequently.
+
+A more efficient system for external client activation has been
+developed. It use low-level mach messages system to implement fast IPC
+between the Jack server and the running clients. The Darwin/MacOSX has
+a very efficient Remote Procedure Call (RPC) implementation that can
+be used: the Jack server activate each external client in turn in a
+loop.
+
+On the client side, each client uses an additionnal thread only used
+for the real-time process callback, that will be triggered by the Jack
+server using this fast RPC mechanism.
+
+
+Real-time threads
+==================
+
+The Darwin/MacOSX system use a special class of scheduling for
+real-time threads.
+
+Since the server audio cycle is called directly from the CoreAudio
+callback, there is nothing special to do on the server side. On the
+client side, the thread used to call the "process" callback from the
+server is made real-time, using the mach thread API.
+
+
+Compilation and installation
+=============================
+
+- In the jack/jack folder, you'll have to produce the version.h
+manually from the version.h.in file ): Edit the version.h.in, replace
+the JACK_PROTOCOL_VERSION value with the one found in configure.in and
+save as a new version.h file. You should get something like "#define
+jack_protocol_version 6" in the file.
+
+Several packages need to be installed before compiling Jack :
+
+- Fink dlcompat (fink.sourceforge.net) : this package define the
+dlopen, dlsym... API used in Jack to load drivers and internal
+clients. The package has to be installed before compiling Jack.
+
+- fakepoll is a implementation of the poll function using select. The
+Fink version of poll does not work correctly, thus the public domain
+"fakepoll" code has been used instead. It is directly included in the
+Jack Darwin/MacOSX port.
+
+- PortAudio (www.portaudio.com) : PortAudio is a free, cross platform,
+open-source, audio I/O library. The Jack CoreAudio driver actually is
+implemented using PortAudio. The PortAudio source code for MacOSX has
+to be installed and compiled to produce a framework called
+"PortAudio.framework" that will be used in the Jack link phase.
+
+
+Several targets are available in the Project Builder project :
+
+- jackd : build the Jack server ("jackd" executable)
+- jack framework : build the "Jack.framework" library.
+- driver : build the PortAudio driver as a "jack_portaudio.so" shared library.
+- jack_metro : build the "jack_metro" executable.
+- jack_lsp : build the "jack_lsp" executable.
+- jack_connect : build the "jack_connect" executable.
+- jack_disconnect : build the "jack_disconnect" executable.
+
+Server, driver and library installation :
+-----------------------------------------
+
+First copy the Jack.framework in /Library/Framework. Then as root :
+
+ # cp jack_portaudio /usr/local/lib
+ # cp jackd /usr/local/bin
+
+Launching Jack server :
+-----------------------
+
+By default buffer size is 128 frames and sample rate is 44100.
+
+ $ jackd -v -R -d coreaudio
+
+To setup a 32 frames buffer and a 4800 Hz sample rate :
+
+ $ jackd -v -R -d coreaudio -p 32 -r 48000
+
+Performances
+=============
+
+The Darwin/MacOSX implementation is quite efficient: on a G4/867 Mhz,
+the Jack server can run with a 32 frames buffer size without noticable
+problems.
+
+
+Known problems or unimplemented features
+=========================================
+
+- thread cancellation : the pthread API pthread_cancel is not
+completely available on Darwin/MacOSX. Thread cannot be cancelled in
+the general case: they must use explicit cancelation points like
+"pthread_testcancel" (see the "jack_client_thread" function)
+
+- xruns detection and report: not implemented.
+
+
+Possible improvements
+======================
+
+- The audio driver is built on top of PortAudio. It may be more
+efficient to directly use the CoreAudio API in order to avoid
+additional buffer copy and interleaving/disinterleaving operations.
+
+- The project uses Project Builder. It would be helpful to work on
+the autoconf and automake tools as the Linux version. In this case,
+the macosx/config.h file would have to be removed and generated by
+configure, and jack/version.h will be generated automatically from
+jack/version.h.in
+
+- Better separation of Linux and Darwin/MacOSX only code.
+
+The Jack port for Darwin/MacOSX version has be done by:
+
+Grame Research Laboratory
+9, rue du Garet 69001 Lyon - France
+Mail : letz@grame.fr
diff --git a/config/os/macosx/fakepoll.h b/config/os/macosx/fakepoll.h
new file mode 100644
index 0000000..e3f4345
--- /dev/null
+++ b/config/os/macosx/fakepoll.h
@@ -0,0 +1,161 @@
+
+// fakepoll.h
+// poll using select
+// Warning: a call to this poll() takes about 4K of stack space.
+
+// Greg Parker gparker-web@sealiesoftware.com December 2000
+// This code is in the public domain and may be copied or modified without
+// permission.
+
+// Updated May 2002:
+// * fix crash when an fd is less than 0
+// * set errno=EINVAL if an fd is greater or equal to FD_SETSIZE
+// * don't set POLLIN or POLLOUT in revents if it wasn't requested
+// in events (only happens when an fd is in the poll set twice)
+
+#ifndef _FAKE_POLL_H
+#define _FAKE_POLL_H
+
+#include <limits.h>
+#include <sys/types.h>
+#include <sys/time.h>
+#include <unistd.h>
+#include <stdlib.h>
+#include <errno.h>
+
+typedef struct pollfd {
+ int fd; /* file desc to poll */
+ short events; /* events of interest on fd */
+ short revents; /* events that occurred on fd */
+} pollfd_t;
+
+
+// poll flags
+#define POLLIN 0x0001
+#define POLLOUT 0x0004
+#define POLLERR 0x0008
+
+// synonyms
+#define POLLNORM POLLIN
+#define POLLPRI POLLIN
+#define POLLRDNORM POLLIN
+#define POLLRDBAND POLLIN
+#define POLLWRNORM POLLOUT
+#define POLLWRBAND POLLOUT
+
+// ignored
+#define POLLHUP 0x0010
+#define POLLNVAL 0x0020
+
+inline int poll(struct pollfd *pollSet, int pollCount, int pollTimeout)
+{
+ struct timeval tv;
+ struct timeval *tvp;
+ fd_set readFDs, writeFDs, exceptFDs;
+ fd_set *readp, *writep, *exceptp;
+ struct pollfd *pollEnd, *p;
+ int selected;
+ int result;
+ int maxFD;
+
+ if (!pollSet) {
+ pollEnd = NULL;
+ readp = NULL;
+ writep = NULL;
+ exceptp = NULL;
+ maxFD = 0;
+ }
+ else {
+ pollEnd = pollSet + pollCount;
+ readp = &readFDs;
+ writep = &writeFDs;
+ exceptp = &exceptFDs;
+
+ FD_ZERO(readp);
+ FD_ZERO(writep);
+ FD_ZERO(exceptp);
+
+ // Find the biggest fd in the poll set
+ maxFD = 0;
+ for (p = pollSet; p < pollEnd; p++) {
+ if (p->fd > maxFD) maxFD = p->fd;
+ }
+
+ if (maxFD >= FD_SETSIZE) {
+ // At least one fd is too big
+ errno = EINVAL;
+ return -1;
+ }
+
+ // Transcribe flags from the poll set to the fd sets
+ for (p = pollSet; p < pollEnd; p++) {
+ if (p->fd < 0) {
+ // Negative fd checks nothing and always reports zero
+ } else {
+ if (p->events & POLLIN) FD_SET(p->fd, readp);
+ if (p->events & POLLOUT) FD_SET(p->fd, writep);
+ if (p->events != 0) {
+ FD_SET(p->fd, exceptp);
+ }
+ // POLLERR is never set coming in; poll() always reports errors
+ // But don't report if we're not listening to anything at all.
+ }
+ }
+ }
+
+ // poll timeout is in milliseconds. Convert to struct timeval.
+ // poll timeout == -1 : wait forever : select timeout of NULL
+ // poll timeout == 0 : return immediately : select timeout of zero
+ if (pollTimeout >= 0) {
+ tv.tv_sec = pollTimeout / 1000;
+ tv.tv_usec = (pollTimeout % 1000) * 1000;
+ tvp = &tv;
+ } else {
+ tvp = NULL;
+ }
+
+ selected = select(maxFD+1, readp, writep, exceptp, tvp);
+
+ if (selected < 0) {
+ // Error during select
+ result = -1;
+ }
+ else if (selected > 0) {
+ // Select found something
+ // Transcribe result from fd sets to poll set.
+ // Also count the number of selected fds. poll returns the
+ // number of ready fds; select returns the number of bits set.
+ int polled = 0;
+ for (p = pollSet; p < pollEnd; p++) {
+ p->revents = 0;
+ if (p->fd < 0) {
+ // Negative fd always reports zero
+ } else {
+ if ((p->events & POLLIN) && FD_ISSET(p->fd, readp)) {
+ p->revents |= POLLIN;
+ }
+ if ((p->events & POLLOUT) && FD_ISSET(p->fd, writep)) {
+ p->revents |= POLLOUT;
+ }
+ if ((p->events != 0) && FD_ISSET(p->fd, exceptp)) {
+ p->revents |= POLLERR;
+ }
+
+ if (p->revents) polled++;
+ }
+ }
+ result = polled;
+ }
+ else {
+ // selected == 0, select timed out before anything happened
+ // Clear all result bits and return zero.
+ for (p = pollSet; p < pollEnd; p++) {
+ p->revents = 0;
+ }
+ result = 0;
+ }
+
+ return result;
+}
+
+#endif
diff --git a/config/os/macosx/getopt.h b/config/os/macosx/getopt.h
new file mode 100644
index 0000000..7275c59
--- /dev/null
+++ b/config/os/macosx/getopt.h
@@ -0,0 +1,22 @@
+/*
+ Copyright © Grame 2003
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+ Grame Research Laboratory, 9, rue du Garet 69001 Lyon - France
+ grame@rd.grame.fr
+*/
+
+#include "/Developer/SDKs/MacOSX10.3.0.sdk/usr/include/getopt.h"
diff --git a/config/os/macosx/ipc.h b/config/os/macosx/ipc.h
new file mode 100644
index 0000000..621196e
--- /dev/null
+++ b/config/os/macosx/ipc.h
@@ -0,0 +1,186 @@
+/*
+ Copyright © Grame 2003
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+ Grame Research Laboratory, 9, rue du Garet 69001 Lyon - France
+ grame@rd.grame.fr
+*/
+
+#ifndef __ipc__
+#define __ipc__
+
+#include <mach/mach_error.h>
+#include <servers/bootstrap.h>
+#include <jack/internal.h>
+#include <jack/engine.h>
+#include <libjack/local.h> /* JOQ: fix me */
+
+/*
+ Copyright © Grame 2003
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+ Grame Research Laboratory, 9, rue du Garet 69001 Lyon - France
+ grame@rd.grame.fr
+*/
+
+/*
+ RPC without time out can put the jack server in a blocked state
+ (waiting for the client answer) when a client is killed. The
+ mach_msg function does not return any error in this case. Using
+ time out solve the problem but does not seems really satisfactory.
+*/
+
+#define WAIT 25 /* in millisecond */
+
+static inline int
+jack_client_resume(jack_client_internal_t *client)
+{
+ mach_msg_header_t *head = &client->message.header;
+ int err;
+
+ if (!client->running) {
+ err = mach_msg (head, MACH_RCV_MSG, 0, sizeof(client->message),
+ client->serverport, 0, MACH_PORT_NULL);
+ if (err) {
+ jack_error("jack_client_resume: priming receive error: %s\n",
+ mach_error_string(err));
+ return -1;
+ }
+ client->running = TRUE;
+ }else {
+ /* remote port is already the send-once he sent us */
+ head->msgh_bits = MACH_MSGH_BITS(MACH_MSG_TYPE_MOVE_SEND_ONCE, 0);
+ head->msgh_local_port = MACH_PORT_NULL;
+ head->msgh_size = sizeof(mach_msg_header_t);
+
+ err = mach_msg(head, (MACH_SEND_MSG|MACH_RCV_MSG|
+ MACH_SEND_TIMEOUT|MACH_RCV_TIMEOUT),
+ sizeof(*head), sizeof(client->message),
+ client->serverport, WAIT, MACH_PORT_NULL);
+
+ if (err) {
+
+ /*
+ switch(err) {
+ case MACH_SEND_TIMED_OUT:
+ jack_error("MACH_SEND_TIMED_OUT %s\n",
+ client->control->name);
+ break;
+
+ case MACH_RCV_TIMED_OUT:
+ jack_error("MACH_RCV_TIMED_OUT %s\n",
+ client->control->name);
+ break;
+
+ case MACH_SEND_INVALID_DEST:
+ jack_error("MACH_SEND_INVALID_DEST %s\n",
+ client->control->name);
+ break;
+ }
+ */
+
+ jack_error("jack_client_resume: send error for %s\n",
+ mach_error_string(err));
+ return err;
+ }
+ }
+
+ return 0;
+}
+
+static inline int
+jack_client_suspend(jack_client_t * client)
+{
+ int err = 0;
+ mach_msg_header_t * head = &client->message.header;
+
+ head->msgh_bits = MACH_MSGH_BITS(MACH_MSG_TYPE_COPY_SEND,
+ MACH_MSG_TYPE_MAKE_SEND_ONCE);
+ head->msgh_remote_port = client->serverport;
+ head->msgh_local_port = client->replyport;
+ head->msgh_size = sizeof(mach_msg_header_t);
+
+ err = mach_msg(head, MACH_SEND_MSG|MACH_RCV_MSG|MACH_SEND_TIMEOUT,
+ sizeof(mach_msg_header_t), sizeof(client->message),
+ client->replyport, WAIT, MACH_PORT_NULL);
+
+ if (err) {
+ jack_error("jack_client_suspend: RPC error: %s\n",
+ mach_error_string(err));
+ return -1;
+ }
+
+ return 0;
+}
+
+static inline void
+allocate_mach_serverport(jack_engine_t * engine, jack_client_internal_t *client)
+{
+ char buf[256];
+ snprintf(buf, 256, "JackMachPort_%d", engine->portnum);
+
+ if (mach_port_allocate(engine->servertask, MACH_PORT_RIGHT_RECEIVE,
+ &client->serverport)){
+ jack_error("allocate_mach_serverport: can't allocate mach port");
+ }
+
+ if (mach_port_insert_right(engine->servertask, client->serverport,
+ client->serverport, MACH_MSG_TYPE_MAKE_SEND)){
+ jack_error("allocate_mach_serverport: error inserting mach rights");
+ }
+
+ if (bootstrap_register(engine->bp, buf, client->serverport)){
+ jack_error("allocate_mach_serverport: can't check in mach port");
+ }
+
+ client->portnum = engine->portnum;
+ engine->portnum++;
+}
+
+static inline int
+allocate_mach_clientport(jack_client_t * client, int portnum)
+{
+ char buf[256];
+ snprintf(buf, 256, "JackMachPort_%d", portnum);
+
+ if (bootstrap_look_up(client->bp, buf, &client->serverport)){
+ jack_error ("allocate_mach_clientport: can't find mach server port");
+ return -1;
+ }
+
+ if (mach_port_allocate(client->clienttask, MACH_PORT_RIGHT_RECEIVE,
+ &client->replyport)){
+ jack_error("allocate_mach_clientport: can't allocate mach port");
+ return -1;
+ }
+
+ return 0;
+}
+
+#endif /* __ipc__ */
diff --git a/config/os/macosx/jack.xcode/project.pbxproj b/config/os/macosx/jack.xcode/project.pbxproj
new file mode 100644
index 0000000..a76e7d0
--- /dev/null
+++ b/config/os/macosx/jack.xcode/project.pbxproj
@@ -0,0 +1,1326 @@
+// !$*UTF8*$!
+{
+ archiveVersion = 1;
+ classes = {
+ };
+ objectVersion = 39;
+ objects = {
+ 014CEA520018CE5811CA2923 = {
+ buildRules = (
+ );
+ buildSettings = {
+ COPY_PHASE_STRIP = NO;
+ GCC_DYNAMIC_NO_PIC = NO;
+ GCC_ENABLE_FIX_AND_CONTINUE = YES;
+ GCC_GENERATE_DEBUGGING_SYMBOLS = YES;
+ GCC_OPTIMIZATION_LEVEL = 0;
+ OPTIMIZATION_CFLAGS = "-O0";
+ ZERO_LINK = YES;
+ };
+ isa = PBXBuildStyle;
+ name = Development;
+ };
+ 014CEA530018CE5811CA2923 = {
+ buildRules = (
+ );
+ buildSettings = {
+ COPY_PHASE_STRIP = YES;
+ GCC_ENABLE_FIX_AND_CONTINUE = NO;
+ ZERO_LINK = NO;
+ };
+ isa = PBXBuildStyle;
+ name = Deployment;
+ };
+//010
+//011
+//012
+//013
+//014
+//030
+//031
+//032
+//033
+//034
+ 034768E8FF38A79811DB9C8B = {
+ explicitFileType = "compiled.mach-o.executable";
+ fallbackIsa = PBXFileReference;
+ isa = PBXExecutableFileReference;
+ path = jackd;
+ refType = 3;
+ sourceTree = BUILT_PRODUCTS_DIR;
+ };
+//030
+//031
+//032
+//033
+//034
+//080
+//081
+//082
+//083
+//084
+ 08FB7793FE84155DC02AAC07 = {
+ buildSettings = {
+ };
+ buildStyles = (
+ 014CEA520018CE5811CA2923,
+ 014CEA530018CE5811CA2923,
+ );
+ hasScannedForEncodings = 1;
+ isa = PBXProject;
+ mainGroup = 08FB7794FE84155DC02AAC07;
+ projectDirPath = "";
+ targets = (
+ 08FB779FFE84155DC02AAC07,
+ 4BA1CADE0470D14500053105,
+ 4BBB87300406EF300019BE76,
+ 4BCA2602040B8B9400053105,
+ 4BF8712F040BDE8200053105,
+ 4BA1CB000470D38800053105,
+ 4BA1E4570442D99D00053105,
+ );
+ };
+ 08FB7794FE84155DC02AAC07 = {
+ children = (
+ 4BA9D903040E0CC200053105,
+ 4B6CBA33041F4DDF00053105,
+ 4B6AF278041F4DBC00053105,
+ 4BA716600408E047004F4E3A,
+ 4BA7165F0408DFF5004F4E3A,
+ 08FB7795FE84155DC02AAC07,
+ 1AB674ADFE9D54B511CA2CBB,
+ );
+ isa = PBXGroup;
+ name = jackd;
+ refType = 4;
+ sourceTree = "<group>";
+ };
+ 08FB7795FE84155DC02AAC07 = {
+ children = (
+ 4B117C6305DD0C8000B5DA5A,
+ 4B117C6605DD0C8700B5DA5A,
+ 4B117C6905DD0C8D00B5DA5A,
+ 4B117C6C05DD0C9400B5DA5A,
+ 4B117C6F05DD0C9900B5DA5A,
+ 4B117C7205DD0C9D00B5DA5A,
+ 4B117C7505DD0CA000B5DA5A,
+ );
+ isa = PBXGroup;
+ name = Client;
+ refType = 4;
+ sourceTree = "<group>";
+ };
+ 08FB779FFE84155DC02AAC07 = {
+ buildPhases = (
+ 08FB77A0FE84155DC02AAC07,
+ 08FB77A1FE84155DC02AAC07,
+ 08FB77A3FE84155DC02AAC07,
+ 08FB77A5FE84155DC02AAC07,
+ C6A0FF2D029079AD04C91782,
+ );
+ buildSettings = {
+ FRAMEWORK_SEARCH_PATHS = "";
+ HEADER_SEARCH_PATHS = "../../../ ../../";
+ INSTALL_PATH = "$(HOME)/bin";
+ LIBRARY_SEARCH_PATHS = "";
+ OPTIMIZATION_CFLAGS = "-O3";
+ OTHER_LDFLAGS = "-framework CoreAudio -ldl ";
+ OTHER_REZFLAGS = "";
+ PRODUCT_NAME = jackd;
+ REZ_EXECUTABLE = YES;
+ SECTORDER_FLAGS = "";
+ WARNING_CFLAGS = "-Wmost -Wno-four-char-constants -Wno-unknown-pragmas";
+ };
+ dependencies = (
+ );
+ isa = PBXToolTarget;
+ name = Jackd;
+ productInstallPath = "$(HOME)/bin";
+ productName = jackd;
+ productReference = 034768E8FF38A79811DB9C8B;
+ };
+ 08FB77A0FE84155DC02AAC07 = {
+ buildActionMask = 2147483647;
+ files = (
+ 4B16FF920467B5A000053105,
+ 4BB9E095046FADED00053105,
+ 4B5B51EE047D353A00053105,
+ 4BAA76A7047E0D5200053105,
+ 4B783E1B049F824D00053105,
+ 4B117C7B05DD0CC000B5DA5A,
+ 4B4DCBA205DD234100DC3452,
+ 4B4DCBA505DD234800DC3452,
+ 4B4DCBA805DD235B00DC3452,
+ 4BA39A1F05DD2C63008919E8,
+ 4BA39A2305DD2CA5008919E8,
+ );
+ isa = PBXHeadersBuildPhase;
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 08FB77A1FE84155DC02AAC07 = {
+ buildActionMask = 2147483647;
+ files = (
+ 4B117C5905DD0C3600B5DA5A,
+ 4B117C5B05DD0C4100B5DA5A,
+ 4B117C5E05DD0C5B00B5DA5A,
+ 4B117C6405DD0C8000B5DA5A,
+ 4B117C6705DD0C8700B5DA5A,
+ 4B117C6A05DD0C8D00B5DA5A,
+ 4B117C6D05DD0C9400B5DA5A,
+ 4B117C7005DD0C9900B5DA5A,
+ 4B117C7305DD0C9D00B5DA5A,
+ 4B117C7605DD0CA000B5DA5A,
+ );
+ isa = PBXSourcesBuildPhase;
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 08FB77A3FE84155DC02AAC07 = {
+ buildActionMask = 2147483647;
+ files = (
+ );
+ isa = PBXFrameworksBuildPhase;
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 08FB77A5FE84155DC02AAC07 = {
+ buildActionMask = 2147483647;
+ files = (
+ );
+ isa = PBXRezBuildPhase;
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+//080
+//081
+//082
+//083
+//084
+//1A0
+//1A1
+//1A2
+//1A3
+//1A4
+ 1AB674ADFE9D54B511CA2CBB = {
+ children = (
+ 034768E8FF38A79811DB9C8B,
+ 4BBB87310406EF300019BE76,
+ 4BCA2603040B8B9400053105,
+ 4BF87130040BDE8200053105,
+ 4BA1E4580442D99D00053105,
+ 4BA1CADF0470D14500053105,
+ 4BA1CB010470D38800053105,
+ );
+ isa = PBXGroup;
+ name = Products;
+ refType = 4;
+ sourceTree = "<group>";
+ };
+//1A0
+//1A1
+//1A2
+//1A3
+//1A4
+//4B0
+//4B1
+//4B2
+//4B3
+//4B4
+ 4B099343041FB67A00053105 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ lastKnownFileType = sourcecode.c.h;
+ path = fakepoll.h;
+ refType = 4;
+ sourceTree = "<group>";
+ };
+ 4B117C5805DD0C3600B5DA5A = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ lastKnownFileType = sourcecode.c.c;
+ name = jackd.c;
+ path = ../../../jackd/jackd.c;
+ refType = 2;
+ sourceTree = SOURCE_ROOT;
+ };
+ 4B117C5905DD0C3600B5DA5A = {
+ fileRef = 4B117C5805DD0C3600B5DA5A;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ 4B117C5A05DD0C4100B5DA5A = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ lastKnownFileType = sourcecode.c.c;
+ name = engine.c;
+ path = ../../../jackd/engine.c;
+ refType = 2;
+ sourceTree = SOURCE_ROOT;
+ };
+ 4B117C5B05DD0C4100B5DA5A = {
+ fileRef = 4B117C5A05DD0C4100B5DA5A;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ 4B117C5C05DD0C4100B5DA5A = {
+ fileRef = 4B117C5A05DD0C4100B5DA5A;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ 4B117C5D05DD0C5B00B5DA5A = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ lastKnownFileType = sourcecode.c.c;
+ name = transengine.c;
+ path = ../../../jackd/transengine.c;
+ refType = 2;
+ sourceTree = SOURCE_ROOT;
+ };
+ 4B117C5E05DD0C5B00B5DA5A = {
+ fileRef = 4B117C5D05DD0C5B00B5DA5A;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ 4B117C5F05DD0C5B00B5DA5A = {
+ fileRef = 4B117C5D05DD0C5B00B5DA5A;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ 4B117C6305DD0C8000B5DA5A = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ lastKnownFileType = sourcecode.c.c;
+ name = port.c;
+ path = ../../../libjack/port.c;
+ refType = 2;
+ sourceTree = SOURCE_ROOT;
+ };
+ 4B117C6405DD0C8000B5DA5A = {
+ fileRef = 4B117C6305DD0C8000B5DA5A;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ 4B117C6505DD0C8000B5DA5A = {
+ fileRef = 4B117C6305DD0C8000B5DA5A;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ 4B117C6605DD0C8700B5DA5A = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ lastKnownFileType = sourcecode.c.c;
+ name = pool.c;
+ path = ../../../libjack/pool.c;
+ refType = 2;
+ sourceTree = SOURCE_ROOT;
+ };
+ 4B117C6705DD0C8700B5DA5A = {
+ fileRef = 4B117C6605DD0C8700B5DA5A;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ 4B117C6805DD0C8700B5DA5A = {
+ fileRef = 4B117C6605DD0C8700B5DA5A;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ 4B117C6905DD0C8D00B5DA5A = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ lastKnownFileType = sourcecode.c.c;
+ name = driver.c;
+ path = ../../../libjack/driver.c;
+ refType = 2;
+ sourceTree = SOURCE_ROOT;
+ };
+ 4B117C6A05DD0C8D00B5DA5A = {
+ fileRef = 4B117C6905DD0C8D00B5DA5A;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ 4B117C6B05DD0C8D00B5DA5A = {
+ fileRef = 4B117C6905DD0C8D00B5DA5A;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ 4B117C6C05DD0C9400B5DA5A = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ lastKnownFileType = sourcecode.c.c;
+ name = ringbuffer.c;
+ path = ../../../libjack/ringbuffer.c;
+ refType = 2;
+ sourceTree = SOURCE_ROOT;
+ };
+ 4B117C6D05DD0C9400B5DA5A = {
+ fileRef = 4B117C6C05DD0C9400B5DA5A;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ 4B117C6E05DD0C9400B5DA5A = {
+ fileRef = 4B117C6C05DD0C9400B5DA5A;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ 4B117C6F05DD0C9900B5DA5A = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ lastKnownFileType = sourcecode.c.c;
+ name = transclient.c;
+ path = ../../../libjack/transclient.c;
+ refType = 2;
+ sourceTree = SOURCE_ROOT;
+ };
+ 4B117C7005DD0C9900B5DA5A = {
+ fileRef = 4B117C6F05DD0C9900B5DA5A;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ 4B117C7105DD0C9900B5DA5A = {
+ fileRef = 4B117C6F05DD0C9900B5DA5A;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ 4B117C7205DD0C9D00B5DA5A = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ lastKnownFileType = sourcecode.c.c;
+ name = shm.c;
+ path = ../../../libjack/shm.c;
+ refType = 2;
+ sourceTree = SOURCE_ROOT;
+ };
+ 4B117C7305DD0C9D00B5DA5A = {
+ fileRef = 4B117C7205DD0C9D00B5DA5A;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ 4B117C7405DD0C9D00B5DA5A = {
+ fileRef = 4B117C7205DD0C9D00B5DA5A;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ 4B117C7505DD0CA000B5DA5A = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ lastKnownFileType = sourcecode.c.c;
+ name = client.c;
+ path = ../../../libjack/client.c;
+ refType = 2;
+ sourceTree = SOURCE_ROOT;
+ };
+ 4B117C7605DD0CA000B5DA5A = {
+ fileRef = 4B117C7505DD0CA000B5DA5A;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ 4B117C7705DD0CA000B5DA5A = {
+ fileRef = 4B117C7505DD0CA000B5DA5A;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ 4B117C7A05DD0CC000B5DA5A = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ lastKnownFileType = sourcecode.c.h;
+ name = config.h;
+ path = ../../../config.h;
+ refType = 2;
+ sourceTree = SOURCE_ROOT;
+ };
+ 4B117C7B05DD0CC000B5DA5A = {
+ fileRef = 4B117C7A05DD0CC000B5DA5A;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ 4B117C7C05DD0CC000B5DA5A = {
+ fileRef = 4B117C7A05DD0CC000B5DA5A;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ 4B117C7F05DD0D7700B5DA5A = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ lastKnownFileType = sourcecode.c.c;
+ name = portaudio_driver.c;
+ path = ../../../drivers/portaudio/portaudio_driver.c;
+ refType = 2;
+ sourceTree = SOURCE_ROOT;
+ };
+ 4B117C8005DD0D7700B5DA5A = {
+ fileRef = 4B117C7F05DD0D7700B5DA5A;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ 4B117C8105DD0D7D00B5DA5A = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ lastKnownFileType = sourcecode.c.h;
+ name = portaudio_driver.h;
+ path = ../../../drivers/portaudio/portaudio_driver.h;
+ refType = 2;
+ sourceTree = SOURCE_ROOT;
+ };
+ 4B117C8205DD0D7D00B5DA5A = {
+ fileRef = 4B117C8105DD0D7D00B5DA5A;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ 4B117C8305DD0DA700B5DA5A = {
+ fileRef = 4B117C6905DD0C8D00B5DA5A;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ 4B16FF900467B5A000053105 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ lastKnownFileType = sourcecode.c.h;
+ path = pThreadUtilities.h;
+ refType = 2;
+ sourceTree = SOURCE_ROOT;
+ };
+ 4B16FF920467B5A000053105 = {
+ fileRef = 4B16FF900467B5A000053105;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ 4B4DCB9405DD229F00DC3452 = {
+ fileRef = 4B117C6305DD0C8000B5DA5A;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ 4B4DCB9505DD22AF00DC3452 = {
+ fileRef = 4B117C6605DD0C8700B5DA5A;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ 4B4DCB9705DD22BB00DC3452 = {
+ fileRef = 4B117C7505DD0CA000B5DA5A;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ 4B4DCB9805DD22C300DC3452 = {
+ fileRef = 4B117C7205DD0C9D00B5DA5A;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ 4B4DCB9905DD22C900DC3452 = {
+ fileRef = 4B117C6F05DD0C9900B5DA5A;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ 4B4DCBA105DD234100DC3452 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ lastKnownFileType = sourcecode.c.h;
+ name = ringbuffer.h;
+ path = ../../../jack/ringbuffer.h;
+ refType = 2;
+ sourceTree = SOURCE_ROOT;
+ };
+ 4B4DCBA205DD234100DC3452 = {
+ fileRef = 4B4DCBA105DD234100DC3452;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ 4B4DCBA305DD234100DC3452 = {
+ fileRef = 4B4DCBA105DD234100DC3452;
+ isa = PBXBuildFile;
+ settings = {
+ ATTRIBUTES = (
+ Public,
+ );
+ };
+ };
+ 4B4DCBA405DD234800DC3452 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ lastKnownFileType = sourcecode.c.h;
+ name = transport.h;
+ path = ../../../jack/transport.h;
+ refType = 2;
+ sourceTree = SOURCE_ROOT;
+ };
+ 4B4DCBA505DD234800DC3452 = {
+ fileRef = 4B4DCBA405DD234800DC3452;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ 4B4DCBA605DD234800DC3452 = {
+ fileRef = 4B4DCBA405DD234800DC3452;
+ isa = PBXBuildFile;
+ settings = {
+ ATTRIBUTES = (
+ Public,
+ );
+ };
+ };
+ 4B4DCBA705DD235B00DC3452 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ lastKnownFileType = sourcecode.c.h;
+ name = types.h;
+ path = ../../../jack/types.h;
+ refType = 2;
+ sourceTree = SOURCE_ROOT;
+ };
+ 4B4DCBA805DD235B00DC3452 = {
+ fileRef = 4B4DCBA705DD235B00DC3452;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ 4B4DCBA905DD235B00DC3452 = {
+ fileRef = 4B4DCBA705DD235B00DC3452;
+ isa = PBXBuildFile;
+ settings = {
+ ATTRIBUTES = (
+ Public,
+ );
+ };
+ };
+ 4B4DCBAE05DD23DE00DC3452 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ lastKnownFileType = sourcecode.c.c;
+ name = metro.c;
+ path = "../../../example-clients/metro.c";
+ refType = 2;
+ sourceTree = SOURCE_ROOT;
+ };
+ 4B4DCBAF05DD23DE00DC3452 = {
+ fileRef = 4B4DCBAE05DD23DE00DC3452;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ 4B4DCBB205DD243A00DC3452 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ lastKnownFileType = sourcecode.c.c;
+ name = connect.c;
+ path = "../../../example-clients/connect.c";
+ refType = 2;
+ sourceTree = SOURCE_ROOT;
+ };
+ 4B4DCBB305DD243A00DC3452 = {
+ fileRef = 4B4DCBB205DD243A00DC3452;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ 4B4DCBB605DD248300DC3452 = {
+ fileRef = 4B4DCBB205DD243A00DC3452;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ 4B4DCBB905DD249E00DC3452 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ lastKnownFileType = sourcecode.c.c;
+ name = lsp.c;
+ path = "../../../example-clients/lsp.c";
+ refType = 2;
+ sourceTree = SOURCE_ROOT;
+ };
+ 4B4DCBBA05DD249E00DC3452 = {
+ fileRef = 4B4DCBB905DD249E00DC3452;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ 4B4DCBBD05DD24CD00DC3452 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ lastKnownFileType = sourcecode.c.c;
+ name = capture_client.c;
+ path = "../../../example-clients/capture_client.c";
+ refType = 2;
+ sourceTree = SOURCE_ROOT;
+ };
+ 4B5B51EA047D353A00053105 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ lastKnownFileType = sourcecode.c.h;
+ path = ipc.h;
+ refType = 2;
+ sourceTree = SOURCE_ROOT;
+ };
+ 4B5B51EC047D353A00053105 = {
+ fileRef = 4B5B51EA047D353A00053105;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ 4B5B51EE047D353A00053105 = {
+ fileRef = 4B5B51EA047D353A00053105;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ 4B5B51F0047D353A00053105 = {
+ fileRef = 4B5B51EA047D353A00053105;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ 4B6AF278041F4DBC00053105 = {
+ children = (
+ 4B4DCBAE05DD23DE00DC3452,
+ 4B4DCBB205DD243A00DC3452,
+ 4B4DCBB905DD249E00DC3452,
+ 4B4DCBBD05DD24CD00DC3452,
+ );
+ isa = PBXGroup;
+ name = Samples;
+ refType = 4;
+ sourceTree = "<group>";
+ };
+ 4B6CBA33041F4DDF00053105 = {
+ children = (
+ 4B117C7A05DD0CC000B5DA5A,
+ 4B16FF900467B5A000053105,
+ 4B099343041FB67A00053105,
+ 4B5B51EA047D353A00053105,
+ 4BB9E091046FADED00053105,
+ 4BAA76A6047E0D5200053105,
+ );
+ isa = PBXGroup;
+ name = Porting_code;
+ refType = 4;
+ sourceTree = "<group>";
+ };
+ 4B783E1B049F824D00053105 = {
+ fileRef = 4B099343041FB67A00053105;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ 4BA1CAD90470D14500053105 = {
+ buildActionMask = 2147483647;
+ files = (
+ 4BA1CAE60470D1FB00053105,
+ 4BA1CAEA0470D1FD00053105,
+ 4B5B51F0047D353A00053105,
+ 4B117C7C05DD0CC000B5DA5A,
+ 4B4DCBA305DD234100DC3452,
+ 4B4DCBA605DD234800DC3452,
+ 4B4DCBA905DD235B00DC3452,
+ 4BA39A2005DD2C63008919E8,
+ 4BA39A2405DD2CA5008919E8,
+ );
+ isa = PBXHeadersBuildPhase;
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 4BA1CADA0470D14500053105 = {
+ buildActionMask = 2147483647;
+ files = (
+ );
+ isa = PBXResourcesBuildPhase;
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 4BA1CADB0470D14500053105 = {
+ buildActionMask = 2147483647;
+ files = (
+ 4B117C5C05DD0C4100B5DA5A,
+ 4B117C5F05DD0C5B00B5DA5A,
+ 4B117C6505DD0C8000B5DA5A,
+ 4B117C6805DD0C8700B5DA5A,
+ 4B117C6B05DD0C8D00B5DA5A,
+ 4B117C6E05DD0C9400B5DA5A,
+ 4B117C7105DD0C9900B5DA5A,
+ 4B117C7405DD0C9D00B5DA5A,
+ 4B117C7705DD0CA000B5DA5A,
+ );
+ isa = PBXSourcesBuildPhase;
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 4BA1CADC0470D14500053105 = {
+ buildActionMask = 2147483647;
+ files = (
+ );
+ isa = PBXFrameworksBuildPhase;
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 4BA1CADD0470D14500053105 = {
+ buildActionMask = 2147483647;
+ files = (
+ );
+ isa = PBXRezBuildPhase;
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 4BA1CADE0470D14500053105 = {
+ buildPhases = (
+ 4BA1CAD90470D14500053105,
+ 4BA1CADA0470D14500053105,
+ 4BA1CADB0470D14500053105,
+ 4BA1CADC0470D14500053105,
+ 4BA1CADD0470D14500053105,
+ );
+ buildSettings = {
+ DYLIB_COMPATIBILITY_VERSION = 1;
+ DYLIB_CURRENT_VERSION = 1;
+ FRAMEWORK_VERSION = A;
+ HEADER_SEARCH_PATHS = "../../ ../../../";
+ LIBRARY_SEARCH_PATHS = "";
+ OPTIMIZATION_CFLAGS = "-O3";
+ OTHER_CFLAGS = "-DOLD_TRANSPORT";
+ OTHER_LDFLAGS = "-framework CoreAudio ";
+ OTHER_LIBTOOL_FLAGS = "";
+ OTHER_REZFLAGS = "";
+ PRINCIPAL_CLASS = "";
+ PRODUCT_NAME = Jack;
+ SECTORDER_FLAGS = "";
+ WARNING_CFLAGS = "-Wmost -Wno-four-char-constants -Wno-unknown-pragmas";
+ WRAPPER_EXTENSION = framework;
+ };
+ dependencies = (
+ );
+ isa = PBXFrameworkTarget;
+ name = "Jack framework";
+ productInstallPath = "$(LOCAL_LIBRARY_DIR)/Frameworks";
+ productName = Jack;
+ productReference = 4BA1CADF0470D14500053105;
+ productSettingsXML = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>
+<!DOCTYPE plist PUBLIC \"-//Apple Computer//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">
+<plist version=\"1.0\">
+<dict>
+ <key>CFBundleDevelopmentRegion</key>
+ <string>English</string>
+ <key>CFBundleExecutable</key>
+ <string></string>
+ <key>CFBundleGetInfoString</key>
+ <string></string>
+ <key>CFBundleIconFile</key>
+ <string></string>
+ <key>CFBundleIdentifier</key>
+ <string></string>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+ <key>CFBundleName</key>
+ <string></string>
+ <key>CFBundlePackageType</key>
+ <string>FMWK</string>
+ <key>CFBundleShortVersionString</key>
+ <string></string>
+ <key>CFBundleSignature</key>
+ <string>????</string>
+ <key>CFBundleVersion</key>
+ <string>0.0.1d1</string>
+</dict>
+</plist>
+";
+ };
+ 4BA1CADF0470D14500053105 = {
+ explicitFileType = wrapper.framework;
+ fallbackIsa = PBXFileReference;
+ isa = PBXFrameworkReference;
+ path = Jack.framework;
+ refType = 3;
+ sourceTree = BUILT_PRODUCTS_DIR;
+ };
+ 4BA1CAE60470D1FB00053105 = {
+ fileRef = 4B16FF900467B5A000053105;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ 4BA1CAEA0470D1FD00053105 = {
+ fileRef = 4BB9E091046FADED00053105;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ 4BA1CAFC0470D38800053105 = {
+ buildActionMask = 2147483647;
+ files = (
+ );
+ isa = PBXHeadersBuildPhase;
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 4BA1CAFD0470D38800053105 = {
+ buildActionMask = 2147483647;
+ files = (
+ 4B4DCBB605DD248300DC3452,
+ );
+ isa = PBXSourcesBuildPhase;
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 4BA1CAFE0470D38800053105 = {
+ buildActionMask = 2147483647;
+ files = (
+ );
+ isa = PBXFrameworksBuildPhase;
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 4BA1CAFF0470D38800053105 = {
+ buildActionMask = 2147483647;
+ files = (
+ );
+ isa = PBXRezBuildPhase;
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 4BA1CB000470D38800053105 = {
+ buildPhases = (
+ 4BA1CAFC0470D38800053105,
+ 4BA1CAFD0470D38800053105,
+ 4BA1CAFE0470D38800053105,
+ 4BA1CAFF0470D38800053105,
+ );
+ buildSettings = {
+ OTHER_CFLAGS = "";
+ OTHER_LDFLAGS = "-framework Jack";
+ OTHER_REZFLAGS = "";
+ PRODUCT_NAME = jack_disconnect;
+ REZ_EXECUTABLE = YES;
+ SECTORDER_FLAGS = "";
+ WARNING_CFLAGS = "-Wmost -Wno-four-char-constants -Wno-unknown-pragmas";
+ };
+ dependencies = (
+ );
+ isa = PBXToolTarget;
+ name = jack_disconnect;
+ productInstallPath = /usr/local/bin;
+ productName = jack_disconnect;
+ productReference = 4BA1CB010470D38800053105;
+ };
+ 4BA1CB010470D38800053105 = {
+ explicitFileType = "compiled.mach-o.executable";
+ fallbackIsa = PBXFileReference;
+ isa = PBXExecutableFileReference;
+ path = jack_disconnect;
+ refType = 3;
+ sourceTree = BUILT_PRODUCTS_DIR;
+ };
+ 4BA1E4530442D99D00053105 = {
+ buildActionMask = 2147483647;
+ files = (
+ );
+ isa = PBXHeadersBuildPhase;
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 4BA1E4540442D99D00053105 = {
+ buildActionMask = 2147483647;
+ files = (
+ 4B4DCBBA05DD249E00DC3452,
+ );
+ isa = PBXSourcesBuildPhase;
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 4BA1E4550442D99D00053105 = {
+ buildActionMask = 2147483647;
+ files = (
+ );
+ isa = PBXFrameworksBuildPhase;
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 4BA1E4560442D99D00053105 = {
+ buildActionMask = 2147483647;
+ files = (
+ );
+ isa = PBXRezBuildPhase;
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 4BA1E4570442D99D00053105 = {
+ buildPhases = (
+ 4BA1E4530442D99D00053105,
+ 4BA1E4540442D99D00053105,
+ 4BA1E4550442D99D00053105,
+ 4BA1E4560442D99D00053105,
+ );
+ buildSettings = {
+ HEADER_SEARCH_PATHS = ../../;
+ OTHER_CFLAGS = "";
+ OTHER_LDFLAGS = "-framework Jack";
+ OTHER_REZFLAGS = "";
+ PRODUCT_NAME = jack_lsp;
+ REZ_EXECUTABLE = YES;
+ SECTORDER_FLAGS = "";
+ WARNING_CFLAGS = "-Wmost -Wno-four-char-constants -Wno-unknown-pragmas";
+ };
+ dependencies = (
+ );
+ isa = PBXToolTarget;
+ name = jack_lsp;
+ productInstallPath = /usr/local/bin;
+ productName = jack_lsp;
+ productReference = 4BA1E4580442D99D00053105;
+ };
+ 4BA1E4580442D99D00053105 = {
+ explicitFileType = "compiled.mach-o.executable";
+ fallbackIsa = PBXFileReference;
+ isa = PBXExecutableFileReference;
+ path = jack_lsp;
+ refType = 3;
+ sourceTree = BUILT_PRODUCTS_DIR;
+ };
+ 4BA39A1E05DD2C63008919E8 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ lastKnownFileType = sourcecode.c.h;
+ name = timestamps.h;
+ path = ../../../jack/timestamps.h;
+ refType = 2;
+ sourceTree = SOURCE_ROOT;
+ };
+ 4BA39A1F05DD2C63008919E8 = {
+ fileRef = 4BA39A1E05DD2C63008919E8;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ 4BA39A2005DD2C63008919E8 = {
+ fileRef = 4BA39A1E05DD2C63008919E8;
+ isa = PBXBuildFile;
+ settings = {
+ ATTRIBUTES = (
+ Public,
+ );
+ };
+ };
+ 4BA39A2205DD2CA5008919E8 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ lastKnownFileType = sourcecode.c.h;
+ name = jack.h;
+ path = ../../../jack/jack.h;
+ refType = 2;
+ sourceTree = SOURCE_ROOT;
+ };
+ 4BA39A2305DD2CA5008919E8 = {
+ fileRef = 4BA39A2205DD2CA5008919E8;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ 4BA39A2405DD2CA5008919E8 = {
+ fileRef = 4BA39A2205DD2CA5008919E8;
+ isa = PBXBuildFile;
+ settings = {
+ ATTRIBUTES = (
+ Public,
+ );
+ };
+ };
+ 4BA7165F0408DFF5004F4E3A = {
+ children = (
+ 4B117C5805DD0C3600B5DA5A,
+ 4B117C5A05DD0C4100B5DA5A,
+ 4B117C5D05DD0C5B00B5DA5A,
+ );
+ isa = PBXGroup;
+ name = Server;
+ refType = 4;
+ sourceTree = "<group>";
+ };
+ 4BA716600408E047004F4E3A = {
+ children = (
+ 4B117C7F05DD0D7700B5DA5A,
+ 4B117C8105DD0D7D00B5DA5A,
+ );
+ isa = PBXGroup;
+ name = Driver;
+ refType = 4;
+ sourceTree = "<group>";
+ };
+ 4BA9D903040E0CC200053105 = {
+ children = (
+ 4BA39A2205DD2CA5008919E8,
+ 4BA39A1E05DD2C63008919E8,
+ 4B4DCBA105DD234100DC3452,
+ 4B4DCBA405DD234800DC3452,
+ 4B4DCBA705DD235B00DC3452,
+ );
+ isa = PBXGroup;
+ name = Headers;
+ refType = 4;
+ sourceTree = "<group>";
+ };
+ 4BAA76A6047E0D5200053105 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ lastKnownFileType = sourcecode.c.h;
+ path = getopt.h;
+ refType = 2;
+ sourceTree = SOURCE_ROOT;
+ };
+ 4BAA76A7047E0D5200053105 = {
+ fileRef = 4BAA76A6047E0D5200053105;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ 4BB9E091046FADED00053105 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ lastKnownFileType = sourcecode.c.h;
+ path = mach_port.h;
+ refType = 4;
+ sourceTree = "<group>";
+ };
+ 4BB9E095046FADED00053105 = {
+ fileRef = 4BB9E091046FADED00053105;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ 4BB9E097046FB05700053105 = {
+ fileRef = 4BB9E091046FADED00053105;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ 4BBB872C0406EF300019BE76 = {
+ buildActionMask = 2147483647;
+ files = (
+ 4BB9E097046FB05700053105,
+ 4B5B51EC047D353A00053105,
+ 4B117C8205DD0D7D00B5DA5A,
+ );
+ isa = PBXHeadersBuildPhase;
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 4BBB872D0406EF300019BE76 = {
+ buildActionMask = 2147483647;
+ files = (
+ 4B117C8005DD0D7700B5DA5A,
+ 4B117C8305DD0DA700B5DA5A,
+ 4B4DCB9405DD229F00DC3452,
+ 4B4DCB9505DD22AF00DC3452,
+ 4B4DCB9705DD22BB00DC3452,
+ 4B4DCB9805DD22C300DC3452,
+ 4B4DCB9905DD22C900DC3452,
+ );
+ isa = PBXSourcesBuildPhase;
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 4BBB872E0406EF300019BE76 = {
+ buildActionMask = 2147483647;
+ files = (
+ );
+ isa = PBXFrameworksBuildPhase;
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 4BBB872F0406EF300019BE76 = {
+ buildActionMask = 2147483647;
+ files = (
+ );
+ isa = PBXRezBuildPhase;
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 4BBB87300406EF300019BE76 = {
+ buildPhases = (
+ 4BBB872C0406EF300019BE76,
+ 4BBB872D0406EF300019BE76,
+ 4BBB872E0406EF300019BE76,
+ 4BBB872F0406EF300019BE76,
+ );
+ buildSettings = {
+ DYLIB_COMPATIBILITY_VERSION = 1;
+ DYLIB_CURRENT_VERSION = 1;
+ HEADER_SEARCH_PATHS = "../../ ../../../";
+ LIBRARY_SEARCH_PATHS = "";
+ LIBRARY_STYLE = BUNDLE;
+ OPTIMIZATION_CFLAGS = "-O3";
+ OTHER_LDFLAGS = "-framework PortAudio -framework CoreAudio ";
+ OTHER_LIBTOOL_FLAGS = "";
+ OTHER_REZFLAGS = "";
+ PRODUCT_NAME = jack_portaudio.so;
+ REZ_EXECUTABLE = YES;
+ SECTORDER_FLAGS = "";
+ WARNING_CFLAGS = "-Wmost -Wno-four-char-constants -Wno-unknown-pragmas";
+ };
+ dependencies = (
+ );
+ isa = PBXLibraryTarget;
+ name = driver;
+ productInstallPath = /usr/local/lib;
+ productName = driver;
+ productReference = 4BBB87310406EF300019BE76;
+ };
+ 4BBB87310406EF300019BE76 = {
+ explicitFileType = "compiled.mach-o.dylib";
+ fallbackIsa = PBXFileReference;
+ isa = PBXLibraryReference;
+ path = jack_portaudio.so;
+ refType = 3;
+ sourceTree = BUILT_PRODUCTS_DIR;
+ };
+ 4BCA25FE040B8B9400053105 = {
+ buildActionMask = 2147483647;
+ files = (
+ );
+ isa = PBXHeadersBuildPhase;
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 4BCA25FF040B8B9400053105 = {
+ buildActionMask = 2147483647;
+ files = (
+ 4B4DCBAF05DD23DE00DC3452,
+ );
+ isa = PBXSourcesBuildPhase;
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 4BCA2600040B8B9400053105 = {
+ buildActionMask = 2147483647;
+ files = (
+ );
+ isa = PBXFrameworksBuildPhase;
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 4BCA2601040B8B9400053105 = {
+ buildActionMask = 2147483647;
+ files = (
+ );
+ isa = PBXRezBuildPhase;
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 4BCA2602040B8B9400053105 = {
+ buildPhases = (
+ 4BCA25FE040B8B9400053105,
+ 4BCA25FF040B8B9400053105,
+ 4BCA2600040B8B9400053105,
+ 4BCA2601040B8B9400053105,
+ );
+ buildSettings = {
+ HEADER_SEARCH_PATHS = ../../;
+ OPTIMIZATION_CFLAGS = "-O0";
+ OTHER_CFLAGS = "";
+ OTHER_LDFLAGS = "-framework Jack";
+ OTHER_REZFLAGS = "";
+ PREBINDING = NO;
+ PRODUCT_NAME = jack_metro;
+ REZ_EXECUTABLE = YES;
+ SECTORDER_FLAGS = "";
+ WARNING_CFLAGS = "-Wmost -Wno-four-char-constants -Wno-unknown-pragmas";
+ };
+ dependencies = (
+ );
+ isa = PBXToolTarget;
+ name = jack_metro;
+ productInstallPath = /usr/local/bin;
+ productName = metro;
+ productReference = 4BCA2603040B8B9400053105;
+ };
+ 4BCA2603040B8B9400053105 = {
+ explicitFileType = "compiled.mach-o.executable";
+ fallbackIsa = PBXFileReference;
+ isa = PBXExecutableFileReference;
+ path = jack_metro;
+ refType = 3;
+ sourceTree = BUILT_PRODUCTS_DIR;
+ };
+ 4BF8712B040BDE8200053105 = {
+ buildActionMask = 2147483647;
+ files = (
+ );
+ isa = PBXHeadersBuildPhase;
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 4BF8712C040BDE8200053105 = {
+ buildActionMask = 2147483647;
+ files = (
+ 4B4DCBB305DD243A00DC3452,
+ );
+ isa = PBXSourcesBuildPhase;
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 4BF8712D040BDE8200053105 = {
+ buildActionMask = 2147483647;
+ files = (
+ );
+ isa = PBXFrameworksBuildPhase;
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 4BF8712E040BDE8200053105 = {
+ buildActionMask = 2147483647;
+ files = (
+ );
+ isa = PBXRezBuildPhase;
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 4BF8712F040BDE8200053105 = {
+ buildPhases = (
+ 4BF8712B040BDE8200053105,
+ 4BF8712C040BDE8200053105,
+ 4BF8712D040BDE8200053105,
+ 4BF8712E040BDE8200053105,
+ );
+ buildSettings = {
+ HEADER_SEARCH_PATHS = "";
+ OTHER_CFLAGS = "";
+ OTHER_LDFLAGS = "-framework Jack";
+ OTHER_REZFLAGS = "";
+ PRODUCT_NAME = jack_connect;
+ REZ_EXECUTABLE = YES;
+ SECTORDER_FLAGS = "";
+ WARNING_CFLAGS = "-Wmost -Wno-four-char-constants -Wno-unknown-pragmas";
+ };
+ dependencies = (
+ );
+ isa = PBXToolTarget;
+ name = jack_connect;
+ productInstallPath = /usr/local/bin;
+ productName = connect;
+ productReference = 4BF87130040BDE8200053105;
+ };
+ 4BF87130040BDE8200053105 = {
+ explicitFileType = "compiled.mach-o.executable";
+ fallbackIsa = PBXFileReference;
+ isa = PBXExecutableFileReference;
+ path = jack_connect;
+ refType = 3;
+ sourceTree = BUILT_PRODUCTS_DIR;
+ };
+//4B0
+//4B1
+//4B2
+//4B3
+//4B4
+//C60
+//C61
+//C62
+//C63
+//C64
+ C6A0FF2D029079AD04C91782 = {
+ buildActionMask = 8;
+ dstPath = /usr/share/man/man1/;
+ dstSubfolderSpec = 0;
+ files = (
+ );
+ isa = PBXCopyFilesBuildPhase;
+ runOnlyForDeploymentPostprocessing = 1;
+ };
+ };
+ rootObject = 08FB7793FE84155DC02AAC07;
+}
diff --git a/config/os/macosx/mach_port.h b/config/os/macosx/mach_port.h
new file mode 100644
index 0000000..efa4839
--- /dev/null
+++ b/config/os/macosx/mach_port.h
@@ -0,0 +1,35 @@
+/*
+ Copyright © Grame 2003
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+ Grame Research Laboratory, 9, rue du Garet 69001 Lyon - France
+ grame@rd.grame.fr
+*/
+
+#ifndef __mach_port__
+#define __mach_port__
+
+#include <mach/mach.h>
+#include <mach/mach_types.h>
+#include <mach/message.h>
+
+/* specific ressources for server/client real-time thread communication */
+typedef struct {
+ mach_msg_header_t header;
+ mach_msg_trailer_t trailer;
+} trivial_message;
+
+#endif \ No newline at end of file
diff --git a/config/os/macosx/os_defines.h b/config/os/macosx/os_defines.h
new file mode 100644
index 0000000..d73c63a
--- /dev/null
+++ b/config/os/macosx/os_defines.h
@@ -0,0 +1,39 @@
+/*
+ Copyright (C) 2004 Jack O'Quin
+
+ MacOS X specific defines.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 2.1 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+ $Id$
+*/
+
+#ifndef _jack_os_defines
+#define _jack_os_defines 1
+
+/* a bigger process stack makes the application crash... */
+#define JACK_THREAD_STACK_TOUCH 10000
+#define JACK_CPP_VARARGS_BROKEN 1
+#define JACK_USE_MACH_THREADS 1
+#define JACK_DO_NOT_MLOCK 1
+#define PORTAUDIO_H <PortAudio.h>
+#define GETOPT_H <sysdeps/getopt.h>
+
+/* MacOSX defines __POWERPC__ rather than __powerpc__ */
+#if defined(__POWERPC__) && !defined(__powerpc__)
+#define __powerpc__ __POWERPC__
+#endif
+
+#endif /* _jack_os_defines */
diff --git a/config/os/macosx/pThreadUtilities.h b/config/os/macosx/pThreadUtilities.h
new file mode 100644
index 0000000..bd1d1e8
--- /dev/null
+++ b/config/os/macosx/pThreadUtilities.h
@@ -0,0 +1,203 @@
+/*
+ Copyright: © Copyright 2002 Apple Computer, Inc. All rights
+ reserved.
+
+ Disclaimer: IMPORTANT: This Apple software is supplied to
+ you by Apple Computer, Inc. ("Apple") in
+ consideration of your agreement to the
+ following terms, and your use, installation,
+ modification or redistribution of this Apple
+ software constitutes acceptance of these
+ terms. If you do not agree with these terms,
+ please do not use, install, modify or
+ redistribute this Apple software.
+
+ In consideration of your agreement to abide by
+ the following terms, and subject to these
+ terms, Apple grants you a personal,
+ non-exclusive license, under AppleÕs
+ copyrights in this original Apple software
+ (the "Apple Software"), to use, reproduce,
+ modify and redistribute the Apple Software,
+ with or without modifications, in source
+ and/or binary forms; provided that if you
+ redistribute the Apple Software in its
+ entirety and without modifications, you must
+ retain this notice and the following text and
+ disclaimers in all such redistributions of the
+ Apple Software. Neither the name, trademarks,
+ service marks or logos of Apple Computer,
+ Inc. may be used to endorse or promote
+ products derived from the Apple Software
+ without specific prior written permission from
+ Apple. Except as expressly stated in this
+ notice, no other rights or licenses, express
+ or implied, are granted by Apple herein,
+ including but not limited to any patent rights
+ that may be infringed by your derivative works
+ or by other works in which the Apple Software
+ may be incorporated.
+
+ The Apple Software is provided by Apple on an
+ "AS IS" basis. APPLE MAKES NO WARRANTIES,
+ EXPRESS OR IMPLIED, INCLUDING WITHOUT
+ LIMITATION THE IMPLIED WARRANTIES OF
+ NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS
+ FOR A PARTICULAR PURPOSE, REGARDING THE APPLE
+ SOFTWARE OR ITS USE AND OPERATION ALONE OR IN
+ COMBINATION WITH YOUR PRODUCTS.
+
+ IN NO EVENT SHALL APPLE BE LIABLE FOR ANY
+ SPECIAL, INDIRECT, INCIDENTAL OR CONSEQUENTIAL
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) ARISING IN ANY WAY OUT OF THE
+ USE, REPRODUCTION, MODIFICATION AND/OR
+ DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER
+ CAUSED AND WHETHER UNDER THEORY OF CONTRACT,
+ TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY
+ OR OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED
+ OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+/* pThreadUtilities.h */
+
+#ifndef __PTHREADUTILITIES_H__
+#define __PTHREADUTILITIES_H__
+
+#import "pthread.h"
+#import <CoreServices/../Frameworks/CarbonCore.framework/Headers/MacTypes.h>
+
+#define THREAD_SET_PRIORITY 0
+#define THREAD_SCHEDULED_PRIORITY 1
+
+#include <mach/mach_error.h>
+#include <mach/thread_policy.h>
+#include <mach/thread_act.h>
+#include <CoreAudio/HostTime.h>
+
+static inline UInt32
+_getThreadPriority(pthread_t inThread, int inWhichPriority)
+{
+ thread_basic_info_data_t threadInfo;
+ policy_info_data_t thePolicyInfo;
+ unsigned int count;
+
+ // get basic info
+ count = THREAD_BASIC_INFO_COUNT;
+ thread_info (pthread_mach_thread_np (inThread), THREAD_BASIC_INFO,
+ (thread_info_t)&threadInfo, &count);
+
+ switch (threadInfo.policy) {
+ case POLICY_TIMESHARE:
+ count = POLICY_TIMESHARE_INFO_COUNT;
+ thread_info(pthread_mach_thread_np (inThread),
+ THREAD_SCHED_TIMESHARE_INFO,
+ (thread_info_t)&(thePolicyInfo.ts), &count);
+ if (inWhichPriority == THREAD_SCHEDULED_PRIORITY) {
+ return thePolicyInfo.ts.cur_priority;
+ } else {
+ return thePolicyInfo.ts.base_priority;
+ }
+ break;
+
+ case POLICY_FIFO:
+ count = POLICY_FIFO_INFO_COUNT;
+ thread_info(pthread_mach_thread_np (inThread),
+ THREAD_SCHED_FIFO_INFO,
+ (thread_info_t)&(thePolicyInfo.fifo), &count);
+ if ( (thePolicyInfo.fifo.depressed)
+ && (inWhichPriority == THREAD_SCHEDULED_PRIORITY) ) {
+ return thePolicyInfo.fifo.depress_priority;
+ }
+ return thePolicyInfo.fifo.base_priority;
+ break;
+
+ case POLICY_RR:
+ count = POLICY_RR_INFO_COUNT;
+ thread_info(pthread_mach_thread_np (inThread),
+ THREAD_SCHED_RR_INFO,
+ (thread_info_t)&(thePolicyInfo.rr), &count);
+ if ( (thePolicyInfo.rr.depressed)
+ && (inWhichPriority == THREAD_SCHEDULED_PRIORITY) ) {
+ return thePolicyInfo.rr.depress_priority;
+ }
+ return thePolicyInfo.rr.base_priority;
+ break;
+ }
+
+ return 0;
+}
+
+// returns the thread's priority as it was last set by the API
+static inline UInt32
+getThreadSetPriority(pthread_t inThread)
+{
+ return _getThreadPriority (inThread, THREAD_SET_PRIORITY);
+}
+
+// returns the thread's priority as it was last scheduled by the Kernel
+static inline UInt32
+getThreadScheduledPriority(pthread_t inThread)
+{
+ return _getThreadPriority (inThread, THREAD_SCHEDULED_PRIORITY);
+}
+
+
+static inline void
+setThreadToPriority(pthread_t inThread, UInt32 inPriority, Boolean inIsFixed,
+ UInt64 inHALIOProcCycleDurationInNanoseconds)
+{
+ if (inPriority == 96)
+ {
+ // REAL-TIME / TIME-CONSTRAINT THREAD
+ thread_time_constraint_policy_data_t theTCPolicy;
+ UInt64 theComputeQuanta;
+ UInt64 thePeriod;
+ UInt64 thePeriodNanos;
+
+ thePeriodNanos = inHALIOProcCycleDurationInNanoseconds;
+ theComputeQuanta = AudioConvertNanosToHostTime ( thePeriodNanos * 0.15 );
+ thePeriod = AudioConvertNanosToHostTime (thePeriodNanos);
+
+ theTCPolicy.period = thePeriod;
+ theTCPolicy.computation = theComputeQuanta;
+ theTCPolicy.constraint = thePeriod;
+ theTCPolicy.preemptible = true;
+ thread_policy_set (pthread_mach_thread_np(inThread),
+ THREAD_TIME_CONSTRAINT_POLICY,
+ (thread_policy_t)&theTCPolicy,
+ THREAD_TIME_CONSTRAINT_POLICY_COUNT);
+ } else {
+ // OTHER THREADS
+ thread_extended_policy_data_t theFixedPolicy;
+ thread_precedence_policy_data_t thePrecedencePolicy;
+ SInt32 relativePriority;
+
+ // [1] SET FIXED / NOT FIXED
+ theFixedPolicy.timeshare = !inIsFixed;
+ thread_policy_set (pthread_mach_thread_np(inThread),
+ THREAD_EXTENDED_POLICY,
+ (thread_policy_t)&theFixedPolicy,
+ THREAD_EXTENDED_POLICY_COUNT);
+
+ // [2] SET PRECEDENCE N.B.: We expect that if thread A
+ // created thread B, and the program wishes to change the
+ // priority of thread B, then the call to change the
+ // priority of thread B must be made by thread A. This
+ // assumption allows us to use pthread_self() to correctly
+ // calculate the priority of the feeder thread (since
+ // precedency policy's importance is relative to the
+ // spawning thread's priority.)
+ relativePriority = inPriority -
+ getThreadSetPriority (pthread_self());
+
+ thePrecedencePolicy.importance = relativePriority;
+ thread_policy_set (pthread_mach_thread_np(inThread),
+ THREAD_PRECEDENCE_POLICY,
+ (thread_policy_t)&thePrecedencePolicy,
+ THREAD_PRECEDENCE_POLICY_COUNT);
+ }
+}
+
+#endif /* __PTHREADUTILITIES_H__ */
diff --git a/config/os/macosx/poll.h b/config/os/macosx/poll.h
new file mode 100644
index 0000000..32ef6d2
--- /dev/null
+++ b/config/os/macosx/poll.h
@@ -0,0 +1,29 @@
+/*
+ Copyright (C) 2004 Jack O'Quin
+
+ Mac OS/X replacement for <sys/poll.h>. Overrides system version,
+ using <sysdeps/fakepoll.h> to emulate the needed features.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 2.1 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+ $Id$
+*/
+
+#ifndef __poll_h__
+#define __poll_h__
+
+#include <poll.h>
+
+#endif /* __poll_h__ */
diff --git a/config/os/macosx/portaudio.h b/config/os/macosx/portaudio.h
new file mode 100644
index 0000000..4c43b0c
--- /dev/null
+++ b/config/os/macosx/portaudio.h
@@ -0,0 +1,28 @@
+/*
+ Copyright (C) 2004 Jack O'Quin
+
+ Mac OS/X specific defines.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 2.1 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+ $Id$
+*/
+
+#ifndef _macosx_portaudio
+#define _macosx_portaudio 1
+
+#include <PortAudio.h>
+
+#endif /* _macosx_portaudio */
diff --git a/config/os/macosx/time.h b/config/os/macosx/time.h
new file mode 100644
index 0000000..73fd898
--- /dev/null
+++ b/config/os/macosx/time.h
@@ -0,0 +1,52 @@
+/*
+ Copyright (C) 2001-2003 Paul Davis
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 2.1 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+ $Id$
+*/
+
+#ifndef __jack_time_h__
+#define __jack_time_h__
+
+/*
+ * This is the MacOSX version of <jack/time.h>. It overrides the
+ * generic version via the configure.hosts mechanism.
+ */
+#include <jack/types.h>
+#include <mach/mach_time.h>
+
+/* This is a kludge. We need one global instantiation of this
+ * variable in each address space. So, libjack/client.c declares the
+ * actual storage. Other source files will see it as an extern. */
+#define JACK_TIME_GLOBAL_DECL double __jack_time_ratio
+extern JACK_TIME_GLOBAL_DECL;
+
+static inline jack_time_t
+jack_get_microseconds(void)
+{
+ return mach_absolute_time () * __jack_time_ratio;
+}
+
+/* This should only be called ONCE per process. */
+static inline void
+jack_init_time ()
+{
+ mach_timebase_info_data_t info;
+ mach_timebase_info(&info);
+ __jack_time_ratio = ((float)info.numer/info.denom) / 1000;
+}
+
+#endif /* __jack_time_h__ */
diff --git a/config/sysdeps/.cvsignore b/config/sysdeps/.cvsignore
new file mode 100644
index 0000000..eb92105
--- /dev/null
+++ b/config/sysdeps/.cvsignore
@@ -0,0 +1,3 @@
+Makefile
+Makefile.in
+*.h
diff --git a/config/sysdeps/Makefile.am b/config/sysdeps/Makefile.am
new file mode 100644
index 0000000..efd1145
--- /dev/null
+++ b/config/sysdeps/Makefile.am
@@ -0,0 +1,23 @@
+# This directory contains links to platform-dependent headers in the
+# source tree. None are installed or distributed from here. Remember
+# that the build tree and the source tree are not always the same.
+
+MAINTAINERCLEANFILES = Makefile.in
+CLEANFILES = *.h
+
+# Link all relevant headers into the `sysdeps' directory. The order
+# of these loops determines header file precedence.
+
+all-local:
+ for h in ${top_srcdir}/config/cpu/generic/*.h; do \
+ $(LN_S) -f $$h .; \
+ done
+ for h in ${top_srcdir}/config/@cpu_include_dir@/*.h; do \
+ $(LN_S) -f $$h .; \
+ done
+ for h in ${top_srcdir}/config/os/generic/*.h; do \
+ $(LN_S) -f $$h .; \
+ done
+ for h in ${top_srcdir}/config/@os_include_dir@/*.h; do \
+ $(LN_S) -f $$h .; \
+ done