OpenCore  1.0.4
OpenCore Bootloader
Loading...
Searching...
No Matches
AppleCpuSupport.c File Reference
#include <Uefi.h>
#include <IndustryStandard/AppleSmBios.h>
#include <Library/BaseLib.h>
#include <Library/OcCpuLib.h>
#include <Library/OcStringLib.h>
#include <IndustryStandard/ProcessorInfo.h>
#include "OcCpuInternals.h"

Go to the source code of this file.

Functions

UINT8 InternalDetectAppleMajorType (IN CONST CHAR8 *BrandString)
 
UINT16 InternalDetectAppleProcessorType (IN UINT8 Model, IN UINT8 Stepping, IN UINT8 AppleMajorType, IN UINT16 CoreCount, IN BOOLEAN Is64Bit)
 
UINT32 OcCpuModelToAppleFamily (IN CPUID_VERSION_INFO_EAX VersionEax)
 
UINT16 OcCpuFrequencyToDisplayFrequency (IN UINT64 Frequency)
 

Detailed Description

Copyright (C) 2016 - 2017, The HermitCrabs Lab. All rights reserved.

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 AppleCpuSupport.c.

Function Documentation

◆ InternalDetectAppleMajorType()

UINT8 InternalDetectAppleMajorType ( IN CONST CHAR8 * BrandString)

Detect Apple CPU major type.

Parameters
[in]BrandStringCPU Brand String from CPUID.
Return values
AppleCPU major type.

Definition at line 26 of file AppleCpuSupport.c.

◆ InternalDetectAppleProcessorType()

UINT16 InternalDetectAppleProcessorType ( IN UINT8 Model,
IN UINT8 Stepping,
IN UINT8 AppleMajorType,
IN UINT16 CoreCount,
IN BOOLEAN Is64Bit )

Detect Apple CPU type.

Parameters
[in]ModelCPU model from CPUID.
[in]SteppingCPU stepping from CPUID.
[in]AppleMajorTypeApple CPU major type.
[in]CoreCountNumber of physical cores.
[in]Is64BitCPU supports 64-bit mode.
Return values
AppleCPU type.

Definition at line 132 of file AppleCpuSupport.c.

◆ OcCpuFrequencyToDisplayFrequency()

UINT16 OcCpuFrequencyToDisplayFrequency ( IN UINT64 Frequency)

Converts calculated CPU frequency in Hz to rounded value in MHz.

Parameters
[in]FrequencyCPU frequency in Hz.
Returns
Rounded CPU frequency in MHz.

Definition at line 742 of file AppleCpuSupport.c.

◆ OcCpuModelToAppleFamily()

UINT32 OcCpuModelToAppleFamily ( IN CPUID_VERSION_INFO_EAX VersionEax)

Converts CPUID Family and Model extracted from EAX CPUID (1) call to AppleFamily value. This implements cpuid_set_cpufamily functionality as it is in XNU.

Parameters
[in]VersionEaxCPUID (1) EAX value.
Return values
AppleFamily (e.g. CPUFAMILY_UNKNOWN)

Definition at line 686 of file AppleCpuSupport.c.