3 Copyright (c) 2006, Intel Corporation
4 All rights reserved. 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
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.
18 Ipf CAR specific function used to switch to cache mode for the later memory access
24 #include "IpfPeiMain.h"
25 #include "IpfCpuCore.i"
29 IN PEI_CORE_INSTANCE
*CoreData
35 Switch the PHIT pointers to cache mode after InstallPeiMemory in CAR.
39 CoreData - The PEI core Private Data
45 EFI_HOB_HANDOFF_INFO_TABLE
*Phit
;
47 if (CoreData
== NULL
) {
49 // the first call with CoreData as NULL.
54 if ((GetHandOffStatus().r10
& 0xFF) == RecoveryFn
) {
55 CoreData
->StackBase
= CoreData
->StackBase
& CACHE_MODE_ADDRESS_MASK
;
56 CoreData
->HobList
.Raw
= (UINT8
*)((UINTN
)CoreData
->HobList
.Raw
& CACHE_MODE_ADDRESS_MASK
);
59 // Change the PHIT pointer value to cache mode
61 Phit
= CoreData
->HobList
.HandoffInformationTable
;
63 Phit
->EfiMemoryTop
= Phit
->EfiMemoryTop
& CACHE_MODE_ADDRESS_MASK
;
64 Phit
->EfiFreeMemoryTop
= Phit
->EfiFreeMemoryTop
& CACHE_MODE_ADDRESS_MASK
;
65 Phit
->EfiMemoryBottom
= Phit
->EfiMemoryBottom
& CACHE_MODE_ADDRESS_MASK
;
66 Phit
->EfiFreeMemoryBottom
= Phit
->EfiFreeMemoryBottom
& CACHE_MODE_ADDRESS_MASK
;
67 Phit
->EfiEndOfHobList
= Phit
->EfiEndOfHobList
& CACHE_MODE_ADDRESS_MASK
;