### Data Combination Example in SSDT
Source: https://github.com/acidanthera/cpufriend/blob/master/Instructions.md
This example shows how to integrate the `cf-frequency-data` from `ssdt_data.dsl` into an existing SSDT generated by `ssdtPRGen.sh`. It demonstrates the structure for pasting the custom data.
```dsl
//
// Context of the SSDT generated by ssdtPRGen.sh
//
Method (_DSM, 4, NotSerialized)
{
If (LEqual (Arg2, Zero))
{
Return (Buffer (One)
{
0x03
})
}
Return (Package () // size removed
{
"plugin-type",
One,
//
// Paste it from ssdt_data.dsl
//
"cf-frequency-data",
Buffer () // size removed
{
// Data from ssdt_data.dsl
}
})
}
//
// Context of the SSDT generated by ssdtPRGen.sh
//
```
--------------------------------
### Generate CPUFriendDataProvider.kext
Source: https://github.com/acidanthera/cpufriend/blob/master/Instructions.md
Use the `--kext` flag with `ResourceConverter.sh` to create a `CPUFriendDataProvider.kext` using information from a specified file.
```bash
./ResourceConverter.sh --kext /path/to/file
```
--------------------------------
### Enable Debug Logging for CPUFriend
Source: https://context7.com/acidanthera/cpufriend/llms.txt
Add this boot argument to enable verbose debug logging for CPUFriend. Only available in DEBUG builds.
```bash
# Add to boot-args in OpenCore config.plist or bootloader configuration
-cpufdbg
```
--------------------------------
### OpenCore config.plist Kernel Section for CPUFriend
Source: https://context7.com/acidanthera/cpufriend/llms.txt
This XML configuration snippet shows how to add Lilu, CPUFriend, and CPUFriendDataProvider kexts to the OpenCore bootloader's Kernel section. Ensure Lilu.kext is loaded before CPUFriend.kext.
```xml
Kernel
Add
BundlePath
Lilu.kext
Enabled
ExecutablePath
Contents/MacOS/Lilu
PlistPath
Contents/Info.plist
BundlePath
CPUFriend.kext
Enabled
ExecutablePath
Contents/MacOS/CPUFriend
PlistPath
Contents/Info.plist
BundlePath
CPUFriendDataProvider.kext
Enabled
ExecutablePath
PlistPath
Contents/Info.plist
```
--------------------------------
### Enable CPUFriend on Unsupported macOS Versions
Source: https://context7.com/acidanthera/cpufriend/llms.txt
Add this boot argument to allow CPUFriend to load on macOS versions not officially supported by the current build. Useful for beta or unsupported macOS versions.
```bash
# Add to boot-args for beta or unsupported macOS versions
-cpufbeta
```
--------------------------------
### Define CPUFriendDataProvider Info.plist
Source: https://context7.com/acidanthera/cpufriend/llms.txt
Structure for the Info.plist file in a CPUFriendDataProvider kext, including the cf-frequency-data key for base64-encoded binary data.
```xml
CFBundleIdentifier
org.acidanthera.driver.CPUFriendDataProvider
CFBundleInfoDictionaryVersion
6.0
CFBundleName
CPUFriendDataProvider
CFBundlePackageType
KEXT
CFBundleShortVersionString
1.0.1
CFBundleVersion
1.0.1
IOKitPersonalities
CPUFriendDataProvider
CFBundleIdentifier
com.apple.driver.AppleACPIPlatform
IOClass
AppleACPICPU
IONameMatch
processor
IOProbeScore
1100
IOProviderClass
IOACPIPlatformDevice
cf-frequency-data
AgAAAA...BASE64_ENCODED_DATA...
OSBundleRequired
Root
```
--------------------------------
### Generate CPUFriendDataProvider.kext
Source: https://context7.com/acidanthera/cpufriend/llms.txt
Use ResourceConverter.sh to create a CPUFriendDataProvider.kext from a modified plist. This kext injects custom CPU frequency data.
```bash
# Generate CPUFriendDataProvider.kext from a modified plist
./Tools/ResourceConverter.sh --kext /path/to/modified/Mac-XXXXXXXX.plist
```
```bash
# Generate version-specific kext for OpenCore MinKernel/MaxKernel compatibility
./Tools/ResourceConverter.sh --kext /path/to/modified/Mac-XXXXXXXX.plist 110
# Creates: CPUFriendDataProvider_110.kext (for macOS 11.0+)
```
```bash
# Example: Extract original plist, modify it, then generate the kext
# 1. Copy original plist from X86PlatformPlugin
cp /System/Library/Extensions/IOPlatformPluginFamily.kext/Contents/PlugIns/X86PlatformPlugin.kext/Contents/Resources/Mac-XXXXXXXX.plist ~/Desktop/
# 2. Modify FrequencyVectors or other values using a plist editor
# 3. Generate the data provider kext
cd /path/to/CPUFriend/Tools
./ResourceConverter.sh --kext ~/Desktop/Mac-XXXXXXXX.plist
# Output: CPUFriendDataProvider.kext in current directory
```
--------------------------------
### Enable CPUFriend on Unsupported OS Versions
Source: https://github.com/acidanthera/cpufriend/blob/master/Instructions.md
Add the `-cpufbeta` kernel flag to enable CPUFriend on operating systems that are not officially supported.
```bash
-cpufbeta
```
--------------------------------
### Enable CPUFriend Debug Logging
Source: https://github.com/acidanthera/cpufriend/blob/master/Instructions.md
Add the `-cpufdbg` kernel flag to enable debug logging. This is only available in DEBUG binaries of CPUFriend.
```bash
-cpufdbg
```
--------------------------------
### Disable CPUFriend Entirely
Source: https://context7.com/acidanthera/cpufriend/llms.txt
Add this boot argument to completely disable CPUFriend without removing the kext. Useful for testing or troubleshooting.
```bash
# Add to boot-args to disable CPUFriend
-cpufoff
```
--------------------------------
### Generate ssdt_data.dsl
Source: https://github.com/acidanthera/cpufriend/blob/master/Instructions.md
Use the `--acpi` flag with `ResourceConverter.sh` to create an `ssdt_data.dsl` file containing CPU frequency data from a specified file.
```bash
./ResourceConverter.sh --acpi /path/to/file
```
--------------------------------
### Inject cf-frequency-data in CPUFriend
Source: https://context7.com/acidanthera/cpufriend/llms.txt
Retrieves the cf-frequency-data property from the IOService tree and injects it during the configuration callback.
```c
// CPUFriend internally looks for cf-frequency-data in the IOService tree
// From CPUFriendData::probe():
auto data = OSDynamicCast(OSData, provider->getProperty("cf-frequency-data"));
if (!data) {
auto cpu = provider->getParentEntry(gIOServicePlane);
data = OSDynamicCast(OSData, cpu->getProperty("cf-frequency-data"));
}
// The data is then injected during configResourceCallback
// When custom data exists (size > 0), it replaces the original:
if (data && size > 0) {
resourceData = data;
resourceDataLength = size;
result = kOSReturnSuccess;
}
```
--------------------------------
### Combine CPUFriend SSDT Data with ssdtPRGen.sh
Source: https://context7.com/acidanthera/cpufriend/llms.txt
Structure for combining ssdt_data.dsl frequency data into an existing ssdtPRGen.sh SSDT. Locate the _DSM method and merge the 'cf-frequency-data' entry.
```dsl
// Combined SSDT structure (merge ssdt_data.dsl into ssdtPRGen SSDT)
// Locate Method (_DSM, 4, NotSerialized) in the ssdtPRGen SSDT
Method (_DSM, 4, NotSerialized)
{
If (LEqual (Arg2, Zero))
{
Return (Buffer (One)
{
0x03
})
}
Return (Package ()
{
// Original ssdtPRGen plugin-type entry
"plugin-type",
One,
// Add this section from ssdt_data.dsl
"cf-frequency-data",
Buffer ()
{
// Paste hex data from ssdt_data.dsl here
0x02, 0x00, 0x00, 0x00, /* ... frequency vector data ... */
}
})
}
```
--------------------------------
### Generate SSDT for ACPI Injection
Source: https://context7.com/acidanthera/cpufriend/llms.txt
Use ResourceConverter.sh to create an ssdt_data.dsl file for injecting CPU frequency data via ACPI. This method is useful when combining with other SSDTs.
```bash
# Generate ssdt_data.dsl from a modified plist
./Tools/ResourceConverter.sh --acpi /path/to/modified/Mac-XXXXXXXX.plist
# The script auto-detects CPU device name from ioreg
# Output: ssdt_data.dsl in current directory
# Example generated SSDT structure:
# DefinitionBlock ("", "SSDT", 2, "ACDT", "FreqData", 0x00000000)
# {
# External (_PR_.CPU0, DeviceObj)
# Scope (\_PR.CPU0)
# {
# Method (_DSM, 4, NotSerialized)
# {
# Return (Package ()
# {
# "plugin-type", One,
# "cf-frequency-data", Buffer () { /* hex data */ }
# })
# }
# }
# }
```
--------------------------------
### Analyze FrequencyVectors Binary Structure
Source: https://context7.com/acidanthera/cpufriend/llms.txt
C-style structure definitions for parsing frequency vector binary data used by X86PlatformPlugin.
```c
// xcpmio_vectors_t structure (from FrequencyVectors.bt)
// This is the format of frequency data in X86PlatformPlugin resources
typedef struct xcpmio_vector {
uint32_t fv_specifier; // Vector specifier
xcpmio_fv_t fv_type; // Type: ABSOLUTE, NON_TURBO_PCT, TURBO_PCT, etc.
uint32_t fv_mhz; // Frequency in MHz
uint64_t fv_ttd_us; // Time-to-decision in microseconds
xcpmio_idle_t idle[16]; // Idle state configurations
} xcpmio_vector_t;
typedef struct xcpmio_qos {
char qos_name[16]; // QoS level name
uint8_t qos_min_index; // Minimum frequency index
uint8_t qos_max_index; // Maximum frequency index
uint16_t qos_scales[32]; // Scaling factors
uint8_t qos_epp; // Energy Performance Preference
} xcpmio_qos_t;
typedef struct xcpmio_vectors {
uint32 version; // Version (typically 2)
xcpmio_vector_t vector[32]; // Up to 32 frequency vectors
xcpmio_qos_t qos[16]; // Up to 16 QoS configurations
xcpmio_var_t vars[16]; // Configuration variables
} xcpmio_vectors_t;
// Frequency vector types (fv_type field)
enum xcpmio_fv_t {
XCPMIO_FV_NONE = 0x0,
XCPMIO_FV_ABSOLUTE = 0x1, // Absolute MHz value
XCPMIO_FV_NON_TURBO_PCT = 0x2, // Percentage of non-turbo max
XCPMIO_FV_TURBO_PCT = 0x3, // Percentage of turbo max
XCPMIO_FV_LPM_PCT = 0x4, // Low power mode percentage
XCPMIO_FMAX_VMIN = 0x5, // Max frequency at minimum voltage
};
```
--------------------------------
### Disable CPUFriend Entirely
Source: https://github.com/acidanthera/cpufriend/blob/master/Instructions.md
Add the `-cpufoff` kernel flag to disable CPUFriend. This will prevent it from injecting any custom data.
```bash
-cpufoff
```
=== COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.