From 9f73d38da4a01da1c5ff6679565d426f1c4bbe98 Mon Sep 17 00:00:00 2001 From: vanjeff Date: Thu, 20 Jul 2006 04:00:59 +0000 Subject: [PATCH 1/1] added some comments in BaseLib git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@1053 6f19259b-4bc3-4df7-8a09-765794883524 --- MdePkg/Include/Library/DxeServicesTableLib.h | 16 ++++++------ .../Library/UefiBootServicesTableLib.h | 24 ++++++++++++------ .../Library/UefiRuntimeServicesTableLib.h | 16 ++++++------ .../DxeServicesTableLib/DxeServicesTableLib.c | 25 +++++++++++-------- .../UefiRuntimeServicesTableLib.c | 21 +++++++--------- 5 files changed, 56 insertions(+), 46 deletions(-) diff --git a/MdePkg/Include/Library/DxeServicesTableLib.h b/MdePkg/Include/Library/DxeServicesTableLib.h index b3aa42b127..fc39725c92 100644 --- a/MdePkg/Include/Library/DxeServicesTableLib.h +++ b/MdePkg/Include/Library/DxeServicesTableLib.h @@ -1,14 +1,14 @@ /** @file Library that provides a global pointer to the DXE Services Table - Copyright (c) 2006, Intel Corporation - All rights reserved. This program and the accompanying materials - are licensed and made available under the terms and conditions of the BSD License - which accompanies this distribution. The full text of the license may be found at - http://opensource.org/licenses/bsd-license.php + Copyright (c) 2006, Intel Corporation + All rights reserved. This program and the accompanying materials + are licensed and made available under the terms and conditions of the BSD License + which accompanies this distribution. The full text of the license may be found at + http://opensource.org/licenses/bsd-license.php - THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, - WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. + THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, + WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. Module Name: DxeServicesTableLib.h @@ -18,7 +18,7 @@ #define __DXE_SERVICES_TABLE_LIB_H__ // -// +// Cached copy of the System Configuration Table // extern EFI_DXE_SERVICES *gDS; diff --git a/MdePkg/Include/Library/UefiBootServicesTableLib.h b/MdePkg/Include/Library/UefiBootServicesTableLib.h index 73a2e39a5d..df900a7ece 100644 --- a/MdePkg/Include/Library/UefiBootServicesTableLib.h +++ b/MdePkg/Include/Library/UefiBootServicesTableLib.h @@ -1,14 +1,14 @@ /** @file Library that provides a global pointer to the UEFI Boot Services Tables - Copyright (c) 2006, Intel Corporation - All rights reserved. This program and the accompanying materials - are licensed and made available under the terms and conditions of the BSD License - which accompanies this distribution. The full text of the license may be found at - http://opensource.org/licenses/bsd-license.php + Copyright (c) 2006, Intel Corporation + All rights reserved. This program and the accompanying materials + are licensed and made available under the terms and conditions of the BSD License + which accompanies this distribution. The full text of the license may be found at + http://opensource.org/licenses/bsd-license.php - THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, - WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. + THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, + WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. Module Name: UefiBootServicesTableLib.h @@ -18,10 +18,18 @@ #define __UEFI_BOOT_SERVICES_TABLE_LIB_H__ // -// +// Cache the Image Handle // extern EFI_HANDLE gImageHandle; + +// +// Cache pointer to the EFI System Table +// extern EFI_SYSTEM_TABLE *gST; + +// +// Cache pointer to the EFI Boot Services Table +// extern EFI_BOOT_SERVICES *gBS; #endif diff --git a/MdePkg/Include/Library/UefiRuntimeServicesTableLib.h b/MdePkg/Include/Library/UefiRuntimeServicesTableLib.h index d1dfe43710..4f1ce3a1f8 100644 --- a/MdePkg/Include/Library/UefiRuntimeServicesTableLib.h +++ b/MdePkg/Include/Library/UefiRuntimeServicesTableLib.h @@ -1,14 +1,14 @@ /** @file Library that provides a global pointer to the UEFI Runtime Services Tables - Copyright (c) 2006, Intel Corporation - All rights reserved. This program and the accompanying materials - are licensed and made available under the terms and conditions of the BSD License - which accompanies this distribution. The full text of the license may be found at - http://opensource.org/licenses/bsd-license.php + Copyright (c) 2006, Intel Corporation + All rights reserved. This program and the accompanying materials + are licensed and made available under the terms and conditions of the BSD License + which accompanies this distribution. The full text of the license may be found at + http://opensource.org/licenses/bsd-license.php - THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, - WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. + THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, + WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. Module Name: UefiRuntimeServicesTableLib.h @@ -18,7 +18,7 @@ #define __UEFI_RUNTIME_SERVICES_TABLE_LIB_H__ // -// +// Cached copy of the EFI Runtime Services Table // extern EFI_RUNTIME_SERVICES *gRT; diff --git a/MdePkg/Library/DxeServicesTableLib/DxeServicesTableLib.c b/MdePkg/Library/DxeServicesTableLib/DxeServicesTableLib.c index 40d4f641a4..fac2dde8dc 100644 --- a/MdePkg/Library/DxeServicesTableLib/DxeServicesTableLib.c +++ b/MdePkg/Library/DxeServicesTableLib/DxeServicesTableLib.c @@ -2,33 +2,35 @@ DXE Library. Copyright (c) 2006, Intel Corporation
- All rights reserved. This program and the accompanying materials - are licensed and made available under the terms and conditions of the BSD License - which accompanies this distribution. The full text of the license may be found at - http://opensource.org/licenses/bsd-license.php + All rights reserved. This program and the accompanying materials + are licensed and made available under the terms and conditions of the BSD License + which accompanies this distribution. The full text of the license may be found at + http://opensource.org/licenses/bsd-license.php - THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, - WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. + THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, + WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. Module Name: DxeServicesTableLib.c **/ - +// +// Cached copy of the System Configuration Table +// EFI_DXE_SERVICES *gDS = NULL; /** The constructor function caches the pointer of System Configuration Table. - - The constructor function caches the pointer of System Configuration Table. + + The constructor function caches the pointer of System Configuration Table. It will ASSERT() if that operation fails. It will ASSERT() if the pointer of System Configuration Table is NULL. It will always return EFI_SUCCESS. @param ImageHandle The firmware allocated handle for the EFI image. @param SystemTable A pointer to the EFI System Table. - + @retval EFI_SUCCESS The constructor always returns EFI_SUCCESS. **/ @@ -40,6 +42,9 @@ DxeServicesTableLibConstructor ( { EFI_STATUS Status; + // + // Cached copy of the System Configuration Table + // Status = EfiGetSystemConfigurationTable (&gEfiDxeServicesTableGuid, (VOID **) &gDS); ASSERT_EFI_ERROR (Status); ASSERT (gDS != NULL); diff --git a/MdePkg/Library/UefiRuntimeServicesTableLib/UefiRuntimeServicesTableLib.c b/MdePkg/Library/UefiRuntimeServicesTableLib/UefiRuntimeServicesTableLib.c index bd996ba8b5..bf15467bbe 100644 --- a/MdePkg/Library/UefiRuntimeServicesTableLib/UefiRuntimeServicesTableLib.c +++ b/MdePkg/Library/UefiRuntimeServicesTableLib/UefiRuntimeServicesTableLib.c @@ -2,33 +2,30 @@ UEFI Runtime Services Table Library. Copyright (c) 2006, Intel Corporation
- All rights reserved. This program and the accompanying materials - are licensed and made available under the terms and conditions of the BSD License - which accompanies this distribution. The full text of the license may be found at - http://opensource.org/licenses/bsd-license.php + All rights reserved. This program and the accompanying materials + are licensed and made available under the terms and conditions of the BSD License + which accompanies this distribution. The full text of the license may be found at + http://opensource.org/licenses/bsd-license.php - THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, - WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. + THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, + WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. Module Name: UefiRuntimeServicesTableLib.c **/ -// -// Cached copy of the EFI Runtime Services Table -// EFI_RUNTIME_SERVICES *gRT = NULL; /** The constructor function caches the pointer of Runtime Services Table. - - The constructor function caches the pointer of Runtime Services Table. + + The constructor function caches the pointer of Runtime Services Table. It will ASSERT() if the pointer of Runtime Services Table is NULL. It will always return EFI_SUCCESS. @param ImageHandle The firmware allocated handle for the EFI image. @param SystemTable A pointer to the EFI System Table. - + @retval EFI_SUCCESS The constructor always returns EFI_SUCCESS. **/ -- 2.39.2