VirtualBox

source: vbox/trunk/src/VBox/Devices/EFI/FirmwareNew/UefiCpuPkg/Library/CpuCommonFeaturesLib/FastStrings.c@ 85718

Last change on this file since 85718 was 80721, checked in by vboxsync, 5 years ago

Devices/EFI/FirmwareNew: Start upgrade process to edk2-stable201908 (compiles on Windows and works to some extent), bugref:4643

  • Property svn:eol-style set to native
File size: 2.0 KB
Line 
1/** @file
2 Fast-Strings feature.
3
4 Copyright (c) 2017, Intel Corporation. All rights reserved.<BR>
5 SPDX-License-Identifier: BSD-2-Clause-Patent
6
7**/
8
9#include "CpuCommonFeatures.h"
10
11/**
12 Initializes Fast-Strings feature to specific state.
13
14 @param[in] ProcessorNumber The index of the CPU executing this function.
15 @param[in] CpuInfo A pointer to the REGISTER_CPU_FEATURE_INFORMATION
16 structure for the CPU executing this function.
17 @param[in] ConfigData A pointer to the configuration buffer returned
18 by CPU_FEATURE_GET_CONFIG_DATA. NULL if
19 CPU_FEATURE_GET_CONFIG_DATA was not provided in
20 RegisterCpuFeature().
21 @param[in] State If TRUE, then the Fast-Strings feature must be enabled.
22 If FALSE, then the Fast-Strings feature must be disabled.
23
24 @retval RETURN_SUCCESS Fast-Strings feature is initialized.
25
26 @note This service could be called by BSP only.
27**/
28RETURN_STATUS
29EFIAPI
30FastStringsInitialize (
31 IN UINTN ProcessorNumber,
32 IN REGISTER_CPU_FEATURE_INFORMATION *CpuInfo,
33 IN VOID *ConfigData, OPTIONAL
34 IN BOOLEAN State
35 )
36{
37 //
38 // The scope of FastStrings bit in the MSR_IA32_MISC_ENABLE is core for below processor type, only program
39 // MSR_IA32_MISC_ENABLE for thread 0 in each core.
40 //
41 if (IS_SILVERMONT_PROCESSOR (CpuInfo->DisplayFamily, CpuInfo->DisplayModel) ||
42 IS_GOLDMONT_PROCESSOR (CpuInfo->DisplayFamily, CpuInfo->DisplayModel) ||
43 IS_PENTIUM_4_PROCESSOR (CpuInfo->DisplayFamily, CpuInfo->DisplayModel)) {
44 if (CpuInfo->ProcessorInfo.Location.Thread != 0) {
45 return RETURN_SUCCESS;
46 }
47 }
48
49 CPU_REGISTER_TABLE_WRITE_FIELD (
50 ProcessorNumber,
51 Msr,
52 MSR_IA32_MISC_ENABLE,
53 MSR_IA32_MISC_ENABLE_REGISTER,
54 Bits.FastStrings,
55 (State) ? 1 : 0
56 );
57 return RETURN_SUCCESS;
58}
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette