]> git.proxmox.com Git - mirror_edk2.git/blame - MdePkg/Library/PeiServicesTablePointerLibKr7/PeiServicesTablePointer.c
Re-defined PCD_INVALID_TOKEN_NUMBER in header files of PCD Ppi&Protocol, since it...
[mirror_edk2.git] / MdePkg / Library / PeiServicesTablePointerLibKr7 / PeiServicesTablePointer.c
CommitLineData
bf231ea6 1/** @file\r
37f259c9 2 PEI Services Table Pointer Library implementation for IPF that uses Kernel\r
bf231ea6 3 Register 7 to store the pointer.\r
c7d265a9 4\r
076a01da 5 Copyright (c) 2006 - 2008, Intel Corporation.<BR>\r
37f259c9 6 All rights reserved. This program and the accompanying materials\r
7 are licensed and made available under the terms and conditions of the BSD License\r
8 which accompanies this distribution. The full text of the license may be found at\r
9 http://opensource.org/licenses/bsd-license.php\r
c7d265a9 10\r
37f259c9 11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
12 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
c7d265a9 13\r
bf231ea6 14**/\r
c7d265a9 15\r
37f259c9 16#include <PiPei.h>\r
c7d265a9 17#include <Library/BaseLib.h>\r
37f259c9 18#include <Library/DebugLib.h>\r
c7d265a9 19\r
20/**\r
21 The function returns the pointer to PeiServices.\r
22\r
23 The function returns the pointer to PeiServices.\r
24 It will ASSERT() if the pointer to PeiServices is NULL.\r
25\r
373b5cf9 26 @return The pointer to PeiServices.\r
c7d265a9 27\r
28**/\r
5240b97c 29CONST EFI_PEI_SERVICES **\r
c7d265a9 30EFIAPI\r
31GetPeiServicesTablePointer (\r
32 VOID\r
33 )\r
34{\r
5240b97c 35 CONST EFI_PEI_SERVICES **PeiServices;\r
c7d265a9 36\r
5240b97c 37 PeiServices = (CONST EFI_PEI_SERVICES **)(UINTN)AsmReadKr7 ();\r
c7d265a9 38 ASSERT (PeiServices != NULL);\r
39 return PeiServices;\r
40}\r
41\r
61296d0d 42/**\r
076a01da 43 The function set the pointer of PEI services in KR7 register \r
61296d0d 44 according to PI specification.\r
45 \r
42eedea9 46 @param PeiServicesTablePointer The address of PeiServices pointer.\r
61296d0d 47**/\r
48VOID\r
49EFIAPI\r
50SetPeiServicesTablePointer (\r
f944ec32 51 IN EFI_PEI_SERVICES ** PeiServicesTablePointer\r
61296d0d 52 )\r
53{\r
58dcdada 54 AsmWriteKr7 ((UINT64)(UINTN)PeiServicesTablePointer);\r
61296d0d 55}\r
56 \r
58dcdada 57\r
81c7803c 58\r
10e53a28 59\r