--- /dev/null
+/* Cycript - Optimizing JavaScript Compiler/Runtime
+ * Copyright (C) 2009-2014 Jay Freeman (saurik)
+*/
+
+/* GNU Affero General Public License, Version 3 {{{ */
+/*
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as published by
+ * the Free Software Foundation, either version 3 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 Affero General Public License for more details.
+
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+**/
+/* }}} */
+
+#include <sstream>
+#include <string>
+
+#include <dlfcn.h>
+
+#include "Exception.hpp"
+#include "Pooling.hpp"
+
+#if defined(__APPLE__) && (defined(__i386__) || defined(__x86_64__))
+#include <sys/fcntl.h>
+#include <sys/mman.h>
+
+#include <mach-o/loader.h>
+
+#define CS_OPS_PIDOFFSET 6
+
+extern "C" int csops(pid_t pid, unsigned int ops, void *useraddr, size_t usersize);
+extern "C" int proc_pidpath(int pid, void *buffer, uint32_t buffersize);
+#endif
+
+int main(int argc, char * const argv[], char const * const envp[]);
+extern "C" char *MSmain0(int argc, char *argv[]);
+
+static std::string LibraryFor(void *address) {
+ Dl_info info;
+ _assert(dladdr(address, &info) != 0);
+ return info.dli_fname;
+}
+
+template <typename Type_>
+Type_ *shift(Type_ *data, size_t size) {
+ return reinterpret_cast<Type_ *>(reinterpret_cast<uint8_t *>(data) + size);
+}
+
+void InjectLibrary(int pid, int argc, const char *argv[]) {
+ auto cynject(LibraryFor(reinterpret_cast<void *>(&main)));
+ auto slash(cynject.rfind('/'));
+ _assert(slash != std::string::npos);
+ cynject = cynject.substr(0, slash) + "/cynject";
+
+ auto library(LibraryFor(reinterpret_cast<void *>(&MSmain0)));
+
+#if defined(__APPLE__) && (defined(__i386__) || defined(__x86_64__))
+ off_t offset;
+ _assert(csops(pid, CS_OPS_PIDOFFSET, &offset, sizeof(offset)) != -1);
+
+ char path[PATH_MAX];
+ int writ(proc_pidpath(pid, path, sizeof(path)));
+ _assert(writ != 0);
+
+ auto fd(_syscall(open(path, O_RDONLY)));
+
+ auto page(getpagesize());
+ auto size(page * 4);
+ auto map(_syscall(mmap(NULL, size, PROT_READ, MAP_SHARED, fd, offset)));
+
+ _syscall(close(fd)); // XXX: _scope
+
+ auto header(reinterpret_cast<mach_header *>(map));
+ auto command(reinterpret_cast<load_command *>(header + 1));
+
+ switch (header->magic) {
+ case MH_MAGIC_64:
+ command = shift(command, sizeof(uint32_t));
+ case MH_MAGIC:
+ break;
+ default:
+ _assert(false);
+ }
+
+ bool ios(false);
+ for (decltype(header->ncmds) i(0); i != header->ncmds; ++i) {
+ if (command->cmd == LC_VERSION_MIN_IPHONEOS)
+ ios = true;
+ command = shift(command, command->cmdsize);
+ }
+
+ _syscall(munmap(map, size)); // XXX: _scope
+
+ auto length(library.size());
+ _assert(length >= 6);
+ length -= 6;
+
+ _assert(library.substr(length) == ".dylib");
+ library = library.substr(0, length);
+ library += ios ? "-sim" : "-sys";
+ library += ".dylib";
+#endif
+
+ std::ostringstream inject;
+ inject << cynject << " " << std::dec << pid << " " << library;
+ for (decltype(argc) i(0); i != argc; ++i)
+ inject << " " << argv[i];
+
+ _assert(system(inject.str().c_str()) == 0);
+}
+++ /dev/null
-/* Cycript - Optimizing JavaScript Compiler/Runtime
- * Copyright (C) 2009-2014 Jay Freeman (saurik)
-*/
-
-/* GNU Affero General Public License, Version 3 {{{ */
-/*
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 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 Affero General Public License for more details.
-
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
-**/
-/* }}} */
-
-#include <sstream>
-#include <string>
-
-#include <dlfcn.h>
-
-#include "Exception.hpp"
-#include "Pooling.hpp"
-
-#if defined(__APPLE__) && (defined(__i386__) || defined(__x86_64__))
-#include <sys/fcntl.h>
-#include <sys/mman.h>
-
-#include <mach-o/loader.h>
-
-#define CS_OPS_PIDOFFSET 6
-
-extern "C" int csops(pid_t pid, unsigned int ops, void *useraddr, size_t usersize);
-extern "C" int proc_pidpath(int pid, void *buffer, uint32_t buffersize);
-#endif
-
-int main(int argc, char * const argv[], char const * const envp[]);
-extern "C" char *MSmain0(int argc, char *argv[]);
-
-static std::string LibraryFor(void *address) {
- Dl_info info;
- _assert(dladdr(address, &info) != 0);
- return info.dli_fname;
-}
-
-template <typename Type_>
-Type_ *shift(Type_ *data, size_t size) {
- return reinterpret_cast<Type_ *>(reinterpret_cast<uint8_t *>(data) + size);
-}
-
-void InjectLibrary(int pid, int argc, const char *argv[]) {
- auto cynject(LibraryFor(reinterpret_cast<void *>(&main)));
- auto slash(cynject.rfind('/'));
- _assert(slash != std::string::npos);
- cynject = cynject.substr(0, slash) + "/cynject";
-
- auto library(LibraryFor(reinterpret_cast<void *>(&MSmain0)));
-
-#if defined(__APPLE__) && (defined(__i386__) || defined(__x86_64__))
- off_t offset;
- _assert(csops(pid, CS_OPS_PIDOFFSET, &offset, sizeof(offset)) != -1);
-
- char path[PATH_MAX];
- int writ(proc_pidpath(pid, path, sizeof(path)));
- _assert(writ != 0);
-
- auto fd(_syscall(open(path, O_RDONLY)));
-
- auto page(getpagesize());
- auto size(page * 4);
- auto map(_syscall(mmap(NULL, size, PROT_READ, MAP_SHARED, fd, offset)));
-
- _syscall(close(fd)); // XXX: _scope
-
- auto header(reinterpret_cast<mach_header *>(map));
- auto command(reinterpret_cast<load_command *>(header + 1));
-
- switch (header->magic) {
- case MH_MAGIC_64:
- command = shift(command, sizeof(uint32_t));
- case MH_MAGIC:
- break;
- default:
- _assert(false);
- }
-
- bool ios(false);
- for (decltype(header->ncmds) i(0); i != header->ncmds; ++i) {
- if (command->cmd == LC_VERSION_MIN_IPHONEOS)
- ios = true;
- command = shift(command, command->cmdsize);
- }
-
- _syscall(munmap(map, size)); // XXX: _scope
-
- auto length(library.size());
- _assert(length >= 6);
- length -= 6;
-
- _assert(library.substr(length) == ".dylib");
- library = library.substr(0, length);
- library += ios ? "-sim" : "-sys";
- library += ".dylib";
-#endif
-
- std::ostringstream inject;
- inject << cynject << " " << std::dec << pid << " " << library;
- for (decltype(argc) i(0); i != argc; ++i)
- inject << " " << argv[i];
-
- _assert(system(inject.str().c_str()) == 0);
-}
ACLOCAL_AMFLAGS = -I m4
-AM_CPPFLAGS = -I$(srcdir)/include -DYYDEBUG=1
+AM_CPPFLAGS = -DYYDEBUG=1
AM_CPPFLAGS += -include config.h -include $(srcdir)/unconfig.h
CY_LDFLAGS = -no-undefined -avoid-version -export-dynamic
bin_PROGRAMS = cycript
cycript_SOURCES = Console.cpp Display.cpp
cycript_LDADD = libcycript.la $(LTLIBREADLINE) $(LTLIBTERMCAP) $(LTLIBGCC) $(PTHREAD_CFLAGS) -ldl
-
-ldid = true
-entitle = $(ldid) -S$(srcdir)/cycript.xml
endif
if CY_EXECUTE
libcycript_la_LIBADD += $(LTOBJECTIVEC)
endif
-if CY_MACH
+if CY_ATTACH
libcycript_la_SOURCES += Handler.cpp
if CY_CONSOLE
-cycript_SOURCES += Mach/Inject.cpp
+cycript_SOURCES += Inject.cpp
AM_CPPFLAGS += -DCY_ATTACH
endif
endif
@CY_OBJECTIVEC_TRUE@am__append_9 = ObjectiveC
@CY_OBJECTIVEC_TRUE@am__append_10 = ObjectiveC/Output.cpp ObjectiveC/Replace.cpp ObjectiveC/Library.mm
@CY_OBJECTIVEC_TRUE@am__append_11 = $(LTOBJECTIVEC)
-@CY_MACH_TRUE@am__append_12 = Handler.cpp
-@CY_CONSOLE_TRUE@@CY_MACH_TRUE@am__append_13 = Mach/Inject.cpp
-@CY_CONSOLE_TRUE@@CY_MACH_TRUE@am__append_14 = -DCY_ATTACH
+@CY_ATTACH_TRUE@am__append_12 = Handler.cpp
+@CY_ATTACH_TRUE@@CY_CONSOLE_TRUE@am__append_13 = Inject.cpp
+@CY_ATTACH_TRUE@@CY_CONSOLE_TRUE@am__append_14 = -DCY_ATTACH
subdir = .
DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
$(top_srcdir)/configure $(am__configure_deps) \
@CY_OBJECTIVEC_TRUE@am__objects_3 = ObjectiveC/Output.lo \
@CY_OBJECTIVEC_TRUE@ ObjectiveC/Replace.lo \
@CY_OBJECTIVEC_TRUE@ ObjectiveC/Library.lo
-@CY_MACH_TRUE@am__objects_4 = Handler.lo
+@CY_ATTACH_TRUE@am__objects_4 = Handler.lo
am_libcycript_la_OBJECTS = ConvertUTF.lo Decode.lo Driver.lo \
Highlight.lo Library.lo Network.lo Output.lo Parser.lo \
Replace.lo Cycript.tab.lo lex.cy.lo $(am__objects_1) \
$(LIBTOOLFLAGS) --mode=link $(OBJCXXLD) $(AM_OBJCXXFLAGS) \
$(OBJCXXFLAGS) $(libcycript_la_LDFLAGS) $(LDFLAGS) -o $@
PROGRAMS = $(bin_PROGRAMS)
-am__cycript_SOURCES_DIST = Console.cpp Display.cpp Mach/Inject.cpp
-@CY_CONSOLE_TRUE@@CY_MACH_TRUE@am__objects_5 = Mach/Inject.$(OBJEXT)
+am__cycript_SOURCES_DIST = Console.cpp Display.cpp Inject.cpp
+@CY_ATTACH_TRUE@@CY_CONSOLE_TRUE@am__objects_5 = Inject.$(OBJEXT)
@CY_CONSOLE_TRUE@am_cycript_OBJECTS = Console.$(OBJEXT) \
@CY_CONSOLE_TRUE@ Display.$(OBJEXT) $(am__objects_5)
cycript_OBJECTS = $(am_cycript_OBJECTS)
CXXFLAGS = @CXXFLAGS@
CYGPATH_W = @CYGPATH_W@
CY_ARCH = @CY_ARCH@
-CY_ATTACH_GROUP = @CY_ATTACH_GROUP@
CY_EXECUTE = @CY_EXECUTE@
CY_JAVA = @CY_JAVA@
-CY_MACH = @CY_MACH@
CY_OBJECTIVEC = @CY_OBJECTIVEC@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
VERSION = @VERSION@
WEBKIT_CFLAGS = @WEBKIT_CFLAGS@
WEBKIT_LIBS = @WEBKIT_LIBS@
-_LIPO = @_LIPO@
-_NM = @_NM@
-_OTOOL = @_OTOOL@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
ac_ct_CXX = @ac_ct_CXX@
ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
ac_ct_OBJCXX = @ac_ct_OBJCXX@
-ac_ct__LIPO = @ac_ct__LIPO@
-ac_ct__NM = @ac_ct__NM@
-ac_ct__OTOOL = @ac_ct__OTOOL@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
Cycript.tab.cc Cycript.tab.hh stack.hh Cycript.output
SUBDIRS =
ACLOCAL_AMFLAGS = -I m4
-AM_CPPFLAGS = -I$(srcdir)/include -DYYDEBUG=1 -include config.h \
- -include $(srcdir)/unconfig.h $(am__append_3) $(am__append_14)
+AM_CPPFLAGS = -DYYDEBUG=1 -include config.h -include \
+ $(srcdir)/unconfig.h $(am__append_3) $(am__append_14)
CY_LDFLAGS = -no-undefined -avoid-version -export-dynamic
lib_LTLIBRARIES = libcycript.la
libcycript_la_LDFLAGS = $(CY_LDFLAGS)
@CY_CONSOLE_TRUE@cycript_SOURCES = Console.cpp Display.cpp \
@CY_CONSOLE_TRUE@ $(am__append_13)
@CY_CONSOLE_TRUE@cycript_LDADD = libcycript.la $(LTLIBREADLINE) $(LTLIBTERMCAP) $(LTLIBGCC) $(PTHREAD_CFLAGS) -ldl
-@CY_CONSOLE_TRUE@ldid = true
-@CY_CONSOLE_TRUE@entitle = $(ldid) -S$(srcdir)/cycript.xml
all: config.h
$(MAKE) $(AM_MAKEFLAGS) all-recursive
list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
echo " rm -f" $$list; \
rm -f $$list
-Mach/$(am__dirstamp):
- @$(MKDIR_P) Mach
- @: > Mach/$(am__dirstamp)
-Mach/$(DEPDIR)/$(am__dirstamp):
- @$(MKDIR_P) Mach/$(DEPDIR)
- @: > Mach/$(DEPDIR)/$(am__dirstamp)
-Mach/Inject.$(OBJEXT): Mach/$(am__dirstamp) \
- Mach/$(DEPDIR)/$(am__dirstamp)
cycript$(EXEEXT): $(cycript_OBJECTS) $(cycript_DEPENDENCIES) $(EXTRA_cycript_DEPENDENCIES)
@rm -f cycript$(EXEEXT)
-rm -f *.$(OBJEXT)
-rm -f Java/*.$(OBJEXT)
-rm -f Java/*.lo
- -rm -f Mach/*.$(OBJEXT)
-rm -f ObjectiveC/*.$(OBJEXT)
-rm -f ObjectiveC/*.lo
-rm -f sig/*.$(OBJEXT)
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Execute.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Handler.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Highlight.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Inject.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/JavaScriptCore.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Library.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Network.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Replace.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lex.cy.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@Java/$(DEPDIR)/Execute.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@Mach/$(DEPDIR)/Inject.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@ObjectiveC/$(DEPDIR)/Library.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@ObjectiveC/$(DEPDIR)/Output.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@ObjectiveC/$(DEPDIR)/Replace.Plo@am__quote@
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-rm -f Java/$(DEPDIR)/$(am__dirstamp)
-rm -f Java/$(am__dirstamp)
- -rm -f Mach/$(DEPDIR)/$(am__dirstamp)
- -rm -f Mach/$(am__dirstamp)
-rm -f ObjectiveC/$(DEPDIR)/$(am__dirstamp)
-rm -f ObjectiveC/$(am__dirstamp)
-rm -f sig/$(DEPDIR)/$(am__dirstamp)
distclean: distclean-recursive
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
- -rm -rf ./$(DEPDIR) Java/$(DEPDIR) Mach/$(DEPDIR) ObjectiveC/$(DEPDIR) sig/$(DEPDIR)
+ -rm -rf ./$(DEPDIR) Java/$(DEPDIR) ObjectiveC/$(DEPDIR) sig/$(DEPDIR)
-rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
distclean-hdr distclean-libtool distclean-tags
maintainer-clean: maintainer-clean-recursive
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
-rm -rf $(top_srcdir)/autom4te.cache
- -rm -rf ./$(DEPDIR) Java/$(DEPDIR) Mach/$(DEPDIR) ObjectiveC/$(DEPDIR) sig/$(DEPDIR)
+ -rm -rf ./$(DEPDIR) Java/$(DEPDIR) ObjectiveC/$(DEPDIR) sig/$(DEPDIR)
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
am__EXEEXT_TRUE
LTLIBOBJS
LIBOBJS
-CY_MACH_FALSE
-CY_MACH_TRUE
-CY_MACH
-CY_ATTACH_GROUP
-ac_ct__OTOOL
-_OTOOL
-ac_ct__NM
-_NM
-ac_ct__LIPO
-_LIPO
SO
LTFLAGS
LTLIBGCC
LIBFFI_CFLAGS
CY_EXECUTE_FALSE
CY_EXECUTE_TRUE
+CY_ATTACH_FALSE
+CY_ATTACH_TRUE
CY_CONSOLE_FALSE
CY_CONSOLE_TRUE
LTJAVASCRIPTCORE
enable_libtool_lock
enable_javascript
enable_console
+enable_attach
'
ac_precious_vars='build_alias
host_alias
available option for ENGINE is JavaScriptCore)
[default=yes]
--disable-console disable console
+ --disable-attach disable attach
Optional Packages:
--with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
fi
+# Check whether --enable-attach was given.
+if test "${enable_attach+set}" = set; then :
+ enableval=$enable_attach;
+fi
+
+ if test "x$enable_attach" != "xno" -a "x$CY_EXECUTE" = x1; then
+ CY_ATTACH_TRUE=
+ CY_ATTACH_FALSE='#'
+else
+ CY_ATTACH_TRUE='#'
+ CY_ATTACH_FALSE=
+fi
+
+
if test "x$CY_EXECUTE" = x1; then
SO=$acl_shlibext
-if test "x$CY_EXECUTE" = x1; then :
-
- ac_fn_cxx_check_header_mongrel "$LINENO" "mach/mach.h" "ac_cv_header_mach_mach_h" "$ac_includes_default"
-if test "x$ac_cv_header_mach_mach_h" = xyes; then :
-
- if test -n "$ac_tool_prefix"; then
- for ac_prog in lipo
- do
- # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
-set dummy $ac_tool_prefix$ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog__LIPO+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$_LIPO"; then
- ac_cv_prog__LIPO="$_LIPO" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog__LIPO="$ac_tool_prefix$ac_prog"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-_LIPO=$ac_cv_prog__LIPO
-if test -n "$_LIPO"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $_LIPO" >&5
-$as_echo "$_LIPO" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
- test -n "$_LIPO" && break
- done
-fi
-if test -z "$_LIPO"; then
- ac_ct__LIPO=$_LIPO
- for ac_prog in lipo
-do
- # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct__LIPO+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$ac_ct__LIPO"; then
- ac_cv_prog_ac_ct__LIPO="$ac_ct__LIPO" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_ac_ct__LIPO="$ac_prog"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct__LIPO=$ac_cv_prog_ac_ct__LIPO
-if test -n "$ac_ct__LIPO"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct__LIPO" >&5
-$as_echo "$ac_ct__LIPO" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
- test -n "$ac_ct__LIPO" && break
-done
-
- if test "x$ac_ct__LIPO" = x; then
- _LIPO="as_fn_error $? "missing \"lipo\"" "$LINENO" 5"
- else
- case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
- _LIPO=$ac_ct__LIPO
- fi
-fi
-
- if test -n "$ac_tool_prefix"; then
- for ac_prog in nm
- do
- # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
-set dummy $ac_tool_prefix$ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog__NM+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$_NM"; then
- ac_cv_prog__NM="$_NM" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog__NM="$ac_tool_prefix$ac_prog"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-_NM=$ac_cv_prog__NM
-if test -n "$_NM"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $_NM" >&5
-$as_echo "$_NM" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
- test -n "$_NM" && break
- done
-fi
-if test -z "$_NM"; then
- ac_ct__NM=$_NM
- for ac_prog in nm
-do
- # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct__NM+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$ac_ct__NM"; then
- ac_cv_prog_ac_ct__NM="$ac_ct__NM" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_ac_ct__NM="$ac_prog"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct__NM=$ac_cv_prog_ac_ct__NM
-if test -n "$ac_ct__NM"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct__NM" >&5
-$as_echo "$ac_ct__NM" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
- test -n "$ac_ct__NM" && break
-done
-
- if test "x$ac_ct__NM" = x; then
- _NM="as_fn_error $? "missing \"nm\"" "$LINENO" 5"
- else
- case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
- _NM=$ac_ct__NM
- fi
-fi
-
- if test -n "$ac_tool_prefix"; then
- for ac_prog in otool
- do
- # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
-set dummy $ac_tool_prefix$ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog__OTOOL+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$_OTOOL"; then
- ac_cv_prog__OTOOL="$_OTOOL" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog__OTOOL="$ac_tool_prefix$ac_prog"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-_OTOOL=$ac_cv_prog__OTOOL
-if test -n "$_OTOOL"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $_OTOOL" >&5
-$as_echo "$_OTOOL" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
- test -n "$_OTOOL" && break
- done
-fi
-if test -z "$_OTOOL"; then
- ac_ct__OTOOL=$_OTOOL
- for ac_prog in otool
-do
- # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct__OTOOL+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$ac_ct__OTOOL"; then
- ac_cv_prog_ac_ct__OTOOL="$ac_ct__OTOOL" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_ac_ct__OTOOL="$ac_prog"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct__OTOOL=$ac_cv_prog_ac_ct__OTOOL
-if test -n "$ac_ct__OTOOL"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct__OTOOL" >&5
-$as_echo "$ac_ct__OTOOL" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
- test -n "$ac_ct__OTOOL" && break
-done
-
- if test "x$ac_ct__OTOOL" = x; then
- _OTOOL="as_fn_error $? "missing \"otool\"" "$LINENO" 5"
- else
- case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
- _OTOOL=$ac_ct__OTOOL
- fi
-fi
-
- CY_ATTACH_GROUP=procmod
-
- CY_MACH=1
-
-fi
-
-
-fi
- if test "x$CY_MACH" = x1; then
- CY_MACH_TRUE=
- CY_MACH_FALSE='#'
-else
- CY_MACH_TRUE='#'
- CY_MACH_FALSE=
-fi
-
-
ac_config_files="$ac_config_files Makefile"
cat >confcache <<\_ACEOF
as_fn_error $? "conditional \"CY_CONSOLE\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
+if test -z "${CY_ATTACH_TRUE}" && test -z "${CY_ATTACH_FALSE}"; then
+ as_fn_error $? "conditional \"CY_ATTACH\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
if test -z "${CY_EXECUTE_TRUE}" && test -z "${CY_EXECUTE_FALSE}"; then
as_fn_error $? "conditional \"CY_EXECUTE\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
as_fn_error $? "conditional \"CY_OBJECTIVEC\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
-if test -z "${CY_MACH_TRUE}" && test -z "${CY_MACH_FALSE}"; then
- as_fn_error $? "conditional \"CY_MACH\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
: "${CONFIG_STATUS=./config.status}"
ac_write_fail=0
AC_ARG_ENABLE([console], AS_HELP_STRING([--disable-console], [disable console]))
AM_CONDITIONAL([CY_CONSOLE], [test "x$enable_console" != "xno"])
+AC_ARG_ENABLE([attach], AS_HELP_STRING([--disable-attach], [disable attach]))
+AM_CONDITIONAL([CY_ATTACH], [test "x$enable_attach" != "xno" -a "x$CY_EXECUTE" = x1])
+
AC_DEFUN([CY_CHECK_PKG_CONFIG_LIBFFI], [
PKG_CHECK_MODULES([LIBFFI], [libffi], [
AC_LIB_APPENDTOVAR([CPPFLAGS], [`$PKG_CONFIG --cflags libffi`])
AC_SUBST([LTFLAGS])
AC_SUBST([SO], [$acl_shlibext])
-AS_IF([test "x$CY_EXECUTE" = x1], [
- AC_CHECK_HEADER([mach/mach.h], [
- AC_CHECK_TOOLS([_LIPO], [lipo], [AC_MSG_ERROR([missing "lipo"])])
- AC_CHECK_TOOLS([_NM], [nm], [AC_MSG_ERROR([missing "nm"])])
- AC_CHECK_TOOLS([_OTOOL], [otool], [AC_MSG_ERROR([missing "otool"])])
- AC_SUBST([CY_ATTACH_GROUP], [procmod])
- AC_SUBST([CY_MACH], [1])])])
-AM_CONDITIONAL([CY_MACH], [test "x$CY_MACH" = x1])
-
AC_CONFIG_FILES([Makefile])
AC_OUTPUT
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
- <key>com.apple.springboard.debugapplications</key>
- <true/>
<key>dynamic-codesigning</key>
<true/>
- <key>get-task-allow</key>
- <true/>
- <key>task_for_pid-allow</key>
- <true/>
</dict>
</plist>
+++ /dev/null
-/*
- * Copyright (c) 2000-2007 Apple Inc. All rights reserved.
- *
- * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
- *
- * This file contains Original Code and/or Modifications of Original Code
- * as defined in and that are subject to the Apple Public Source License
- * Version 2.0 (the 'License'). You may not use this file except in
- * compliance with the License. The rights granted to you under the License
- * may not be used to create, or enable the creation or redistribution of,
- * unlawful or unlicensed copies of an Apple operating system, or to
- * circumvent, violate, or enable the circumvention or violation of, any
- * terms of an Apple operating system software license agreement.
- *
- * Please obtain a copy of the License at
- * http://www.opensource.apple.com/apsl/ and read it before using this file.
- *
- * The Original Code and all software distributed under the License are
- * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
- * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
- * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
- * Please see the License for the specific language governing rights and
- * limitations under the License.
- *
- * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
- */
-#ifdef PRIVATE
-
-#ifndef _MACHINE_CPU_CAPABILITIES_H
-#define _MACHINE_CPU_CAPABILITIES_H
-
-#ifdef KERNEL_PRIVATE
-#if defined (__ppc__)
-#include "ppc/cpu_capabilities.h"
-#elif defined (__i386__)
-#include "i386/cpu_capabilities.h"
-#else
-#error architecture not supported
-#endif
-
-#else /* !KERNEL_PRIVATE -- System Framework header */
-#if defined (__ppc__) || defined(__ppc64__)
-#include <System/ppc/cpu_capabilities.h>
-#elif defined (__i386__) || defined(__x86_64__)
-#include <System/i386/cpu_capabilities.h>
-#else
-#error architecture not supported
-#endif
-#endif /* KERNEL_PRIVATE */
-
-#endif /* _MACHINE_CPU_CAPABILITIES_H */
-#endif /* PRIVATE */
+++ /dev/null
-#ifndef _mach_vm_user_
-#define _mach_vm_user_
-
-/* Module mach_vm */
-
-#include <string.h>
-#include <mach/ndr.h>
-#include <mach/boolean.h>
-#include <mach/kern_return.h>
-#include <mach/notify.h>
-#include <mach/mach_types.h>
-#include <mach/message.h>
-#include <mach/mig_errors.h>
-#include <mach/port.h>
-
-#ifdef AUTOTEST
-#ifndef FUNCTION_PTR_T
-#define FUNCTION_PTR_T
-typedef void (*function_ptr_t)(mach_port_t, char *, mach_msg_type_number_t);
-typedef struct {
- char *name;
- function_ptr_t function;
-} function_table_entry;
-typedef function_table_entry *function_table_t;
-#endif /* FUNCTION_PTR_T */
-#endif /* AUTOTEST */
-
-#ifndef mach_vm_MSG_COUNT
-#define mach_vm_MSG_COUNT 20
-#endif /* mach_vm_MSG_COUNT */
-
-#include <mach/std_types.h>
-#include <mach/mig.h>
-#include <mach/mig.h>
-#include <mach/mach_types.h>
-#include <mach_debug/mach_debug_types.h>
-
-#ifdef __BeforeMigUserHeader
-__BeforeMigUserHeader
-#endif /* __BeforeMigUserHeader */
-
-#include <sys/cdefs.h>
-__BEGIN_DECLS
-
-
-/* Routine mach_vm_allocate */
-#ifdef mig_external
-mig_external
-#else
-extern
-#endif /* mig_external */
-kern_return_t mach_vm_allocate
-(
- vm_map_t target,
- mach_vm_address_t *address,
- mach_vm_size_t size,
- int flags
-);
-
-/* Routine mach_vm_deallocate */
-#ifdef mig_external
-mig_external
-#else
-extern
-#endif /* mig_external */
-kern_return_t mach_vm_deallocate
-(
- vm_map_t target,
- mach_vm_address_t address,
- mach_vm_size_t size
-);
-
-/* Routine mach_vm_protect */
-#ifdef mig_external
-mig_external
-#else
-extern
-#endif /* mig_external */
-kern_return_t mach_vm_protect
-(
- vm_map_t target_task,
- mach_vm_address_t address,
- mach_vm_size_t size,
- boolean_t set_maximum,
- vm_prot_t new_protection
-);
-
-/* Routine mach_vm_inherit */
-#ifdef mig_external
-mig_external
-#else
-extern
-#endif /* mig_external */
-kern_return_t mach_vm_inherit
-(
- vm_map_t target_task,
- mach_vm_address_t address,
- mach_vm_size_t size,
- vm_inherit_t new_inheritance
-);
-
-/* Routine mach_vm_read */
-#ifdef mig_external
-mig_external
-#else
-extern
-#endif /* mig_external */
-kern_return_t mach_vm_read
-(
- vm_map_t target_task,
- mach_vm_address_t address,
- mach_vm_size_t size,
- vm_offset_t *data,
- mach_msg_type_number_t *dataCnt
-);
-
-/* Routine mach_vm_read_list */
-#ifdef mig_external
-mig_external
-#else
-extern
-#endif /* mig_external */
-kern_return_t mach_vm_read_list
-(
- vm_map_t target_task,
- mach_vm_read_entry_t data_list,
- natural_t count
-);
-
-/* Routine mach_vm_write */
-#ifdef mig_external
-mig_external
-#else
-extern
-#endif /* mig_external */
-kern_return_t mach_vm_write
-(
- vm_map_t target_task,
- mach_vm_address_t address,
- vm_offset_t data,
- mach_msg_type_number_t dataCnt
-);
-
-/* Routine mach_vm_copy */
-#ifdef mig_external
-mig_external
-#else
-extern
-#endif /* mig_external */
-kern_return_t mach_vm_copy
-(
- vm_map_t target_task,
- mach_vm_address_t source_address,
- mach_vm_size_t size,
- mach_vm_address_t dest_address
-);
-
-/* Routine mach_vm_read_overwrite */
-#ifdef mig_external
-mig_external
-#else
-extern
-#endif /* mig_external */
-kern_return_t mach_vm_read_overwrite
-(
- vm_map_t target_task,
- mach_vm_address_t address,
- mach_vm_size_t size,
- mach_vm_address_t data,
- mach_vm_size_t *outsize
-);
-
-/* Routine mach_vm_msync */
-#ifdef mig_external
-mig_external
-#else
-extern
-#endif /* mig_external */
-kern_return_t mach_vm_msync
-(
- vm_map_t target_task,
- mach_vm_address_t address,
- mach_vm_size_t size,
- vm_sync_t sync_flags
-);
-
-/* Routine mach_vm_behavior_set */
-#ifdef mig_external
-mig_external
-#else
-extern
-#endif /* mig_external */
-kern_return_t mach_vm_behavior_set
-(
- vm_map_t target_task,
- mach_vm_address_t address,
- mach_vm_size_t size,
- vm_behavior_t new_behavior
-);
-
-/* Routine mach_vm_map */
-#ifdef mig_external
-mig_external
-#else
-extern
-#endif /* mig_external */
-kern_return_t mach_vm_map
-(
- vm_map_t target_task,
- mach_vm_address_t *address,
- mach_vm_size_t size,
- mach_vm_offset_t mask,
- int flags,
- mem_entry_name_port_t object,
- memory_object_offset_t offset,
- boolean_t copy,
- vm_prot_t cur_protection,
- vm_prot_t max_protection,
- vm_inherit_t inheritance
-);
-
-/* Routine mach_vm_machine_attribute */
-#ifdef mig_external
-mig_external
-#else
-extern
-#endif /* mig_external */
-kern_return_t mach_vm_machine_attribute
-(
- vm_map_t target_task,
- mach_vm_address_t address,
- mach_vm_size_t size,
- vm_machine_attribute_t attribute,
- vm_machine_attribute_val_t *value
-);
-
-/* Routine mach_vm_remap */
-#ifdef mig_external
-mig_external
-#else
-extern
-#endif /* mig_external */
-kern_return_t mach_vm_remap
-(
- vm_map_t target_task,
- mach_vm_address_t *target_address,
- mach_vm_size_t size,
- mach_vm_offset_t mask,
- int flags,
- vm_map_t src_task,
- mach_vm_address_t src_address,
- boolean_t copy,
- vm_prot_t *cur_protection,
- vm_prot_t *max_protection,
- vm_inherit_t inheritance
-);
-
-/* Routine mach_vm_page_query */
-#ifdef mig_external
-mig_external
-#else
-extern
-#endif /* mig_external */
-kern_return_t mach_vm_page_query
-(
- vm_map_t target_map,
- mach_vm_offset_t offset,
- integer_t *disposition,
- integer_t *ref_count
-);
-
-/* Routine mach_vm_region_recurse */
-#ifdef mig_external
-mig_external
-#else
-extern
-#endif /* mig_external */
-kern_return_t mach_vm_region_recurse
-(
- vm_map_t target_task,
- mach_vm_address_t *address,
- mach_vm_size_t *size,
- natural_t *nesting_depth,
- vm_region_recurse_info_t info,
- mach_msg_type_number_t *infoCnt
-);
-
-/* Routine mach_vm_region */
-#ifdef mig_external
-mig_external
-#else
-extern
-#endif /* mig_external */
-kern_return_t mach_vm_region
-(
- vm_map_t target_task,
- mach_vm_address_t *address,
- mach_vm_size_t *size,
- vm_region_flavor_t flavor,
- vm_region_info_t info,
- mach_msg_type_number_t *infoCnt,
- mach_port_t *object_name
-);
-
-/* Routine _mach_make_memory_entry */
-#ifdef mig_external
-mig_external
-#else
-extern
-#endif /* mig_external */
-kern_return_t _mach_make_memory_entry
-(
- vm_map_t target_task,
- memory_object_size_t *size,
- memory_object_offset_t offset,
- vm_prot_t permission,
- mem_entry_name_port_t *object_handle,
- mem_entry_name_port_t parent_handle
-);
-
-/* Routine mach_vm_purgable_control */
-#ifdef mig_external
-mig_external
-#else
-extern
-#endif /* mig_external */
-kern_return_t mach_vm_purgable_control
-(
- vm_map_t target_task,
- mach_vm_address_t address,
- vm_purgable_t control,
- int *state
-);
-
-/* Routine mach_vm_page_info */
-#ifdef mig_external
-mig_external
-#else
-extern
-#endif /* mig_external */
-kern_return_t mach_vm_page_info
-(
- vm_map_t target_task,
- mach_vm_address_t address,
- vm_page_info_flavor_t flavor,
- vm_page_info_t info,
- mach_msg_type_number_t *infoCnt
-);
-
-__END_DECLS
-
-/********************** Caution **************************/
-/* The following data types should be used to calculate */
-/* maximum message sizes only. The actual message may be */
-/* smaller, and the position of the arguments within the */
-/* message layout may vary from what is presented here. */
-/* For example, if any of the arguments are variable- */
-/* sized, and less than the maximum is sent, the data */
-/* will be packed tight in the actual message to reduce */
-/* the presence of holes. */
-/********************** Caution **************************/
-
-/* typedefs for all requests */
-
-#ifndef __Request__mach_vm_subsystem__defined
-#define __Request__mach_vm_subsystem__defined
-
-#ifdef __MigPackStructs
-#pragma pack(4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- NDR_record_t NDR;
- mach_vm_address_t address;
- mach_vm_size_t size;
- int flags;
- } __Request__mach_vm_allocate_t;
-#ifdef __MigPackStructs
-#pragma pack()
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- NDR_record_t NDR;
- mach_vm_address_t address;
- mach_vm_size_t size;
- } __Request__mach_vm_deallocate_t;
-#ifdef __MigPackStructs
-#pragma pack()
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- NDR_record_t NDR;
- mach_vm_address_t address;
- mach_vm_size_t size;
- boolean_t set_maximum;
- vm_prot_t new_protection;
- } __Request__mach_vm_protect_t;
-#ifdef __MigPackStructs
-#pragma pack()
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- NDR_record_t NDR;
- mach_vm_address_t address;
- mach_vm_size_t size;
- vm_inherit_t new_inheritance;
- } __Request__mach_vm_inherit_t;
-#ifdef __MigPackStructs
-#pragma pack()
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- NDR_record_t NDR;
- mach_vm_address_t address;
- mach_vm_size_t size;
- } __Request__mach_vm_read_t;
-#ifdef __MigPackStructs
-#pragma pack()
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- NDR_record_t NDR;
- mach_vm_read_entry_t data_list;
- natural_t count;
- } __Request__mach_vm_read_list_t;
-#ifdef __MigPackStructs
-#pragma pack()
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- /* start of the kernel processed data */
- mach_msg_body_t msgh_body;
- mach_msg_ool_descriptor_t data;
- /* end of the kernel processed data */
- NDR_record_t NDR;
- mach_vm_address_t address;
- mach_msg_type_number_t dataCnt;
- } __Request__mach_vm_write_t;
-#ifdef __MigPackStructs
-#pragma pack()
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- NDR_record_t NDR;
- mach_vm_address_t source_address;
- mach_vm_size_t size;
- mach_vm_address_t dest_address;
- } __Request__mach_vm_copy_t;
-#ifdef __MigPackStructs
-#pragma pack()
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- NDR_record_t NDR;
- mach_vm_address_t address;
- mach_vm_size_t size;
- mach_vm_address_t data;
- } __Request__mach_vm_read_overwrite_t;
-#ifdef __MigPackStructs
-#pragma pack()
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- NDR_record_t NDR;
- mach_vm_address_t address;
- mach_vm_size_t size;
- vm_sync_t sync_flags;
- } __Request__mach_vm_msync_t;
-#ifdef __MigPackStructs
-#pragma pack()
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- NDR_record_t NDR;
- mach_vm_address_t address;
- mach_vm_size_t size;
- vm_behavior_t new_behavior;
- } __Request__mach_vm_behavior_set_t;
-#ifdef __MigPackStructs
-#pragma pack()
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- /* start of the kernel processed data */
- mach_msg_body_t msgh_body;
- mach_msg_port_descriptor_t object;
- /* end of the kernel processed data */
- NDR_record_t NDR;
- mach_vm_address_t address;
- mach_vm_size_t size;
- mach_vm_offset_t mask;
- int flags;
- memory_object_offset_t offset;
- boolean_t copy;
- vm_prot_t cur_protection;
- vm_prot_t max_protection;
- vm_inherit_t inheritance;
- } __Request__mach_vm_map_t;
-#ifdef __MigPackStructs
-#pragma pack()
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- NDR_record_t NDR;
- mach_vm_address_t address;
- mach_vm_size_t size;
- vm_machine_attribute_t attribute;
- vm_machine_attribute_val_t value;
- } __Request__mach_vm_machine_attribute_t;
-#ifdef __MigPackStructs
-#pragma pack()
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- /* start of the kernel processed data */
- mach_msg_body_t msgh_body;
- mach_msg_port_descriptor_t src_task;
- /* end of the kernel processed data */
- NDR_record_t NDR;
- mach_vm_address_t target_address;
- mach_vm_size_t size;
- mach_vm_offset_t mask;
- int flags;
- mach_vm_address_t src_address;
- boolean_t copy;
- vm_inherit_t inheritance;
- } __Request__mach_vm_remap_t;
-#ifdef __MigPackStructs
-#pragma pack()
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- NDR_record_t NDR;
- mach_vm_offset_t offset;
- } __Request__mach_vm_page_query_t;
-#ifdef __MigPackStructs
-#pragma pack()
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- NDR_record_t NDR;
- mach_vm_address_t address;
- natural_t nesting_depth;
- mach_msg_type_number_t infoCnt;
- } __Request__mach_vm_region_recurse_t;
-#ifdef __MigPackStructs
-#pragma pack()
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- NDR_record_t NDR;
- mach_vm_address_t address;
- vm_region_flavor_t flavor;
- mach_msg_type_number_t infoCnt;
- } __Request__mach_vm_region_t;
-#ifdef __MigPackStructs
-#pragma pack()
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- /* start of the kernel processed data */
- mach_msg_body_t msgh_body;
- mach_msg_port_descriptor_t parent_handle;
- /* end of the kernel processed data */
- NDR_record_t NDR;
- memory_object_size_t size;
- memory_object_offset_t offset;
- vm_prot_t permission;
- } __Request___mach_make_memory_entry_t;
-#ifdef __MigPackStructs
-#pragma pack()
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- NDR_record_t NDR;
- mach_vm_address_t address;
- vm_purgable_t control;
- int state;
- } __Request__mach_vm_purgable_control_t;
-#ifdef __MigPackStructs
-#pragma pack()
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- NDR_record_t NDR;
- mach_vm_address_t address;
- vm_page_info_flavor_t flavor;
- mach_msg_type_number_t infoCnt;
- } __Request__mach_vm_page_info_t;
-#ifdef __MigPackStructs
-#pragma pack()
-#endif
-#endif /* !__Request__mach_vm_subsystem__defined */
-
-/* union of all requests */
-
-#ifndef __RequestUnion__mach_vm_subsystem__defined
-#define __RequestUnion__mach_vm_subsystem__defined
-union __RequestUnion__mach_vm_subsystem {
- __Request__mach_vm_allocate_t Request_mach_vm_allocate;
- __Request__mach_vm_deallocate_t Request_mach_vm_deallocate;
- __Request__mach_vm_protect_t Request_mach_vm_protect;
- __Request__mach_vm_inherit_t Request_mach_vm_inherit;
- __Request__mach_vm_read_t Request_mach_vm_read;
- __Request__mach_vm_read_list_t Request_mach_vm_read_list;
- __Request__mach_vm_write_t Request_mach_vm_write;
- __Request__mach_vm_copy_t Request_mach_vm_copy;
- __Request__mach_vm_read_overwrite_t Request_mach_vm_read_overwrite;
- __Request__mach_vm_msync_t Request_mach_vm_msync;
- __Request__mach_vm_behavior_set_t Request_mach_vm_behavior_set;
- __Request__mach_vm_map_t Request_mach_vm_map;
- __Request__mach_vm_machine_attribute_t Request_mach_vm_machine_attribute;
- __Request__mach_vm_remap_t Request_mach_vm_remap;
- __Request__mach_vm_page_query_t Request_mach_vm_page_query;
- __Request__mach_vm_region_recurse_t Request_mach_vm_region_recurse;
- __Request__mach_vm_region_t Request_mach_vm_region;
- __Request___mach_make_memory_entry_t Request__mach_make_memory_entry;
- __Request__mach_vm_purgable_control_t Request_mach_vm_purgable_control;
- __Request__mach_vm_page_info_t Request_mach_vm_page_info;
-};
-#endif /* !__RequestUnion__mach_vm_subsystem__defined */
-/* typedefs for all replies */
-
-#ifndef __Reply__mach_vm_subsystem__defined
-#define __Reply__mach_vm_subsystem__defined
-
-#ifdef __MigPackStructs
-#pragma pack(4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- NDR_record_t NDR;
- kern_return_t RetCode;
- mach_vm_address_t address;
- } __Reply__mach_vm_allocate_t;
-#ifdef __MigPackStructs
-#pragma pack()
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- NDR_record_t NDR;
- kern_return_t RetCode;
- } __Reply__mach_vm_deallocate_t;
-#ifdef __MigPackStructs
-#pragma pack()
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- NDR_record_t NDR;
- kern_return_t RetCode;
- } __Reply__mach_vm_protect_t;
-#ifdef __MigPackStructs
-#pragma pack()
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- NDR_record_t NDR;
- kern_return_t RetCode;
- } __Reply__mach_vm_inherit_t;
-#ifdef __MigPackStructs
-#pragma pack()
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- /* start of the kernel processed data */
- mach_msg_body_t msgh_body;
- mach_msg_ool_descriptor_t data;
- /* end of the kernel processed data */
- NDR_record_t NDR;
- mach_msg_type_number_t dataCnt;
- } __Reply__mach_vm_read_t;
-#ifdef __MigPackStructs
-#pragma pack()
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- NDR_record_t NDR;
- kern_return_t RetCode;
- mach_vm_read_entry_t data_list;
- } __Reply__mach_vm_read_list_t;
-#ifdef __MigPackStructs
-#pragma pack()
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- NDR_record_t NDR;
- kern_return_t RetCode;
- } __Reply__mach_vm_write_t;
-#ifdef __MigPackStructs
-#pragma pack()
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- NDR_record_t NDR;
- kern_return_t RetCode;
- } __Reply__mach_vm_copy_t;
-#ifdef __MigPackStructs
-#pragma pack()
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- NDR_record_t NDR;
- kern_return_t RetCode;
- mach_vm_size_t outsize;
- } __Reply__mach_vm_read_overwrite_t;
-#ifdef __MigPackStructs
-#pragma pack()
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- NDR_record_t NDR;
- kern_return_t RetCode;
- } __Reply__mach_vm_msync_t;
-#ifdef __MigPackStructs
-#pragma pack()
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- NDR_record_t NDR;
- kern_return_t RetCode;
- } __Reply__mach_vm_behavior_set_t;
-#ifdef __MigPackStructs
-#pragma pack()
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- NDR_record_t NDR;
- kern_return_t RetCode;
- mach_vm_address_t address;
- } __Reply__mach_vm_map_t;
-#ifdef __MigPackStructs
-#pragma pack()
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- NDR_record_t NDR;
- kern_return_t RetCode;
- vm_machine_attribute_val_t value;
- } __Reply__mach_vm_machine_attribute_t;
-#ifdef __MigPackStructs
-#pragma pack()
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- NDR_record_t NDR;
- kern_return_t RetCode;
- mach_vm_address_t target_address;
- vm_prot_t cur_protection;
- vm_prot_t max_protection;
- } __Reply__mach_vm_remap_t;
-#ifdef __MigPackStructs
-#pragma pack()
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- NDR_record_t NDR;
- kern_return_t RetCode;
- integer_t disposition;
- integer_t ref_count;
- } __Reply__mach_vm_page_query_t;
-#ifdef __MigPackStructs
-#pragma pack()
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- NDR_record_t NDR;
- kern_return_t RetCode;
- mach_vm_address_t address;
- mach_vm_size_t size;
- natural_t nesting_depth;
- mach_msg_type_number_t infoCnt;
- int info[19];
- } __Reply__mach_vm_region_recurse_t;
-#ifdef __MigPackStructs
-#pragma pack()
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- /* start of the kernel processed data */
- mach_msg_body_t msgh_body;
- mach_msg_port_descriptor_t object_name;
- /* end of the kernel processed data */
- NDR_record_t NDR;
- mach_vm_address_t address;
- mach_vm_size_t size;
- mach_msg_type_number_t infoCnt;
- int info[10];
- } __Reply__mach_vm_region_t;
-#ifdef __MigPackStructs
-#pragma pack()
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- /* start of the kernel processed data */
- mach_msg_body_t msgh_body;
- mach_msg_port_descriptor_t object_handle;
- /* end of the kernel processed data */
- NDR_record_t NDR;
- memory_object_size_t size;
- } __Reply___mach_make_memory_entry_t;
-#ifdef __MigPackStructs
-#pragma pack()
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- NDR_record_t NDR;
- kern_return_t RetCode;
- int state;
- } __Reply__mach_vm_purgable_control_t;
-#ifdef __MigPackStructs
-#pragma pack()
-#endif
-
-#ifdef __MigPackStructs
-#pragma pack(4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- NDR_record_t NDR;
- kern_return_t RetCode;
- mach_msg_type_number_t infoCnt;
- int info[32];
- } __Reply__mach_vm_page_info_t;
-#ifdef __MigPackStructs
-#pragma pack()
-#endif
-#endif /* !__Reply__mach_vm_subsystem__defined */
-
-/* union of all replies */
-
-#ifndef __ReplyUnion__mach_vm_subsystem__defined
-#define __ReplyUnion__mach_vm_subsystem__defined
-union __ReplyUnion__mach_vm_subsystem {
- __Reply__mach_vm_allocate_t Reply_mach_vm_allocate;
- __Reply__mach_vm_deallocate_t Reply_mach_vm_deallocate;
- __Reply__mach_vm_protect_t Reply_mach_vm_protect;
- __Reply__mach_vm_inherit_t Reply_mach_vm_inherit;
- __Reply__mach_vm_read_t Reply_mach_vm_read;
- __Reply__mach_vm_read_list_t Reply_mach_vm_read_list;
- __Reply__mach_vm_write_t Reply_mach_vm_write;
- __Reply__mach_vm_copy_t Reply_mach_vm_copy;
- __Reply__mach_vm_read_overwrite_t Reply_mach_vm_read_overwrite;
- __Reply__mach_vm_msync_t Reply_mach_vm_msync;
- __Reply__mach_vm_behavior_set_t Reply_mach_vm_behavior_set;
- __Reply__mach_vm_map_t Reply_mach_vm_map;
- __Reply__mach_vm_machine_attribute_t Reply_mach_vm_machine_attribute;
- __Reply__mach_vm_remap_t Reply_mach_vm_remap;
- __Reply__mach_vm_page_query_t Reply_mach_vm_page_query;
- __Reply__mach_vm_region_recurse_t Reply_mach_vm_region_recurse;
- __Reply__mach_vm_region_t Reply_mach_vm_region;
- __Reply___mach_make_memory_entry_t Reply__mach_make_memory_entry;
- __Reply__mach_vm_purgable_control_t Reply_mach_vm_purgable_control;
- __Reply__mach_vm_page_info_t Reply_mach_vm_page_info;
-};
-#endif /* !__RequestUnion__mach_vm_subsystem__defined */
-
-#ifndef subsystem_to_name_map_mach_vm
-#define subsystem_to_name_map_mach_vm \
- { "mach_vm_allocate", 4800 },\
- { "mach_vm_deallocate", 4801 },\
- { "mach_vm_protect", 4802 },\
- { "mach_vm_inherit", 4803 },\
- { "mach_vm_read", 4804 },\
- { "mach_vm_read_list", 4805 },\
- { "mach_vm_write", 4806 },\
- { "mach_vm_copy", 4807 },\
- { "mach_vm_read_overwrite", 4808 },\
- { "mach_vm_msync", 4809 },\
- { "mach_vm_behavior_set", 4810 },\
- { "mach_vm_map", 4811 },\
- { "mach_vm_machine_attribute", 4812 },\
- { "mach_vm_remap", 4813 },\
- { "mach_vm_page_query", 4814 },\
- { "mach_vm_region_recurse", 4815 },\
- { "mach_vm_region", 4816 },\
- { "_mach_make_memory_entry", 4817 },\
- { "mach_vm_purgable_control", 4818 },\
- { "mach_vm_page_info", 4819 }
-#endif
-
-#ifdef __AfterMigUserHeader
-__AfterMigUserHeader
-#endif /* __AfterMigUserHeader */
-
-#endif /* _mach_vm_user_ */
+++ /dev/null
-/*
- * Copyright (c) 2000-2007 Apple Inc. All rights reserved.
- *
- * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
- *
- * This file contains Original Code and/or Modifications of Original Code
- * as defined in and that are subject to the Apple Public Source License
- * Version 2.0 (the 'License'). You may not use this file except in
- * compliance with the License. The rights granted to you under the License
- * may not be used to create, or enable the creation or redistribution of,
- * unlawful or unlicensed copies of an Apple operating system, or to
- * circumvent, violate, or enable the circumvention or violation of, any
- * terms of an Apple operating system software license agreement.
- *
- * Please obtain a copy of the License at
- * http://www.opensource.apple.com/apsl/ and read it before using this file.
- *
- * The Original Code and all software distributed under the License are
- * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
- * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
- * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
- * Please see the License for the specific language governing rights and
- * limitations under the License.
- *
- * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
- */
-#ifdef PRIVATE
-
-#ifndef _MACHINE_CPU_CAPABILITIES_H
-#define _MACHINE_CPU_CAPABILITIES_H
-
-#ifdef KERNEL_PRIVATE
-#if defined (__ppc__)
-#include "ppc/cpu_capabilities.h"
-#elif defined (__i386__)
-#include "i386/cpu_capabilities.h"
-#else
-#error architecture not supported
-#endif
-
-#else /* !KERNEL_PRIVATE -- System Framework header */
-#if defined (__ppc__) || defined(__ppc64__)
-#include <System/ppc/cpu_capabilities.h>
-#elif defined (__i386__) || defined(__x86_64__)
-#include <System/i386/cpu_capabilities.h>
-#else
-#error architecture not supported
-#endif
-#endif /* KERNEL_PRIVATE */
-
-#endif /* _MACHINE_CPU_CAPABILITIES_H */
-#endif /* PRIVATE */
+++ /dev/null
-/*
- * Copyright (c) 2000-2003 Apple Computer, Inc. All rights reserved.
- *
- * @APPLE_LICENSE_HEADER_START@
- *
- * This file contains Original Code and/or Modifications of Original Code
- * as defined in and that are subject to the Apple Public Source License
- * Version 2.0 (the 'License'). You may not use this file except in
- * compliance with the License. Please obtain a copy of the License at
- * http://www.opensource.apple.com/apsl/ and read it before using this
- * file.
- *
- * The Original Code and all software distributed under the License are
- * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
- * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
- * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
- * Please see the License for the specific language governing rights and
- * limitations under the License.
- *
- * @APPLE_LICENSE_HEADER_END@
- */
-/*
- * Copyright 1996 1995 by Open Software Foundation, Inc. 1997 1996 1995 1994 1993 1992 1991
- * All Rights Reserved
- *
- * Permission to use, copy, modify, and distribute this software and
- * its documentation for any purpose and without fee is hereby granted,
- * provided that the above copyright notice appears in all copies and
- * that both the copyright notice and this permission notice appear in
- * supporting documentation.
- *
- * OSF DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
- * FOR A PARTICULAR PURPOSE.
- *
- * IN NO EVENT SHALL OSF BE LIABLE FOR ANY SPECIAL, INDIRECT, OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
- * LOSS OF USE, DATA OR PROFITS, WHETHER IN ACTION OF CONTRACT,
- * NEGLIGENCE, OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
- * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- *
- */
-/*
- * MkLinux
- */
-
-/*
- * POSIX Realtime Scheduling Framework - IEEE 1003.1b
- */
-
-#ifndef _POSIX_SCHED_H
-#define _POSIX_SCHED_H
-
-struct sched_param
-{
- int sched_priority;
- int quantum;
-};
-
-/*
- * POSIX scheduling policies
- */
-
-#define SCHED_OTHER POLICY_TIMESHARE
-#define SCHED_FIFO POLICY_FIFO
-#define SCHED_RR POLICY_RR
-
-#endif /* _POSIX_SCHED_H */
+++ /dev/null
-/*
- * Copyright (c) 2000-2003, 2007 Apple Inc. All rights reserved.
- *
- * @APPLE_LICENSE_HEADER_START@
- *
- * This file contains Original Code and/or Modifications of Original Code
- * as defined in and that are subject to the Apple Public Source License
- * Version 2.0 (the 'License'). You may not use this file except in
- * compliance with the License. Please obtain a copy of the License at
- * http://www.opensource.apple.com/apsl/ and read it before using this
- * file.
- *
- * The Original Code and all software distributed under the License are
- * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
- * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
- * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
- * Please see the License for the specific language governing rights and
- * limitations under the License.
- *
- * @APPLE_LICENSE_HEADER_END@
- */
-/*
- * Copyright 1996 1995 by Open Software Foundation, Inc. 1997 1996 1995 1994 1993 1992 1991
- * All Rights Reserved
- *
- * Permission to use, copy, modify, and distribute this software and
- * its documentation for any purpose and without fee is hereby granted,
- * provided that the above copyright notice appears in all copies and
- * that both the copyright notice and this permission notice appear in
- * supporting documentation.
- *
- * OSF DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
- * FOR A PARTICULAR PURPOSE.
- *
- * IN NO EVENT SHALL OSF BE LIABLE FOR ANY SPECIAL, INDIRECT, OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
- * LOSS OF USE, DATA OR PROFITS, WHETHER IN ACTION OF CONTRACT,
- * NEGLIGENCE, OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
- * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- *
- */
-/*
- * MkLinux
- */
-
-/*
- * POSIX Threads - IEEE 1003.1c
- */
-
-#ifndef _POSIX_PTHREAD_INTERNALS_H
-#define _POSIX_PTHREAD_INTERNALS_H
-
-// suppress pthread_attr_t typedef in sys/signal.h
-#define _PTHREAD_ATTR_T
-struct _pthread_attr_t; /* forward reference */
-typedef struct _pthread_attr_t pthread_attr_t;
-
-#include <assert.h>
-#include <stddef.h>
-#include <stdint.h>
-#include <stdlib.h>
-#include <limits.h>
-#include <errno.h>
-#include <mach/mach.h>
-#include <mach/mach_error.h>
-#include <libkern/OSAtomic.h>
-
-
-#ifndef __POSIX_LIB__
-#define __POSIX_LIB__
-#endif
-
-#include "posix_sched.h" /* For POSIX scheduling policy & parameter */
-#include <sys/queue.h> /* For POSIX scheduling policy & parameter */
-#include "pthread_machdep.h" /* Machine-dependent definitions. */
-#include "pthread_spinlock.h" /* spinlock definitions. */
-
-TAILQ_HEAD(__pthread_list, _pthread);
-
-extern int __pthread_lock_debug;
-extern int __pthread_lock_old;
-
-extern struct __pthread_list __pthread_head; /* head of list of open files */
-extern pthread_lock_t _pthread_list_lock;
-extern size_t pthreadsize;
-/*
- * Compiled-in limits
- */
-#define _EXTERNAL_POSIX_THREAD_KEYS_MAX 512
-#define _INTERNAL_POSIX_THREAD_KEYS_MAX 256
-#define _INTERNAL_POSIX_THREAD_KEYS_END 768
-
-/*
- * Threads
- */
-#define MAXTHREADNAMESIZE 64
-#define _PTHREAD_T
-typedef struct _pthread
-{
- long sig; /* Unique signature for this structure */
- struct __darwin_pthread_handler_rec *__cleanup_stack;
- pthread_lock_t lock; /* Used for internal mutex on structure */
- uint32_t detached:8,
- inherit:8,
- policy:8,
- freeStackOnExit:1,
- newstyle:1,
- kernalloc:1,
- schedset:1,
- wqthread:1,
- wqkillset:1,
- pad:2;
- size_t guardsize; /* size in bytes to guard stack overflow */
-#if !defined(__LP64__)
- int pad0; /* for backwards compatibility */
-#endif
- struct sched_param param;
- uint32_t cancel_error;
-#if defined(__LP64__)
- uint32_t cancel_pad; /* pad value for alignment */
-#endif
- struct _pthread *joiner;
-#if !defined(__LP64__)
- int pad1; /* for backwards compatibility */
-#endif
- void *exit_value;
- semaphore_t death; /* pthread_join() uses this to wait for death's call */
- mach_port_t kernel_thread; /* kernel thread this thread is bound to */
- void *(*fun)(void*);/* Thread start routine */
- void *arg; /* Argment for thread start routine */
- int cancel_state; /* Whether thread can be cancelled */
- int err_no; /* thread-local errno */
- void *tsd[_EXTERNAL_POSIX_THREAD_KEYS_MAX + _INTERNAL_POSIX_THREAD_KEYS_MAX]; /* Thread specific data */
- void *stackaddr; /* Base of the stack (is aligned on vm_page_size boundary */
- size_t stacksize; /* Size of the stack (is a multiple of vm_page_size and >= PTHREAD_STACK_MIN) */
- mach_port_t reply_port; /* Cached MiG reply port */
-#if defined(__LP64__)
- int pad2; /* for natural alignment */
-#endif
- void *cthread_self; /* cthread_self() if somebody calls cthread_set_self() */
- /* protected by list lock */
- uint32_t childrun:1,
- parentcheck:1,
- childexit:1,
- pad3:29;
-#if defined(__LP64__)
- int pad4; /* for natural alignment */
-#endif
- TAILQ_ENTRY(_pthread) plist;
- void * freeaddr;
- size_t freesize;
- mach_port_t joiner_notify;
- char pthread_name[MAXTHREADNAMESIZE]; /* including nulll the name */
- int max_tsd_key;
- void * cur_workq;
- void * cur_workitem;
- uint64_t thread_id;
-} *pthread_t;
-
-/*
- * Thread attributes
- */
-struct _pthread_attr_t
-{
- long sig; /* Unique signature for this structure */
- pthread_lock_t lock;
- uint32_t detached:8,
- inherit:8,
- policy:8,
- freeStackOnExit:1,
- fastpath:1,
- schedset:1,
- reserved1:5;
- size_t guardsize; /* size in bytes to guard stack overflow */
- int reserved2; /* Should we free the stack when we exit? */
- struct sched_param param;
- void *stackaddr; /* Base of the stack (is aligned on vm_page_size boundary */
- size_t stacksize; /* Size of the stack (is a multiple of vm_page_size and >= PTHREAD_STACK_MIN) */
- boolean_t reserved3;
-};
-
-/*
- * Mutex attributes
- */
-#define _PTHREAD_MUTEX_POLICY_NONE 0
-#define _PTHREAD_MUTEX_POLICY_FAIRSHARE 1
-#define _PTHREAD_MUTEX_POLICY_FIRSTFIT 2
-#define _PTHREAD_MUTEX_POLICY_REALTIME 3
-#define _PTHREAD_MUTEX_POLICY_ADAPTIVE 4
-#define _PTHREAD_MUTEX_POLICY_PRIPROTECT 5
-#define _PTHREAD_MUTEX_POLICY_PRIINHERIT 6
-
-#define _PTHREAD_MUTEXATTR_T
-typedef struct
-{
- long sig; /* Unique signature for this structure */
- int prioceiling;
- uint32_t protocol:2, /* protocol attribute */
- type:2, /* mutex type */
- pshared:2,
- policy:3,
- rfu:23;
-} pthread_mutexattr_t;
-
-/*
- * Mutex variables
- */
-struct _pthread_mutex_options {
- uint32_t protocol:2, /* protocol */
- type:2, /* mutex type */
- pshared:2, /* mutex type */
- policy:3,
- hold:2,
- misalign:1, /* 8 byte aligned? */
- notify:1, /* CV notify field for kernel */
- mutex:1, /* used in clrprepo that it is a mutex */
- rfu:2,
- lock_count:16;
-};
-
-
-#define _PTHREAD_MTX_OPT_PSHARED 0x010
-#define _PTHREAD_MTX_OPT_HOLD 0x200 /* current owner of the mutex */
-#define _PTHREAD_MTX_OPT_NOMTX 0x400 /* no mutex refs held */
-
-#define _PTHREAD_MTX_OPT_NOTIFY 0x1000 /* notify to drop mutex handling in cvwait */
-#define _PTHREAD_MTX_OPT_MUTEX 0x2000 /* this is a mutex type */
-
-
-#define _PTHREAD_MUTEX_T
-typedef struct _pthread_mutex
-{
- long sig; /* Unique signature for this structure */
- pthread_lock_t lock; /* Used for internal mutex on structure */
- union {
- uint32_t value;
- struct _pthread_mutex_options options;
- } mtxopts;
- int16_t prioceiling;
- int16_t priority; /* Priority to restore when mutex unlocked */
- uint32_t waiters; /* Count of threads waiting for this mutex */
- pthread_t owner; /* Which thread has this mutex locked */
- struct _pthread_mutex *next, *prev; /* List of other mutexes he owns */
- struct _pthread_cond *busy; /* List of condition variables using this mutex */
- semaphore_t sem; /* Semaphore used for waiting */
- semaphore_t order;
-} pthread_mutex_t;
-
-
-typedef struct _npthread_mutex
-{
-/* keep same as pthread_mutex_t from here to .. */
- long sig; /* Unique signature for this structure */
- pthread_lock_t lock; /* Used for static init sequencing */
- union {
- uint32_t value;
- struct _pthread_mutex_options options;
- } mtxopts;
- int16_t prioceiling;
- int16_t priority; /* Priority to restore when mutex unlocked */
- uint32_t m_seq[3];
-#if defined(__LP64__)
- uint64_t m_tid; /* Which thread has this mutex locked */
- uint32_t * m_lseqaddr;
- uint32_t * m_useqaddr;
- uint32_t reserved[2];
-#else
- uint32_t * m_lseqaddr;
- uint64_t m_tid; /* Which thread has this mutex locked */
- uint32_t * m_useqaddr;
-#endif
-} npthread_mutex_t;
-
-
-
-
-/*
- * Condition variable attributes
- */
-#define _PTHREAD_CONDATTR_T
-typedef struct
-{
- long sig; /* Unique signature for this structure */
- uint32_t pshared:2, /* pshared */
- unsupported:30;
-} pthread_condattr_t;
-
-/*
- * Condition variables
- */
-#define _PTHREAD_COND_T
-typedef struct _pthread_cond
-{
- long sig; /* Unique signature for this structure */
- pthread_lock_t lock; /* Used for internal mutex on structure */
- uint32_t waiters:15, /* Number of threads waiting */
- sigspending:15, /* Number of outstanding signals */
- pshared:2;
- struct _pthread_cond *next, *prev; /* List of condition variables using mutex */
- struct _pthread_mutex *busy; /* mutex associated with variable */
- semaphore_t sem; /* Kernel semaphore */
-} pthread_cond_t;
-
-
-typedef struct _npthread_cond
-{
- long sig; /* Unique signature for this structure */
- pthread_lock_t lock; /* Used for internal mutex on structure */
- uint32_t rfu:29, /* not in use*/
- misalign: 1, /* structure is not aligned to 8 byte boundary */
- pshared:2;
- struct _npthread_mutex *busy; /* mutex associated with variable */
- uint32_t c_seq[3];
-#if defined(__LP64__)
- uint32_t reserved[3];
-#endif /* __LP64__ */
-} npthread_cond_t;
-
-/*
- * Initialization control (once) variables
- */
-#define _PTHREAD_ONCE_T
-typedef struct
-{
- long sig; /* Unique signature for this structure */
- pthread_lock_t lock; /* Used for internal mutex on structure */
-} pthread_once_t;
-
-#define _PTHREAD_RWLOCKATTR_T
-typedef struct {
- long sig; /* Unique signature for this structure */
- int pshared;
- int rfu[2]; /* reserved for future use */
-} pthread_rwlockattr_t;
-
-#define _PTHREAD_RWLOCK_T
-typedef struct {
- long sig;
- pthread_mutex_t lock; /* monitor lock */
- int state;
- pthread_cond_t read_signal;
- pthread_cond_t write_signal;
- int blocked_writers;
- int reserved;
- pthread_t owner;
- int rfu[1];
- int pshared;
-} pthread_rwlock_t;
-
-#define PTHRW_RFU_64BIT 124 /* 31 * sizeof(uint32_t) */
-#define PTHRW_RFU_32BIT 72 /* 18 * sizeof(uint32_t) */
-
-#define _PTHREAD_RWLOCK_T
-typedef struct {
- long sig;
- pthread_lock_t lock;
-#if defined(__LP64__)
- int reserv;
- volatile uint32_t rw_seq[4];
- pthread_t rw_owner;
-#else /* __LP64__ */
- volatile uint32_t rw_seq[4];
- pthread_t rw_owner;
- int reserv;
-#endif /* __LP64__ */
- volatile uint32_t * rw_lcntaddr;
- volatile uint32_t * rw_seqaddr;
- volatile uint32_t * rw_ucntaddr;
- uint32_t rw_flags;
- int misalign;
-#if defined(__LP64__)
- char rfu[PTHRW_RFU_64BIT];
-#else /* __LP64__ */
- char rfu[PTHRW_RFU_32BIT];
-#endif /* __LP64__ */
- int pshared;
-} npthread_rwlock_t;
-
-/* flags for rw_flags */
-#define PTHRW_KERN_PROCESS_SHARED 0x10
-#define PTHRW_KERN_PROCESS_PRIVATE 0x20
-#define PTHRW_KERN_PROCESS_FLAGS_MASK 0x30
-#define _PTHREAD_RWLOCK_UPGRADE_TRY 0x10000
-
-/* New model bits on Lword */
-#define PTH_RWL_KBIT 0x01 /* users cannot acquire in user mode */
-#define PTH_RWL_EBIT 0x02 /* exclusive lock in progress */
-#define PTH_RWL_WBIT 0x04 /* write waiters pending in kernel */
-#define PTH_RWL_PBIT 0x04 /* prepost (cv) pending in kernel */
-#define PTH_RWL_YBIT 0x08 /* yielding write waiters pending in kernel */
-#define PTH_RWL_RETRYBIT 0x08 /* mutex retry wait */
-#define PTH_RWL_LBIT 0x10 /* long read in progress */
-#define PTH_RWL_MTXNONE 0x10 /* indicates the cvwait does not have mutex held */
-#define PTH_RWL_UBIT 0x20 /* upgrade request pending */
-#define PTH_RWL_MTX_WAIT 0x20 /* in cvar in mutex wait */
-#define PTH_RWL_RBIT 0x40 /* reader pending in kernel(not used) */
-#define PTH_RWL_MBIT 0x40 /* overlapping grants from kernel */
-#define PTH_RWL_TRYLKBIT 0x40 /* sets try lock attempt */
-#define PTH_RWL_IBIT 0x80 /* lock reset, held untill first succeesful unlock */
-
-/* UBIT values for mutex, cvar */
-#define PTH_RWU_SBIT 0x01
-#define PTH_RWU_BBIT 0x02
-
-#define PTHRW_RWL_INIT PTH_RWL_IBIT /* reset on the lock bits (U)*/
-#define PTHRW_RWLOCK_INIT (PTH_RWL_IBIT | PTH_RWL_RBIT) /* reset on the lock bits (U)*/
-#define PTH_RWLOCK_RESET_RBIT 0xffffffbf
-
-#define PTHRW_INC 0x100
-#define PTHRW_BIT_MASK 0x000000ff
-
-#define PTHRW_UN_BIT_MASK 0x000000bf /* remove overlap bit */
-
-
-/* New model bits on Sword */
-#define PTH_RWS_SBIT 0x01 /* kernel transition seq not set yet*/
-#define PTH_RWS_IBIT 0x02 /* Sequence is not set on return from kernel */
-
-#define PTH_RWS_CV_CBIT PTH_RWS_SBIT /* kernel has cleared all info w.r.s.t CV */
-#define PTH_RWS_CV_PBIT PTH_RWS_IBIT /* kernel has prepost/fake structs only,no waiters */
-#define PTH_RWS_CV_BITSALL (PTH_RWS_CV_CBIT | PTH_RWS_CV_PBIT)
-#define PTH_RWS_CV_MBIT PTH_RWL_MBIT /* to indicate prepost return from kernel */
-#define PTH_RWS_CV_RESET_PBIT 0xfffffffd
-
-#define PTH_RWS_WSVBIT 0x04 /* save W bit */
-#define PTH_RWS_USVBIT 0x08 /* save U bit */
-#define PTH_RWS_YSVBIT 0x10 /* save Y bit */
-#define PTHRW_RWS_INIT PTH_RWS_SBIT /* reset on the lock bits (U)*/
-#define PTHRW_RWS_SAVEMASK (PTH_RWS_WSVBIT|PTH_RWS_USVBIT|PTH_RWS_YSVBIT) /*save bits mask*/
-#define PTHRW_SW_Reset_BIT_MASK 0x000000fe /* remove S bit and get rest of the bits */
-
-#define PTHRW_COUNT_SHIFT 8
-#define PTHRW_COUNT_MASK 0xffffff00
-#define PTHRW_MAX_READERS 0xffffff00
-
-
-#define PTHREAD_MTX_TID_SWITCHING (uint64_t)-1
-
-/* new L word defns */
-#define can_rwl_readinuser(x) ((((x) & (PTH_RWL_UBIT | PTH_RWL_WBIT | PTH_RWL_KBIT)) == 0)||(((x) & PTH_RWL_LBIT) != 0))
-#define can_rwl_longreadinuser(x) (((x) & (PTH_RWL_UBIT | PTH_RWL_WBIT | PTH_RWL_KBIT | PTH_RWL_YBIT)) == 0)
-#define is_rwl_ebit_set(x) (((x) & PTH_RWL_EBIT) != 0)
-#define is_rwl_eubit_set(x) (((x) & (PTH_RWL_EBIT | PTH_RWL_UBIT)) != 0)
-#define is_rwl_wbit_set(x) (((x) & PTH_RWL_WBIT) != 0)
-#define is_rwl_lbit_set(x) (((x) & PTH_RWL_LBIT) != 0)
-#define is_rwl_ebit_clear(x) (((x) & PTH_RWL_EBIT) == 0)
-#define is_rwl_lbit_clear(x) (((x) & PTH_RWL_LBIT) == 0)
-#define is_rwl_readoverlap(x) (((x) & PTH_RWL_MBIT) != 0)
-
-/* S word checks */
-#define is_rws_setseq(x) (((x) & PTH_RWS_SBIT))
-#define is_rws_setunlockinit(x) (((x) & PTH_RWS_IBIT))
-
-/* is x lower than Y */
-static inline int is_seqlower(uint32_t x, uint32_t y) {
- if (x < y) {
- if ((y-x) < (PTHRW_MAX_READERS/2))
- return(1);
- } else {
- if ((x-y) > (PTHRW_MAX_READERS/2))
- return(1);
- }
- return(0);
-}
-
-/* is x lower than or eq Y */
-static inline int is_seqlower_eq(uint32_t x, uint32_t y) {
- if (x==y)
- return(1);
- else
- return(is_seqlower(x,y));
-}
-
-/* is x greater than Y */
-static inline int is_seqhigher(uint32_t x, uint32_t y) {
- if (x > y) {
- if ((x-y) < (PTHRW_MAX_READERS/2))
- return(1);
- } else {
- if ((y-x) > (PTHRW_MAX_READERS/2))
- return(1);
- }
- return(0);
-}
-
-static inline int diff_genseq(uint32_t x, uint32_t y) {
- if (x == y) {
- return(0);
- } else if (x > y) {
- return(x-y);
- } else {
- return((PTHRW_MAX_READERS - y) + x + PTHRW_INC);
- }
-}
-
-/* keep the size to 64bytes for both 64 and 32 */
-#define _PTHREAD_WORKQUEUE_ATTR_T
-typedef struct {
- uint32_t sig;
- int queueprio;
- int overcommit;
- unsigned int resv2[13];
-} pthread_workqueue_attr_t;
-
-#define _PTHREAD_WORKITEM_T
-typedef struct _pthread_workitem {
- TAILQ_ENTRY(_pthread_workitem) item_entry; /* pthread_workitem list in prio */
- void (*func)(void *);
- void * func_arg;
- struct _pthread_workqueue * workq;
- unsigned int flags;
- unsigned int fromcache; /* padding for 64bit */
-} * pthread_workitem_t;
-
-#define PTH_WQITEM_INKERNEL_QUEUE 1
-#define PTH_WQITEM_RUNNING 2
-#define PTH_WQITEM_COMPLETED 4
-#define PTH_WQITEM_REMOVED 8
-#define PTH_WQITEM_BARRIER 0x10
-#define PTH_WQITEM_DESTROY 0x20
-#define PTH_WQITEM_NOTINLIST 0x40
-#define PTH_WQITEM_APPLIED 0x80
-#define PTH_WQITEM_KERN_COUNT 0x100
-
-/* try to fit these within multiple of pages (8 pages for now) */
-#define WORKITEM_POOL_SIZE 680
-/* ensure some multiple of the chunk is the pool size */
-#define WORKITEM_CHUNK_SIZE 40
-
-#define WORKITEM_STARTPOOL_SIZE WORKITEM_CHUNK_SIZE
-
-TAILQ_HEAD(__pthread_workitem_pool, _pthread_workitem);
-extern struct __pthread_workitem_pool __pthread_workitem_pool_head; /* head list of workitem pool */
-
-#define _PTHREAD_WORKQUEUE_HEAD_T
-typedef struct _pthread_workqueue_head {
- TAILQ_HEAD(, _pthread_workqueue) wqhead;
- struct _pthread_workqueue * next_workq;
-} * pthread_workqueue_head_t;
-
-
-/* sized to be 128 bytes both in 32 and 64bit archs */
-#define _PTHREAD_WORKQUEUE_T
-typedef struct _pthread_workqueue {
- unsigned int sig; /* Unique signature for this structure */
- pthread_lock_t lock; /* Used for internal mutex on structure */
- TAILQ_ENTRY(_pthread_workqueue) wq_list; /* workqueue list in prio */
- TAILQ_HEAD(, _pthread_workitem) item_listhead; /* pthread_workitem list in prio */
- TAILQ_HEAD(, _pthread_workitem) item_kernhead; /* pthread_workitem list in prio */
- unsigned int flags;
- size_t stacksize;
- int istimeshare;
- int importance;
- int affinity;
- int queueprio;
- int barrier_count;
- int kq_count;
- void (*term_callback)(struct _pthread_workqueue *,void *);
- void * term_callarg;
- pthread_workqueue_head_t headp;
- int overcommit;
-#if !defined(__LP64__)
- unsigned int rev2[12];
-#endif
-} * pthread_workqueue_t;
-
-#define PTHREAD_WORKQ_IN_CREATION 1
-#define PTHREAD_WORKQ_IN_TERMINATE 2
-#define PTHREAD_WORKQ_BARRIER_ON 4
-#define PTHREAD_WORKQ_TERM_ON 8
-#define PTHREAD_WORKQ_DESTROYED 0x10
-#define PTHREAD_WORKQ_REQUEUED 0x20
-#define PTHREAD_WORKQ_SUSPEND 0x40
-
-#define WORKQUEUE_POOL_SIZE 16
-TAILQ_HEAD(__pthread_workqueue_pool, _pthread_workqueue);
-extern struct __pthread_workqueue_pool __pthread_workqueue_pool_head; /* head list of workqueue pool */
-
-#include "pthread_spis.h"
-
-#if defined(__i386__) || defined(__ppc64__) || defined(__x86_64__) || (defined(__arm__) && (defined(_ARM_ARCH_7) || !defined(_ARM_ARCH_6) || !defined(__thumb__)))
-/*
- * Inside libSystem, we can use r13 or %gs directly to get access to the
- * thread-specific data area. The current thread is in the first slot.
- */
-inline static pthread_t __attribute__((__pure__))
-_pthread_self_direct(void)
-{
- pthread_t ret;
-
-#if defined(__i386__) || defined(__x86_64__)
- ret = (pthread_t) _pthread_getspecific_direct(0);
-#elif defined(__ppc64__)
- register const pthread_t __pthread_self asm ("r13");
- ret = __pthread_self;
-#elif defined(__arm__) && defined(_ARM_ARCH_6)
- ret = (pthread_t) _pthread_getspecific_direct(0);
-#elif defined(__arm__) && !defined(_ARM_ARCH_6)
- ret = (pthread_t) _pthread_getspecific_direct(0);
-#endif
- return ret;
-}
-#define pthread_self() _pthread_self_direct()
-#endif
-
-#define _PTHREAD_DEFAULT_INHERITSCHED PTHREAD_INHERIT_SCHED
-#define _PTHREAD_DEFAULT_PROTOCOL PTHREAD_PRIO_NONE
-#define _PTHREAD_DEFAULT_PRIOCEILING 0
-#define _PTHREAD_DEFAULT_POLICY SCHED_OTHER
-#define _PTHREAD_DEFAULT_STACKSIZE 0x80000 /* 512K */
-#define _PTHREAD_DEFAULT_PSHARED PTHREAD_PROCESS_PRIVATE
-
-#define _PTHREAD_NO_SIG 0x00000000
-#define _PTHREAD_MUTEX_ATTR_SIG 0x4D545841 /* 'MTXA' */
-#define _PTHREAD_MUTEX_SIG 0x4D555458 /* 'MUTX' */
-#define _PTHREAD_MUTEX_SIG_init 0x32AAABA7 /* [almost] ~'MUTX' */
-#define _PTHREAD_ERRORCHECK_MUTEX_SIG_init 0x32AAABA1
-#define _PTHREAD_RECURSIVE_MUTEX_SIG_init 0x32AAABA2
-#define _PTHREAD_FIRSTFIT_MUTEX_SIG_init 0x32AAABA3
-#define _PTHREAD_MUTEX_SIG_init_MASK 0xfffffff0
-#define _PTHREAD_MUTEX_SIG_CMP 0x32AAABA0
-#define _PTHREAD_COND_ATTR_SIG 0x434E4441 /* 'CNDA' */
-#define _PTHREAD_COND_SIG 0x434F4E44 /* 'COND' */
-#define _PTHREAD_COND_SIG_init 0x3CB0B1BB /* [almost] ~'COND' */
-#define _PTHREAD_ATTR_SIG 0x54484441 /* 'THDA' */
-#define _PTHREAD_ONCE_SIG 0x4F4E4345 /* 'ONCE' */
-#define _PTHREAD_ONCE_SIG_init 0x30B1BCBA /* [almost] ~'ONCE' */
-#define _PTHREAD_SIG 0x54485244 /* 'THRD' */
-#define _PTHREAD_RWLOCK_ATTR_SIG 0x52574C41 /* 'RWLA' */
-#define _PTHREAD_RWLOCK_SIG 0x52574C4B /* 'RWLK' */
-#define _PTHREAD_RWLOCK_SIG_init 0x2DA8B3B4 /* [almost] ~'RWLK' */
-
-
-#define _PTHREAD_KERN_COND_SIG 0x12345678 /* */
-#define _PTHREAD_KERN_MUTEX_SIG 0x34567812 /* */
-#define _PTHREAD_KERN_RWLOCK_SIG 0x56781234 /* */
-
-#define _PTHREAD_CREATE_PARENT 4
-#define _PTHREAD_EXITED 8
-// 4597450: begin
-#define _PTHREAD_WASCANCEL 0x10
-// 4597450: end
-
-#if defined(DEBUG)
-#define _PTHREAD_MUTEX_OWNER_SELF pthread_self()
-#else
-#define _PTHREAD_MUTEX_OWNER_SELF (pthread_t)0x12141968
-#endif
-#define _PTHREAD_MUTEX_OWNER_SWITCHING (pthread_t)(~0)
-
-#define _PTHREAD_CANCEL_STATE_MASK 0x01
-#define _PTHREAD_CANCEL_TYPE_MASK 0x02
-#define _PTHREAD_CANCEL_PENDING 0x10 /* pthread_cancel() has been called for this thread */
-
-extern boolean_t swtch_pri(int);
-
-#ifndef PTHREAD_MACH_CALL
-#define PTHREAD_MACH_CALL(expr, ret) (ret) = (expr)
-#endif
-
-/* Prototypes. */
-
-/* Functions defined in machine-dependent files. */
-extern vm_address_t _sp(void);
-extern vm_address_t _adjust_sp(vm_address_t sp);
-extern void _pthread_setup(pthread_t th, void (*f)(pthread_t), void *sp, int suspended, int needresume);
-
-extern void _pthread_tsd_cleanup(pthread_t self);
-
-__private_extern__ void __mtx_holdlock(npthread_mutex_t *mutex, uint32_t diff, uint32_t * flagp, uint32_t ** pmtxp, uint32_t * mgenp, uint32_t * ugenp, uint64_t *tidp);
-__private_extern__ int __mtx_droplock(npthread_mutex_t *mutex, uint32_t diff, uint32_t * flagp, uint32_t ** pmtxp, uint32_t * mgenp, uint32_t * ugenp);
-__private_extern__ int __mtx_updatebits(npthread_mutex_t *mutex, uint32_t updateval, int firstfiti, int fromcond, uint64_t selfid);
-
-/* syscall interfaces */
-extern uint32_t __psynch_mutexwait(pthread_mutex_t * mutex, uint32_t mgen, uint32_t ugen, uint64_t tid, uint32_t flags);
-extern uint32_t __psynch_mutexdrop(pthread_mutex_t * mutex, uint32_t mgen, uint32_t ugen, uint64_t tid, uint32_t flags);
-
-extern uint32_t __psynch_cvbroad(pthread_cond_t * cv, uint64_t cvlsgen, uint64_t cvudgen, uint32_t flags, pthread_mutex_t * mutex, uint64_t mugen, uint64_t tid);
-extern uint32_t __psynch_cvsignal(pthread_cond_t * cv, uint64_t cvlsgen, uint32_t cvugen, int thread_port, pthread_mutex_t * mutex, uint64_t mugen, uint64_t tid, uint32_t flags);
-extern uint32_t __psynch_cvwait(pthread_cond_t * cv, uint64_t cvlsgen, uint32_t cvugen, pthread_mutex_t * mutex, uint64_t mugen, uint32_t flags, int64_t sec, uint32_t nsec);
-extern uint32_t __psynch_cvclrprepost(void * cv, uint32_t cvgen, uint32_t cvugen, uint32_t cvsgen, uint32_t prepocnt, uint32_t preposeq, uint32_t flags);
-extern uint32_t __psynch_rw_longrdlock(pthread_rwlock_t * rwlock, uint32_t lgenval, uint32_t ugenval, uint32_t rw_wc, int flags);
-extern uint32_t __psynch_rw_yieldwrlock(pthread_rwlock_t * rwlock, uint32_t lgenval, uint32_t ugenval, uint32_t rw_wc, int flags);
-extern int __psynch_rw_downgrade(pthread_rwlock_t * rwlock, uint32_t lgenval, uint32_t ugenval, uint32_t rw_wc, int flags);
-extern uint32_t __psynch_rw_upgrade(pthread_rwlock_t * rwlock, uint32_t lgenval, uint32_t ugenval, uint32_t rw_wc, int flags);
-extern uint32_t __psynch_rw_rdlock(pthread_rwlock_t * rwlock, uint32_t lgenval, uint32_t ugenval, uint32_t rw_wc, int flags);
-extern uint32_t __psynch_rw_wrlock(pthread_rwlock_t * rwlock, uint32_t lgenval, uint32_t ugenval, uint32_t rw_wc, int flags);
-extern uint32_t __psynch_rw_unlock(pthread_rwlock_t * rwlock, uint32_t lgenval, uint32_t ugenval, uint32_t rw_wc, int flags);
-extern uint32_t __psynch_rw_unlock2(pthread_rwlock_t * rwlock, uint32_t lgenval, uint32_t ugenval, uint32_t rw_wc, int flags);
-
-__private_extern__ semaphore_t new_sem_from_pool(void);
-__private_extern__ void restore_sem_to_pool(semaphore_t);
-__private_extern__ void _pthread_atfork_queue_init(void);
-int _pthread_lookup_thread(pthread_t thread, mach_port_t * port, int only_joinable);
-int _pthread_join_cleanup(pthread_t thread, void ** value_ptr, int conforming);
-__private_extern__ int proc_setthreadname(void * buffer, int buffersize);
-
-#endif /* _POSIX_PTHREAD_INTERNALS_H */
+++ /dev/null
-/*
- * Copyright (c) 2003-2004, 2008 Apple Inc. All rights reserved.
- *
- * @APPLE_LICENSE_HEADER_START@
- *
- * This file contains Original Code and/or Modifications of Original Code
- * as defined in and that are subject to the Apple Public Source License
- * Version 2.0 (the 'License'). You may not use this file except in
- * compliance with the License. Please obtain a copy of the License at
- * http://www.opensource.apple.com/apsl/ and read it before using this
- * file.
- *
- * The Original Code and all software distributed under the License are
- * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
- * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
- * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
- * Please see the License for the specific language governing rights and
- * limitations under the License.
- *
- * @APPLE_LICENSE_HEADER_END@
- */
-/*
- * Copyright 1996 1995 by Open Software Foundation, Inc. 1997 1996 1995 1994 1993 1992 1991
- * All Rights Reserved
- *
- * Permission to use, copy, modify, and distribute this software and
- * its documentation for any purpose and without fee is hereby granted,
- * provided that the above copyright notice appears in all copies and
- * that both the copyright notice and this permission notice appear in
- * supporting documentation.
- *
- * OSF DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
- * FOR A PARTICULAR PURPOSE.
- *
- * IN NO EVENT SHALL OSF BE LIABLE FOR ANY SPECIAL, INDIRECT, OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
- * LOSS OF USE, DATA OR PROFITS, WHETHER IN ACTION OF CONTRACT,
- * NEGLIGENCE, OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
- * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- */
-/*
- * MkLinux
- */
-
-/* Machine-dependent definitions for pthread internals. */
-
-#ifndef _POSIX_PTHREAD_MACHDEP_H
-#define _POSIX_PTHREAD_MACHDEP_H
-
-#ifndef __ASSEMBLER__
-
-#include <System/machine/cpu_capabilities.h>
-#ifdef __arm__
-#include <arm/arch.h>
-#endif
-#include <TargetConditionals.h>
-
-/*
-** Define macros for inline pthread_getspecific() usage.
-** We reserve a number of slots for Apple internal use.
-** This number can grow dynamically, no need to fix it.
-*/
-
-/* This header contains pre defined thread specific keys */
-/* 0 is used for pthread_self */
-#define _PTHREAD_TSD_SLOT_PTHREAD_SELF 0
-/* Keys 1- 9 for use by dyld, directly or indirectly */
-#define _PTHREAD_TSD_SLOT_DYLD_1 1
-#define _PTHREAD_TSD_SLOT_DYLD_2 2
-#define _PTHREAD_TSD_SLOT_DYLD_3 3
-#define _PTHREAD_TSD_RESERVED_SLOT_COUNT 4
-/* To mirror the usage by dyld for Unwind_SjLj */
-#define _PTHREAD_TSD_SLOT_DYLD_8 8
-
-/* Keys 10 - 29 are for Libc/Libsystem internal ussage */
-/* used as __pthread_tsd_first + Num */
-#define __PTK_LIBC_LOCALE_KEY 10
-#define __PTK_LIBC_TTYNAME_KEY 11
-#define __PTK_LIBC_LOCALTIME_KEY 12
-#define __PTK_LIBC_GMTIME_KEY 13
-#define __PTK_LIBC_GDTOA_BIGINT_KEY 14
-#define __PTK_LIBC_PARSEFLOAT_KEY 15
-/* for usage by dyld */
-#define __PTK_LIBC_DYLD_Unwind_SjLj_Key 18
-
-/* Keys 20-25 for libdispactch usage */
-#define __PTK_LIBDISPATCH_KEY0 20
-#define __PTK_LIBDISPATCH_KEY1 21
-#define __PTK_LIBDISPATCH_KEY2 22
-#define __PTK_LIBDISPATCH_KEY3 23
-#define __PTK_LIBDISPATCH_KEY4 24
-#define __PTK_LIBDISPATCH_KEY5 25
-
-/* Keys 30-255 for Non Libsystem usage */
-
-/* Keys 30-39 for Graphic frameworks usage */
-#define _PTHREAD_TSD_SLOT_OPENGL 30 /* backwards compat sake */
-#define __PTK_FRAMEWORK_OPENGL_KEY 30
-#define __PTK_FRAMEWORK_GRAPHICS_KEY1 31
-#define __PTK_FRAMEWORK_GRAPHICS_KEY2 32
-#define __PTK_FRAMEWORK_GRAPHICS_KEY3 33
-#define __PTK_FRAMEWORK_GRAPHICS_KEY4 34
-#define __PTK_FRAMEWORK_GRAPHICS_KEY5 35
-#define __PTK_FRAMEWORK_GRAPHICS_KEY6 36
-#define __PTK_FRAMEWORK_GRAPHICS_KEY7 37
-#define __PTK_FRAMEWORK_GRAPHICS_KEY8 38
-#define __PTK_FRAMEWORK_GRAPHICS_KEY9 39
-
-/* Keys 40-49 for Objective-C runtime usage */
-#define __PTK_FRAMEWORK_OBJC_KEY0 40
-#define __PTK_FRAMEWORK_OBJC_KEY1 41
-#define __PTK_FRAMEWORK_OBJC_KEY2 42
-#define __PTK_FRAMEWORK_OBJC_KEY3 43
-#define __PTK_FRAMEWORK_OBJC_KEY4 44
-#define __PTK_FRAMEWORK_OBJC_KEY5 45
-#define __PTK_FRAMEWORK_OBJC_KEY6 46
-#define __PTK_FRAMEWORK_OBJC_KEY7 47
-#define __PTK_FRAMEWORK_OBJC_KEY8 48
-#define __PTK_FRAMEWORK_OBJC_KEY9 49
-
-/* Keys 50-59 for Core Foundation usage */
-#define __PTK_FRAMEWORK_COREFOUNDATION_KEY0 50
-#define __PTK_FRAMEWORK_COREFOUNDATION_KEY1 51
-#define __PTK_FRAMEWORK_COREFOUNDATION_KEY2 52
-#define __PTK_FRAMEWORK_COREFOUNDATION_KEY3 53
-#define __PTK_FRAMEWORK_COREFOUNDATION_KEY4 54
-#define __PTK_FRAMEWORK_COREFOUNDATION_KEY5 55
-#define __PTK_FRAMEWORK_COREFOUNDATION_KEY6 56
-#define __PTK_FRAMEWORK_COREFOUNDATION_KEY7 57
-#define __PTK_FRAMEWORK_COREFOUNDATION_KEY8 58
-#define __PTK_FRAMEWORK_COREFOUNDATION_KEY9 59
-
-/* Keys 60-69 for Foundation usage */
-#define __PTK_FRAMEWORK_FOUNDATION_KEY0 60
-#define __PTK_FRAMEWORK_FOUNDATION_KEY1 61
-#define __PTK_FRAMEWORK_FOUNDATION_KEY2 62
-#define __PTK_FRAMEWORK_FOUNDATION_KEY3 63
-#define __PTK_FRAMEWORK_FOUNDATION_KEY4 64
-#define __PTK_FRAMEWORK_FOUNDATION_KEY5 65
-#define __PTK_FRAMEWORK_FOUNDATION_KEY6 66
-#define __PTK_FRAMEWORK_FOUNDATION_KEY7 67
-#define __PTK_FRAMEWORK_FOUNDATION_KEY8 68
-#define __PTK_FRAMEWORK_FOUNDATION_KEY9 69
-
-/* Keys 70-79 for Core Animation/QuartzCore usage */
-#define __PTK_FRAMEWORK_QUARTZCORE_KEY0 70
-#define __PTK_FRAMEWORK_QUARTZCORE_KEY1 71
-#define __PTK_FRAMEWORK_QUARTZCORE_KEY2 72
-#define __PTK_FRAMEWORK_QUARTZCORE_KEY3 73
-#define __PTK_FRAMEWORK_QUARTZCORE_KEY4 74
-#define __PTK_FRAMEWORK_QUARTZCORE_KEY5 75
-#define __PTK_FRAMEWORK_QUARTZCORE_KEY6 76
-#define __PTK_FRAMEWORK_QUARTZCORE_KEY7 77
-#define __PTK_FRAMEWORK_QUARTZCORE_KEY8 78
-#define __PTK_FRAMEWORK_QUARTZCORE_KEY9 79
-
-
-/* Keys 80-89 for Garbage Collection */
-#define __PTK_FRAMEWORK_OLDGC_KEY0 80
-#define __PTK_FRAMEWORK_OLDGC_KEY1 81
-#define __PTK_FRAMEWORK_OLDGC_KEY2 82
-#define __PTK_FRAMEWORK_OLDGC_KEY3 83
-#define __PTK_FRAMEWORK_OLDGC_KEY4 84
-#define __PTK_FRAMEWORK_OLDGC_KEY5 85
-#define __PTK_FRAMEWORK_OLDGC_KEY6 86
-#define __PTK_FRAMEWORK_OLDGC_KEY7 87
-#define __PTK_FRAMEWORK_OLDGC_KEY8 88
-#define __PTK_FRAMEWORK_OLDGC_KEY9 89
-
-/* Keys 90-94 for JavaScriptCore Collection */
-#define __PTK_FRAMEWORK_JAVASCRIPTCORE_KEY0 90
-#define __PTK_FRAMEWORK_JAVASCRIPTCORE_KEY1 91
-#define __PTK_FRAMEWORK_JAVASCRIPTCORE_KEY2 92
-#define __PTK_FRAMEWORK_JAVASCRIPTCORE_KEY3 93
-#define __PTK_FRAMEWORK_JAVASCRIPTCORE_KEY4 94
-
-/* Keys 110-119 for Garbage Collection */
-#define __PTK_FRAMEWORK_GC_KEY0 110
-#define __PTK_FRAMEWORK_GC_KEY1 111
-#define __PTK_FRAMEWORK_GC_KEY2 112
-#define __PTK_FRAMEWORK_GC_KEY3 113
-#define __PTK_FRAMEWORK_GC_KEY4 114
-#define __PTK_FRAMEWORK_GC_KEY5 115
-#define __PTK_FRAMEWORK_GC_KEY6 116
-#define __PTK_FRAMEWORK_GC_KEY7 117
-#define __PTK_FRAMEWORK_GC_KEY8 118
-#define __PTK_FRAMEWORK_GC_KEY9 119
-
-/*
-** Define macros for inline pthread_getspecific() usage.
-** We reserve a number of slots for Apple internal use.
-** This number can grow dynamically, no need to fix it.
-*/
-
-
-#if defined(__cplusplus)
-extern "C" {
-#endif
-
-extern void *pthread_getspecific(unsigned long);
-/* setup destructor function for static key as it is not created with pthread_key_create() */
-int pthread_key_init_np(int, void (*)(void *));
-
-#if defined(__cplusplus)
-}
-#endif
-
-typedef int pthread_lock_t;
-
-#if TARGET_IPHONE_SIMULATOR
-
-/* Similator will use the host implementation, so bypass the macro that is in the target code */
-
-inline static int
-_pthread_has_direct_tsd(void)
-{
- return 0;
-}
-
-#define _pthread_getspecific_direct(key) pthread_getspecific(key)
-#define _pthread_setspecific_direct(key, val) pthread_setspecific(key, val)
-
-#else /* TARGET_IPHONE_SIMULATOR */
-
-inline static int
-_pthread_has_direct_tsd(void)
-{
-#if defined(__ppc__)
- int *caps = (int *)_COMM_PAGE_CPU_CAPABILITIES;
- if (*caps & kFastThreadLocalStorage) {
- return 1;
- } else {
- return 0;
- }
-#else
- return 1;
-#endif
-}
-
-/* To be used with static constant keys only */
-inline static void *
-_pthread_getspecific_direct(unsigned long slot)
-{
- void *ret;
-
-#if defined(__i386__) || defined(__x86_64__)
- asm("mov %%gs:%1, %0" : "=r" (ret) : "m" (*(void **)(slot * sizeof(void *))));
-#elif defined(__ppc64__) || defined(__ppc__)
- ret = pthread_getspecific(slot);
-#elif defined(__arm__) && defined(_ARM_ARCH_6) && !defined(_ARM_ARCH_7) && defined(__thumb__) && !defined(__OPTIMIZE__)
- ret = pthread_getspecific(slot);
-#elif defined(__arm__) && defined(_ARM_ARCH_6)
- void **__pthread_tsd;
- __asm__ (
- "mrc p15, 0, %0, c13, c0, 3\n"
- "bic %0, %0, #3\n"
- : "=r"(__pthread_tsd));
- ret = __pthread_tsd[slot];
-#elif defined(__arm__) && !defined(_ARM_ARCH_6)
- register void **__pthread_tsd asm ("r9");
- ret = __pthread_tsd[slot];
-#else
-#error no pthread_getspecific_direct implementation for this arch
-#endif
- return ret;
-}
-
-#if defined(__i386__) || defined(__x86_64__) || defined(__arm__)
-/* To be used with static constant keys only */
-inline static int
-_pthread_setspecific_direct(unsigned long slot, void * val)
-{
-
-#if defined(__i386__)
-#if defined(__PIC__)
- asm("movl %1,%%gs:%0" : "=m" (*(void **)(slot * sizeof(void *))) : "rn" (val));
-#else
- asm("movl %1,%%gs:%0" : "=m" (*(void **)(slot * sizeof(void *))) : "ri" (val));
-#endif
-#elif defined(__x86_64__)
- /* PIC is free and cannot be disabled, even with: gcc -mdynamic-no-pic ... */
- asm("movq %1,%%gs:%0" : "=m" (*(void **)(slot * sizeof(void *))) : "rn" (val));
-#elif defined(__arm__) && defined(_ARM_ARCH_6)
- void **__pthread_tsd;
- __asm__ (
- "mrc p15, 0, %0, c13, c0, 3\n"
- "bic %0, %0, #3\n"
- : "=r"(__pthread_tsd));
- __pthread_tsd[slot] = val;
-#elif defined(__arm__) && !defined(_ARM_ARCH_6)
- register void **__pthread_tsd asm ("r9");
- __pthread_tsd[slot] = val;
-#endif
- return(0);
-}
-#elif defined(__ppc__) || defined(__ppc64__)
-/* To be used with static constant keys only */
-#define _pthread_setspecific_direct(key, val) pthread_setspecific(key, val)
-#else
-#error no pthread_setspecific_direct implementation for this arch
-#endif
-
-#endif /* TARGET_IPHONE_SIMULATOR */
-
-#define LOCK_INIT(l) ((l) = 0)
-#define LOCK_INITIALIZER 0
-
-#endif /* ! __ASSEMBLER__ */
-#endif /* _POSIX_PTHREAD_MACHDEP_H */
+++ /dev/null
-/*
- * Copyright (c) 2003 Apple Computer, Inc. All rights reserved.
- *
- * @APPLE_LICENSE_HEADER_START@
- *
- * This file contains Original Code and/or Modifications of Original Code
- * as defined in and that are subject to the Apple Public Source License
- * Version 2.0 (the 'License'). You may not use this file except in
- * compliance with the License. Please obtain a copy of the License at
- * http://www.opensource.apple.com/apsl/ and read it before using this
- * file.
- *
- * The Original Code and all software distributed under the License are
- * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
- * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
- * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
- * Please see the License for the specific language governing rights and
- * limitations under the License.
- *
- * @APPLE_LICENSE_HEADER_END@
- */
-/*
- * Copyright 1996 1995 by Open Software Foundation, Inc. 1997 1996 1995 1994 1993 1992 1991
- * All Rights Reserved
- *
- * Permission to use, copy, modify, and distribute this software and
- * its documentation for any purpose and without fee is hereby granted,
- * provided that the above copyright notice appears in all copies and
- * that both the copyright notice and this permission notice appear in
- * supporting documentation.
- *
- * OSF DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
- * FOR A PARTICULAR PURPOSE.
- *
- * IN NO EVENT SHALL OSF BE LIABLE FOR ANY SPECIAL, INDIRECT, OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
- * LOSS OF USE, DATA OR PROFITS, WHETHER IN ACTION OF CONTRACT,
- * NEGLIGENCE, OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
- * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- *
- */
-/*
- * MkLinux
- */
-
-/*
- * POSIX Threads - IEEE 1003.1c
- */
-
-#ifndef _POSIX_PTHREAD_SPINLOCK_H
-#define _POSIX_PTHREAD_SPINLOCK_H
-
-#include <mach/mach.h>
-#define __APPLE_API_PRIVATE
-#include <machine/cpu_capabilities.h>
-
-#ifndef __POSIX_LIB__
-#define __POSIX_LIB__
-#endif
-
-#include "pthread_machdep.h" /* Machine-dependent definitions. */
-
-/* Number of times to spin when the lock is unavailable and we are on a
- multiprocessor. On a uniprocessor we yield the processor immediately. */
-#define MP_SPIN_TRIES 1000
-extern int _spin_tries;
-extern int __is_threaded;
-
-/* Internal mutex locks for data structures */
-#define TRY_LOCK(v) (!__is_threaded || _spin_lock_try((pthread_lock_t *)&(v)))
-
-/* _DO_SPINLOCK_LOCK() takes a (pthread_lock_t *) */
-#define _DO_SPINLOCK_LOCK(v) _spin_lock(v)
-
-/* _DO_SPINLOCK_UNLOCK() takes a (pthread_lock_t *) */
-#define _DO_SPINLOCK_UNLOCK(v) _spin_unlock(v)
-
-/* LOCK() takes a (pthread_lock_t) */
-#define LOCK(v) \
- do { \
- if (__is_threaded) { \
- _DO_SPINLOCK_LOCK((pthread_lock_t *)&(v)); \
- } \
- } while (0)
-
-/* UNLOCK() takes a (pthread_lock_t) */
-#define UNLOCK(v) \
- do { \
- if (__is_threaded) { \
- _DO_SPINLOCK_UNLOCK((pthread_lock_t *)&(v)); \
- } \
- } while (0)
-
-/* Prototypes. */
-
-/* Functions defined in machine-dependent files. */
-extern void _spin_lock(pthread_lock_t *lockp);
-extern int _spin_lock_try(pthread_lock_t *lockp);
-extern void _spin_unlock(pthread_lock_t *lockp);
-
-#endif /* _POSIX_PTHREAD_SPINLOCK_H */
+++ /dev/null
-PACKAGE_TARNAME := @PACKAGE_TARNAME@
-
-CY_ATTACH_GROUP := @CY_ATTACH_GROUP@
-
-lib := lib
-dll := @SO@
-depends ?=
-
-deb := $(shell grep ^Package: $(srcdir)/control.in | cut -d ' ' -f 2-)_$(shell grep ^Version: $(srcdir)/control.in | cut -d ' ' -f 2 | $(sed) -e 's/\#/$(version)/')_$(arch).deb
-
-libcycript.la: $(code)
- $(ldid) .libs/$(lib)cycript.$(dll)
-
-cycript: Console.lo libcycript.la $(inject)
- $(entitle) .libs/cycript
-
-package: $(deb)
-
-install: cycript libcycript.la
-ifneq ($(CY_ATTACH_GROUP),)
- chgrp $(CY_ATTACH_GROUP) $(DESTDIR)$(bindir)/cycript
- chmod g+s $(DESTDIR)$(bindir)/cycript
-endif