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 |
|
---|
10 | Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
|
---|
11 | SPDX-License-Identifier: BSD-2-Clause-Patent
|
---|
12 |
|
---|
13 | **/
|
---|
14 |
|
---|
15 | #ifndef __CPU_LIB_H__
|
---|
16 | #define __CPU_LIB_H__
|
---|
17 |
|
---|
18 | /**
|
---|
19 | Places the CPU in a sleep state until an interrupt is received.
|
---|
20 |
|
---|
21 | Places the CPU in a sleep state until an interrupt is received. If interrupts
|
---|
22 | are disabled prior to calling this function, then the CPU will be placed in a
|
---|
23 | sleep state indefinitely.
|
---|
24 |
|
---|
25 | **/
|
---|
26 | VOID
|
---|
27 | EFIAPI
|
---|
28 | CpuSleep (
|
---|
29 | VOID
|
---|
30 | );
|
---|
31 |
|
---|
32 | /**
|
---|
33 | Flushes all the Translation Lookaside Buffers(TLB) entries in a CPU.
|
---|
34 |
|
---|
35 | Flushes all the Translation Lookaside Buffers(TLB) entries in a CPU.
|
---|
36 |
|
---|
37 | **/
|
---|
38 | VOID
|
---|
39 | EFIAPI
|
---|
40 | CpuFlushTlb (
|
---|
41 | VOID
|
---|
42 | );
|
---|
43 |
|
---|
44 | #if defined (MDE_CPU_IA32) || defined (MDE_CPU_X64)
|
---|
45 |
|
---|
46 | /**
|
---|
47 | Initializes floating point units for requirement of UEFI specification.
|
---|
48 | This function initializes floating-point control word to 0x027F (all exceptions
|
---|
49 | masked,double-precision, round-to-nearest) and multimedia-extensions control word
|
---|
50 | (if supported) to 0x1F80 (all exceptions masked, round-to-nearest, flush to zero
|
---|
51 | for masked underflow).
|
---|
52 | **/
|
---|
53 | VOID
|
---|
54 | EFIAPI
|
---|
55 | InitializeFloatingPointUnits (
|
---|
56 | VOID
|
---|
57 | );
|
---|
58 |
|
---|
59 | /**
|
---|
60 | Determine if the standard CPU signature is "AuthenticAMD".
|
---|
61 | @retval TRUE The CPU signature matches.
|
---|
62 | @retval FALSE The CPU signature does not match.
|
---|
63 | **/
|
---|
64 | BOOLEAN
|
---|
65 | EFIAPI
|
---|
66 | StandardSignatureIsAuthenticAMD (
|
---|
67 | VOID
|
---|
68 | );
|
---|
69 |
|
---|
70 | /**
|
---|
71 | Return the 32bit CPU family and model value.
|
---|
72 | @return CPUID[01h].EAX with Processor Type and Stepping ID cleared.
|
---|
73 | **/
|
---|
74 | UINT32
|
---|
75 | EFIAPI
|
---|
76 | GetCpuFamilyModel (
|
---|
77 | VOID
|
---|
78 | );
|
---|
79 |
|
---|
80 | /**
|
---|
81 | Return the CPU stepping ID.
|
---|
82 | @return CPU stepping ID value in CPUID[01h].EAX.
|
---|
83 | **/
|
---|
84 | UINT8
|
---|
85 | EFIAPI
|
---|
86 | GetCpuSteppingId (
|
---|
87 | VOID
|
---|
88 | );
|
---|
89 |
|
---|
90 | #endif
|
---|
91 |
|
---|
92 | #endif
|
---|