]> git.proxmox.com Git - mirror_edk2.git/blame - MdeModulePkg/Core/Pei/Ipf/SwitchToCacheMode.c
1. Sync the latest network stack. Add NetLibCreateIPv4DPathNode () in netlib library.
[mirror_edk2.git] / MdeModulePkg / Core / Pei / Ipf / SwitchToCacheMode.c
CommitLineData
192f6d4c 1/*++\r
2\r
3Copyright (c) 2006, Intel Corporation \r
4All rights reserved. This program and the accompanying materials \r
5are licensed and made available under the terms and conditions of the BSD License \r
6which accompanies this distribution. The full text of the license may be found at \r
7http://opensource.org/licenses/bsd-license.php \r
8 \r
9THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
10WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
11\r
12Module Name:\r
13\r
14 SwitchToCacheMode.c\r
15\r
16Abstract:\r
17\r
18 Ipf CAR specific function used to switch to cache mode for the later memory access\r
19\r
20Revision History\r
21\r
22--*/\r
23\r
192f6d4c 24#include "IpfPeiMain.h"\r
25#include "IpfCpuCore.i"\r
26\r
27VOID\r
28SwitchToCacheMode (\r
29 IN PEI_CORE_INSTANCE *CoreData\r
30 )\r
31/*++\r
32\r
33Routine Description:\r
34\r
35 Switch the PHIT pointers to cache mode after InstallPeiMemory in CAR.\r
36\r
37Arguments:\r
38\r
39 CoreData - The PEI core Private Data\r
40\r
41Returns:\r
42\r
43--*/\r
44{\r
45 EFI_HOB_HANDOFF_INFO_TABLE *Phit;\r
46\r
47 if (CoreData == NULL) {\r
48 //\r
49 // the first call with CoreData as NULL.\r
50 //\r
51 return;\r
52 }\r
53 \r
54 if ((GetHandOffStatus().r10 & 0xFF) == RecoveryFn) {\r
55 CoreData->StackBase = CoreData->StackBase & CACHE_MODE_ADDRESS_MASK;\r
56 CoreData->HobList.Raw = (UINT8 *)((UINTN)CoreData->HobList.Raw & CACHE_MODE_ADDRESS_MASK);\r
57\r
58 //\r
59 // Change the PHIT pointer value to cache mode\r
60 //\r
61 Phit = CoreData->HobList.HandoffInformationTable;\r
62\r
63 Phit->EfiMemoryTop = Phit->EfiMemoryTop & CACHE_MODE_ADDRESS_MASK;\r
64 Phit->EfiFreeMemoryTop = Phit->EfiFreeMemoryTop & CACHE_MODE_ADDRESS_MASK;\r
65 Phit->EfiMemoryBottom = Phit->EfiMemoryBottom & CACHE_MODE_ADDRESS_MASK;\r
66 Phit->EfiFreeMemoryBottom = Phit->EfiFreeMemoryBottom & CACHE_MODE_ADDRESS_MASK;\r
67 Phit->EfiEndOfHobList = Phit->EfiEndOfHobList & CACHE_MODE_ADDRESS_MASK;\r
68 }\r
69\r
70 return;\r
71}\r