VirtualBox

source: vbox/trunk/src/VBox/Devices/EFI/Firmware/MdePkg/Include/Library/CpuLib.h@ 105681

Last change on this file since 105681 was 105670, checked in by vboxsync, 7 months ago

Devices/EFI/FirmwareNew: Merge edk2-stable-202405 and make it build on aarch64, bugref:4643

  • Property svn:eol-style set to native
File size: 2.6 KB
Line 
1/** @file
2 Provides CPU architecture specific functions that can not be defined
3 in the Base Library due to dependencies on the PAL Library
4
5 The CPU Library provides services to flush CPU TLBs and place the CPU in a sleep state.
6 The implementation of these services on Itanium processors requires the use of PAL Calls.
7 PAL Calls require PEI and DXE specific mechanisms to look up PAL Entry Point.
8 As a result, these services could not be defined in the Base Library.
9
10Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
11Copyright (c) 2024, Loongson Technology Corporation Limited. All rights reserved.<BR>
12SPDX-License-Identifier: BSD-2-Clause-Patent
13
14**/
15
16#ifndef __CPU_LIB_H__
17#define __CPU_LIB_H__
18
19/**
20 Places the CPU in a sleep state until an interrupt is received.
21
22 Places the CPU in a sleep state until an interrupt is received. If interrupts
23 are disabled prior to calling this function, then the CPU will be placed in a
24 sleep state indefinitely.
25
26**/
27VOID
28EFIAPI
29CpuSleep (
30 VOID
31 );
32
33/**
34 Flushes all the Translation Lookaside Buffers(TLB) entries in a CPU.
35
36 Flushes all the Translation Lookaside Buffers(TLB) entries in a CPU.
37
38**/
39VOID
40EFIAPI
41CpuFlushTlb (
42 VOID
43 );
44
45#if defined (MDE_CPU_IA32) || defined (MDE_CPU_X64) || defined (MDE_CPU_LOONGARCH64)
46
47/**
48 Initialize the CPU floating point units.
49
50 Initializes floating point units for requirement of UEFI specification.
51 For IA32 and X64, this function initializes floating-point control word to 0x027F
52 (all exceptions masked,double-precision, round-to-nearest) and multimedia-extensions
53 control word (if supported) to 0x1F80 (all exceptions masked, round-to-nearest,
54 flush to zero for masked underflow).
55**/
56VOID
57EFIAPI
58InitializeFloatingPointUnits (
59 VOID
60 );
61
62#endif
63
64#if defined (MDE_CPU_IA32) || defined (MDE_CPU_X64)
65
66/**
67 Determine if the standard CPU signature is "AuthenticAMD".
68 @retval TRUE The CPU signature matches.
69 @retval FALSE The CPU signature does not match.
70**/
71BOOLEAN
72EFIAPI
73StandardSignatureIsAuthenticAMD (
74 VOID
75 );
76
77/**
78 Return the 32bit CPU family and model value.
79 @return CPUID[01h].EAX with Processor Type and Stepping ID cleared.
80**/
81UINT32
82EFIAPI
83GetCpuFamilyModel (
84 VOID
85 );
86
87/**
88 Return the CPU stepping ID.
89 @return CPU stepping ID value in CPUID[01h].EAX.
90**/
91UINT8
92EFIAPI
93GetCpuSteppingId (
94 VOID
95 );
96
97#endif
98
99#if defined (MDE_CPU_LOONGARCH64)
100
101/**
102 Enable the CPU floating point units.
103
104 Enable the CPU floating point units.
105**/
106VOID
107EFIAPI
108EnableFloatingPointUnits (
109 VOID
110 );
111
112/**
113 Disable the CPU floating point units.
114
115 Disable the CPU floating point units.
116**/
117VOID
118EFIAPI
119DisableFloatingPointUnits (
120 VOID
121 );
122
123#endif
124
125#endif
Note: See TracBrowser for help on using the repository browser.

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