OpenCore
1.0.4
OpenCore Bootloader
|
#include <Base.h>
#include <IndustryStandard/AppleIntelCpuInfo.h>
#include <Library/BaseMemoryLib.h>
#include <Library/OcDebugLogLib.h>
#include <Library/OcAppleKernelLib.h>
#include <Library/PrintLib.h>
#include <Library/OcFileLib.h>
#include <Library/OcStringLib.h>
#include <Library/UefiLib.h>
Go to the source code of this file.
Data Structures | |
struct | INTERNAL_CPUID_FN_PATCH |
struct | INTERNAL_CPUID_PATCH |
struct | INTERNAL_MICROCODE_PATCH |
Macros | |
#define | CURRENT_CPU_INFO_CORE_COUNT_OFFSET 1 |
Functions | |
STATIC_ASSERT (sizeof(INTERNAL_CPUID_FN_PATCH)==sizeof(mKernelCpuidReplaceDbg), "Check your CPUID patch layout") | |
STATIC EFI_STATUS | PatchKernelCpuIdLegacy (IN OUT PATCHER_CONTEXT *Patcher, IN UINT32 KernelVersion, IN OC_CPU_INFO *CpuInfo, IN UINT32 *Data, IN UINT32 *DataMask, IN UINT8 *Start, IN UINT8 *Last) |
EFI_STATUS | PatchKernelCpuId (IN OUT PATCHER_CONTEXT *Patcher, IN OC_CPU_INFO *CpuInfo, IN UINT32 *Data, IN UINT32 *DataMask, IN UINT32 KernelVersion) |
STATIC UINT8 * | PatchMovVar (IN OUT UINT8 *Location, IN BOOLEAN Is32Bit, IN OUT UINT64 *FuncAddr, IN UINT64 VarSymAddr, IN UINT64 Value) |
STATIC EFI_STATUS | PatchProvideCurrentCpuInfoMSR35h (IN OUT PATCHER_CONTEXT *Patcher, IN OC_CPU_INFO *CpuInfo, IN UINT32 KernelVersion) |
EFI_STATUS | PatchProvideCurrentCpuInfo (IN OUT PATCHER_CONTEXT *Patcher, IN OC_CPU_INFO *CpuInfo, IN UINT32 KernelVersion) |
CPUID kernel patches.
Copyright (c) 2018-2020, vit9696, Goldfish64. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Definition in file CpuidPatches.c.
#define CURRENT_CPU_INFO_CORE_COUNT_OFFSET 1 |
Definition at line 1076 of file CpuidPatches.c.
EFI_STATUS PatchKernelCpuId | ( | IN OUT PATCHER_CONTEXT * | Patcher, |
IN OC_CPU_INFO * | CpuInfo, | ||
IN UINT32 * | Data, | ||
IN UINT32 * | DataMask, | ||
IN UINT32 | KernelVersion ) |
Apply modification to CPUID 1.
Patcher | Patcher context. |
CpuInfo | CPU information. |
Data | 4 32-bit integers with CPUID data. |
DataMask | 4 32-bit integers with CPUID enabled overrides data. |
KernelVersion | Current kernel version. |
Definition at line 879 of file CpuidPatches.c.
STATIC EFI_STATUS PatchKernelCpuIdLegacy | ( | IN OUT PATCHER_CONTEXT * | Patcher, |
IN UINT32 | KernelVersion, | ||
IN OC_CPU_INFO * | CpuInfo, | ||
IN UINT32 * | Data, | ||
IN UINT32 * | DataMask, | ||
IN UINT8 * | Start, | ||
IN UINT8 * | Last ) |
Definition at line 210 of file CpuidPatches.c.
STATIC UINT8 * PatchMovVar | ( | IN OUT UINT8 * | Location, |
IN BOOLEAN | Is32Bit, | ||
IN OUT UINT64 * | FuncAddr, | ||
IN UINT64 | VarSymAddr, | ||
IN UINT64 | Value ) |
Definition at line 1109 of file CpuidPatches.c.
EFI_STATUS PatchProvideCurrentCpuInfo | ( | IN OUT PATCHER_CONTEXT * | Patcher, |
IN OC_CPU_INFO * | CpuInfo, | ||
IN UINT32 | KernelVersion ) |
Apply current CPU information patches.
Patcher | Patcher context. |
CpuInfo | CPU information. |
KernelVersion | Current kernel version. |
Definition at line 1557 of file CpuidPatches.c.
STATIC EFI_STATUS PatchProvideCurrentCpuInfoMSR35h | ( | IN OUT PATCHER_CONTEXT * | Patcher, |
IN OC_CPU_INFO * | CpuInfo, | ||
IN UINT32 | KernelVersion ) |
Definition at line 1344 of file CpuidPatches.c.
STATIC_ASSERT | ( | sizeof(INTERNAL_CPUID_FN_PATCH) | = =sizeof(mKernelCpuidReplaceDbg), |
"Check your CPUID patch layout" | ) |
UINT8 associativity |
Definition at line 34 of file CpuidPatches.c.
UINT8 linesize |
Definition at line 35 of file CpuidPatches.c.
STATIC CONST struct { ... } mCpuCacheDescriptorValues[] |
STATIC CONST UINT8 mKernelCpuidFindMcRel[] |
Definition at line 127 of file CpuidPatches.c.
STATIC CONST UINT8 mKernelCpuIdFindRelNew[] |
Definition at line 100 of file CpuidPatches.c.
STATIC CONST UINT8 mKernelCpuIdFindRelOld[] |
Definition at line 114 of file CpuidPatches.c.
STATIC CONST UINT8 mKernelCpuidReplaceDbg[] |
cpu->cpuid_signature = 0x11111111; cpu->cpuid_stepping = 0x22; cpu->cpuid_model = 0x33; cpu->cpuid_family = 0x44; cpu->cpuid_type = 0x55555555; cpu->cpuid_extmodel = 0x66; cpu->cpuid_extfamily = 0x77; cpu->cpuid_features = 0x8888888888888888; cpu->cpuid_logical_per_package = 0x99999999; cpu->cpuid_cpufamily = 0xAAAAAAAA; return 0xAAAAAAAA;
Definition at line 148 of file CpuidPatches.c.
STATIC CONST UINT8 mProvideCurrentCpuInfoLeopardSysctlMibInitFind1[] |
Definition at line 1420 of file CpuidPatches.c.
STATIC CONST UINT8 mProvideCurrentCpuInfoLeopardSysctlMibInitFind2[] |
Definition at line 1461 of file CpuidPatches.c.
STATIC CONST UINT8 mProvideCurrentCpuInfoLeopardSysctlMibInitMask1[] |
Definition at line 1427 of file CpuidPatches.c.
STATIC CONST UINT8 mProvideCurrentCpuInfoLeopardSysctlMibInitMask2[] |
Definition at line 1468 of file CpuidPatches.c.
STATIC PATCHER_GENERIC_PATCH mProvideCurrentCpuInfoLeopardSysctlMibInitPatch1 |
Definition at line 1446 of file CpuidPatches.c.
STATIC PATCHER_GENERIC_PATCH mProvideCurrentCpuInfoLeopardSysctlMibInitPatch2 |
Definition at line 1482 of file CpuidPatches.c.
STATIC UINT8 mProvideCurrentCpuInfoLeopardSysctlMibInitReplace1[] |
Definition at line 1434 of file CpuidPatches.c.
STATIC UINT8 mProvideCurrentCpuInfoLeopardSysctlMibInitReplace2[] |
Definition at line 1475 of file CpuidPatches.c.
STATIC CONST UINT8 mProvideCurrentCpuInfoSnowLeopardSysctlMibInitFind[] |
Definition at line 1497 of file CpuidPatches.c.
STATIC CONST UINT8 mProvideCurrentCpuInfoSnowLeopardSysctlMibInitFindMask[] |
Definition at line 1506 of file CpuidPatches.c.
STATIC PATCHER_GENERIC_PATCH mProvideCurrentCpuInfoSnowLeopardSysctlMibInitPatch |
Definition at line 1543 of file CpuidPatches.c.
STATIC UINT8 mProvideCurrentCpuInfoSnowLeopardSysctlMibInitReplace[] |
Definition at line 1515 of file CpuidPatches.c.
STATIC CONST UINT8 mProvideCurrentCpuInfoSnowLeopardSysctlMibInitReplaceMask[] |
Definition at line 1529 of file CpuidPatches.c.
STATIC CONST UINT8 mProvideCurrentCpuInfoTopologyCoreCountFind[] |
Definition at line 1207 of file CpuidPatches.c.
STATIC PATCHER_GENERIC_PATCH mProvideCurrentCpuInfoTopologyCoreCountPatch |
Definition at line 1219 of file CpuidPatches.c.
STATIC UINT8 mProvideCurrentCpuInfoTopologyCoreCountReplace[] |
Definition at line 1213 of file CpuidPatches.c.
STATIC CONST UINT8 mProvideCurrentCpuInfoTopologyCorePerPackageV1_5Find[] |
Definition at line 1268 of file CpuidPatches.c.
STATIC PATCHER_GENERIC_PATCH mProvideCurrentCpuInfoTopologyCorePerPackageV1_5Patch |
Definition at line 1287 of file CpuidPatches.c.
STATIC CONST UINT8 mProvideCurrentCpuInfoTopologyCorePerPackageV1_5Replace[] |
Definition at line 1278 of file CpuidPatches.c.
STATIC CONST UINT8 mProvideCurrentCpuInfoTopologyCorePerPackageV1Find[] |
Definition at line 1234 of file CpuidPatches.c.
STATIC PATCHER_GENERIC_PATCH mProvideCurrentCpuInfoTopologyCorePerPackageV1Patch |
Definition at line 1253 of file CpuidPatches.c.
STATIC CONST UINT8 mProvideCurrentCpuInfoTopologyCorePerPackageV1Replace[] |
Definition at line 1244 of file CpuidPatches.c.
STATIC CONST UINT8 mProvideCurrentCpuInfoTopologyCorePerPackageV2Find[] |
Definition at line 1302 of file CpuidPatches.c.
STATIC CONST UINT8 mProvideCurrentCpuInfoTopologyCorePerPackageV2Mask[] |
Definition at line 1312 of file CpuidPatches.c.
STATIC PATCHER_GENERIC_PATCH mProvideCurrentCpuInfoTopologyCorePerPackageV2Patch |
Definition at line 1329 of file CpuidPatches.c.
STATIC CONST UINT8 mProvideCurrentCpuInfoTopologyCorePerPackageV2Replace[] |
Definition at line 1318 of file CpuidPatches.c.
STATIC PATCHER_GENERIC_PATCH mProvideCurrentCpuInfoTopologyValidationPatch |
Definition at line 1062 of file CpuidPatches.c.
STATIC UINT8 mProvideCurrentCpuInfoTopologyValidationReplace[] |
Definition at line 1055 of file CpuidPatches.c.
STATIC UINT8 mProvideCurrentCpuInfoZeroMsrThreadCoreCountFind[] |
Definition at line 1080 of file CpuidPatches.c.
STATIC PATCHER_GENERIC_PATCH mProvideCurrentCpuInfoZeroMsrThreadCoreCountPatch |
Definition at line 1094 of file CpuidPatches.c.
STATIC UINT8 mProvideCurrentCpuInfoZeroMsrThreadCoreCountReplace[] |
Definition at line 1087 of file CpuidPatches.c.
UINT8 partitions |
Definition at line 36 of file CpuidPatches.c.
UINT32 size |
Definition at line 33 of file CpuidPatches.c.
cache_type_t type |
Definition at line 32 of file CpuidPatches.c.
UINT8 value |
Definition at line 31 of file CpuidPatches.c.