]> git.proxmox.com Git - mirror_edk2.git/blame - EdkCompatibilityPkg/Foundation/Library/EdkIIGlueLib/Library/UefiBootServicesTableLib/UefiBootServicesTableLib.c
Save segment registers on stack in case the thunk code assembly calls CF9 soft reset...
[mirror_edk2.git] / EdkCompatibilityPkg / Foundation / Library / EdkIIGlueLib / Library / UefiBootServicesTableLib / UefiBootServicesTableLib.c
CommitLineData
3eb9473e 1/*++\r
2\r
3Copyright (c) 2004 - 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
12\r
13Module Name:\r
14\r
15 UefiBootServicesTableLib.c\r
16 \r
17Abstract: \r
18\r
19 UEFI Boot Services Table Library.\r
20\r
21--*/\r
22\r
23#include "EdkIIGlueUefi.h"\r
24\r
3eb9473e 25EFI_SYSTEM_TABLE *gST;\r
26EFI_BOOT_SERVICES *gBS;\r
27\r
28/**\r
29 The constructor function caches the pointer of Boot Services Table.\r
30 \r
31 The constructor function caches the pointer of Boot Services Table through System Table.\r
32 It will ASSERT() if the pointer of System Table is NULL.\r
33 It will ASSERT() if the pointer of Boot Services Table is NULL.\r
34 It will always return EFI_SUCCESS.\r
35\r
36 @param ImageHandle The firmware allocated handle for the EFI image.\r
37 @param SystemTable A pointer to the EFI System Table.\r
38\r
39 @retval EFI_SUCCESS The constructor always returns EFI_SUCCESS.\r
40\r
41**/\r
42EFI_STATUS\r
43EFIAPI\r
44UefiBootServicesTableLibConstructor (\r
45 IN EFI_HANDLE ImageHandle,\r
46 IN EFI_SYSTEM_TABLE *SystemTable\r
47 )\r
48{\r
3eb9473e 49 //\r
50 // Cache pointer to the EFI System Table\r
51 //\r
52 gST = SystemTable;\r
53 ASSERT (gST != NULL);\r
54\r
55 //\r
56 // Cache pointer to the EFI Boot Services Table\r
57 //\r
58 gBS = SystemTable->BootServices;\r
59 ASSERT (gBS != NULL);\r
60\r
61 return EFI_SUCCESS;\r
62}\r