]> git.proxmox.com Git - mirror_edk2.git/blob - EdkCompatibilityPkg/Foundation/Library/Pei/PeiLib/X64/Processor.c
Sync all bug fixes between EDK1.04 and EDK1.06 into EdkCompatibilityPkg.
[mirror_edk2.git] / EdkCompatibilityPkg / Foundation / Library / Pei / PeiLib / X64 / Processor.c
1 /*++
2
3 Copyright (c) 2005 - 2010, Intel Corporation. All rights reserved.<BR>
4 This program and the accompanying materials
5 are licensed and made available under the terms and conditions of the BSD License
6 which accompanies this distribution. The full text of the license may be found at
7 http://opensource.org/licenses/bsd-license.php
8
9 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
10 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
11
12
13 Module Name:
14
15 Processor.c
16
17 Abstract:
18
19 --*/
20
21 #include "Tiano.h"
22 #include "EfiJump.h"
23 #include EFI_GUID_DEFINITION (PeiFlushInstructionCache)
24 #include EFI_GUID_DEFINITION (PeiTransferControl)
25
26 //
27 // Prototypes
28 //
29 EFI_STATUS
30 EFIAPI
31 TransferControlSetJump (
32 IN EFI_PEI_TRANSFER_CONTROL_PROTOCOL *This,
33 IN VOID *Jump
34 );
35
36 EFI_STATUS
37 EFIAPI
38 TransferControlLongJump (
39 IN EFI_PEI_TRANSFER_CONTROL_PROTOCOL *This,
40 IN VOID *Jump
41 );
42
43 EFI_STATUS
44 EFIAPI
45 FlushInstructionCacheFlush (
46 IN EFI_PEI_FLUSH_INSTRUCTION_CACHE_PROTOCOL *This,
47 IN EFI_PHYSICAL_ADDRESS Start,
48 IN UINT64 Length
49 );
50
51 //
52 // Table declarations
53 //
54 EFI_PEI_TRANSFER_CONTROL_PROTOCOL mTransferControl = {
55 TransferControlSetJump,
56 TransferControlLongJump,
57 sizeof (EFI_JUMP_BUFFER)
58 };
59
60 EFI_PEI_FLUSH_INSTRUCTION_CACHE_PROTOCOL mFlushInstructionCache = {
61 FlushInstructionCacheFlush
62 };
63
64
65 EFI_STATUS
66 EFIAPI
67 InstallEfiPeiTransferControl(
68 IN OUT EFI_PEI_TRANSFER_CONTROL_PROTOCOL **This
69 )
70 /*++
71
72 Routine Description:
73
74 Installs the pointer to the transfer control mechanism
75
76 Arguments:
77
78 This - Pointer to transfer control mechanism.
79
80 Returns:
81
82 This - Pointer to transfer control mechanism.
83
84 --*/
85 {
86 *This = &mTransferControl;
87 return EFI_SUCCESS;
88 }
89
90
91 EFI_STATUS
92 EFIAPI
93 InstallEfiPeiFlushInstructionCache (
94 IN OUT EFI_PEI_FLUSH_INSTRUCTION_CACHE_PROTOCOL **This
95 )
96 /*++
97
98 Routine Description:
99
100 Installs the pointer to the flush instruction cache mechanism
101
102 Arguments:
103
104 This - Pointer to flush instruction cache mechanism.
105
106 Returns:
107
108 This - Pointer to flush instruction cache mechanism.
109
110 --*/
111 {
112 *This = &mFlushInstructionCache;
113 return EFI_SUCCESS;
114 }
115
116
117 EFI_STATUS
118 EFIAPI
119 FlushInstructionCacheFlush (
120 IN EFI_PEI_FLUSH_INSTRUCTION_CACHE_PROTOCOL *This,
121 IN EFI_PHYSICAL_ADDRESS Start,
122 IN UINT64 Length
123 )
124 /*++
125
126 Routine Description:
127
128 This routine would provide support for flushing the CPU instruction cache.
129 In the case of IA32, this flushing is not necessary and is thus not implemented.
130
131 Arguments:
132
133 Pointer to CPU Architectural Protocol interface
134 Start adddress in memory to flush
135 Length of memory to flush
136
137 Returns:
138
139 Status
140 EFI_SUCCESS
141
142 --*/
143 {
144 return EFI_SUCCESS;
145 }
146