diff --git a/.DS_Store b/.DS_Store
deleted file mode 100644
index 68f0155..0000000
Binary files a/.DS_Store and /dev/null differ
diff --git a/.github/workflows/objective-c-xcode.yml b/.github/workflows/objective-c-xcode.yml
new file mode 100644
index 0000000..eacbcc9
--- /dev/null
+++ b/.github/workflows/objective-c-xcode.yml
@@ -0,0 +1,342 @@
+name: Xcode - Build and Analyze (10.3+ target)
+
+on:
+ push:
+ branches: [ "master" ]
+ pull_request:
+ branches: [ "master" ]
+ workflow_dispatch:
+
+jobs:
+ build:
+ name: Build and analyse default scheme using xcodebuild command
+ runs-on: macos-latest
+
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v4
+
+ - name: Check Environment
+ run: |
+ echo "=== CI Environment Info ==="
+ echo "macOS Version: $(sw_vers -productVersion)"
+ echo "Xcode Version: $(xcodebuild -version | head -1)"
+ echo "Available SDKs:"
+ xcodebuild -showsdks | grep -E "(macOS|MacOSX)" || echo "No macOS SDKs found"
+ echo ""
+ echo "⚠️ Note: Xcode 16.4 may have compatibility issues with older macOS SDKs"
+ echo " This is expected and the CI will handle it gracefully"
+
+ - name: Xcodebuild (Unsigned for CI)
+ working-directory: ./DirectHW
+ run: |
+ # Detect macOS version for proper project selection
+ MACOS_VERSION=$(sw_vers -productVersion | cut -d. -f1)
+ echo "macOS major version: $MACOS_VERSION"
+
+ # Choose appropriate Xcode project based on macOS version
+ if [ "$MACOS_VERSION" -ge 15 ]; then
+ echo "Using modern DirectHW.xcodeproj for macOS $MACOS_VERSION"
+ XCODE_PROJ="DirectHW.xcodeproj"
+ BUILD_DIR="build/build15"
+ elif [ "$MACOS_VERSION" -ge 11 ]; then
+ echo "Using modern DirectHW.xcodeproj for macOS $MACOS_VERSION"
+ XCODE_PROJ="DirectHW.xcodeproj"
+ BUILD_DIR="build/build11"
+ else
+ echo "Using legacy DirectHW10.6.xcodeproj for macOS $MACOS_VERSION"
+ XCODE_PROJ="DirectHW10.6.xcodeproj"
+ BUILD_DIR="build/build10.6"
+ fi
+
+ echo "=== Starting Xcode Build with $XCODE_PROJ ==="
+ # Create build directory before attempting to write log file
+ mkdir -p "$BUILD_DIR"
+ XCODE_BUILD_LOG="$BUILD_DIR/xcode_build.log"
+
+ # Capture build output for debugging
+ if xcodebuild -alltargets -project "$XCODE_PROJ" \
+ CODE_SIGN_IDENTITY="" \
+ CODE_SIGNING_REQUIRED=NO \
+ CODE_SIGNING_ALLOWED=NO \
+ SYMROOT="$BUILD_DIR" \
+ -verbose 2> "$XCODE_BUILD_LOG"; then
+ echo "✅ Xcode build command completed"
+ else
+ echo "⚠️ Xcode build failed - this is expected with modern Xcode and older projects"
+
+ # Show error output for debugging if log file exists and has content
+ if [[ -f "$XCODE_BUILD_LOG" && -s "$XCODE_BUILD_LOG" ]]; then
+ echo "Xcode build errors (for debugging):"
+ cat "$XCODE_BUILD_LOG"
+ fi
+ fi
+
+ # Check if build succeeded
+ if [ -d "$BUILD_DIR/Release" ] && [ -f "$BUILD_DIR/Release/libDirectHW.dylib" ]; then
+ echo "✅ Xcode build succeeded"
+ ls -la "$BUILD_DIR/Release/"
+ else
+ echo "❌ Xcode build failed or incomplete - will use make libs fallback"
+ # Create symlink for consistency with buildlatest expectation
+ mkdir -p build/buildlatest
+ ln -sf "$BUILD_DIR/Release" build/buildlatest/Release 2>/dev/null || :
+ fi
+
+ - name: libs
+ working-directory: ./DirectHW
+ run: make libs
+
+ - name: Debug Build Outputs
+ working-directory: ./DirectHW
+ run: |
+ echo "=== Searching for all build outputs ==="
+ find . -name "*.dylib" -o -name "*.kext" -o -name "*.framework" | head -20
+ echo "=== Build directory structure ==="
+ ls -R build/ 2>/dev/null || echo "No build directory"
+
+ - name: Create Package
+ working-directory: ./DirectHW
+ run: |
+ echo "=== Creating Package ==="
+
+ # Find the actual build directory
+ BUILD_ROOT=""
+ BUILD_SUCCESS=false
+
+ # Check version-specific build directories first
+ for BUILD_DIR in "build/buildlatest/Release" "build/build15/Release" "build/build11/Release" "build/Release" "build/*/Release"; do
+ if [ -d "./$BUILD_DIR" ] && [ -f "./$BUILD_DIR/libDirectHW.dylib" ]; then
+ BUILD_ROOT="./$BUILD_DIR"
+ echo "✅ Found build directory: $BUILD_ROOT"
+ BUILD_SUCCESS=true
+ break
+ fi
+ done
+
+ if [ "$BUILD_SUCCESS" = true ]; then
+ echo "🎯 Using real build artifacts"
+
+ # Create component packages that install to /usr/local
+ mkdir -p pkg_components/lib/usr/local/lib
+ mkdir -p pkg_components/kext/usr/local/kexts
+ mkdir -p pkg_components/framework/usr/local/frameworks
+ mkdir -p pkg_scripts
+
+ # Copy build artifacts to component structures
+ if [ -f "$BUILD_ROOT/libDirectHW.dylib" ]; then
+ cp "$BUILD_ROOT/libDirectHW.dylib" pkg_components/lib/usr/local/lib/
+ echo "✅ Copied library"
+ fi
+ if [ -d "$BUILD_ROOT/DirectHW.kext" ]; then
+ cp -r "$BUILD_ROOT/DirectHW.kext" pkg_components/kext/usr/local/kexts/
+ echo "✅ Copied kext"
+ fi
+ if [ -d "$BUILD_ROOT/DirectHW.framework" ]; then
+ cp -r "$BUILD_ROOT/DirectHW.framework" pkg_components/framework/usr/local/frameworks/
+ echo "✅ Copied framework"
+ fi
+
+ # Copy postinstall script
+ if [ -f "postinstall" ]; then
+ cp postinstall pkg_scripts/
+ echo "✅ Copied postinstall script"
+ else
+ echo "⚠️ postinstall script not found - creating basic one"
+ echo "#!/bin/bash" > pkg_scripts/postinstall
+ echo "echo 'DirectHW postinstall completed'" >> pkg_scripts/postinstall
+ chmod +x pkg_scripts/postinstall
+ fi
+
+ echo "=== Creating Component Packages ==="
+ # Create component packages
+ pkgbuild --root pkg_components/lib --identifier com.directhw.lib --version 1.0 --install-location /usr/local --scripts pkg_scripts DirectHW-lib.pkg && echo "✅ Library package created" || echo "❌ Library package failed"
+ pkgbuild --root pkg_components/kext --identifier com.directhw.kext --version 1.0 --install-location /usr/local --scripts pkg_scripts DirectHW-kext.pkg && echo "✅ Kext package created" || echo "❌ Kext package failed"
+ pkgbuild --root pkg_components/framework --identifier com.directhw.framework --version 1.0 --install-location /usr/local --scripts pkg_scripts DirectHW-framework.pkg && echo "✅ Framework package created" || echo "❌ Framework package failed"
+
+ # Create distribution XML
+ echo '' > distribution.xml
+ echo '' >> distribution.xml
+ echo ' DirectHW' >> distribution.xml
+ echo ' com.directhw' >> distribution.xml
+ echo ' ' >> distribution.xml
+ echo ' ' >> distribution.xml
+ echo ' ' >> distribution.xml
+ echo ' ' >> distribution.xml
+ echo ' ' >> distribution.xml
+ echo ' ' >> distribution.xml
+ echo ' ' >> distribution.xml
+ echo ' ' >> distribution.xml
+ echo ' ' >> distribution.xml
+ echo ' ' >> distribution.xml
+ echo ' ' >> distribution.xml
+ echo ' ' >> distribution.xml
+ echo ' ' >> distribution.xml
+ echo ' ' >> distribution.xml
+ echo ' ' >> distribution.xml
+ echo ' #DirectHW-lib.pkg' >> distribution.xml
+ echo ' #DirectHW-framework.pkg' >> distribution.xml
+ echo '' >> distribution.xml
+
+ # Create distribution package
+ productbuild --distribution distribution.xml --package-path . DirectHW.pkg 2>/dev/null || echo "Distribution package creation failed"
+ else
+ echo "❌ CRITICAL: No build artifacts found - CI should fail to catch broken builds"
+ echo "This ensures that build failures are caught and fixed rather than silently ignored"
+ echo ""
+ echo "Troubleshooting information:"
+ echo "- Check Xcode build logs above for specific error details"
+ echo "- Verify that make libs fallback completed successfully"
+ echo "- Ensure libDirectHW.dylib was built and placed in the correct location"
+ echo "- Checked directories: build/build15/Release, build/build11/Release, build/buildlatest/Release, build/Release, build/*/Release"
+ exit 1
+ fi
+
+ - name: Build Universal AppleScript Runner
+ run: |
+ # Build universal AppleScript runner for create-dmg (preserves PowerPC original)
+ cd create-dmg/support
+ make clean
+ make
+ # Save as universal binary (keeping PowerPC original intact)
+ cp AdiumApplescriptRunner AdiumApplescriptRunner-Universal
+ git restore AdiumApplescriptRunner # Restore PowerPC original
+ file AdiumApplescriptRunner AdiumApplescriptRunner-Universal
+ echo "Built universal AppleScript runner alongside PowerPC original"
+
+ - name: Create DMG
+ run: |
+ echo "=== Creating DMG ==="
+ # Prepare DMG contents
+ mkdir -p dmg_contents
+
+ # Check what was actually built
+ echo "=== Build directory contents ==="
+ find DirectHW -name "build*" -type d -exec ls -la {} \; 2>/dev/null || echo "No build directory found"
+ find DirectHW -name "*.kext" -o -name "*.framework" -o -name "*.dylib" -o -name "*.pkg" 2>/dev/null || echo "No built artifacts found"
+
+ # Copy build artifacts - check multiple possible build directories
+ ARTIFACTS_FOUND=false
+
+ # First check for distribution package (preferred)
+ if [ -f "DirectHW/DirectHW.pkg" ]; then
+ cp "DirectHW/DirectHW.pkg" "dmg_contents/Install DirectHW.pkg"
+ echo "✅ Copied distribution package"
+ ARTIFACTS_FOUND=true
+ else
+ # Fallback to individual component packages
+ for PKG in "DirectHW/DirectHW-lib.pkg" "DirectHW/DirectHW-kext.pkg" "DirectHW/DirectHW-framework.pkg"; do
+ if [ -f "$PKG" ]; then
+ cp "$PKG" "dmg_contents/$(basename "$PKG")"
+ echo "✅ Copied $(basename "$PKG")"
+ ARTIFACTS_FOUND=true
+ fi
+ done
+ fi
+
+ # Also check for build directory artifacts
+ for BUILD_DIR in "DirectHW/build/build15/Release" "DirectHW/build/buildlatest/Release" "DirectHW/build/build11/Release" "DirectHW/build/Release" "DirectHW/build/*/Release"; do
+ if [ -d "$BUILD_DIR" ]; then
+ echo "📁 Found build directory for DMG: $BUILD_DIR"
+
+ # Copy available artifacts (may not have all types due to build failures)
+ find "$BUILD_DIR" -name "*.kext" -exec cp -r {} dmg_contents/ \; 2>/dev/null && echo "✅ Found kext files" && ARTIFACTS_FOUND=true
+ find "$BUILD_DIR" -name "*.framework" -exec cp -r {} dmg_contents/ \; 2>/dev/null && echo "✅ Found framework files" && ARTIFACTS_FOUND=true
+ find "$BUILD_DIR" -name "*.dylib" -exec cp {} dmg_contents/ \; 2>/dev/null && echo "✅ Found library files" && ARTIFACTS_FOUND=true
+ find "$BUILD_DIR" -name "*.a" -exec cp {} dmg_contents/ \; 2>/dev/null && echo "✅ Found static library files" && ARTIFACTS_FOUND=true
+
+ # If we found at least the library, consider it successful
+ if [ -f "$BUILD_DIR/libDirectHW.dylib" ]; then
+ ARTIFACTS_FOUND=true
+ echo "✅ Core library found - DMG creation possible"
+ fi
+
+ break # Use first found build directory
+ fi
+ done
+
+ # Copy documentation
+ if [ -f "DirectHW/ReadMe.rtf" ]; then
+ cp "DirectHW/ReadMe.rtf" "dmg_contents/Read Me.rtf"
+ echo "✅ Copied ReadMe.rtf"
+ fi
+ if [ -f "DirectHW/Welcome.rtf" ]; then
+ cp "DirectHW/Welcome.rtf" "dmg_contents/Welcome.rtf"
+ echo "✅ Copied Welcome.rtf"
+ fi
+
+ echo "=== DMG contents ==="
+ ls -la dmg_contents/
+
+ # Only create DMG if we have content
+ if [ "$ARTIFACTS_FOUND" = true ] && [ "$(ls -A dmg_contents/)" ]; then
+ echo "🎯 Creating DMG with found content"
+ # Create DMG using hdiutil (more reliable than create-dmg in CI)
+ hdiutil create -volname "DirectHW v1.5.1" -srcfolder dmg_contents -ov -format UDZO DirectHW-v1.5.1.dmg
+ if [ $? -eq 0 ]; then
+ echo "✅ DMG created successfully"
+ else
+ echo "❌ DMG creation failed"
+ exit 1
+ fi
+ else
+ echo "❌ CRITICAL: No content found for DMG creation - build artifacts missing"
+ echo "CI should fail when real build artifacts are not available"
+ echo ""
+ echo "Missing artifacts that should have been created:"
+ echo "- libDirectHW.dylib (core library)"
+ echo "- DirectHW.kext (kernel extension)"
+ echo "- DirectHW.framework (framework)"
+ echo "- DirectHW.pkg (installer package)"
+ echo ""
+ echo "This failure ensures broken builds are caught and fixed."
+ exit 1
+ fi
+
+ - name: Upload DMG Artifact
+ uses: actions/upload-artifact@v4
+ if: always()
+ with:
+ name: DirectHW-DMG
+ path: |
+ DirectHW-v1.5.1.dmg
+ dmg_contents/
+ if-no-files-found: warn
+
+ - name: Upload Build Artifacts
+ uses: actions/upload-artifact@v4
+ if: always()
+ with:
+ name: DirectHW-Build-Artifacts
+ path: |
+ DirectHW/build/buildlatest/Release/
+ DirectHW/build/build15/Release/
+ DirectHW/build/build11/Release/
+ DirectHW/build/*/Release/
+ DirectHW/*.pkg
+ DirectHW/*.kext
+ DirectHW/*.framework
+ DirectHW/*.dylib
+ DirectHW/postinstall
+ DirectHW/pkg_scripts/
+ DirectHW/pkg_components/
+ DirectHW/distribution.xml
+ if-no-files-found: warn
+
+ - name: CI Status Summary
+ if: always()
+ run: |
+ echo "=== CI Build Summary ==="
+ echo "📊 Build Status: $([ -d 'DirectHW/build/build15/Release' ] || [ -d 'DirectHW/build/buildlatest/Release' ] && echo '✅ SUCCESS' || echo '❌ FAILED - Xcode compatibility issue')"
+ echo "📦 Package Status: $([ -f 'DirectHW/DirectHW.pkg' ] && echo '✅ Distribution package created' || echo '⚠️ Using component packages')"
+ echo "💿 DMG Status: $([ -f 'DirectHW-v1.5.1.dmg' ] && echo '✅ DMG created' || echo '❌ DMG creation failed')"
+ echo ""
+ echo "🔧 Known Issues:"
+ echo " - Xcode 16.4 has SDK compatibility issues with older macOS targets"
+ echo " - For production builds, use Xcode 15.x or implement local signing"
+ echo " - CI fails when builds fail - no mock artifacts are created"
+ echo ""
+ echo "📋 Next Steps:"
+ echo " - Test the generated packages locally"
+ echo " - Use self-signed certificates for kext development"
+ echo " - Consider upgrading to newer Xcode for production builds"
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..204f333
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,45 @@
+# General
+.DS_Store
+.patched
+
+## User settings
+xcuserdata/
+
+## compatibility with Xcode 8 and earlier (ignoring not required starting Xcode 9)
+*.xcscmblueprint
+*.xccheckout
+
+## compatibility with Xcode 3 and earlier (ignoring not required starting Xcode 4)
+build/
+DerivedData/
+*.moved-aside
+*.pbxuser
+!default.pbxuser
+*.mode1v3
+!default.mode1v3
+*.mode2v3
+!default.mode2v3
+*.perspectivev3
+!default.perspectivev3
+
+## Gcc Patch
+/*.gcno
+
+### Xcode Patch ###
+*.xcodeproj/*
+!*.xcodeproj/project.pbxproj
+!*.xcodeproj/xcshareddata/
+!*.xcworkspace/contents.xcworkspacedata
+**/xcshareddata/WorkspaceSettings.xcsettings
+project.xcworkspace
+*.mode1
+
+## Build artifacts
+*.pkg
+*.dmg
+test_build/
+build/
+*.app
+*.framework
+*.kext
+
diff --git a/DirectHW/.DS_Store b/DirectHW/.DS_Store
deleted file mode 100644
index 1248b09..0000000
Binary files a/DirectHW/.DS_Store and /dev/null differ
diff --git a/DirectHW/DirectHW-Framework-Info.plist b/DirectHW/DirectHW-Framework-Info.plist
index fb82074..c31199b 100644
--- a/DirectHW/DirectHW-Framework-Info.plist
+++ b/DirectHW/DirectHW-Framework-Info.plist
@@ -3,20 +3,22 @@
CFBundleDevelopmentRegion
- en_US
+ en
CFBundleExecutable
${EXECUTABLE_NAME}
CFBundleIdentifier
$(PRODUCT_BUNDLE_IDENTIFIER)
CFBundleInfoDictionaryVersion
6.0
+ CFBundleName
+ $(PRODUCT_NAME)
CFBundlePackageType
FMWK
+ CFBundleShortVersionString
+ $(MODULE_VERSION)
CFBundleSignature
- DHWF
+ ????
CFBundleVersion
- $(CURRENT_PROJECT_VERSION)
- CFBundleShortVersionString
- $(CURRENT_PROJECT_VERSION)
+ $(MODULE_VERSION)
diff --git a/DirectHW/DirectHW-Info.plist b/DirectHW/DirectHW-Info.plist
index abbd125..b141a88 100644
--- a/DirectHW/DirectHW-Info.plist
+++ b/DirectHW/DirectHW-Info.plist
@@ -3,23 +3,23 @@
CFBundleDevelopmentRegion
- en_US
+ en
CFBundleExecutable
- DirectHW
+ $(EXECUTABLE_NAME)
CFBundleIdentifier
$(PRODUCT_BUNDLE_IDENTIFIER)
CFBundleInfoDictionaryVersion
6.0
CFBundleName
- DirectHW
+ $(PRODUCT_NAME)
CFBundlePackageType
KEXT
+ CFBundleShortVersionString
+ $(MODULE_VERSION)
CFBundleSignature
- DHWK
+ ????
CFBundleVersion
$(MODULE_VERSION)
- CFBundleShortVersionString
- $(MODULE_VERSION)
IOKitPersonalities
DirectHWUserClient
@@ -38,20 +38,24 @@
DirectHWUserClient
+ NSHumanReadableCopyright
+ Copyright © 2008-2010 coresystems GmbH <info@coresystems.de>. All rights reserved.
+ OSBundleCompatibleVersion
+ 1.0
OSBundleLibraries
+ com.apple.iokit.IOPCIFamily
+ 1.0.0
+ com.apple.kpi.bsd
+ 8.0.0
com.apple.kpi.iokit
- 8.0.0d0
+ 8.0.0
com.apple.kpi.libkern
- 8.0.0d0
+ 8.0.0
com.apple.kpi.mach
- 8.0.0d0
+ 8.0.0
com.apple.kpi.unsupported
- 8.0.0b1
+ 8.0.0
- OSBundleCompatibleVersion
- $(DYLIB_COMPATIBILITY_VERSION)
- OSBundleRequied
- Root
diff --git a/DirectHW/DirectHW.c b/DirectHW/DirectHW.c
index fea62d5..be952ec 100644
--- a/DirectHW/DirectHW.c
+++ b/DirectHW/DirectHW.c
@@ -6,7 +6,7 @@
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
- *
+ *
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
@@ -16,274 +16,265 @@
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-#include
-#include
-#include
-#include
-
-#ifdef __GNUC__
+#include "MacOSMacros.h"
+#include "DirectHW.h"
#include
-#endif /* __GNUC__ */
-
#include
-
-#include "DirectHW.h"
+#include
+#include
+#include
#ifndef MAP_FAILED
-#define MAP_FAILED ((void *)-1)
-#endif /* MAP_FAILED */
-
-/* define WANT_OLD_API for support of OSX 10.4 and earlier */
-#undef WANT_OLD_API
+#define MAP_FAILED ((void *)-1)
+#endif
/* define DEBUG to print Framework debugging information */
#undef DEBUG
#ifndef err_get_system
#define err_get_system(err) (((err)>>26)&0x3f)
-#endif /* err_get_system */
+#endif
#ifndef err_get_sub
#define err_get_sub(err) (((err)>>14)&0xfff)
-#endif /* err_get_sub */
+#endif
#ifndef err_get_code
#define err_get_code(err) ((err)&0x3fff)
-#endif /* err_get_code */
+#endif
-enum
-{
- kReadIO,
- kWriteIO,
- kPrepareMap,
- kReadMSR,
- kWriteMSR,
- kNumberOfMethods
-};
-
-typedef struct {
-#if defined(__x86_64__) || defined(__arm64__)
- UInt64 offset;
- UInt64 width;
- UInt64 data;
-#else /* __i386__ || __arm__ */
- UInt32 offset;
- UInt32 width;
- UInt32 data;
-#endif /* __i386__ || __x86_64__ || __arm__ || __arm64__ */
-} iomem_t;
-
-typedef struct {
-#if defined(__x86_64__) || defined(__arm64__)
- UInt64 addr;
- UInt64 size;
-#else /* __i386__ || __arm__ */
- UInt32 addr;
- UInt32 size;
-#endif /* __i386__ || __x86_64__ || __arm__ || __arm64__ */
-} map_t;
-
-typedef struct {
- UInt32 core;
- UInt32 index;
-
- union {
- uint64_t io64;
-
- struct
- {
-#ifndef __BIG_ENDIAN__
- UInt32 lo;
- UInt32 hi;
-#else /* __BIG_ENDIAN__ == 1 */
- UInt32 hi;
- UInt32 lo;
-#endif /* __BIG_ENDIAN__ */
- } io32;
- } val;
-} msrcmd_t;
-
-static io_connect_t connect = -1;
+#include "DirectHWShared.h"
+
+static io_connect_t darwin_connect = MACH_PORT_NULL;
static io_service_t iokit_uc;
static int darwin_init(void)
{
- kern_return_t err;
-
- /* Note the actual security happens in the kernel module.
- * This check is just candy to be able to get nicer output
- */
- if (getuid() != 0)
- {
- /* Fun's reserved for root */
- errno = EPERM;
-
- return -1;
- }
-
- /* Get the DirectHW driver service */
- iokit_uc = IOServiceGetMatchingService(kIOMasterPortDefault, IOServiceMatching("DirectHWService"));
+ kern_return_t err;
+
+ /* Note the actual security happens in the kernel module.
+ * This check is just candy to be able to get nicer output
+ */
+ if (getuid() != 0) {
+ /* Fun's reserved for root */
+ errno = EPERM;
+ return -1;
+ }
- if (!iokit_uc)
- {
- printf("DirectHW.kext not loaded.\n");
+ /* Get the DirectHW driver service */
+ /* Use weak linking for maximum compatibility with all SDKs and architectures */
+ /* kIOMainPortDefault exists since macOS 12.1 SDK, kIOMasterPortDefault exists since macOS 10.2.8 */
+ extern const mach_port_t kIOMainPortDefault __attribute__((weak));
+ extern const mach_port_t kIOMasterPortDefault __attribute__((weak));
- errno = ENOSYS;
+ /* Create compatibility macro as suggested by Joevt */
+ #define kOurMasterPort (kIOMasterPortDefault ? kIOMasterPortDefault : kIOMainPortDefault)
- return -1;
- }
+ /* Use the compatible master port that works with all SDKs and targets */
+ iokit_uc = IOServiceGetMatchingService(kOurMasterPort, IOServiceMatching("DirectHWService"));
- /* Create an instance */
- err = IOServiceOpen(iokit_uc, mach_task_self(), 0, &connect);
+ if (!iokit_uc) {
+ printf("DirectHW.kext not loaded.\n");
+ errno = ENOSYS;
+ return -1;
+ }
- /* Should not go further if error with service open */
- if (err != KERN_SUCCESS)
- {
- printf("Could not create DirectHW instance.\n");
+ /* Create an instance */
+ err = IOServiceOpen(iokit_uc, mach_task_self(), 0, &darwin_connect);
- errno = ENOSYS;
-
- return -1;
- }
+ /* Should not go further if error with service open */
+ if (err != KERN_SUCCESS) {
+ printf("Could not create DirectHW instance.\n");
+ errno = ENOSYS;
+ return -1;
+ }
- return 0;
+ return 0;
}
static void darwin_cleanup(void)
{
- IOServiceClose(connect);
+ if (darwin_connect != MACH_PORT_NULL) {
+ IOServiceClose(darwin_connect);
+ darwin_connect = MACH_PORT_NULL;
+ }
}
-static int darwin_ioread(int pos, unsigned char *buf, int len)
+kern_return_t MyIOConnectCallStructMethod(
+ io_connect_t connect,
+ unsigned int index,
+ void * in,
+ size_t dataInLen,
+ void * out,
+ size_t * dataOutLen
+)
{
-
- kern_return_t err;
- size_t dataInLen = sizeof(iomem_t);
- size_t dataOutLen = sizeof(iomem_t);
- iomem_t in;
- iomem_t out;
-#ifdef __LP64__
- UInt64 tmpdata;
-#else
- UInt32 tmpdata;
-#endif
-
- in.width = len;
- in.offset = pos;
-
-#ifdef __LP64__
- if (len > 8)
+ kern_return_t err;
+#if MAC_OS_X_VERSION_MAX_ALLOWED <= MAC_OS_X_VERSION_10_4 || MAC_OS_X_VERSION_SDK <= MAC_OS_X_VERSION_10_4
+ /* Use legacy IOConnectMethodStructureIStructureO for Mac OS X 10.4 and earlier */
+ err = IOConnectMethodStructureIStructureO(connect, index, dataInLen, dataOutLen, in, out);
+#elif defined(__LP64__)
+ /* Use modern IOConnectCallStructMethod for 64-bit systems */
+ err = IOConnectCallStructMethod(connect, index, in, dataInLen, out, dataOutLen);
#else
- if (len > 4)
-#endif
- return 1;
-
-#if !defined(__LP64__) && defined(WANT_OLD_API)
- /* Check if OSX 10.5 API is available */
- if (IOConnectCallStructMethod != NULL) {
-#endif
- err = IOConnectCallStructMethod(connect, kReadIO, &in, dataInLen, &out, &dataOutLen);
-#if !defined(__LP64__) && defined(WANT_OLD_API)
- } else {
- /* Use old API */
- err = IOConnectMethodStructureIStructureO(connect, kReadIO, dataInLen, &dataOutLen, &in, &out);
- }
+ /* For 32-bit systems with transitional APIs (Mac OS X 10.5-10.7),
+ * determine which API to use based on availability at compile time.
+ * Use weak linking to check API availability at runtime. */
+ if (&IOConnectCallStructMethod != NULL) {
+ /* Modern API is available, use it */
+ err = IOConnectCallStructMethod(connect, index, in, dataInLen, out, dataOutLen);
+ } else {
+ /* Modern API not available, use legacy API */
+ err = IOConnectMethodStructureIStructureO(connect, index, dataInLen, dataOutLen, in, out);
+ }
#endif
+ return err;
+}
- if (err != KERN_SUCCESS)
- return 1;
-
- tmpdata = out.data;
-
- switch (len) {
- case 1:
- memcpy(buf, &tmpdata, 1);
- break;
-
- case 2:
- memcpy(buf, &tmpdata, 2);
- break;
+static kern_return_t dhw_IOConnectCallStructMethod(
+ unsigned int index,
+ void * in,
+ size_t dataInLen,
+ void * out,
+ size_t * dataOutLen
+)
+{
+ if (darwin_connect == MACH_PORT_NULL) {
+ iopl(3);
+ }
+ if (darwin_connect != MACH_PORT_NULL) {
+ return MyIOConnectCallStructMethod(darwin_connect, index, in, dataInLen, out, dataOutLen);
+ }
+ return kIOReturnError;
+}
- case 4:
- memcpy(buf, &tmpdata, 4);
- break;
+int darwin_ioread(int pos, unsigned char * buf, int len)
+{
+ kern_return_t err;
+ size_t dataInLen;
+ size_t dataOutLen;
+ void *in;
+ void *out;
+ iomem_t in32;
+ iomem_t out32;
+ iomem64_t in64;
+ iomem64_t out64;
+ UInt64 tmpdata64;
+ UInt32 tmpdata;
-#ifdef __LP64__
- case 8:
- memcpy(buf, &tmpdata, 8);
- break;
-#endif
+ if (len <= 4) {
+ in = &in32;
+ out = &out32;
+ dataInLen = sizeof(in32);
+ dataOutLen = sizeof(out32);
+ in32.width = len;
+ in32.offset = pos;
+ }
+ else if (len <= 8) {
+ in = &in64;
+ out = &out64;
+ dataInLen = sizeof(in64);
+ dataOutLen = sizeof(out64);
+ in64.width = len;
+ in64.offset = pos;
+ }
+ else {
+ return 1;
+ }
- default:
- fprintf(stderr, "ERROR: unsupported ioRead length %d\n", len);
+ err = dhw_IOConnectCallStructMethod(kReadIO, in, dataInLen, out, &dataOutLen);
+ if (err != KERN_SUCCESS)
return 1;
- }
- return 0;
+ if (len <= 4) {
+ tmpdata = out32.data;
+ switch (len) {
+ case 1: memcpy(buf, &tmpdata, 1); break;
+ case 2: memcpy(buf, &tmpdata, 2); break;
+ case 4: memcpy(buf, &tmpdata, 4); break;
+ case 8: memcpy(buf, &tmpdata, 8); break;
+ default:
+ fprintf(stderr, "ERROR: unsupported ioRead length %d\n", len);
+ return 1;
+ }
+ }
+ else {
+ tmpdata64 = out64.data;
+ switch (len) {
+ case 8: memcpy(buf, &tmpdata64, 8); break;
+ default:
+ fprintf(stderr, "ERROR: unsupported ioRead length %d\n", len);
+ return 1;
+ }
+ }
+
+ return 0;
}
static int darwin_iowrite(int pos, unsigned char * buf, int len)
{
- kern_return_t err;
- size_t dataInLen = sizeof(iomem_t);
- size_t dataOutLen = sizeof(iomem_t);
- iomem_t in;
- iomem_t out;
-
- in.width = len;
- in.offset = pos;
- memcpy(&in.data, buf, len);
-
-#ifdef __LP64__
- if (len > 8)
-#else
- if (len > 4)
-#endif
- {
- return 1;
+ kern_return_t err;
+ size_t dataInLen;
+ size_t dataOutLen;
+ void *in;
+ void *out;
+ iomem_t in32;
+ iomem_t out32;
+ iomem64_t in64;
+ iomem64_t out64;
+
+ if (len <= 4) {
+ in = &in32;
+ out = &out32;
+ dataInLen = sizeof(in32);
+ dataOutLen = sizeof(out32);
+ in32.width = len;
+ in32.offset = pos;
+ memcpy(&in32.data, buf, len);
+ }
+ else if (len <= 8) {
+ in = &in64;
+ out = &out64;
+ dataInLen = sizeof(in64);
+ dataOutLen = sizeof(out64);
+ in64.width = len;
+ in64.offset = pos;
+ memcpy(&in64.data, buf, len);
+ }
+ else {
+ return 1;
}
-#if !defined(__LP64__) && defined(WANT_OLD_API)
- /* Check if OSX 10.5 API is available */
- if (IOConnectCallStructMethod != NULL) {
-#endif
- err = IOConnectCallStructMethod(connect, kWriteIO, &in, dataInLen, &out, &dataOutLen);
-#if !defined(__LP64__) && defined(WANT_OLD_API)
- } else {
- /* Use old API */
- err = IOConnectMethodStructureIStructureO(connect, kWriteIO, dataInLen, &dataOutLen, &in, &out);
- }
-#endif
-
- if (err != KERN_SUCCESS)
- {
- return 1;
+ err = dhw_IOConnectCallStructMethod(kWriteIO, in, dataInLen, out, &dataOutLen);
+ if (err != KERN_SUCCESS) {
+ return 1;
}
- return 0;
+ return 0;
}
/* Compatibility interface */
+
unsigned char inb(unsigned short addr)
{
- unsigned char ret = 0;
- darwin_ioread(addr, &ret, 1);
- return ret;
+ unsigned char ret = 0;
+ darwin_ioread(addr, &ret, 1);
+ return ret;
}
unsigned short inw(unsigned short addr)
{
- unsigned short ret = 0;
- darwin_ioread(addr, (unsigned char *)&ret, 2);
- return ret;
+ unsigned short ret = 0;
+ darwin_ioread(addr, (unsigned char *)&ret, 2);
+ return ret;
}
unsigned int inl(unsigned short addr)
{
- unsigned int ret = 0;
- darwin_ioread(addr, (unsigned char *)&ret, 4);
- return ret;
+ unsigned int ret = 0;
+ darwin_ioread(addr, (unsigned char *)&ret, 4);
+ return ret;
}
#ifdef __LP64__
@@ -297,17 +288,17 @@ unsigned long inq(unsigned short addr)
void outb(unsigned char val, unsigned short addr)
{
- darwin_iowrite(addr, &val, 1);
+ darwin_iowrite(addr, &val, 1);
}
void outw(unsigned short val, unsigned short addr)
{
- darwin_iowrite(addr, (unsigned char *)&val, 2);
+ darwin_iowrite(addr, (unsigned char *)&val, 2);
}
void outl(unsigned int val, unsigned short addr)
{
- darwin_iowrite(addr, (unsigned char *)&val, 4);
+ darwin_iowrite(addr, (unsigned char *)&val, 4);
}
#ifdef __LP64__
@@ -317,88 +308,84 @@ void outq(unsigned long val, unsigned short addr)
}
#endif
-int iopl(int level __attribute__((unused)))
+int iopl(int level)
{
- atexit(darwin_cleanup);
-
- return darwin_init();
+ if (level) {
+ if (darwin_connect != MACH_PORT_NULL) {
+ return 0;
+ }
+ atexit(darwin_cleanup);
+ return darwin_init();
+ }
+ else {
+ darwin_cleanup();
+ return 0;
+ }
}
void *map_physical(uint64_t phys_addr, size_t len)
{
- kern_return_t err;
-#if __LP64__
- mach_vm_address_t addr;
- mach_vm_size_t size;
+ kern_return_t err;
+#if defined(__LP64__) && (MAC_OS_X_VERSION_SDK >= MAC_OS_X_VERSION_10_5)
+ mach_vm_address_t addr;
+ mach_vm_size_t size;
#else
vm_address_t addr;
vm_size_t size;
#endif
-
- size_t dataInLen = sizeof(map_t);
- size_t dataOutLen = sizeof(map_t);
+ size_t dataInLen = sizeof(map_t);
+ size_t dataOutLen = sizeof(map_t);
map_t in;
map_t out;
- in.addr = phys_addr;
- in.size = len;
+ in.addr = phys_addr;
+ in.size = len;
#ifdef DEBUG
- printf("map_phys: phys %08lx, %08x\n", phys_addr, len);
-#endif /* DEBUG */
-
-#if !defined(__LP64__) && defined(WANT_OLD_API)
- /* Check if OSX 10.5 API is available */
- if (IOConnectCallStructMethod != NULL) {
-#endif
- err = IOConnectCallStructMethod(connect, kPrepareMap, &in, dataInLen, &out, &dataOutLen);
-#if !defined(__LP64__) && defined(WANT_OLD_API)
- } else {
- /* Use old API */
- err = IOConnectMethodStructureIStructureO(connect, kPrepareMap, dataInLen, &dataOutLen, &in, &out);
- }
+ printf("map_phys: phys %08lx, %08x\n", phys_addr, len);
#endif
- if (err != KERN_SUCCESS) {
- printf("\nError(kPrepareMap): system 0x%x subsystem 0x%x code 0x%x ",
- err_get_system(err), err_get_sub(err), err_get_code(err));
+ err = dhw_IOConnectCallStructMethod(kPrepareMap, &in, dataInLen, &out, &dataOutLen);
+ if (err != KERN_SUCCESS) {
+ printf("\nError(kPrepareMap): system 0x%x subsystem 0x%x code 0x%x ",
+ err_get_system(err), err_get_sub(err), err_get_code(err));
- printf("physical 0x%16lx[0x%lx]\n", (unsigned long)phys_addr, (unsigned long)len);
+ printf("physical 0x%16lx[0x%lx]\n", (unsigned long)phys_addr, (unsigned long)len);
- switch (err_get_code(err)) {
- case 0x2c2: printf("Invalid argument.\n"); errno = EINVAL; break;
- case 0x2cd: printf("Device not open.\n"); errno = ENOENT; break;
- }
+ switch (err_get_code(err)) {
+ case 0x2c2: printf("Invalid argument.\n"); errno = EINVAL; break;
+ case 0x2cd: printf("Device not open.\n"); errno = ENOENT; break;
+ }
- return MAP_FAILED;
- }
+ return MAP_FAILED;
+ }
- err = IOConnectMapMemory(connect, 0, mach_task_self(),
- &addr, &size, kIOMapAnywhere | kIOMapInhibitCache);
+ err = IOConnectMapMemory(darwin_connect, 0, mach_task_self(),
+ &addr, &size, kIOMapAnywhere | kIOMapInhibitCache);
- /* Now this is odd; The above connect seems to be unfinished at the
- * time the function returns. So wait a little bit, or the calling
- * program will just segfault. Bummer. Who knows a better solution?
- */
- usleep(1000);
+ /* Now this is odd; The above connect seems to be unfinished at the
+ * time the function returns. So wait a little bit, or the calling
+ * program will just segfault. Bummer. Who knows a better solution?
+ */
+ usleep(1000);
- if (err != KERN_SUCCESS) {
- printf("\nError(IOConnectMapMemory): system 0x%x subsystem 0x%x code 0x%x ",
- err_get_system(err), err_get_sub(err), err_get_code(err));
+ if (err != KERN_SUCCESS) {
+ printf("\nError(IOConnectMapMemory): system 0x%x subsystem 0x%x code 0x%x ",
+ err_get_system(err), err_get_sub(err), err_get_code(err));
- printf("physical 0x%16lx[0x%lx]\n", (unsigned long)phys_addr, (unsigned long)len);
+ printf("physical 0x%16lx[0x%lx]\n", (unsigned long)phys_addr, (unsigned long)len);
- switch (err_get_code(err)) {
- case 0x2c2: printf("Invalid argument.\n"); errno = EINVAL; break;
- case 0x2cd: printf("Device not open.\n"); errno = ENOENT; break;
- }
+ switch (err_get_code(err)) {
+ case 0x2c2: printf("Invalid argument.\n"); errno = EINVAL; break;
+ case 0x2cd: printf("Device not open.\n"); errno = ENOENT; break;
+ }
- return MAP_FAILED;
- }
+ return MAP_FAILED;
+ }
#ifdef DEBUG
- printf("map_phys: virt %16lx, %16lx\n", (unsigned long)addr, (unsigned long)size);
+ printf("map_phys: virt %16lx, %16lx\n", (unsigned long)addr, (unsigned long)size);
#endif /* DEBUG */
return (void *)addr;
@@ -406,80 +393,184 @@ void *map_physical(uint64_t phys_addr, size_t len)
void unmap_physical(void *virt_addr __attribute__((unused)), size_t len __attribute__((unused)))
{
- // Nut'n Honey
+ // Nut'n Honey
}
static int current_logical_cpu = 0;
msr_t rdmsr(int addr)
{
- kern_return_t err;
- size_t dataInLen = sizeof(msrcmd_t);
- size_t dataOutLen = sizeof(msrcmd_t);
- msrcmd_t in, out;
- msr_t ret = { INVALID_MSR_HI, INVALID_MSR_LO };
-
- in.core = current_logical_cpu;
- in.index = addr;
-
-#if !defined(__LP64__) && defined(WANT_OLD_API)
- /* Check if OSX 10.5 API is available */
- if (IOConnectCallStructMethod != NULL) {
-#endif
- err = IOConnectCallStructMethod(connect, kReadMSR, &in, dataInLen, &out, &dataOutLen);
-#if !defined(__LP64__) && defined(WANT_OLD_API)
- } else {
- /* Use old API */
- err = IOConnectMethodStructureIStructureO(connect, kReadMSR, dataInLen, &dataOutLen, &in, &out);
- }
-#endif
-
- if (err != KERN_SUCCESS)
- {
- return ret;
+ kern_return_t err;
+ size_t dataInLen = sizeof(msrcmd_t);
+ size_t dataOutLen = sizeof(msrcmd_t);
+ msrcmd_t in, out;
+ msr_t ret;
+ ret.lo = INVALID_MSR_LO;
+ ret.hi = INVALID_MSR_HI;
+
+ in.core = current_logical_cpu;
+ in.index = addr;
+
+ err = dhw_IOConnectCallStructMethod(kReadMSR, &in, dataInLen, &out, &dataOutLen);
+ if (err != KERN_SUCCESS) {
+ return ret;
}
- ret.io64 = out.val.io64;
+ ret.lo = out.lo;
+ ret.hi = out.hi;
+
+ return ret;
+}
+
+int rdcpuid(uint32_t eax, uint32_t ecx, uint32_t cpudata[4])
+{
+ kern_return_t err;
+ size_t dataInLen = sizeof(cpuid_t);
+ size_t dataOutLen = sizeof(cpuid_t);
+ cpuid_t in, out;
+
+ in.core = current_logical_cpu;
+ in.eax = eax;
+ in.ecx = ecx;
+
+ err = dhw_IOConnectCallStructMethod(kReadCpuId, &in, dataInLen, &out, &dataOutLen);
+ if (err != KERN_SUCCESS)
+ return -1;
+
+ memcpy(cpudata, out.cpudata, sizeof(uint32_t) * 4);
+ return 0;
+}
+
+int readmem32(uint64_t addr, uint32_t* data)
+{
+ kern_return_t err;
+ size_t dataInLen = sizeof(readmem_t);
+ size_t dataOutLen = sizeof(readmem_t);
+ readmem_t in, out;
+
+ in.core = current_logical_cpu;
+ in.addr = addr;
- return ret;
+ err = dhw_IOConnectCallStructMethod(kReadMem, &in, dataInLen, &out, &dataOutLen);
+ if (err != KERN_SUCCESS)
+ return -1;
+
+ *data = out.data;
+ return 0;
}
int wrmsr(int addr, msr_t msr)
{
- kern_return_t err;
- size_t dataInLen = sizeof(msrcmd_t);
- size_t dataOutLen = sizeof(msrcmd_t);
+ kern_return_t err;
+ size_t dataInLen = sizeof(msrcmd_t);
+ size_t dataOutLen = sizeof(msrcmd_t);
msrcmd_t in;
msrcmd_t out;
- in.core = current_logical_cpu;
- in.index = addr;
- in.val.io64 = msr.io64;
+ in.core = current_logical_cpu;
+ in.index = addr;
+ in.lo = msr.lo;
+ in.hi = msr.hi;
-#if !defined(__LP64__) && defined(WANT_OLD_API)
- /* Check if OSX 10.5 API is available */
- if (IOConnectCallStructMethod != NULL) {
-#endif
- err = IOConnectCallStructMethod(connect, kWriteMSR, &in, dataInLen, &out, &dataOutLen);
-#if !defined(__LP64__) && defined(WANT_OLD_API)
- } else {
- /* Use old API */
- err = IOConnectMethodStructureIStructureO(connect, kWriteMSR, dataInLen, &dataOutLen, &in, &out);
- }
-#endif
+ err = dhw_IOConnectCallStructMethod(kWriteMSR, &in, dataInLen, &out, &dataOutLen);
+ if (err != KERN_SUCCESS)
+ return 1;
+
+ return 0;
+}
- if (err != KERN_SUCCESS)
- {
- return 1;
+int logical_cpu_select(int cpu)
+{
+ current_logical_cpu = cpu;
+ return current_logical_cpu;
+}
+
+int allocate_physically_contiguous_32(size_t len, uint32_t *phys, void* *user, uint32_t *type)
+{
+ kern_return_t err;
+
+ MemParams in;
+ MemParams out;
+ size_t dataInLen = sizeof(MemParams);
+ size_t dataOutLen = sizeof(MemParams);
+
+ in.allocOptions = kPhysContig;
+ in.size = len;
+ in.physMask = 0xfffff000; // 32-bit page aligned
+ in.mapOptions = kIOMapInhibitCache;
+
+ err = dhw_IOConnectCallStructMethod(kAllocatePhysicalMemory, &in, dataInLen, &out, &dataOutLen);
+ if (err != KERN_SUCCESS) {
+ printf("\nError(kAllocatePhysicalMemory): system 0x%x subsystem 0x%x code 0x%x\n",
+ err_get_system(err), err_get_sub(err), err_get_code(err));
+ return -1;
}
- return 0;
+ if (phys) *phys = (UInt32)out.physAddr;
+#ifdef __LP64__
+ if (user) *user = (void*)out.userAddr;
+#else
+ if (user) *user = (void*)(UInt32)out.userAddr;
+#endif
+ if (type) *type = out.memoryType;
+ return 0;
}
-int logical_cpu_select(int cpu)
+int unallocate_mem(uint32_t type)
{
- current_logical_cpu = cpu;
+ kern_return_t err;
- return current_logical_cpu;
+ MemParams in;
+ MemParams out;
+ size_t dataInLen = sizeof(MemParams);
+ size_t dataOutLen = sizeof(MemParams);
+
+ in.memoryType = type;
+
+ err = dhw_IOConnectCallStructMethod(kUnallocatePhysicalMemory, &in, dataInLen, &out, &dataOutLen);
+ if (err != KERN_SUCCESS) {
+ printf("\nError(kUnallocatePhysicalMemory): system 0x%x subsystem 0x%x code 0x%x\n",
+ err_get_system(err), err_get_sub(err), err_get_code(err));
+ return -1;
+ }
+ return 0;
}
+void *map_physical_v2(uint64_t phys_addr, size_t len)
+{
+ kern_return_t err;
+
+ MemParams in;
+ MemParams out;
+ size_t dataInLen = sizeof(MemParams);
+ size_t dataOutLen = sizeof(MemParams);
+
+ in.allocOptions = kUsePhys;
+ in.physAddr = phys_addr;
+ in.size = len;
+ in.mapOptions = kIOMapInhibitCache;
+
+#ifdef DEBUG
+ printf("map_phys: phys %08llx, %08zx\n", phys_addr, len);
+#endif
+
+ err = dhw_IOConnectCallStructMethod(kAllocatePhysicalMemory, &in, dataInLen, &out, &dataOutLen);
+ if (err != KERN_SUCCESS) {
+ printf("\nError(kPrepareMap): system 0x%x subsystem 0x%x code 0x%x ",
+ err_get_system(err), err_get_sub(err), err_get_code(err));
+
+ printf("physical 0x%16lx[0x%lx]\n", (unsigned long)phys_addr, (unsigned long)len);
+
+ return MAP_FAILED;
+ }
+
+#ifdef DEBUG
+ printf("map_phys: virt %16lx, %16llx\n", out.userAddr, out.size);
+#endif /* DEBUG */
+
+#ifdef __LP64__
+ return (void *)out.userAddr;
+#else
+ return (void *)(UInt32)out.userAddr;
+#endif
+}
diff --git a/DirectHW/DirectHW.cpp b/DirectHW/DirectHW.cpp
index 51b3cb0..fecf216 100644
--- a/DirectHW/DirectHW.cpp
+++ b/DirectHW/DirectHW.cpp
@@ -5,7 +5,7 @@
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
- *
+ *
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
@@ -16,28 +16,110 @@
*/
#include "DirectHW.hpp"
+#include
+#include
+
+#if defined(__i386__) || defined(__x86_64__)
+ #if 0
+ #include
+ #else
+ typedef unsigned short i386_ioport_t;
+ #if defined(__GNUC__)
+ static __inline__ UInt32 inl (i386_ioport_t port) { UInt32 datum; __asm__ volatile("inl %w1, %0" : "=a" (datum) : "Nd" (port)); return(datum); }
+ static __inline__ UInt16 inw (i386_ioport_t port) { UInt16 datum; __asm__ volatile("inw %w1, %w0" : "=a" (datum) : "Nd" (port)); return(datum); }
+ static __inline__ UInt8 inb (i386_ioport_t port) { UInt8 datum; __asm__ volatile("inb %w1, %b0" : "=a" (datum) : "Nd" (port)); return(datum); }
+ static __inline__ void outl(i386_ioport_t port, UInt32 datum) { __asm__ volatile("outl %0, %w1" : : "a" (datum) , "Nd" (port)); }
+ static __inline__ void outw(i386_ioport_t port, UInt16 datum) { __asm__ volatile("outw %w0, %w1" : : "a" (datum) , "Nd" (port)); }
+ static __inline__ void outb(i386_ioport_t port, UInt8 datum) { __asm__ volatile("outb %b0, %w1" : : "a" (datum) , "Nd" (port)); }
+ #endif
+ #endif
+#endif
-#undef DEBUG_KEXT
+//#define DOLOG kprintf
+#define DOLOG IOLog
+
+//This is defined in the compiler flags for the debug target.
+//#undef DEBUG_KEXT
//#define DEBUG_KEXT
-#ifndef suepr
+#undef super
#define super IOService
-#endif /* super */
+
+#if MAC_OS_X_VERSION_SDK <= MAC_OS_X_VERSION_10_6
+ extern vm_size_t page_size;
+#endif
+
+#if MAC_OS_X_VERSION_SDK <= MAC_OS_X_VERSION_10_5
+ #define kIOMemoryMapperNone kIOMemoryDontMap
+#endif
+
+#if MAC_OS_X_VERSION_SDK <= MAC_OS_X_VERSION_10_4
+ #define kIOUCVariableStructureSize ((IOByteCount)-1)
+ #define getAddress getVirtualAddress
+#endif
+
+#if MAC_OS_X_VERSION_SDK <= MAC_OS_X_VERSION_10_3
+ #define snprintf(str, len, format, ...) sprintf(str, len, format, VA_ARGS);
+#endif
+
+#ifndef kIOUserClientCrossEndianKey
+ #define kIOUserClientCrossEndianKey "IOUserClientCrossEndian"
+#endif
+#ifndef kIOUserClientCrossEndianCompatibleKey
+ #define kIOUserClientCrossEndianCompatibleKey "IOUserClientCrossEndianCompatible"
+#endif
+
+extern "C"
+{
+ /* from sys/osfmk/i386/mp.c */
+#if MAC_OS_X_VERSION_SDK <= MAC_OS_X_VERSION_10_5 || defined(__arm64e__)
+ #if defined(__i386__) || defined(__x86_64__)
+ extern void mp_rendezvous(void (*setup_func)(void *),
+ void (*action_func)(void *),
+ void (*teardown_func)(void *),
+ void *arg);
+ #else
+ static void mp_rendezvous(void (*setup_func)(void *),
+ void (*action_func)(void *),
+ void (*teardown_func)(void *),
+ void *arg)
+ {
+ ((void)setup_func);
+ ((void)teardown_func);
+ action_func(arg);
+ }
+ #endif
+
+ #define mp_rendezvous_no_intrs(x, y) mp_rendezvous(NULL, x, NULL, y)
+
+ #define cpu_number() (0)
+
+#else
+ extern void mp_rendezvous(void (*setup_func)(void *),
+ void (*action_func)(void *),
+ void (*teardown_func)(void *),
+ void *arg);
+
+ extern void mp_rendezvous_no_intrs(void (*action_func)(void *),
+ void *arg) /* __attribute__((weak_import)) */;
+
+ extern int cpu_number(void) /* __attribute__((weak_import)) */ ;
+#endif
+}
OSDefineMetaClassAndStructors(DirectHWService, IOService)
bool DirectHWService::start(IOService * provider)
{
- IOLog("DirectHW: Driver v%s (compiled on %s) loaded.\nVisit http://www.coresystems.de/ for more information.\n", DIRECTHW_VERSION, __DATE__);
-
- if (super::start(provider))
- {
- registerService();
+ DOLOG("DirectHW: Driver v%s (compiled on %s at %s) loaded.\n", DIRECTHW_VERSION, __DATE__, __TIME__);
+ DOLOG("Visit http://www.coresystems.de/ for more information.\n");
- return true;
- }
+ if (super::start(provider)) {
+ registerService();
+ return true;
+ }
- return false;
+ return false;
}
#undef super
@@ -45,137 +127,234 @@ bool DirectHWService::start(IOService * provider)
OSDefineMetaClassAndStructors(DirectHWUserClient, IOUserClient)
-const IOExternalAsyncMethod DirectHWUserClient::fAsyncMethods[kNumberOfMethods] =
-{
- {0, (IOAsyncMethod) & DirectHWUserClient::ReadIOAsync, kIOUCStructIStructO, sizeof(iomem_t), sizeof(iomem_t)},
- {0, (IOAsyncMethod) & DirectHWUserClient::WriteIOAsync, kIOUCStructIStructO, sizeof(iomem_t), sizeof(iomem_t)},
- {0, (IOAsyncMethod) & DirectHWUserClient::PrepareMapAsync, kIOUCStructIStructO, sizeof(map_t), sizeof(map_t)},
+const IOExternalAsyncMethod DirectHWUserClient::fAsyncMethods[kNumberOfMethods] = {
+ {0, (IOAsyncMethod) & DirectHWUserClient::ReadIOAsync, kIOUCStructIStructO, kIOUCVariableStructureSize, kIOUCVariableStructureSize},
+ {0, (IOAsyncMethod) & DirectHWUserClient::WriteIOAsync, kIOUCStructIStructO, kIOUCVariableStructureSize, kIOUCVariableStructureSize},
+ {0, (IOAsyncMethod) & DirectHWUserClient::PrepareMapAsync, kIOUCStructIStructO, kIOUCVariableStructureSize, kIOUCVariableStructureSize},
{0, (IOAsyncMethod) & DirectHWUserClient::ReadMSRAsync, kIOUCStructIStructO, sizeof(msrcmd_t), sizeof(msrcmd_t)},
- {0, (IOAsyncMethod) & DirectHWUserClient::WriteMSRAsync, kIOUCStructIStructO, sizeof(msrcmd_t), sizeof(msrcmd_t)}
+ {0, (IOAsyncMethod) & DirectHWUserClient::WriteMSRAsync, kIOUCStructIStructO, sizeof(msrcmd_t), sizeof(msrcmd_t)},
+ {0, (IOAsyncMethod) & DirectHWUserClient::ReadCpuIdAsync, kIOUCStructIStructO, sizeof(cpuid_t), sizeof(cpuid_t)},
+ {0, (IOAsyncMethod) & DirectHWUserClient::ReadMemAsync, kIOUCStructIStructO, sizeof(readmem_t), sizeof(readmem_t)},
+ {0, (IOAsyncMethod) & DirectHWUserClient::ReadAsync, kIOUCStructIStructO, sizeof(Parameters), sizeof(Parameters)},
+ {0, (IOAsyncMethod) & DirectHWUserClient::WriteAsync, kIOUCStructIStructO, sizeof(Parameters), sizeof(Parameters)},
+ {0, (IOAsyncMethod) & DirectHWUserClient::AllocatePhysicalMemoryAsync, kIOUCStructIStructO, sizeof(MemParams), sizeof(MemParams)},
+ {0, (IOAsyncMethod) & DirectHWUserClient::UnallocatePhysicalMemoryAsync, kIOUCStructIStructO, sizeof(MemParams), sizeof(MemParams)},
};
-const IOExternalMethod DirectHWUserClient::fMethods[kNumberOfMethods] =
-{
- {0, (IOMethod) & DirectHWUserClient::ReadIO, kIOUCStructIStructO, sizeof(iomem_t), sizeof(iomem_t)},
- {0, (IOMethod) & DirectHWUserClient::WriteIO, kIOUCStructIStructO, sizeof(iomem_t), sizeof(iomem_t)},
- {0, (IOMethod) & DirectHWUserClient::PrepareMap, kIOUCStructIStructO, sizeof(map_t), sizeof(map_t)},
- {0, (IOMethod) & DirectHWUserClient::ReadMSR, kIOUCStructIStructO, sizeof(msrcmd_t), sizeof(msrcmd_t)},
- {0, (IOMethod) & DirectHWUserClient::WriteMSR, kIOUCStructIStructO, sizeof(msrcmd_t), sizeof(msrcmd_t)}
+const IOExternalMethod DirectHWUserClient::fMethods[kNumberOfMethods] = {
+ {0, (IOMethod) & DirectHWUserClient::ReadIO, kIOUCStructIStructO, kIOUCVariableStructureSize, kIOUCVariableStructureSize},
+ {0, (IOMethod) & DirectHWUserClient::WriteIO, kIOUCStructIStructO, kIOUCVariableStructureSize, kIOUCVariableStructureSize},
+ {0, (IOMethod) & DirectHWUserClient::PrepareMap, kIOUCStructIStructO, kIOUCVariableStructureSize, kIOUCVariableStructureSize},
+ {0, (IOMethod) & DirectHWUserClient::ReadMSR, kIOUCStructIStructO, sizeof(msrcmd_t), sizeof(msrcmd_t)},
+ {0, (IOMethod) & DirectHWUserClient::WriteMSR, kIOUCStructIStructO, sizeof(msrcmd_t), sizeof(msrcmd_t)},
+ {0, (IOMethod) & DirectHWUserClient::ReadCpuId, kIOUCStructIStructO, sizeof(cpuid_t), sizeof(cpuid_t)},
+ {0, (IOMethod) & DirectHWUserClient::ReadMem, kIOUCStructIStructO, sizeof(readmem_t), sizeof(readmem_t)},
+ {0, (IOMethod) & DirectHWUserClient::Read, kIOUCStructIStructO, sizeof(Parameters), sizeof(Parameters)},
+ {0, (IOMethod) & DirectHWUserClient::Write, kIOUCStructIStructO, sizeof(Parameters), sizeof(Parameters)},
+ {0, (IOMethod) & DirectHWUserClient::AllocatePhysicalMemory, kIOUCStructIStructO, sizeof(MemParams), sizeof(MemParams)},
+ {0, (IOMethod) & DirectHWUserClient::UnallocatePhysicalMemory, kIOUCStructIStructO, sizeof(MemParams), sizeof(MemParams)},
};
-bool DirectHWUserClient::initWithTask(task_t task, void *securityID, UInt32 type)
+bool DirectHWUserClient::initWithTask(task_t task, void *securityID, UInt32 type, OSDictionary* properties)
{
- bool ret;
+ bool ret;
- ret = super::initWithTask(task, securityID, type);
+ #ifdef DEBUG_KEXT
+ DOLOG("DirectHW: initWithTask(%p, %p, %lx)\n", (void *)task, (void *)securityID, (unsigned long)type);
+ #endif
-#ifdef DEBUG_KEXT
- IOLog("DirectHW: initWithTask(%p, %p, %16lx)\n", (void *)task, (void *)securityID, (unsigned long)type);
-#endif /* DEBUG_KEXT */
+ if (kIOReturnSuccess != clientHasPrivilege(securityID, kIOClientPrivilegeAdministrator)) {
+ DOLOG("DirectHW: Requires administrator.\n");
+ return (false);
+ }
- if (ret == false)
- {
- IOLog("DirectHW: initWithTask failed.\n");
+ ret = super::initWithTask(task, securityID, type);
+ if (ret == false) {
+ DOLOG("DirectHW: initWithTask failed.\n");
+ return ret;
+ }
- return ret;
- }
+ fCrossEndian = false;
- fTask = task;
+#if MAC_OS_X_VERSION_SDK >= MAC_OS_X_VERSION_10_4
+ if (properties != NULL && properties->getObject(kIOUserClientCrossEndianKey)) {
+ // A connection to this user client is being opened by a user process running using Rosetta.
- return ret;
+ // Indicate that this user client can handle being called from cross-endian user processes by
+ // setting its IOUserClientCrossEndianCompatible property in the I/O Registry.
+ if (setProperty(kIOUserClientCrossEndianCompatibleKey, kOSBooleanTrue)) {
+ fCrossEndian = true;
+ DOLOG("DirectHW: fCrossEndian = true\n");
+ }
+ }
+#endif
+
+ fTask = task;
+ return ret;
}
IOExternalAsyncMethod *DirectHWUserClient::getAsyncTargetAndMethodForIndex(IOService ** target, UInt32 index)
{
- if (target == NULL)
- {
+ if (target == NULL) {
+ DOLOG("DirectHW: getAsyncTargetAndMethodForIndex no target\n");
return NULL;
}
- if (index < (UInt32) kNumberOfMethods)
- {
- if (fAsyncMethods[index].object == (IOService *) 0)
- {
+ if (index < (UInt32) kNumberOfMethods) {
+ if (fAsyncMethods[index].object == (IOService *) 0) {
*target = this;
}
-
return (IOExternalAsyncMethod *) & fAsyncMethods[index];
}
+ DOLOG("DirectHW: getAsyncTargetAndMethodForIndex index %d out of range %d\n", (int)index, (int)kNumberOfMethods);
*target = NULL;
return NULL;
}
IOExternalMethod *DirectHWUserClient::getTargetAndMethodForIndex(IOService ** target, UInt32 index)
{
- if (target == NULL)
- {
+ if (target == NULL) {
return NULL;
}
- if (index < (UInt32) kNumberOfMethods)
- {
- if (fMethods[index].object == (IOService *) 0)
- {
- *target = this;
+ if (index < (UInt32) kNumberOfMethods) {
+ if (fMethods[index].object == (IOService *) 0) {
+ *target = this;
}
- return (IOExternalMethod *) & fMethods[index];
- }
-
+ return (IOExternalMethod *) & fMethods[index];
+ }
+
+ DOLOG("DirectHW: getTargetAndMethodForIndex index %d out of range %d\n", (int)index, (int)kNumberOfMethods);
*target = NULL;
return NULL;
}
bool DirectHWUserClient::start(IOService * provider)
{
- bool success;
-
-#ifdef DEBUG_KEXT
- IOLog("DirectHW: Starting DirectHWUserClient\n");
-#endif
-
- fProvider = OSDynamicCast(DirectHWService, provider);
- success = (fProvider != NULL);
-
- if (kIOReturnSuccess != clientHasPrivilege(current_task(),kIOClientPrivilegeAdministrator)) {
- IOLog("DirectHW: Need to be administrator.\n");
- success = false;
- }
+ bool success;
+
+ #ifdef DEBUG_KEXT
+ DOLOG("DirectHW: Starting DirectHWUserClient.\n");
+ #endif
+
+ fNextMemoryType = 0;
+ fProvider = OSDynamicCast(DirectHWService, provider);
+ success = (fProvider != NULL);
+
+ if (success) {
+ success = super::start(provider);
+ #ifdef DEBUG_KEXT
+ DOLOG("DirectHW: Client successfully started.\n");
+ #endif
+
+ fMemoryTypes = OSDictionary::withCapacity(8);
+ if (!fMemoryTypes) {
+ DOLOG("DirectHW: Could not create memory types dictionary.\n");
+ success = false;
+ }
+ }
+ else {
+ #ifdef DEBUG_KEXT
+ DOLOG("DirectHW: Could not start client.\n");
+ #endif
+ }
- if (success)
- {
- success = super::start(provider);
-#ifdef DEBUG_KEXT
- IOLog("DirectHW: Client successfully started.\n");
- } else {
- IOLog("DirectHW: Could not start client.\n");
+#if 0
+ #if (defined(__i386__) || defined(__x86_64__))
+ uint32_t cr0, cr2, cr3;
+ #ifdef __x86_64__
+ __asm__ __volatile__ (
+ "mov %%cr0, %%rax\n"
+ "mov %%eax, %0\n"
+ "mov %%cr2, %%rax\n"
+ "mov %%eax, %1\n"
+ "mov %%cr3, %%rax\n"
+ "mov %%eax, %2\n"
+ : "=m" (cr0), "=m" (cr2), "=m" (cr3)
+ : /* no input */
+ : "%rax"
+ );
+ #elif defined(__i386__)
+ __asm__ __volatile__ (
+ "mov %%cr0, %%eax\n"
+ "mov %%eax, %0\n"
+ "mov %%cr2, %%eax\n"
+ "mov %%eax, %1\n"
+ "mov %%cr3, %%eax\n"
+ "mov %%eax, %2\n"
+ : "=m" (cr0), "=m" (cr2), "=m" (cr3)
+ : /* no input */
+ : "%eax"
+ );
+ #endif
+ DOLOG("DirectHW: cr0 = 0x%8.8X\n", cr0);
+ DOLOG("DirectHW: cr2 = 0x%8.8X\n", cr2);
+ DOLOG("DirectHW: cr3 = 0x%8.8X\n", cr3);
+ #endif
#endif
- }
- return success;
+ return success;
}
void DirectHWUserClient::stop(IOService *provider)
{
-#ifdef DEBUG_KEXT
- IOLog("DirectHW: Stopping client.\n");
-#endif
+ #ifdef DEBUG_KEXT
+ DOLOG("DirectHW: Stopping client.\n");
+ #endif
+
+ if (fMemoryTypes) {
+ OSCollectionIterator *memoryTypeIterator = OSCollectionIterator::withCollection(fMemoryTypes);
+ if (memoryTypeIterator) {
+ const OSSymbol *key;
+/*
+ // list all memorymaps
+ while ((key = (const OSSymbol *) memoryTypeIterator->getNextObject()))
+ DOLOG("• memory type %s\n", key->getCStringNoCopy());
+ memoryTypeIterator->reset();
+*/
+ unsigned int numItems = fMemoryTypes->getCount();
+ if (numItems > 0)
+ DOLOG("DirectHW: Cleaning up %d memory types\n", numItems);
+
+ while ((key = (const OSSymbol *) memoryTypeIterator->getNextObject())) {
+ UInt32 memoryType;
+ int numLen;
+ const char* numStr = key->getCStringNoCopy();
+
+ // the kernel version of sscanf only works with %d and returns number of parsed characters instead of number of parsed arguments
+ if ((numLen = sscanf(numStr, "%d", &memoryType)) == 1) {
+ UnallocatePhysicalMemoryType(memoryType);
+ memoryTypeIterator->reset(); // this is needed after removing an object otherwise the loop stops
+ }
+ else
+ DOLOG("DirectHW: Invalid memory type: %s, numCharsParsed:%d\n", numStr, numLen);
+ }
+ memoryTypeIterator->release();
+ }
+ else
+ DOLOG("DirectHW: could not create fMemoryTypes iterator\n");
+
+ fMemoryTypes->release();
+ fMemoryTypes = NULL;
+ }
- super::stop(provider);
+ super::stop(provider);
}
IOReturn DirectHWUserClient::clientClose(void)
{
- bool success = terminate();
- if (!success) {
- IOLog("DirectHW: Client NOT successfully closed.\n");
-#ifdef DEBUG_KEXT
- } else {
- IOLog("DirectHW: Client successfully closed.\n");
-#endif
- }
+ bool success = terminate();
+ if (!success) {
+ DOLOG("DirectHW: Client NOT successfully closed.\n");
+ }
+ else {
+ #ifdef DEBUG_KEXT
+ DOLOG("DirectHW: Client successfully closed.\n");
+ #endif
+ }
- return kIOReturnSuccess;
+ return kIOReturnSuccess;
}
IOReturn
@@ -185,8 +364,7 @@ DirectHWUserClient::ReadIOAsync(OSAsyncReference asyncRef,
IOByteCount *outStructSize)
{
((void)asyncRef);
-
- return DirectHWUserClient::ReadIO(inStruct, outStruct, inStructSize, outStructSize);
+ return ReadIO(inStruct, outStruct, inStructSize, outStructSize);
}
IOReturn
@@ -194,50 +372,100 @@ DirectHWUserClient::ReadIO(iomem_t *inStruct, iomem_t *outStruct,
IOByteCount inStructSize,
IOByteCount *outStructSize)
{
- ((void)inStructSize);
+#if defined(__i386__) || defined(__x86_64__)
+ if (
+ (inStructSize != sizeof(iomem_t) && inStructSize != sizeof(iomem64_t))
+ || !outStructSize
+ || *outStructSize != inStructSize
+ ) {
+ return kIOReturnBadArgument;
+ }
- if ((fProvider == NULL) || (isInactive()))
- {
- return kIOReturnNotAttached;
- }
+ if ((fProvider == NULL) || (isInactive())) {
+ return kIOReturnNotAttached;
+ }
- switch (inStruct->width)
- {
- case 1:
- outStruct->data = inb(inStruct->offset);
- break;
-
- case 2:
- outStruct->data = inw(inStruct->offset);
- break;
-
- case 4:
- outStruct->data = inl(inStruct->offset);
- break;
-
-#ifdef __LP64__
- case 8:
- outStruct->data = (UInt64)inl(inStruct->offset);
- outStruct->data = ((UInt64)inl(inStruct->offset) << 32);
-#endif
+ if (inStructSize == sizeof(iomem_t)) {
+ if (fCrossEndian) {
+ inStruct->offset = OSSwapInt32(inStruct->offset);
+ inStruct->width = OSSwapInt32(inStruct->width);
+ }
- default:
- IOLog("DirectHW: Invalid read attempt %ld bytes at IO address %lx\n",
- (long)inStruct->width, (unsigned long)inStruct->offset);
- break;
- }
+ outStruct->data = 0;
+ switch (inStruct->width) {
+ case 1: *(UInt8*)(&outStruct->data) = inb(inStruct->offset); break;
+ case 2: *(UInt16*)(&outStruct->data) = inw(inStruct->offset); break;
+ case 4: {
+ UInt64 val = inl(inStruct->offset);
+ *(UInt32*)(&outStruct->data) = (UInt32)val;
+ } break;
+ default:
+ DOLOG("DirectHW: Invalid read attempt %ld bytes at IO address %lx\n",
+ (long)inStruct->width, (unsigned long)inStruct->offset);
+ return kIOReturnBadArgument;
+ }
-#ifdef DEBUG_KEXT
- IOLog("DirectHW: Read %ld bytes at IO address %lx (result=%lx)\n",
- (unsigned long)inStruct->width, (unsigned long)inStruct->offset, (unsigned long)outStruct->data);
-#endif /* DEBUG_KEXT */
+ #ifdef DEBUG_KEXT
+ DOLOG("DirectHW: Read %ld bytes at IO address %lx (result=%lx)\n",
+ (unsigned long)inStruct->width, (unsigned long)inStruct->offset, (unsigned long)outStruct->data);
+ #endif
- if (outStructSize != NULL)
- {
- *outStructSize = sizeof(iomem_t);
+ if (fCrossEndian) {
+ switch (inStruct->width) {
+ case 2: *(UInt16*)(&outStruct->data) = OSSwapInt16(*(UInt16*)(&outStruct->data)); break;
+ case 4: *(UInt32*)(&outStruct->data) = OSSwapInt32(*(UInt32*)(&outStruct->data)); break;
+ }
+ }
}
+ else {
+ iomem64_t *inStruct64 = (iomem64_t*)inStruct;
+ iomem64_t *outStruct64 = (iomem64_t*)outStruct;
- return kIOReturnSuccess;
+ if (fCrossEndian) {
+ inStruct64->offset = OSSwapInt64(inStruct64->offset);
+ inStruct64->width = OSSwapInt64(inStruct64->width);
+ }
+
+ switch (inStruct64->width) {
+ case 1: *(UInt8*)(&outStruct64->data) = inb(inStruct64->offset); break;
+ case 2: *(UInt16*)(&outStruct64->data) = inw(inStruct64->offset); break;
+ case 4: {
+ UInt64 val = inl((i386_ioport_t)inStruct64->offset);
+ *(UInt32*)(&outStruct64->data) = (UInt32)val;
+ } break;
+ case 8: {
+ UInt64 val = inl((i386_ioport_t)inStruct64->offset);
+ UInt64 val2 = inl((i386_ioport_t)inStruct64->offset + 4);
+ *(UInt64*)(&outStruct64->data) = (UInt64)(val) | ((UInt64)(val2) << 32);
+ } break;
+ default:
+ DOLOG("DirectHW: Invalid read attempt %ld bytes at IO address %lx\n",
+ (long)inStruct64->width, (unsigned long)inStruct64->offset);
+ return kIOReturnBadArgument;
+ }
+
+ #ifdef DEBUG_KEXT
+ DOLOG("DirectHW: Read %ld bytes at IO address %lx (result=%lx)\n",
+ (unsigned long)inStruct64->width, (unsigned long)inStruct64->offset, (unsigned long)outStruct64->data);
+ #endif
+
+ if (fCrossEndian) {
+ switch (inStruct64->width) {
+ case 2: *(UInt16*)(&outStruct64->data) = OSSwapInt16(*(UInt16*)(&outStruct64->data)); break;
+ case 4: *(UInt32*)(&outStruct64->data) = OSSwapInt32(*(UInt32*)(&outStruct64->data)); break;
+ case 8: *(UInt64*)(&outStruct64->data) = OSSwapInt64(*(UInt64*)(&outStruct64->data)); break;
+ }
+ }
+ }
+#else
+ ((void)inStruct);
+ ((void)outStruct);
+ ((void)inStructSize);
+ ((void)outStructSize);
+ return kIOReturnBadArgument;
+#endif
+
+ return kIOReturnSuccess;
}
IOReturn
@@ -246,8 +474,7 @@ DirectHWUserClient::WriteIOAsync(OSAsyncReference asyncRef, iomem_t *inStruct, i
IOByteCount *outStructSize)
{
((void)asyncRef);
-
- return DirectHWUserClient::WriteIO(inStruct, outStruct, inStructSize, outStructSize);
+ return WriteIO(inStruct, outStruct, inStructSize, outStructSize);
}
IOReturn
@@ -255,53 +482,94 @@ DirectHWUserClient::WriteIO(iomem_t *inStruct, iomem_t *outStruct,
IOByteCount inStructSize,
IOByteCount *outStructSize)
{
-#ifndef DEBUG_KEXT
- ((void)inStruct);
-#endif /* DEBUG_KEXT */
((void)outStruct);
- ((void)inStructSize);
- if ((fProvider == NULL) || (isInactive()))
- {
- return kIOReturnNotAttached;
- }
-
-#ifdef DEBUG_KEXT
- IOLog("DirectHW: Write %ld bytes at IO address %lx (value=%lx)\n",
- (long)inStruct->width, (unsigned long)inStruct->offset, (unsigned long)inStruct->data);
-#endif /* DEBUG_KEXT */
-
- switch (inStruct->width)
- {
- case 1:
- outb(inStruct->offset, (unsigned char)inStruct->data);
- break;
-
- case 2:
- outw(inStruct->offset, (unsigned short)inStruct->data);
- break;
-
- case 4:
- outl(inStruct->offset, (unsigned int)inStruct->data);
- break;
-
-#ifdef __LP64__
- case 8:
- outl(inStruct->offset, (unsigned int)inStruct->data & 0xFFFFFFFF);
- outl(inStruct->offset, (unsigned int)((inStruct->data & 0xFFFFFFFF00000000) >> 32));
-#endif
+#if defined(__i386__) || defined(__x86_64__)
+ if (
+ (inStructSize != sizeof(iomem_t) && inStructSize != sizeof(iomem64_t))
+ || !outStructSize
+ || *outStructSize != inStructSize
+ ) {
+ return kIOReturnBadArgument;
+ }
- default:
- IOLog("DirectHW: Invalid write attempt %ld bytes at IO address %lx\n",
- (long)inStruct->width, (unsigned long)inStruct->offset);
- }
+ if ((fProvider == NULL) || (isInactive())) {
+ return kIOReturnNotAttached;
+ }
- if (outStructSize != NULL)
- {
- *outStructSize = sizeof(iomem_t);
+ if (inStructSize == sizeof(iomem_t)) {
+ if (fCrossEndian) {
+ inStruct->offset = OSSwapInt32(inStruct->offset);
+ inStruct->width = OSSwapInt32(inStruct->width);
+ switch (inStruct->width) {
+ case 2: *(UInt16*)(&inStruct->data) = OSSwapInt16(*(UInt16*)(&inStruct->data)); break;
+ case 4: *(UInt32*)(&inStruct->data) = OSSwapInt32(*(UInt32*)(&inStruct->data)); break;
+ }
+ }
+
+ #ifdef DEBUG_KEXT
+ DOLOG("DirectHW: Write %ld bytes at IO address %lx (value=%lx)\n",
+ (long)inStruct->width, (unsigned long)inStruct->offset, (unsigned long)inStruct->data);
+ #endif
+
+ switch (inStruct->width) {
+ case 1: outb(inStruct->offset, *(UInt8*)(&inStruct->data)); break;
+ case 2: outw(inStruct->offset, *(UInt16*)(&inStruct->data)); break;
+ case 4: {
+ unsigned int val = (unsigned int)inStruct->data;
+ outl(inStruct->offset, val);
+ } break;
+ default:
+ DOLOG("DirectHW: Invalid write attempt %ld bytes at IO address %lx\n",
+ (long)inStruct->width, (unsigned long)inStruct->offset);
+ return kIOReturnBadArgument;
+ }
+ }
+ else {
+ iomem64_t *inStruct64 = (iomem64_t*)inStruct;
+
+ if (fCrossEndian) {
+ inStruct64->offset = OSSwapInt64(inStruct64->offset);
+ inStruct64->width = OSSwapInt64(inStruct64->width);
+ switch (inStruct64->width) {
+ case 2: *(UInt16*)(&inStruct64->data) = OSSwapInt16(*(UInt16*)(&inStruct64->data)); break;
+ case 4: *(UInt32*)(&inStruct64->data) = OSSwapInt32(*(UInt32*)(&inStruct64->data)); break;
+ case 8: *(UInt64*)(&inStruct64->data) = OSSwapInt64(*(UInt64*)(&inStruct64->data)); break;
+ }
+ }
+
+ #ifdef DEBUG_KEXT
+ DOLOG("DirectHW: Write %ld bytes at IO address %lx (value=%lx)\n",
+ (long)inStruct64->width, (unsigned long)inStruct64->offset, (unsigned long)inStruct64->data);
+ #endif
+
+ switch (inStruct64->width) {
+ case 1: outb(inStruct64->offset, (unsigned char)inStruct64->data); break;
+ case 2: outw(inStruct64->offset, (unsigned short)inStruct64->data); break;
+ case 4: {
+ unsigned int val = (unsigned int)inStruct64->data;
+ outl(inStruct64->offset, val);
+ } break;
+ case 8: {
+ unsigned int val = (unsigned int)((UInt32)inStruct64->data);
+ unsigned int val2 = (unsigned int)(inStruct64->data >> 32);
+ outl(inStruct64->offset, val);
+ outl(inStruct64->offset + 4, val2);
+ } break;
+ default:
+ DOLOG("DirectHW: Invalid write attempt %ld bytes at IO address %lx\n",
+ (long)inStruct64->width, (unsigned long)inStruct64->offset);
+ return kIOReturnBadArgument;
+ }
}
+#else
+ ((void)inStruct);
+ ((void)inStructSize);
+ ((void)outStructSize);
+ return kIOReturnBadArgument;
+#endif
- return kIOReturnSuccess;
+ return kIOReturnSuccess;
}
IOReturn
@@ -311,7 +579,6 @@ DirectHWUserClient::PrepareMapAsync(OSAsyncReference asyncRef,
IOByteCount *outStructSize)
{
((void)asyncRef);
-
return PrepareMap(inStruct, outStruct, inStructSize, outStructSize);
}
@@ -320,44 +587,66 @@ DirectHWUserClient::PrepareMap(map_t *inStruct, map_t *outStruct,
IOByteCount inStructSize,
IOByteCount *outStructSize)
{
+ if (
+ (inStructSize != sizeof(map_t) && inStructSize != sizeof(map32_t))
+ || !outStructSize
+ || *outStructSize != inStructSize
+ ) {
+ return kIOReturnBadArgument;
+ }
+
((void)outStruct);
((void)inStructSize);
- if ((fProvider == NULL) || (isInactive()))
- {
- return kIOReturnNotAttached;
- }
-
- if ((LastMapAddr != 0) || (LastMapSize != 0))
- {
- return kIOReturnNotOpen;
+ if ((fProvider == NULL) || (isInactive())) {
+ return kIOReturnNotAttached;
}
- LastMapAddr = inStruct->addr;
- LastMapSize = inStruct->size;
-
-#ifdef DEBUG_KEXT
- IOLog("DirectHW: PrepareMap 0x%16lx[0x%lx]\n", (unsigned long)LastMapAddr, (unsigned long)LastMapSize);
-#endif /* DEBUG_KEXT */
+ if ((LastMapAddr != 0) || (LastMapSize != 0)) {
+ return kIOReturnNotOpen;
+ }
- if (outStructSize != NULL)
- {
- *outStructSize = sizeof(map_t);
+ if (inStructSize == sizeof(map_t)) {
+ if (fCrossEndian) {
+ inStruct->addr = OSSwapInt64(inStruct->addr);
+ inStruct->size = OSSwapInt64(inStruct->size);
+ }
+ LastMapAddr = inStruct->addr;
+ LastMapSize = inStruct->size;
+ }
+ else {
+ map32_t *inStruct32 = (map32_t *)inStruct;
+ if (fCrossEndian) {
+ inStruct32->addr = OSSwapInt32(inStruct32->addr);
+ inStruct32->size = OSSwapInt32(inStruct32->size);
+ }
+ LastMapAddr = inStruct32->addr;
+ LastMapSize = inStruct32->size;
}
- return kIOReturnSuccess;
+ #ifdef DEBUG_KEXT
+ DOLOG("DirectHW: PrepareMap 0x%16lx[0x%lx]\n", (unsigned long)LastMapAddr, (unsigned long)LastMapSize);
+ #endif
+
+ return kIOReturnSuccess;
}
inline void
DirectHWUserClient::cpuid(uint32_t op1, uint32_t op2, uint32_t *data)
{
- asm("cpuid"
- : "=a" (data[0]),
- "=b" (data[1]),
- "=c" (data[2]),
- "=d" (data[3])
- : "a"(op1),
- "c"(op2));
+#if defined(__i386__) || defined(__x86_64__)
+ asm("cpuid"
+ : "=a" (data[0]),
+ "=b" (data[1]),
+ "=c" (data[2]),
+ "=d" (data[3])
+ : "a"(op1),
+ "c"(op2));
+#else
+ ((void)op1);
+ ((void)op2);
+ data[0] = data[1] = data[2] = data[3] = 0;
+#endif
}
static inline uint64_t
@@ -365,83 +654,128 @@ rdmsr64(uint32_t msr)
{
uint32_t lo = 0;
uint32_t hi = 0;
- uint64_t val = 0;
+ uint64_t val;
+#if defined(__i386__) || defined(__x86_64__)
rdmsr(msr, lo, hi);
+#else
+ ((void)msr);
+#endif
val = (((uint64_t)hi) << 32) | ((uint64_t)lo);
-#ifdef DEBUG_KEXT
- printf("rdmsr64(0x%.16lX) => %.16llX\n", (unsigned long)msr, (unsigned long long)val);
-#endif /* DEBUG_KEXT */
+ #ifdef DEBUG_KEXT
+ DOLOG("DirectHW: rdmsr64(0x%.16lX) => %.16llX\n", (unsigned long)msr, (unsigned long long)val);
+ #endif
return val;
}
static inline void wrmsr64(UInt32 msr, UInt64 val)
{
- UInt32 lo = ((UInt32)(val & 0xFFFFFFFF));
- UInt32 hi = ((UInt32)((val & 0xFFFFFFFF00000000) >> 32));
+ UInt32 lo = (UInt32)val;
+ UInt32 hi = (UInt32)(val >> 32);
-#ifdef DEBUG_KEXT
- printf("wrmsr64(0x%.16lX, %.16llX)\n", (unsigned long)msr, (unsigned long long)val);
-#endif /* DEBUG_KEXT */
+ #ifdef DEBUG_KEXT
+ DOLOG("DirectHW: wrmsr64(0x%.16lX, %.16llX)\n", (unsigned long)msr, (unsigned long long)val);
+ #endif
+#if defined(__i386__) || defined(__x86_64__)
wrmsr(msr, lo, hi);
+#else
+ ((void)msr);
+ ((void)lo);
+ ((void)hi);
+#endif
+}
+
+void
+DirectHWUserClient::CPUIDHelperFunction(void *data)
+{
+ CPUIDHelper * cpuData = (CPUIDHelper *)data;
+ cpuData->out->core = (UInt32)-1;
+ if (cpuData->in->core != cpu_number())
+ return;
+ cpuid(cpuData->in->eax, cpuData->in->ecx, cpuData->out->cpudata);
+ cpuData->out->eax = cpuData->in->eax;
+ cpuData->out->ecx = cpuData->in->ecx;
+ cpuData->out->core = cpuData->in->core;
+}
+
+void
+DirectHWUserClient::ReadMemHelperFunction(void *data)
+{
+ ReadMemHelper * memData = (ReadMemHelper *)data;
+ memData->out->core = (UInt32)-1;
+ if (memData->in->core != cpu_number())
+ return;
+ uint32_t out;
+#if defined(__i386__) || defined(__x86_64__)
+ uint64_t addr = memData->in->addr;
+ __asm__ __volatile__ (
+ "mov %1,%%eax\n"
+ "mov %%eax, %0\n"
+ : "=m" (out)
+ : "m" (addr)
+ : "%eax"
+ );
+#else
+ out = 0;
+#endif
+ memData->out->data = out;
+ memData->out->core = memData->in->core;
}
void
DirectHWUserClient::MSRHelperFunction(void *data)
{
- MSRHelper *MSRData = (MSRHelper *)data;
- msrcmd_t *inStruct = MSRData->in;
- msrcmd_t *outStruct = MSRData->out;
+ MSRHelper *MSRData = (MSRHelper *)data;
+ msrcmd_t *inStruct = MSRData->in;
+ msrcmd_t *outStruct = MSRData->out;
- outStruct->core = ((UInt32)-1);
+ outStruct->core = ((UInt32)-1);
- outStruct->val.io32.lo = INVALID_MSR_LO;
- outStruct->val.io32.hi = INVALID_MSR_HI;
+ outStruct->lo = INVALID_MSR_LO;
+ outStruct->hi = INVALID_MSR_HI;
- uint32_t cpuiddata[4];
+ uint32_t cpuiddata[4];
- cpuid(1, 0, cpuiddata);
+ cpuid(1, 0, cpuiddata);
- //bool have_ht = ((cpuiddata[3] & (1 << 28)) != 0);
+ //bool have_ht = ((cpuiddata[3] & (1 << 28)) != 0);
- uint32_t core_id = cpuiddata[1] >> 24;
+ uint32_t core_id = cpuiddata[1] >> 24;
- cpuid(11, 0, cpuiddata);
+ cpuid(11, 0, cpuiddata);
- uint32_t smt_mask = ~((-1) << (cpuiddata[0] &0x1f));
+ uint32_t smt_mask = ~((-1) << (cpuiddata[0] &0x1f));
- // TODO: What we want is this:
- // if (inStruct->core != cpu_to_core(cpu_number()))
- // return;
+ // TODO: What we want is this:
+ // if (inStruct->core != cpu_to_core(cpu_number()))
+ // return;
- if ((core_id & smt_mask) != core_id)
- {
- return; // It's a HT thread
+ if ((core_id & smt_mask) != core_id) {
+ return; // It's a HT thread
}
- if (inStruct->core != cpu_number())
- {
- return;
+ if (inStruct->core != cpu_number()) {
+ return;
}
- IOLog("DirectHW: ReadMSRHelper %ld %ld %lx \n",
+ DOLOG("DirectHW: ReadMSRHelper %ld %ld %lx\n",
(long)inStruct->core, (long)cpu_number(), (unsigned long)smt_mask);
- if (MSRData->Read)
- {
+ if (MSRData->Read) {
uint64_t ret = rdmsr64(inStruct->index);
+ outStruct->lo = (uint32_t)ret;
+ outStruct->hi = (uint32_t)(ret >> 32);
+ }
+ else {
+ wrmsr64(inStruct->index, ((uint64_t)inStruct->hi << 32) | inStruct->lo);
+ }
- outStruct->val.io64 = ret;
- } else {
- wrmsr64(inStruct->index, inStruct->val.io64);
- }
-
- outStruct->index = inStruct->index;
- outStruct->core = inStruct->core;
+ outStruct->index = inStruct->index;
+ outStruct->core = inStruct->core;
}
IOReturn
@@ -451,8 +785,7 @@ DirectHWUserClient::ReadMSRAsync(OSAsyncReference asyncRef,
IOByteCount *outStructSize)
{
((void)asyncRef);
-
- return DirectHWUserClient::ReadMSR(inStruct, outStruct, inStructSize, outStructSize);
+ return ReadMSR(inStruct, outStruct, inStructSize, outStructSize);
}
IOReturn
@@ -462,35 +795,45 @@ DirectHWUserClient::ReadMSR(msrcmd_t *inStruct, msrcmd_t *outStruct,
{
((void)inStructSize);
- if ((fProvider == NULL) || (isInactive()))
- {
- return kIOReturnNotAttached;
- }
+ if ((fProvider == NULL) || (isInactive())) {
+ return kIOReturnNotAttached;
+ }
- MSRHelper MSRData = { inStruct, outStruct, true };
+ if (fCrossEndian) {
+ inStruct->core = OSSwapInt32(inStruct->core);
+ inStruct->index = OSSwapInt32(inStruct->index);
+ inStruct->lo = OSSwapInt32(inStruct->lo);
+ inStruct->hi = OSSwapInt32(inStruct->hi);
+ }
-#ifdef USE_MP_RENDEZVOUS
- mp_rendezvous(NULL, (void (*)(void *))MSRHelperFunction, NULL, (void *)&MSRData);
-#else /* !USE_MP_RENDEZVOUS */
- mp_rendezvous_no_intrs((void (*)(void *))MSRHelperFunction, (void *)&MSRData);
-#endif /* USE_MP_RENDEZVOUS */
+ MSRHelper MSRData = { inStruct, outStruct, true };
- if (outStructSize != NULL)
- {
+ #ifdef USE_MP_RENDEZVOUS
+ mp_rendezvous(NULL, (void (*)(void *))MSRHelperFunction, NULL, (void *)&MSRData);
+ #else
+ mp_rendezvous_no_intrs((void (*)(void *))MSRHelperFunction, (void *)&MSRData);
+ #endif
+
+ if (outStructSize != NULL) {
*outStructSize = sizeof(msrcmd_t);
}
- if (outStruct->core != inStruct->core)
- {
- return kIOReturnIOError;
+ if (outStruct->core != inStruct->core) {
+ return kIOReturnIOError;
}
-#ifdef DEBUG_KEXT
- IOLog("DirectHW: ReadMSR(0x%16lx) => 0x%16llx\n",
- (unsigned long)inStruct->index, (unsigned long long)outStruct->val.io64);
-#endif /* DEBUG_KEXT */
+ #ifdef DEBUG_KEXT
+ DOLOG("DirectHW: ReadMSR(0x%16lx) => 0x%8lx%08lx\n",
+ (unsigned long)inStruct->index, (unsigned long)outStruct->hi, (unsigned long)outStruct->lo);
+ #endif
- return kIOReturnSuccess;
+ if (fCrossEndian) {
+ outStruct->core = OSSwapInt32(outStruct->core);
+ outStruct->index = OSSwapInt32(outStruct->index);
+ outStruct->lo = OSSwapInt32(outStruct->lo);
+ outStruct->hi = OSSwapInt32(outStruct->hi);
+ }
+ return kIOReturnSuccess;
}
IOReturn
@@ -500,8 +843,7 @@ DirectHWUserClient::WriteMSRAsync(OSAsyncReference asyncRef,
IOByteCount *outStructSize)
{
((void)asyncRef);
-
- return DirectHWUserClient::WriteMSR(inStruct, outStruct, inStructSize, outStructSize);
+ return WriteMSR(inStruct, outStruct, inStructSize, outStructSize);
}
IOReturn
@@ -511,93 +853,1204 @@ DirectHWUserClient::WriteMSR(msrcmd_t *inStruct, msrcmd_t *outStruct,
{
((void)inStructSize);
- if ((fProvider == NULL) || (isInactive()))
- {
- return kIOReturnNotAttached;
- }
+ if ((fProvider == NULL) || (isInactive())) {
+ return kIOReturnNotAttached;
+ }
-#ifdef DEBUG_KEXT
- IOLog("DirectHW: WriteMSR(0x%16lx) = 0x%16llx\n",
- (unsigned long)inStruct->index, (unsigned long long)inStruct->val.io64);
-#endif /* DEBUG_KEXT */
+ if (fCrossEndian) {
+ inStruct->core = OSSwapInt32(inStruct->core);
+ inStruct->index = OSSwapInt32(inStruct->index);
+ inStruct->lo = OSSwapInt32(inStruct->lo);
+ inStruct->hi = OSSwapInt32(inStruct->hi);
+ }
- MSRHelper MSRData = { inStruct, outStruct, false };
+ #ifdef DEBUG_KEXT
+ DOLOG("DirectHW: WriteMSR(0x%16lx) = 0x%8lx%08lx\n",
+ (unsigned long)inStruct->index, (unsigned long)inStruct->hi, (unsigned long)inStruct->lo);
+ #endif
-#ifdef USE_MP_RENDEZVOUS
- mp_rendezvous(NULL, (void (*)(void *))MSRHelperFunction, NULL, (void *)&MSRData);
-#else /* !USE_MP_RENDEZVOUS */
- mp_rendezvous_no_intrs((void (*)(void *))MSRHelperFunction, (void *)&MSRData);
-#endif /* USE_MP_RENDEZVOUS */
+ MSRHelper MSRData = { inStruct, outStruct, false };
- if (outStructSize != NULL)
- {
+ #ifdef USE_MP_RENDEZVOUS
+ mp_rendezvous(NULL, (void (*)(void *))MSRHelperFunction, NULL, (void *)&MSRData);
+ #else
+ mp_rendezvous_no_intrs((void (*)(void *))MSRHelperFunction, (void *)&MSRData);
+ #endif
+
+ if (outStructSize != NULL) {
*outStructSize = sizeof(msrcmd_t);
}
- if (outStruct->core != inStruct->core)
- {
- return kIOReturnIOError;
+ if (outStruct->core != inStruct->core) {
+ return kIOReturnIOError;
+ }
+
+ if (fCrossEndian) {
+ outStruct->core = OSSwapInt32(outStruct->core);
+ outStruct->index = OSSwapInt32(outStruct->index);
+ outStruct->lo = OSSwapInt32(outStruct->lo);
+ outStruct->hi = OSSwapInt32(outStruct->hi);
+ }
+ return kIOReturnSuccess;
+}
+
+IOReturn
+DirectHWUserClient::ReadCpuIdAsync(OSAsyncReference asyncRef,
+ cpuid_t * inStruct, cpuid_t * outStruct,
+ IOByteCount inStructSize,
+ IOByteCount * outStructSize)
+{
+ ((void)asyncRef);
+ return ReadCpuId(inStruct, outStruct, inStructSize, outStructSize);
+}
+
+IOReturn
+DirectHWUserClient::ReadCpuId(cpuid_t * inStruct, cpuid_t * outStruct,
+ IOByteCount inStructSize,
+ IOByteCount * outStructSize)
+{
+ ((void)inStructSize);
+
+ if (fProvider == NULL || isInactive()) {
+ return kIOReturnNotAttached;
+ }
+
+ if (fCrossEndian) {
+ inStruct->core = OSSwapInt32(inStruct->core);
+ inStruct->eax = OSSwapInt32(inStruct->eax);
+ inStruct->ecx = OSSwapInt32(inStruct->ecx);
+ }
+
+ CPUIDHelper cpuidData = { inStruct, outStruct};
+ mp_rendezvous(NULL, (void (*)(void *))CPUIDHelperFunction, NULL,
+ (void *)&cpuidData);
+
+ if (outStructSize != NULL) {
+ *outStructSize = sizeof(cpuid_t);
+ }
+
+ if (outStruct->core != inStruct->core)
+ return kIOReturnIOError;
+
+ if (fCrossEndian) {
+ outStruct->core = OSSwapInt32(outStruct->core);
+ outStruct->eax = OSSwapInt32(outStruct->eax);
+ outStruct->ecx = OSSwapInt32(outStruct->ecx);
+ outStruct->cpudata[0] = OSSwapInt32(outStruct->cpudata[0]);
+ outStruct->cpudata[1] = OSSwapInt32(outStruct->cpudata[1]);
+ outStruct->cpudata[2] = OSSwapInt32(outStruct->cpudata[2]);
+ outStruct->cpudata[3] = OSSwapInt32(outStruct->cpudata[3]);
+ }
+ return kIOReturnSuccess;
+}
+
+IOReturn
+DirectHWUserClient::ReadMemAsync(OSAsyncReference asyncRef,
+ readmem_t * inStruct, readmem_t * outStruct,
+ IOByteCount inStructSize,
+ IOByteCount * outStructSize)
+{
+ ((void)asyncRef);
+ return ReadMem(inStruct, outStruct, inStructSize, outStructSize);
+}
+
+IOReturn
+DirectHWUserClient::ReadMem(readmem_t * inStruct, readmem_t * outStruct,
+ IOByteCount inStructSize,
+ IOByteCount * outStructSize)
+{
+ ((void)inStructSize);
+
+ if (fProvider == NULL || isInactive()) {
+ return kIOReturnNotAttached;
+ }
+
+ if (fCrossEndian) {
+ inStruct->core = OSSwapInt32(inStruct->core);
+ inStruct->addr = OSSwapInt64(inStruct->addr);
+ }
+
+ if (cpu_number() != inStruct->core)
+ return kIOReturnIOError;
+ outStruct->core = inStruct->core;
+ ReadMemHelper memData = { inStruct, outStruct };
+ mp_rendezvous(NULL, (void (*)(void *))ReadMemHelperFunction, NULL, (void *)&memData);
+
+ if (outStructSize != NULL) {
+ *outStructSize = sizeof(readmem_t);
+ }
+
+ if (outStruct->core != inStruct->core)
+ return kIOReturnIOError;
+
+ if (fCrossEndian) {
+ outStruct->core = OSSwapInt32(outStruct->core);
+ outStruct->addr = OSSwapInt64(outStruct->addr);
+ outStruct->data = OSSwapInt32(outStruct->data);
+ }
+ return kIOReturnSuccess;
+}
+
+IOReturn
+DirectHWUserClient::Read(Parameters * inStruct, Parameters * outStruct,
+ IOByteCount inStructSize,
+ IOByteCount * outStructSize)
+{
+ return ReadWrite(kRead, inStruct, outStruct, inStructSize, outStructSize);
+}
+
+IOReturn
+DirectHWUserClient::ReadAsync(
+ OSAsyncReference asyncRef,
+ Parameters * inStruct, Parameters * outStruct,
+ IOByteCount inStructSize,
+ IOByteCount * outStructSize)
+{
+ ((void)asyncRef);
+ return ReadWrite(kRead, inStruct, outStruct, inStructSize, outStructSize);
+}
+
+IOReturn
+DirectHWUserClient::Write(Parameters * inStruct, Parameters * outStruct,
+ IOByteCount inStructSize,
+ IOByteCount * outStructSize)
+{
+ return ReadWrite(kWrite, inStruct, outStruct, inStructSize, outStructSize);
+}
+
+IOReturn
+DirectHWUserClient::WriteAsync(
+ OSAsyncReference asyncRef,
+ Parameters * inStruct, Parameters * outStruct,
+ IOByteCount inStructSize,
+ IOByteCount * outStructSize)
+{
+ ((void)asyncRef);
+ return ReadWrite(kWrite, inStruct, outStruct, inStructSize, outStructSize);
+}
+
+static int pciHostBridgeCount = -1;
+static IOPCIBridge * pciHostBridges[10] = {0,0,0,0,0,0,0,0,0,0};
+
+#ifdef __ppc__
+static UInt32 pciHostFlags[10] = {0,0,0,0,0,0,0,0,0,0};
+enum {
+ pciHostEndianChecked = 1,
+ pciHostEndianSwap = 2,
+};
+#endif
+
+void
+DirectHWUserClient::GetPciHostBridges1(IOService *service, OSIterator *services)
+{
+ while (service) {
+ IOPCIBridge *pciBridge = OSDynamicCast(IOPCIBridge, service);
+ if (pciBridge) {
+ DOLOG("DirectHW: Found PCI host %d: %s\n", pciHostBridgeCount, pciBridge->getName());
+ pciHostBridges[pciHostBridgeCount++] = pciBridge;
+ }
+ else {
+ OSIterator *children = service->getChildIterator(gIOServicePlane);
+ IOService *child = OSDynamicCast(IOService, children->getNextObject());
+ GetPciHostBridges1(child, children);
+ children->release();
+ }
+ if (!services) {
+ break;
+ }
+ service = OSDynamicCast(IOService, services->getNextObject());
+ }
+}
+
+void
+DirectHWUserClient::GetPciHostBridges(void)
+{
+ //DOLOG("[ DirectHW: GetPciHostBridges %d\n", pciHostBridgeCount);
+ if (pciHostBridgeCount < 0) {
+ pciHostBridgeCount = 0;
+ IOService *device = getServiceRoot();
+ GetPciHostBridges1(device, NULL);
+ }
+ //DOLOG("] DirectHW: GetPciHostBridges %d\n", pciHostBridgeCount);
+}
+
+IOPCIDevice *
+DirectHWUserClient::FindMatching(IOService *service, IOPCIAddressSpace space, OSIterator *services)
+{
+ while (service) {
+ IOPCIDevice *pciDevice;
+ IOPCIBridge *pciBridge = NULL;
+
+ pciDevice = OSDynamicCast(IOPCIDevice, service);
+ if (pciDevice) {
+ IOPCIAddressSpace regSpace;
+ regSpace.bits = 0;
+ regSpace.s.busNum = pciDevice->getBusNumber();
+ regSpace.s.deviceNum = pciDevice->getDeviceNumber();
+ regSpace.s.functionNum = pciDevice->getFunctionNumber();
+ if (regSpace.bits == space.bits) {
+ //DOLOG("DirectHW: PCIDevice %s\n", pciDevice->getName());
+ pciDevice->retain();
+ return pciDevice;
+ }
+ }
+ else {
+ pciBridge = OSDynamicCast(IOPCIBridge, service);
+ }
+
+ if (pciDevice || pciBridge) {
+ OSIterator *children = service->getChildIterator(gIOServicePlane);
+ IOService *child = OSDynamicCast(IOService, children->getNextObject());
+ pciDevice = FindMatching(child, space, children);
+ children->release();
+
+ if (pciDevice) {
+ return pciDevice;
+ }
+ }
+
+ if (!services) {
+ break;
+ }
+ service = OSDynamicCast(IOService, services->getNextObject());
+ }
+ return NULL;
+}
+
+IOReturn
+DirectHWUserClient::ReadWrite(
+ uint32_t selector,
+ Parameters * inStruct, Parameters * outStruct,
+ IOByteCount inStructSize,
+ IOByteCount * outStructSize)
+{
+ IOReturn ret = kIOReturnBadArgument;
+ Parameters * params;
+ IOMemoryDescriptor * md;
+ IOMemoryMap * map;
+ void * vmaddr;
+ IOPCIBridge * owner = NULL;
+
+ if (inStructSize != sizeof(Parameters)) return (kIOReturnBadArgument);
+ if (outStructSize != NULL) {
+ *outStructSize = sizeof(Parameters);
+ }
+
+ bcopy(inStruct, outStruct, sizeof(Parameters));
+ params = outStruct;
+
+ if (fCrossEndian) {
+ params->options = OSSwapInt32(params->options);
+ params->spaceType = OSSwapInt32(params->spaceType);
+ params->bitWidth = OSSwapInt32(params->bitWidth);
+ params->_resv = OSSwapInt32(params->_resv);
+ if (kConfigSpace == params->spaceType) {
+ Address address;
+ address.addr64 = OSSwapInt64(params->address.addr64);
+ params->address.pci.offset = address.pciswapped.offset;
+ params->address.pci.function = address.pciswapped.function;
+ params->address.pci.device = address.pciswapped.device;
+ params->address.pci.bus = address.pciswapped.bus;
+ params->address.pci.segment = address.pciswapped.segment;
+ params->address.pci.reserved = address.pciswapped.reserved;
+ }
+ else {
+ params->address.addr64 = OSSwapInt64(params->address.addr64);
+ }
+ }
+
+ map = 0;
+ vmaddr = 0;
+ unsigned int offset = 0;
+ IOPCIAddressSpace space;
+ bool doSwap = false;
+ bool doSkip = false;
+ IOPCIDevice *pciDevice = NULL;
+
+ if (k64BitMemorySpace == params->spaceType) {
+ #if !(defined(__ppc__) && defined(KPI_10_4_0_PPC_COMPAT))
+ md = IOMemoryDescriptor::withAddressRange(params->address.addr64, (params->bitWidth >> 3), kIODirectionOutIn | kIOMemoryMapperNone, kernel_task);
+ #else
+ md = IOMemoryDescriptor::withAddress((void*)params->address.addr64, (params->bitWidth >> 3), kIODirectionOutIn);
+ #endif
+ if (md) {
+ map = md->map();
+ md->release();
+ }
+ if (!map) return (kIOReturnVMError);
+ vmaddr = (void *)map->getAddress();
+ }
+ else if (kConfigSpace == params->spaceType) {
+ GetPciHostBridges();
+
+/*
+ DOLOG("DirectHW: %s %04x:%02x:%02x.%01x @%02x = %llx\n",
+ selector == kRead ? "Read" : selector == kWrite ? "Write" : "Unknown",
+ params->address.pci.segment,
+ params->address.pci.bus,
+ params->address.pci.device,
+ params->address.pci.function,
+ params->address.pci.offset,
+ params->value
+ );
+*/
+
+ if (params->address.pci.segment < pciHostBridgeCount) {
+ owner = pciHostBridges[params->address.pci.segment];
+ }
+ if (!owner) {
+ DOLOG("DirectHW: %s owner not found for %04x:%02x:%02x.%01x\n",
+ selector == kRead ? "Read" : selector == kWrite ? "Write" : "Uknown",
+ params->address.pci.segment,
+ params->address.pci.bus,
+ params->address.pci.device,
+ params->address.pci.function
+ );
+ return (kIOReturnBadArgument);
+ }
+ else {
+ //DOLOG("DirectHW: Using PCI host: %s\n", owner->getName());
+ }
+
+ space.bits = 0;
+ offset = params->address.pci.offset;
+ space.s.busNum = params->address.pci.bus;
+ space.s.deviceNum = params->address.pci.device;
+ space.s.functionNum = params->address.pci.function;
+
+#ifdef __ppc__
+ if (space.s.busNum) {
+ pciDevice = FindMatching(owner, space, NULL);
+ if (pciDevice) {
+ if (
+ (params->address.pci.offset & 0xff) >= 0x50 &&
+ (params->address.pci.offset & 0xff) < 0x54
+ ) {
+ OSData *data;
+ UInt16 vendor;
+ UInt16 product;
+ if ((data = OSDynamicCast(OSData, pciDevice->getProperty("vendor-id")))) {
+ vendor = *((UInt32 *) data->getBytesNoCopy());
+ if (vendor == 0x1191) {
+ if ((data = OSDynamicCast(OSData, pciDevice->getProperty("device-id")))) {
+ product = *((UInt32 *) data->getBytesNoCopy());
+ if (product == 0x0009) {
+ // 01:04.0 SCSI storage controller [0100]: Artop Electronic Corp ATP865 [1191:0009] (rev 03)
+ DOLOG("DirectHW: skip read of 1191:0009 @%02x\n", params->address.pci.offset);
+ doSkip = true;
+ } // if product
+ } // if data
+ } // if vendor
+ } // if data
+ } // if offset
+ } // if pcidevice
+ else {
+ // DEC bridge of B&W G3 causes machine check for non-existing devices
+ //DOLOG("DirectHW: PCI device doesn't exist\n");
+ doSkip = true;
+ }
+ }
+ else if (
+ space.s.deviceNum == 0
+ && space.s.functionNum == 0
+ ) {
+ if (!(pciHostFlags[params->address.pci.segment] & pciHostEndianChecked)) {
+ //DOLOG("DirectHW: Checking endianness of PCI host: %s\n", owner->getName());
+ if (owner->configRead32(space, kIOPCIConfigVendorID) == 0x6b107400) {
+ DOLOG("DirectHW: U4 HT Bridge needs endian swapping.\n");
+ pciHostFlags[params->address.pci.segment] |= pciHostEndianSwap;
+ }
+ pciHostFlags[params->address.pci.segment] |= pciHostEndianChecked;
+ }
+ if (pciHostFlags[params->address.pci.segment] & pciHostEndianSwap) {
+ doSwap = true;
+ //DOLOG("DirectHW: changing offset from %x", offset);
+ switch ((params->bitWidth << 4) | (offset & 3)) {
+ case 0x80: offset = (offset & ~3) | 3; break;
+ case 0x81: offset = (offset & ~3) | 2; break;
+ case 0x82: offset = (offset & ~3) | 1; break;
+ case 0x83: offset = (offset & ~3) | 0; break;
+ case 0x100: offset = (offset & ~3) | 2; break;
+ case 0x102: offset = (offset & ~3) | 0; break;
+ }
+ //DOLOG(" to %x\n", offset);
+ }
+ }
+#endif
+
+#if MAC_OS_X_VERSION_SDK >= MAC_OS_X_VERSION_10_4
+ space.es.registerNumExtended = (0xF & (offset >> 8));
+#endif
+ }
+
+ switch (selector) {
+ case kWrite:
+
+ if (fCrossEndian) {
+ params->value = OSSwapInt64(params->value);
+ }
+
+ if (k64BitMemorySpace == params->spaceType) {
+ switch (params->bitWidth) {
+ case 8:
+ *((uint8_t *) vmaddr) = params->value;
+ ret = kIOReturnSuccess;
+ break;
+ case 16:
+ *((uint16_t *) vmaddr) = params->value;
+ ret = kIOReturnSuccess;
+ break;
+ case 32:
+ *((uint32_t *) vmaddr) = static_cast(params->value);
+ ret = kIOReturnSuccess;
+ break;
+ case 64:
+ *((uint64_t *) vmaddr) = params->value;
+ ret = kIOReturnSuccess;
+ break;
+ default:
+ break;
+ }
+ }
+ else if (kConfigSpace == params->spaceType) {
+ switch (params->bitWidth) {
+ case 8:
+ //DOLOG("DirectHW: Do write 8 bits (0x%02llx) using PCI host: %s\n", params->value, owner->getName());
+ if (!doSkip) owner->configWrite8(space, offset, params->value);
+ ret = kIOReturnSuccess;
+ break;
+ case 16:
+ //DOLOG("DirectHW: Do write 16 bits (0x%04llx) using PCI host: %s\n", params->value, owner->getName());
+ if (!doSkip) owner->configWrite16(space, offset, params->value);
+ ret = kIOReturnSuccess;
+ break;
+ case 32:
+ //DOLOG("DirectHW: Do write 32 bits (0x%08llx) using PCI host: %s\n", params->value, owner->getName());
+ if (!doSkip) owner->configWrite32(space, offset, static_cast(params->value));
+ ret = kIOReturnSuccess;
+ break;
+ default:
+ break;
+ }
+ }
+ break;
+
+ case kRead:
+
+ if (k64BitMemorySpace == params->spaceType) {
+ switch (params->bitWidth) {
+ case 8:
+ params->value = *((uint8_t *) vmaddr);
+ ret = kIOReturnSuccess;
+ break;
+ case 16:
+ params->value = *((uint16_t *) vmaddr);
+ ret = kIOReturnSuccess;
+ break;
+ case 32:
+ params->value = *((uint32_t *) vmaddr);
+ ret = kIOReturnSuccess;
+ break;
+ case 64:
+ params->value = *((uint64_t *) vmaddr);
+ ret = kIOReturnSuccess;
+ break;
+ default:
+ break;
+ }
+ }
+ else if (kConfigSpace == params->spaceType) {
+ switch (params->bitWidth) {
+ case 8:
+ //DOLOG("DirectHW: Do read 8 using PCI host: %s\n", owner->getName());
+ params->value = doSkip ? (UInt8)-1 : owner->configRead8(space, offset);
+ ret = kIOReturnSuccess;
+ break;
+ case 16:
+ //DOLOG("DirectHW: Do read 16 using PCI host: %s\n", owner->getName());
+ params->value = doSkip ? (UInt16)-1 : doSwap ? OSSwapInt16(owner->configRead16(space, offset)) : owner->configRead16(space, offset);
+ ret = kIOReturnSuccess;
+ break;
+ case 32:
+ //DOLOG("DirectHW: Do read 32 using PCI host: %s\n", owner->getName());
+ params->value = doSkip ? (UInt32)-1 : doSwap ? OSSwapInt32(owner->configRead32(space, offset)) : owner->configRead32(space, offset);
+ ret = kIOReturnSuccess;
+ break;
+ default:
+ break;
+ }
+ }
+
+ if (fCrossEndian) {
+ params->value = OSSwapInt64(params->value);
+ }
+ break;
+
+ default:
+ break;
+ }
+
+ if (pciDevice) {
+ //DOLOG("DirectHW: Done with pciDevice\n");
+ pciDevice->release();
}
- return kIOReturnSuccess;
+ if (map) {
+ DOLOG("DirectHW: Do map release\n");
+ map->release();
+ }
+
+ return (ret);
}
IOReturn DirectHWUserClient::clientMemoryForType(UInt32 type, UInt32 *flags, IOMemoryDescriptor **memory)
{
- IOMemoryDescriptor *newmemory = NULL;
+ IOMemoryDescriptor *newmemory = NULL;
+
+ #ifndef DEBUG_KEXT
+ ((void)flags);
+ #else
+ DOLOG("DirectHW: clientMemoryForType(%lx, %p, %p)\n",
+ (unsigned long)type, (void *)flags, (void *)memory);
+ #endif
+
+ if (type != 0) {
+ DOLOG("DirectHW: Unknown mapping type %lx.\n", (unsigned long)type);
+
+ return kIOReturnUnsupported;
+ }
+
+ if ((LastMapAddr == 0) && (LastMapSize == 0)) {
+ DOLOG("DirectHW: No PrepareMap called.\n");
+
+ return kIOReturnNotAttached;
+ }
+
+ #ifdef DEBUG_KEXT
+ DOLOG("DirectHW: Mapping physical 0x%16lx[0x%lx]\n",
+ (unsigned long)LastMapAddr, (unsigned long)LastMapSize);
+ #endif
+
+ if (memory != NULL) {
+ newmemory = IOMemoryDescriptor::withPhysicalAddress((IOPhysicalAddress)LastMapAddr, (IOByteCount)LastMapSize, kIODirectionIn);
+ }
+
+ /* Reset mapping to zero */
+ LastMapAddr = 0;
+ LastMapSize = 0;
+
+ if (newmemory == NULL) {
+ DOLOG("DirectHW: Could not map memory!\n");
+
+ return kIOReturnNotOpen;
+ }
+
+ newmemory->retain();
+
+ if (memory != NULL) {
+ *memory = newmemory;
+ }
+
+ #ifdef DEBUG_KEXT
+ DOLOG("DirectHW: Mapping succeeded.\n");
+ #endif
+
+ return kIOReturnSuccess;
+}
+
+IOReturn
+DirectHWUserClient::AllocatePhysicalMemoryAsync(OSAsyncReference asyncRef,
+ MemParams * inStruct, MemParams * outStruct,
+ IOByteCount inStructSize,
+ IOByteCount * outStructSize)
+{
+ ((void)asyncRef);
+ return AllocatePhysicalMemory(inStruct, outStruct, inStructSize, outStructSize);
+}
-#ifndef DEBUG_KEXT
- ((void)flags);
+IOReturn
+DirectHWUserClient::UnallocatePhysicalMemoryAsync(OSAsyncReference asyncRef,
+ MemParams * inStruct, MemParams * outStruct,
+ IOByteCount inStructSize,
+ IOByteCount * outStructSize)
+{
+ ((void)asyncRef);
+ return UnallocatePhysicalMemory(inStruct, outStruct, inStructSize, outStructSize);
+}
+
+#define check_memdesc() \
+ do { \
+ if (!memDesc) { \
+ DOLOG("DirectHW: Could not create memory descriptor.\n"); \
+ result = kIOReturnNoResources; \
+ goto bail; \
+ } \
+ if (0) DOLOG("DirectHW: 1 memDesc->getRetainCount:%d\n", memDesc->getRetainCount()); \
+ } while(0)
+
+#define check_memmapkernel() \
+ do { \
+ if (!memMapKernel) { \
+ DOLOG("DirectHW: Could not make mapping in kernel space (memDesc:%p)\n", memDesc); \
+ result = kIOReturnVMError; \
+ goto bail; \
+ } \
+ if (0) DOLOG("DirectHW: 2 memDesc->getRetainCount:%d memMapKernel->getRetainCount:%d\n", memDesc->getRetainCount(), memMapKernel->getRetainCount()); \
+ } while (0)
+
+#define check_memmapuser() \
+ do { \
+ if (!memMapUser) { \
+ DOLOG("DirectHW: Could not make mapping in user space.\n"); \
+ result = kIOReturnVMError; \
+ goto bail; \
+ } \
+ if (0) DOLOG("DirectHW: 3 memDesc->getRetainCount:%d memMapUser->getRetainCount:%d\n", memDesc->getRetainCount(), memMapUser->getRetainCount()); \
+ } while (0)
+
+IOReturn
+DirectHWUserClient::AllocatePhysicalMemory(
+ MemParams * inStruct, MemParams * outStruct,
+ IOByteCount inStructSize,
+ IOByteCount * outStructSize)
+{
+ IOReturn result = kIOReturnSuccess;
+
+ IOMemoryDescriptor* memDesc = NULL;
+ IOMemoryMap* memMapKernel = NULL;
+ IOMemoryMap* memMapUser = NULL;
+ bool isPrepared = false;
+ char key[11];
+ char keyKernel[11];
+ bool isMapKernelInDictionary = false;
+ bool isMapInDictionary = false;
+
+ IOPhysicalSegment* segmentOffsetsArray = NULL;
+ vm_size_t segmentOffsetsSize = 0;
+ IOMemoryDescriptor* segmentsDesc = NULL;
+ IOMemoryMap* segmentsMapUser = NULL;
+ IOMemoryMap* segmentsMapKernel = NULL;
+ char segmentsKey[11];
+ char segmentsKeyKernel[11];
+ bool isSegmentsInDictionary = false;
+ bool isSegmentsKernelInDictionary = false;
+
+ UInt32 kernelMemoryType = kMemoryTypeKernel;
+#if !defined(__ppc__) || !defined(KPI_10_4_0_PPC_COMPAT)
#else
- IOLog("DirectHW: clientMemoryForType(%lx, %p, %p)\n",
- (unsigned long)type, (void *)flags, (void *)memory);
-#endif /* DEBUG_KEXT */
+ void* kernelAddress = NULL;
+#endif
+ UInt64 userAddress = 0;
+
+ if (
+ inStructSize != sizeof(MemParams)
+ || !outStructSize
+ || *outStructSize != inStructSize
+ ) {
+ DOLOG("DirectHW: AllocatePhysicalMemory kIOReturnBadArgument\n");
+ return kIOReturnBadArgument;
+ }
- if (type != 0)
- {
- IOLog("DirectHW: Unknown mapping type %lx.\n", (unsigned long)type);
+ bcopy(inStruct, outStruct, sizeof(MemParams));
+
+ if (fCrossEndian) {
+ outStruct->memoryType = OSSwapInt32(outStruct->memoryType );
+ outStruct->allocOptions = OSSwapInt32(outStruct->allocOptions);
+ outStruct->mapOptions = OSSwapInt32(outStruct->mapOptions );
+ outStruct->physMask = OSSwapInt64(outStruct->physMask );
+ outStruct->size = OSSwapInt64(outStruct->size );
+ outStruct->userAddr = OSSwapInt64(outStruct->userAddr );
+ outStruct->physAddr = OSSwapInt64(outStruct->physAddr );
+ outStruct->kernAddr = OSSwapInt64(outStruct->kernAddr );
+ outStruct->segments = OSSwapInt64(outStruct->segments );
+ }
+ IOOptionBits mapOptions = outStruct->mapOptions;
+ UInt64 bufferSize = outStruct->size;
+ UInt64 wantedUserAddr = outStruct->userAddr;
+ UInt32 memoryType = fNextMemoryType++;
+ if (fNextMemoryType == kMemoryTypeMax)
+ fNextMemoryType = 0;
+
+ if ((outStruct->allocOptions & kAllocTypeMask) == kUsePhys) {
+ DOLOG("[ DirectHW: AllocatePhysicalMemory memoryType:%d allocOptions:0x%x mapOptions:0x%x size:0x%llx physAddr:0x%llx\n",
+ (int)memoryType, (int)outStruct->allocOptions, (int)outStruct->mapOptions, outStruct->size, outStruct->physAddr
+ );
+
+ memDesc = IOMemoryDescriptor::withPhysicalAddress((IOPhysicalAddress)outStruct->physAddr, (IOByteCount)outStruct->size, kIODirectionOutIn);
+
+ if (outStruct->allocOptions & kMapKernel) {
+ memMapKernel = memDesc->map(mapOptions | kIOMapAnywhere);
+ check_memmapkernel();
+ }
+ } else if ((outStruct->allocOptions & kAllocTypeMask) == kUseVirt) {
+ DOLOG("[ DirectHW: AllocatePhysicalMemory memoryType:%d allocOptions:0x%x mapOptions:0x%x size:0x%llx userAddr:0x%llx\n",
+ (int)memoryType, (int)outStruct->allocOptions, (int)outStruct->mapOptions, outStruct->size, outStruct->userAddr
+ );
+ if (!wantedUserAddr) {
+ DOLOG("DirectHW: User memory needs an address.\n");
+ result = kIOReturnBadArgument;
+ goto bail;
+ }
- return kIOReturnUnsupported;
- }
+ userAddress = wantedUserAddr;
+ #if !(defined(__ppc__) && defined(KPI_10_4_0_PPC_COMPAT))
+ memDesc = IOMemoryDescriptor::withAddressRange(userAddress, bufferSize, kIODirectionOutIn, fTask);
+ #else
+ memDesc = IOMemoryDescriptor::withAddress((vm_address_t)userAddress, (IOByteCount)bufferSize, kIODirectionOutIn, fTask);
+ #endif
+ check_memdesc(); // user(memDesc:1)
+ if (outStruct->allocOptions & kMapKernel) {
+ memMapKernel = memDesc->map(mapOptions | kIOMapAnywhere);
+ check_memmapkernel();
+ }
+ } else {
+ DOLOG("[ DirectHW: AllocatePhysicalMemory memoryType:%d allocOptions:0x%x mapOptions:0x%x physMask:%08llx size:0x%llx\n",
+ (int)memoryType, (int)outStruct->allocOptions, (int)outStruct->mapOptions, outStruct->physMask, outStruct->size
+ );
+
+ bufferSize = (bufferSize + page_size - 1) & -page_size; // http://developer.apple.com/qa/qa2001/qa1197.html
+ //DOLOG("DirectHW: bufferSize:0x%llx\n", bufferSize);
+
+ #if !defined(__ppc__) || !defined(KPI_10_4_0_PPC_COMPAT)
+ memDesc = IOBufferMemoryDescriptor::inTaskWithPhysicalMask(kernel_task, kIODirectionOutIn | kIOMemoryPhysicallyContiguous, bufferSize, outStruct->physMask);
+ check_memdesc(); // phys(memDesc:1)
+ //DOLOG("DirectHW: inTaskWithPhysicalMask memDesc:%p\n", memDesc);
+ if (outStruct->allocOptions & kMapKernel) {
+ memMapKernel = memDesc->map(mapOptions | kIOMapAnywhere);
+ check_memmapkernel();
+ }
+ #else
+ kernelMemoryType = kMemoryTypeKernelMalloc;
+ kernelAddress = IOMallocContiguous((vm_size_t)bufferSize, page_size, NULL);
+ if (!kernelAddress) {
+ DOLOG("DirectHW: Could not malloc contiguous memory.\n");
+ result = kIOReturnNoMemory;
+ goto bail;
+ }
+ //DOLOG("DirectHW: IOMallocContiguous kernelAddress:%p\n", kernelAddress);
+
+ IOReturn tempResult = IOSetProcessorCacheMode(kernel_task, (IOVirtualAddress)kernelAddress, (IOByteCount)bufferSize, mapOptions & kIOMapCacheMask);
+ if (tempResult != kIOReturnSuccess)
+ DOLOG("DirectHW: IOSetProcessorCacheMode failed:%08x\n", tempResult);
+
+ bzero(kernelAddress, (size_t)bufferSize);
+
+ memDesc = IOMemoryDescriptor::withAddress(kernelAddress, (IOByteCount)bufferSize, kIODirectionOutIn);
+ check_memdesc(); // phys(memDesc:1)
+
+ if (outStruct->allocOptions & kMapKernel) {
+ memMapKernel = memDesc->setMapping(kernel_task, (IOVirtualAddress)kernelAddress, mapOptions & ~kIOMapAnywhere);
+ check_memmapkernel();
+ }
+ #endif
+ }
- if ((LastMapAddr == 0) && (LastMapSize == 0))
{
- IOLog("DirectHW: No PrepareMap called.\n");
+ //DOLOG("DirectHW: prepare memDesc:%p\n", memDesc);
+ result = memDesc->prepare(); // this is necessary for userspace memory that is not wired; I don’t think it is necessary for memory allocated with IOMalloc*
+ if (result != kIOReturnSuccess) {
+ DOLOG("DirectHW: Could not prepare user memory.\n");
+ goto bail;
+ }
+ isPrepared = true;
+ //DOLOG("DirectHW: 4 memDesc->getRetainCount:%d\n", memDesc->getRetainCount()); // phys(memDesc:1)
+ }
- return kIOReturnNotAttached;
- }
+ if (!((outStruct->allocOptions & kAllocTypeMask) == kUseVirt)) {
+ #ifdef __LP64__
+ //DOLOG("DirectHW: createMappingInTask memDesc:%p ftask:%p mapOptions:%x\n", memDesc, fTask, mapOptions);
+ memMapUser = memDesc->createMappingInTask(fTask, 0, kIOMapDefaultCache | kIOMapAnywhere);
+ #else
+ //DOLOG("DirectHW: map ftask:%p mapOptions:%x\n", fTask, (int)mapOptions);
+ memMapUser = memDesc->map(fTask, 0, mapOptions | kIOMapAnywhere);
+ #endif
+ check_memmapuser(); // phys(memDesc:2 memMapUser:2)
+
+ //DOLOG("DirectHW: memMapUser->getAddress\n");
+ userAddress = memMapUser->getAddress();
+ }
+
+ //DOLOG("DirectHW: memMapUser->getPhysicalSegment\n");
-#ifdef DEBUG_KEXT
- IOLog("DirectHW: Mapping physical 0x%16lx[0x%lx]\n",
- (unsigned long)LastMapAddr, (unsigned long)LastMapSize);
-#endif /* DEBUG_KEXT */
+ UInt32 numAllSegments;
+ UInt32 numSegments;
+ IOByteCount offset;
+ IOByteCount length;
+ UInt64 prevSegmentEnd;
+ UInt64 segmentStart;
- if (memory != NULL)
{
- newmemory = IOMemoryDescriptor::withPhysicalAddress(LastMapAddr, LastMapSize, kIODirectionIn);
+ numAllSegments = 0;
+ numSegments = 0;
+ prevSegmentEnd = 0;
+ for (offset = 0; (segmentStart = (UInt64)memDesc->getPhysicalSegment(offset, &length)); offset += length) {
+ // Why does getPhysicalSegment return 1 MB segments that are contiguous?
+ // Don't count contguous segments as separate segments.
+ if (segmentStart != prevSegmentEnd)
+ numSegments++;
+ numAllSegments++;
+ prevSegmentEnd = segmentStart + length;
+ }
}
-
- /* Reset mapping to zero */
- LastMapAddr = 0;
- LastMapSize = 0;
- if (newmemory == NULL)
- {
- IOLog("DirectHW: Could not map memory!\n");
+ if (numSegments == 0)
+ DOLOG("DirectHW: numSegments = 0\n");
+ else if (numSegments > 1) {
+ //DOLOG("DirectHW: numSegments = %u\n", (unsigned int)numSegments);
+ segmentOffsetsSize = (numSegments + 1) * sizeof(IOPhysicalSegment);
+ if (segmentOffsetsSize < page_size)
+ segmentOffsetsSize = page_size; // http://developer.apple.com/qa/qa2001/qa1197.html
+ segmentOffsetsArray = (IOPhysicalSegment*) IOMallocAligned(segmentOffsetsSize, page_size /* sizeof(IOByteCount) */);
+ if (!segmentOffsetsArray) {
+ DOLOG("DirectHW: Could not allocate segments array.\n");
+ result = kIOReturnNoMemory;
+ goto bail;
+ }
- return kIOReturnNotOpen;
- }
+ segmentsDesc = IOMemoryDescriptor::withAddress(segmentOffsetsArray, segmentOffsetsSize, kIODirectionOutIn);
+ if (!segmentsDesc) {
+ DOLOG("DirectHW: Could not create memory descriptor for segments.\n");
+ result = kIOReturnNoResources;
+ goto bail;
+ }
+ //DOLOG("DirectHW: 5 segmentsDesc->getRetainCount:%d\n", segmentsDesc->getRetainCount()); // 1
- newmemory->retain();
+ segmentsMapKernel = segmentsDesc->setMapping(kernel_task, (IOVirtualAddress)segmentOffsetsArray);
+ if (!segmentsMapKernel) {
+ DOLOG("DirectHW: Could not make mapping in kernel space for segments.\n");
+ result = kIOReturnVMError;
+ goto bail;
+ }
+ //DOLOG("DirectHW: 6 segmentsDesc->getRetainCount:%d segmentsMapKernel->getRetainCount:%d\n", segmentsDesc->getRetainCount(), segmentsMapKernel->getRetainCount()); // 2 2
+
+ #ifdef __LP64__
+ segmentsMapUser = segmentsDesc->createMappingInTask(fTask, 0, mapOptions | kIOMapAnywhere);
+ #else
+ segmentsMapUser = segmentsDesc->map(fTask, 0, mapOptions | kIOMapAnywhere);
+ #endif
+ if (!segmentsMapUser) {
+ DOLOG("DirectHW: Could not make mapping in user space for segments.\n");
+ result = kIOReturnVMError;
+ goto bail;
+ }
+ //DOLOG("DirectHW: 7 segmentsDesc->getRetainCount:%d segmentsMapUser->getRetainCount:%d\n", segmentsDesc->getRetainCount(), segmentsMapUser->getRetainCount()); // 3 2
+
+ IOPhysicalSegment* curRec = segmentOffsetsArray - 1;
+ offset = 0;
+ prevSegmentEnd = 0;
+ int myNumSegments = -1;
+ while (1) {
+ segmentStart = (UInt64)memDesc->getPhysicalSegment(offset, &length);
+ // Why does getPhysicalSegment return 1 MB segments that are contiguous?
+ // Don't count contguous segments as separate segments.
+ if (segmentStart != prevSegmentEnd) {
+ curRec++;
+ myNumSegments++;
+ curRec->location = segmentStart;
+ curRec->length = length;
+ if (!segmentStart)
+ break;
+ //DOLOG("DirectHW: segment:%-4d offset:0x%lld length:0x%llx location:0x%08llx\n", myNumSegments, (uint64_t)offset, (uint64_t)length, curRec->location);
+ }
+ else {
+ curRec->length += length;
+ //DOLOG("DirectHW: offset:0x%lld length:0x%llx totalLength:0x%llx\n", myNumSegments, (uint64_t)offset, (uint64_t)length, (uint64_t)curRec->length);
+ }
+ prevSegmentEnd = segmentStart + length;
+ offset += length;
+ }
- if (memory != NULL)
- {
- *memory = newmemory;
+ snprintf(segmentsKey, sizeof(segmentsKey), "%u", memoryType + kMemoryTypeSegments);
+ if (!fMemoryTypes->setObject(segmentsKey, segmentsMapUser)) {
+ DOLOG("DirectHW: Could not add segments memory descriptor to dictionary.\n");
+ result = kIOReturnNoMemory;
+ goto bail;
+ }
+ isSegmentsInDictionary = true;
+ //DOLOG("DirectHW: 8 segmentsMapUser->getRetainCount:%d segmentsKey:%s\n", segmentsMapUser->getRetainCount(), segmentsKey); // 3 2xxxxxxx
+
+ snprintf(segmentsKeyKernel, sizeof(segmentsKeyKernel), "%u", memoryType + kMemoryTypeSegmentsKernel);
+ if (!fMemoryTypes->setObject(segmentsKeyKernel, segmentsMapKernel)) {
+ DOLOG("DirectHW: Could not add segments kernel memory descriptor to dictionary.\n");
+ result = kIOReturnNoMemory;
+ goto bail;
+ }
+ isSegmentsKernelInDictionary = true;
+ //DOLOG("DirectHW: 9 segmentsMapKernel->getRetainCount:%d segmentsKeyKernel:%s\n", segmentsMapKernel->getRetainCount(), segmentsKeyKernel); // 3 3xxxxxxx
}
-#ifdef DEBUG_KEXT
- IOLog("DirectHW: Mapping succeeded.\n");
-#endif /* DEBUG_KEXT */
+ if (memMapKernel) {
+ snprintf(keyKernel, sizeof(keyKernel), "%u", memoryType + kernelMemoryType);
+ if (!fMemoryTypes->setObject(keyKernel, memMapKernel)) {
+ DOLOG("DirectHW: Could not add kernel memory descriptor to dictionary.\n");
+ result = kIOReturnNoMemory;
+ goto bail;
+ }
+ isMapKernelInDictionary = true;
+ //DOLOG("DirectHW: 10 memMapKernel->getRetainCount:%d keyKernel:%s\n", memMapKernel->getRetainCount(), keyKernel); // 3 1xxxxxxx
+ }
+
+ if (memMapUser) {
+ snprintf(key, sizeof(key), "%u", memoryType + kMemoryTypeUser);
+ //DOLOG("DirectHW: fMemoryTypes->setObject\n");
+ if (!fMemoryTypes->setObject(key, memMapUser)) {
+ DOLOG("DirectHW: Could not add memory descriptor to dictionary.\n");
+ result = kIOReturnNoMemory;
+ goto bail;
+ }
+ isMapInDictionary = true;
+ //DOLOG("DirectHW: 11 memMapUser->getRetainCount:%d key:%s\n", memMapUser->getRetainCount(), key); // phys(memMapUser:3)
+ }
+
+ // prepare was called so now we can get the physical address
+ outStruct->physAddr = memMapKernel ? memMapKernel->getPhysicalAddress() : memMapUser ? memMapUser->getPhysicalAddress() : 0;
+ outStruct->kernAddr = memMapKernel ? memMapKernel->getAddress() : 0;
+ outStruct->userAddr = userAddress;
+ outStruct->segments = segmentsMapUser ? segmentsMapUser->getAddress() : 0;
+ outStruct->size = bufferSize;
+ outStruct->memoryType = memoryType;
+
+ //DOLOG("DirectHW: user:0x%08llx virt:0x%08llx phys:0x%08llx segments:0x%08llx\n", outStruct->userAddr, outStruct->kernAddr, outStruct->physAddr, outStruct->segments);
+
+ //DOLOG("DirectHW: 12 memDesc->getRetainCount:%d memMapKernel->getRetainCount:%d\n", memDesc ? memDesc->getRetainCount() : 0, memMapKernel ? memMapKernel->getRetainCount() : 0); // phys(memDesc:2 memMapKernel:0)
+
+/*
+ if (memDesc)
+ memDesc->release();
+ if (segmentsDesc)
+ segmentsDesc->release();
+*/
+
+ DOLOG("DirectHW: AllocatePhysicalMemory memoryType:%d allocOptions:0x%x mapOptions:0x%x physMask:%08llx size:0x%llx "
+ "userAddr:0x%llx physAddr:0x%llx kernAddr:0x%llx segments:0x%llx numAllSegments:%d numDiscontiguousSegments:%d\n",
+ (int)memoryType, (int)outStruct->allocOptions, (int)outStruct->mapOptions, outStruct->physMask, outStruct->size,
+ outStruct->userAddr, outStruct->physAddr, outStruct->kernAddr, outStruct->segments, numAllSegments, numSegments
+ );
+
+ if (fCrossEndian) {
+ outStruct->memoryType = OSSwapInt32(outStruct->memoryType );
+ outStruct->allocOptions = OSSwapInt32(outStruct->allocOptions);
+ outStruct->mapOptions = OSSwapInt32(outStruct->mapOptions );
+ outStruct->physMask = OSSwapInt64(outStruct->physMask );
+ outStruct->size = OSSwapInt64(outStruct->size );
+ outStruct->userAddr = OSSwapInt64(outStruct->userAddr );
+ outStruct->physAddr = OSSwapInt64(outStruct->physAddr );
+ outStruct->kernAddr = OSSwapInt64(outStruct->kernAddr );
+ outStruct->segments = OSSwapInt64(outStruct->segments );
+ }
+
+goto success;
+
+bail:
+ //DOLOG("bail\n");
+ if (isMapInDictionary)
+ fMemoryTypes->removeObject(key);
+ if (isMapKernelInDictionary)
+ fMemoryTypes->removeObject(keyKernel);
+
+ if (isSegmentsKernelInDictionary)
+ fMemoryTypes->removeObject(segmentsKeyKernel);
+ if (isSegmentsInDictionary)
+ fMemoryTypes->removeObject(segmentsKey);
+
+ if (segmentsMapUser)
+ segmentsMapUser->release();
+ if (segmentsMapKernel)
+ segmentsMapKernel->release();
+ if (segmentsDesc)
+ segmentsDesc->release();
+ if (segmentOffsetsArray)
+ IOFreeAligned(segmentOffsetsArray, segmentOffsetsSize);
+
+ if (memMapUser)
+ memMapUser->release();
+ if (isPrepared)
+ if (kIOReturnSuccess != memDesc->complete())
+ DOLOG("DirectHW: Complete failed.\n");
+ if (memMapKernel)
+ memMapKernel->release();
+ if (memDesc)
+ memDesc->release();
+#if !defined(__ppc__) || !defined(KPI_10_4_0_PPC_COMPAT)
+#else
+ if (kernelAddress)
+ IOFreeContiguous(kernelAddress, (IOByteCount)bufferSize);
+#endif
+
+success:
+ DOLOG("] DirectHW: AllocatePhysicalMemory memoryType:%d %sresult:%08x\n", (int)memoryType, (int)result ? "•••" : "", result);
+
+ return result;
+} // AllocatePhysicalMemory
- return kIOReturnSuccess;
+
+IOReturn
+DirectHWUserClient::UnallocatePhysicalMemory(
+ MemParams * inStruct, MemParams * outStruct,
+ IOByteCount inStructSize,
+ IOByteCount * outStructSize)
+{
+ ((void)outStruct);
+ ((void)outStructSize);
+ if (inStructSize != sizeof(MemParams)) {
+ return kIOReturnBadArgument;
+ }
+ return UnallocatePhysicalMemoryType(fCrossEndian ? OSSwapInt32(inStruct->memoryType) : inStruct->memoryType);
}
+
+IOReturn DirectHWUserClient::UnallocatePhysicalMemoryType(UInt32 memoryType)
+{
+ DOLOG("[ DirectHW: UnallocatePhysicalMemoryType memoryType:%d\n", (int)memoryType);
+
+ IOReturn result = kIOReturnSuccess;
+
+ IOMemoryDescriptor* memDesc = NULL;
+ IOMemoryMap* memMapKernel = NULL;
+ IOMemoryMap* memMapUser = NULL;
+ bool isPrepared = false;
+ char key[11];
+ char keyKernel[11];
+ bool isMapKernelInDictionary = false;
+
+ void* segmentOffsetsArray = 0;
+ vm_size_t segmentOffsetsSize = 0;
+ IOMemoryDescriptor* segmentsDesc = NULL;
+ IOMemoryMap* segmentsMapUser = NULL;
+ IOMemoryMap* segmentsMapKernel = NULL;
+ char segmentsKey[11];
+ char segmentsKeyKernel[11];
+ bool isSegmentsInDictionary = false;
+ bool isSegmentsKernelInDictionary = false;
+
+ UInt32 kernelMemoryType = kMemoryTypeKernel;
+#if !defined(__ppc__) || !defined(KPI_10_4_0_PPC_COMPAT)
+#else
+ void* kernelAddress = NULL;
+ IOByteCount bufferSize = 0;
+#endif
+
+ if (memoryType >= kMemoryTypeMax) {
+ memoryType = memoryType % kMemoryTypeMax;
+ //DOLOG("Will try memoryType %d\n", (int)memoryType);
+ }
+
+ snprintf(key, sizeof(key), "%u", memoryType + kMemoryTypeUser);
+ memMapUser = OSDynamicCast(IOMemoryMap, fMemoryTypes->getObject(key));
+ if (!memMapUser)
+ DOLOG("DirectHW: memory map %s not found in dictionary\n", key);
+ else {
+ //DOLOG("DirectHW: 13 memMapUser->getRetainCount:%d\n", memMapUser->getRetainCount()); // phys(memMapUser:3)
+ memDesc = memMapUser->getMemoryDescriptor();
+
+ if (!memDesc)
+ DOLOG("DirectHW: memory map %s has no memory descriptor\n", key);
+ else {
+ isPrepared = true;
+ //DOLOG("DirectHW: 14 memDesc->getRetainCount:%d memMapUser->getRetainCount:%d\n", memDesc->getRetainCount(), memMapUser->getRetainCount()); // phys(memDesc:2 memMapUser:3)
+ }
+
+ fMemoryTypes->removeObject(key);
+
+ if (!memDesc)
+ DOLOG("DirectHW: memory map %s has no memory descriptor\n", key);
+ else {
+ //DOLOG("DirectHW: 15 memDesc->getRetainCount:%d memMapUser->getRetainCount:%d\n", memDesc->getRetainCount(), memMapUser->getRetainCount()); // phys(memDesc:2 memMapUser:2)
+ }
+ }
+
+ snprintf(keyKernel, sizeof(keyKernel), "%u", memoryType + kernelMemoryType);
+ memMapKernel = OSDynamicCast(IOMemoryMap, fMemoryTypes->getObject(keyKernel));
+#if !defined(__ppc__) || !defined(KPI_10_4_0_PPC_COMPAT)
+#else
+ if (!memMapKernel) {
+ kernelMemoryType = kMemoryTypeKernelMalloc;
+ snprintf(keyKernel, sizeof(keyKernel), "%u", memoryType + kernelMemoryType);
+ memMapKernel = OSDynamicCast(IOMemoryMap, fMemoryTypes->getObject(keyKernel));
+ }
+#endif
+ if (memMapKernel) {
+ isMapKernelInDictionary = true;
+#if !defined(__ppc__) || !defined(KPI_10_4_0_PPC_COMPAT)
+#else
+ if (kernelMemoryType == kMemoryTypeKernelMalloc) {
+ kernelAddress = (void*)memMapKernel->getAddress();
+ bufferSize = memMapKernel->getLength();
+ }
+#endif
+ }
+
+ snprintf(segmentsKey, sizeof(segmentsKey), "%u", memoryType + kMemoryTypeSegments);
+ segmentsMapUser = OSDynamicCast(IOMemoryMap, fMemoryTypes->getObject(segmentsKey));
+ if (segmentsMapUser) {
+ //DOLOG("DirectHW: memory map %s found in dictionary\n", segmentsKey);
+ isSegmentsInDictionary = true;
+ }
+
+ snprintf(segmentsKeyKernel, sizeof(segmentsKeyKernel), "%u", memoryType + kMemoryTypeSegmentsKernel);
+ segmentsMapKernel = OSDynamicCast(IOMemoryMap, fMemoryTypes->getObject(segmentsKeyKernel));
+ if (segmentsMapKernel) {
+ //DOLOG("DirectHW: memory map %s found in dictionary\n", segmentsKeyKernel);
+ isSegmentsKernelInDictionary = true;
+ segmentsDesc = segmentsMapKernel->getMemoryDescriptor();
+ segmentOffsetsArray = (void*)segmentsMapKernel->getAddress();
+ segmentOffsetsSize = segmentsMapKernel->getLength();
+ }
+
+ if (isMapKernelInDictionary) {
+ //DOLOG("DirectHW: 16 DirectHW: memDesc->getRetainCount:%d memMapKernel->getRetainCount:%d\n", memDesc->getRetainCount(), memMapKernel->getRetainCount()); // kext:3 3
+ fMemoryTypes->removeObject(keyKernel);
+ }
+
+ if (isSegmentsKernelInDictionary) {
+ //DOLOG("DirectHW: 17 segmentsDesc->getRetainCount:%d segmentsMapKernel->getRetainCount:%d\n", segmentsDesc->getRetainCount(), segmentsMapKernel->getRetainCount()); // user:3 3
+ fMemoryTypes->removeObject(segmentsKeyKernel);
+ }
+
+ if (isSegmentsInDictionary) {
+ //DOLOG("DirectHW: 18 segmentsDesc->getRetainCount:%d segmentsMapUser->getRetainCount:%d\n", segmentsDesc->getRetainCount(), segmentsMapUser->getRetainCount()); // user:3 3
+ fMemoryTypes->removeObject(segmentsKey);
+ }
+
+ if (segmentsMapUser) {
+ //DOLOG("DirectHW: 19 segmentsDesc->getRetainCount:%d segmentsMapUser->getRetainCount:%d\n", segmentsDesc->getRetainCount(), segmentsMapUser->getRetainCount()); // user:3 2
+ segmentsMapUser->release();
+ }
+ if (segmentsMapKernel) {
+ //DOLOG("DirectHW: 20 segmentsDesc->getRetainCount:%d segmentsMapKernel->getRetainCount:%d\n", segmentsDesc->getRetainCount(), segmentsMapKernel->getRetainCount()); // user:2 2
+ segmentsMapKernel->release();
+ }
+ if (segmentsDesc) {
+ //DOLOG("DirectHW: 21 segmentsDesc->getRetainCount:%d\n", segmentsDesc->getRetainCount()); // user:1
+ segmentsDesc->release();
+ }
+ if (segmentOffsetsArray) {
+ IOFreeAligned((void*)segmentOffsetsArray, segmentOffsetsSize);
+ }
+
+ if (memMapUser) {
+ //DOLOG("DirectHW: 22 memDesc->getRetainCount:%d memMapUser->getRetainCount:%d\n", memDesc->getRetainCount(), memMapUser->getRetainCount()); // phys(memDesc:2 memMapUser:2)
+ memMapUser->release();
+ // even though retainCount was 2, we cannot access memMapUser after this
+ }
+ if (isPrepared)
+ if (kIOReturnSuccess != memDesc->complete())
+ DOLOG("DirectHW: Complete failed.\n");
+ if (memMapKernel) {
+ //DOLOG("DirectHW: 23 memDesc->getRetainCount:%d memMapKernel->getRetainCount:%d\n", memDesc->getRetainCount(), memMapKernel->getRetainCount()); // kext:2 2
+ memMapKernel->release();
+ }
+ if (memDesc) {
+ //DOLOG("DirectHW: 24 memDesc->getRetainCount:%d\n", memDesc->getRetainCount()); // phys(memDesc:1)
+ memDesc->release();
+ }
+#if !defined(__ppc__) || !defined(KPI_10_4_0_PPC_COMPAT)
+#else
+ if (kernelAddress) {
+ IOFreeContiguous((void*)kernelAddress, bufferSize);
+ }
+#endif
+
+ DOLOG("] DirectHW: UnallocatePhysicalMemoryType memoryType:%d result:%08x\n", (int)memoryType, result);
+
+ return result;
+} // UnallocatePhysicalMemoryType
diff --git a/DirectHW/DirectHW.h b/DirectHW/DirectHW.h
index 5e9d1a1..6c9271c 100644
--- a/DirectHW/DirectHW.h
+++ b/DirectHW/DirectHW.h
@@ -6,7 +6,7 @@
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
- *
+ *
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
@@ -19,9 +19,10 @@
#ifndef __DIRECTHW_H
#define __DIRECTHW_H
-#include
+#include
+#include
-int iopl(int unused);
+int iopl(int level);
unsigned char inb(unsigned short addr);
unsigned short inw(unsigned short addr);
@@ -37,27 +38,33 @@ void outl(unsigned int val, unsigned short addr);
void outq(unsigned long val, unsigned short addr);
#endif
+int readmem32(uint64_t addr, uint32_t* data);
+
void *map_physical(uint64_t phys_addr, size_t len);
void unmap_physical(void *virt_addr, size_t len);
+int allocate_physically_contiguous_32(size_t len, uint32_t *phys, void* *user, uint32_t *type);
+int unallocate_mem(uint32_t type);
-typedef union {
- struct {
-#ifdef __BIG_ENDIAN__
- uint32_t hi;
- uint32_t lo;
-#else /* __LITTLE_ENDIAN__ */
- uint32_t lo;
- uint32_t hi;
-#endif /* __BIG_ENDIAN__ */
- } io32;
-
- uint64_t io64;
+typedef struct {
+ uint32_t hi;
+ uint32_t lo;
} msr_t;
msr_t rdmsr(int addr);
int wrmsr(int addr, msr_t msr);
int logical_cpu_select(int cpu);
+int rdcpuid(uint32_t eax, uint32_t ecx, uint32_t cpudata[4]);
+int darwin_ioread(int pos, unsigned char * buf, int len);
+
+kern_return_t MyIOConnectCallStructMethod(
+ io_connect_t connect,
+ unsigned int index,
+ void * in,
+ size_t dataInLen,
+ void * out,
+ size_t * dataOutLen
+);
#ifndef INVALID_MSR_LO
#define INVALID_MSR_LO 0x63744857
diff --git a/DirectHW/DirectHW.hpp b/DirectHW/DirectHW.hpp
index e187d5b..2769d67 100644
--- a/DirectHW/DirectHW.hpp
+++ b/DirectHW/DirectHW.hpp
@@ -8,7 +8,7 @@
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
- *
+ *
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
@@ -18,129 +18,78 @@
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-#include
-#include
+#include "MacOSMacros.h"
+
+#include
#include
-#include
#include
-#if defined(__i386__) || defined(__x86_64__)
-#include
-#endif /* __i386__ || __x86_64__ */
-
#ifndef DIRECTHW_VERSION
-#define DIRECTHW_VERSION "1.4"
-#endif /* DIRECTHW_VERSION */
+ #define DIRECTHW_VERSION "1.6.2"
+#endif
#ifndef DIRECTHW_VERNUM
-#define DIRECTHW_VERNUM 0x00100400
-#endif /* DIRECTHW_VERNUM */
+ #define DIRECTHW_VERNUM 0x00100500
+#endif
#ifndef APPLE_KEXT_OVERRIDE
-#ifdef __clang__
-#define APPLE_KEXT_OVERRIDE override
-#else /* !__clang__ */
-#define APPLE_KEXT_OVERRIDE
-#endif /* __clang__ */
-#endif /* APPLE_KEXT_OVERRIDE */
-/* */
+ #ifdef __clang__
+ #define APPLE_KEXT_OVERRIDE override
+ #else
+ #define APPLE_KEXT_OVERRIDE
+ #endif
+#endif
+
+#ifndef LIBKERN_RETURNS_NOT_RETAINED
+ #define LIBKERN_RETURNS_NOT_RETAINED
+#endif
#ifndef rdmsr
-#define rdmsr(msr, lo, hi) \
+ #define rdmsr(msr, lo, hi) \
__asm__ volatile("rdmsr" : "=a" (lo), "=d" (hi) : "c" (msr))
-#endif /* rdmsr */
+#endif
#ifndef wrmsr
-#define wrmsr(msr, lo, hi) \
+ #define wrmsr(msr, lo, hi) \
__asm__ volatile("wrmsr" : : "c" (msr), "a" (lo), "d" (hi))
-#endif /* wrmsr */
+#endif
class DirectHWService : public IOService
{
- OSDeclareDefaultStructors(DirectHWService)
+ OSDeclareDefaultStructors(DirectHWService)
public:
- virtual bool start(IOService *provider) APPLE_KEXT_OVERRIDE;
+ virtual bool start(IOService *provider) APPLE_KEXT_OVERRIDE;
};
-/* */
-/*class DirectHWService;*/
-
class DirectHWUserClient : public IOUserClient
{
- OSDeclareDefaultStructors(DirectHWUserClient)
-
- enum {
- kReadIO,
- kWriteIO,
- kPrepareMap,
- kReadMSR,
- kWriteMSR,
- kNumberOfMethods
- };
-
- typedef struct {
-#if defined(__x86_64__) || defined(__arm64__)
- UInt64 offset;
- UInt64 width;
- UInt64 data;
-#else /* __i386__ || __arm__ */
- UInt32 offset;
- UInt32 width;
- UInt32 data;
-#endif /* __i386__ || __x86_64__ || __arm__ || __arm64__ */
- } iomem_t;
-
- typedef struct {
-#if defined(__x86_64__) || defined(__arm64__)
- UInt64 addr;
- UInt64 size;
-#else /* __i386__ || __arm__ */
- UInt32 addr;
- UInt32 size;
-#endif /* __i386__ || __x86_64__ || __arm__ || __arm64__ */
- } map_t;
-
- typedef struct {
- UInt32 core;
- UInt32 index;
-
- union {
- uint64_t io64;
-
- struct
- {
-#ifndef __BIG_ENDIAN__
- UInt32 lo;
- UInt32 hi;
-#else /* __BIG_ENDIAN__ == 1 */
- UInt32 hi;
- UInt32 lo;
-#endif /* __BIG_ENDIAN__ */
- } io32;
- } val;
- } msrcmd_t;
+ OSDeclareDefaultStructors(DirectHWUserClient)
+
+ #include "DirectHWShared.h"
public:
- virtual bool initWithTask(task_t task, void *securityID, UInt32 type) APPLE_KEXT_OVERRIDE;
+ virtual bool initWithTask(task_t task, void *securityID, UInt32 type, OSDictionary* properties) APPLE_KEXT_OVERRIDE;
- virtual bool start(IOService * provider) APPLE_KEXT_OVERRIDE;
- virtual void stop(IOService * provider) APPLE_KEXT_OVERRIDE;
+ virtual bool start(IOService * provider) APPLE_KEXT_OVERRIDE;
+ virtual void stop(IOService * provider) APPLE_KEXT_OVERRIDE;
- virtual IOReturn clientMemoryForType(UInt32 type, UInt32 *flags, IOMemoryDescriptor **memory) APPLE_KEXT_OVERRIDE;
+ virtual IOReturn clientMemoryForType(UInt32 type, UInt32 *flags, IOMemoryDescriptor **memory) APPLE_KEXT_OVERRIDE;
- virtual IOReturn clientClose(void) APPLE_KEXT_OVERRIDE;
+ virtual IOReturn clientClose(void) APPLE_KEXT_OVERRIDE;
protected:
- DirectHWService *fProvider;
+ DirectHWService *fProvider;
+ OSDictionary *fMemoryTypes; // contains the list of memory allocations
+ UInt32 fNextMemoryType;
- static const IOExternalMethod fMethods[kNumberOfMethods];
+ static const IOExternalMethod fMethods[kNumberOfMethods];
static const IOExternalAsyncMethod fAsyncMethods[kNumberOfMethods];
- virtual IOExternalMethod *getTargetAndMethodForIndex(LIBKERN_RETURNS_NOT_RETAINED IOService ** target, UInt32 index) APPLE_KEXT_OVERRIDE;
+ virtual IOExternalMethod *getTargetAndMethodForIndex(LIBKERN_RETURNS_NOT_RETAINED IOService ** target, UInt32 index) APPLE_KEXT_OVERRIDE;
virtual IOExternalAsyncMethod *getAsyncTargetAndMethodForIndex(LIBKERN_RETURNS_NOT_RETAINED IOService ** target, UInt32 index) APPLE_KEXT_OVERRIDE;
- virtual IOReturn ReadIO(iomem_t *inStruct, iomem_t *outStruct,
+ virtual IOReturn ReadIO(iomem_t *inStruct, iomem_t *outStruct,
IOByteCount inStructSize,
IOByteCount *outStructSize);
@@ -149,7 +98,7 @@ class DirectHWUserClient : public IOUserClient
IOByteCount inStructSize,
IOByteCount *outStructSize);
- virtual IOReturn WriteIO(iomem_t *inStruct, iomem_t *outStruct,
+ virtual IOReturn WriteIO(iomem_t *inStruct, iomem_t *outStruct,
IOByteCount inStructSize,
IOByteCount *outStructSize);
@@ -158,7 +107,7 @@ class DirectHWUserClient : public IOUserClient
IOByteCount inStructSize,
IOByteCount *outStructSize);
- virtual IOReturn PrepareMap(map_t *inStruct, map_t *outStruct,
+ virtual IOReturn PrepareMap(map_t *inStruct, map_t *outStruct,
IOByteCount inStructSize,
IOByteCount *outStructSize);
@@ -167,7 +116,7 @@ class DirectHWUserClient : public IOUserClient
IOByteCount inStructSize,
IOByteCount *outStructSize);
- virtual IOReturn ReadMSR(msrcmd_t *inStruct, msrcmd_t *outStruct,
+ virtual IOReturn ReadMSR(msrcmd_t *inStruct, msrcmd_t *outStruct,
IOByteCount inStructSize,
IOByteCount *outStructSize);
@@ -175,8 +124,8 @@ class DirectHWUserClient : public IOUserClient
msrcmd_t *inStruct, msrcmd_t *outStruct,
IOByteCount inStructSize,
IOByteCount *outStructSize);
-
- virtual IOReturn WriteMSR(msrcmd_t *inStruct, msrcmd_t *outStruct,
+
+ virtual IOReturn WriteMSR(msrcmd_t *inStruct, msrcmd_t *outStruct,
IOByteCount inStructSize,
IOByteCount *outStructSize);
@@ -185,12 +134,77 @@ class DirectHWUserClient : public IOUserClient
IOByteCount inStructSize,
IOByteCount *outStructSize);
+ virtual IOReturn ReadCpuId(cpuid_t * inStruct, cpuid_t * outStruct,
+ IOByteCount inStructSize,
+ IOByteCount * outStructSize);
+
+ virtual IOReturn ReadCpuIdAsync(OSAsyncReference asyncRef,
+ cpuid_t * inStruct, cpuid_t * outStruct,
+ IOByteCount inStructSize,
+ IOByteCount * outStructSize);
+
+ virtual IOReturn ReadMem(readmem_t * inStruct, readmem_t * outStruct,
+ IOByteCount inStructSize,
+ IOByteCount * outStructSize);
+
+ virtual IOReturn ReadMemAsync(OSAsyncReference asyncRef,
+ readmem_t * inStruct, readmem_t * outStruct,
+ IOByteCount inStructSize,
+ IOByteCount * outStructSize);
+
+ virtual IOReturn Read(Parameters * inStruct, Parameters * outStruct,
+ IOByteCount inStructSize,
+ IOByteCount * outStructSize);
+
+ virtual IOReturn ReadAsync(OSAsyncReference asyncRef,
+ Parameters * inStruct, Parameters * outStruct,
+ IOByteCount inStructSize,
+ IOByteCount * outStructSize);
+
+ virtual IOReturn Write(Parameters * inStruct, Parameters * outStruct,
+ IOByteCount inStructSize,
+ IOByteCount * outStructSize);
+
+ virtual IOReturn WriteAsync(OSAsyncReference asyncRef,
+ Parameters * inStruct, Parameters * outStruct,
+ IOByteCount inStructSize,
+ IOByteCount * outStructSize);
+
+ virtual IOReturn ReadWrite(uint32_t selector,
+ Parameters * inStruct, Parameters * outStruct,
+ IOByteCount inStructSize,
+ IOByteCount * outStructSize);
+
+ virtual IOReturn AllocatePhysicalMemory(MemParams * inStruct, MemParams * outStruct,
+ IOByteCount inStructSize,
+ IOByteCount * outStructSize);
+
+ virtual IOReturn AllocatePhysicalMemoryAsync(OSAsyncReference asyncRef,
+ MemParams * inStruct, MemParams * outStruct,
+ IOByteCount inStructSize,
+ IOByteCount * outStructSize);
+
+ virtual IOReturn UnallocatePhysicalMemory(MemParams * inStruct, MemParams * outStruct,
+ IOByteCount inStructSize,
+ IOByteCount * outStructSize);
+
+ virtual IOReturn UnallocatePhysicalMemoryAsync(OSAsyncReference asyncRef,
+ MemParams * inStruct, MemParams * outStruct,
+ IOByteCount inStructSize,
+ IOByteCount * outStructSize);
+
+ virtual IOReturn UnallocatePhysicalMemoryType(UInt32 memoryType);
+
private:
- task_t fTask;
+ task_t fTask;
+ bool fCrossEndian;
+
UInt64 LastMapAddr;
UInt64 LastMapSize;
- static void MSRHelperFunction(void *data);
+ static void MSRHelperFunction(void *data);
+ static void CPUIDHelperFunction(void *data);
+ static void ReadMemHelperFunction(void *data);
typedef struct {
msrcmd_t *in;
@@ -198,29 +212,27 @@ class DirectHWUserClient : public IOUserClient
bool Read;
} MSRHelper;
- static inline void cpuid(uint32_t op1, uint32_t op2, uint32_t *data);
-};
+ typedef struct {
+ cpuid_t *in, *out;
+ } CPUIDHelper;
-extern "C"
-{
- /* from sys/osfmk/i386/mp.c */
- extern void mp_rendezvous(void (*setup_func)(void *),
- void (*action_func)(void *),
- void (*teardown_func)(void *),
- void *arg);
+ typedef struct {
+ readmem_t *in, *out;
+ } ReadMemHelper;
- extern void mp_rendezvous_no_intrs(void (*action_func)(void *),
- void *arg);
+ static inline void cpuid(uint32_t op1, uint32_t op2, uint32_t *data);
- extern int cpu_number(void);
-}
+ void GetPciHostBridges1(IOService *service, OSIterator *services);
+ void GetPciHostBridges(void);
+ IOPCIDevice * FindMatching(IOService *service, IOPCIAddressSpace space, OSIterator *services);
+};
#ifndef INVALID_MSR_LO
-#define INVALID_MSR_LO 0x63744857
-#endif /* INVALID_MSR_LO */
+ #define INVALID_MSR_LO 0x63744857
+#endif
#ifndef INVALID_MSR_HI
-#define INVALID_MSR_HI 0x44697265
-#endif /* INVALID_MSR_HI */
+ #define INVALID_MSR_HI 0x44697265
+#endif
#endif /* __DIRECTHW_HPP__ */
diff --git a/DirectHW/DirectHW.pmdoc/01directhw-contents.xml b/DirectHW/DirectHW.pmdoc/01directhw-contents.xml
index 957bc7f..fbc8dfd 100644
--- a/DirectHW/DirectHW.pmdoc/01directhw-contents.xml
+++ b/DirectHW/DirectHW.pmdoc/01directhw-contents.xml
@@ -1,74 +1,71 @@
-
-
-
-
-
-
- mode
-
-
-
- mode
-
+
+
+
+
+
+ mode
+
+
+
mode
mode
mode
+ mode
-
-
-
+
+
+
+
+ mode
+
+
+
mode
-
-
- mode
-
+ mode
+
+
+
mode
-
-
+ mode
+
+
+
+
mode
- mode
-
-
-
-
- mode
-
-
-
- mode
-
- mode
-
-
-
- mode
-
+
+
mode
mode
-
-
+
+
mode
-
-
- mode
-
+ mode
+
+ mode
+
+
+
+ mode
+
+
+
mode
-
-
- mode
-
+ mode
+
+
+
mode
mode
@@ -77,6 +74,7 @@
mode
+ mode
diff --git a/DirectHW/DirectHW.pmdoc/01directhw.xml b/DirectHW/DirectHW.pmdoc/01directhw.xml
index 9574919..434bc5d 100644
--- a/DirectHW/DirectHW.pmdoc/01directhw.xml
+++ b/DirectHW/DirectHW.pmdoc/01directhw.xml
@@ -15,11 +15,12 @@
installFrom.path
parent
installTo
+ ../
01directhw-contents.xml
-
-
+
+
/CVS$
/\.svn$
/\.cvsignore$
diff --git a/DirectHW/DirectHW.pmdoc/index.xml b/DirectHW/DirectHW.pmdoc/index.xml
index e17b7ab..af6487f 100644
--- a/DirectHW/DirectHW.pmdoc/index.xml
+++ b/DirectHW/DirectHW.pmdoc/index.xml
@@ -44,9 +44,9 @@
-
- com.coresystems.driver.DirectHW
- component
+
+ postinstall
+ script
- 01directhw.xml
diff --git a/DirectHW/DirectHW.xcodeproj/project.pbxproj b/DirectHW/DirectHW.xcodeproj/project.pbxproj
index 22bf0f0..4884699 100644
--- a/DirectHW/DirectHW.xcodeproj/project.pbxproj
+++ b/DirectHW/DirectHW.xcodeproj/project.pbxproj
@@ -17,11 +17,14 @@
/* End PBXBuildFile section */
/* Begin PBXFileReference section */
- 5D9932B30D0F95DD00760F43 /* DirectHW.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DirectHW.cpp; sourceTree = ""; };
- 5D9932B40D0F95DD00760F43 /* DirectHW.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DirectHW.hpp; sourceTree = ""; };
+ 5D9932B30D0F95DD00760F43 /* DirectHW.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DirectHW.cpp; sourceTree = ""; tabWidth = 4; };
+ 5D9932B40D0F95DD00760F43 /* DirectHW.hpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = DirectHW.hpp; sourceTree = ""; tabWidth = 4; };
5D9932D60D0F97D000760F43 /* DirectHW.kext */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = DirectHW.kext; sourceTree = BUILT_PRODUCTS_DIR; };
5D9932D70D0F97D000760F43 /* DirectHW-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "DirectHW-Info.plist"; sourceTree = ""; };
- AB66BE3125B4AE2C00943C69 /* IOKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = IOKit.framework; path = ../../../../../../System/Library/Frameworks/IOKit.framework; sourceTree = ""; };
+ 630046332C30137100FE1452 /* Kernel.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Kernel.framework; path = System/Library/Frameworks/Kernel.framework; sourceTree = SDKROOT; };
+ 63DFE2232C25A2C00075F0BB /* DirectHWShared.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DirectHWShared.h; sourceTree = ""; };
+ 63ECBFC82984EDB80031C612 /* MacOSMacros.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MacOSMacros.h; sourceTree = ""; };
+ AB66BE3125B4AE2C00943C69 /* IOKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = IOKit.framework; path = System/Library/Frameworks/IOKit.framework; sourceTree = SDKROOT; };
AB83952325B4B678001D8E16 /* libDirectHW.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libDirectHW.a; sourceTree = BUILT_PRODUCTS_DIR; };
FD12A6700E9235DB004BBD7B /* DirectHW.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = DirectHW.c; sourceTree = ""; };
FD12A6710E9235DB004BBD7B /* DirectHW.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DirectHW.h; sourceTree = ""; };
@@ -60,20 +63,23 @@
isa = PBXGroup;
children = (
AB66BE3225B4AE4200943C69 /* Resources */,
- AB66BE3025B4AE2600943C69 /* Frameworks */,
- AB66BE2F25B4AE1C00943C69 /* Source KernelSpace */,
- 5D9932940D0F94F500760F43 /* Source Userspace */,
+ 63614FF92987AA7100593F0A /* Source Common */,
+ AB66BE2F25B4AE1C00943C69 /* Source Kernel */,
+ 5D9932940D0F94F500760F43 /* Source User */,
5D99329C0D0F952400760F43 /* Products */,
+ AB66BE3025B4AE2600943C69 /* Frameworks */,
);
+ indentWidth = 4;
sourceTree = "";
+ tabWidth = 4;
};
- 5D9932940D0F94F500760F43 /* Source Userspace */ = {
+ 5D9932940D0F94F500760F43 /* Source User */ = {
isa = PBXGroup;
children = (
FD12A6700E9235DB004BBD7B /* DirectHW.c */,
FD12A6710E9235DB004BBD7B /* DirectHW.h */,
);
- name = "Source Userspace";
+ name = "Source User";
sourceTree = "";
};
5D99329C0D0F952400760F43 /* Products */ = {
@@ -86,18 +92,28 @@
name = Products;
sourceTree = "";
};
- AB66BE2F25B4AE1C00943C69 /* Source KernelSpace */ = {
+ 63614FF92987AA7100593F0A /* Source Common */ = {
+ isa = PBXGroup;
+ children = (
+ 63ECBFC82984EDB80031C612 /* MacOSMacros.h */,
+ 63DFE2232C25A2C00075F0BB /* DirectHWShared.h */,
+ );
+ name = "Source Common";
+ sourceTree = "";
+ };
+ AB66BE2F25B4AE1C00943C69 /* Source Kernel */ = {
isa = PBXGroup;
children = (
5D9932B30D0F95DD00760F43 /* DirectHW.cpp */,
5D9932B40D0F95DD00760F43 /* DirectHW.hpp */,
);
- name = "Source KernelSpace";
+ name = "Source Kernel";
sourceTree = "";
};
AB66BE3025B4AE2600943C69 /* Frameworks */ = {
isa = PBXGroup;
children = (
+ 630046332C30137100FE1452 /* Kernel.framework */,
AB66BE3125B4AE2C00943C69 /* IOKit.framework */,
);
name = Frameworks;
@@ -139,8 +155,8 @@
buildConfigurationList = 5D9932DB0D0F97D100760F43 /* Build configuration list for PBXNativeTarget "KEXT" */;
buildPhases = (
5D9932D20D0F97D000760F43 /* Sources */,
- 5D9932D30D0F97D000760F43 /* Resources */,
5D9932D40D0F97D000760F43 /* Frameworks */,
+ 5D9932D30D0F97D000760F43 /* Resources */,
);
buildRules = (
);
@@ -155,9 +171,9 @@
isa = PBXNativeTarget;
buildConfigurationList = AB83952425B4B678001D8E16 /* Build configuration list for PBXNativeTarget "libDirectHW" */;
buildPhases = (
- AB83951F25B4B678001D8E16 /* Headers */,
AB83952025B4B678001D8E16 /* Sources */,
AB83952125B4B678001D8E16 /* Frameworks */,
+ AB83951F25B4B678001D8E16 /* Headers */,
);
buildRules = (
);
@@ -172,10 +188,10 @@
isa = PBXNativeTarget;
buildConfigurationList = FDC4F2C00E923E2B0006B2A5 /* Build configuration list for PBXNativeTarget "DirectHW" */;
buildPhases = (
- FDC4F2B00E923DF00006B2A5 /* Headers */,
- FDC4F2B10E923DF00006B2A5 /* Resources */,
FDC4F2B20E923DF00006B2A5 /* Sources */,
FDC4F2B30E923DF00006B2A5 /* Frameworks */,
+ FDC4F2B00E923DF00006B2A5 /* Headers */,
+ FDC4F2B10E923DF00006B2A5 /* Resources */,
);
buildRules = (
);
@@ -192,7 +208,7 @@
5D99328B0D0F94EE00760F43 /* Project object */ = {
isa = PBXProject;
attributes = {
- LastUpgradeCheck = 1230;
+ LastUpgradeCheck = 1420;
TargetAttributes = {
5D9932D50D0F97D000760F43 = {
DevelopmentTeam = YZAQ856TTM;
@@ -275,6 +291,8 @@
5D99328C0D0F94EE00760F43 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_ANALYZER_SECURITY_FLOATLOOPCOUNTER = YES;
CLANG_ANALYZER_SECURITY_INSECUREAPI_RAND = YES;
CLANG_ANALYZER_SECURITY_INSECUREAPI_STRCPY = YES;
@@ -286,7 +304,7 @@
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
- CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
+ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
@@ -294,37 +312,35 @@
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
+ CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
- CODE_SIGN_IDENTITY = "Apple Development";
+ CODE_SIGN_IDENTITY = "";
COPY_PHASE_STRIP = NO;
- CURRENT_PROJECT_VERSION = 1.4;
- DEVELOPMENT_TEAM = YZAQ856TTM;
- DYLIB_COMPATIBILITY_VERSION = 1.0;
- DYLIB_CURRENT_VERSION = 1.4;
+ DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_STRICT_OBJC_MSGSEND = YES;
- ENABLE_TESTABILITY = YES;
+ GCC_NO_COMMON_BLOCKS = YES;
GCC_OPTIMIZATION_LEVEL = 0;
+ GCC_PREPROCESSOR_DEFINITIONS = (
+ "DEBUG=1",
+ "$(inherited)",
+ );
GCC_REUSE_STRINGS = NO;
+ GCC_SYMBOLS_PRIVATE_EXTERN = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
- GCC_WARN_ABOUT_RETURN_TYPE = YES;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
- GCC_WARN_UNINITIALIZED_AUTOS = YES;
+ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_LABEL = YES;
GCC_WARN_UNUSED_PARAMETER = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
GENERATE_PKGINFO_FILE = YES;
- INFOPLIST_FILE = "DirectHW-Info.plist";
KEEP_PRIVATE_EXTERNS = YES;
- MACOSX_DEPLOYMENT_TARGET = 11.1;
- MARKETING_VERSION = 1.4;
- MODULE_VERSION = 1.4;
- ONLY_ACTIVE_ARCH = YES;
OTHER_CPLUSPLUSFLAGS = (
"-DDEBUG_KEXT=1",
"-DDEBUG=1",
@@ -333,16 +349,16 @@
RUN_CLANG_STATIC_ANALYZER = YES;
SDKROOT = macosx;
STRIP_INSTALLED_PRODUCT = NO;
+ SYMROOT = build/buildlatest;
USE_HEADERMAP = NO;
- VERSIONING_SYSTEM = "apple-generic";
- VERSION_INFO_BUILDER = "Vampire Cat";
- VERSION_INFO_FILE = DHWVer.c;
};
name = Debug;
};
5D99328D0D0F94EE00760F43 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_ANALYZER_SECURITY_FLOATLOOPCOUNTER = YES;
CLANG_ANALYZER_SECURITY_INSECUREAPI_RAND = YES;
CLANG_ANALYZER_SECURITY_INSECUREAPI_STRCPY = YES;
@@ -354,7 +370,7 @@
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
- CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
+ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
@@ -362,46 +378,33 @@
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
+ CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
- CODE_SIGN_IDENTITY = "Apple Development";
- CURRENT_PROJECT_VERSION = 1.4;
- DEVELOPMENT_TEAM = YZAQ856TTM;
- DYLIB_COMPATIBILITY_VERSION = 1.0;
- DYLIB_CURRENT_VERSION = 1.4;
- ENABLE_HARDENED_RUNTIME = YES;
+ CODE_SIGN_IDENTITY = "";
+ DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_STRICT_OBJC_MSGSEND = YES;
- ENABLE_TESTABILITY = NO;
- GCC_GENERATE_DEBUGGING_SYMBOLS = NO;
GCC_INLINES_ARE_PRIVATE_EXTERN = YES;
GCC_NO_COMMON_BLOCKS = YES;
- GCC_OPTIMIZATION_LEVEL = z;
+ GCC_OPTIMIZATION_LEVEL = 3;
GCC_SYMBOLS_PRIVATE_EXTERN = YES;
GCC_UNROLL_LOOPS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
- GCC_WARN_ABOUT_RETURN_TYPE = YES;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
- GCC_WARN_UNINITIALIZED_AUTOS = YES;
+ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_LABEL = YES;
GCC_WARN_UNUSED_PARAMETER = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
GENERATE_PKGINFO_FILE = YES;
- INFOPLIST_FILE = "DirectHW-Info.plist";
- LLVM_LTO = YES_THIN;
- MACOSX_DEPLOYMENT_TARGET = 11.1;
- MARKETING_VERSION = 1.4;
- MODULE_VERSION = 1.4;
- ONLY_ACTIVE_ARCH = YES;
SDKROOT = macosx;
+ SYMROOT = build/buildlatest;
USE_HEADERMAP = NO;
- VERSIONING_SYSTEM = "apple-generic";
- VERSION_INFO_BUILDER = "Vampire Cat";
- VERSION_INFO_FILE = DHWVer.c;
};
name = Release;
};
@@ -412,19 +415,29 @@
CLANG_ANALYZER_DIVIDE_BY_ZERO = NO;
CLANG_ANALYZER_NULL_DEREFERENCE = NO;
CLANG_ENABLE_OBJC_WEAK = YES;
- COMBINE_HIDPI_IMAGES = YES;
- DEBUG_INFORMATION_FORMAT = dwarf;
+ CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO;
+ CURRENT_PROJECT_VERSION = "$(MODULE_VERSION)";
GCC_DYNAMIC_NO_PIC = NO;
+ GCC_ENABLE_FLOATING_POINT_LIBRARY_CALLS = NO;
+ GCC_ENABLE_KERNEL_DEVELOPMENT = YES;
GCC_MODEL_TUNING = G5;
- GCC_OPTIMIZATION_LEVEL = 0;
+ GCC_PREPROCESSOR_DEFINITIONS = (
+ "MODULE_VERSION=$(MODULE_VERSION)",
+ "PRODUCT_NAME=$(PRODUCT_NAME)",
+ "$(inherited)",
+ );
INFOPLIST_FILE = "DirectHW-Info.plist";
INSTALL_GROUP = wheel;
INSTALL_OWNER = root;
- MODULE_NAME = com.dcook.driver.DirectHW;
- PRODUCT_BUNDLE_IDENTIFIER = com.dcook.driver.DirectHW;
+ MACOSX_DEPLOYMENT_TARGET = 10.3;
+ MARKETING_VERSION = 1.6.2;
+ MODULE_NAME = com.coresystems.DirectHW;
+ MODULE_VERSION = 1.6.2;
+ OTHER_CFLAGS = "-DMAC_OS_X_VERSION_SDK=1070";
+ OTHER_LDFLAGS = "-static";
+ PRODUCT_BUNDLE_IDENTIFIER = com.coresystems.DirectHW;
PRODUCT_NAME = DirectHW;
RUN_CLANG_STATIC_ANALYZER = YES;
- VALID_ARCHS = "i386 x86_64";
WRAPPER_EXTENSION = kext;
ZERO_LINK = NO;
};
@@ -434,16 +447,27 @@
isa = XCBuildConfiguration;
buildSettings = {
CLANG_ENABLE_OBJC_WEAK = YES;
- COMBINE_HIDPI_IMAGES = YES;
- DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
+ CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO;
+ CURRENT_PROJECT_VERSION = "$(MODULE_VERSION)";
+ GCC_ENABLE_FLOATING_POINT_LIBRARY_CALLS = NO;
+ GCC_ENABLE_KERNEL_DEVELOPMENT = YES;
GCC_MODEL_TUNING = G5;
+ GCC_PREPROCESSOR_DEFINITIONS = (
+ "MODULE_VERSION=$(MODULE_VERSION)",
+ "PRODUCT_NAME=$(PRODUCT_NAME)",
+ );
INFOPLIST_FILE = "DirectHW-Info.plist";
INSTALL_GROUP = wheel;
INSTALL_OWNER = root;
- MODULE_NAME = com.dcook.driver.DirectHW;
- PRODUCT_BUNDLE_IDENTIFIER = com.dcook.driver.DirectHW;
+ MACOSX_DEPLOYMENT_TARGET = 10.3;
+ MARKETING_VERSION = 1.6.2;
+ MODULE_NAME = com.coresystems.DirectHW;
+ MODULE_VERSION = 1.6.2;
+ OTHER_CFLAGS = "-DMAC_OS_X_VERSION_SDK=1070";
+ OTHER_LDFLAGS = "-static";
+ PRODUCT_BUNDLE_IDENTIFIER = com.coresystems.DirectHW;
PRODUCT_NAME = DirectHW;
- VALID_ARCHS = "i386 x86_64";
+ STRIP_STYLE = "non-global";
WRAPPER_EXTENSION = kext;
ZERO_LINK = NO;
};
@@ -464,9 +488,6 @@
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
- CODE_SIGN_STYLE = Automatic;
- DEBUG_INFORMATION_FORMAT = dwarf;
- DEVELOPMENT_TEAM = YZAQ856TTM;
EXECUTABLE_PREFIX = lib;
GCC_C_LANGUAGE_STANDARD = gnu11;
GCC_DYNAMIC_NO_PIC = NO;
@@ -500,10 +521,7 @@
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
- CODE_SIGN_STYLE = Automatic;
COPY_PHASE_STRIP = NO;
- DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
- DEVELOPMENT_TEAM = YZAQ856TTM;
ENABLE_NS_ASSERTIONS = NO;
EXECUTABLE_PREFIX = lib;
GCC_C_LANGUAGE_STANDARD = gnu11;
@@ -521,17 +539,22 @@
isa = XCBuildConfiguration;
buildSettings = {
CLANG_ENABLE_OBJC_WEAK = YES;
- COMBINE_HIDPI_IMAGES = YES;
- COPY_PHASE_STRIP = NO;
+ CURRENT_PROJECT_VERSION = 1.6.2;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
FRAMEWORK_VERSION = A;
GCC_DYNAMIC_NO_PIC = NO;
- GCC_OPTIMIZATION_LEVEL = 0;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
+ GCC_PREPROCESSOR_DEFINITIONS = (
+ "MODULE_VERSION=$(MODULE_VERSION)",
+ "PRODUCT_NAME=$(PRODUCT_NAME)",
+ "$(inherited)",
+ );
INFOPLIST_FILE = "DirectHW-Framework-Info.plist";
INSTALL_PATH = "$(SYSTEM_LIBRARY_DIR)/Frameworks";
KEEP_PRIVATE_EXTERNS = NO;
+ MARKETING_VERSION = 1.6.2;
+ MODULE_VERSION = 1.6.2;
OTHER_LDFLAGS = "";
PRODUCT_BUNDLE_IDENTIFIER = com.coresystems.DirectHW;
PRODUCT_NAME = DirectHW;
@@ -542,15 +565,20 @@
isa = XCBuildConfiguration;
buildSettings = {
CLANG_ENABLE_OBJC_WEAK = YES;
- COMBINE_HIDPI_IMAGES = YES;
COPY_PHASE_STRIP = NO;
- DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
+ CURRENT_PROJECT_VERSION = 1.6.2;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
FRAMEWORK_VERSION = A;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
+ GCC_PREPROCESSOR_DEFINITIONS = (
+ "MODULE_VERSION=$(MODULE_VERSION)",
+ "PRODUCT_NAME=$(PRODUCT_NAME)",
+ );
INFOPLIST_FILE = "DirectHW-Framework-Info.plist";
INSTALL_PATH = "$(SYSTEM_LIBRARY_DIR)/Frameworks";
+ MARKETING_VERSION = 1.6.2;
+ MODULE_VERSION = 1.6.2;
OTHER_LDFLAGS = "";
PRODUCT_BUNDLE_IDENTIFIER = com.coresystems.DirectHW;
PRODUCT_NAME = DirectHW;
diff --git a/DirectHW/DirectHW.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/DirectHW/DirectHW.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
new file mode 100644
index 0000000..18d9810
--- /dev/null
+++ b/DirectHW/DirectHW.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
@@ -0,0 +1,8 @@
+
+
+
+
+ IDEDidComputeMac32BitWarning
+
+
+
diff --git a/DirectHW/DirectHW.xcodeproj/project.xcworkspace/xcuserdata/andyvand.xcuserdatad/UserInterfaceState.xcuserstate b/DirectHW/DirectHW.xcodeproj/project.xcworkspace/xcuserdata/andyvand.xcuserdatad/UserInterfaceState.xcuserstate
index c484217..b86447e 100644
Binary files a/DirectHW/DirectHW.xcodeproj/project.xcworkspace/xcuserdata/andyvand.xcuserdatad/UserInterfaceState.xcuserstate and b/DirectHW/DirectHW.xcodeproj/project.xcworkspace/xcuserdata/andyvand.xcuserdatad/UserInterfaceState.xcuserstate differ
diff --git a/DirectHW/DirectHW.xcodeproj/xcshareddata/xcschemes/DirectHW.xcscheme b/DirectHW/DirectHW.xcodeproj/xcshareddata/xcschemes/DirectHW.xcscheme
index d130c07..98b7fd9 100644
--- a/DirectHW/DirectHW.xcodeproj/xcshareddata/xcschemes/DirectHW.xcscheme
+++ b/DirectHW/DirectHW.xcodeproj/xcshareddata/xcschemes/DirectHW.xcscheme
@@ -1,6 +1,6 @@
- BuildMachineOSBuild
- 20C69
CFBundleDevelopmentRegion
- en_US
+ en
CFBundleExecutable
- DirectHW
+ $(EXECUTABLE_NAME)
CFBundleIdentifier
- com.dcook.driver.DirectHW
+ $(PRODUCT_BUNDLE_IDENTIFIER)
CFBundleInfoDictionaryVersion
6.0
CFBundleName
- DirectHW
+ $(PRODUCT_NAME)
CFBundlePackageType
KEXT
CFBundleShortVersionString
- 1.4
+ $(MODULE_VERSION)
CFBundleSignature
- DHWK
- CFBundleSupportedPlatforms
-
- MacOSX
-
+ ????
CFBundleVersion
- 1.4
- DTCompiler
- com.apple.compilers.llvm.clang.1_0
- DTPlatformBuild
- 12C33
- DTPlatformName
- macosx
- DTPlatformVersion
- 11.1
- DTSDKBuild
- 20C63
- DTSDKName
- macosx11.1
- DTXcode
- 1230
- DTXcodeBuild
- 12C33
+ $(MODULE_VERSION)
IOKitPersonalities
DirectHWUserClient
CFBundleIdentifier
- com.dcook.driver.DirectHW
+ $(PRODUCT_BUNDLE_IDENTIFIER)
IOClass
DirectHWService
IOMatchCategory
@@ -60,22 +38,20 @@
DirectHWUserClient
- LSMinimumSystemVersion
- 11.1
+ NSHumanReadableCopyright
+ Copyright © 2008-2010 coresystems GmbH <info@coresystems.de>. All rights reserved.
OSBundleCompatibleVersion
1.0
OSBundleLibraries
+ com.apple.iokit.IOPCIFamily
+ 1.0.0
com.apple.kpi.iokit
- 8.0.0d0
+ 7.0.0
com.apple.kpi.libkern
- 8.0.0d0
+ 7.0.0
com.apple.kpi.mach
- 8.0.0d0
- com.apple.kpi.unsupported
- 8.0.0b1
+ 7.0.0
- OSBundleRequied
- Root
diff --git a/DirectHW/DirectHW10.3.xcode/project.pbxproj b/DirectHW/DirectHW10.3.xcode/project.pbxproj
new file mode 100644
index 0000000..4ec8da1
--- /dev/null
+++ b/DirectHW/DirectHW10.3.xcode/project.pbxproj
@@ -0,0 +1,315 @@
+// !$*UTF8*$!
+{
+ archiveVersion = 1;
+ classes = {
+ };
+ objectVersion = 39;
+ objects = {
+ 06AA1265FFB2107B11CA28AA = {
+ buildSettings = {
+ COPY_PHASE_STRIP = NO;
+ GCC_DYNAMIC_NO_PIC = NO;
+ GCC_ENABLE_FIX_AND_CONTINUE = YES;
+ GCC_GENERATE_DEBUGGING_SYMBOLS = YES;
+ GCC_OPTIMIZATION_LEVEL = 0;
+ OPTIMIZATION_CFLAGS = "-O0";
+ PREBINDING = NO;
+ ZERO_LINK = NO;
+ };
+ isa = PBXBuildStyle;
+ name = Development;
+ };
+ 06AA1266FFB2107B11CA28AA = {
+ buildSettings = {
+ COPY_PHASE_STRIP = YES;
+ GCC_ENABLE_FIX_AND_CONTINUE = NO;
+ PREBINDING = NO;
+ ZERO_LINK = NO;
+ };
+ isa = PBXBuildStyle;
+ name = Deployment;
+ };
+//060
+//061
+//062
+//063
+//064
+//080
+//081
+//082
+//083
+//084
+ 089C1669FE841209C02AAC07 = {
+ buildSettings = {
+ };
+ buildStyles = (
+ 06AA1265FFB2107B11CA28AA,
+ 06AA1266FFB2107B11CA28AA,
+ );
+ hasScannedForEncodings = 1;
+ isa = PBXProject;
+ mainGroup = 089C166AFE841209C02AAC07;
+ projectDirPath = "";
+ targets = (
+ 32D94FC30562CBF700B6AF17,
+ );
+ };
+ 089C166AFE841209C02AAC07 = {
+ children = (
+ 247142CAFF3F8F9811CA285C,
+ 8DA80CCF06AD972A00E5AC22,
+ 089C167CFE841241C02AAC07,
+ 19C28FB6FE9D52B211CA2CBB,
+ );
+ isa = PBXGroup;
+ name = DirectHW10.3;
+ refType = 4;
+ sourceTree = "";
+ };
+ 089C167CFE841241C02AAC07 = {
+ children = (
+ 32D94FCF0562CBF700B6AF17,
+ );
+ isa = PBXGroup;
+ name = Resources;
+ refType = 4;
+ sourceTree = "";
+ };
+//080
+//081
+//082
+//083
+//084
+//190
+//191
+//192
+//193
+//194
+ 19C28FB6FE9D52B211CA2CBB = {
+ children = (
+ 32D94FD00562CBF700B6AF17,
+ );
+ isa = PBXGroup;
+ name = Products;
+ refType = 4;
+ sourceTree = "";
+ };
+//190
+//191
+//192
+//193
+//194
+//1A0
+//1A1
+//1A2
+//1A3
+//1A4
+ 1A224C3EFF42367911CA2CB7 = {
+ fileEncoding = 4;
+ isa = PBXFileReference;
+ lastKnownFileType = sourcecode.cpp.h;
+ path = DirectHW.hpp;
+ refType = 4;
+ sourceTree = "";
+ };
+ 1A224C3FFF42367911CA2CB7 = {
+ fileEncoding = 4;
+ isa = PBXFileReference;
+ lastKnownFileType = sourcecode.cpp.cpp;
+ path = DirectHW.cpp;
+ refType = 4;
+ sourceTree = "";
+ };
+//1A0
+//1A1
+//1A2
+//1A3
+//1A4
+//240
+//241
+//242
+//243
+//244
+ 247142CAFF3F8F9811CA285C = {
+ children = (
+ 1A224C3EFF42367911CA2CB7,
+ 1A224C3FFF42367911CA2CB7,
+ 6382F0422C19B9CB009F4BF6,
+ );
+ isa = PBXGroup;
+ name = Source;
+ path = "";
+ refType = 4;
+ sourceTree = "";
+ };
+//240
+//241
+//242
+//243
+//244
+//320
+//321
+//322
+//323
+//324
+ 32D94FC30562CBF700B6AF17 = {
+ buildPhases = (
+ 32D94FC40562CBF700B6AF17,
+ 32D94FC50562CBF700B6AF17,
+ 32D94FC70562CBF700B6AF17,
+ 32D94FC90562CBF700B6AF17,
+ 32D94FCB0562CBF700B6AF17,
+ 32D94FCC0562CBF700B6AF17,
+ 32D94FCD0562CBF700B6AF17,
+ );
+ buildRules = (
+ );
+ buildSettings = {
+ INFOPLIST_FILE = "DirectHW10.3-Info.plist";
+ INSTALL_PATH = "$(SYSTEM_LIBRARY_DIR)/Extensions";
+ MODULE_NAME = com.coresystems.DirectHW;
+ MODULE_VERSION = 1.6.2;
+ OTHER_CPLUSPLUSFLAGS = "-DMAC_OS_X_VERSION_SDK=1030";
+ PRODUCT_BUNDLE_IDENTIFIER = com.coresystems.DirectHW;
+ PRODUCT_NAME = DirectHW;
+ WRAPPER_EXTENSION = kext;
+ };
+ dependencies = (
+ );
+ isa = PBXNativeTarget;
+ name = DirectHW;
+ productInstallPath = "$(SYSTEM_LIBRARY_DIR)/Extensions";
+ productName = DirectHW10.3;
+ productReference = 32D94FD00562CBF700B6AF17;
+ productType = "com.apple.product-type.kernel-extension.iokit";
+ };
+ 32D94FC40562CBF700B6AF17 = {
+ buildActionMask = 2147483647;
+ files = (
+ );
+ isa = PBXShellScriptBuildPhase;
+ runOnlyForDeploymentPostprocessing = 0;
+ shellPath = /bin/sh;
+ shellScript = "script=\"${SYSTEM_DEVELOPER_DIR}/ProjectBuilder Extras/Kernel Extension Support/KEXTPreprocess\";\nif [ -x \"$script\" ]; then\n . \"$script\"\nfi";
+ };
+ 32D94FC50562CBF700B6AF17 = {
+ buildActionMask = 2147483647;
+ files = (
+ 32D94FC60562CBF700B6AF17,
+ 6382F0432C19B9CB009F4BF6,
+ );
+ isa = PBXHeadersBuildPhase;
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 32D94FC60562CBF700B6AF17 = {
+ fileRef = 1A224C3EFF42367911CA2CB7;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ 32D94FC70562CBF700B6AF17 = {
+ buildActionMask = 2147483647;
+ files = (
+ );
+ isa = PBXResourcesBuildPhase;
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 32D94FC90562CBF700B6AF17 = {
+ buildActionMask = 2147483647;
+ files = (
+ 32D94FCA0562CBF700B6AF17,
+ );
+ isa = PBXSourcesBuildPhase;
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 32D94FCA0562CBF700B6AF17 = {
+ fileRef = 1A224C3FFF42367911CA2CB7;
+ isa = PBXBuildFile;
+ settings = {
+ ATTRIBUTES = (
+ );
+ };
+ };
+ 32D94FCB0562CBF700B6AF17 = {
+ buildActionMask = 2147483647;
+ files = (
+ );
+ isa = PBXFrameworksBuildPhase;
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 32D94FCC0562CBF700B6AF17 = {
+ buildActionMask = 2147483647;
+ files = (
+ );
+ isa = PBXRezBuildPhase;
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 32D94FCD0562CBF700B6AF17 = {
+ buildActionMask = 2147483647;
+ files = (
+ );
+ isa = PBXShellScriptBuildPhase;
+ runOnlyForDeploymentPostprocessing = 0;
+ shellPath = /bin/sh;
+ shellScript = "script=\"${SYSTEM_DEVELOPER_DIR}/ProjectBuilder Extras/Kernel Extension Support/KEXTPostprocess\";\nif [ -x \"$script\" ]; then\n . \"$script\"\nfi";
+ };
+ 32D94FCF0562CBF700B6AF17 = {
+ isa = PBXFileReference;
+ lastKnownFileType = text.xml;
+ path = "DirectHW10.3-Info.plist";
+ refType = 4;
+ sourceTree = "";
+ };
+ 32D94FD00562CBF700B6AF17 = {
+ explicitFileType = wrapper.cfbundle;
+ includeInIndex = 0;
+ isa = PBXFileReference;
+ path = DirectHW.kext;
+ refType = 3;
+ sourceTree = BUILT_PRODUCTS_DIR;
+ };
+//320
+//321
+//322
+//323
+//324
+//630
+//631
+//632
+//633
+//634
+ 6382F0422C19B9CB009F4BF6 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ lastKnownFileType = sourcecode.c.h;
+ path = MacOSMacros.h;
+ refType = 4;
+ sourceTree = "";
+ };
+ 6382F0432C19B9CB009F4BF6 = {
+ fileRef = 6382F0422C19B9CB009F4BF6;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+//630
+//631
+//632
+//633
+//634
+//8D0
+//8D1
+//8D2
+//8D3
+//8D4
+ 8DA80CCF06AD972A00E5AC22 = {
+ isa = PBXFileReference;
+ lastKnownFileType = wrapper.framework;
+ name = Kernel.framework;
+ path = /System/Library/Frameworks/Kernel.framework;
+ refType = 0;
+ sourceTree = "";
+ };
+ };
+ rootObject = 089C1669FE841209C02AAC07;
+}
diff --git a/DirectHW/DirectHW10.4.xcodeproj/project.pbxproj b/DirectHW/DirectHW10.4.xcodeproj/project.pbxproj
new file mode 100644
index 0000000..e3a8f36
--- /dev/null
+++ b/DirectHW/DirectHW10.4.xcodeproj/project.pbxproj
@@ -0,0 +1,565 @@
+// !$*UTF8*$!
+{
+ archiveVersion = 1;
+ classes = {
+ };
+ objectVersion = 42;
+ objects = {
+
+/* Begin PBXBuildFile section */
+ 5D9932DD0D0F97EF00760F43 /* DirectHW.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5D9932B30D0F95DD00760F43 /* DirectHW.cpp */; };
+ AB83950A25B4B4DA001D8E16 /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AB66BE3125B4AE2C00943C69 /* IOKit.framework */; };
+ AB83952A25B4B69B001D8E16 /* DirectHW.h in Headers */ = {isa = PBXBuildFile; fileRef = FD12A6710E9235DB004BBD7B /* DirectHW.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ AB83953125B4B6A1001D8E16 /* DirectHW.c in Sources */ = {isa = PBXBuildFile; fileRef = FD12A6700E9235DB004BBD7B /* DirectHW.c */; };
+ AB83953525B4B6A5001D8E16 /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AB66BE3125B4AE2C00943C69 /* IOKit.framework */; };
+ FDC4F2BC0E923E0C0006B2A5 /* DirectHW.h in Headers */ = {isa = PBXBuildFile; fileRef = FD12A6710E9235DB004BBD7B /* DirectHW.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ FDC4F2BD0E923E100006B2A5 /* DirectHW.c in Sources */ = {isa = PBXBuildFile; fileRef = FD12A6700E9235DB004BBD7B /* DirectHW.c */; };
+/* End PBXBuildFile section */
+
+/* Begin PBXFileReference section */
+ 5D9932B30D0F95DD00760F43 /* DirectHW.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DirectHW.cpp; sourceTree = ""; tabWidth = 4; };
+ 5D9932B40D0F95DD00760F43 /* DirectHW.hpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = DirectHW.hpp; sourceTree = ""; tabWidth = 4; };
+ 5D9932D60D0F97D000760F43 /* DirectHW.kext */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = DirectHW.kext; sourceTree = BUILT_PRODUCTS_DIR; };
+ 5D9932D70D0F97D000760F43 /* DirectHW-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.xml; path = "DirectHW-Info.plist"; sourceTree = ""; };
+ 635989A22C314F870045F7CA /* DirectHWShared.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = DirectHWShared.h; sourceTree = ""; };
+ 63ECBFC82984EDB80031C612 /* MacOSMacros.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MacOSMacros.h; sourceTree = ""; };
+ AB66BE3125B4AE2C00943C69 /* IOKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = IOKit.framework; path = System/Library/Frameworks/IOKit.framework; sourceTree = SDKROOT; };
+ AB83952325B4B678001D8E16 /* libDirectHW.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libDirectHW.a; sourceTree = BUILT_PRODUCTS_DIR; };
+ FD12A6700E9235DB004BBD7B /* DirectHW.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = DirectHW.c; sourceTree = ""; };
+ FD12A6710E9235DB004BBD7B /* DirectHW.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DirectHW.h; sourceTree = ""; };
+ FDC4F1CB0E923CB30006B2A5 /* DirectHW-Framework-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.xml; path = "DirectHW-Framework-Info.plist"; sourceTree = ""; };
+ FDC4F2B50E923DF00006B2A5 /* DirectHW.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = DirectHW.framework; sourceTree = BUILT_PRODUCTS_DIR; };
+/* End PBXFileReference section */
+
+/* Begin PBXFrameworksBuildPhase section */
+ 5D9932D40D0F97D000760F43 /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ AB83952125B4B678001D8E16 /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ AB83953525B4B6A5001D8E16 /* IOKit.framework in Frameworks */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ FDC4F2B30E923DF00006B2A5 /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ AB83950A25B4B4DA001D8E16 /* IOKit.framework in Frameworks */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXFrameworksBuildPhase section */
+
+/* Begin PBXGroup section */
+ 5D9932890D0F94EE00760F43 = {
+ isa = PBXGroup;
+ children = (
+ AB66BE3225B4AE4200943C69 /* Resources */,
+ 63614FF92987AA7100593F0A /* Source Common */,
+ AB66BE2F25B4AE1C00943C69 /* Source Kernel */,
+ 5D9932940D0F94F500760F43 /* Source User */,
+ 5D99329C0D0F952400760F43 /* Products */,
+ AB66BE3025B4AE2600943C69 /* Frameworks */,
+ );
+ sourceTree = "";
+ };
+ 5D9932940D0F94F500760F43 /* Source User */ = {
+ isa = PBXGroup;
+ children = (
+ FD12A6700E9235DB004BBD7B /* DirectHW.c */,
+ FD12A6710E9235DB004BBD7B /* DirectHW.h */,
+ );
+ name = "Source User";
+ sourceTree = "";
+ };
+ 5D99329C0D0F952400760F43 /* Products */ = {
+ isa = PBXGroup;
+ children = (
+ 5D9932D60D0F97D000760F43 /* DirectHW.kext */,
+ FDC4F2B50E923DF00006B2A5 /* DirectHW.framework */,
+ AB83952325B4B678001D8E16 /* libDirectHW.a */,
+ );
+ name = Products;
+ sourceTree = "";
+ };
+ 63614FF92987AA7100593F0A /* Source Common */ = {
+ isa = PBXGroup;
+ children = (
+ 63ECBFC82984EDB80031C612 /* MacOSMacros.h */,
+ 635989A22C314F870045F7CA /* DirectHWShared.h */,
+ );
+ name = "Source Common";
+ sourceTree = "";
+ };
+ AB66BE2F25B4AE1C00943C69 /* Source Kernel */ = {
+ isa = PBXGroup;
+ children = (
+ 5D9932B30D0F95DD00760F43 /* DirectHW.cpp */,
+ 5D9932B40D0F95DD00760F43 /* DirectHW.hpp */,
+ );
+ name = "Source Kernel";
+ sourceTree = "";
+ };
+ AB66BE3025B4AE2600943C69 /* Frameworks */ = {
+ isa = PBXGroup;
+ children = (
+ AB66BE3125B4AE2C00943C69 /* IOKit.framework */,
+ );
+ name = Frameworks;
+ sourceTree = "";
+ };
+ AB66BE3225B4AE4200943C69 /* Resources */ = {
+ isa = PBXGroup;
+ children = (
+ 5D9932D70D0F97D000760F43 /* DirectHW-Info.plist */,
+ FDC4F1CB0E923CB30006B2A5 /* DirectHW-Framework-Info.plist */,
+ );
+ name = Resources;
+ sourceTree = "";
+ };
+/* End PBXGroup section */
+
+/* Begin PBXHeadersBuildPhase section */
+ AB83951F25B4B678001D8E16 /* Headers */ = {
+ isa = PBXHeadersBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ AB83952A25B4B69B001D8E16 /* DirectHW.h in Headers */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ FDC4F2B00E923DF00006B2A5 /* Headers */ = {
+ isa = PBXHeadersBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ FDC4F2BC0E923E0C0006B2A5 /* DirectHW.h in Headers */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXHeadersBuildPhase section */
+
+/* Begin PBXNativeTarget section */
+ 5D9932D50D0F97D000760F43 /* KEXT */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = 5D9932DB0D0F97D100760F43 /* Build configuration list for PBXNativeTarget "KEXT" */;
+ buildPhases = (
+ 5D9932D20D0F97D000760F43 /* Sources */,
+ 5D9932D40D0F97D000760F43 /* Frameworks */,
+ 5D9932D30D0F97D000760F43 /* Resources */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ );
+ name = KEXT;
+ productName = DirectHW;
+ productReference = 5D9932D60D0F97D000760F43 /* DirectHW.kext */;
+ productType = "com.apple.product-type.kernel-extension.iokit";
+ };
+ AB83952225B4B678001D8E16 /* libDirectHW */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = AB83952425B4B678001D8E16 /* Build configuration list for PBXNativeTarget "libDirectHW" */;
+ buildPhases = (
+ AB83952025B4B678001D8E16 /* Sources */,
+ AB83952125B4B678001D8E16 /* Frameworks */,
+ AB83951F25B4B678001D8E16 /* Headers */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ );
+ name = libDirectHW;
+ productName = libDirectHW;
+ productReference = AB83952325B4B678001D8E16 /* libDirectHW.a */;
+ productType = "com.apple.product-type.library.static";
+ };
+ FDC4F2B40E923DF00006B2A5 /* DirectHW */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = FDC4F2C00E923E2B0006B2A5 /* Build configuration list for PBXNativeTarget "DirectHW" */;
+ buildPhases = (
+ FDC4F2B20E923DF00006B2A5 /* Sources */,
+ FDC4F2B30E923DF00006B2A5 /* Frameworks */,
+ FDC4F2B00E923DF00006B2A5 /* Headers */,
+ FDC4F2B10E923DF00006B2A5 /* Resources */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ );
+ name = DirectHW;
+ productName = DirectHW;
+ productReference = FDC4F2B50E923DF00006B2A5 /* DirectHW.framework */;
+ productType = "com.apple.product-type.framework";
+ };
+/* End PBXNativeTarget section */
+
+/* Begin PBXProject section */
+ 5D99328B0D0F94EE00760F43 /* Project object */ = {
+ isa = PBXProject;
+ attributes = {
+ LastUpgradeCheck = 1420;
+ TargetAttributes = {
+ 5D9932D50D0F97D000760F43 = {
+ DevelopmentTeam = YZAQ856TTM;
+ };
+ AB83952225B4B678001D8E16 = {
+ CreatedOnToolsVersion = 12.3;
+ DevelopmentTeam = YZAQ856TTM;
+ ProvisioningStyle = Automatic;
+ };
+ FDC4F2B40E923DF00006B2A5 = {
+ DevelopmentTeam = YZAQ856TTM;
+ };
+ };
+ };
+ buildConfigurationList = 5D99328E0D0F94EE00760F43 /* Build configuration list for PBXProject "DirectHW10.4" */;
+ compatibilityVersion = "Xcode 3.1";
+ developmentRegion = en;
+ hasScannedForEncodings = 0;
+ knownRegions = (
+ en,
+ Base,
+ );
+ mainGroup = 5D9932890D0F94EE00760F43;
+ productRefGroup = 5D99329C0D0F952400760F43 /* Products */;
+ projectDirPath = "";
+ projectRoot = "";
+ targets = (
+ 5D9932D50D0F97D000760F43 /* KEXT */,
+ FDC4F2B40E923DF00006B2A5 /* DirectHW */,
+ AB83952225B4B678001D8E16 /* libDirectHW */,
+ );
+ };
+/* End PBXProject section */
+
+/* Begin PBXResourcesBuildPhase section */
+ 5D9932D30D0F97D000760F43 /* Resources */ = {
+ isa = PBXResourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ FDC4F2B10E923DF00006B2A5 /* Resources */ = {
+ isa = PBXResourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXResourcesBuildPhase section */
+
+/* Begin PBXSourcesBuildPhase section */
+ 5D9932D20D0F97D000760F43 /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 5D9932DD0D0F97EF00760F43 /* DirectHW.cpp in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ AB83952025B4B678001D8E16 /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ AB83953125B4B6A1001D8E16 /* DirectHW.c in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ FDC4F2B20E923DF00006B2A5 /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ FDC4F2BD0E923E100006B2A5 /* DirectHW.c in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXSourcesBuildPhase section */
+
+/* Begin XCBuildConfiguration section */
+ 5D99328C0D0F94EE00760F43 /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ ARCHS = (
+ i386,
+ ppc,
+ );
+ DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
+ GCC_NO_COMMON_BLOCKS = YES;
+ GCC_OPTIMIZATION_LEVEL = 0;
+ GCC_PREPROCESSOR_DEFINITIONS = (
+ "DEBUG=1",
+ "$(inherited)",
+ );
+ GCC_REUSE_STRINGS = NO;
+ GCC_SYMBOLS_PRIVATE_EXTERN = YES;
+ "GCC_VERSION[sdk=macosx10.4][arch=*]" = 4.0;
+ GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
+ GCC_WARN_TYPECHECK_CALLS_TO_PRINTF = YES;
+ GCC_WARN_UNDECLARED_SELECTOR = YES;
+ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
+ GCC_WARN_UNUSED_FUNCTION = YES;
+ GCC_WARN_UNUSED_LABEL = YES;
+ GCC_WARN_UNUSED_PARAMETER = YES;
+ GCC_WARN_UNUSED_VARIABLE = YES;
+ GENERATE_PKGINFO_FILE = YES;
+ KEEP_PRIVATE_EXTERNS = YES;
+ MACOSX_DEPLOYMENT_TARGET = 10.4;
+ "MACOSX_DEPLOYMENT_TARGET[arch=ppc64]" = 10.5;
+ "MACOSX_DEPLOYMENT_TARGET[arch=x86_64]" = 10.5;
+ OTHER_CPLUSPLUSFLAGS = (
+ "-DDEBUG_KEXT=1",
+ "-DDEBUG=1",
+ "$(OTHER_CFLAGS)",
+ );
+ RUN_CLANG_STATIC_ANALYZER = YES;
+ SDKROOT = /Developer/SDKs/MacOSX10.4u.sdk;
+ "SDKROOT[arch=ppc64]" = macosx10.5;
+ "SDKROOT[arch=x86_64]" = macosx10.5;
+ STRIP_INSTALLED_PRODUCT = NO;
+ SYMROOT = build/build10.4;
+ };
+ name = Debug;
+ };
+ 5D99328D0D0F94EE00760F43 /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ ARCHS = (
+ i386,
+ ppc,
+ );
+ DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
+ GCC_INLINES_ARE_PRIVATE_EXTERN = YES;
+ GCC_NO_COMMON_BLOCKS = YES;
+ GCC_OPTIMIZATION_LEVEL = 3;
+ GCC_SYMBOLS_PRIVATE_EXTERN = YES;
+ GCC_UNROLL_LOOPS = YES;
+ "GCC_VERSION[sdk=macosx10.4][arch=*]" = 4.0;
+ GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
+ GCC_WARN_TYPECHECK_CALLS_TO_PRINTF = YES;
+ GCC_WARN_UNDECLARED_SELECTOR = YES;
+ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
+ GCC_WARN_UNUSED_FUNCTION = YES;
+ GCC_WARN_UNUSED_LABEL = YES;
+ GCC_WARN_UNUSED_PARAMETER = YES;
+ GCC_WARN_UNUSED_VARIABLE = YES;
+ GENERATE_PKGINFO_FILE = YES;
+ MACOSX_DEPLOYMENT_TARGET = 10.4;
+ "MACOSX_DEPLOYMENT_TARGET[arch=ppc64]" = 10.5;
+ "MACOSX_DEPLOYMENT_TARGET[arch=x86_64]" = 10.5;
+ SDKROOT = /Developer/SDKs/MacOSX10.4u.sdk;
+ "SDKROOT[arch=ppc64]" = macosx10.5;
+ "SDKROOT[arch=x86_64]" = macosx10.5;
+ SYMROOT = build/build10.4;
+ };
+ name = Release;
+ };
+ 5D9932D90D0F97D100760F43 /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ARCHS = (
+ i386,
+ ppc,
+ );
+ CURRENT_PROJECT_VERSION = "$(MODULE_VERSION)";
+ GCC_MODEL_TUNING = G5;
+ GCC_PREPROCESSOR_DEFINITIONS = (
+ "MODULE_VERSION=$(MODULE_VERSION)",
+ "PRODUCT_NAME=$(PRODUCT_NAME)",
+ "$(inherited)",
+ );
+ GCC_REUSE_STRINGS = YES;
+ INFOPLIST_FILE = "DirectHW-Info.plist";
+ INSTALL_GROUP = wheel;
+ INSTALL_OWNER = root;
+ KEEP_PRIVATE_EXTERNS = YES;
+ MARKETING_VERSION = 1.6.2;
+ MODULE_NAME = com.coresystems.DirectHW;
+ MODULE_VERSION = 1.6.2;
+ OTHER_CFLAGS = "-DMAC_OS_X_VERSION_SDK=1040";
+ "OTHER_CFLAGS[arch=i386]" = "-DMAC_OS_X_VERSION_SDK=1040";
+ "OTHER_CFLAGS[arch=ppc]" = "-DMAC_OS_X_VERSION_SDK=1040 -DKPI_10_4_0_PPC_COMPAT";
+ OTHER_LDFLAGS = (
+ "-Xlinker",
+ "-no_uuid",
+ );
+ PRODUCT_BUNDLE_IDENTIFIER = com.coresystems.DirectHW;
+ PRODUCT_NAME = DirectHW;
+ STRIP_INSTALLED_PRODUCT = NO;
+ WRAPPER_EXTENSION = kext;
+ };
+ name = Debug;
+ };
+ 5D9932DA0D0F97D100760F43 /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ARCHS = (
+ i386,
+ ppc,
+ );
+ CURRENT_PROJECT_VERSION = "$(MODULE_VERSION)";
+ GCC_MODEL_TUNING = G5;
+ GCC_PREPROCESSOR_DEFINITIONS = (
+ "MODULE_VERSION=$(MODULE_VERSION)",
+ "PRODUCT_NAME=$(PRODUCT_NAME)",
+ "$(inherited)",
+ );
+ INFOPLIST_FILE = "DirectHW-Info.plist";
+ INSTALL_GROUP = wheel;
+ INSTALL_OWNER = root;
+ KEEP_PRIVATE_EXTERNS = YES;
+ MARKETING_VERSION = 1.6.2;
+ MODULE_NAME = com.coresystems.DirectHW;
+ MODULE_VERSION = 1.6.2;
+ OTHER_CFLAGS = (
+ "-DMAC_OS_X_VERSION_SDK=1040",
+ "-DKPI_10_4_0_PPC_COMPAT",
+ );
+ OTHER_LDFLAGS = (
+ "-Xlinker",
+ "-no_uuid",
+ );
+ PRODUCT_BUNDLE_IDENTIFIER = com.coresystems.DirectHW;
+ PRODUCT_NAME = DirectHW;
+ STRIP_INSTALLED_PRODUCT = NO;
+ WRAPPER_EXTENSION = kext;
+ };
+ name = Release;
+ };
+ AB83952525B4B678001D8E16 /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ EXECUTABLE_PREFIX = lib;
+ GCC_DYNAMIC_NO_PIC = NO;
+ GCC_NO_COMMON_BLOCKS = YES;
+ GCC_PREPROCESSOR_DEFINITIONS = (
+ "DEBUG=1",
+ "$(inherited)",
+ );
+ GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
+ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
+ MTL_FAST_MATH = YES;
+ PRODUCT_MODULE_NAME = DirectHW;
+ PRODUCT_NAME = DirectHW;
+ SKIP_INSTALL = YES;
+ };
+ name = Debug;
+ };
+ AB83952625B4B678001D8E16 /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ COPY_PHASE_STRIP = NO;
+ EXECUTABLE_PREFIX = lib;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
+ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
+ MTL_FAST_MATH = YES;
+ PRODUCT_MODULE_NAME = DirectHW;
+ PRODUCT_NAME = DirectHW;
+ SKIP_INSTALL = YES;
+ };
+ name = Release;
+ };
+ FDC4F2B60E923DF00006B2A5 /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ CURRENT_PROJECT_VERSION = 1.6.2;
+ DYLIB_COMPATIBILITY_VERSION = 1;
+ DYLIB_CURRENT_VERSION = 1;
+ FRAMEWORK_VERSION = A;
+ GCC_DYNAMIC_NO_PIC = NO;
+ GCC_PRECOMPILE_PREFIX_HEADER = YES;
+ GCC_PREPROCESSOR_DEFINITIONS = (
+ "MODULE_VERSION=$(MODULE_VERSION)",
+ "PRODUCT_NAME=$(PRODUCT_NAME)",
+ "$(inherited)",
+ );
+ INFOPLIST_FILE = "DirectHW-Framework-Info.plist";
+ INSTALL_PATH = "$(SYSTEM_LIBRARY_DIR)/Frameworks";
+ KEEP_PRIVATE_EXTERNS = NO;
+ MARKETING_VERSION = 1.6.2;
+ MODULE_VERSION = 1.6.2;
+ OTHER_LDFLAGS = "";
+ PRODUCT_BUNDLE_IDENTIFIER = com.coresystems.DirectHW;
+ PRODUCT_NAME = DirectHW;
+ };
+ name = Debug;
+ };
+ FDC4F2B70E923DF00006B2A5 /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ COPY_PHASE_STRIP = NO;
+ CURRENT_PROJECT_VERSION = 1.6.2;
+ DYLIB_COMPATIBILITY_VERSION = 1;
+ DYLIB_CURRENT_VERSION = 1;
+ FRAMEWORK_VERSION = A;
+ GCC_PRECOMPILE_PREFIX_HEADER = YES;
+ GCC_PREPROCESSOR_DEFINITIONS = (
+ "MODULE_VERSION=$(MODULE_VERSION)",
+ "PRODUCT_NAME=$(PRODUCT_NAME)",
+ );
+ INFOPLIST_FILE = "DirectHW-Framework-Info.plist";
+ INSTALL_PATH = "$(SYSTEM_LIBRARY_DIR)/Frameworks";
+ MARKETING_VERSION = 1.6.2;
+ MODULE_VERSION = 1.6.2;
+ OTHER_LDFLAGS = "";
+ PRODUCT_BUNDLE_IDENTIFIER = com.coresystems.DirectHW;
+ PRODUCT_NAME = DirectHW;
+ };
+ name = Release;
+ };
+/* End XCBuildConfiguration section */
+
+/* Begin XCConfigurationList section */
+ 5D99328E0D0F94EE00760F43 /* Build configuration list for PBXProject "DirectHW10.4" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 5D99328C0D0F94EE00760F43 /* Debug */,
+ 5D99328D0D0F94EE00760F43 /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+ 5D9932DB0D0F97D100760F43 /* Build configuration list for PBXNativeTarget "KEXT" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 5D9932D90D0F97D100760F43 /* Debug */,
+ 5D9932DA0D0F97D100760F43 /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+ AB83952425B4B678001D8E16 /* Build configuration list for PBXNativeTarget "libDirectHW" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ AB83952525B4B678001D8E16 /* Debug */,
+ AB83952625B4B678001D8E16 /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+ FDC4F2C00E923E2B0006B2A5 /* Build configuration list for PBXNativeTarget "DirectHW" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ FDC4F2B60E923DF00006B2A5 /* Debug */,
+ FDC4F2B70E923DF00006B2A5 /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+/* End XCConfigurationList section */
+ };
+ rootObject = 5D99328B0D0F94EE00760F43 /* Project object */;
+}
diff --git a/DirectHW/DirectHW10.4.xcodeproj/xcshareddata/xcschemes/DirectHW.xcscheme b/DirectHW/DirectHW10.4.xcodeproj/xcshareddata/xcschemes/DirectHW.xcscheme
new file mode 100644
index 0000000..98b7fd9
--- /dev/null
+++ b/DirectHW/DirectHW10.4.xcodeproj/xcshareddata/xcschemes/DirectHW.xcscheme
@@ -0,0 +1,67 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/DirectHW/DirectHW10.4.xcodeproj/xcshareddata/xcschemes/KEXT.xcscheme b/DirectHW/DirectHW10.4.xcodeproj/xcshareddata/xcschemes/KEXT.xcscheme
new file mode 100644
index 0000000..4d8aa20
--- /dev/null
+++ b/DirectHW/DirectHW10.4.xcodeproj/xcshareddata/xcschemes/KEXT.xcscheme
@@ -0,0 +1,67 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/DirectHW/DirectHW10.4.xcodeproj/xcshareddata/xcschemes/libDirectHW.xcscheme b/DirectHW/DirectHW10.4.xcodeproj/xcshareddata/xcschemes/libDirectHW.xcscheme
new file mode 100644
index 0000000..1a85bd4
--- /dev/null
+++ b/DirectHW/DirectHW10.4.xcodeproj/xcshareddata/xcschemes/libDirectHW.xcscheme
@@ -0,0 +1,67 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/DirectHW/DirectHW10.5.xcodeproj/project.pbxproj b/DirectHW/DirectHW10.5.xcodeproj/project.pbxproj
new file mode 100644
index 0000000..882ff0e
--- /dev/null
+++ b/DirectHW/DirectHW10.5.xcodeproj/project.pbxproj
@@ -0,0 +1,574 @@
+// !$*UTF8*$!
+{
+ archiveVersion = 1;
+ classes = {
+ };
+ objectVersion = 45;
+ objects = {
+
+/* Begin PBXBuildFile section */
+ 5D9932DD0D0F97EF00760F43 /* DirectHW.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5D9932B30D0F95DD00760F43 /* DirectHW.cpp */; };
+ AB83950A25B4B4DA001D8E16 /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AB66BE3125B4AE2C00943C69 /* IOKit.framework */; };
+ AB83952A25B4B69B001D8E16 /* DirectHW.h in Headers */ = {isa = PBXBuildFile; fileRef = FD12A6710E9235DB004BBD7B /* DirectHW.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ AB83953125B4B6A1001D8E16 /* DirectHW.c in Sources */ = {isa = PBXBuildFile; fileRef = FD12A6700E9235DB004BBD7B /* DirectHW.c */; };
+ AB83953525B4B6A5001D8E16 /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AB66BE3125B4AE2C00943C69 /* IOKit.framework */; };
+ FDC4F2BC0E923E0C0006B2A5 /* DirectHW.h in Headers */ = {isa = PBXBuildFile; fileRef = FD12A6710E9235DB004BBD7B /* DirectHW.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ FDC4F2BD0E923E100006B2A5 /* DirectHW.c in Sources */ = {isa = PBXBuildFile; fileRef = FD12A6700E9235DB004BBD7B /* DirectHW.c */; };
+/* End PBXBuildFile section */
+
+/* Begin PBXFileReference section */
+ 5D9932B30D0F95DD00760F43 /* DirectHW.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DirectHW.cpp; sourceTree = ""; tabWidth = 4; };
+ 5D9932B40D0F95DD00760F43 /* DirectHW.hpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = DirectHW.hpp; sourceTree = ""; tabWidth = 4; };
+ 5D9932D60D0F97D000760F43 /* DirectHW.kext */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = DirectHW.kext; sourceTree = BUILT_PRODUCTS_DIR; };
+ 5D9932D70D0F97D000760F43 /* DirectHW-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "DirectHW-Info.plist"; sourceTree = ""; };
+ 63BF51882C27984B00F0A2FD /* DirectHWShared.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DirectHWShared.h; sourceTree = ""; };
+ 63ECBFC82984EDB80031C612 /* MacOSMacros.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MacOSMacros.h; sourceTree = ""; };
+ AB66BE3125B4AE2C00943C69 /* IOKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = IOKit.framework; path = System/Library/Frameworks/IOKit.framework; sourceTree = SDKROOT; };
+ AB83952325B4B678001D8E16 /* libDirectHW.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libDirectHW.a; sourceTree = BUILT_PRODUCTS_DIR; };
+ FD12A6700E9235DB004BBD7B /* DirectHW.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = DirectHW.c; sourceTree = ""; };
+ FD12A6710E9235DB004BBD7B /* DirectHW.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DirectHW.h; sourceTree = ""; };
+ FDC4F1CB0E923CB30006B2A5 /* DirectHW-Framework-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "DirectHW-Framework-Info.plist"; sourceTree = ""; };
+ FDC4F2B50E923DF00006B2A5 /* DirectHW.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = DirectHW.framework; sourceTree = BUILT_PRODUCTS_DIR; };
+/* End PBXFileReference section */
+
+/* Begin PBXFrameworksBuildPhase section */
+ 5D9932D40D0F97D000760F43 /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ AB83952125B4B678001D8E16 /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ AB83953525B4B6A5001D8E16 /* IOKit.framework in Frameworks */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ FDC4F2B30E923DF00006B2A5 /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ AB83950A25B4B4DA001D8E16 /* IOKit.framework in Frameworks */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXFrameworksBuildPhase section */
+
+/* Begin PBXGroup section */
+ 5D9932890D0F94EE00760F43 = {
+ isa = PBXGroup;
+ children = (
+ AB66BE3225B4AE4200943C69 /* Resources */,
+ 63614FF92987AA7100593F0A /* Source Common */,
+ AB66BE2F25B4AE1C00943C69 /* Source Kernel */,
+ 5D9932940D0F94F500760F43 /* Source User */,
+ 5D99329C0D0F952400760F43 /* Products */,
+ AB66BE3025B4AE2600943C69 /* Frameworks */,
+ );
+ sourceTree = "";
+ };
+ 5D9932940D0F94F500760F43 /* Source User */ = {
+ isa = PBXGroup;
+ children = (
+ FD12A6700E9235DB004BBD7B /* DirectHW.c */,
+ FD12A6710E9235DB004BBD7B /* DirectHW.h */,
+ );
+ name = "Source User";
+ sourceTree = "";
+ };
+ 5D99329C0D0F952400760F43 /* Products */ = {
+ isa = PBXGroup;
+ children = (
+ 5D9932D60D0F97D000760F43 /* DirectHW.kext */,
+ FDC4F2B50E923DF00006B2A5 /* DirectHW.framework */,
+ AB83952325B4B678001D8E16 /* libDirectHW.a */,
+ );
+ name = Products;
+ sourceTree = "";
+ };
+ 63614FF92987AA7100593F0A /* Source Common */ = {
+ isa = PBXGroup;
+ children = (
+ 63BF51882C27984B00F0A2FD /* DirectHWShared.h */,
+ 63ECBFC82984EDB80031C612 /* MacOSMacros.h */,
+ );
+ name = "Source Common";
+ sourceTree = "";
+ };
+ AB66BE2F25B4AE1C00943C69 /* Source Kernel */ = {
+ isa = PBXGroup;
+ children = (
+ 5D9932B30D0F95DD00760F43 /* DirectHW.cpp */,
+ 5D9932B40D0F95DD00760F43 /* DirectHW.hpp */,
+ );
+ name = "Source Kernel";
+ sourceTree = "";
+ };
+ AB66BE3025B4AE2600943C69 /* Frameworks */ = {
+ isa = PBXGroup;
+ children = (
+ AB66BE3125B4AE2C00943C69 /* IOKit.framework */,
+ );
+ name = Frameworks;
+ sourceTree = "";
+ };
+ AB66BE3225B4AE4200943C69 /* Resources */ = {
+ isa = PBXGroup;
+ children = (
+ 5D9932D70D0F97D000760F43 /* DirectHW-Info.plist */,
+ FDC4F1CB0E923CB30006B2A5 /* DirectHW-Framework-Info.plist */,
+ );
+ name = Resources;
+ sourceTree = "";
+ };
+/* End PBXGroup section */
+
+/* Begin PBXHeadersBuildPhase section */
+ AB83951F25B4B678001D8E16 /* Headers */ = {
+ isa = PBXHeadersBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ AB83952A25B4B69B001D8E16 /* DirectHW.h in Headers */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ FDC4F2B00E923DF00006B2A5 /* Headers */ = {
+ isa = PBXHeadersBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ FDC4F2BC0E923E0C0006B2A5 /* DirectHW.h in Headers */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXHeadersBuildPhase section */
+
+/* Begin PBXNativeTarget section */
+ 5D9932D50D0F97D000760F43 /* KEXT */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = 5D9932DB0D0F97D100760F43 /* Build configuration list for PBXNativeTarget "KEXT" */;
+ buildPhases = (
+ 5D9932D20D0F97D000760F43 /* Sources */,
+ 5D9932D40D0F97D000760F43 /* Frameworks */,
+ 5D9932D30D0F97D000760F43 /* Resources */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ );
+ name = KEXT;
+ productName = DirectHW;
+ productReference = 5D9932D60D0F97D000760F43 /* DirectHW.kext */;
+ productType = "com.apple.product-type.kernel-extension.iokit";
+ };
+ AB83952225B4B678001D8E16 /* libDirectHW */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = AB83952425B4B678001D8E16 /* Build configuration list for PBXNativeTarget "libDirectHW" */;
+ buildPhases = (
+ AB83952025B4B678001D8E16 /* Sources */,
+ AB83952125B4B678001D8E16 /* Frameworks */,
+ AB83951F25B4B678001D8E16 /* Headers */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ );
+ name = libDirectHW;
+ productName = libDirectHW;
+ productReference = AB83952325B4B678001D8E16 /* libDirectHW.a */;
+ productType = "com.apple.product-type.library.static";
+ };
+ FDC4F2B40E923DF00006B2A5 /* DirectHW */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = FDC4F2C00E923E2B0006B2A5 /* Build configuration list for PBXNativeTarget "DirectHW" */;
+ buildPhases = (
+ FDC4F2B20E923DF00006B2A5 /* Sources */,
+ FDC4F2B30E923DF00006B2A5 /* Frameworks */,
+ FDC4F2B00E923DF00006B2A5 /* Headers */,
+ FDC4F2B10E923DF00006B2A5 /* Resources */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ );
+ name = DirectHW;
+ productName = DirectHW;
+ productReference = FDC4F2B50E923DF00006B2A5 /* DirectHW.framework */;
+ productType = "com.apple.product-type.framework";
+ };
+/* End PBXNativeTarget section */
+
+/* Begin PBXProject section */
+ 5D99328B0D0F94EE00760F43 /* Project object */ = {
+ isa = PBXProject;
+ attributes = {
+ LastUpgradeCheck = 1420;
+ TargetAttributes = {
+ 5D9932D50D0F97D000760F43 = {
+ DevelopmentTeam = YZAQ856TTM;
+ };
+ AB83952225B4B678001D8E16 = {
+ CreatedOnToolsVersion = 12.3;
+ DevelopmentTeam = YZAQ856TTM;
+ ProvisioningStyle = Automatic;
+ };
+ FDC4F2B40E923DF00006B2A5 = {
+ DevelopmentTeam = YZAQ856TTM;
+ };
+ };
+ };
+ buildConfigurationList = 5D99328E0D0F94EE00760F43 /* Build configuration list for PBXProject "DirectHW10.5" */;
+ compatibilityVersion = "Xcode 3.1";
+ developmentRegion = en;
+ hasScannedForEncodings = 0;
+ knownRegions = (
+ en,
+ Base,
+ );
+ mainGroup = 5D9932890D0F94EE00760F43;
+ productRefGroup = 5D99329C0D0F952400760F43 /* Products */;
+ projectDirPath = "";
+ projectRoot = "";
+ targets = (
+ 5D9932D50D0F97D000760F43 /* KEXT */,
+ FDC4F2B40E923DF00006B2A5 /* DirectHW */,
+ AB83952225B4B678001D8E16 /* libDirectHW */,
+ );
+ };
+/* End PBXProject section */
+
+/* Begin PBXResourcesBuildPhase section */
+ 5D9932D30D0F97D000760F43 /* Resources */ = {
+ isa = PBXResourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ FDC4F2B10E923DF00006B2A5 /* Resources */ = {
+ isa = PBXResourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXResourcesBuildPhase section */
+
+/* Begin PBXSourcesBuildPhase section */
+ 5D9932D20D0F97D000760F43 /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 5D9932DD0D0F97EF00760F43 /* DirectHW.cpp in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ AB83952025B4B678001D8E16 /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ AB83953125B4B6A1001D8E16 /* DirectHW.c in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ FDC4F2B20E923DF00006B2A5 /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ FDC4F2BD0E923E100006B2A5 /* DirectHW.c in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXSourcesBuildPhase section */
+
+/* Begin XCBuildConfiguration section */
+ 5D99328C0D0F94EE00760F43 /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ ARCHS = (
+ x86_64,
+ i386,
+ ppc,
+ ppc64,
+ );
+ COPY_PHASE_STRIP = NO;
+ DEBUG_INFORMATION_FORMAT = dwarf;
+ GCC_NO_COMMON_BLOCKS = YES;
+ GCC_OPTIMIZATION_LEVEL = 0;
+ GCC_PREPROCESSOR_DEFINITIONS = (
+ "DEBUG=1",
+ "$(inherited)",
+ );
+ GCC_REUSE_STRINGS = NO;
+ GCC_SYMBOLS_PRIVATE_EXTERN = YES;
+ "GCC_VERSION[sdk=macosx10.4][arch=*]" = 4.0;
+ GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
+ GCC_WARN_UNDECLARED_SELECTOR = YES;
+ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
+ GCC_WARN_UNUSED_FUNCTION = YES;
+ GCC_WARN_UNUSED_LABEL = YES;
+ GCC_WARN_UNUSED_PARAMETER = YES;
+ GCC_WARN_UNUSED_VARIABLE = YES;
+ GENERATE_PKGINFO_FILE = YES;
+ KEEP_PRIVATE_EXTERNS = YES;
+ MACOSX_DEPLOYMENT_TARGET = 10.4;
+ "MACOSX_DEPLOYMENT_TARGET[arch=ppc64]" = 10.5;
+ "MACOSX_DEPLOYMENT_TARGET[arch=x86_64]" = 10.5;
+ OTHER_CPLUSPLUSFLAGS = (
+ "-DDEBUG_KEXT=1",
+ "-DDEBUG=1",
+ "$(OTHER_CFLAGS)",
+ );
+ RUN_CLANG_STATIC_ANALYZER = YES;
+ SDKROOT = macosx10.4;
+ "SDKROOT[arch=ppc64]" = macosx10.5;
+ "SDKROOT[arch=x86_64]" = macosx10.5;
+ STRIP_INSTALLED_PRODUCT = NO;
+ SYMROOT = build/build10.5;
+ };
+ name = Debug;
+ };
+ 5D99328D0D0F94EE00760F43 /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ ARCHS = (
+ x86_64,
+ i386,
+ ppc,
+ ppc64,
+ );
+ COPY_PHASE_STRIP = NO;
+ DEBUG_INFORMATION_FORMAT = dwarf;
+ GCC_INLINES_ARE_PRIVATE_EXTERN = YES;
+ GCC_NO_COMMON_BLOCKS = YES;
+ GCC_OPTIMIZATION_LEVEL = 3;
+ GCC_SYMBOLS_PRIVATE_EXTERN = YES;
+ GCC_UNROLL_LOOPS = YES;
+ "GCC_VERSION[sdk=macosx10.4][arch=*]" = 4.0;
+ GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
+ GCC_WARN_UNDECLARED_SELECTOR = YES;
+ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
+ GCC_WARN_UNUSED_FUNCTION = YES;
+ GCC_WARN_UNUSED_LABEL = YES;
+ GCC_WARN_UNUSED_PARAMETER = YES;
+ GCC_WARN_UNUSED_VARIABLE = YES;
+ GENERATE_PKGINFO_FILE = YES;
+ MACOSX_DEPLOYMENT_TARGET = 10.4;
+ "MACOSX_DEPLOYMENT_TARGET[arch=ppc64]" = 10.5;
+ "MACOSX_DEPLOYMENT_TARGET[arch=x86_64]" = 10.5;
+ SDKROOT = macosx10.4;
+ "SDKROOT[arch=ppc64]" = macosx10.5;
+ "SDKROOT[arch=x86_64]" = macosx10.5;
+ SYMROOT = build/build10.5;
+ };
+ name = Release;
+ };
+ 5D9932D90D0F97D100760F43 /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ARCHS = (
+ i386,
+ ppc,
+ );
+ CURRENT_PROJECT_VERSION = "$(MODULE_VERSION)";
+ GCC_MODEL_TUNING = G5;
+ GCC_PREPROCESSOR_DEFINITIONS = (
+ "MODULE_VERSION=$(MODULE_VERSION)",
+ "PRODUCT_NAME=$(PRODUCT_NAME)",
+ "$(inherited)",
+ );
+ GCC_REUSE_STRINGS = YES;
+ INFOPLIST_FILE = "DirectHW-Info.plist";
+ INSTALL_GROUP = wheel;
+ INSTALL_OWNER = root;
+ KEEP_PRIVATE_EXTERNS = YES;
+ MARKETING_VERSION = 1.6.2;
+ MODULE_NAME = com.coresystems.DirectHW;
+ MODULE_VERSION = 1.6.2;
+ "OTHER_CFLAGS[sdk=macosx10.4][arch=i386]" = "-DMAC_OS_X_VERSION_SDK=1040";
+ "OTHER_CFLAGS[sdk=macosx10.4][arch=ppc]" = (
+ "-DMAC_OS_X_VERSION_SDK=1040",
+ "-DKPI_10_4_0_PPC_COMPAT",
+ );
+ "OTHER_CFLAGS[sdk=macosx10.5][arch=*]" = "-DMAC_OS_X_VERSION_SDK=1050";
+ "OTHER_CFLAGS[sdk=macosx10.6][arch=*]" = "-DMAC_OS_X_VERSION_SDK=1060";
+ OTHER_LDFLAGS = (
+ "-Xlinker",
+ "-no_uuid",
+ );
+ PRODUCT_BUNDLE_IDENTIFIER = com.coresystems.DirectHW;
+ PRODUCT_NAME = DirectHW;
+ STRIP_INSTALLED_PRODUCT = NO;
+ WRAPPER_EXTENSION = kext;
+ };
+ name = Debug;
+ };
+ 5D9932DA0D0F97D100760F43 /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ARCHS = (
+ i386,
+ ppc,
+ );
+ CURRENT_PROJECT_VERSION = "$(MODULE_VERSION)";
+ GCC_MODEL_TUNING = G5;
+ GCC_PREPROCESSOR_DEFINITIONS = (
+ "MODULE_VERSION=$(MODULE_VERSION)",
+ "PRODUCT_NAME=$(PRODUCT_NAME)",
+ "$(inherited)",
+ );
+ INFOPLIST_FILE = "DirectHW-Info.plist";
+ INSTALL_GROUP = wheel;
+ INSTALL_OWNER = root;
+ KEEP_PRIVATE_EXTERNS = YES;
+ MARKETING_VERSION = 1.6.2;
+ MODULE_NAME = com.coresystems.DirectHW;
+ MODULE_VERSION = 1.6.2;
+ "OTHER_CFLAGS[sdk=macosx10.4][arch=i386]" = "-DMAC_OS_X_VERSION_SDK=1040";
+ "OTHER_CFLAGS[sdk=macosx10.4][arch=ppc]" = (
+ "-DMAC_OS_X_VERSION_SDK=1040",
+ "-DKPI_10_4_0_PPC_COMPAT",
+ );
+ "OTHER_CFLAGS[sdk=macosx10.5][arch=*]" = "-DMAC_OS_X_VERSION_SDK=1050";
+ "OTHER_CFLAGS[sdk=macosx10.6][arch=*]" = "-DMAC_OS_X_VERSION_SDK=1060";
+ OTHER_LDFLAGS = (
+ "-Xlinker",
+ "-no_uuid",
+ );
+ PRODUCT_BUNDLE_IDENTIFIER = com.coresystems.DirectHW;
+ PRODUCT_NAME = DirectHW;
+ STRIP_INSTALLED_PRODUCT = NO;
+ WRAPPER_EXTENSION = kext;
+ };
+ name = Release;
+ };
+ AB83952525B4B678001D8E16 /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ EXECUTABLE_PREFIX = lib;
+ GCC_DYNAMIC_NO_PIC = NO;
+ GCC_NO_COMMON_BLOCKS = YES;
+ GCC_PREPROCESSOR_DEFINITIONS = (
+ "DEBUG=1",
+ "$(inherited)",
+ );
+ GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
+ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
+ MTL_FAST_MATH = YES;
+ PRODUCT_MODULE_NAME = DirectHW;
+ PRODUCT_NAME = DirectHW;
+ SKIP_INSTALL = YES;
+ };
+ name = Debug;
+ };
+ AB83952625B4B678001D8E16 /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ EXECUTABLE_PREFIX = lib;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
+ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
+ MTL_FAST_MATH = YES;
+ PRODUCT_MODULE_NAME = DirectHW;
+ PRODUCT_NAME = DirectHW;
+ SKIP_INSTALL = YES;
+ };
+ name = Release;
+ };
+ FDC4F2B60E923DF00006B2A5 /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ CURRENT_PROJECT_VERSION = 1.6.2;
+ DYLIB_COMPATIBILITY_VERSION = 1;
+ DYLIB_CURRENT_VERSION = 1;
+ FRAMEWORK_VERSION = A;
+ GCC_DYNAMIC_NO_PIC = NO;
+ GCC_PRECOMPILE_PREFIX_HEADER = YES;
+ GCC_PREPROCESSOR_DEFINITIONS = (
+ "MODULE_VERSION=$(MODULE_VERSION)",
+ "PRODUCT_NAME=$(PRODUCT_NAME)",
+ "$(inherited)",
+ );
+ INFOPLIST_FILE = "DirectHW-Framework-Info.plist";
+ INSTALL_PATH = "$(SYSTEM_LIBRARY_DIR)/Frameworks";
+ KEEP_PRIVATE_EXTERNS = NO;
+ MARKETING_VERSION = 1.6.2;
+ MODULE_VERSION = 1.6.2;
+ OTHER_LDFLAGS = "";
+ PRODUCT_BUNDLE_IDENTIFIER = com.coresystems.DirectHW;
+ PRODUCT_NAME = DirectHW;
+ };
+ name = Debug;
+ };
+ FDC4F2B70E923DF00006B2A5 /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ CURRENT_PROJECT_VERSION = 1.6.2;
+ DYLIB_COMPATIBILITY_VERSION = 1;
+ DYLIB_CURRENT_VERSION = 1;
+ FRAMEWORK_VERSION = A;
+ GCC_PRECOMPILE_PREFIX_HEADER = YES;
+ GCC_PREPROCESSOR_DEFINITIONS = (
+ "MODULE_VERSION=$(MODULE_VERSION)",
+ "PRODUCT_NAME=$(PRODUCT_NAME)",
+ );
+ INFOPLIST_FILE = "DirectHW-Framework-Info.plist";
+ INSTALL_PATH = "$(SYSTEM_LIBRARY_DIR)/Frameworks";
+ MARKETING_VERSION = 1.6.2;
+ MODULE_VERSION = 1.6.2;
+ OTHER_LDFLAGS = "";
+ PRODUCT_BUNDLE_IDENTIFIER = com.coresystems.DirectHW;
+ PRODUCT_NAME = DirectHW;
+ };
+ name = Release;
+ };
+/* End XCBuildConfiguration section */
+
+/* Begin XCConfigurationList section */
+ 5D99328E0D0F94EE00760F43 /* Build configuration list for PBXProject "DirectHW10.5" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 5D99328C0D0F94EE00760F43 /* Debug */,
+ 5D99328D0D0F94EE00760F43 /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+ 5D9932DB0D0F97D100760F43 /* Build configuration list for PBXNativeTarget "KEXT" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 5D9932D90D0F97D100760F43 /* Debug */,
+ 5D9932DA0D0F97D100760F43 /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+ AB83952425B4B678001D8E16 /* Build configuration list for PBXNativeTarget "libDirectHW" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ AB83952525B4B678001D8E16 /* Debug */,
+ AB83952625B4B678001D8E16 /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+ FDC4F2C00E923E2B0006B2A5 /* Build configuration list for PBXNativeTarget "DirectHW" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ FDC4F2B60E923DF00006B2A5 /* Debug */,
+ FDC4F2B70E923DF00006B2A5 /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+/* End XCConfigurationList section */
+ };
+ rootObject = 5D99328B0D0F94EE00760F43 /* Project object */;
+}
diff --git a/DirectHW/DirectHW10.5.xcodeproj/xcshareddata/xcschemes/DirectHW.xcscheme b/DirectHW/DirectHW10.5.xcodeproj/xcshareddata/xcschemes/DirectHW.xcscheme
new file mode 100644
index 0000000..98b7fd9
--- /dev/null
+++ b/DirectHW/DirectHW10.5.xcodeproj/xcshareddata/xcschemes/DirectHW.xcscheme
@@ -0,0 +1,67 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/DirectHW/DirectHW10.5.xcodeproj/xcshareddata/xcschemes/KEXT.xcscheme b/DirectHW/DirectHW10.5.xcodeproj/xcshareddata/xcschemes/KEXT.xcscheme
new file mode 100644
index 0000000..4d8aa20
--- /dev/null
+++ b/DirectHW/DirectHW10.5.xcodeproj/xcshareddata/xcschemes/KEXT.xcscheme
@@ -0,0 +1,67 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/DirectHW/DirectHW10.5.xcodeproj/xcshareddata/xcschemes/libDirectHW.xcscheme b/DirectHW/DirectHW10.5.xcodeproj/xcshareddata/xcschemes/libDirectHW.xcscheme
new file mode 100644
index 0000000..1a85bd4
--- /dev/null
+++ b/DirectHW/DirectHW10.5.xcodeproj/xcshareddata/xcschemes/libDirectHW.xcscheme
@@ -0,0 +1,67 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/DirectHW/DirectHW10.6.xcodeproj/project.pbxproj b/DirectHW/DirectHW10.6.xcodeproj/project.pbxproj
new file mode 100644
index 0000000..a8f2c46
--- /dev/null
+++ b/DirectHW/DirectHW10.6.xcodeproj/project.pbxproj
@@ -0,0 +1,578 @@
+// !$*UTF8*$!
+{
+ archiveVersion = 1;
+ classes = {
+ };
+ objectVersion = 46;
+ objects = {
+
+/* Begin PBXBuildFile section */
+ 5D9932DD0D0F97EF00760F43 /* DirectHW.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5D9932B30D0F95DD00760F43 /* DirectHW.cpp */; };
+ AB83950A25B4B4DA001D8E16 /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AB66BE3125B4AE2C00943C69 /* IOKit.framework */; };
+ AB83952A25B4B69B001D8E16 /* DirectHW.h in Headers */ = {isa = PBXBuildFile; fileRef = FD12A6710E9235DB004BBD7B /* DirectHW.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ AB83953125B4B6A1001D8E16 /* DirectHW.c in Sources */ = {isa = PBXBuildFile; fileRef = FD12A6700E9235DB004BBD7B /* DirectHW.c */; };
+ AB83953525B4B6A5001D8E16 /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AB66BE3125B4AE2C00943C69 /* IOKit.framework */; };
+ FDC4F2BC0E923E0C0006B2A5 /* DirectHW.h in Headers */ = {isa = PBXBuildFile; fileRef = FD12A6710E9235DB004BBD7B /* DirectHW.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ FDC4F2BD0E923E100006B2A5 /* DirectHW.c in Sources */ = {isa = PBXBuildFile; fileRef = FD12A6700E9235DB004BBD7B /* DirectHW.c */; };
+/* End PBXBuildFile section */
+
+/* Begin PBXFileReference section */
+ 5D9932B30D0F95DD00760F43 /* DirectHW.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DirectHW.cpp; sourceTree = ""; tabWidth = 4; };
+ 5D9932B40D0F95DD00760F43 /* DirectHW.hpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = DirectHW.hpp; sourceTree = ""; tabWidth = 4; };
+ 5D9932D60D0F97D000760F43 /* DirectHW.kext */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = DirectHW.kext; sourceTree = BUILT_PRODUCTS_DIR; };
+ 5D9932D70D0F97D000760F43 /* DirectHW-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "DirectHW-Info.plist"; sourceTree = ""; };
+ 63D45C5E2C27A03400B2E069 /* DirectHWShared.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DirectHWShared.h; sourceTree = ""; };
+ 63ECBFC82984EDB80031C612 /* MacOSMacros.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MacOSMacros.h; sourceTree = ""; };
+ AB66BE3125B4AE2C00943C69 /* IOKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = IOKit.framework; path = System/Library/Frameworks/IOKit.framework; sourceTree = SDKROOT; };
+ AB83952325B4B678001D8E16 /* libDirectHW.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libDirectHW.a; sourceTree = BUILT_PRODUCTS_DIR; };
+ FD12A6700E9235DB004BBD7B /* DirectHW.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = DirectHW.c; sourceTree = ""; };
+ FD12A6710E9235DB004BBD7B /* DirectHW.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DirectHW.h; sourceTree = ""; };
+ FDC4F1CB0E923CB30006B2A5 /* DirectHW-Framework-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "DirectHW-Framework-Info.plist"; sourceTree = ""; };
+ FDC4F2B50E923DF00006B2A5 /* DirectHW.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = DirectHW.framework; sourceTree = BUILT_PRODUCTS_DIR; };
+/* End PBXFileReference section */
+
+/* Begin PBXFrameworksBuildPhase section */
+ 5D9932D40D0F97D000760F43 /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ AB83952125B4B678001D8E16 /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ AB83953525B4B6A5001D8E16 /* IOKit.framework in Frameworks */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ FDC4F2B30E923DF00006B2A5 /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ AB83950A25B4B4DA001D8E16 /* IOKit.framework in Frameworks */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXFrameworksBuildPhase section */
+
+/* Begin PBXGroup section */
+ 5D9932890D0F94EE00760F43 = {
+ isa = PBXGroup;
+ children = (
+ AB66BE3225B4AE4200943C69 /* Resources */,
+ 63614FF92987AA7100593F0A /* Source Common */,
+ AB66BE2F25B4AE1C00943C69 /* Source Kernel */,
+ 5D9932940D0F94F500760F43 /* Source User */,
+ 5D99329C0D0F952400760F43 /* Products */,
+ AB66BE3025B4AE2600943C69 /* Frameworks */,
+ );
+ sourceTree = "";
+ };
+ 5D9932940D0F94F500760F43 /* Source User */ = {
+ isa = PBXGroup;
+ children = (
+ FD12A6700E9235DB004BBD7B /* DirectHW.c */,
+ FD12A6710E9235DB004BBD7B /* DirectHW.h */,
+ );
+ name = "Source User";
+ sourceTree = "";
+ };
+ 5D99329C0D0F952400760F43 /* Products */ = {
+ isa = PBXGroup;
+ children = (
+ 5D9932D60D0F97D000760F43 /* DirectHW.kext */,
+ FDC4F2B50E923DF00006B2A5 /* DirectHW.framework */,
+ AB83952325B4B678001D8E16 /* libDirectHW.a */,
+ );
+ name = Products;
+ sourceTree = "";
+ };
+ 63614FF92987AA7100593F0A /* Source Common */ = {
+ isa = PBXGroup;
+ children = (
+ 63D45C5E2C27A03400B2E069 /* DirectHWShared.h */,
+ 63ECBFC82984EDB80031C612 /* MacOSMacros.h */,
+ );
+ name = "Source Common";
+ sourceTree = "";
+ };
+ AB66BE2F25B4AE1C00943C69 /* Source Kernel */ = {
+ isa = PBXGroup;
+ children = (
+ 5D9932B30D0F95DD00760F43 /* DirectHW.cpp */,
+ 5D9932B40D0F95DD00760F43 /* DirectHW.hpp */,
+ );
+ name = "Source Kernel";
+ sourceTree = "";
+ };
+ AB66BE3025B4AE2600943C69 /* Frameworks */ = {
+ isa = PBXGroup;
+ children = (
+ AB66BE3125B4AE2C00943C69 /* IOKit.framework */,
+ );
+ name = Frameworks;
+ sourceTree = "";
+ };
+ AB66BE3225B4AE4200943C69 /* Resources */ = {
+ isa = PBXGroup;
+ children = (
+ 5D9932D70D0F97D000760F43 /* DirectHW-Info.plist */,
+ FDC4F1CB0E923CB30006B2A5 /* DirectHW-Framework-Info.plist */,
+ );
+ name = Resources;
+ sourceTree = "";
+ };
+/* End PBXGroup section */
+
+/* Begin PBXHeadersBuildPhase section */
+ AB83951F25B4B678001D8E16 /* Headers */ = {
+ isa = PBXHeadersBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ AB83952A25B4B69B001D8E16 /* DirectHW.h in Headers */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ FDC4F2B00E923DF00006B2A5 /* Headers */ = {
+ isa = PBXHeadersBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ FDC4F2BC0E923E0C0006B2A5 /* DirectHW.h in Headers */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXHeadersBuildPhase section */
+
+/* Begin PBXNativeTarget section */
+ 5D9932D50D0F97D000760F43 /* KEXT */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = 5D9932DB0D0F97D100760F43 /* Build configuration list for PBXNativeTarget "KEXT" */;
+ buildPhases = (
+ 5D9932D20D0F97D000760F43 /* Sources */,
+ 5D9932D40D0F97D000760F43 /* Frameworks */,
+ 5D9932D30D0F97D000760F43 /* Resources */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ );
+ name = KEXT;
+ productName = DirectHW;
+ productReference = 5D9932D60D0F97D000760F43 /* DirectHW.kext */;
+ productType = "com.apple.product-type.kernel-extension.iokit";
+ };
+ AB83952225B4B678001D8E16 /* libDirectHW */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = AB83952425B4B678001D8E16 /* Build configuration list for PBXNativeTarget "libDirectHW" */;
+ buildPhases = (
+ AB83952025B4B678001D8E16 /* Sources */,
+ AB83952125B4B678001D8E16 /* Frameworks */,
+ AB83951F25B4B678001D8E16 /* Headers */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ );
+ name = libDirectHW;
+ productName = libDirectHW;
+ productReference = AB83952325B4B678001D8E16 /* libDirectHW.a */;
+ productType = "com.apple.product-type.library.static";
+ };
+ FDC4F2B40E923DF00006B2A5 /* DirectHW */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = FDC4F2C00E923E2B0006B2A5 /* Build configuration list for PBXNativeTarget "DirectHW" */;
+ buildPhases = (
+ FDC4F2B20E923DF00006B2A5 /* Sources */,
+ FDC4F2B30E923DF00006B2A5 /* Frameworks */,
+ FDC4F2B00E923DF00006B2A5 /* Headers */,
+ FDC4F2B10E923DF00006B2A5 /* Resources */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ );
+ name = DirectHW;
+ productName = DirectHW;
+ productReference = FDC4F2B50E923DF00006B2A5 /* DirectHW.framework */;
+ productType = "com.apple.product-type.framework";
+ };
+/* End PBXNativeTarget section */
+
+/* Begin PBXProject section */
+ 5D99328B0D0F94EE00760F43 /* Project object */ = {
+ isa = PBXProject;
+ attributes = {
+ LastUpgradeCheck = 1420;
+ TargetAttributes = {
+ 5D9932D50D0F97D000760F43 = {
+ DevelopmentTeam = YZAQ856TTM;
+ };
+ AB83952225B4B678001D8E16 = {
+ CreatedOnToolsVersion = 12.3;
+ DevelopmentTeam = YZAQ856TTM;
+ ProvisioningStyle = Automatic;
+ };
+ FDC4F2B40E923DF00006B2A5 = {
+ DevelopmentTeam = YZAQ856TTM;
+ };
+ };
+ };
+ buildConfigurationList = 5D99328E0D0F94EE00760F43 /* Build configuration list for PBXProject "DirectHW10.6" */;
+ compatibilityVersion = "Xcode 3.2";
+ developmentRegion = en;
+ hasScannedForEncodings = 0;
+ knownRegions = (
+ en,
+ Base,
+ );
+ mainGroup = 5D9932890D0F94EE00760F43;
+ productRefGroup = 5D99329C0D0F952400760F43 /* Products */;
+ projectDirPath = "";
+ projectRoot = "";
+ targets = (
+ 5D9932D50D0F97D000760F43 /* KEXT */,
+ FDC4F2B40E923DF00006B2A5 /* DirectHW */,
+ AB83952225B4B678001D8E16 /* libDirectHW */,
+ );
+ };
+/* End PBXProject section */
+
+/* Begin PBXResourcesBuildPhase section */
+ 5D9932D30D0F97D000760F43 /* Resources */ = {
+ isa = PBXResourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ FDC4F2B10E923DF00006B2A5 /* Resources */ = {
+ isa = PBXResourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXResourcesBuildPhase section */
+
+/* Begin PBXSourcesBuildPhase section */
+ 5D9932D20D0F97D000760F43 /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 5D9932DD0D0F97EF00760F43 /* DirectHW.cpp in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ AB83952025B4B678001D8E16 /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ AB83953125B4B6A1001D8E16 /* DirectHW.c in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ FDC4F2B20E923DF00006B2A5 /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ FDC4F2BD0E923E100006B2A5 /* DirectHW.c in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXSourcesBuildPhase section */
+
+/* Begin XCBuildConfiguration section */
+ 5D99328C0D0F94EE00760F43 /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ ARCHS = (
+ x86_64,
+ i386,
+ ppc,
+ ppc64,
+ );
+ DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
+ GCC_NO_COMMON_BLOCKS = YES;
+ GCC_OPTIMIZATION_LEVEL = 0;
+ GCC_PREPROCESSOR_DEFINITIONS = (
+ "DEBUG=1",
+ "$(inherited)",
+ );
+ GCC_REUSE_STRINGS = NO;
+ GCC_SYMBOLS_PRIVATE_EXTERN = YES;
+ "GCC_VERSION[sdk=macosx10.4][arch=*]" = 4.0;
+ GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
+ GCC_WARN_UNDECLARED_SELECTOR = YES;
+ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
+ GCC_WARN_UNUSED_FUNCTION = YES;
+ GCC_WARN_UNUSED_LABEL = YES;
+ GCC_WARN_UNUSED_PARAMETER = YES;
+ GCC_WARN_UNUSED_VARIABLE = YES;
+ GENERATE_PKGINFO_FILE = YES;
+ KEEP_PRIVATE_EXTERNS = YES;
+ MACOSX_DEPLOYMENT_TARGET = 10.4;
+ "MACOSX_DEPLOYMENT_TARGET[arch=ppc64]" = 10.5;
+ "MACOSX_DEPLOYMENT_TARGET[arch=x86_64]" = 10.5;
+ OTHER_CPLUSPLUSFLAGS = (
+ "-DDEBUG_KEXT=1",
+ "-DDEBUG=1",
+ "$(OTHER_CFLAGS)",
+ );
+ RUN_CLANG_STATIC_ANALYZER = YES;
+ SDKROOT = macosx10.4;
+ "SDKROOT[arch=ppc64]" = macosx10.5;
+ "SDKROOT[arch=x86_64]" = macosx10.5;
+ STRIP_INSTALLED_PRODUCT = NO;
+ SYMROOT = build/build10.6;
+ };
+ name = Debug;
+ };
+ 5D99328D0D0F94EE00760F43 /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ ARCHS = (
+ x86_64,
+ i386,
+ ppc,
+ ppc64,
+ );
+ DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
+ GCC_INLINES_ARE_PRIVATE_EXTERN = YES;
+ GCC_NO_COMMON_BLOCKS = YES;
+ GCC_OPTIMIZATION_LEVEL = 3;
+ GCC_SYMBOLS_PRIVATE_EXTERN = YES;
+ GCC_UNROLL_LOOPS = YES;
+ "GCC_VERSION[sdk=macosx10.4][arch=*]" = 4.0;
+ GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
+ GCC_WARN_UNDECLARED_SELECTOR = YES;
+ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
+ GCC_WARN_UNUSED_FUNCTION = YES;
+ GCC_WARN_UNUSED_LABEL = YES;
+ GCC_WARN_UNUSED_PARAMETER = YES;
+ GCC_WARN_UNUSED_VARIABLE = YES;
+ GENERATE_PKGINFO_FILE = YES;
+ MACOSX_DEPLOYMENT_TARGET = 10.4;
+ "MACOSX_DEPLOYMENT_TARGET[arch=ppc64]" = 10.5;
+ "MACOSX_DEPLOYMENT_TARGET[arch=x86_64]" = 10.5;
+ SDKROOT = macosx10.4;
+ "SDKROOT[arch=ppc64]" = macosx10.5;
+ "SDKROOT[arch=x86_64]" = macosx10.5;
+ SYMROOT = build/build10.6;
+ };
+ name = Release;
+ };
+ 5D9932D90D0F97D100760F43 /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ARCHS = (
+ x86_64,
+ i386,
+ ppc,
+ );
+ CURRENT_PROJECT_VERSION = "$(MODULE_VERSION)";
+ GCC_MODEL_TUNING = G5;
+ GCC_PREPROCESSOR_DEFINITIONS = (
+ "MODULE_VERSION=$(MODULE_VERSION)",
+ "PRODUCT_NAME=$(PRODUCT_NAME)",
+ "$(inherited)",
+ );
+ GCC_REUSE_STRINGS = YES;
+ INFOPLIST_FILE = "DirectHW-Info.plist";
+ INSTALL_GROUP = wheel;
+ INSTALL_OWNER = root;
+ KEEP_PRIVATE_EXTERNS = YES;
+ MARKETING_VERSION = 1.6.2;
+ MODULE_NAME = com.coresystems.DirectHW;
+ MODULE_VERSION = 1.6.2;
+ "OTHER_CFLAGS[sdk=macosx10.4][arch=i386]" = "-DMAC_OS_X_VERSION_SDK=1040";
+ "OTHER_CFLAGS[sdk=macosx10.4][arch=ppc]" = (
+ "-DMAC_OS_X_VERSION_SDK=1040",
+ "-DKPI_10_4_0_PPC_COMPAT",
+ );
+ "OTHER_CFLAGS[sdk=macosx10.5][arch=*]" = "-DMAC_OS_X_VERSION_SDK=1050";
+ "OTHER_CFLAGS[sdk=macosx10.6][arch=*]" = "-DMAC_OS_X_VERSION_SDK=1060";
+ OTHER_LDFLAGS = (
+ "-Xlinker",
+ "-no_uuid",
+ );
+ PRODUCT_BUNDLE_IDENTIFIER = com.coresystems.DirectHW;
+ PRODUCT_NAME = DirectHW;
+ "SDKROOT[arch=x86_64]" = macosx10.6;
+ STRIP_INSTALLED_PRODUCT = NO;
+ WRAPPER_EXTENSION = kext;
+ };
+ name = Debug;
+ };
+ 5D9932DA0D0F97D100760F43 /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ARCHS = (
+ x86_64,
+ i386,
+ ppc,
+ );
+ CURRENT_PROJECT_VERSION = "$(MODULE_VERSION)";
+ GCC_MODEL_TUNING = G5;
+ GCC_PREPROCESSOR_DEFINITIONS = (
+ "MODULE_VERSION=$(MODULE_VERSION)",
+ "PRODUCT_NAME=$(PRODUCT_NAME)",
+ "$(inherited)",
+ );
+ INFOPLIST_FILE = "DirectHW-Info.plist";
+ INSTALL_GROUP = wheel;
+ INSTALL_OWNER = root;
+ KEEP_PRIVATE_EXTERNS = YES;
+ MARKETING_VERSION = 1.6.2;
+ MODULE_NAME = com.coresystems.DirectHW;
+ MODULE_VERSION = 1.6.2;
+ "OTHER_CFLAGS[sdk=macosx10.4][arch=i386]" = "-DMAC_OS_X_VERSION_SDK=1040";
+ "OTHER_CFLAGS[sdk=macosx10.4][arch=ppc]" = (
+ "-DMAC_OS_X_VERSION_SDK=1040",
+ "-DKPI_10_4_0_PPC_COMPAT",
+ );
+ "OTHER_CFLAGS[sdk=macosx10.5][arch=*]" = "-DMAC_OS_X_VERSION_SDK=1050";
+ "OTHER_CFLAGS[sdk=macosx10.6][arch=*]" = "-DMAC_OS_X_VERSION_SDK=1060";
+ OTHER_LDFLAGS = (
+ "-Xlinker",
+ "-no_uuid",
+ );
+ PRODUCT_BUNDLE_IDENTIFIER = com.coresystems.DirectHW;
+ PRODUCT_NAME = DirectHW;
+ "SDKROOT[arch=x86_64]" = macosx10.6;
+ STRIP_INSTALLED_PRODUCT = NO;
+ WRAPPER_EXTENSION = kext;
+ };
+ name = Release;
+ };
+ AB83952525B4B678001D8E16 /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ EXECUTABLE_PREFIX = lib;
+ GCC_DYNAMIC_NO_PIC = NO;
+ GCC_NO_COMMON_BLOCKS = YES;
+ GCC_PREPROCESSOR_DEFINITIONS = (
+ "DEBUG=1",
+ "$(inherited)",
+ );
+ GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
+ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
+ MTL_FAST_MATH = YES;
+ PRODUCT_MODULE_NAME = DirectHW;
+ PRODUCT_NAME = DirectHW;
+ SKIP_INSTALL = YES;
+ };
+ name = Debug;
+ };
+ AB83952625B4B678001D8E16 /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ COPY_PHASE_STRIP = NO;
+ EXECUTABLE_PREFIX = lib;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
+ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
+ MTL_FAST_MATH = YES;
+ PRODUCT_MODULE_NAME = DirectHW;
+ PRODUCT_NAME = DirectHW;
+ SKIP_INSTALL = YES;
+ };
+ name = Release;
+ };
+ FDC4F2B60E923DF00006B2A5 /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ CURRENT_PROJECT_VERSION = 1.6.2;
+ DYLIB_COMPATIBILITY_VERSION = 1;
+ DYLIB_CURRENT_VERSION = 1;
+ FRAMEWORK_VERSION = A;
+ GCC_DYNAMIC_NO_PIC = NO;
+ GCC_PRECOMPILE_PREFIX_HEADER = YES;
+ GCC_PREPROCESSOR_DEFINITIONS = (
+ "MODULE_VERSION=$(MODULE_VERSION)",
+ "PRODUCT_NAME=$(PRODUCT_NAME)",
+ "$(inherited)",
+ );
+ INFOPLIST_FILE = "DirectHW-Framework-Info.plist";
+ INSTALL_PATH = "$(SYSTEM_LIBRARY_DIR)/Frameworks";
+ KEEP_PRIVATE_EXTERNS = NO;
+ MARKETING_VERSION = 1.6.2;
+ MODULE_VERSION = 1.6.2;
+ OTHER_LDFLAGS = "";
+ PRODUCT_BUNDLE_IDENTIFIER = com.coresystems.DirectHW;
+ PRODUCT_NAME = DirectHW;
+ };
+ name = Debug;
+ };
+ FDC4F2B70E923DF00006B2A5 /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ COPY_PHASE_STRIP = NO;
+ CURRENT_PROJECT_VERSION = 1.6.2;
+ DYLIB_COMPATIBILITY_VERSION = 1;
+ DYLIB_CURRENT_VERSION = 1;
+ FRAMEWORK_VERSION = A;
+ GCC_PRECOMPILE_PREFIX_HEADER = YES;
+ GCC_PREPROCESSOR_DEFINITIONS = (
+ "MODULE_VERSION=$(MODULE_VERSION)",
+ "PRODUCT_NAME=$(PRODUCT_NAME)",
+ );
+ INFOPLIST_FILE = "DirectHW-Framework-Info.plist";
+ INSTALL_PATH = "$(SYSTEM_LIBRARY_DIR)/Frameworks";
+ MARKETING_VERSION = 1.6.2;
+ MODULE_VERSION = 1.6.2;
+ OTHER_LDFLAGS = "";
+ PRODUCT_BUNDLE_IDENTIFIER = com.coresystems.DirectHW;
+ PRODUCT_NAME = DirectHW;
+ };
+ name = Release;
+ };
+/* End XCBuildConfiguration section */
+
+/* Begin XCConfigurationList section */
+ 5D99328E0D0F94EE00760F43 /* Build configuration list for PBXProject "DirectHW10.6" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 5D99328C0D0F94EE00760F43 /* Debug */,
+ 5D99328D0D0F94EE00760F43 /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+ 5D9932DB0D0F97D100760F43 /* Build configuration list for PBXNativeTarget "KEXT" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 5D9932D90D0F97D100760F43 /* Debug */,
+ 5D9932DA0D0F97D100760F43 /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+ AB83952425B4B678001D8E16 /* Build configuration list for PBXNativeTarget "libDirectHW" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ AB83952525B4B678001D8E16 /* Debug */,
+ AB83952625B4B678001D8E16 /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+ FDC4F2C00E923E2B0006B2A5 /* Build configuration list for PBXNativeTarget "DirectHW" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ FDC4F2B60E923DF00006B2A5 /* Debug */,
+ FDC4F2B70E923DF00006B2A5 /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+/* End XCConfigurationList section */
+ };
+ rootObject = 5D99328B0D0F94EE00760F43 /* Project object */;
+}
diff --git a/DirectHW/DirectHW10.6.xcodeproj/xcshareddata/xcschemes/DirectHW.xcscheme b/DirectHW/DirectHW10.6.xcodeproj/xcshareddata/xcschemes/DirectHW.xcscheme
new file mode 100644
index 0000000..98b7fd9
--- /dev/null
+++ b/DirectHW/DirectHW10.6.xcodeproj/xcshareddata/xcschemes/DirectHW.xcscheme
@@ -0,0 +1,67 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/DirectHW/DirectHW10.6.xcodeproj/xcshareddata/xcschemes/KEXT.xcscheme b/DirectHW/DirectHW10.6.xcodeproj/xcshareddata/xcschemes/KEXT.xcscheme
new file mode 100644
index 0000000..4d8aa20
--- /dev/null
+++ b/DirectHW/DirectHW10.6.xcodeproj/xcshareddata/xcschemes/KEXT.xcscheme
@@ -0,0 +1,67 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/DirectHW/DirectHW10.6.xcodeproj/xcshareddata/xcschemes/libDirectHW.xcscheme b/DirectHW/DirectHW10.6.xcodeproj/xcshareddata/xcschemes/libDirectHW.xcscheme
new file mode 100644
index 0000000..1a85bd4
--- /dev/null
+++ b/DirectHW/DirectHW10.6.xcodeproj/xcshareddata/xcschemes/libDirectHW.xcscheme
@@ -0,0 +1,67 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/DirectHW/DirectHWShared.h b/DirectHW/DirectHWShared.h
new file mode 100644
index 0000000..c5437b2
--- /dev/null
+++ b/DirectHW/DirectHWShared.h
@@ -0,0 +1,160 @@
+enum {
+ kReadIO,
+ kWriteIO,
+ kPrepareMap,
+ kReadMSR,
+ kWriteMSR,
+ kReadCpuId,
+ kReadMem,
+ kRead,
+ kWrite,
+ kAllocatePhysicalMemory,
+ kUnallocatePhysicalMemory,
+ kNumberOfMethods
+};
+
+typedef struct {
+ UInt64 offset;
+ UInt64 width;
+ UInt64 data; // this field is always little endian // is 1 or 2 or 4 or 8 bytes starting at the lowest address
+} iomem64_t;
+
+typedef struct {
+ UInt32 offset;
+ UInt32 width;
+ UInt32 data; // this field is always little endian // is 1 or 2 or 4 bytes starting at the lowest address
+} iomem_t;
+
+typedef struct {
+ UInt64 addr;
+ UInt64 size;
+} map_t;
+
+typedef struct {
+ UInt32 addr;
+ UInt32 size;
+} map32_t;
+
+typedef struct {
+ UInt32 core;
+ UInt32 index;
+ UInt32 hi;
+ UInt32 lo;
+} msrcmd_t;
+
+typedef struct {
+ uint32_t core;
+ uint32_t eax;
+ uint32_t ecx;
+ uint32_t cpudata[4];
+} cpuid_t;
+
+typedef struct {
+ uint32_t core;
+ uint64_t addr;
+ uint32_t data;
+} readmem_t;
+
+// ==============
+// Read, Write
+
+/* Space definitions */
+enum {
+ kConfigSpace = 0,
+ kIOSpace = 1,
+ k32BitMemorySpace = 2,
+ k64BitMemorySpace = 3
+};
+
+union Address {
+ uint64_t addr64;
+ struct {
+ unsigned int offset :16;
+ unsigned int function :3;
+ unsigned int device :5;
+ unsigned int bus :8;
+ unsigned int segment :16;
+ unsigned int reserved :16;
+ } pci;
+ struct {
+ unsigned int reserved :16;
+ unsigned int segment :16;
+ unsigned int bus :8;
+ unsigned int device :5;
+ unsigned int function :3;
+ unsigned int offset :16;
+ } pciswapped;
+};
+typedef union Address Address;
+
+struct Parameters {
+ uint32_t options;
+ uint32_t spaceType;
+ uint32_t bitWidth;
+ uint32_t _resv;
+ uint64_t value;
+ Address address;
+};
+typedef struct Parameters Parameters;
+
+// ==============
+// AllocatePhysicalMemory
+
+enum {
+ kMemoryTypeMax = 10000000,
+ kMemoryTypeUser = 10000000,
+ kMemoryTypeKernel = 20000000,
+ kMemoryTypeKernelMalloc = 30000000,
+ kMemoryTypeSegments = 40000000, // this is added to the other memory types and should only be used by the kext
+ kMemoryTypeSegmentsKernel = 50000000
+};
+
+enum {
+ kPhysContig = 0,
+ kUseVirt = 1,
+ kUsePhys = 2,
+ kAllocTypeMask = 15,
+ kMapKernel = 1 << 4,
+};
+
+typedef struct IOPhysicalSegment {
+ UInt64 location;
+ UInt64 length;
+} IOPhysicalSegment;
+
+typedef struct MemParams {
+ UInt32 memoryType;
+ UInt32 allocOptions;
+ UInt32 mapOptions;
+ #if 0
+ kUsePhys:
+ kernel:
+ kIOMapAnywhere is always set.
+ kIOMapDefaultCache to inhibit the cache in I/O areas, kIOMapCopybackCache in general purpose RAM.
+ kIOMapInhibitCache, kIOMapWriteThruCache, kIOMapCopybackCache to set the appropriate caching.
+ kIOMapReadOnly to allow only read only accesses to the memory - writes will cause and access fault.
+ kIOMapReference will only succeed if the mapping already exists, and the IOMemoryMap object is just an extra reference, ie. no new mapping will be created.
+ kIOMapUnique allows a special kind of mapping to be created that may be used with the IOMemoryMap::redirect() API. These mappings will not be shared as is the default - there will always be a unique mapping created for the caller, not an existing mapping with an extra reference.
+ kIOMapPrefault will try to prefault the pages corresponding to the mapping. This must not be done on the kernel task, and the memory must have been wired via prepare(). Otherwise, the function will fail.
+ user:
+ same as kUsePhys/kernel
+ kUseVirt:
+ kernel:
+ same as kUsePhys/kernel
+ user:
+ mapping was created by user task
+ physContig:
+ kernel:
+ same as kUsePhys/kernel
+ user:
+ same as kUsePhys/kernel
+ #endif
+ UInt64 physMask;
+ UInt64 size;
+ UInt64 userAddr;
+ UInt64 physAddr;
+ UInt64 kernAddr;
+ UInt64 segments;
+} MemParams;
+
+// ==============
diff --git a/DirectHW/MacOSMacros.h b/DirectHW/MacOSMacros.h
new file mode 100644
index 0000000..e46529a
--- /dev/null
+++ b/DirectHW/MacOSMacros.h
@@ -0,0 +1,101 @@
+#ifndef __MACOSMACROS_HPP__
+#define __MACOSMACROS_HPP__
+
+/* DirectHW - Kernel extension to pass through IO commands to user space
+ *
+ * Copyright © 2008-2010 coresystems GmbH
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#ifdef MAC_OS_X_VERSION_SDK
+#define MAC_OS_X_VERSION_MAX_ALLOWED MAC_OS_X_VERSION_SDK
+#else
+#include
+#include
+#endif
+
+#ifndef MAC_OS_X_VERSION_10_3
+#define MAC_OS_X_VERSION_10_3 1030
+#endif
+#ifndef MAC_OS_X_VERSION_10_4
+#define MAC_OS_X_VERSION_10_4 1040
+#endif
+#ifndef MAC_OS_X_VERSION_10_5
+#define MAC_OS_X_VERSION_10_5 1050
+#endif
+#ifndef MAC_OS_X_VERSION_10_6
+#define MAC_OS_X_VERSION_10_6 1060
+#endif
+#ifndef MAC_OS_X_VERSION_10_7
+#define MAC_OS_X_VERSION_10_7 1070
+#endif
+#ifndef MAC_OS_X_VERSION_10_12
+#define MAC_OS_X_VERSION_10_12 101200
+#endif
+
+#ifdef AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER
+ #undef MAC_OS_X_VERSION_SDK
+ #define MAC_OS_X_VERSION_SDK MAC_OS_X_VERSION_10_4
+#endif
+
+#if defined(AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER) && defined(TARGET_OS_EMBEDDED)
+ #undef MAC_OS_X_VERSION_SDK
+ #define MAC_OS_X_VERSION_SDK MAC_OS_X_VERSION_10_5
+#endif
+
+#ifdef AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER
+ #undef MAC_OS_X_VERSION_SDK
+ #define MAC_OS_X_VERSION_SDK MAC_OS_X_VERSION_10_6
+#endif
+
+#ifdef AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER
+ #undef MAC_OS_X_VERSION_SDK
+ #define MAC_OS_X_VERSION_SDK MAC_OS_X_VERSION_10_7
+#endif
+
+#if !defined(MAC_OS_X_VERSION_MAX_ALLOWED) || !defined(MAC_OS_X_VERSION_SDK)
+ #error missing #include AvailabilityMacros.h
+#endif
+
+#if defined(__ppc64__)
+ #warning ppc64
+#elif defined(__ppc__)
+ #warning ppc
+#elif defined(__x86_64__)
+ #warning x86_64
+#elif defined(__i386__)
+ #warning i386
+#elif defined(__arm64e__)
+ #warning arm64e
+#elif defined(__arm64__)
+ #warning arm64
+#else
+ #error other architecture
+#endif
+
+#if MAC_OS_X_VERSION_SDK == MAC_OS_X_VERSION_10_3
+ #warning SDK 10.3
+#elif MAC_OS_X_VERSION_SDK == MAC_OS_X_VERSION_10_4
+ #warning SDK 10.4
+#elif MAC_OS_X_VERSION_SDK == MAC_OS_X_VERSION_10_5
+ #warning SDK 10.5
+#elif MAC_OS_X_VERSION_SDK == MAC_OS_X_VERSION_10_6
+ #warning SDK 10.6
+#elif MAC_OS_X_VERSION_SDK == MAC_OS_X_VERSION_10_7
+ #warning SDK 10.7+
+#else
+ #error unknown SDK
+#endif
+
+#endif /* __MACOSMACROS_H__ */
diff --git a/DirectHW/Makefile b/DirectHW/Makefile
index 94033f6..7023145 100644
--- a/DirectHW/Makefile
+++ b/DirectHW/Makefile
@@ -6,7 +6,7 @@
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
-#
+#
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
@@ -16,53 +16,257 @@
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#
-all: dmg
+all: main libs
-prepare:
- if [ ! -r .patched ]; then \
- test `uname -r | cut -f1 -d\.` -lt 10 && \
- patch -p0 < DirectHW-i386-only.diff || echo "Not patching."; \
- fi
- touch .patched
+# Note: OSTYPE-based version detection removed for consistency and reliability
+# Use sw_vers-based detection below for all version comparisons
+# Note: Do not append comments to makefile := assignment lines because spaces before the # become part of the assigned string.
-build: prepare
- xcodebuild -alltargets
+# Get macOS version using sw_vers for reliable detection
+# sw_vers -productVersion works in 10.3+ but not 10.2 and earlier
+# Fallback using perl works in 10.1 and later
+DETECTED_VERSION := $(shell sw_vers -productVersion 2>/dev/null | cut -d. -f1-2 || sw_vers 2>/dev/null | perl -ne 'if (/ProductVersion:\s*(\d+(\.\d+)?)/) { print $$1 }' | cut -d. -f1-2)
+# Error handling: if version detection failed, abort with clear error message
+ifeq ($(DETECTED_VERSION),)
+$(error Could not detect macOS version. Please ensure sw_vers is available.)
+endif
+macos_version := $(DETECTED_VERSION)
-install: build
- sudo xcodebuild -alltargets DSTROOT=`pwd`/build/DirectHW install
+# Version comparisons using proper macOS version detection
+# Convert to integer format (major*10000 + minor*100 + patch) for proper comparison
+is_sequoia_or_later := $(shell expr $(shell echo "$(macos_version)" | sed 's/\./ /' | awk '{print $$1 * 10000 + $$2 * 100 + ($$3 ? $$3 : 0)}') \>= 150000)
-package: install
- /Developer/usr/bin/packagemaker -v --doc DirectHW.pmdoc \
- --id com.coresystems.DirectHW --out build/DirectHW.pkg
+# Detect build machine architecture for universal binary decisions
+build_arch := $(shell uname -m)
+is_arm64_build := $(if $(filter arm64,$(build_arch)),1,0)
+is_sonoma_or_later := $(shell expr $(shell echo "$(macos_version)" | sed 's/\./ /' | awk '{print $$1 * 10000 + $$2 * 100 + ($$3 ? $$3 : 0)}') \>= 140000)
+is_ventura_or_later := $(shell expr $(shell echo "$(macos_version)" | sed 's/\./ /' | awk '{print $$1 * 10000 + $$2 * 100 + ($$3 ? $$3 : 0)}') \>= 130000)
+is_monterey_or_later := $(shell expr $(shell echo "$(macos_version)" | sed 's/\./ /' | awk '{print $$1 * 10000 + $$2 * 100 + ($$3 ? $$3 : 0)}') \>= 120000)
+is_big_sur_or_later := $(shell expr $(shell echo "$(macos_version)" | sed 's/\./ /' | awk '{print $$1 * 10000 + $$2 * 100 + ($$3 ? $$3 : 0)}') \>= 110000)
+is_catalina_or_later := $(shell expr $(shell echo "$(macos_version)" | sed 's/\./ /' | awk '{print $$1 * 10000 + $$2 * 100 + ($$3 ? $$3 : 0)}') \>= 101500)
+is_mojave_or_later := $(shell expr $(shell echo "$(macos_version)" | sed 's/\./ /' | awk '{print $$1 * 10000 + $$2 * 100 + ($$3 ? $$3 : 0)}') \>= 101400)
+is_high_sierra_or_later := $(shell expr $(shell echo "$(macos_version)" | sed 's/\./ /' | awk '{print $$1 * 10000 + $$2 * 100 + ($$3 ? $$3 : 0)}') \>= 101300)
+is_sierra_or_later := $(shell expr $(shell echo "$(macos_version)" | sed 's/\./ /' | awk '{print $$1 * 10000 + $$2 * 100 + ($$3 ? $$3 : 0)}') \>= 101200)
+is_el_capitan_or_later := $(shell expr $(shell echo "$(macos_version)" | sed 's/\./ /' | awk '{print $$1 * 10000 + $$2 * 100 + ($$3 ? $$3 : 0)}') \>= 101100)
+is_yosemite_or_later := $(shell expr $(shell echo "$(macos_version)" | sed 's/\./ /' | awk '{print $$1 * 10000 + $$2 * 100 + ($$3 ? $$3 : 0)}') \>= 101000)
+is_mavericks_or_later := $(shell expr $(shell echo "$(macos_version)" | sed 's/\./ /' | awk '{print $$1 * 10000 + $$2 * 100 + ($$3 ? $$3 : 0)}') \>= 100900)
+is_mountain_lion_or_later := $(shell expr $(shell echo "$(macos_version)" | sed 's/\./ /' | awk '{print $$1 * 10000 + $$2 * 100 + ($$3 ? $$3 : 0)}') \>= 100800)
+is_lion_or_later := $(shell expr $(shell echo "$(macos_version)" | sed 's/\./ /' | awk '{print $$1 * 10000 + $$2 * 100 + ($$3 ? $$3 : 0)}') \>= 100700)
+is_snow_leopard_or_later := $(shell expr $(shell echo "$(macos_version)" | sed 's/\./ /' | awk '{print $$1 * 10000 + $$2 * 100 + ($$3 ? $$3 : 0)}') \>= 100600)
+is_leopard_or_later := $(shell expr $(shell echo "$(macos_version)" | sed 's/\./ /' | awk '{print $$1 * 10000 + $$2 * 100 + ($$3 ? $$3 : 0)}') \>= 100500)
+is_tiger_or_later := $(shell expr $(shell echo "$(macos_version)" | sed 's/\./ /' | awk '{print $$1 * 10000 + $$2 * 100 + ($$3 ? $$3 : 0)}') \>= 100400)
-dmg: package
- rm -rf DirectHW.dmg
- rm -rf out
- mkdir out
- cp -r build/DirectHW.pkg out/Install\ DirectHW.pkg
- cp -r ReadMe.rtf out/Read\ Me.rtf
- /Developer/Tools/SetFile -a E out/Install\ DirectHW.pkg
- /Developer/Tools/SetFile -a E out/Read\ Me.rtf
- ../create-dmg/create-dmg --window-size 447 337 \
- --background background.png --icon-size 80 \
- --volname "Install DirectHW" \
- --icon "Install DirectHW.pkg" 142 64 \
- --icon "Read Me.rtf" 310 64 \
- DirectHW.dmg out
+# latestsdk := $(shell xcodebuild -showsdks | sort -r | sed -nE '/.*(-sdk macosx.*)/ { s//\1/;p;q; }')
-load: install
- cd build/DirectHW/System/Library/Extensions; sudo kextunload -v DirectHW.kext; sudo kextload -v DirectHW.kext
+proj := DirectHW.xcodeproj
+build := build/buildlatest
+extensions := /System/Library/Extensions
+debugsym :=
+sdk := -sdk macosx
+# Default deployment target for older systems
+deploy := MACOSX_DEPLOYMENT_TARGET=10.3
+arch :=
+# Use proper macOS version detection for build configuration
+ifneq ($(is_sequoia_or_later), 0)
+ proj := DirectHW.xcodeproj
+ build := build/build15
+ # Modern Xcode (16.4+) can still build for 10.6+ deployment
+ deploy := MACOSX_DEPLOYMENT_TARGET=10.6
+ifeq ($(is_arm64_build),1)
+ # Apple Silicon build machine - create universal binary
+ arch := -arch x86_64 -arch arm64
+else
+ # Intel build machine - x86_64 only
+ arch := -arch x86_64
+endif
+else ifneq ($(is_sonoma_or_later), 0)
+ proj := DirectHW.xcodeproj
+ build := build/build14
+ sdk := -sdk macosx
+ deploy := MACOSX_DEPLOYMENT_TARGET=10.6
+ifeq ($(is_arm64_build),1)
+ arch := -arch x86_64 -arch arm64
+else
+ arch := -arch x86_64
+endif
+else ifneq ($(is_ventura_or_later), 0)
+ proj := DirectHW.xcodeproj
+ build := build/build13
+ sdk := -sdk macosx
+ deploy := MACOSX_DEPLOYMENT_TARGET=10.6
+ifeq ($(is_arm64_build),1)
+ arch := -arch x86_64 -arch arm64
+else
+ arch := -arch x86_64
+endif
+else ifneq ($(is_monterey_or_later), 0)
+ proj := DirectHW.xcodeproj
+ build := build/build12
+ sdk := -sdk macosx
+ deploy := MACOSX_DEPLOYMENT_TARGET=10.6
+ifeq ($(is_arm64_build),1)
+ arch := -arch x86_64 -arch arm64
+else
+ arch := -arch x86_64
+endif
+else ifneq ($(is_big_sur_or_later), 0)
+ proj := DirectHW.xcodeproj
+ build := build/build11
+ sdk := -sdk macosx
+ deploy := MACOSX_DEPLOYMENT_TARGET=10.6
+ifeq ($(is_arm64_build),1)
+ arch := -arch x86_64 -arch arm64
+else
+ arch := -arch x86_64
+endif
+else ifneq ($(is_catalina_or_later), 0)
+ proj := DirectHW.xcodeproj
+ build := build/build10.15
+ sdk := -sdk macosx
+ # Catalina (10.15+) dropped 32-bit support completely
+ arch := -arch x86_64
+else ifneq ($(is_mojave_or_later), 0)
+ proj := DirectHW.xcodeproj
+ build := build/build10.14
+ sdk := -sdk macosx10.14
+ arch := -arch i386 -arch x86_64
+else ifneq ($(is_high_sierra_or_later), 0)
+ proj := DirectHW.xcodeproj
+ build := build/build10.13
+ sdk := -sdk macosx10.13
+ arch := -arch i386 -arch x86_64
+else ifneq ($(is_sierra_or_later), 0)
+ proj := DirectHW10.6.xcodeproj
+ build := build/build10.12
+ sdk :=
+ deploy :=
+else ifneq ($(is_el_capitan_or_later), 0)
+ proj := DirectHW10.6.xcodeproj
+ build := build/build10.11
+ sdk :=
+ deploy :=
+else ifneq ($(is_yosemite_or_later), 0)
+ proj := DirectHW10.6.xcodeproj
+ build := build/build10.10
+ sdk :=
+ deploy :=
+else ifneq ($(is_mavericks_or_later), 0)
+ proj := DirectHW10.6.xcodeproj
+ build := build/build10.9
+ sdk :=
+ deploy :=
+ extensions := /Library/Extensions
+else ifneq ($(is_mountain_lion_or_later), 0)
+ proj := DirectHW10.6.xcodeproj
+ build := build/build10.8
+ sdk :=
+ deploy :=
+else ifneq ($(is_lion_or_later), 0)
+ proj := DirectHW10.6.xcodeproj
+ build := build/build10.7
+ sdk :=
+ deploy :=
+else ifneq ($(is_snow_leopard_or_later), 0)
+ proj := DirectHW10.6.xcodeproj
+ build := build/build10.6
+ sdk :=
+ deploy :=
+else ifneq ($(is_leopard_or_later), 0)
+ proj := DirectHW10.5.xcodeproj
+ build := build/build10.5
+ debugsym := -g
+ sdk :=
+ deploy :=
+else ifneq ($(is_tiger_or_later), 0)
+ proj := DirectHW10.4.xcodeproj
+ build := build/build10.4
+ sdk :=
+ deploy :=
+endif
-installer: package
- rm -rf ~/Desktop/DirectHW.pkg
- cp -r build/DirectHW.pkg ~/Desktop
+main:
+ @echo "=== Attempting Xcode build ===" && \
+ BUILD_LOG="$(build)/xcode_build.log" && \
+ mkdir -p $(build) && \
+ if xcodebuild -alltargets -project $(proj) $(sdk) $(deploy) $(arch) SYMROOT=$(build) 2> "$$BUILD_LOG"; then \
+ echo "✅ Xcode build succeeded"; \
+ else \
+ echo "❌ Xcode build failed, falling back to Command Line Tools"; \
+ if [ -f "$$BUILD_LOG" ] && [ -s "$$BUILD_LOG" ]; then \
+ echo "Xcode build errors:"; \
+ cat "$$BUILD_LOG"; \
+ fi; \
+ $(MAKE) libs-fallback; \
+ fi
-clean:
- sudo rm -rf build/Release build/DirectHW.build build/DirectHW build/DirectHW.pkg
- rm -rf out
+libs: DirectHW.c DirectHW.h
+ mkdir -p $(build)/Release
+ifneq ($(is_big_sur_or_later)$(is_monterey_or_later)$(is_ventura_or_later)$(is_sonoma_or_later)$(is_sequoia_or_later),0)
+ifeq ($(is_arm64_build),1)
+ # Apple Silicon build machine - create universal binary
+ $(CC) -arch x86_64 -arch arm64 DirectHW.c -dynamiclib -framework IOKit -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -o $(build)/Release/libDirectHW.dylib $(debugsym)
+else
+ # Intel build machine - x86_64 only for Apple Silicon era macOS
+ $(CC) -arch x86_64 DirectHW.c -dynamiclib -framework IOKit -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -o $(build)/Release/libDirectHW.dylib $(debugsym)
+endif
+else ifneq ($(is_catalina_or_later),0)
+ # Catalina (10.15+) - 64-bit only
+ $(CC) -arch x86_64 DirectHW.c -dynamiclib -framework IOKit -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -o $(build)/Release/libDirectHW.dylib $(debugsym)
+else ifneq ($(is_mojave_or_later)$(is_high_sierra_or_later),0)
+ # Mojave (10.14) and High Sierra (10.13) - last versions with 32-bit support
+ $(CC) -arch i386 -arch x86_64 DirectHW.c -dynamiclib -framework IOKit -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -o $(build)/Release/libDirectHW.dylib $(debugsym)
+else
+ # Older systems - 64-bit only (no ARM64 support)
+ $(CC) -arch x86_64 DirectHW.c -dynamiclib -framework IOKit -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -o $(build)/Release/libDirectHW.dylib $(debugsym)
+endif
+ #$(CC) -static -c DirectHW.c -o $(build)/Release/libDirectHW.a
-distclean:
- rm DirectHW.dmg
+libs-fallback: DirectHW.c DirectHW.h
+ @echo "=== Building with Command Line Tools (fallback) ==="
+ mkdir -p $(build)/Release
+ifneq ($(is_big_sur_or_later)$(is_monterey_or_later)$(is_ventura_or_later)$(is_sonoma_or_later)$(is_sequoia_or_later),0)
+ifeq ($(is_arm64_build),1)
+ # Apple Silicon build machine - create universal binary
+ $(CC) -arch x86_64 -arch arm64 DirectHW.c -dynamiclib -framework IOKit -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -o $(build)/Release/libDirectHW.dylib $(debugsym)
+else
+ # Intel build machine - x86_64 only for Apple Silicon era macOS
+ $(CC) -arch x86_64 DirectHW.c -dynamiclib -framework IOKit -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -o $(build)/Release/libDirectHW.dylib $(debugsym)
+endif
+else ifneq ($(is_catalina_or_later),0)
+ # Catalina (10.15+) - 64-bit only
+ $(CC) -arch x86_64 DirectHW.c -dynamiclib -framework IOKit -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -o $(build)/Release/libDirectHW.dylib $(debugsym)
+else ifneq ($(is_mojave_or_later)$(is_high_sierra_or_later),0)
+ # Mojave (10.14) and High Sierra (10.13) - last versions with 32-bit support
+ $(CC) -arch i386 -arch x86_64 DirectHW.c -dynamiclib -framework IOKit -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -o $(build)/Release/libDirectHW.dylib $(debugsym)
+else
+ # Older systems - 64-bit only (no ARM64 support)
+ $(CC) -arch x86_64 DirectHW.c -dynamiclib -framework IOKit -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -o $(build)/Release/libDirectHW.dylib $(debugsym)
+endif
+ #$(CC) -static -c DirectHW.c -o $(build)/Release/libDirectHW.a
-.PHONY: prepare build install package dmg load copy clean distclean
+install:
+ sudo mkdir -p /usr/local/lib
+ [[ -e $(extensions)/DirectHW.kext ]] && sudo rm -R $(extensions)/DirectHW.kext || :
+ sudo cp -p -R $(build)/Release/DirectHW.kext $(extensions)/
+ [[ -e /Library/Frameworks/DirectHW.framework ]] && sudo rm -R /Library/Frameworks/DirectHW.framework || :
+ sudo cp -p -R $(build)/Release/DirectHW.framework /Library/Frameworks/
+ sudo cp -p $(build)/Release/libDirectHW.a /usr/local/lib/
+ sudo cp -p $(build)/Release/libDirectHW.dylib /usr/local/lib/
+ sudo chmod -R 755 $(extensions)/DirectHW.kext
+ sudo chmod -R 755 /Library/Frameworks/DirectHW.framework
+ sudo chmod 644 /usr/local/lib/libDirectHW.a
+ sudo chmod 644 /usr/local/lib/libDirectHW.dylib
+ sudo chown -R root:wheel $(extensions)/DirectHW.kext
+ sudo chown -R root:wheel /Library/Frameworks/DirectHW.framework
+ sudo kextunload -v $(extensions)/DirectHW.kext || :
+ sudo kextload -v $(extensions)/DirectHW.kext
+ sudo touch $(extensions) || :
+ # Use kmutil for macOS 10.13+ (High Sierra and later), kextcache for older versions
+ if [ "$(is_high_sierra_or_later)" != "0" ]; then \
+ sudo kmutil install --volume-root / --check-rebuild || : ; \
+ else \
+ sudo kextcache -system-prelinked-kernel || sudo kextcache -system-cache || : ; \
+ fi
+clean:
+ rm -rf $(build)
diff --git a/DirectHW/build/.DS_Store b/DirectHW/build/.DS_Store
deleted file mode 100644
index 9868ab2..0000000
Binary files a/DirectHW/build/.DS_Store and /dev/null differ
diff --git a/DirectHW/build/Debug/DirectHW.framework/DirectHW b/DirectHW/build/Debug/DirectHW.framework/DirectHW
deleted file mode 120000
index 663039e..0000000
--- a/DirectHW/build/Debug/DirectHW.framework/DirectHW
+++ /dev/null
@@ -1 +0,0 @@
-Versions/Current/DirectHW
\ No newline at end of file
diff --git a/DirectHW/build/Debug/DirectHW.framework/Headers b/DirectHW/build/Debug/DirectHW.framework/Headers
deleted file mode 120000
index a177d2a..0000000
--- a/DirectHW/build/Debug/DirectHW.framework/Headers
+++ /dev/null
@@ -1 +0,0 @@
-Versions/Current/Headers
\ No newline at end of file
diff --git a/DirectHW/build/Debug/DirectHW.framework/PkgInfo b/DirectHW/build/Debug/DirectHW.framework/PkgInfo
deleted file mode 100644
index 511ee85..0000000
--- a/DirectHW/build/Debug/DirectHW.framework/PkgInfo
+++ /dev/null
@@ -1 +0,0 @@
-FMWKDHWF
\ No newline at end of file
diff --git a/DirectHW/build/Debug/DirectHW.framework/Resources b/DirectHW/build/Debug/DirectHW.framework/Resources
deleted file mode 120000
index 953ee36..0000000
--- a/DirectHW/build/Debug/DirectHW.framework/Resources
+++ /dev/null
@@ -1 +0,0 @@
-Versions/Current/Resources
\ No newline at end of file
diff --git a/DirectHW/build/Debug/DirectHW.framework/Versions/A/DirectHW b/DirectHW/build/Debug/DirectHW.framework/Versions/A/DirectHW
deleted file mode 100755
index 5031a90..0000000
Binary files a/DirectHW/build/Debug/DirectHW.framework/Versions/A/DirectHW and /dev/null differ
diff --git a/DirectHW/build/Debug/DirectHW.framework/Versions/A/Headers/DirectHW.h b/DirectHW/build/Debug/DirectHW.framework/Versions/A/Headers/DirectHW.h
deleted file mode 100644
index 5e9d1a1..0000000
--- a/DirectHW/build/Debug/DirectHW.framework/Versions/A/Headers/DirectHW.h
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * DirectHW.h - userspace part for DirectHW
- *
- * Copyright © 2008-2010 coresystems GmbH
- *
- * Permission to use, copy, modify, and/or distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- */
-
-#ifndef __DIRECTHW_H
-#define __DIRECTHW_H
-
-#include
-
-int iopl(int unused);
-
-unsigned char inb(unsigned short addr);
-unsigned short inw(unsigned short addr);
-unsigned int inl(unsigned short addr);
-#ifdef __EA64__
-unsigned long inq(unsigned short addr);
-#endif
-
-void outb(unsigned char val, unsigned short addr);
-void outw(unsigned short val, unsigned short addr);
-void outl(unsigned int val, unsigned short addr);
-#ifdef __EA64__
-void outq(unsigned long val, unsigned short addr);
-#endif
-
-void *map_physical(uint64_t phys_addr, size_t len);
-void unmap_physical(void *virt_addr, size_t len);
-
-typedef union {
- struct {
-#ifdef __BIG_ENDIAN__
- uint32_t hi;
- uint32_t lo;
-#else /* __LITTLE_ENDIAN__ */
- uint32_t lo;
- uint32_t hi;
-#endif /* __BIG_ENDIAN__ */
- } io32;
-
- uint64_t io64;
-} msr_t;
-
-msr_t rdmsr(int addr);
-
-int wrmsr(int addr, msr_t msr);
-int logical_cpu_select(int cpu);
-
-#ifndef INVALID_MSR_LO
-#define INVALID_MSR_LO 0x63744857
-#endif /* INVALID_MSR_LO */
-
-#ifndef INVALID_MSR_HI
-#define INVALID_MSR_HI 0x44697265
-#endif /* INVALID_MSR_HI */
-
-#endif /* __DIRECTHW_H */
diff --git a/DirectHW/build/Debug/DirectHW.framework/Versions/A/Resources/Info.plist b/DirectHW/build/Debug/DirectHW.framework/Versions/A/Resources/Info.plist
deleted file mode 100644
index ef1ea91..0000000
--- a/DirectHW/build/Debug/DirectHW.framework/Versions/A/Resources/Info.plist
+++ /dev/null
@@ -1,46 +0,0 @@
-
-
-
-
- BuildMachineOSBuild
- 20C69
- CFBundleDevelopmentRegion
- en_US
- CFBundleExecutable
- DirectHW
- CFBundleIdentifier
- com.coresystems.DirectHW
- CFBundleInfoDictionaryVersion
- 6.0
- CFBundlePackageType
- FMWK
- CFBundleShortVersionString
- 1.4
- CFBundleSignature
- DHWF
- CFBundleSupportedPlatforms
-
- MacOSX
-
- CFBundleVersion
- 1.4
- DTCompiler
- com.apple.compilers.llvm.clang.1_0
- DTPlatformBuild
- 12C33
- DTPlatformName
- macosx
- DTPlatformVersion
- 11.1
- DTSDKBuild
- 20C63
- DTSDKName
- macosx11.1
- DTXcode
- 1230
- DTXcodeBuild
- 12C33
- LSMinimumSystemVersion
- 11.1
-
-
diff --git a/DirectHW/build/Debug/DirectHW.framework/Versions/A/_CodeSignature/CodeResources b/DirectHW/build/Debug/DirectHW.framework/Versions/A/_CodeSignature/CodeResources
deleted file mode 100644
index fc72133..0000000
--- a/DirectHW/build/Debug/DirectHW.framework/Versions/A/_CodeSignature/CodeResources
+++ /dev/null
@@ -1,135 +0,0 @@
-
-
-
-
- files
-
- Resources/Info.plist
-
- qwLEDTfpiY5eBNlU9ekz077sqKs=
-
-
- files2
-
- Headers/DirectHW.h
-
- hash2
-
- zf7xjb3mLkwPdBpQlZ0AVwvfTpjPytUKY3F8a5jjaQs=
-
-
- Resources/Info.plist
-
- hash2
-
- 9mb8avj2GaemqETK0hPBuHEu7yGE2yHd3As3cHeJQp4=
-
-
-
- rules
-
- ^Resources/
-
- ^Resources/.*\.lproj/
-
- optional
-
- weight
- 1000
-
- ^Resources/.*\.lproj/locversion.plist$
-
- omit
-
- weight
- 1100
-
- ^Resources/Base\.lproj/
-
- weight
- 1010
-
- ^version.plist$
-
-
- rules2
-
- .*\.dSYM($|/)
-
- weight
- 11
-
- ^(.*/)?\.DS_Store$
-
- omit
-
- weight
- 2000
-
- ^(Frameworks|SharedFrameworks|PlugIns|Plug-ins|XPCServices|Helpers|MacOS|Library/(Automator|Spotlight|LoginItems))/
-
- nested
-
- weight
- 10
-
- ^.*
-
- ^Info\.plist$
-
- omit
-
- weight
- 20
-
- ^PkgInfo$
-
- omit
-
- weight
- 20
-
- ^Resources/
-
- weight
- 20
-
- ^Resources/.*\.lproj/
-
- optional
-
- weight
- 1000
-
- ^Resources/.*\.lproj/locversion.plist$
-
- omit
-
- weight
- 1100
-
- ^Resources/Base\.lproj/
-
- weight
- 1010
-
- ^[^/]+$
-
- nested
-
- weight
- 10
-
- ^embedded\.provisionprofile$
-
- weight
- 20
-
- ^version\.plist$
-
- weight
- 20
-
-
-
-
diff --git a/DirectHW/build/Debug/DirectHW.framework/Versions/Current b/DirectHW/build/Debug/DirectHW.framework/Versions/Current
deleted file mode 120000
index 8c7e5a6..0000000
--- a/DirectHW/build/Debug/DirectHW.framework/Versions/Current
+++ /dev/null
@@ -1 +0,0 @@
-A
\ No newline at end of file
diff --git a/DirectHW/build/Debug/DirectHW.kext/Contents/MacOS/DirectHW b/DirectHW/build/Debug/DirectHW.kext/Contents/MacOS/DirectHW
deleted file mode 100755
index 0171d92..0000000
Binary files a/DirectHW/build/Debug/DirectHW.kext/Contents/MacOS/DirectHW and /dev/null differ
diff --git a/DirectHW/build/Debug/DirectHW.kext/Contents/PkgInfo b/DirectHW/build/Debug/DirectHW.kext/Contents/PkgInfo
deleted file mode 100644
index 9c1b2cd..0000000
--- a/DirectHW/build/Debug/DirectHW.kext/Contents/PkgInfo
+++ /dev/null
@@ -1 +0,0 @@
-KEXTDHWK
\ No newline at end of file
diff --git a/DirectHW/build/Debug/DirectHW.kext/Contents/_CodeSignature/CodeResources b/DirectHW/build/Debug/DirectHW.kext/Contents/_CodeSignature/CodeResources
deleted file mode 100644
index d5d0fd7..0000000
--- a/DirectHW/build/Debug/DirectHW.kext/Contents/_CodeSignature/CodeResources
+++ /dev/null
@@ -1,115 +0,0 @@
-
-
-
-
- files
-
- files2
-
- rules
-
- ^Resources/
-
- ^Resources/.*\.lproj/
-
- optional
-
- weight
- 1000
-
- ^Resources/.*\.lproj/locversion.plist$
-
- omit
-
- weight
- 1100
-
- ^Resources/Base\.lproj/
-
- weight
- 1010
-
- ^version.plist$
-
-
- rules2
-
- .*\.dSYM($|/)
-
- weight
- 11
-
- ^(.*/)?\.DS_Store$
-
- omit
-
- weight
- 2000
-
- ^(Frameworks|SharedFrameworks|PlugIns|Plug-ins|XPCServices|Helpers|MacOS|Library/(Automator|Spotlight|LoginItems))/
-
- nested
-
- weight
- 10
-
- ^.*
-
- ^Info\.plist$
-
- omit
-
- weight
- 20
-
- ^PkgInfo$
-
- omit
-
- weight
- 20
-
- ^Resources/
-
- weight
- 20
-
- ^Resources/.*\.lproj/
-
- optional
-
- weight
- 1000
-
- ^Resources/.*\.lproj/locversion.plist$
-
- omit
-
- weight
- 1100
-
- ^Resources/Base\.lproj/
-
- weight
- 1010
-
- ^[^/]+$
-
- nested
-
- weight
- 10
-
- ^embedded\.provisionprofile$
-
- weight
- 20
-
- ^version\.plist$
-
- weight
- 20
-
-
-
-
diff --git a/DirectHW/build/Debug/libDirectHW.a b/DirectHW/build/Debug/libDirectHW.a
deleted file mode 100644
index 9398077..0000000
Binary files a/DirectHW/build/Debug/libDirectHW.a and /dev/null differ
diff --git a/DirectHW/build/Debug/usr/local/include/DirectHW.h b/DirectHW/build/Debug/usr/local/include/DirectHW.h
deleted file mode 100644
index 5e9d1a1..0000000
--- a/DirectHW/build/Debug/usr/local/include/DirectHW.h
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * DirectHW.h - userspace part for DirectHW
- *
- * Copyright © 2008-2010 coresystems GmbH
- *
- * Permission to use, copy, modify, and/or distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- */
-
-#ifndef __DIRECTHW_H
-#define __DIRECTHW_H
-
-#include
-
-int iopl(int unused);
-
-unsigned char inb(unsigned short addr);
-unsigned short inw(unsigned short addr);
-unsigned int inl(unsigned short addr);
-#ifdef __EA64__
-unsigned long inq(unsigned short addr);
-#endif
-
-void outb(unsigned char val, unsigned short addr);
-void outw(unsigned short val, unsigned short addr);
-void outl(unsigned int val, unsigned short addr);
-#ifdef __EA64__
-void outq(unsigned long val, unsigned short addr);
-#endif
-
-void *map_physical(uint64_t phys_addr, size_t len);
-void unmap_physical(void *virt_addr, size_t len);
-
-typedef union {
- struct {
-#ifdef __BIG_ENDIAN__
- uint32_t hi;
- uint32_t lo;
-#else /* __LITTLE_ENDIAN__ */
- uint32_t lo;
- uint32_t hi;
-#endif /* __BIG_ENDIAN__ */
- } io32;
-
- uint64_t io64;
-} msr_t;
-
-msr_t rdmsr(int addr);
-
-int wrmsr(int addr, msr_t msr);
-int logical_cpu_select(int cpu);
-
-#ifndef INVALID_MSR_LO
-#define INVALID_MSR_LO 0x63744857
-#endif /* INVALID_MSR_LO */
-
-#ifndef INVALID_MSR_HI
-#define INVALID_MSR_HI 0x44697265
-#endif /* INVALID_MSR_HI */
-
-#endif /* __DIRECTHW_H */
diff --git a/DirectHW/build/Release/.DS_Store b/DirectHW/build/Release/.DS_Store
deleted file mode 100644
index c4cabbc..0000000
Binary files a/DirectHW/build/Release/.DS_Store and /dev/null differ
diff --git a/DirectHW/build/Release/DirectHW.framework/DirectHW b/DirectHW/build/Release/DirectHW.framework/DirectHW
deleted file mode 120000
index 663039e..0000000
--- a/DirectHW/build/Release/DirectHW.framework/DirectHW
+++ /dev/null
@@ -1 +0,0 @@
-Versions/Current/DirectHW
\ No newline at end of file
diff --git a/DirectHW/build/Release/DirectHW.framework/Headers b/DirectHW/build/Release/DirectHW.framework/Headers
deleted file mode 120000
index a177d2a..0000000
--- a/DirectHW/build/Release/DirectHW.framework/Headers
+++ /dev/null
@@ -1 +0,0 @@
-Versions/Current/Headers
\ No newline at end of file
diff --git a/DirectHW/build/Release/DirectHW.framework/PkgInfo b/DirectHW/build/Release/DirectHW.framework/PkgInfo
deleted file mode 100644
index 511ee85..0000000
--- a/DirectHW/build/Release/DirectHW.framework/PkgInfo
+++ /dev/null
@@ -1 +0,0 @@
-FMWKDHWF
\ No newline at end of file
diff --git a/DirectHW/build/Release/DirectHW.framework/Resources b/DirectHW/build/Release/DirectHW.framework/Resources
deleted file mode 120000
index 953ee36..0000000
--- a/DirectHW/build/Release/DirectHW.framework/Resources
+++ /dev/null
@@ -1 +0,0 @@
-Versions/Current/Resources
\ No newline at end of file
diff --git a/DirectHW/build/Release/DirectHW.framework/Versions/A/Headers/DirectHW.h b/DirectHW/build/Release/DirectHW.framework/Versions/A/Headers/DirectHW.h
deleted file mode 100644
index 5e9d1a1..0000000
--- a/DirectHW/build/Release/DirectHW.framework/Versions/A/Headers/DirectHW.h
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * DirectHW.h - userspace part for DirectHW
- *
- * Copyright © 2008-2010 coresystems GmbH
- *
- * Permission to use, copy, modify, and/or distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- */
-
-#ifndef __DIRECTHW_H
-#define __DIRECTHW_H
-
-#include
-
-int iopl(int unused);
-
-unsigned char inb(unsigned short addr);
-unsigned short inw(unsigned short addr);
-unsigned int inl(unsigned short addr);
-#ifdef __EA64__
-unsigned long inq(unsigned short addr);
-#endif
-
-void outb(unsigned char val, unsigned short addr);
-void outw(unsigned short val, unsigned short addr);
-void outl(unsigned int val, unsigned short addr);
-#ifdef __EA64__
-void outq(unsigned long val, unsigned short addr);
-#endif
-
-void *map_physical(uint64_t phys_addr, size_t len);
-void unmap_physical(void *virt_addr, size_t len);
-
-typedef union {
- struct {
-#ifdef __BIG_ENDIAN__
- uint32_t hi;
- uint32_t lo;
-#else /* __LITTLE_ENDIAN__ */
- uint32_t lo;
- uint32_t hi;
-#endif /* __BIG_ENDIAN__ */
- } io32;
-
- uint64_t io64;
-} msr_t;
-
-msr_t rdmsr(int addr);
-
-int wrmsr(int addr, msr_t msr);
-int logical_cpu_select(int cpu);
-
-#ifndef INVALID_MSR_LO
-#define INVALID_MSR_LO 0x63744857
-#endif /* INVALID_MSR_LO */
-
-#ifndef INVALID_MSR_HI
-#define INVALID_MSR_HI 0x44697265
-#endif /* INVALID_MSR_HI */
-
-#endif /* __DIRECTHW_H */
diff --git a/DirectHW/build/Release/DirectHW.framework/Versions/A/Resources/Info.plist b/DirectHW/build/Release/DirectHW.framework/Versions/A/Resources/Info.plist
deleted file mode 100644
index ef1ea91..0000000
--- a/DirectHW/build/Release/DirectHW.framework/Versions/A/Resources/Info.plist
+++ /dev/null
@@ -1,46 +0,0 @@
-
-
-
-
- BuildMachineOSBuild
- 20C69
- CFBundleDevelopmentRegion
- en_US
- CFBundleExecutable
- DirectHW
- CFBundleIdentifier
- com.coresystems.DirectHW
- CFBundleInfoDictionaryVersion
- 6.0
- CFBundlePackageType
- FMWK
- CFBundleShortVersionString
- 1.4
- CFBundleSignature
- DHWF
- CFBundleSupportedPlatforms
-
- MacOSX
-
- CFBundleVersion
- 1.4
- DTCompiler
- com.apple.compilers.llvm.clang.1_0
- DTPlatformBuild
- 12C33
- DTPlatformName
- macosx
- DTPlatformVersion
- 11.1
- DTSDKBuild
- 20C63
- DTSDKName
- macosx11.1
- DTXcode
- 1230
- DTXcodeBuild
- 12C33
- LSMinimumSystemVersion
- 11.1
-
-
diff --git a/DirectHW/build/Release/DirectHW.framework/Versions/A/_CodeSignature/CodeResources b/DirectHW/build/Release/DirectHW.framework/Versions/A/_CodeSignature/CodeResources
deleted file mode 100644
index fc72133..0000000
--- a/DirectHW/build/Release/DirectHW.framework/Versions/A/_CodeSignature/CodeResources
+++ /dev/null
@@ -1,135 +0,0 @@
-
-
-
-
- files
-
- Resources/Info.plist
-
- qwLEDTfpiY5eBNlU9ekz077sqKs=
-
-
- files2
-
- Headers/DirectHW.h
-
- hash2
-
- zf7xjb3mLkwPdBpQlZ0AVwvfTpjPytUKY3F8a5jjaQs=
-
-
- Resources/Info.plist
-
- hash2
-
- 9mb8avj2GaemqETK0hPBuHEu7yGE2yHd3As3cHeJQp4=
-
-
-
- rules
-
- ^Resources/
-
- ^Resources/.*\.lproj/
-
- optional
-
- weight
- 1000
-
- ^Resources/.*\.lproj/locversion.plist$
-
- omit
-
- weight
- 1100
-
- ^Resources/Base\.lproj/
-
- weight
- 1010
-
- ^version.plist$
-
-
- rules2
-
- .*\.dSYM($|/)
-
- weight
- 11
-
- ^(.*/)?\.DS_Store$
-
- omit
-
- weight
- 2000
-
- ^(Frameworks|SharedFrameworks|PlugIns|Plug-ins|XPCServices|Helpers|MacOS|Library/(Automator|Spotlight|LoginItems))/
-
- nested
-
- weight
- 10
-
- ^.*
-
- ^Info\.plist$
-
- omit
-
- weight
- 20
-
- ^PkgInfo$
-
- omit
-
- weight
- 20
-
- ^Resources/
-
- weight
- 20
-
- ^Resources/.*\.lproj/
-
- optional
-
- weight
- 1000
-
- ^Resources/.*\.lproj/locversion.plist$
-
- omit
-
- weight
- 1100
-
- ^Resources/Base\.lproj/
-
- weight
- 1010
-
- ^[^/]+$
-
- nested
-
- weight
- 10
-
- ^embedded\.provisionprofile$
-
- weight
- 20
-
- ^version\.plist$
-
- weight
- 20
-
-
-
-
diff --git a/DirectHW/build/Release/DirectHW.framework/Versions/Current b/DirectHW/build/Release/DirectHW.framework/Versions/Current
deleted file mode 120000
index 8c7e5a6..0000000
--- a/DirectHW/build/Release/DirectHW.framework/Versions/Current
+++ /dev/null
@@ -1 +0,0 @@
-A
\ No newline at end of file
diff --git a/DirectHW/build/Release/DirectHW.kext/Contents/Info.plist b/DirectHW/build/Release/DirectHW.kext/Contents/Info.plist
deleted file mode 100644
index b903853..0000000
--- a/DirectHW/build/Release/DirectHW.kext/Contents/Info.plist
+++ /dev/null
@@ -1,81 +0,0 @@
-
-
-
-
- BuildMachineOSBuild
- 20C69
- CFBundleDevelopmentRegion
- en_US
- CFBundleExecutable
- DirectHW
- CFBundleIdentifier
- com.dcook.driver.DirectHW
- CFBundleInfoDictionaryVersion
- 6.0
- CFBundleName
- DirectHW
- CFBundlePackageType
- KEXT
- CFBundleShortVersionString
- 1.4
- CFBundleSignature
- DHWK
- CFBundleSupportedPlatforms
-
- MacOSX
-
- CFBundleVersion
- 1.4
- DTCompiler
- com.apple.compilers.llvm.clang.1_0
- DTPlatformBuild
- 12C33
- DTPlatformName
- macosx
- DTPlatformVersion
- 11.1
- DTSDKBuild
- 20C63
- DTSDKName
- macosx11.1
- DTXcode
- 1230
- DTXcodeBuild
- 12C33
- IOKitPersonalities
-
- DirectHWUserClient
-
- CFBundleIdentifier
- com.dcook.driver.DirectHW
- IOClass
- DirectHWService
- IOMatchCategory
- DirectHWService
- IOProviderClass
- IOResources
- IOResourceMatch
- IOKit
- IOUserClientClass
- DirectHWUserClient
-
-
- LSMinimumSystemVersion
- 11.1
- OSBundleCompatibleVersion
- 1.0
- OSBundleLibraries
-
- com.apple.kpi.iokit
- 8.0.0d0
- com.apple.kpi.libkern
- 8.0.0d0
- com.apple.kpi.mach
- 8.0.0d0
- com.apple.kpi.unsupported
- 8.0.0b1
-
- OSBundleRequied
- Root
-
-
diff --git a/DirectHW/build/Release/DirectHW.kext/Contents/MacOS/DirectHW b/DirectHW/build/Release/DirectHW.kext/Contents/MacOS/DirectHW
deleted file mode 100755
index 4533f76..0000000
Binary files a/DirectHW/build/Release/DirectHW.kext/Contents/MacOS/DirectHW and /dev/null differ
diff --git a/DirectHW/build/Release/DirectHW.kext/Contents/PkgInfo b/DirectHW/build/Release/DirectHW.kext/Contents/PkgInfo
deleted file mode 100644
index 9c1b2cd..0000000
--- a/DirectHW/build/Release/DirectHW.kext/Contents/PkgInfo
+++ /dev/null
@@ -1 +0,0 @@
-KEXTDHWK
\ No newline at end of file
diff --git a/DirectHW/build/Release/DirectHW.kext/Contents/_CodeSignature/CodeResources b/DirectHW/build/Release/DirectHW.kext/Contents/_CodeSignature/CodeResources
deleted file mode 100644
index d5d0fd7..0000000
--- a/DirectHW/build/Release/DirectHW.kext/Contents/_CodeSignature/CodeResources
+++ /dev/null
@@ -1,115 +0,0 @@
-
-
-
-
- files
-
- files2
-
- rules
-
- ^Resources/
-
- ^Resources/.*\.lproj/
-
- optional
-
- weight
- 1000
-
- ^Resources/.*\.lproj/locversion.plist$
-
- omit
-
- weight
- 1100
-
- ^Resources/Base\.lproj/
-
- weight
- 1010
-
- ^version.plist$
-
-
- rules2
-
- .*\.dSYM($|/)
-
- weight
- 11
-
- ^(.*/)?\.DS_Store$
-
- omit
-
- weight
- 2000
-
- ^(Frameworks|SharedFrameworks|PlugIns|Plug-ins|XPCServices|Helpers|MacOS|Library/(Automator|Spotlight|LoginItems))/
-
- nested
-
- weight
- 10
-
- ^.*
-
- ^Info\.plist$
-
- omit
-
- weight
- 20
-
- ^PkgInfo$
-
- omit
-
- weight
- 20
-
- ^Resources/
-
- weight
- 20
-
- ^Resources/.*\.lproj/
-
- optional
-
- weight
- 1000
-
- ^Resources/.*\.lproj/locversion.plist$
-
- omit
-
- weight
- 1100
-
- ^Resources/Base\.lproj/
-
- weight
- 1010
-
- ^[^/]+$
-
- nested
-
- weight
- 10
-
- ^embedded\.provisionprofile$
-
- weight
- 20
-
- ^version\.plist$
-
- weight
- 20
-
-
-
-
diff --git a/DirectHW/build/Release/libDirectHW.a b/DirectHW/build/Release/libDirectHW.a
deleted file mode 100644
index 4cb0aed..0000000
Binary files a/DirectHW/build/Release/libDirectHW.a and /dev/null differ
diff --git a/DirectHW/build/Release/usr/.DS_Store b/DirectHW/build/Release/usr/.DS_Store
deleted file mode 100644
index c6f7c52..0000000
Binary files a/DirectHW/build/Release/usr/.DS_Store and /dev/null differ
diff --git a/DirectHW/build/Release/usr/local/.DS_Store b/DirectHW/build/Release/usr/local/.DS_Store
deleted file mode 100644
index f2165f4..0000000
Binary files a/DirectHW/build/Release/usr/local/.DS_Store and /dev/null differ
diff --git a/DirectHW/build/Release/usr/local/include/DirectHW.h b/DirectHW/build/Release/usr/local/include/DirectHW.h
deleted file mode 100644
index 5e9d1a1..0000000
--- a/DirectHW/build/Release/usr/local/include/DirectHW.h
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * DirectHW.h - userspace part for DirectHW
- *
- * Copyright © 2008-2010 coresystems GmbH
- *
- * Permission to use, copy, modify, and/or distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- */
-
-#ifndef __DIRECTHW_H
-#define __DIRECTHW_H
-
-#include
-
-int iopl(int unused);
-
-unsigned char inb(unsigned short addr);
-unsigned short inw(unsigned short addr);
-unsigned int inl(unsigned short addr);
-#ifdef __EA64__
-unsigned long inq(unsigned short addr);
-#endif
-
-void outb(unsigned char val, unsigned short addr);
-void outw(unsigned short val, unsigned short addr);
-void outl(unsigned int val, unsigned short addr);
-#ifdef __EA64__
-void outq(unsigned long val, unsigned short addr);
-#endif
-
-void *map_physical(uint64_t phys_addr, size_t len);
-void unmap_physical(void *virt_addr, size_t len);
-
-typedef union {
- struct {
-#ifdef __BIG_ENDIAN__
- uint32_t hi;
- uint32_t lo;
-#else /* __LITTLE_ENDIAN__ */
- uint32_t lo;
- uint32_t hi;
-#endif /* __BIG_ENDIAN__ */
- } io32;
-
- uint64_t io64;
-} msr_t;
-
-msr_t rdmsr(int addr);
-
-int wrmsr(int addr, msr_t msr);
-int logical_cpu_select(int cpu);
-
-#ifndef INVALID_MSR_LO
-#define INVALID_MSR_LO 0x63744857
-#endif /* INVALID_MSR_LO */
-
-#ifndef INVALID_MSR_HI
-#define INVALID_MSR_HI 0x44697265
-#endif /* INVALID_MSR_HI */
-
-#endif /* __DIRECTHW_H */
diff --git a/DirectHW/build/XCBuildData/3b155dcf293f0ed6c254b044812fa1a4-desc.xcbuild b/DirectHW/build/XCBuildData/3b155dcf293f0ed6c254b044812fa1a4-desc.xcbuild
deleted file mode 100644
index df542d9..0000000
Binary files a/DirectHW/build/XCBuildData/3b155dcf293f0ed6c254b044812fa1a4-desc.xcbuild and /dev/null differ
diff --git a/DirectHW/build/XCBuildData/3b155dcf293f0ed6c254b044812fa1a4-manifest.xcbuild b/DirectHW/build/XCBuildData/3b155dcf293f0ed6c254b044812fa1a4-manifest.xcbuild
deleted file mode 100644
index bcf61b9..0000000
--- a/DirectHW/build/XCBuildData/3b155dcf293f0ed6c254b044812fa1a4-manifest.xcbuild
+++ /dev/null
@@ -1,60 +0,0 @@
-client:
- name: basic
- version: 0
- file-system: default
-
-targets:
- "": [""]
-
-nodes:
- "/Users/andyvand/Downloads/DirectHW-BigSur/DirectHW/build": {"is-mutated":true}
-
-commands:
- "": {"tool":"phony","inputs":["/Users/andyvand/Downloads/DirectHW-BigSur/DirectHW/build","/Users/andyvand/Downloads/DirectHW-BigSur/DirectHW/build/Release/libDirectHW.a","",""],"outputs":[""]}
- "": {"tool":"stale-file-removal","expectedOutputs":["/Users/andyvand/Downloads/DirectHW-BigSur/DirectHW/build/DirectHW.build/Release/libDirectHW.build/Objects-normal/arm64/DHWVer.o","/Users/andyvand/Downloads/DirectHW-BigSur/DirectHW/build/DirectHW.build/Release/libDirectHW.build/Objects-normal/arm64/DirectHW.o","/Users/andyvand/Downloads/DirectHW-BigSur/DirectHW/build/DirectHW.build/Release/libDirectHW.build/Objects-normal/x86_64/DHWVer.o","/Users/andyvand/Downloads/DirectHW-BigSur/DirectHW/build/DirectHW.build/Release/libDirectHW.build/Objects-normal/x86_64/DirectHW.o","/Users/andyvand/Downloads/DirectHW-BigSur/DirectHW/build/Release/usr/local/include/DirectHW.h","/Users/andyvand/Downloads/DirectHW-BigSur/DirectHW/build/Release/libDirectHW.a","/Users/andyvand/Downloads/DirectHW-BigSur/DirectHW/build/DirectHW.build/Release/libDirectHW.build/Objects-normal/arm64/Binary/libDirectHW.a","/Users/andyvand/Downloads/DirectHW-BigSur/DirectHW/build/DirectHW.build/Release/libDirectHW.build/Objects-normal/x86_64/Binary/libDirectHW.a","/Users/andyvand/Downloads/DirectHW-BigSur/DirectHW/build/DirectHW.build/Release/libDirectHW.build/DerivedSources/DHWVer.c","/Users/andyvand/Downloads/DirectHW-BigSur/DirectHW/build/DirectHW.build/Release/libDirectHW.build/Objects-normal/arm64/DirectHW.LinkFileList","/Users/andyvand/Downloads/DirectHW-BigSur/DirectHW/build/DirectHW.build/Release/libDirectHW.build/Objects-normal/x86_64/DirectHW.LinkFileList"],"roots":["/tmp/DirectHW.dst","/Users/andyvand/Downloads/DirectHW-BigSur/DirectHW/build","/Users/andyvand/Downloads/DirectHW-BigSur/DirectHW/build"],"outputs":[""]}
- "Gate target-libDirectHW-2c20bf67f7f8aee26bf659bda01bb93e8df92610679fd98cba53bc539abf5189--Barrier-ChangeAlternatePermissions": {"tool":"phony","inputs":["",""],"outputs":[""]}
- "Gate target-libDirectHW-2c20bf67f7f8aee26bf659bda01bb93e8df92610679fd98cba53bc539abf5189--Barrier-ChangePermissions": {"tool":"phony","inputs":["",""],"outputs":[""]}
- "Gate target-libDirectHW-2c20bf67f7f8aee26bf659bda01bb93e8df92610679fd98cba53bc539abf5189--Barrier-CodeSign": {"tool":"phony","inputs":["",""],"outputs":[""]}
- "Gate target-libDirectHW-2c20bf67f7f8aee26bf659bda01bb93e8df92610679fd98cba53bc539abf5189--Barrier-CopyAside": {"tool":"phony","inputs":["",""],"outputs":[""]}
- "Gate target-libDirectHW-2c20bf67f7f8aee26bf659bda01bb93e8df92610679fd98cba53bc539abf5189--Barrier-RegisterExecutionPolicyException": {"tool":"phony","inputs":["",""],"outputs":[""]}
- "Gate target-libDirectHW-2c20bf67f7f8aee26bf659bda01bb93e8df92610679fd98cba53bc539abf5189--Barrier-RegisterProduct": {"tool":"phony","inputs":["",""],"outputs":[""]}
- "Gate target-libDirectHW-2c20bf67f7f8aee26bf659bda01bb93e8df92610679fd98cba53bc539abf5189--Barrier-StripSymbols": {"tool":"phony","inputs":["",""],"outputs":[""]}
- "Gate target-libDirectHW-2c20bf67f7f8aee26bf659bda01bb93e8df92610679fd98cba53bc539abf5189--Barrier-Validate": {"tool":"phony","inputs":["",""],"outputs":[""]}
- "Gate target-libDirectHW-2c20bf67f7f8aee26bf659bda01bb93e8df92610679fd98cba53bc539abf5189--CopySwiftPackageResourcesTaskProducer": {"tool":"phony","inputs":["",""],"outputs":[""]}
- "Gate target-libDirectHW-2c20bf67f7f8aee26bf659bda01bb93e8df92610679fd98cba53bc539abf5189--GeneratedFilesTaskProducer": {"tool":"phony","inputs":["",""],"outputs":[""]}
- "Gate target-libDirectHW-2c20bf67f7f8aee26bf659bda01bb93e8df92610679fd98cba53bc539abf5189--HeadermapTaskProducer": {"tool":"phony","inputs":["",""],"outputs":[""]}
- "Gate target-libDirectHW-2c20bf67f7f8aee26bf659bda01bb93e8df92610679fd98cba53bc539abf5189--InfoPlistTaskProducer": {"tool":"phony","inputs":["",""],"outputs":[""]}
- "Gate target-libDirectHW-2c20bf67f7f8aee26bf659bda01bb93e8df92610679fd98cba53bc539abf5189--ModuleMapTaskProducer": {"tool":"phony","inputs":["",""],"outputs":[""]}
- "Gate target-libDirectHW-2c20bf67f7f8aee26bf659bda01bb93e8df92610679fd98cba53bc539abf5189--ProductPostprocessingTaskProducer": {"tool":"phony","inputs":["","","","","","","","","","","",""],"outputs":[""]}
- "Gate target-libDirectHW-2c20bf67f7f8aee26bf659bda01bb93e8df92610679fd98cba53bc539abf5189--ProductStructureTaskProducer": {"tool":"phony","inputs":["",""],"outputs":[""]}
- "Gate target-libDirectHW-2c20bf67f7f8aee26bf659bda01bb93e8df92610679fd98cba53bc539abf5189--SanitizerTaskProducer": {"tool":"phony","inputs":["",""],"outputs":[""]}
- "Gate target-libDirectHW-2c20bf67f7f8aee26bf659bda01bb93e8df92610679fd98cba53bc539abf5189--StubBinaryTaskProducer": {"tool":"phony","inputs":["",""],"outputs":[""]}
- "Gate target-libDirectHW-2c20bf67f7f8aee26bf659bda01bb93e8df92610679fd98cba53bc539abf5189--SwiftFrameworkABICheckerTaskProducer": {"tool":"phony","inputs":["","",""],"outputs":[""]}
- "Gate target-libDirectHW-2c20bf67f7f8aee26bf659bda01bb93e8df92610679fd98cba53bc539abf5189--SwiftStandardLibrariesTaskProducer": {"tool":"phony","inputs":["","",""],"outputs":[""]}
- "Gate target-libDirectHW-2c20bf67f7f8aee26bf659bda01bb93e8df92610679fd98cba53bc539abf5189--TestTargetPostprocessingTaskProducer": {"tool":"phony","inputs":["",""],"outputs":[""]}
- "Gate target-libDirectHW-2c20bf67f7f8aee26bf659bda01bb93e8df92610679fd98cba53bc539abf5189--TestTargetTaskProducer": {"tool":"phony","inputs":["",""],"outputs":[""]}
- "Gate target-libDirectHW-2c20bf67f7f8aee26bf659bda01bb93e8df92610679fd98cba53bc539abf5189--VersionPlistTaskProducer": {"tool":"phony","inputs":["",""],"outputs":[""]}
- "Gate target-libDirectHW-2c20bf67f7f8aee26bf659bda01bb93e8df92610679fd98cba53bc539abf5189--XCFrameworkTaskProducer": {"tool":"phony","inputs":["",""],"outputs":[""]}
- "Gate target-libDirectHW-2c20bf67f7f8aee26bf659bda01bb93e8df92610679fd98cba53bc539abf5189--begin-compiling": {"tool":"phony","inputs":["","","",""],"outputs":[""]}
- "Gate target-libDirectHW-2c20bf67f7f8aee26bf659bda01bb93e8df92610679fd98cba53bc539abf5189--copy-headers-completion": {"tool":"phony","inputs":[""],"outputs":[""]}
- "Gate target-libDirectHW-2c20bf67f7f8aee26bf659bda01bb93e8df92610679fd98cba53bc539abf5189--end": {"tool":"phony","inputs":["","","","","","","","","","","","","","","","","","","","","","","","","","","","