]> git.proxmox.com Git - mirror_edk2.git/blob - OldMdePkg/Library/PeiServicesTablePointerLibKr1/PeiServicesTablePointer.c
AsmReadKr1 is already defined in the baselib
[mirror_edk2.git] / OldMdePkg / Library / PeiServicesTablePointerLibKr1 / PeiServicesTablePointer.c
1 /*++
2
3 Copyright (c) 2006 Intel Corporation. All rights reserved
4 This software and associated documentation (if any) is furnished
5 under a license and may only be used or copied in accordance
6 with the terms of the license. Except as permitted by such
7 license, no part of this software or documentation may be
8 reproduced, stored in a retrieval system, or transmitted in any
9 form or by any means without the express written consent of
10 Intel Corporation.
11
12
13 Module Name:
14
15 PeiServicesTablePointer.c
16
17 Abstract:
18
19 PEI Services Table Pointer Library.
20
21 --*/
22
23 /**
24 The function returns the pointer to PeiServices.
25
26 The function returns the pointer to PeiServices.
27 It will ASSERT() if the pointer to PeiServices is NULL.
28
29 @retval The pointer to PeiServices.
30
31 **/
32 EFI_PEI_SERVICES **
33 EFIAPI
34 GetPeiServicesTablePointer (
35 VOID
36 )
37 {
38 EFI_PEI_SERVICES **PeiServices;
39
40 PeiServices = (EFI_PEI_SERVICES **)(UINTN)AsmReadKr1 ();
41 ASSERT (PeiServices != NULL);
42 return PeiServices;
43 }
44
45 /**
46 The constructor function caches the pointer to PEI services.
47
48 The constructor function caches the pointer to PEI services.
49 It will always return EFI_SUCCESS.
50
51 @param FfsHeader Pointer to FFS header the loaded driver.
52 @param PeiServices Pointer to the PEI services.
53
54 @retval EFI_SUCCESS The constructor always returns EFI_SUCCESS.
55
56 **/
57 EFI_STATUS
58 EFIAPI
59 PeiServicesTablePointerLibConstructor (
60 IN EFI_FFS_FILE_HEADER *FfsHeader,
61 IN EFI_PEI_SERVICES **PeiServices
62 )
63 {
64 AsmWriteKr1 ((UINT64)(UINTN)PeiServices);
65 return EFI_SUCCESS;
66 }